/* SpeedyGo Yönetim — sade, beyaz, premium. Yazı tipi sunucudan (harici istek yok). */
@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);
  --side: 232px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ── Giriş ── */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; 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; }
.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; }
.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); }
.input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--white); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
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; }
.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;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn:hover { background: var(--soft); }
.btn:active { transform: translateY(1px); }
.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; }
.btn.danger { color: var(--red-ink); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; height: 46px; }

/* ── İskelet ── */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100%; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 14px; border-right: 1px solid var(--line); background: var(--white);
}
.side .brand { padding: 0 10px 22px; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-s);
  color: var(--ink-2); text-decoration: none; font-weight: 550;
}
.nav a 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); }
.nav a.on svg { color: var(--red); }
.nav .dot { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line-2); display: grid; gap: 10px; }
.who { display: grid; }
.who b { font-weight: 650; }
.who span { color: var(--muted); font-size: 12.5px; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 550; cursor: pointer; text-align: left; }
.link:hover { color: var(--ink); }
.live-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.live-state i { width: 8px; height: 8px; border-radius: 50%; background: #c7c9ce; }
.live-state.on i { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.main { min-width: 0; padding: 28px 36px 48px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 24px; letter-spacing: -0.025em; font-weight: 700; }
.head .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── 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; }
.stat { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.stat span { color: var(--muted); font-size: 12.5px; font-weight: 550; }
.stat b { display: block; margin-top: 4px; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.stat b small { font-size: 14px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.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); }
.muted { color: var(--muted); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

.seg { display: inline-flex; padding: 3px; background: var(--soft); border-radius: 10px; gap: 2px; }
.seg button { height: 30px; padding: 0 12px; border: 0; background: none; border-radius: 8px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(29, 31, 35, 0.1); }

/* ── Tablo ── */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
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; }
td { padding: 13px 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); }
td.r, th.r { text-align: right; }
td .sub { display: block; color: var(--muted); font-size: 12.5px; }

/* ── Canlı ── */
.live { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; height: calc(100vh - 250px); min-height: 460px; }
.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 .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; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.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); }
.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; }

/* ── Çekmece ve pencere ── */
.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(440px, 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.2s ease;
}
.drawer header { padding: 20px 24px 14px; display: flex; align-items: center; justify-content: space-between; }
.drawer header h2 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.drawer .body { padding: 0 24px 24px; overflow: auto; flex: 1; }
.x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--soft); cursor: pointer; font-size: 18px; line-height: 1; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 12px; padding: 14px 0; border-top: 1px solid var(--line-2); margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; }
.actions { display: grid; gap: 8px; margin-top: 8px; }
.modal {
  position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 32px)); background: var(--white); border-radius: 16px; padding: 24px;
  box-shadow: var(--shadow); animation: pop 0.15s ease;
}
.modal { max-height: 92vh; overflow: auto; }
.modal.wide { width: min(560px, 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: 340px; }
.toast.err { background: var(--red-ink); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%); } }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.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); }

/* ── Dar ekran ── */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; top: auto; height: auto;
    flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line);
  }
  .side .brand, .side-foot { display: none; }
  .nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .nav a { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 11px; position: relative; text-align: center; }
  .nav .dot { position: absolute; top: 2px; right: calc(50% - 20px); margin: 0; }
  .main { padding: 18px 16px 96px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat b { font-size: 22px; }
  .live { grid-template-columns: 1fr; height: auto; }
  .map-box { height: 46vh; }
  .panel-r { max-height: 50vh; }
  .grid2, .form-row { grid-template-columns: 1fr; }
  .head h1 { font-size: 21px; }
  .head .tools { width: 100%; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg button { white-space: nowrap; flex: none; }
  th, td { white-space: nowrap; padding: 12px 14px; }
  .toasts { left: 16px; right: 16px; bottom: 84px; }
  .mobile-out { display: inline-flex !important; }
}
.mobile-out { display: none !important; }

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