/* SpeedyGo Yönetim — sade, beyaz, premium. Yazı tipi sunucudan (harici istek yok).
   Yerleşim: ≥1200 tam kenar menü · 768–1199 ikon menü (tablet) · <768 üst çubuk + alt sekme (telefon). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #1d1f23;
  --ink-2: #4a4e57;
  --muted: #7b8089;
  --line: #e9eaee;
  --line-2: #f1f2f4;
  --soft: #f7f7f8;
  --white: #fff;
  --red: #e3122b;
  --red-ink: #b80d22;
  --red-soft: #fdecee;
  --green: #12805c;
  --green-soft: #e8f5ef;
  --amber: #a15c00;
  --amber-soft: #fff4e0;
  --blue: #1f5fbf;
  --blue-soft: #eaf1fb;
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 1px 2px rgba(29, 31, 35, 0.04), 0 8px 24px rgba(29, 31, 35, 0.06);
  --shadow-l: 0 2px 6px rgba(29, 31, 35, 0.06), 0 16px 40px rgba(29, 31, 35, 0.12);
  --side: 244px;
  --top: 60px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
}

* { box-sizing: border-box; }
html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation; /* çift dokunuşla yakınlaşma yok */
}
body {
  min-height: 100%;
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { display: flex; justify-content: center; margin: 16px 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.04em; }
svg { flex: none; }

/* ── Giriş ── */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); background: var(--white); }
.auth-card { width: 100%; max-width: 360px; }
.brand { display: flex; align-items: baseline; gap: 2px; font-weight: 800; font-size: 22px; letter-spacing: -0.03em; }
.brand b { color: var(--red); font-weight: 800; }
.brand-link { text-decoration: none; }
.auth h1 { font-size: 22px; letter-spacing: -0.02em; margin: 28px 0 6px; font-weight: 700; }
.auth p.sub { color: var(--muted); margin: 0 0 24px; }
.auth p.tiny { font-size: 12.5px; margin: 18px 0 0; text-align: center; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field > span.hint { font-weight: 400; font-size: 12.5px; color: var(--muted); }
.label { display: block; margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--white); outline: none; font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
}
select.input { padding-right: 34px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8089' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
textarea.input { height: auto; padding: 10px 14px; resize: vertical; min-height: 72px; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(29, 31, 35, 0.07); }
.input.sm { height: 36px; padding: 0 10px; font-size: 13.5px; }
select.input.sm { padding-right: 30px; background-position: right 10px center; }
.input.auto { width: auto; max-width: 220px; }
.input[readonly] { background: var(--soft); }
.pw { position: relative; }
.pw .input { padding-right: 76px; }
.eye { position: absolute; right: 6px; top: 6px; height: 32px; padding: 0 10px; border: 0; background: var(--soft); border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.copyrow { display: flex; gap: 8px; }
.error { color: var(--red-ink); background: var(--red-soft); border-radius: var(--radius-s); padding: 10px 12px; margin: 0 0 14px; font-size: 13px; }

/* ── Düğmeler ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--white); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { background: var(--soft); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--white); }
.btn.primary:hover { background: #000; }
.btn.red { background: var(--red); border-color: var(--red); color: var(--white); }
.btn.red:hover { background: var(--red-ink); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { color: var(--red-ink); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; height: 46px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 550; cursor: pointer; text-align: left; }
.link:hover { color: var(--ink); }
.link.strong { color: var(--ink); font-weight: 650; }
.icon-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 10px; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .dot { position: absolute; top: 3px; right: 2px; }
.tel { text-decoration: none; font-weight: 600; border-bottom: 1px dashed var(--line); }

/* ── İskelet ── */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.col { min-width: 0; display: flex; flex-direction: column; }
.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  padding: 18px 12px 14px; border-right: 1px solid var(--line); background: var(--white); overflow-y: auto;
}
.side .brand-link { padding: 4px 12px 18px; }
.nav { display: grid; gap: 1px; }
.nav-g { padding: 14px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #a3a7ae; }
.nav-g:first-child { padding-top: 0; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--radius-s);
  color: var(--ink-2); text-decoration: none; font-weight: 550;
}
.nav a svg, .tabbar svg, .menu svg, .tile svg, .res svg { width: 19px; height: 19px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover { background: var(--soft); color: var(--ink); }
.nav a.on { background: var(--soft); color: var(--ink); font-weight: 650; }
.nav a.on svg { color: var(--red); }
.dot { margin-left: auto; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; font-style: normal; }
.side-foot { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid var(--line-2); display: grid; gap: 10px; }
.who-row { display: flex; align-items: center; gap: 6px; }
.who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 6px; border-radius: 10px; }
.who:hover { background: var(--soft); }
.who > div:last-child { min-width: 0; display: grid; }
.who b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { color: var(--muted); font-size: 12px; }
.live-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; padding: 0 6px; }
.live-state i, .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #c7c9ce; flex: none; }
.live-state.on i, .live-dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.live-dot { margin: 0 6px; }

.top {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-brand { display: none; }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.search { position: relative; flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px; background: var(--soft); border: 1px solid transparent; border-radius: 10px; }
.search:focus-within { background: var(--white); border-color: var(--line); box-shadow: 0 0 0 3px rgba(29, 31, 35, 0.05); }
.search svg { width: 17px; height: 17px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; }
.search-input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 14px; }
.search-input::-webkit-search-cancel-button { display: none; }
kbd { font: 600 11px/1 inherit; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; background: var(--white); }
.user-btn { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; border: 0; background: transparent; border-radius: 22px; cursor: pointer; font-weight: 600; }
.user-btn:hover { background: var(--soft); }
.show-m { display: none; }

.main { flex: 1; min-width: 0; width: 100%; max-width: 1480px; padding: 26px 32px 56px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 24px; letter-spacing: -0.025em; font-weight: 700; line-height: 1.25; }
.head .lead { margin: 4px 0 0; }
.head .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.grow-input { flex: 1; min-width: 180px; }
.sec-h { margin: 0 0 12px; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.sec-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 26px 0 12px; }
.sec-bar .sec-h { margin: 0; }
.foot-note { margin: 12px 4px; font-size: 13px; }

/* ── Mobil alt sekme + menü sayfası ── */
.tabbar { display: none; }
.sheet {
  position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow: auto;
  background: var(--white); border-radius: 20px 20px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-l); animation: rise 0.2s ease;
}
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 14px; }
.sheet-user { display: flex; align-items: center; gap: 12px; padding: 4px 4px 14px; border-bottom: 1px solid var(--line-2); margin-bottom: 14px; }
.sheet-user b { display: block; }
.sheet-user span { color: var(--muted); font-size: 12.5px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-size: 12.5px; font-weight: 600; text-align: center; color: var(--ink-2); }
.tile.on { border-color: var(--ink); color: var(--ink); }
.tile.on svg { color: var(--red); }
.tile .dot { position: absolute; top: 6px; right: 6px; }

/* ── Açılır menü ── */
.pop { position: fixed; z-index: 70; animation: fade 0.12s; }
.menu { min-width: 230px; max-width: calc(100vw - 16px); max-height: 70vh; overflow: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-l); padding: 6px; display: grid; }
.wide-menu { width: 340px; }
.menu-head { display: flex; flex-direction: column; padding: 10px 12px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.menu-head span { color: var(--muted); font-size: 12.5px; }
.menu > a, .menu > button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none; border-radius: var(--radius-s); text-decoration: none; text-align: left; cursor: pointer; font-weight: 550; color: var(--ink-2); }
.menu > a:hover, .menu > button:hover { background: var(--soft); color: var(--ink); }
.menu > .danger { color: var(--red-ink); }
.menu-label { padding: 8px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #a3a7ae; }
.menu .res { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: none; border-radius: var(--radius-s); cursor: pointer; text-align: left; }
.menu .res:hover { background: var(--soft); }
.res .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.note-item { flex-direction: column; align-items: flex-start !important; gap: 2px !important; }
.note-item span { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.menu-foot { justify-content: center; color: var(--muted) !important; font-size: 12.5px; border-top: 1px solid var(--line-2) !important; border-radius: 0 !important; margin-top: 4px; }

/* ── Parçalar ── */
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.card.pad { padding: 18px 20px; }
.card h2 { margin: 0 0 14px; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stats.tight { gap: 8px; margin: 14px 0; }
.stats.tight .stat { padding: 12px 14px; }
.stats.tight .stat b { font-size: 18px; }
.stat { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; min-width: 0; }
.stat span { color: var(--muted); font-size: 12.5px; font-weight: 550; }
.stat b { display: block; margin-top: 4px; font-size: 24px; font-weight: 700; letter-spacing: -0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat b small { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.stat b.warn { color: var(--red); }
.link-stat:hover { border-color: #d6d8dd; background: var(--soft); }
.pill {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: 11px; font-size: 12px; font-weight: 650; background: var(--soft); color: var(--ink-2); white-space: nowrap;
}
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red-ink); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.note-box { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); margin-bottom: 14px; }
.note-box svg { width: 22px; height: 22px; stroke: var(--red); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.note-box b { display: block; margin-bottom: 2px; }
.note-box span { color: var(--ink-2); font-size: 13px; }
.shield { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--red-soft); flex: none; }
.shield svg { width: 16px; height: 16px; stroke: var(--red); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.seg { display: inline-flex; padding: 3px; background: var(--soft); border-radius: 10px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { height: 30px; padding: 0 12px; border: 0; background: none; border-radius: 8px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; flex: none; }
.seg button.on { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(29, 31, 35, 0.1); }
.tabs-line { margin: 18px 0 12px; }
.range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.range > .seg, .toolbar > .seg, .tools > .seg { min-width: 0; }
.sec-bar > *, .toolbar > *, .head > * { min-width: 0; max-width: 100%; }
.range-custom { display: flex; gap: 6px; align-items: center; }
.range-custom .input { width: 150px; }

/* ── Tablo ── */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--white); white-space: nowrap; position: sticky; top: 0; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--soft); }
tbody tr.late td:first-child { box-shadow: inset 3px 0 0 var(--red); }
td.r, th.r { text-align: right; }
td .sub { display: block; color: var(--muted); font-size: 12.5px; }
td.clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user b { white-space: nowrap; }

/* ── Grafik ve dağılım ── */
.chart-card { margin-bottom: 16px; }
.chart svg { display: block; width: 100%; height: 150px; }
.chart-x { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--muted); }
.chart-x span { flex: 1; text-align: center; }
.chart .bar { fill: #d4d6db; }
.chart .bar.top { fill: var(--red); }
.chart g:hover .bar { fill: var(--ink); }
.dist { margin-bottom: 12px; }
.dist-top { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.dist-top small { color: var(--muted); font-weight: 600; }
.meter { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }

/* ── Canlı ── */
.live { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; height: calc(100vh - 300px); height: calc(100dvh - 300px); min-height: 460px; }
.map-box, .mini-map, .picker { isolation: isolate; position: relative; z-index: 0; }
.map-box { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
#map { position: absolute; inset: 0; background: #f3f3f4; }
.leaflet-tile-pane { filter: grayscale(1) contrast(0.95) brightness(1.04); }
.panel-r { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 0; }
.panel-r .seg { margin: 12px 12px 4px; align-self: flex-start; }
.list { overflow: auto; flex: 1; min-height: 0; }
.row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line-2); cursor: pointer; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--soft); }
.row.static { cursor: default; }
.row.static:hover { background: none; }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .grow span { display: block; color: var(--muted); font-size: 12.5px; }
.list-card.plain { border: 0; }
.list-card.plain .row { padding: 12px 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; color: var(--ink-2); flex: none; }
.avatar.on { background: var(--green-soft); color: var(--green); }
.avatar.sq { border-radius: 9px; background: var(--red-soft); color: var(--red-ink); }
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; background: var(--ink); color: #fff; }
.avatar.xl { width: 56px; height: 56px; font-size: 18px; background: var(--ink); color: #fff; }
.profile { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.profile b { display: block; font-size: 17px; }
.pin { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 11.5px; border: 2.5px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.pin.off { background: #9aa0a8; }
.pin.rest { border-radius: 8px; background: var(--red); }
.pin.drop { width: 16px; height: 16px; border-width: 2px; background: var(--blue); }
.pin.drop.ready { background: var(--amber); }
.pin.drop.picked { background: var(--green); }
.alerts { display: grid; gap: 8px; margin-bottom: 16px; }
.alert { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--amber-soft); color: #6b3f00; }
.alert.red { background: var(--red-soft); color: var(--red-ink); }
.alert .grow { flex: 1; font-weight: 550; }
.mini-map { height: 260px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #f3f3f4; }
.mini-map.short { height: 180px; margin-top: 8px; }
.picker { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 14px; background: #f3f3f4; }
.sub-h { margin: 22px 0 10px; font-size: 14px; font-weight: 650; }

/* ── Zaman çizelgesi ── */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 46px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 40px 1fr; gap: 16px; padding: 7px 0; position: relative; }
.timeline li::before { content: ''; position: absolute; left: 43px; top: 13px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.tl-time { color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.timeline b { font-weight: 600; }
.timeline .sub { display: block; color: var(--muted); font-size: 12.5px; }

/* ── Anahtar (switch) ── */
.switch { -webkit-appearance: none; appearance: none; width: 42px; height: 24px; border-radius: 12px; background: #d4d6db; position: relative; cursor: pointer; flex: none; transition: background 0.15s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: left 0.15s; }
.switch:checked { background: var(--ink); }
.switch:checked::after { left: 21px; }
.switch-row { cursor: pointer; }

/* ── Çekmece ve pencere (yakınlaşma/ölçek animasyonu yok) ── */
.scrim { position: fixed; inset: 0; background: rgba(29, 31, 35, 0.32); z-index: 50; animation: fade 0.15s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); z-index: 51;
  background: var(--white); box-shadow: -12px 0 40px rgba(29, 31, 35, 0.12);
  display: flex; flex-direction: column; animation: slide 0.18s ease;
}
.drawer.wide { width: min(760px, 100%); }
.drawer header { padding: 18px 24px 12px; padding-top: calc(18px + env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-2); }
.drawer header h2 { margin: 0; font-size: 18px; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer .body { padding: 16px 24px calc(28px + env(safe-area-inset-bottom)); overflow: auto; flex: 1; overscroll-behavior: contain; }
.x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--soft); cursor: pointer; font-size: 18px; line-height: 1; flex: none; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 12px; padding: 14px 0; border-top: 1px solid var(--line-2); margin: 0; }
.kv:first-of-type { border-top: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.actions { display: grid; gap: 8px; margin-top: 8px; }
.modal {
  position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(440px, calc(100% - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--white); border-radius: 16px; padding: 24px;
  box-shadow: var(--shadow-l); animation: fade 0.15s;
}
.modal.wide { width: min(600px, calc(100% - 32px)); }
.modal h2 { margin: 0 0 6px; font-size: 18px; letter-spacing: -0.02em; }
.modal p { margin: 0 0 16px; color: var(--muted); }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: grid; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius-s); box-shadow: var(--shadow); animation: fade 0.15s; max-width: 360px; }
.toast.err { background: var(--red-ink); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 8px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sec { margin-bottom: 28px; }
.sec > h2 { margin: 0 0 12px; font-size: 15px; font-weight: 650; }
.weeknav { display: inline-flex; align-items: center; gap: 4px; }
.big { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.in { color: var(--green); }
.out { color: var(--red-ink); }

/* ── Tablet: ikon menü ── */
@media (max-width: 1199px) {
  :root { --side: 76px; }
  .side { padding: 16px 10px 12px; align-items: center; }
  .side .brand-link { padding: 4px 0 16px; }
  .side .brand { font-size: 0; }
  .side .brand::before { content: 'S'; font-size: 22px; }
  .side .brand b { font-size: 0; }
  .side .brand b::before { content: 'G'; font-size: 22px; }
  .nav { width: 100%; }
  .nav-g { font-size: 0; padding: 10px 0 4px; border-top: 1px solid var(--line-2); margin: 6px 8px 0; }
  .nav-g:first-child { border-top: 0; margin-top: 0; }
  .nav a { justify-content: center; padding: 11px 0; }
  .nav a > span:not(.dot) { display: none; }
  .nav a .dot { position: absolute; top: 3px; right: 6px; margin: 0; min-width: 17px; height: 17px; font-size: 10px; }
  .side-foot { padding: 10px 0 0; width: 100%; justify-items: center; }
  .live-state span, .who > div:last-child { display: none; }
  .who-row { flex-direction: column; }
  .who { padding: 4px; flex: none; }
  .top { padding: 0 20px; }
  .main { padding: 22px 22px 48px; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1199px) and (min-width: 768px) {
  .stats.tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Telefon: üst çubuk + alt sekme ── */
@media (max-width: 767px) {
  :root { --top: 56px; }
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: 0 8px 0 16px; padding-top: env(safe-area-inset-top); height: calc(var(--top) + env(safe-area-inset-top)); gap: 6px; }
  .top-brand { display: block; }
  .top-brand .brand { font-size: 20px; }
  .search { display: none; }
  .search.open { display: flex; position: absolute; left: 8px; right: 8px; top: calc(9px + env(safe-area-inset-top)); max-width: none; background: var(--white); border-color: var(--line); z-index: 2; }
  .show-m { display: grid; }
  .hide-m { display: none; }
  .user-btn { padding: 0 4px; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar .more { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px; border: 0; background: none; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; cursor: pointer; }
  .tabbar a svg, .tabbar .more svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--ink); }
  .tabbar a.on svg { color: var(--red); }
  .tabbar .dot { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; min-width: 17px; height: 17px; font-size: 10px; }
  .main { padding: 16px 16px calc(92px + env(safe-area-inset-bottom)); }
  .head { margin-bottom: 14px; }
  .head h1 { font-size: 21px; }
  .head .tools { width: 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 12px 14px; }
  .stat b { font-size: 20px; }
  .stats.tight .stat b { font-size: 16px; }
  .grid2, .grid3, .form-row { grid-template-columns: 1fr; }
  .live { grid-template-columns: 1fr; height: auto; }
  .map-box { height: 46vh; }
  .panel-r { max-height: 60vh; }
  th, td { white-space: nowrap; padding: 11px 12px; }
  td.clip { max-width: 200px; }
  .toolbar .input.auto { max-width: none; flex: 1 1 140px; }
  .grow-input { min-width: 100%; }
  .range, .sec-bar > .range { width: 100%; }
  .range > .seg { width: 100%; }
  .range-custom { width: 100%; }
  .range-custom .input { flex: 1; width: auto; }
  .kv { grid-template-columns: 108px 1fr; }
  .drawer, .drawer.wide { width: 100%; }
  .drawer header { padding-left: 16px; padding-right: 16px; }
  .drawer .body { padding-left: 16px; padding-right: 16px; }
  .modal { padding: 20px; }
  .modal .foot { flex-direction: column-reverse; }
  .modal .foot .btn { width: 100%; height: 46px; }
  .btn-row .btn { flex: 1 1 auto; }
  .toasts { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .hide-s { display: none; }
  .sec-bar { margin-top: 20px; }
  .mini-map { height: 220px; }
}
@media (max-width: 380px) {
  .sheet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat b { font-size: 18px; }
}

/* Dokunmatik: 16 px altı yazı kutusu iOS'ta otomatik yakınlaştırır — engelle. Hedefler parmak boyutunda. */
@media (hover: none) and (pointer: coarse) {
  .input, .input.sm, .search-input, select, textarea { font-size: 16px; }
  .input.sm { height: 40px; }
  .btn.sm { height: 36px; }
  .seg button { height: 34px; }
}

/* Leaflet düzeltmeleri */
.leaflet-container { font-family: inherit; }
.leaflet-control-attribution { font-size: 10px; }
