/* ==================================================================
   Karavan Rota Paneli – style.css
   Yapı: 1) Tema değişkenleri  2) Temel  3) Kenar çubuğu  4) Liste
         5) Harita & kontroller  6) Detay paneli  7) Bileşenler
         8) Animasyonlar  9) Responsive
   ================================================================== */

/* ---------- 1) TEMA DEĞİŞKENLERİ ---------- */
:root,
[data-theme="dark"] {
  --bg: #0b0f17;
  --surface: #111723;
  --surface-2: #171f2e;
  --surface-3: #1e283a;
  --border: #243047;
  --text: #e6ebf5;
  --muted: #8591a8;
  --accent: #38bdf8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --glass: rgba(17, 23, 35, .88);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f2f5fa;
  --surface-3: #e7ecf4;
  --border: #dde3ee;
  --text: #121826;
  --muted: #5f6b82;
  --accent: #0284c7;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 10px 30px rgba(16, 24, 40, .12);
  --glass: rgba(255, 255, 255, .92);
  color-scheme: light;
}

:root {
  --sidebar-w: 360px;
  --detail-w: 380px;
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- 2) TEMEL ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
svg { width: 1em; height: 1em; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 12px; font-weight: 400; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 3) KENAR ÇUBUĞU ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: margin-left .3s var(--ease);
  z-index: 20;
}

body.sidebar-collapsed .sidebar { margin-left: calc(-1 * var(--sidebar-w)); }

.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand__logo {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  font-size: 20px;
}
.brand h1 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.brand p { font-size: 12px; color: var(--muted); }

.sidebar__actions { display: flex; gap: 4px; }

.sidebar__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px 16px;
}

.sidebar__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}
.sidebar__footer .btn { flex: 1; }

/* Veritabanı dosyası açıkta uyarısı */
.security-warning {
  flex-basis: 100%;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  font-size: 12px;
  color: #fff;
  background: var(--danger);
  border-radius: var(--radius-sm);
}
.security-warning code {
  padding: 0 4px;
  font-size: 11px;
  background: rgba(0, 0, 0, .25);
  border-radius: 4px;
  word-break: break-word;
}

/* Veritabanı bağlantı durumu */
.sync-status {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
}
.sync-status::before {
  content: '';
  flex-shrink: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 20%, transparent);
}
.sync-status[data-mode="online"]::before {
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent);
}
.sync-status[data-mode="offline"] { color: var(--warning); }

/* Rotadan çıkar butonu (liste öğesi) */
.stop__remove {
  flex-shrink: 0;
  align-self: flex-start;
  display: grid; place-items: center;
  width: 26px; height: 26px;
  padding: 0;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  opacity: 0;
  transition: opacity .15s, color .15s, border-color .15s;
}
.stop:hover .stop__remove,
.stop:focus-within .stop__remove { opacity: 1; }
.stop__remove:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
@media (hover: none) { .stop__remove { opacity: .7; } }

/* Rotadan çıkarılanlar listesi */
.excluded {
  margin-top: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.excluded summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.excluded summary::-webkit-details-marker { display: none; }
.excluded__list { list-style: none; margin: 0; padding: 0 8px 8px; display: grid; gap: 4px; }
.excluded__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-2);
}
.excluded__item div { display: grid; min-width: 0; }
.excluded__item strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.excluded__item .btn { flex-shrink: 0; }

.btn--block { width: 100%; margin-top: 14px; }

.btn--danger-solid { color: #fff; background: var(--danger); border-color: var(--danger); padding: 8px 14px; }
.btn--danger-solid:hover { border-color: var(--danger); filter: brightness(1.1); }
.btn--danger-solid:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn--danger-solid.is-armed { animation: breathe 1s ease-in-out infinite; box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 35%, transparent); }

/* ---------- SEÇMELİ SIFIRLAMA PENCERESİ ---------- */
.modal {
  width: min(560px, calc(100vw - 32px));
  max-height: min(86dvh, 760px);
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.modal[open] { display: flex; animation: modal-in .2s var(--ease); }
.modal::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px); }
.modal__inner { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.modal__header h2 { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.modal__body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px; display: grid; gap: 14px; align-content: start; }
.modal__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}
.modal__footer .reset-summary { flex: 1; min-width: 140px; }
.modal .link-btn {
  margin: 0;
  padding: 0;
  font-size: 12px;
  background: none;
  border: 0;
  cursor: pointer;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* Kapsam seçimi */
.reset-scope { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
.reset-scope legend { margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.segmented--2 { grid-template-columns: 1fr 1fr; }
.segmented__radio { position: relative; display: block; cursor: pointer; }
.segmented__radio input { position: absolute; opacity: 0; pointer-events: none; }
.segmented__radio span {
  display: block;
  padding: 7px 6px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 7px;
  transition: all .15s;
}
.segmented__radio input:checked + span { color: var(--text); background: var(--surface-3); border-color: var(--border); }
.segmented__radio input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.reset-stops { display: grid; gap: 6px; }
.reset-stops__actions { display: flex; gap: 14px; }
.reset-stops__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 10px;
  max-height: 180px;
  overflow-y: auto;
  padding: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.reset-stop { display: flex; align-items: center; gap: 7px; padding: 3px 0; font-size: 12px; cursor: pointer; min-width: 0; }
.reset-stop span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Veri türü grupları */
#resetGroups { display: grid; gap: 14px; }
.reset-group { display: grid; gap: 4px; }
.reset-group__head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.reset-group__head h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.reset-group__head .link-btn { margin-left: auto; }
.tag--muted { color: var(--muted); background: var(--surface-2); }

.reset-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.reset-option:hover { border-color: var(--muted); }
.reset-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--danger) 60%, transparent);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}
.reset-option.is-empty { opacity: .5; cursor: default; }
.reset-option.is-empty:hover { border-color: var(--border); }
.reset-option input { flex-shrink: 0; width: 16px; height: 16px; accent-color: var(--danger); }
.reset-option__text { flex: 1; min-width: 0; display: grid; }
.reset-option__text strong { font-size: 13px; font-weight: 600; }
.reset-option__text small { font-size: 11px; color: var(--muted); }
.reset-option__count { flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--muted); }

@media (max-width: 767px) {
  .modal { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .reset-stops__list { grid-template-columns: 1fr; }
  .modal__footer .btn { flex: 1; }
  .modal__footer .reset-summary { flex-basis: 100%; order: -1; }
}

/* İstatistikler */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat {
  display: flex;
  flex-direction: column;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 0;
}
.stat__label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat__value { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat__sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.progress {
  height: 6px;
  margin-top: 14px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
}
.progress__bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: inherit;
  transition: width .5s var(--ease);
}
.progress__label { margin-top: 6px; font-size: 12px; color: var(--muted); }

.toolbar { margin: 12px 0 10px; display: grid; gap: 10px; }

/* Sekmeler (Duraklar / Yakıt) */
.tabs {
  display: flex;
  gap: 4px;
  margin-top: 16px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tab {
  flex: 1 1 auto;               /* uzun başlık ("Navigasyon") daha fazla yer alır */
  padding: 7px 4px;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); background: var(--surface-3); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }

/* ---------- NAVİGASYON SEKMESİ ---------- */
.nav { display: grid; gap: 12px; padding-top: 12px; }
.nav .card { background: var(--surface-2); }
.nav-intro .hint { margin-top: 0; }
.nav-intro .switch { margin-top: 12px; }
.nav-intro__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.nav-parts { display: grid; gap: 10px; }
.nav-part {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.nav-part__head { display: flex; align-items: flex-start; gap: 10px; }
.nav-part__badge {
  flex-shrink: 0;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--bg);
  background: var(--accent);
  border-radius: 99px;
}
.nav-part__title { display: grid; min-width: 0; }
.nav-part__title strong { font-size: 13px; line-height: 1.35; }
.nav-part__title span { font-size: 11px; color: var(--muted); }

.nav-part__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }

.nav-part__stops {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.nav-part__stops li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 3px;
  font-size: 11.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
}
.nav-part__stops li.is-visited { color: var(--muted); text-decoration: line-through; }
.nav-part__order {
  display: grid; place-items: center;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-3);
  border-radius: 99px;
}

.nav-part__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.nav-part__actions .btn { text-decoration: none; }
.nav-part__actions .btn--primary { flex: 1 1 auto; }

/* ---------- YAKIT SEKMESİ ---------- */
.fuel { display: grid; gap: 12px; padding-top: 12px; }
.fuel .card { background: var(--surface-2); }
.fuel .input { background: var(--surface); }

.field { display: grid; gap: 4px; min-width: 0; }
.field__label { font-size: 11px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fuel-form { display: grid; gap: 10px; }

/* Birimli input: "12 | L/100km" */
.input-unit { position: relative; display: block; }
.input-unit .input { padding-right: 62px; }
.input-unit > span {
  position: absolute;
  top: 50%; right: 10px;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
}

.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
.form-error { font-size: 12px; color: var(--danger); }

.fuel-form__footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fuel-form__footer strong { font-size: 13px; }

.fuel-estimate { display: grid; gap: 6px; margin-top: 12px; }
.fuel-estimate .hint { margin-top: 0; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.kv span { color: var(--muted); }
.kv--hl {
  padding: 8px 10px;
  margin: 2px -2px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 8px;
}
.kv--hl span { color: var(--text); font-weight: 500; }
.kv--hl strong { font-size: 16px; color: var(--accent); }

.section-title { margin-top: 4px; font-size: 13px; font-weight: 600; }
.stats--2 { grid-template-columns: repeat(2, 1fr) !important; }

.fuel-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fuel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.fuel-item__icon {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  background: var(--surface-3);
  border-radius: 8px;
}
.fuel-item__body { flex: 1; min-width: 0; display: grid; }
.fuel-item__body strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fuel-item__body span { font-size: 12px; color: var(--muted); }
.fuel-item__total { flex-shrink: 0; font-size: 13px; font-weight: 700; }
.icon-btn--sm { width: 26px; height: 26px; font-size: 12px; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--muted);
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- 4) DURAK LİSTESİ ---------- */
.stop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.stop {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: background .15s, border-color .15s;
}
.stop:hover { background: var(--surface-2); }
.stop.is-selected { background: var(--surface-2); border-color: var(--warning); }

.stop__check {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 26px; height: 26px;
  margin-top: 1px;
  padding: 0;
  font-size: 16px;
  color: transparent;
  background: transparent;
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: all .2s var(--ease);
}
.stop__check:hover { border-color: var(--success); color: color-mix(in srgb, var(--success) 50%, transparent); }
.stop.is-visited .stop__check { background: var(--success); border-color: var(--success); color: #fff; }
.stop__check.pop { animation: pop .35s var(--ease); }

.stop__body { flex: 1; min-width: 0; cursor: pointer; outline-offset: 4px; border-radius: 6px; }

.stop__title { display: flex; align-items: center; gap: 6px; }
.stop__order {
  flex-shrink: 0;
  min-width: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.stop__name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stop.is-visited .stop__name { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }

.note-icon { display: none; color: var(--muted); font-size: 14px; }
.stop.has-notes .note-icon { display: inline-flex; }

.stop__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 2px;
  padding-left: 26px;
  font-size: 12px;
  color: var(--muted);
}

.stop__badges { display: flex; gap: 3px; margin-top: 6px; padding-left: 26px; }
.mini-badge {
  display: grid; place-items: center;
  width: 22px; height: 22px;
  font-size: 12px;
  background: var(--surface-3);
  border-radius: 6px;
}

.drone-dot { display: inline-flex; align-items: center; gap: 4px; }
.drone-dot::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 20%, transparent);
}

.empty { padding: 24px; text-align: center; color: var(--muted); }

/* UYARI İKONU (çamur / sel riski) – dikkat çekici nabız efekti */
.warn-icon {
  position: relative;
  flex-shrink: 0;
  display: inline-grid; place-items: center;
  font-size: 15px;
  color: var(--warning);
}
.warn-icon::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--warning);
  opacity: 0;
  animation: pulse 2s ease-out infinite;
}
.warn-icon--lg { font-size: 18px; }

/* ---------- 5) HARİTA & KONTROLLER ---------- */
.map-wrap { position: relative; flex: 1; min-width: 0; height: 100dvh; }
.map { position: absolute; inset: 0; background: var(--bg); }

.fab {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 42px; height: 42px;
  padding: 0 12px;
  font-size: 17px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: transform .15s, border-color .15s;
}
.fab:hover { border-color: var(--accent); }
.fab:active { transform: scale(.95); }
.fab.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.fab.is-loading { animation: breathe 1s ease-in-out infinite; }
.fab span { font-size: 13px; font-weight: 600; }
.fab svg { font-size: 20px; }

.fab--menu {
  position: absolute;
  top: 16px; left: 16px;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
body.sidebar-collapsed .fab--menu { opacity: 1; pointer-events: auto; }
body.sidebar-collapsed.has-detail .fab--menu { opacity: 0; pointer-events: none; }

.map-controls {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend {
  position: absolute;
  left: 16px; bottom: 30px;
  z-index: 4;
  display: flex;
  gap: 12px;
  padding: 7px 12px;
  font-size: 12px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 99px;
  backdrop-filter: blur(10px);
  transition: left .3s var(--ease);
}
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
body.has-detail .legend { left: calc(var(--detail-w) + 32px); }

.map-error {
  position: absolute;
  top: 50%; left: 50%;
  z-index: 8;
  width: min(90%, 380px);
  padding: 20px;
  transform: translate(-50%, -50%);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.map-error p { margin-top: 6px; color: var(--muted); }

/* Google InfoWindow tema uyumu */
.gm-style .gm-style-iw-c { background: var(--surface) !important; border-radius: 12px !important; padding: 0 !important; box-shadow: var(--shadow) !important; }
.gm-style .gm-style-iw-d { overflow: auto !important; }
.gm-style .gm-style-iw-tc::after { background: var(--surface) !important; }
.gm-style .gm-style-iw-chr { height: 0; }
.gm-style .gm-style-iw-chr button { position: absolute !important; top: 2px; right: 2px; filter: invert(var(--iw-invert, 1)); }
[data-theme="light"] .gm-style .gm-style-iw-chr button { --iw-invert: 0; }

.iw { display: grid; gap: 4px; padding: 12px 36px 12px 14px; color: var(--text); font-family: 'Inter', sans-serif; }
.iw__title { font-size: 14px; }
.iw__meta { font-size: 12px; color: var(--muted); }
.iw__btn {
  margin-top: 6px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.iw__btn.is-visited { background: var(--success); border-color: var(--success); color: #fff; }

/* ---------- 6) DETAY PANELİ ---------- */
.detail {
  position: absolute;
  top: 16px; left: 16px; bottom: 16px;
  z-index: 7;
  width: var(--detail-w);
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  animation: slide-in .3s var(--ease);
  overflow: hidden;
}

.detail__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.detail__header h2 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 4px; }
.detail__header p { font-size: 13px; }

.eyebrow { font-size: 11px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }

.detail__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 20px;
  display: grid;
  align-content: start;
  gap: 12px;
}

/* GİDİLDİ BUTONU */
.visit-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 12px 14px;
  font-weight: 600;
  text-align: left;
  background: var(--surface-2);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  transition: all .25s var(--ease);
}
.visit-btn:hover { border-color: var(--success); }
.visit-btn__box {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  font-size: 18px;
  color: transparent;
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: all .25s var(--ease);
}
.visit-btn.is-visited {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--success) 50%, transparent);
}
.visit-btn.is-visited .visit-btn__box { background: var(--success); border-color: var(--success); color: #fff; animation: pop .35s var(--ease); }

/* KARTLAR */
.card {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card__title {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
}

.card--alert {
  border-color: color-mix(in srgb, var(--warning) 55%, transparent);
  background: color-mix(in srgb, var(--warning) 8%, var(--surface));
}
.card--alert .card__title { color: var(--warning); }

.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.alert { display: flex; gap: 10px; font-size: 13px; }
.alert__icon {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  font-size: 16px;
  background: var(--surface-2);
  border-radius: 8px;
}
.alert strong { font-size: 12px; }
.alert p { color: var(--muted); }
.alert--rain .alert__icon { background: color-mix(in srgb, var(--warning) 22%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--warning) 50%, transparent); }
.alert--border .alert__icon { background: color-mix(in srgb, var(--danger) 18%, transparent); }

/* PLAN */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-item { display: flex; flex-direction: column; min-width: 0; }
.plan-item__label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.plan-item__value { font-size: 15px; font-weight: 700; }
.plan-item__value--sm { font-size: 13px; font-weight: 500; }
.plan-item__sub { font-size: 12px; color: var(--muted); }

.stepper { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; }
.stepper button {
  width: 26px; height: 26px;
  padding: 0;
  font-size: 16px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.stepper button:hover { border-color: var(--accent); }
.stepper output { min-width: 50px; text-align: center; font-weight: 700; }

.link-btn {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}
.link-btn:hover { text-decoration: underline; }

/* DRONE */
.tag {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  color: #c4b5fd;
  background: rgba(167, 139, 250, .15);
  border-radius: 99px;
}
[data-theme="light"] .tag { color: #6d28d9; }

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.segmented__opt {
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  transition: all .15s;
}
.segmented__opt:hover { color: var(--text); }
.segmented__opt.is-active {
  color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, var(--surface));
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
}

.drone-status {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c);
}
.drone-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }

.hint { margin-top: 8px; font-size: 11px; color: var(--muted); }

/* AKTİVİTE ETİKETLERİ */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px 5px 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 99px;
  opacity: .75;
  transition: all .15s;
}
.badge:hover { opacity: 1; }
.badge.is-active {
  opacity: 1;
  color: var(--text);
  background: color-mix(in srgb, var(--c) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
}

.badges span.badge { cursor: default; }

/* REHBER (görülecek yerler, yol üstü, lezzetler, deneyimler) */
.guide { padding: 0; }
.guide__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  font-size: 13px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.guide__summary::-webkit-details-marker { display: none; }
.guide__summary::after {
  content: '';
  flex-shrink: 0;
  width: 7px; height: 7px;
  margin-left: 2px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s var(--ease);
}
.guide[open] > .guide__summary::after { transform: rotate(-135deg) translateY(-2px); }
.guide__title { flex: 1; min-width: 0; }
.guide__count {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 99px;
}
.guide__note {
  margin: 0 14px 10px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}
.guide__list { list-style: none; margin: 0; padding: 0 8px 8px; display: grid; gap: 2px; }

.guide-item {
  display: flex;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 8px;
  transition: background .15s;
}
.guide-item:hover { background: var(--surface-2); }
.guide-item__check {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 20px; height: 20px;
  margin-top: 1px;
  padding: 0;
  font-size: 13px;
  color: transparent;
  background: transparent;
  border: 2px solid var(--border);
  border-radius: 6px;
  transition: all .2s var(--ease);
}
.guide-item__check:hover { border-color: var(--success); }
.guide-item.is-done .guide-item__check { background: var(--success); border-color: var(--success); color: #fff; }
.guide-item.is-done .guide-item__title strong,
.guide-item.is-done .guide-item__text { color: var(--muted); text-decoration: line-through; }

.guide-item__body { flex: 1; min-width: 0; }
.guide-item__title { display: flex; align-items: baseline; gap: 6px; font-size: 13px; }
.guide-item__icon { flex-shrink: 0; font-size: 13px; }
.guide-item__meta { margin-top: 1px; font-size: 11px; color: var(--accent); }
.guide-item__meta a { color: inherit; text-decoration: none; }
.guide-item__meta a:hover { text-decoration: underline; }
.guide-item p { margin-top: 2px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.guide-item p.guide-item__text { margin-top: 0; font-size: 13px; color: var(--text); }

/* ANAHTAR (switch) */
.switch { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  position: relative;
  flex-shrink: 0;
  width: 36px; height: 20px;
  background: var(--surface-3);
  border-radius: 99px;
  transition: background .2s;
}
.switch__track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s var(--ease);
}
.switch input:checked + .switch__track { background: var(--warning); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* NOT */
.save-state { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--success); }

/* ---------- 7) GENEL BİLEŞENLER ---------- */
.input {
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.input--notes { min-height: 140px; line-height: 1.6; margin-bottom: 4px; }

.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  padding: 0;
  font-size: 17px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  transition: all .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .15s;
}
.btn:hover { border-color: var(--muted); }
.btn--primary { color: var(--bg); background: var(--accent); border-color: var(--accent); padding: 8px 16px; }
.btn--primary:hover { border-color: var(--accent); filter: brightness(1.1); }
.btn--danger { color: var(--danger); }
.btn--danger:hover { border-color: var(--danger); }

.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  background: var(--text);
  color: var(--bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: all .25s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.has-action.is-visible { display: flex; align-items: center; gap: 14px; pointer-events: auto; }
.toast__action {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 7px;
}
.toast--error { background: var(--danger); color: #fff; }

.backdrop { display: none; }

/* ---------- 8) ANİMASYONLAR ---------- */
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
@keyframes pulse {
  0% { transform: scale(.6); opacity: .45; }
  100% { transform: scale(1.8); opacity: 0; }
}
@keyframes slide-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: none; }
}
@keyframes sheet-up {
  from { transform: translateY(100%); }
  to { transform: none; }
}
@keyframes breathe {
  50% { opacity: .5; }
}
@keyframes leave {
  to { opacity: 0; transform: translateX(-16px); }
}
.stop.is-leaving { animation: leave .25s var(--ease) forwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 9) RESPONSIVE ---------- */
@media (max-width: 1100px) {
  :root { --sidebar-w: 320px; --detail-w: 340px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* Mobil: liste soldan kayan çekmece, detay alttan açılan sayfa */
@media (max-width: 767px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(92vw, 400px);
    margin-left: 0 !important;
    transform: translateX(-100%);
    transition: transform .3s var(--ease);
    box-shadow: var(--shadow);
  }
  body.sidebar-open .sidebar { transform: none; }

  .backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
  }
  body.sidebar-open .backdrop { opacity: 1; pointer-events: auto; }

  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat { padding: 8px; }
  .stat__value { font-size: 13px; }

  .fab--menu { opacity: 1; pointer-events: auto; }
  body.has-detail .fab--menu { opacity: 0; pointer-events: none; }

  .map-controls { top: 12px; right: 12px; }
  .fab--menu { top: 12px; left: 12px; }

  .legend { left: 50% !important; transform: translateX(-50%); bottom: 24px; }
  body.has-detail .legend { display: none; }

  .detail {
    top: auto; left: 0; right: 0; bottom: 0;
    width: auto;
    max-height: 78dvh;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    animation: sheet-up .3s var(--ease);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .detail::before {
    content: '';
    position: absolute;
    top: 6px; left: 50%;
    width: 40px; height: 4px;
    transform: translateX(-50%);
    background: var(--border);
    border-radius: 99px;
  }
  .detail__header { padding-top: 20px; }
}
