/* ============================================================
   Kit Takip Sistemi – arayüz
   Mobil öncelikli, kurumsal görünüm. Tek dosya, harici font yok.
   ============================================================ */

:root {
  color-scheme: light;

  /* Kurumsal lacivert */
  --navy-900: #0b1c33;
  --navy-800: #102741;
  --navy-700: #16365a;
  --navy-600: #1d4676;

  /* Etkileşim */
  --blue: #1f6feb;
  --blue-dark: #1a5fcc;
  --blue-soft: #eaf1fd;

  /* Durumlar */
  --green: #0d8a55;
  --green-dark: #0a7346;
  --green-soft: #e6f5ee;
  --amber: #a86000;
  --amber-soft: #fdf1e0;
  --red: #c8372d;
  --red-soft: #fdeceb;

  /* Yüzeyler */
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e5eaf1;
  --line-strong: #d4dce7;

  /* Yazı */
  --ink: #0f2340;
  --ink-2: #3d5372;
  --muted: #6b7f9a;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;

  --sh-1: 0 1px 2px rgba(11, 28, 51, .05), 0 2px 8px rgba(11, 28, 51, .05);
  --sh-2: 0 2px 6px rgba(11, 28, 51, .07), 0 10px 28px rgba(11, 28, 51, .08);
  --sh-nav: 0 -1px 0 var(--line), 0 -8px 24px rgba(11, 28, 51, .06);

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 60px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--blue); }
[hidden] { display: none !important; }
::selection { background: var(--blue-soft); }

/* ---------- uygulama çubuğu ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-900) 100%);
  color: #fff;
  padding: calc(10px + var(--safe-t)) 16px 10px;
}
.appbar-row { display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto; }
.appbar .mark {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: rgba(255, 255, 255, .13);
  display: grid; place-items: center; font-size: 18px;
  border: 1px solid rgba(255, 255, 255, .16);
}
.appbar .titles { min-width: 0; flex: 1; }
.appbar .t1 { font-size: 16px; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.appbar .t2 {
  font-size: 12px; color: rgba(255, 255, 255, .62); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.appbar .user {
  display: flex; align-items: center; gap: 8px; flex: none;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px; padding: 5px 6px 5px 12px; max-width: 52vw;
}
.appbar .user .nm {
  font-size: 13px; font-weight: 600; color: #fff; max-width: 34vw;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.appbar .user .out {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 13px;
  display: grid; place-items: center;
}
.appbar .user .out:active { background: rgba(255, 255, 255, .28); }

/* ilerleme şeridi */
.appbar-prog { max-width: 760px; margin: 12px auto 2px; }
.appbar-prog .bar { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.appbar-prog .bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: #34d39a; transition: width .4s ease; }
.appbar-prog .lbl {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-size: 11.5px; color: rgba(255, 255, 255, .66); font-variant-numeric: tabular-nums;
}
.appbar-prog .lbl b { color: #fff; font-weight: 700; }

/* ---------- sayfa ---------- */
.page {
  max-width: 760px; margin: 0 auto;
  padding: 14px 14px calc(var(--nav-h) + var(--safe-b) + 24px);
}
.page.no-nav { padding-bottom: calc(24px + var(--safe-b)); }

.card {
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-1);
  padding: 16px; margin-bottom: 12px; border: 1px solid var(--line);
}
.card > h2 { margin: 0 0 14px; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.card h3 {
  margin: 20px 0 8px; font-size: 11.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.sub-note { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

/* ---------- alt menü ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  box-shadow: var(--sh-nav);
  padding-bottom: var(--safe-b);
  display: flex;
}
.bottomnav a, .bottomnav button {
  flex: 1; height: var(--nav-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600;
  position: relative; transition: color .15s;
}
.bottomnav .ic { font-size: 20px; line-height: 1; }
.bottomnav .on { color: var(--blue); }
.bottomnav .on::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--blue);
}
.bottomnav a:active, .bottomnav button:active { background: var(--bg); }

/* ---------- arama ---------- */
.searchwrap {
  position: sticky; top: 0; z-index: 30;
  margin: -14px -14px 12px; padding: 12px 14px;
  background: linear-gradient(var(--bg) 78%, rgba(244, 246, 249, 0));
}
.segbar {
  display: flex; gap: 4px; background: #e9edf3; border-radius: 999px; padding: 4px; margin-bottom: 10px;
}
.seg {
  flex: 1; height: 36px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, color .15s;
}
.seg.on { background: #fff; color: var(--navy-800); box-shadow: 0 1px 3px rgba(11, 28, 51, .12); }

.searchbox { position: relative; }
.searchbox input {
  width: 100%; height: 52px; padding: 0 46px 0 44px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r);
  background: #fff; font-size: 16.5px; font-weight: 500; box-shadow: var(--sh-1);
  transition: border-color .15s, box-shadow .15s;
}
.searchbox input::placeholder { color: #97a8bf; font-weight: 400; }
.searchbox input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 111, 235, .13); }
.searchbox input[inputmode="numeric"] { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.searchbox .ic {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  font-size: 17px; color: var(--muted); pointer-events: none;
}
.searchbox .clear {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%; background: #e9edf3; color: var(--ink-2);
  display: grid; place-items: center; font-size: 15px;
}
.searchbox .clear:active { background: var(--line-strong); }
.searchhint { color: var(--muted); font-size: 12.5px; margin: 9px 2px 0; }

/* ---------- sporcu kartı ---------- */
.runner {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-1); margin-bottom: 10px; overflow: hidden;
}
.runner .top { display: flex; gap: 12px; padding: 14px 14px 12px; align-items: flex-start; }
.runner .rn-info { flex: 1; min-width: 0; }
.runner .nm {
  font-size: 17.5px; font-weight: 700; line-height: 1.2; letter-spacing: -0.015em;
  word-break: break-word;
}
.runner .meta { display: flex; flex-wrap: wrap; gap: 5px 8px; margin-top: 8px; }
.runner .meta .mi {
  font-size: 12px; color: var(--ink-2); background: #f2f5f9; border-radius: 7px; padding: 3px 8px;
  white-space: nowrap;
}
.runner .meta .mi b { font-weight: 700; color: var(--ink); }
.runner .size {
  flex: none; width: 62px; border-radius: var(--r-sm); text-align: center;
  background: var(--blue-soft); border: 1px solid #d3e2fb; padding: 7px 4px 8px;
}
.runner .size .k { font-size: 9.5px; font-weight: 700; letter-spacing: .09em; color: #4b7ac4; }
.runner .size .v { font-size: 22px; font-weight: 800; color: #14509e; line-height: 1.05; margin-top: 1px; }
.runner .foot { padding: 0 14px 14px; }

.btn-deliver {
  width: 100%; height: 52px; border-radius: var(--r);
  background: linear-gradient(180deg, #10a065 0%, var(--green) 100%);
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: -0.01em;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: 0 2px 8px rgba(13, 138, 85, .3);
  transition: transform .08s, box-shadow .15s, opacity .15s;
}
.btn-deliver:active { transform: scale(.985); box-shadow: 0 1px 4px rgba(13, 138, 85, .3); }
.btn-deliver:disabled { opacity: .6; }

.runner.done { border-color: #cbe8da; background: linear-gradient(180deg, #fbfefc 0%, #ffffff 60%); }
.delivered-strip {
  display: flex; align-items: center; gap: 10px;
  background: var(--green-soft); border: 1px solid #cbe8da; border-radius: var(--r);
  padding: 11px 12px;
}
.delivered-strip .tick {
  width: 28px; height: 28px; border-radius: 50%; flex: none; background: var(--green); color: #fff;
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
.delivered-strip .txt { flex: 1; min-width: 0; }
.delivered-strip .txt b { display: block; font-size: 14px; color: #0a6b43; font-weight: 700; }
.delivered-strip .txt span { font-size: 12px; color: #4e8a6f; }
.btn-undo {
  flex: none; font-size: 12.5px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 10px; background: #fff;
}
.btn-undo:active { background: var(--bg); }

/* ---------- boş / yükleniyor ---------- */
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty .em { font-size: 36px; opacity: .5; display: block; margin-bottom: 10px; }
.empty b { display: block; color: var(--ink-2); font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.empty small { font-size: 13px; }
.skel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; margin-bottom: 10px; }
.skel i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #eef1f6, #e3e8f0, #eef1f6); background-size: 200% 100%; animation: sh 1.2s infinite; }
.skel i + i { margin-top: 9px; width: 55%; }
@keyframes sh { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- giriş ---------- */
.auth {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 24px 18px calc(30px + var(--safe-b)); max-width: 460px; margin: 0 auto;
}
.auth .brand { text-align: center; margin-bottom: 22px; }
.auth .brand .mark {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 19px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  display: grid; place-items: center; font-size: 30px;
  box-shadow: 0 8px 22px rgba(16, 39, 65, .26);
}
.auth .brand h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.auth .brand p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }

label.fld { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 0 0 7px; }
label.fld + .input, label.fld + select.input { margin-bottom: 15px; }
.input {
  width: 100%; height: 50px; padding: 0 14px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r); background: #fff; font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
select.input { appearance: none; -webkit-appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7f9a' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
textarea.input { height: auto; padding: 12px 14px; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 111, 235, .13); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 18px; border-radius: var(--r);
  background: var(--blue); color: #fff; font-size: 15.5px; font-weight: 700; text-decoration: none;
  transition: background .15s, transform .08s, opacity .15s;
}
.btn:active { transform: scale(.985); }
.btn:hover { background: var(--blue-dark); }
.btn:disabled { opacity: .5; }
.btn.block { width: 100%; }
.btn.lg { height: 52px; font-size: 16px; }
.btn.sm { height: 38px; padding: 0 13px; font-size: 13.5px; border-radius: 10px; }
.btn.ok { background: var(--green); }
.btn.ok:hover { background: #0a7346; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #ad2e25; }
.btn.ghost { background: #fff; color: var(--ink-2); border: 1.5px solid var(--line-strong); }
.btn.ghost:hover { background: var(--bg); }
.btn.quiet { background: transparent; color: var(--blue); }

.error, .info, .warn {
  font-size: 13.5px; padding: 11px 13px; border-radius: var(--r-sm); margin-top: 12px; line-height: 1.4;
}
.error { color: #a92f26; background: var(--red-soft); border: 1px solid #f5d2cf; }
.info { color: #0a6b43; background: var(--green-soft); border: 1px solid #cbe8da; }
.warn { color: var(--amber); background: var(--amber-soft); border: 1px solid #f5e0c2; }

/* ---------- istatistik ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 8px; text-align: center; }
.stat .v { font-size: 25px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11.5px; color: var(--muted); margin-top: 3px; font-weight: 500; }
.stat.is-ok { background: var(--green-soft); border-color: #cbe8da; } .stat.is-ok .v { color: var(--green); }
.stat.is-warn { background: var(--amber-soft); border-color: #f5e0c2; } .stat.is-warn .v { color: var(--amber); }

.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td b { font-weight: 700; }

.bar-cell { display: flex; align-items: center; gap: 8px; }
.bar-mini { flex: 1; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; min-width: 40px; }
.bar-mini i { display: block; height: 100%; background: var(--green); border-radius: 999px; }

.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.warn { background: var(--amber-soft); color: var(--amber); }
.tag.danger { background: var(--red-soft); color: var(--red); }

.row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.row .input { flex: 1; min-width: 150px; }

/* ---------- teslim kayıtları ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters .searchbox { flex: 1; min-width: 180px; }
.filters .searchbox input { height: 46px; font-size: 15.5px; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.chip {
  border: 1.5px solid var(--line-strong); background: #fff; border-radius: 999px;
  padding: 7px 13px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip .n {
  font-size: 11.5px; font-weight: 700; background: var(--bg); color: var(--muted);
  border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.chip.on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.chip.on .n { background: rgba(255, 255, 255, .2); color: #fff; }

.rec {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--green);
  border-radius: var(--r); box-shadow: var(--sh-1); padding: 11px 13px; margin-bottom: 8px;
  display: flex; gap: 12px; align-items: center;
}
.rec .time {
  flex: none; text-align: center; min-width: 44px; font-variant-numeric: tabular-nums;
}
.rec .time b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.rec .time span { font-size: 11px; color: var(--muted); }
.rec .mid { flex: 1; min-width: 0; }
.rec .mid .nm { font-size: 15.5px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.rec .mid .sb { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: var(--muted); }
.rec .mid .sb b { color: var(--ink-2); font-weight: 700; }
.rec .by { flex: none; text-align: right; max-width: 38%; }
.rec .by span { font-size: 10.5px; color: var(--muted); display: block; }
.rec .by b {
  font-size: 13px; font-weight: 700; color: var(--green); line-height: 1.25;
  display: block; word-break: break-word;
}

/* ---------- yönetim ---------- */
.appr {
  border: 1px solid var(--line); border-radius: var(--r); padding: 13px; margin-bottom: 10px; background: #fff;
}
.appr .hd { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.appr .nm { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.appr .pw {
  font-size: 13px; color: var(--muted); margin-top: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.appr .pw b { color: var(--ink); }
.appr .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line);
}
.badge.on { background: var(--green-soft); color: var(--green); border-color: #cbe8da; }
.badge.off { background: var(--red-soft); color: var(--red); border-color: #f5d2cf; }

.perm { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.perm label {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 9px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--bg);
}
.perm label:has(input:checked) { background: var(--blue-soft); border-color: #c5daf9; color: #14509e; }
.perm input { width: 17px; height: 17px; accent-color: var(--blue); margin: 0; }

/* ---------- ana ekrana ekle ---------- */
.install {
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900)); color: #fff;
  border-radius: var(--r-lg); padding: 14px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  box-shadow: var(--sh-2);
}
.install .txt { flex: 1; min-width: 190px; }
.install .txt b { display: block; font-size: 14.5px; font-weight: 700; }
.install .txt span { font-size: 12.5px; color: rgba(255, 255, 255, .7); }
.install .btn { background: #fff; color: var(--navy-800); height: 40px; font-size: 14px; }
.install .btn:hover { background: #eef2f7; }
.install .close { width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 15px; }
.ios-steps { font-size: 12.5px; color: rgba(255, 255, 255, .78); margin-top: 7px; line-height: 1.6; }
.ios-steps kbd {
  background: rgba(255, 255, 255, .16); padding: 2px 7px; border-radius: 5px;
  font-family: inherit; font-size: 12px; font-weight: 600;
}

/* ---------- bildirim / çevrimdışı ---------- */
.offline {
  background: var(--amber-soft); color: var(--amber); text-align: center;
  font-size: 12.5px; padding: 8px; font-weight: 600; border-bottom: 1px solid #f5e0c2;
  position: sticky; top: 0; z-index: 60;
}
.toast {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(10px);
  bottom: calc(var(--nav-h) + var(--safe-b) + 14px); z-index: 70;
  background: var(--navy-900); color: #fff; padding: 12px 18px; border-radius: 999px;
  font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(11, 28, 51, .3);
  max-width: 90vw; text-align: center; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }
.toast.no-nav { bottom: calc(var(--safe-b) + 20px); }

/* ---------- masaüstü ---------- */
@media (min-width: 720px) {
  body { font-size: 15.5px; }
  .page { padding: 20px 20px calc(var(--nav-h) + 30px); }
  .bottomnav { position: sticky; bottom: 0; border-radius: 0; }
  .stat .v { font-size: 30px; }
  .runner .top { padding: 16px 16px 14px; }
}
@media (min-width: 900px) {
  .bottomnav { max-width: 760px; margin: 0 auto; border-radius: var(--r-lg) var(--r-lg) 0 0; }
}
