/* kurye-core · Operasyon Ekranı
   Tasarım dili: SEVKİYAT KONSOLU. Katı yüzeyler (cam/blur yok — yalnız modal
   scrim'inde), düz dolgulu durum göstergeleri (parlama yok), mono-öne-çıkan
   manifesto tipografisi (sipariş no/mesafe/tutar hep tabular mono), tek marka
   rengi (indigo — hem birincil eylem hem "atandı" durumu). Gerçek açık/koyu
   tema çifti: biri diğerinin tersi değil, ikisi de kendi kimliğinde.

   TİPOGRAFİ: IBM Plex superfamily (self-host, web/static/fonts). Plex Sans =
   gövde/etiket (mühendislik/endüstriyel DNA, karakterli ama gürültüsüz), Plex
   Mono = tüm sayılar (lojistik alette tabular sayı için tematik). Tek aile =
   kasıtlı; "rastgele iki font" izlenimi yok. latin + latin-ext (Türkçe ş/ğ/İ). */

/* --- IBM Plex Sans --- */
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:400; font-display:swap;
  src:url(fonts/plex-sans-400.woff2) format("woff2");
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:400; font-display:swap;
  src:url(fonts/plex-sans-ext-400.woff2) format("woff2");
  unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:500; font-display:swap;
  src:url(fonts/plex-sans-500.woff2) format("woff2");
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:500; font-display:swap;
  src:url(fonts/plex-sans-ext-500.woff2) format("woff2");
  unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:600; font-display:swap;
  src:url(fonts/plex-sans-600.woff2) format("woff2");
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:600; font-display:swap;
  src:url(fonts/plex-sans-ext-600.woff2) format("woff2");
  unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:700; font-display:swap;
  src:url(fonts/plex-sans-700.woff2) format("woff2");
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:700; font-display:swap;
  src:url(fonts/plex-sans-ext-700.woff2) format("woff2");
  unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* --- IBM Plex Mono (sayılar) --- */
@font-face { font-family:"IBM Plex Mono"; font-style:normal; font-weight:500; font-display:swap;
  src:url(fonts/plex-mono-500.woff2) format("woff2");
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:"IBM Plex Mono"; font-style:normal; font-weight:500; font-display:swap;
  src:url(fonts/plex-mono-ext-500.woff2) format("woff2");
  unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:"IBM Plex Mono"; font-style:normal; font-weight:600; font-display:swap;
  src:url(fonts/plex-mono-600.woff2) format("woff2");
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:"IBM Plex Mono"; font-style:normal; font-weight:600; font-display:swap;
  src:url(fonts/plex-mono-ext-600.woff2) format("woff2");
  unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* ---------- AÇIK TEMA (varsayılan) ---------- */
:root {
  --bg:        #EEF1F5;
  --surface:   #FFFFFF;
  --surface-2: #E1E5EC;   /* rail, toolbar, sheet başlığı */
  --surface-3: #F4F6F9;   /* hover tonu */
  --ink:       #12161F;
  --ink-2:     #454D5C;
  --ink-3:     #6B7383;
  --line:      #D9DEE6;
  --line-2:    #C5CBD6;

  --accent:       #2451D6;
  --accent-ink:   #1B3EAA;   /* koyu metin/ikon üstü accent (açık zeminde) */
  --accent-weak:  rgba(36,81,214,.10);

  --amber:      #B7791F;  --amber-bg:  #FBF1DD;  --amber-ink: #8A5A14;
  --green:      #1E8E4F;  --green-bg:  #E4F5EA;  --green-ink: #146238;
  --red:        #D23B2E;  --red-bg:    #FBE7E5;  --red-ink:   #A32A20;
  --blue:       var(--accent); --blue-bg: var(--accent-weak); --blue-ink: var(--accent-ink);

  --shadow: 0 1px 2px rgba(20,24,32,.05), 0 10px 28px rgba(20,24,32,.08);
  --scrim:  rgba(10,12,16,.42);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #10141C;
    --surface:   #171C27;
    --surface-2: #0D1119;
    --surface-3: #212838;
    --ink:       #EAEDF3;
    --ink-2:     #B2B9C8;
    --ink-3:     #868E9F;
    --line:      rgba(255,255,255,.09);
    --line-2:    rgba(255,255,255,.15);

    --accent:      #3E63E0;
    --accent-ink:  #A9BBFF;
    --accent-weak: rgba(108,140,255,.16);

    --amber: #E8A23D; --amber-bg: rgba(232,162,61,.14); --amber-ink: #F0B85C;
    --green: #3FCB7A; --green-bg: rgba(63,203,122,.14); --green-ink: #6BDB9B;
    --red:   #F1584B; --red-bg:   rgba(241,88,75,.14);  --red-ink:   #FF8478;
    --blue:  var(--accent); --blue-bg: var(--accent-weak); --blue-ink: var(--accent-ink);

    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.4);
    --scrim:  rgba(4,5,8,.6);
  }
}
/* elle seçim, sistem tercihinin İKİ yönünü de ezer */
:root[data-theme="dark"] {
  --bg: #10141C; --surface: #171C27; --surface-2: #0D1119; --surface-3: #212838;
  --ink: #EAEDF3; --ink-2: #B2B9C8; --ink-3: #868E9F;
  --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.15);
  --accent: #3E63E0; --accent-ink: #A9BBFF; --accent-weak: rgba(108,140,255,.16);
  --amber: #E8A23D; --amber-bg: rgba(232,162,61,.14); --amber-ink: #F0B85C;
  --green: #3FCB7A; --green-bg: rgba(63,203,122,.14); --green-ink: #6BDB9B;
  --red:   #F1584B; --red-bg:   rgba(241,88,75,.14);  --red-ink:   #FF8478;
  --blue:  var(--accent); --blue-bg: var(--accent-weak); --blue-ink: var(--accent-ink);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.4);
  --scrim: rgba(4,5,8,.6);
}
:root[data-theme="light"] {
  --bg: #EEF1F5; --surface: #FFFFFF; --surface-2: #E1E5EC; --surface-3: #F4F6F9;
  --ink: #12161F; --ink-2: #454D5C; --ink-3: #6B7383;
  --line: #D9DEE6; --line-2: #C5CBD6;
  --accent: #2451D6; --accent-ink: #1B3EAA; --accent-weak: rgba(36,81,214,.10);
  --amber: #B7791F; --amber-bg: #FBF1DD; --amber-ink: #8A5A14;
  --green: #1E8E4F; --green-bg: #E4F5EA; --green-ink: #146238;
  --red:   #D23B2E; --red-bg:   #FBE7E5; --red-ink:   #A32A20;
  --blue:  var(--accent); --blue-bg: var(--accent-weak); --blue-ink: var(--accent-ink);
  --shadow: 0 1px 2px rgba(20,24,32,.05), 0 10px 28px rgba(20,24,32,.08);
  --scrim: rgba(10,12,16,.42);
}

:root {
  --r:   10px;
  --r-2: 8px;
  --r-3: 6px;
  --rail-w: 60px;
  --right-w: 380px;
  --ease: cubic-bezier(.32,.72,0,1);
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.5;
  /* NETLİK: "antialiased" gövdeyi inceltip uzaktan soluk gösteriyordu; varsayılan
     render + optimizeLegibility daha kalın ve keskin bir kenar verir. */
  -webkit-font-smoothing: auto;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  transition: background-color .2s, color .2s;
}
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font-family: inherit; font-size: 15px; }
h2, h3 { margin: 0; font-weight: 600; }

.ic { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.75;
      stroke-linecap: round; stroke-linejoin: round; display: block; flex: 0 0 auto; }
.ic--muted { color: var(--ink-3); }

/* ---------- düzen: rail | sahne(toolbar+harita) | sağ çekmece ---------- */
.app {
  position: relative;
  display: flex;
  height: 100vh;
  width: 100vw;
  background: var(--bg);
}
.stage { flex: 1 1 auto; position: relative; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ---------- sol kontrol düğümü (nav) ----------
   Sabit rail yerine: haritanın üstünde yüzen camsı bir "kontrol düğümü".
   Glyph = 3×3 nokta ızgarası (harfsiz, kontrol-paneli dili); tıklanınca ×'e
   dönüşür ve camsı komut paneli açılır. Bağlantı durumu sağ-altta küçük SABİT
   bir rozette (yalnız canlı/hata belirir; bağlı değilken düğüm sade kalır). */
.nav { position: absolute; top: 16px; left: 16px; z-index: 31; }

.node {
  position: relative; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.07);
  transition: transform .18s var(--ease), box-shadow .2s, border-color .2s;
}
.node:hover { transform: scale(1.06); border-color: var(--accent);
  box-shadow: var(--shadow), 0 0 0 4px var(--accent-weak); }
.node:active { transform: scale(.97); }

/* ızgara ↔ × geçişi */
.node__glyph { position: relative; width: 20px; height: 20px; display: grid; place-items: center; }
.node__grid, .node__x {
  grid-area: 1 / 1; transition: opacity .22s var(--ease), transform .28s var(--ease);
}
.node__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 3.5px;
  width: 18px; height: 18px; place-items: center;
}
.node__grid i { width: 3.5px; height: 3.5px; border-radius: 1.5px; background: var(--ink-2); transition: background .15s; }
.node:hover .node__grid i { background: var(--ink); }
.node__x { width: 20px; height: 20px; color: var(--ink); opacity: 0; transform: rotate(-30deg) scale(.7); }
.nav[data-open="true"] .node__grid { opacity: 0; transform: rotate(30deg) scale(.7); }
.nav[data-open="true"] .node__x { opacity: 1; transform: none; }

/* bağlantı rozeti (sağ-alt): sabit, dönmez. Canlı=yeşil, hata=kırmızı; off=gizli */
.node__live {
  position: absolute; right: 5px; bottom: 5px; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--surface); background: var(--ink-3);
  opacity: 0; transform: scale(.6); transition: opacity .2s var(--ease), transform .2s var(--ease), background .2s;
}
.nav[data-state="on"]  .node__live { opacity: 1; transform: none; background: var(--green); }
.nav[data-state="err"] .node__live { opacity: 1; transform: none; background: var(--red); }

/* komut paneli */
.navpanel {
  position: absolute; top: 60px; left: 0; width: 238px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 8px;
  transform-origin: 26px -12px;
  opacity: 0; transform: scale(.9) translateY(-8px); pointer-events: none;
  transition: opacity .18s var(--ease), transform .26s var(--ease);
}
.nav[data-open="true"] .navpanel { opacity: 1; transform: none; pointer-events: auto; }

.navpanel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px 9px;
}
.navpanel__brand { font-weight: 700; font-size: 13px; letter-spacing: .02em; color: var(--ink); }
.navpanel__live { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3); }
.navpanel__live .live__dot { margin: 0; }
.nav[data-state="on"]  .navpanel__live .live__dot { background: var(--green); }
.nav[data-state="err"] .navpanel__live .live__dot { background: var(--red); }
.navpanel__sep { height: 1px; background: var(--line); margin: 6px 6px; }
.navpanel__group { display: flex; flex-direction: column; gap: 2px; }

.navitem {
  display: flex; align-items: center; gap: 11px; width: 100%;
  height: 42px; padding: 0 12px; border-radius: 10px;
  color: var(--ink-2); font-size: 14px; font-weight: 500; text-align: left;
  transition: opacity .22s var(--ease), transform .24s var(--ease), background .14s, color .14s;
  opacity: 0; transform: translateY(6px);
}
.nav[data-open="true"] .navitem { opacity: 1; transform: none; transition-delay: calc(var(--d, 0) * 32ms); }
.navitem .ic { color: var(--ink-3); transition: color .14s; }
.navitem:hover { background: var(--surface-3); color: var(--ink); }
.navitem:hover .ic { color: var(--ink); }
.navitem__l { flex: 1; }
.navitem.is-active { color: var(--ink); background: var(--accent-weak); }
.navitem.is-active .ic { color: var(--accent-ink); }
.navitem__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent); flex: 0 0 auto; }
.navitem__tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
  color: var(--ink-3); background: var(--surface-3); padding: 2px 7px; border-radius: 6px;
}
.navitem__meta { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
/* çıkış = kırmızı, bağlan = accent (JS ikisi arasında geçirir) */
.navitem--danger { color: var(--red-ink); }
.navitem--danger .ic { color: var(--red); }
.navitem--danger:hover { background: var(--red-bg); color: var(--red-ink); }
.navitem--danger:hover .ic { color: var(--red); }
.navitem--accent { color: var(--accent-ink); }
.navitem--accent .ic { color: var(--accent-ink); }
.navitem--accent:hover { background: var(--accent-weak); color: var(--accent-ink); }

/* menü açıkken haritayı hafifçe geri iten scrim (odak paneline) */
.navscrim {
  position: absolute; inset: 0; z-index: 20;
  background: color-mix(in srgb, black 12%, transparent);
  backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.nav[data-open="true"] ~ .navscrim { opacity: 1; pointer-events: auto; }

/* toast (yakında vb. kısa bildirim) */
.toast {
  position: absolute; left: 50%; bottom: 96px; z-index: 33;
  max-width: 78vw;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow);
  padding: 10px 15px; font-size: 13px; color: var(--ink); white-space: nowrap;
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .navpanel, .navitem, .toast, .node__grid, .node__x, .node__live { transition-duration: .01ms; }
  .nav[data-open="true"] .navitem { transition-delay: 0s; }
}

/* ---------- toolbar (haritanın ÜSTÜNDE değil, üzerinde bir şerit) ---------- */
/* Harita üstü kurye sayaç göstergesi: kontrol düğümüyle aynı camsı dilde,
   tam-yuvarlak uçlu bir "gösterge okuması". Bağlantı durumu artık düğümün radar
   halkasında olduğu için buradaki eski bağlantı noktası KALDIRILDI — pill yalnız
   aktif/boşta kurye sayısını taşır (üstüne gelince başlıkta bağlantı metni). */
.mapkpi {
  position: absolute; top: 23px; left: 84px; z-index: 9;
  display: flex; align-items: center; height: 36px;
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  border: 1px solid var(--line-2); border-radius: 18px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.06);
  white-space: nowrap;
}
/* .live__dot temel kuralı menü panelindeki canlı noktası için korunur */
.live__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3);
  flex: 0 0 auto; margin-right: 9px; }
.kpi { display: flex; align-items: center; gap: 7px; padding: 0 13px;
  font-size: 11.5px; color: var(--ink-3); }
.kpi::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-3); flex: 0 0 auto; }
.kpi--active::before { background: var(--accent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 60%, transparent); }
.kpi b { font-family: var(--mono); font-weight: 600; font-size: 15px; color: var(--ink);
  font-variant-numeric: tabular-nums; }
.kpi--sep { border-left: 1px solid var(--line); }

/* ---------- harita alanı ---------- */
.mapwrap { flex: 1 1 auto; position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--bg); z-index: 1; }
.leaflet-container { background: var(--bg); font-family: var(--font); }
.leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface) 82%, transparent) !important;
  color: var(--ink-3) !important; font-size: 10.5px !important;
}
.leaflet-control-attribution a { color: var(--ink-2) !important; }
/* KOYU TILE KONTRASTI: dark_all bu zoomlarda neredeyse simsiyah — hafif
   parlaklık yol ağını geri getirir, marker patlaması bozulmaz. Yalnız koyu tema. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile { filter: brightness(1.18) contrast(.95); }
}
:root[data-theme="dark"] .leaflet-tile { filter: brightness(1.18) contrast(.95); }
:root[data-theme="light"] .leaflet-tile { filter: none; }
/* Leaflet tooltip/popup panel temasına uysun (beyaz kutu koyu temada sırıtıyordu). */
.leaflet-tooltip { background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  box-shadow: var(--shadow); border-radius: var(--r-3); font-family: var(--font); font-size: 12.5px; }
.leaflet-tooltip-top:before { border-top-color: var(--surface); }
.leaflet-tooltip-bottom:before { border-bottom-color: var(--surface); }
.leaflet-tooltip-left:before { border-left-color: var(--surface); }
.leaflet-tooltip-right:before { border-right-color: var(--surface); }
.leaflet-popup-content-wrapper { background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 12px 14px; font-family: var(--font); font-size: 13.5px; line-height: 1.45; }
.leaflet-popup-close-button { color: var(--ink-3) !important; }
/* haritadan atama popup'ı */
.assignpop { min-width: 150px; }
.assignpop__t { font-weight: 600; margin-bottom: 2px; }
.assignpop__s { color: var(--ink-2); font-size: 12.5px; }
.assignpop .btn { height: 32px; width: 100%; margin-top: 8px; font-size: 14px; }

.mapctl { position: absolute; top: 82px; left: 16px; z-index: 9; display: flex; flex-direction: column; gap: 1px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); box-shadow: var(--shadow); overflow: hidden; }
.mapctl__btn {
  width: 38px; height: 38px; color: var(--ink); display: grid; place-items: center;
  transition: background .15s; border-bottom: 1px solid var(--line);
}
.mapctl__btn:last-child { border-bottom: 0; }
.mapctl__btn:hover { background: var(--surface-3); }
.mapctl__btn .ic { width: 18px; height: 18px; }
.mapctl__btn.is-active { color: var(--accent); background: var(--accent-weak); }

/* TAM EKRAN HARİTA (Javi'nin ⤢ deseni): sheet + sağ çekmece gizlenir, harita
   sahneyi kaplar. KPI pill'i haritada yüzdüğü için görünür kalır. */
#app[data-map="full"] .drawer--right,
#app[data-map="full"] .sheet,
#app[data-map="full"] .reopen,
#app[data-map="full"] .rscrim { display: none !important; }

/* Harita açıklaması (legend): sol-üstte, zoom kontrollerinin altında. Katlanır.
   top = mapctl (4 düğme × 38px + ayraçlar) + boşluk — kontrol sütununu ÖRTMEMELİ. */
/* Sağ-üst araç kolonu: Katmanlar üstte, Açıklama altında istifli. Açılınca
   aşağı doğru büyür, biri diğerini itmez (flex kolon). */
.maptools { position: absolute; top: 14px; right: 14px; z-index: 9;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  transition: right .3s var(--ease); }
#app[data-right="closed"] .maptools { right: 46px; }
.legend {
  width: 184px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2);
  box-shadow: var(--shadow); overflow: hidden;
}
.legend__head {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 11px;
  font-weight: 600; font-size: 13.5px; color: var(--ink);
}
.legend__key { width: 12px; height: 12px; border-radius: 3px;
  background: linear-gradient(135deg, var(--amber) 0 33%, var(--accent) 33% 66%, var(--green) 66%); }
.legend__head .ic { margin-left: auto; color: var(--ink-3); transform: rotate(90deg); transition: transform .2s var(--ease); }
.legend[data-open="true"] .legend__head .ic { transform: rotate(-90deg); }
.legend[data-open="false"] .legend__body { display: none; }
.legend__body { padding: 2px 11px 10px; }
.legend__grp { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: .4px; margin: 8px 0 4px; }
.legend__row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); padding: 2px 0; }
.sw { width: 13px; height: 13px; border-radius: 4px; border: 1.5px solid #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); flex: none; }
.sw--dot { width: 11px; height: 11px; border-radius: 50%; }
.sw--amber { background: var(--amber); }
.sw--blue  { background: var(--accent); }
.sw--green { background: var(--green); }
.legend__store { width: 16px; text-align: center; font-size: 12px; flex: none; }

.maplayers {
  width: 184px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2);
  box-shadow: var(--shadow); overflow: hidden;
}
.maplayers__head {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 12px;
  font-weight: 600; font-size: 14px; color: var(--ink);
}
.maplayers__head .ic:last-child { margin-left: auto; color: var(--ink-3); transform: rotate(90deg); transition: transform .2s var(--ease); }
.maplayers[data-open="true"] .maplayers__head .ic:last-child { transform: rotate(-90deg); }
.maplayers__body { padding: 2px 6px 6px; display: flex; flex-direction: column; }
.maplayers[data-open="false"] .maplayers__body { display: none; }
.maplayers__body label {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: var(--r-3);
  font-size: 14px; color: var(--ink-2); cursor: pointer;
}
.maplayers__body label:hover { background: var(--surface-3); color: var(--ink); }
.maplayers__body input { accent-color: var(--accent); width: 14px; height: 14px; }

/* ---------- durum noktaları: DÜZ, parlamasız ---------- */
.dot { width: 7px; height: 7px; border-radius: 2px; display: inline-block; flex: 0 0 auto; }
.dot--amber  { background: var(--amber); }
.dot--blue   { background: var(--blue); }
.dot--green  { background: var(--green); }
.dot--red    { background: var(--red); }

/* ---------- ALT SHEET: sipariş kuyruğu ---------- */
/* Yükseklik tek kaynaktan: --sheet-h. Tıklama (aç/kapa) bu değeri değiştirir,
   tutup sürükleme de — yani iki etkileşim aynı modeli paylaşır, çakışmaz. */
.sheet {
  /* sınırlar: kapalı 78px, tam açık min(58vh,540px) — app.js aynı değerleri kullanır */
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 12;
  display: flex; flex-direction: column;
  /* JS gelmeden önceki ilk kare de doğru yükseklikte olsun (açılışta zıplama yok) */
  height: var(--sheet-h, calc(min(58vh, 540px) * .75)); overflow: hidden;
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(10,14,20,.08);
  transition: height .34s var(--ease);
}
/* sürüklerken parmağı geciktirmesin */
.sheet.is-dragging { transition: none; }
.sheet__handle {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 4px; color: var(--ink-3);
  cursor: grab; touch-action: none; user-select: none;
}
.sheet.is-dragging .sheet__handle { cursor: grabbing; }
.sheet__handle:hover .sheet__grip { background: var(--ink-3); }
.sheet__grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line-2); transition: background .15s; }
.sheet__chev { width: 14px; height: 14px; transition: transform .3s var(--ease); }
.sheet[data-open="true"] .sheet__chev { transform: rotate(180deg); }
.sheet__bar { flex: 0 0 auto; padding: 4px 16px 10px; display: flex; align-items: center; gap: 12px; }
.sheet__body { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding: 0 16px 16px; }

.segtabs { display: flex; gap: 4px; }
.segtab {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: var(--r-2); color: var(--ink-2);
  font-size: 14.5px; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s;
}
.segtab:hover { background: var(--surface-3); color: var(--ink); }
.segtab.is-active { background: var(--surface-3); color: var(--ink); }
.seg-count { font-family: var(--mono); font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.segtab.is-active .seg-count { color: var(--ink); }
/* Sorunlu sekmesi 0 iken kırmızı bağırmasın: nokta nötr griye düşer. */
.segtab[data-zero="1"] .dot--red { background: var(--ink-3); opacity: .55; }

.searchbar {
  flex: 1 1 auto; max-width: 320px; margin-left: auto;
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 11px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-2);
}
.searchbar input { flex: 1; background: none; border: 0; color: var(--ink); outline: none; font-size: 14.5px; min-width: 0; }
.searchbar input::placeholder { color: var(--ink-3); }

/* ---------- kuyruk: manifesto listesi (kartlar değil, ince-ayraçlı satırlar) ---------- */
.queue { display: flex; flex-direction: column; }
.qcard {
  display: grid; grid-template-columns: 3px 1fr auto; align-items: center; gap: 14px;
  padding: 11px 4px 11px 12px; cursor: pointer; border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.qcard:last-child { border-bottom: 0; }
.qcard:hover { background: var(--surface-3); }
.qcard.is-active { background: var(--accent-weak); }
.qcard__edge { align-self: stretch; border-radius: 2px; background: var(--edge, var(--ink-3)); }
.qcard[data-edge="amber"]  { --edge: var(--amber); }
.qcard[data-edge="blue"]   { --edge: var(--blue); }
.qcard[data-edge="green"]  { --edge: var(--green); }
.qcard[data-edge="red"]    { --edge: var(--red); }
.qcard__main { min-width: 0; }
.qcard__top { display: flex; align-items: baseline; gap: 9px; }
.qcard__id { font-family: var(--mono); font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.qcard__biz { font-weight: 600; font-size: 15.5px; }
/* Bekleme süresi: sevkiyatta en kritik alan. 10 dk üstü amber, 20 dk üstü
   kırmızı — operatör geciken siparişi taramadan görsün. */
.qcard__age { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 6px; font-variant-numeric: tabular-nums; }
.qcard__age[data-late="1"] { color: var(--amber-ink); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.qcard__age[data-late="2"] { color: var(--red-ink);   border-color: color-mix(in srgb, var(--red) 45%, transparent); }
/* Meta çipler: ödeme · kanal · gel-al. JaviKurye yoğunluğu, ince/nötr çiplerle.
   Süre rozetinin hemen yanında dururlar (sağa fırlatılmaz). */
.qcard__chips { display: inline-flex; gap: 5px; }
.chip { font-size: 11px; font-weight: 500; line-height: 1; padding: 3px 7px; border-radius: 5px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip--amber { color: var(--amber-ink); background: color-mix(in srgb, var(--amber) 12%, transparent);
  border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.chip--chan { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
/* Atanan kurye adı — sağ sütunda, tutarın üstünde ("kim taşıyor" bir bakışta). */
.qcard__cour { font-size: 12.5px; font-weight: 500; color: var(--accent); }
.qcard__addr { color: var(--ink-2); font-size: 14px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcard__side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.qcard__status { font-size: 13.5px; font-weight: 600; }
.qcard__amt { font-family: var(--mono); font-size: 14.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
/* Detay panelde kurye adı vurgusu + satır-içi geçen süre. */
.drow__v--cour { color: var(--accent); font-weight: 600; }
.ageinline { font-family: var(--mono); font-size: 12.5px; }
.ageinline[data-late="1"] { color: var(--amber-ink); }
.ageinline[data-late="2"] { color: var(--red-ink); }

/* ---------- sağ çekmece ---------- */
.drawer {
  background: var(--surface);
  display: flex; flex-direction: column;
  transition: width .34s var(--ease);
}
.drawer--right { flex: 0 0 var(--right-w); width: var(--right-w); border-left: 1px solid var(--line); }
#app[data-right="closed"] .drawer--right { width: 0; flex-basis: 0; }
.drawer__head {
  flex: 0 0 auto; height: 50px; padding: 0 10px 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid var(--line);
}
.iconbtn {
  width: 32px; height: 32px; border-radius: var(--r-2); color: var(--ink-3);
  display: grid; place-items: center; transition: color .15s, background .15s;
}
.iconbtn:hover { color: var(--ink); background: var(--surface-3); }

.reopen {
  position: absolute; top: 66px; right: 0; z-index: 30;
  width: 26px; height: 46px; color: var(--ink-2);
  display: none; place-items: center;
  background: var(--surface); border: 1px solid var(--line); border-right: 0;
  border-radius: var(--r-2) 0 0 var(--r-2); box-shadow: var(--shadow);
  transition: color .15s, background .15s;
}
.reopen:hover { color: var(--accent); background: var(--surface-3); }
.reopen .ic { width: 19px; height: 19px; }
#app[data-right="closed"] .reopen--right { display: grid; }

/* ---------- sağ panel modları ---------- */
/* Mod sekmeleri: soluk "gri hap" yerine canlı — aktif olan marka rengiyle dolu,
   altında kayan bir gösterge yok; net, tek okunur seçim. */
.modetabs { display: flex; gap: 3px; background: var(--bg); padding: 3px;
  border-radius: var(--r-2); border: 1px solid var(--line); }
.modetab {
  position: relative; padding: 7px 12px; border-radius: var(--r-3);
  font-size: 14px; font-weight: 600; color: var(--ink-2); letter-spacing: -.1px;
  transition: background .16s, color .16s, transform .1s;
}
.modetab:hover { color: var(--ink); background: var(--surface-3); }
.modetab:active { transform: scale(.96); }
.modetab.is-active {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(20,24,32,.12), 0 2px 8px var(--accent-weak);
}
.modetab.is-active:hover { background: var(--accent); color: #fff; filter: brightness(1.07); }

.panes { flex: 1 1 auto; overflow: hidden; position: relative; }
.pane { position: absolute; inset: 0; overflow-y: auto; padding: 16px;
  opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease); }
.pane.is-active { opacity: 1; transform: none; pointer-events: auto; }

/* GLOBAL: hidden attribute HER ZAMAN gizlesin. .empty gibi display:flex kuralları
   aynı özgüllükte `[hidden]`i eziyordu → seçili siparişte boş-durum GİZLENMİYORDU
   (detay paneli hem boş metni hem içeriği aynı anda gösteriyordu). */
[hidden] { display: none !important; }
.empty { height: 100%; min-height: 320px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 10px; padding: 30px; }
/* İkon "tasarlanmış" bir çip içinde — placeholder değil, kasıtlı boş durum. */
.empty__ic { width: 26px; height: 26px; padding: 15px; box-sizing: content-box;
  border-radius: 16px; background: var(--surface-3); border: 1px solid var(--line);
  color: var(--ink-2); fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.empty__t { font-weight: 600; font-size: 16.5px; margin: 4px 0 0; }
.empty__s { color: var(--ink-3); font-size: 14.5px; max-width: 250px; margin: 0; line-height: 1.55; }
/* Alt sheet daralınca kuyruk boş-durumu kırpılmasın: --empty-vis (app.js, sheet
   yüksekliğinden türetilir) 1→0 indikçe blok yumuşakça solup birkaç px aşağı
   kayar. Yalnız sheet içindeki boş-durum; sağ çekmecedeki "Sipariş seçili değil"
   bundan etkilenmez. */
.sheet__body .empty {
  opacity: var(--empty-vis, 1);
  transform: translateY(calc((1 - var(--empty-vis, 1)) * 6px));
  transition: opacity .26s var(--ease), transform .26s var(--ease);
  will-change: opacity, transform;
}
/* Sürüklerken görünürlük parmakla birebir aksın (geçiş gecikmesi = takılma hissi);
   yumuşak solma yalnız tıkla-aç/kapa'da. */
.sheet.is-dragging .empty { transition: none; }

/* ---------- form (manuel paket & login) ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form__lead { color: var(--ink-2); font-size: 14.5px; margin: 0 0 2px; line-height: 1.5; }
.form__lead b { color: var(--accent); font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--ink-3); font-weight: 600; letter-spacing: .3px; text-transform: uppercase; }
.field input, .field select, .field textarea {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-2);
  padding: 9px 11px; color: var(--ink); outline: none; transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pickbtn {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: var(--r-2);
  background: var(--bg); border: 1px dashed var(--line-2); color: var(--ink-2); font-size: 15px;
  transition: border-color .15s, color .15s;
}
.pickbtn:hover { border-color: var(--accent); color: var(--ink); }
.pickbtn.is-set { border-style: solid; border-color: var(--green); color: var(--ink); }
.chipset, .segpill { display: flex; gap: 6px; }
.paychip {
  flex: 1; padding: 8px; border-radius: var(--r-2); font-size: 14.5px; font-weight: 500;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink-2); transition: all .15s;
}
.paychip.is-active { background: var(--accent-weak); border-color: var(--accent); color: var(--accent-ink); }
.form__msg { font-size: 14.5px; margin: 2px 0 0; min-height: 16px; }
.form__msg.ok  { color: var(--green); }
.form__msg.err { color: var(--red); }

/* ---------- kurye listesi (aynı manifesto satırı deseni) ---------- */
.pane__toolbar { margin-bottom: 12px; }
.segpill { background: var(--bg); padding: 3px; border-radius: var(--r-2); }
.segpill button { flex: 1; padding: 6px; border-radius: var(--r-3); font-size: 14px; color: var(--ink-2); transition: all .15s; }
.segpill button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.courierlist, .alertlist { display: flex; flex-direction: column; }
.crow {
  display: flex; align-items: center; gap: 12px; padding: 10px 2px;
  border-bottom: 1px solid var(--line); transition: background .12s;
}
.crow:last-child { border-bottom: 0; }
.crow:hover { background: var(--surface-3); }
.crow__ava { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  font-weight: 600; font-size: 14px; color: var(--ink); background: var(--surface-3);
  border: 1px solid var(--line-2); position: relative; }
.crow__pin { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--surface); }
.crow__pin[data-s="working"] { background: var(--green); }
.crow__pin[data-s="idle"]    { background: var(--ink-3); }
.crow__pin[data-s="break"]   { background: var(--amber); }
.crow__main { flex: 1; min-width: 0; }
.crow__name { font-weight: 600; font-size: 15px; }
.crow__meta { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.crow__load { font-family: var(--mono); font-size: 14px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.crow__load b { color: var(--ink); }

.arow { display: flex; gap: 11px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.arow:last-child { border-bottom: 0; }
.arow__ic { width: 28px; height: 28px; border-radius: var(--r-3); flex: 0 0 auto; display: grid; place-items: center; }
.arow__ic .ic { width: 15px; height: 15px; }
.arow__t { font-weight: 600; font-size: 14.5px; }
.arow__s { color: var(--ink-2); font-size: 13.5px; margin-top: 1px; }

/* ---------- butonlar: düz dolgu, gradyan yok ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; height: 38px;
  border-radius: var(--r-2); font-weight: 600; font-size: 15px; white-space: nowrap;
  background: var(--surface-3); border: 1px solid var(--line-2); color: var(--ink);
  transition: filter .15s, transform .1s, background .15s;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: scale(.98); }
.btn .ic { width: 16px; height: 16px; }
.btn--accent { background: var(--accent); border-color: transparent; color: #fff; }
.btn--accent:hover { filter: brightness(1.08); }
.btn--full { width: 100%; }
/* btn--quiet: yikici ama sik kullanilan islem (Iptal Et) — gorunur ama one
   cikmayan; btn--danger: onay adiminda basilan kirmizi dugme. */
.btn--quiet { background: transparent; color: var(--ink-3); }
.btn--quiet:hover { background: var(--surface-3); color: var(--red-ink); }
.btn--danger { background: var(--red); border-color: transparent; color: #fff; }
.btn--danger:hover { filter: brightness(1.08); }

/* ---------- detay kartı ---------- */
.dcard { display: flex; flex-direction: column; gap: 14px; }
.dcard__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dcard__id { font-family: var(--mono); font-size: 16px; font-weight: 600; }
.badge { padding: 4px 9px; border-radius: var(--r-3); font-size: 13.5px; font-weight: 700; letter-spacing: .1px; }
.badge--amber { background: var(--amber-bg); color: var(--amber-ink); }
.badge--blue  { background: var(--blue-bg);  color: var(--blue-ink); }
.badge--green { background: var(--green-bg); color: var(--green-ink); }
.badge--red   { background: var(--red-bg);   color: var(--red-ink); }
.drow { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.drow:last-child { border-bottom: 0; }
.drow__k { color: var(--ink-3); flex: 0 0 auto; }
.drow__v { color: var(--ink); font-weight: 500; text-align: right; }
.drow__v a { color: var(--accent); text-decoration: none; }
.drow__v .muted { color: var(--ink-3); font-weight: 400; }
.rate { font-family: var(--mono); color: var(--amber-ink); letter-spacing: 1px; }
.badgeset { display: flex; gap: 6px; align-items: center; }

/* detay bölümü (sipariş içeriği / değerlendirme) */
.dsection { border-top: 1px solid var(--line); padding-top: 10px; }
.dsection__t { font-size: 13px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 8px; }
.lrow { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline;
  padding: 6px 0; font-size: 14.5px; }
.lrow__q { font-family: var(--mono); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lrow__n { color: var(--ink); }
.lrow__m { display: block; font-size: 13px; color: var(--ink-3); margin-top: 1px; }
.lrow__p { font-family: var(--mono); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ZAMAN ÇİZELGESİ (Javi 'Paket Durum Değişiklikleri' karşılığı): durum başına
   dikey akış — renkli nokta, kim yaptı, saat + bir önceki adımdan geçen süre.
   Operatörün "nerede takıldı" sorusu buradan okunur. */
.tl { position: relative; }
.tl::before { content: ""; position: absolute; left: 4px; top: 12px; bottom: 12px;
  width: 1.5px; background: var(--line); }
.tl__row { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 10px;
  align-items: center; padding: 5px 0; }
.tl__dot { width: 9px; height: 9px; border-radius: 50%; position: relative; z-index: 1;
  border: 1.5px solid var(--surface); box-sizing: content-box; }
.tl__t { font-weight: 600; font-size: 13.5px; }
.tl__by { display: block; font-size: 11.5px; color: var(--ink-3); }
.tl__time { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2);
  font-variant-numeric: tabular-nums; }
.tl__dur { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3);
  min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }

/* telefon → müşteri arama sonucu (manuel form) */
.lookup { border: 1px solid var(--line); border-radius: var(--r-2); padding: 8px; background: var(--surface-3);
  display: flex; flex-direction: column; gap: 4px; }
.lookup__t { font-size: 13.5px; font-weight: 600; color: var(--ink-2); padding: 2px 4px; }
.lookup__a { text-align: left; padding: 7px 8px; border-radius: var(--r-3); font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); transition: border-color .15s; }
.lookup__a:hover { border-color: var(--accent); }

/* 3-kolon satır (bina/kapı/kat) + onay satırı */
.field-row--3 { grid-template-columns: 1fr 1fr 1fr; }
.field--check { justify-content: flex-end; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink-2);
  padding: 9px 0; cursor: pointer; }
.checkline input { accent-color: var(--accent); width: 15px; height: 15px; }
/* Durum basina 4 dugmeye kadar cikabiliyor (yolda: teslim / teslim edilemedi /
   kurye degistir / iptal) — dar detay sutununda tasmasin diye sarar. */
.dactions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.dactions .btn { flex: 1 1 42%; height: 40px; }
/* dform: dugmenin altinda acilan islem kutusu (teslim tahsilati, teslim
   edilemedi sebebi, iptal onayi). Oneri listesiyle AYNI slotu kullanir. */
.dform { display: flex; flex-direction: column; gap: 10px; padding: 12px;
  border-radius: var(--r-2); background: var(--bg); border: 1px solid var(--line); }
.dform__t { font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-3); }
.dform .field > span { font-size: 11px; }
.dform .dactions { margin-top: 2px; }
.suggest { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.suggest__row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-2);
  background: var(--bg); border: 1px solid var(--line); }
.suggest__row b { font-family: var(--mono); }
/* öneri dışı kuryeler bölüm başlığı ("Diğer kuryeler") */
.suggest__sep {
  margin: 8px 2px 2px; font-size: 11px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3);
}

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: var(--scrim); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal[hidden] { display: none; }
.modal__card { width: 372px; max-width: 92vw; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 4px; }
.modal__head h3 { font-size: 17px; }
.modal__card .form { padding: 12px 16px 18px; }

/* ---------- leaflet marker (İSİMLİ PILL — Javi deseni) ---------- */
/* Marker'lar artık ADLI etiket (kurye adı / restoran adı) — çıplak baş-harf/#no
   karışıktı. Katı yüzey-pill + durum-renkli nokta → hem renkli (Voyager) hem koyu
   haritada okunur. Renk dili sipariş durumuyla ORTAK. */
.mkp-wrap { width: 0; height: 0; overflow: visible; }
.mkp { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 3px 8px 3px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(0,0,0,.28); font-size: 12px; font-weight: 600; color: var(--ink);
  cursor: pointer; }
.mkp__txt { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
/* Üstüne gelince öne çık (yoğun bölgede pill'ler çakışıyor — hover ile okunur). */
.mkp:hover { z-index: 600; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.leaflet-marker-icon:hover { z-index: 600 !important; }
.mkp__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--surface) 60%, transparent); }
.mkp__badge { min-width: 16px; height: 16px; padding: 0 3px; border-radius: 9px; flex: none;
  background: var(--ink); color: var(--surface); font-family: var(--mono); font-size: 10.5px;
  font-weight: 700; line-height: 16px; text-align: center; }
.mkp__ic { font-size: 12px; line-height: 1; }

/* --- SİPARİŞ: temiz durum-renkli NOKTA (etiketsiz) — restoran adı hover/seç --- */
.mkd { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  width: 15px; height: 15px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: pointer; }
.mkd--order[data-edge="amber"] { background: var(--amber); }
.mkd--order[data-edge="blue"]  { background: var(--accent); }
.mkd--order[data-edge="green"] { background: var(--green); }
.mkd--order[data-edge="red"]   { background: var(--red); }
.mkd:hover { transform: translate(-50%, -50%) scale(1.25); z-index: 600; }
/* Seçili sipariş: marka-rengi halka + büyüme. */
.mkd--order.is-sel { box-shadow: 0 1px 4px rgba(0,0,0,.35), 0 0 0 3px var(--accent), 0 0 0 6px var(--accent-weak);
  transform: translate(-50%, -50%) scale(1.3); z-index: 500; }
/* --- KÜME BALONCUĞU: yakın sipariş noktaları tek sayıya toplanınca --- */
.mkc { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  min-width: 30px; height: 30px; padding: 0 7px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 13.5px; color: #fff;
  border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.32); cursor: pointer;
  font-variant-numeric: tabular-nums; }
.mkc[data-edge="amber"] { background: var(--amber); }
.mkc[data-edge="blue"]  { background: var(--accent); }
.mkc[data-edge="green"] { background: var(--green); }
.mkc:hover { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 4px 14px rgba(0,0,0,.4); }

/* KRİTİK GECİKME (>20 dk): nokta haritada da bağırsın — yavaş, dışa büyüyüp
   solan kırmızı halka. Kuyruktaki data-late diliyle aynı eşik. reduced-motion
   global kuralı animasyonu zaten kapatır. */
.mkd--order[data-late="2"]::after { content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid var(--red); animation: late-ring 1.6s ease-out infinite; pointer-events: none; }
@keyframes late-ring { 0% { transform: scale(.65); opacity: .9; } 100% { transform: scale(2); opacity: 0; } }
/* İLİŞKİ VURGUSU: kurye pill'i hover'da taşıdığı sipariş noktaları, sipariş
   hover'da restoranı + kuryesi öne çıkar ("hangi nokta kimin" tooltip'siz). */
.mkd.is-related { transform: translate(-50%, -50%) scale(1.35); z-index: 590;
  box-shadow: 0 1px 4px rgba(0,0,0,.35), 0 0 0 4px var(--accent-weak); }
.mkp--courier.is-related { box-shadow: 0 0 0 3px var(--accent-weak), 0 4px 12px rgba(0,0,0,.35); z-index: 600; }
.mkp--store.is-related { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }

/* Kurye pini: sol nokta durum renginde + hafif renk vurgusu. */
.mkp--courier { border-width: 1.5px; }
/* BAYAT KONUM: last_seen_at eskidiyse pill soluklaşır — taze görünen ama
   aslında dakikalardır güncellenmeyen konuma yanlış güven verilmesin. */
.mkp--courier[data-stale="1"] { opacity: .5; filter: grayscale(.35); }
/* ATAMA ÖNERİSİ: sipariş seçiliyken uygun kuryelerin pill'ine ETA rozeti +
   accent halka. Tıklayınca haritadan atama popup'ı açılır. */
.mkp--courier.is-suggest { border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak), 0 2px 6px rgba(0,0,0,.28); }
.mkp__eta { height: 16px; padding: 0 6px; border-radius: 9px; flex: none;
  background: var(--accent); color: #fff; font-family: var(--mono); font-size: 10.5px;
  font-weight: 700; line-height: 16px; font-variant-numeric: tabular-nums; }
/* KURYE = Javi-stil SOLID CALLOUT. Eski surface-pill açık haritada SİLİK, işaretçisiz
   KABA'ydı. Şimdi: yüksek-kontrast ink zemin + surface metin (hem açık hem koyu
   haritada patlar), konuma ALT-UÇLU işaretçiyle bağlı (kesin nokta belli), durum =
   renkli halkalı nokta, yük rozeti ters-kontrast. */
.mkp--courier {
  background: var(--ink); color: var(--surface); border: none;
  transform: translate(-50%, calc(-100% - 8px));   /* pill noktanın ÜSTÜNDE; uç tam noktada */
  padding: 4px 10px 4px 8px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.mkp--courier::after {   /* callout ucu → tam konumu işaret eder */
  content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--ink); border-bottom: 0;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,.25));
}
.mkp--courier .mkp__dot { width: 9px; height: 9px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ink) 45%, transparent); }
.mkp--courier[data-status="idle"]  .mkp__dot { background: var(--green); }
.mkp--courier[data-status="busy"]  .mkp__dot { background: var(--accent); }
.mkp--courier[data-status="break"] .mkp__dot { background: var(--amber); }
.mkp--courier .mkp__badge { background: var(--surface); color: var(--ink); }  /* ink pill üstünde ters */
.mk-drop .mkp--courier { animation: none; }  /* -100% transform, generic drop ile çakışmasın */
/* Restoran pini: KÜÇÜK + SOLUK ikon — sabit bağlam (alım noktası), kurye/siparişle
   yarışmaz, geri planda durur. Üstüne gelince belirginleşir. */
.mkp--store { width: 15px; height: 15px; padding: 0; border-radius: 50%; justify-content: center;
  background: var(--surface); border: 1px solid var(--line-2);
  box-shadow: 0 1px 2px rgba(0,0,0,.15); opacity: .5; }
.mkp--store .mkp__ic { font-size: 8.5px; filter: grayscale(.5); }
.mkp--store:hover { opacity: 1; transform: translate(-50%,-50%) scale(1.4); z-index: 600; }
/* ZOOM'A DUYARLI RESTORAN ETİKETİ: mahalle bakışında (zoom ≥ 15) adlar açılır —
   geniş bakışta metin gürültüsü, yakın bakışta bilgi. app.js zoomend'de
   .zoom-labels sınıfını basar. */
.mkp__stxt { display: none; }
.zoom-labels .mkp--store { width: auto; height: auto; padding: 2px 8px 2px 6px; gap: 4px;
  border-radius: 999px; opacity: .92; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.zoom-labels .mkp--store .mkp__stxt { display: inline; font-size: 11px; font-weight: 600;
  color: var(--ink-2); max-width: 110px; overflow: hidden; text-overflow: ellipsis; }

/* --- marker hareketi: kayma / düşüş / seçili vurgu --- */
.leaflet-marker-icon.mk-glide { transition: transform 1.1s cubic-bezier(.33,.1,.25,1); }
/* Glide'ı zoom/pan boyunca kapat: hem bizim .panning hem Leaflet'in kendi
   zoom-anim sınıfı (zoom sırasında marker transform'u Leaflet'e ait, transition
   yakalarsa "takılma" olur). */
.leaflet-container.panning .leaflet-marker-icon.mk-glide,
.leaflet-zoom-anim .leaflet-marker-icon.mk-glide { transition: none !important; }
@keyframes mkp-drop { 0% { transform: translate(-50%, calc(-50% - 9px)) scale(.6); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.mk-drop .mkp, .mk-drop .mkd { animation: mkp-drop .42s var(--ease); }

/* seçim + klavye odağı — sessiz kalite: fareyle görünmez, klavyeyle net. */
::selection { background: var(--accent-weak); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.iconbtn:focus-visible, .mapctl__btn:focus-visible { outline-offset: 1px; }
.node:focus-visible, .navitem:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible,
.searchbar input:focus-visible { outline: none; } /* bunlar zaten border-color ile odak gösteriyor */

/* scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: padding-box; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ==================== RESPONSIVE ====================
   Masaüstü düzen = rail | sahne | sağ çekmece (3 sabit sütun). Dar ekranda sağ
   çekmece SÜTUN olmaktan çıkıp haritanın ÜSTÜNE overlay olur (transform ile
   kayar, genişlik tüketmez) → harita hiçbir zaman ekran dışına itilmez. Arkada
   tıkla-kapat scrim. Telefonda tam-ekran overlay + sıkışan toolbar/sheet. */

/* scrim: yalnız overlay modunda (dar ekran) devreye girer */
.rscrim {
  position: absolute; inset: 0; z-index: 35;
  background: var(--scrim); opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease); display: none;
}

@media (max-width: 1079px) {
  /* çekmece = harita üstünde overlay; sütun genişliği çalmaz */
  .drawer--right {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: min(380px, 88vw); flex: none; z-index: 40;
    box-shadow: -10px 0 34px rgba(8,11,18,.22);
    transform: translateX(0);
    transition: transform .34s var(--ease), width .34s var(--ease);
  }
  #app[data-right="closed"] .drawer--right {
    width: min(380px, 88vw); flex: none;
    transform: translateX(100%);   /* ekranın dışına kayar */
  }
  .rscrim { display: block; }
  #app[data-right="open"] .rscrim { opacity: 1; pointer-events: auto; }
  /* araç kolonu çekmecenin altında kalmasın: hep kapalı-konum ofseti */
  .maptools, #app[data-right="closed"] .maptools { right: 46px; }
}

@media (max-width: 640px) {
  /* KATMAN + AÇIKLAMA kutuları dar haritayı yemesin: kapalıyken salt-ikon.
     Açınca normal genişliğine döner. */
  .maplayers[data-open="false"] { width: auto; }
  .maplayers[data-open="false"] .maplayers__head { padding: 10px 11px; }
  .maplayers[data-open="false"] .maplayers__t,
  .maplayers[data-open="false"] .maplayers__head .ic:last-child { display: none; }
  .legend[data-open="false"] { width: auto; }
  .legend[data-open="false"] .legend__head { padding: 10px 11px; }
  .legend[data-open="false"] .legend__t,
  .legend[data-open="false"] .legend__head .ic { display: none; }

  /* dar ekranda gösterge sıkışsın */
  .kpi { padding: 0 10px; gap: 6px; }

  /* Dar peek çubuğu: 4 durum sekmesi (asıl bakış noktası) öncelikli — arama
     gizlenir (gerekirse yatay kaydırma), böylece sekmeler kırpılmaz. */
  .sheet__bar { gap: 8px; padding: 4px 12px 10px; }
  .searchbar { display: none; }
  .segtabs { flex: 1 1 auto; min-width: 0; justify-content: space-between;
    overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
  .segtabs::-webkit-scrollbar { display: none; }
  .segtab { padding: 7px 9px; }
}

@media (max-width: 560px) {
  /* dar ekranda kontrol düğümü biraz küçülür, panel daralır */
  .node { width: 48px; height: 48px; }
  .navpanel { width: 216px; }
  .segtab { padding: 7px 7px; }
  .seg-count { font-size: 13.5px; }
}

@media (max-width: 480px) {
  /* telefon: çekmece tam-ekran overlay (rail'in de üstünü kapar, kapatınca döner) */
  .drawer--right, #app[data-right="closed"] .drawer--right { width: 100vw; }
}

@media (max-width: 400px) {
  /* çok dar: live metnini bırak, durum yalnız renkli noktayla anlaşılsın */
  #liveText { display: none; }
  .live { padding-left: 0; border-left: 0; }
  .segtab { padding: 7px 7px; }
}

/* ---------- mutfak ilerlemesi (hazırlık penceresi) ----------
   "Hazırlanıyor" rozeti sürecin NERESİNDE olduğunu söylemiyordu; bu çubuk
   kartta ve detayda kalan süreyi canlı akıtır. Tahmin yoksa (manuel paket)
   belirsiz-ilerleme animasyonu döner. */
.qprep { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qprep__bar {
  flex: 1; height: 4px; border-radius: 2px;
  background: var(--amber-bg); overflow: hidden; position: relative;
}
.qprep__bar i {
  display: block; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--amber), var(--amber-ink));
  transition: width .6s ease;
}
.qprep__t { font-size: 11px; font-weight: 600; color: var(--amber-ink); white-space: nowrap; }
/* tahminsiz: kayan parça (belirsiz ilerleme) */
.qprep[data-indet="1"] .qprep__bar i,
.dprep[data-indet="1"] .qprep__bar i {
  width: 30% !important;
  animation: prepslide 1.8s ease-in-out infinite;
}
@keyframes prepslide {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(430%); }
}
/* detaydaki büyük hali */
.dprep { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.dprep__bar { height: 6px; border-radius: 3px; }
.dprep__t { font-size: 12.5px; font-weight: 600; color: var(--amber-ink); white-space: nowrap; }
