:root {
  --bg: #f4f2ec;
  --panel: #ffffff;
  --ink: #1c1917;
  --stone: #14110b;
  --muted: #5b636d;
  --line: #e3dfd4;
  --gold: #a16207;
  --gold-hover: #854d0e;
  --gold-soft: #f6edd8;
  --gold-ink: #7a5a12;
  --gold-bright: #c9a24b;
  --on-stone: #c9c2b3;
  --green: #1e7a48;
  --green-soft: #e2f3e9;
  --amber: #9a6400;
  --amber-soft: #fbf0d9;
  --red: #c62828;
  --red-dark: #8e1b1b;
  --red-soft: #fbe6e6;
  --grey: #6b7280;
  --grey-soft: #e9e6de;
  --shadow: 0 4px 18px rgb(22 25 29 / .16);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 system-ui, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
[hidden] { display: none !important; }
h1 { font-size: 16px; margin: 0; }
h2 { font-size: 15px; margin: 0; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

input, select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
label { display: block; font-size: 13px; font-weight: 600; flex: 1; min-width: 0; }
.help { color: var(--muted); font-size: 13px; }
.error { color: var(--red); font-size: 13px; }

.btn {
  height: 38px; padding: 0 14px; border-radius: 8px; white-space: nowrap;
  border: 1px solid var(--line); background: #fff; font-weight: 600;
}
.btn:hover:not(:disabled) { background: var(--bg); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--gold-hover); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover:not(:disabled) { background: var(--red-dark); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.text-btn { border: 0; background: none; color: var(--muted); padding: 6px; }
.text-btn:hover { color: var(--ink); }
.text-btn.danger { color: var(--red); }
.icon-btn { border: 0; background: none; font-size: 22px; line-height: 1; width: 32px; height: 32px; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: var(--bg); color: var(--ink); }

/* Üst çubuk */
.top {
  display: flex; align-items: center; gap: 20px; flex: none;
  padding: 8px 16px; background: var(--stone); color: var(--on-stone);
}
.top :focus-visible { outline-color: var(--gold-bright); }
.top .text-btn { color: var(--on-stone); }
.top .text-btn:hover { color: #fff; }
.top .dot.online { background: #4ec98a; }
.top .dot.no_gps { background: #e8b23a; }
.top .dot.offline { background: #f07070; }
.top .dot.off_hours { background: #a8a196; }
.brand { display: flex; align-items: center; }
.brand h1 { line-height: 0; }
.brand img { height: 34px; width: auto; }
.summary { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--on-stone); }
.summary b { color: #fff; font-variant-numeric: tabular-nums; margin-right: 3px; }
.summary span { display: inline-flex; align-items: center; gap: 5px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.conn { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 10px; background: var(--grey-soft); color: var(--muted); }
.conn.live { background: var(--green-soft); color: var(--green); }
.conn.down { background: var(--red-soft); color: var(--red); }
.chip-btn { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 10px; border: 0; background: var(--amber-soft); color: var(--amber); }
.stale { background: var(--red-soft); color: var(--red-dark); padding: 6px 16px; font-size: 13px; font-weight: 600; flex: none; }

.layout { flex: 1; display: flex; min-height: 0; }
.side { width: 360px; flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }

/* Sekmeler */
.tabs { display: flex; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 5; flex: none; }
.tabs button { flex: 1; height: 42px; border: 0; background: none; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--gold); }
.count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold-soft); color: var(--gold-ink); font-size: 12px; text-align: center; }
.tab { padding: 12px; }
.tab-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.tab-head input { margin: 0; flex: 1; min-width: 0; }
.tab-head .segment { flex: 1; }

.segment { display: flex; background: var(--bg); border-radius: 8px; padding: 3px; }
.segment button { flex: 1; height: 32px; border: 0; background: none; border-radius: 6px; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; padding: 0 8px; }
.segment button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .14); }

/* Avatar ve durum */
.avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--grey); }
.avatar.online { background: var(--green); }
.avatar.no_gps { background: var(--amber); }
.avatar.offline, .avatar.alarm { background: var(--red); }
.avatar.unpaired { background: var(--grey-soft); color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--grey); }
.dot.online { background: var(--green); }
.dot.no_gps { background: var(--amber); }
.dot.offline { background: var(--red); }

/* Ekip listesi */
.person { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; background: none; border-radius: 10px; text-align: left; }
.person:hover { background: var(--bg); }
.person.selected { background: var(--gold-soft); }
.person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-sub { color: var(--muted); font-size: 13px; }
.person-sub.bad { color: var(--red); font-weight: 600; }
.person-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.person-side .low { color: var(--red); font-weight: 700; }
.report-row { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.report-row label { margin-bottom: 4px; }
.report-controls { display: flex; gap: 8px; }
.report-controls input { margin: 0; flex: 1; min-width: 0; }
#route-pdf { margin-bottom: 14px; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* Uyarılar */
.alerts { flex: none; max-height: 190px; overflow-y: auto; }
.alerts:empty { display: none; }
.alert { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--amber-soft); border-bottom: 1px solid var(--line); font-size: 13px; }
.alert-text { flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: left; }
.alert-text small { color: var(--muted); display: block; font-size: 12px; }

/* Görevler */
.task { padding: 10px 4px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task-head { display: flex; gap: 8px; align-items: center; }
.task-head strong { flex: 1; min-width: 0; font-size: 15px; }
.badge { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 9px; background: var(--gold-soft); color: var(--gold-ink); flex: none; }
.badge.collection, .badge.done { background: var(--green-soft); color: var(--green); }
.badge.failed { background: var(--red-soft); color: var(--red); }
.badge.cancelled { background: var(--grey-soft); color: var(--muted); }
.task-meta { color: var(--muted); font-size: 13px; }
.task .text-btn { padding: 2px 0; font-size: 13px; text-decoration: underline; }

/* Ayarlar */
.settings { display: flex; flex-direction: column; gap: 18px; }
.group { display: flex; flex-direction: column; gap: 10px; }
.group + .group { border-top: 1px solid var(--line); padding-top: 16px; }
.row { display: flex; gap: 10px; }
.unit { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--muted); }
.unit input { width: 84px; flex: none; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 4px; }
.days { display: flex; gap: 4px; }
.days label { text-align: center; font-weight: 400; }
.days input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.days span { display: block; padding: 7px 0; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.days input:checked + span { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); font-weight: 700; }
.days input:focus-visible + span { outline: 2px solid var(--gold); }

/* Harita */
.map-wrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: #e8e6df; }
.map-btn { position: absolute; left: 56px; top: 10px; z-index: 800; height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: #fff; box-shadow: var(--shadow); font-weight: 600; font-size: 13px; }
.map-btn:hover { background: var(--bg); }

.pin-wrap { position: relative; width: 36px; height: 36px; }
.pin { width: 36px; height: 36px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 1px 6px rgb(0 0 0 / .45); background: var(--grey); }
.pin.online { background: var(--green); }
.pin.no_gps { background: var(--amber); }
.pin.offline { background: var(--red); }
.pin.alarm { background: var(--red); animation: pulse 1s infinite; }
.pin-wrap.selected .pin { outline: 3px solid var(--gold); outline-offset: 1px; }
.pin-label { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: rgb(255 255 255 / .94); color: var(--ink); font-size: 12px; font-weight: 600; padding: 0 6px; border-radius: 5px; box-shadow: 0 1px 3px rgb(0 0 0 / .25); }
.stop-pin { width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .35); }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgb(198 40 40 / .3); } }
@media (prefers-reduced-motion: reduce) { .pin.alarm { animation: none; } }

/* Ayrıntı kartı */
.detail { position: absolute; top: 10px; right: 10px; bottom: 10px; width: 340px; z-index: 850; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.detail-head { display: flex; align-items: center; gap: 10px; padding: 12px; }
.detail-title { flex: 1; min-width: 0; }
.detail-title h2 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail > .segment { margin: 0 12px; flex: none; }
.detail-body { flex: 1; overflow-y: auto; padding: 12px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.facts a { color: var(--gold); }
.facts .low { color: var(--red); }
.button-row { display: flex; gap: 8px; margin-bottom: 14px; }
.button-row .btn { flex: 1; }
.btn.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
.detail h3 { font-size: 14px; margin: 0 0 4px; }
.subhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.more { display: flex; gap: 8px; margin-top: 8px; }
.notice { background: var(--gold-soft); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.notice p { margin-bottom: 8px; }

.date-nav { display: flex; gap: 6px; margin-bottom: 12px; }
.date-nav input { margin: 0; flex: 1; min-width: 0; text-align: center; }
.date-nav .btn { width: 38px; padding: 0; font-size: 18px; flex: none; }
.route-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.route-stats div { background: var(--bg); border-radius: 8px; padding: 7px 4px; text-align: center; }
.route-stats strong { display: block; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.route-stats span { color: var(--muted); font-size: 12px; }

/* Oynatma */
.route-play { background: var(--bg); border-radius: 10px; padding: 10px; margin-bottom: 12px; position: sticky; top: -12px; z-index: 2; box-shadow: 0 6px 10px -8px rgb(0 0 0 / .3); }
.play-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.play-row .btn { min-width: 76px; }
.play-time { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; flex: 1; }
.segment.speed { background: #fff; }
.segment.speed button { height: 28px; padding: 0 7px; font-size: 12px; }
.segment.speed button.active { background: var(--gold-soft); color: var(--gold-ink); box-shadow: none; }
#play-range { width: 100%; height: 28px; margin: 0; padding: 0; border: 0; background: none; accent-color: var(--gold); }
.legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend-bar { flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgb(14 165 233), rgb(124 58 237)); }

/* Günün zaman akışı */
.day-timeline { list-style: none; margin: 0 0 14px; padding: 0; position: relative; }
.day-timeline li button { display: grid; grid-template-columns: 92px 14px 1fr; gap: 8px; align-items: start; width: 100%; border: 0; background: none; padding: 7px 6px; border-radius: 8px; text-align: left; }
.day-timeline li.now button { background: var(--gold-soft); }
.tl-time { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; white-space: nowrap; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; background: var(--grey); position: relative; }
.tl-body { display: flex; flex-direction: column; min-width: 0; }
.tl-body strong { font-size: 14px; }
.tl-body small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-timeline .start .tl-dot { background: var(--green); }
.day-timeline .end .tl-dot { background: var(--red); }
.day-timeline .move .tl-dot { background: rgb(14 165 233); border-radius: 3px; }
.day-timeline .stop .tl-dot { background: var(--gold); }
.day-timeline .gap .tl-dot { background: #fff; border: 2px dashed var(--grey); }
.day-timeline .gap .tl-body strong { color: var(--muted); }
.day-timeline .task .tl-dot { background: var(--green); border-radius: 3px; }
.day-timeline .task.failed .tl-dot { background: var(--red); }
.day-timeline .alert .tl-dot { background: var(--amber); transform: rotate(45deg); border-radius: 2px; }
.day-timeline .alert.panic .tl-dot { background: var(--red); }
.day-timeline .alert.panic strong { color: var(--red); }

/* Haritadaki rota işaretleri */
.route-arrow { width: 14px; height: 14px; display: flex; align-items: center; justify-content: center; }
.route-arrow::before { content: ""; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid currentColor; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff); }
.edge-pin { width: 30px; height: 30px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 1px 5px rgb(0 0 0 / .4); }
.edge-pin.start { background: var(--green); }
.edge-pin.end { background: var(--red); }
.event-pin { width: 22px; height: 22px; border-radius: 6px; color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .35); background: var(--green); }
.event-pin.failed { background: var(--red); }
.event-pin.alert { background: var(--amber); }
.event-pin.alert.panic { background: var(--red); }
.pin.playhead { background: var(--ink); outline: 3px solid var(--gold); }
.pin.playhead.in-gap { opacity: .45; }
.leaflet-tooltip.stop-label { background: rgb(255 255 255 / .95); border: 0; border-radius: 6px; box-shadow: 0 1px 4px rgb(0 0 0 / .3); padding: 2px 7px; font: 600 12px system-ui, "Segoe UI", sans-serif; color: var(--ink); font-variant-numeric: tabular-nums; }
.leaflet-tooltip.stop-label::before { display: none; }
.leaflet-tooltip.stop-label.edge.start { color: var(--green); }
.leaflet-tooltip.stop-label.edge.end { color: var(--red); }
.hide-route-labels .leaflet-tooltip.stop-label:not(.edge) { display: none; }
.route-mode .pin-wrap { opacity: .22; filter: grayscale(1); }
.route-mode .pin-wrap .pin-label { display: none; }
.leaflet-tooltip.route-tip { font: 600 12px system-ui, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) {
  .day-timeline li:not(.now) button:hover { background: var(--bg); }
}

/* Panik */
.panic { background: var(--red); color: #fff; flex: none; z-index: 1000; }
.panic-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.panic-row + .panic-row { border-top: 1px solid rgb(255 255 255 / .3); }
.panic-text { flex: 1; min-width: 220px; font-size: 18px; font-weight: 700; }
.panic-text small { display: block; font-size: 13px; font-weight: 400; }
.panic-row a { color: #fff; font-weight: 700; }
.panic-row button { height: 36px; padding: 0 12px; border-radius: 8px; font-weight: 700; border: 1px solid #fff; background: transparent; color: #fff; }
.panic-row button:hover { background: rgb(255 255 255 / .15); }
.panic-row button.solid { background: #fff; color: var(--red); }
.panic-row button.solid:hover { background: var(--red-soft); }

/* Pencereler */
dialog { border: 0; border-radius: 12px; padding: 20px; width: min(430px, calc(100vw - 32px)); box-shadow: 0 8px 40px rgb(0 0 0 / .3); color: var(--ink); }
dialog::backdrop { background: rgb(0 0 0 / .4); }
dialog h2 { font-size: 18px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.copy-field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 10px; background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.copy-label { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.copy-field strong { overflow-wrap: anywhere; }
.copy-field .code { font: 700 26px/1.25 ui-monospace, Consolas, monospace; letter-spacing: 3px; color: var(--gold); }

.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 8px; box-shadow: var(--shadow); }
.toast.bad { background: var(--red); }

.login-page { align-items: center; justify-content: safe center; padding: 16px; background: var(--stone); overflow: auto; }
.login-page .brand img.login-logo { height: 64px; }
.login-tag { color: var(--gold-bright); margin: 6px 0 24px; font-size: 15px; }
.login-card { background: var(--panel); padding: 28px; border-radius: 14px; box-shadow: var(--shadow); width: min(360px, 100%); display: flex; flex-direction: column; gap: 14px; }

button { transition: background-color .15s, color .15s, border-color .15s; }
@media (prefers-reduced-motion: reduce) { button { transition: none; } }

@media (max-width: 1000px) {
  .side { width: 300px; }
  .detail { width: 300px; }
}

@media (max-width: 800px) {
  /* Dokunmatikte en az 44 piksel hedef; 16 piksel yazı alanı odaklanınca sayfanın büyümesini önler. */
  .btn, .tabs button, .segment button, .map-btn, .text-btn, .icon-btn, .chip-btn { min-height: 44px; min-width: 44px; }
  .btn.small { height: 44px; }
  input, select { height: 44px; font-size: 16px; }
  .btn { height: 44px; }
  .top { gap: 8px 12px; flex-wrap: wrap; padding: 8px 12px; }
  .summary { order: 3; width: 100%; }
  .layout { flex-direction: column-reverse; }
  .side { width: 100%; flex: 1 1 50%; border-right: 0; border-top: 1px solid var(--line); }
  .detail { width: auto; z-index: 1100; }
  .route-mode ~ .detail, .map-wrap:has(.route-mode) .detail { max-height: 52vh; }
  .map-wrap { flex: 1 1 50%; }
  .detail { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 72vh; border-radius: 14px 14px 0 0; z-index: 1100; }
  .panic-text { font-size: 16px; }
}

/* --- Yetki ve kullanıcılar --- */
body:not(.can-operate) [data-perm=operate],
body:not(.can-manage) [data-perm=manage] { display: none !important; }
.account-btn { display: flex; flex-direction: column; align-items: flex-end; border: 0; background: none; color: #fff; padding: 2px 6px; border-radius: 6px; line-height: 1.2; text-align: right; max-width: 220px; }
.account-btn:hover { background: rgb(255 255 255 / .08); }
.account-btn span { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.account-btn small { font-size: 11px; color: var(--on-stone); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.grow { flex: 1; min-width: 0; margin: 0; }
.user-row { display: flex; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; }
.user-row.inactive { opacity: .55; }
.user-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-main strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-main small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.user-actions select { height: 30px; margin: 0; font-size: 13px; padding: 0 6px; width: auto; }
.user-actions .text-btn { padding: 0; font-size: 12px; text-decoration: underline; }
.badge.pending { background: var(--amber-soft); color: var(--amber); }
.badge.off { background: var(--grey-soft); color: var(--muted); }
.role-help { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.role-help dt { font-weight: 600; color: var(--ink); }
.role-help dd { margin: 0; }
.link-url { word-break: break-all; font-size: 13px; font-weight: 500; }
@media (max-width: 800px) { .account-btn small { display: none; } }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; font-size: 13px; padding: 0; margin-bottom: 2px; }

/* --- Platform yönetimi --- */
.platform-page { overflow: auto; }
.platform-tag { color: var(--gold-bright); font-size: 13px; font-weight: 600; letter-spacing: .3px; }
.on-dark { color: var(--on-stone); }
.platform-main { padding: 20px; max-width: 1200px; width: 100%; margin: 0 auto; }
.platform-head { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; }
.platform-head h2 { font-size: 20px; }
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid tr:last-child td { border-bottom: 0; }
.grid .num { font-variant-numeric: tabular-nums; }
.grid .warn { color: var(--amber); font-weight: 700; }
.grid .muted-row td { color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.owner-form { border-top: 1px solid var(--line); padding-top: 12px; }
.owner-form h3 { font-size: 14px; margin: 0; }

/* --- Kuyumcular --- */
.tab-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; flex: none; font-weight: 500; margin-left: auto; }
.check input { width: auto; height: auto; margin: 0; }
.places-help { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; }
.place-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; background: none; border-radius: 10px; text-align: left; }
.place-row:hover { background: var(--bg); }
.place-icon { width: 12px; height: 12px; flex: none; margin: 0 4px; background: var(--gold); transform: rotate(45deg); border-radius: 2px; }
.place-icon.zone { transform: none; background: var(--gold-soft); border: 2px dashed var(--gold); width: 16px; height: 14px; margin: 0 2px; }
.place-icon.busy { background: var(--green); }
.place-icon.zone.busy { background: var(--green-soft); border-color: var(--green); }
.place-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.place-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-sub.here, .person-place { color: var(--green); font-weight: 600; }
.person-place { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.shop-pin { position: relative; width: 18px; height: 18px; }
.shop-pin i { position: absolute; inset: 3px; background: var(--gold); border: 2px solid #fff; transform: rotate(45deg); border-radius: 2px; box-shadow: 0 1px 4px rgb(0 0 0 / .35); }
.shop-pin.busy i { background: var(--green); }
.shop-label { display: none; position: absolute; left: 20px; top: 0; white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--gold-ink); background: rgb(255 255 255 / .9); padding: 0 5px; border-radius: 4px; }
.show-place-labels .shop-label { display: block; }
.route-mode .shop-pin { opacity: .45; }
.zone-label { font-weight: 600; }
.leaflet-container.picking, .leaflet-container.picking .leaflet-interactive { cursor: crosshair; }

.map-mode { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 1000; background: var(--stone); color: #fff; padding: 8px 10px 8px 14px; border-radius: 10px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; max-width: calc(100% - 24px); font-size: 13px; font-weight: 600; }
.map-mode-actions { display: flex; gap: 6px; flex: none; }
.map-mode .btn { background: rgb(255 255 255 / .12); border-color: transparent; color: #fff; }
.map-mode .btn.primary { background: var(--gold); }
.map-mode .btn:hover:not(:disabled) { background: rgb(255 255 255 / .22); }

.input-row { display: flex; gap: 8px; }
.input-row input { margin: 0; flex: 1; min-width: 0; }
.loc-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
#place-loc.ok { color: var(--green); font-weight: 600; }
.results { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; max-height: 180px; overflow-y: auto; }
.result { border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; padding: 7px 10px; font-size: 13px; }
.result:last-child { border-bottom: 0; }
.result:hover { background: var(--gold-soft); }

.place-popup .leaflet-popup-content { margin: 12px 14px; font: inherit; }
.place-pop { display: flex; flex-direction: column; gap: 4px; }
.place-pop strong { font-size: 15px; }
.place-pop p { margin: 0; }
.pop-here { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--green); font-weight: 600; text-decoration: underline; text-align: left; }
.pop-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.danger-text { color: var(--red); }
.visit-list { list-style: none; margin: 4px 0 0; padding: 0; max-height: 180px; overflow-y: auto; font-size: 12px; }
.visit-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.visit-list li span { grid-column: 1 / -1; color: var(--muted); }
.visit-list li small { color: var(--muted); }
.day-timeline .visit .tl-dot { background: var(--gold); transform: rotate(45deg) scale(.85); border-radius: 2px; }
.day-timeline .zone .tl-dot { background: var(--gold-soft); border: 2px dashed var(--gold); border-radius: 3px; }
.event-pin.visit { background: var(--gold); }
@media (max-width: 800px) { .map-mode { flex-direction: column; align-items: stretch; gap: 6px; } }
.facts div:has(dd.here) { grid-column: 1 / -1; }
.facts dd.here { color: var(--green); }
.tabs button { font-size: 13px; padding: 0 4px; white-space: nowrap; }
.map-mode { width: max-content; }
#map-mode-text { min-width: 0; }

/* --- Güvenlik ve hesap --- */
body:not(.can-own) [data-perm=own] { display: none !important; }
dialog.wide { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.acc-section { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.acc-section h3, .inline-confirm strong { font-size: 14px; margin: 0; }
.ok-line { color: var(--green); font-weight: 600; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.check-line { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check-line input { width: auto; height: auto; margin: 0; }
.inline-confirm { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.setup-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.qr { display: block; width: 200px; height: 200px; margin: 4px auto; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 8px; }
.secret { display: inline-block; font: 600 15px/1.4 ui-monospace, Consolas, monospace; letter-spacing: 1px; background: var(--bg); padding: 6px 10px; border-radius: 6px; margin-top: 4px; user-select: all; }
.twofa-verify { display: flex; gap: 8px; }
.code-input { margin: 0; flex: 1; min-width: 0; font: 600 20px/1 ui-monospace, Consolas, monospace; letter-spacing: 4px; text-align: center; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 16px; margin: 0; padding: 10px 12px 10px 34px; background: var(--bg); border-radius: 8px; }
.recovery-codes code { font: 600 14px/1.6 ui-monospace, Consolas, monospace; }
.session-list { list-style: none; margin: 0; padding: 0; }
.session-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.session-list li:last-child { border-bottom: 0; }
.session-list .badge { margin-left: 6px; }
.tag-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.user-more summary { font-size: 12px; color: var(--muted); cursor: pointer; text-align: right; list-style: none; text-decoration: underline; }
.user-more summary::-webkit-details-marker { display: none; }
.user-more > div { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; margin-top: 4px; }
.user-more .text-btn { font-size: 12px; padding: 0; text-decoration: underline; text-align: right; }
#users-view { margin-bottom: 10px; }
.audit-list { list-style: none; margin: 8px 0 10px; padding: 0; font-size: 13px; }
.audit-list li { display: grid; grid-template-columns: 82px 1fr; gap: 8px; padding: 7px 2px; border-bottom: 1px solid var(--line); }
.audit-list li.warn strong { color: var(--red); }
.audit-list li.empty { display: block; }
.audit-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.audit-list small { display: block; color: var(--muted); }
.audit-target { color: var(--ink); }
.security-group { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.login-card .link-line { text-align: center; font-size: 13px; }
.login-card .link-line a, .link-like { color: var(--gold); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; font-size: 13px; }
.ok-box { background: var(--green-soft); color: var(--green); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
