/* ==========================================================================
   Transfer Platformu - ortak stil (mobil öncelikli)
   ========================================================================== */
:root {
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f8fafc; --border: #e2e8f0;
  --text: #1e293b; --muted: #64748b; --primary: #0f6fde; --primary-d: #0b57b0; --primary-l: #e8f1fd;
  --ok: #138a4b; --ok-l: #e5f6ec; --warn: #b45309; --warn-l: #fef3e2; --err: #c62828; --err-l: #fdecec;
  --info: #0e7490; --info-l: #e3f5f9; --gray-l: #eef2f6;
  --radius: 10px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 2px 8px rgba(15,23,42,.05);
  --nav-w: 232px; --top-h: 56px;
  font-size: 15px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f172a; --surface: #182235; --surface-2: #1e2a40; --border: #2c3a52; --text: #e2e8f0; --muted: #94a3b8;
    --primary: #4b9bff; --primary-d: #2f7fe6; --primary-l: #1c3150; --ok-l: #14342a; --warn-l: #3a2a12; --err-l: #3d1c1c; --info-l: #133640; --gray-l: #243149;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.35rem; margin: 0 0 12px; }
h2 { font-size: 1.12rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
small, .muted { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
code { background: var(--gray-l); padding: 1px 5px; border-radius: 4px; font-size: .9em; }

/* ---- Yerleşim ---- */
.topbar { position: sticky; top: 0; z-index: 50; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .brand { font-weight: 700; font-size: 1.05rem; color: var(--text); white-space: nowrap; }
.topbar .brand span { color: var(--primary); }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: .85rem; color: var(--muted); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { position: relative; border: 0; background: transparent; color: var(--text); width: 44px; height: 44px; border-radius: 8px; cursor: pointer; font-size: 1.25rem; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--gray-l); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--err); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.layout { display: flex; min-height: calc(100vh - var(--top-h)); }
.sidenav { width: var(--nav-w); flex: 0 0 var(--nav-w); background: var(--surface); border-right: 1px solid var(--border); padding: 10px 8px; position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; }
.sidenav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--text); font-size: .93rem; min-height: 44px; }
.sidenav a:hover { background: var(--gray-l); text-decoration: none; }
.sidenav a.active { background: var(--primary-l); color: var(--primary); font-weight: 600; }
.sidenav .sec { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 12px 4px; }
.main { flex: 1; min-width: 0; padding: 16px; max-width: 1400px; }
#menuBtn { display: none; }
@media (max-width: 900px) {
  #menuBtn { display: inline-flex; }
  .sidenav { position: fixed; left: 0; top: var(--top-h); z-index: 60; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow); }
  body.nav-open .sidenav { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: var(--top-h) 0 0 0; background: rgba(0,0,0,.3); z-index: 55; }
  .main { padding: 12px; }
  .topbar .who { display: none; }
}
/* Şoför: alt sekme çubuğu */
.bottombar { position: fixed; bottom: 0; left: 0; right: 0; height: 60px; display: flex; background: var(--surface); border-top: 1px solid var(--border); z-index: 50; }
.bottombar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .75rem; color: var(--muted); }
.bottombar a.active { color: var(--primary); font-weight: 600; }
.bottombar a i { font-style: normal; font-size: 1.3rem; }
body.has-bottombar .main { padding-bottom: 80px; }

/* ---- Bileşenler ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 14px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 8px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); display: block; color: var(--text); }
.kpi:hover { text-decoration: none; border-color: var(--primary); }
.kpi .v { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.kpi .l { font-size: .8rem; color: var(--muted); }
.kpi.warn .v { color: var(--warn); } .kpi.err .v { color: var(--err); } .kpi.ok .v { color: var(--ok); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: .92rem; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--gray-l); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: .84rem; }
.btn.lg { min-height: 56px; font-size: 1.1rem; font-weight: 600; padding: 12px 18px; }
.btn.block { width: 100%; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--gray-l); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-l); color: var(--ok); } .badge.warn { background: var(--warn-l); color: var(--warn); }
.badge.err { background: var(--err-l); color: var(--err); } .badge.info { background: var(--info-l); color: var(--info); }
.badge.primary { background: var(--primary-l); color: var(--primary); }

/* Formlar */
label.f { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 3px; font-weight: 500; }
.field { margin-bottom: 10px; min-width: 0; }
.field.err input, .field.err select, .field.err textarea { border-color: var(--err); }
.field .msg { color: var(--err); font-size: .78rem; margin-top: 2px; }
input, select, textarea { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 16px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-l); border-color: var(--primary); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; vertical-align: middle; margin: 0 6px 0 0; }
.check { display: inline-flex; align-items: center; margin: 4px 14px 4px 0; font-size: .92rem; cursor: pointer; min-height: 32px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; }
.form-grid .full { grid-column: 1 / -1; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.filters .field { margin: 0; min-width: 140px; flex: 1 1 140px; max-width: 240px; }

/* Tablo -> mobilde kart */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl tr.click { cursor: pointer; }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; }
@media (max-width: 700px) {
  .tbl.responsive thead { display: none; }
  .tbl.responsive tr { display: block; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; background: var(--surface); padding: 4px 0; }
  .tbl.responsive td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 6px 10px; text-align: right; }
  .tbl.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; text-align: left; flex: 0 0 40%; }
  .tbl.responsive td.num { text-align: right; }
  .tbl.responsive td.actions::before { content: ""; }
}
.empty { text-align: center; color: var(--muted); padding: 24px 8px; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 10px; font-size: .85rem; color: var(--muted); }

/* Sekmeler */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; min-height: 44px; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 30px 10px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 640px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal.wide { max-width: 960px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.modal-h h3 { margin: 0; }
.modal-b { padding: 16px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
@media (max-width: 560px) { .modal-bg { padding: 0; } .modal { border-radius: 0; min-height: 100vh; } }

/* Toast */
#toasts { position: fixed; right: 12px; bottom: 12px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 24px); }
.toast { background: #1e293b; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); font-size: .9rem; max-width: 420px; }
.toast.err { background: var(--err); } .toast.ok { background: var(--ok); }
body.has-bottombar #toasts { bottom: 72px; }

/* Zaman çizelgesi */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; border-left: 2px solid var(--border); margin-left: 6px; font-size: .88rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline li small { display: block; }

.map { width: 100%; height: 420px; border-radius: var(--radius); border: 1px solid var(--border); z-index: 0; }
.map.tall { height: calc(100vh - 190px); min-height: 380px; }
.map.short { height: 260px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: .9rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.big-status { font-size: 1.1rem; font-weight: 700; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.notif-panel { position: absolute; right: 8px; top: calc(var(--top-h) - 4px); width: min(380px, calc(100vw - 16px)); max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); z-index: 90; }
.notif-panel .n { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: .88rem; cursor: pointer; }
.notif-panel .n.unread { background: var(--primary-l); }
.notif-panel .n:hover { background: var(--gray-l); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-box { width: 100%; max-width: 400px; }
.gantt { position: relative; overflow-x: auto; }
.gantt .lane { display: flex; align-items: center; border-bottom: 1px solid var(--border); min-height: 44px; }
.gantt .lane .lbl { flex: 0 0 170px; font-size: .82rem; padding: 4px 8px; position: sticky; left: 0; background: var(--surface); z-index: 2; }
.gantt .lane .track { position: relative; flex: 0 0 1440px; height: 40px; background-image: repeating-linear-gradient(90deg, transparent 0 59px, var(--border) 59px 60px); }
.gantt .job { position: absolute; top: 6px; height: 28px; border-radius: 6px; background: var(--primary); color: #fff; font-size: .72rem; padding: 2px 6px; overflow: hidden; white-space: nowrap; cursor: pointer; }
.gantt .job.done { background: var(--ok); } .gantt .job.open { background: var(--warn); }
.stars { color: #f5a623; letter-spacing: 1px; }
.stars-input button { font-size: 1.8rem; border: 0; background: transparent; color: var(--border); cursor: pointer; padding: 0 2px; }
.stars-input button.on { color: #f5a623; }
.hide { display: none !important; }
.right { text-align: right; } .nowrap { white-space: nowrap; } .mt { margin-top: 12px; } .mb0 { margin-bottom: 0; }
.alert { padding: 10px 12px; border-radius: 8px; font-size: .9rem; margin-bottom: 12px; }
.alert.warn { background: var(--warn-l); color: var(--warn); } .alert.err { background: var(--err-l); color: var(--err); }
.alert.info { background: var(--info-l); color: var(--info); } .alert.ok { background: var(--ok-l); color: var(--ok); }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: sp 0.8s linear infinite; vertical-align: middle; }
@keyframes sp { to { transform: rotate(360deg); } }
.vehicle-marker { background: none; border: 0; }
.vehicle-marker div { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; }
.mb { margin-bottom: 12px; } .sel-col { width: 32px; }
/* Hızlı durum paneli */
.quick .qrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border); }
.quick .qbtns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sm-select { min-height: 32px; width: auto; padding: 4px 8px; font-size: .84rem; }
.quick-driver .btn.lg { margin-top: 8px; }
.quick-driver .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
