/* Tabanca (Yakıt Ofisi Merkez) ile aynı dil: sakin zemin, 1px çizgiler, küçük yarıçaplar, tek boy kontroller;
   kimlik yeşil→mavi geçişli vurgu. Sistem temasını izler: koyu varsayılan, sistem açıksa açık tema.
   Temaya göre değişen her şey değişkende durur; kural ezmek yerine :root ezilir. */

:root {
    color-scheme: dark;
    --accent1: #74c69d;
    --accent2: #4ea8de;
    --grad: linear-gradient(100deg, var(--accent1), var(--accent2));
    --on-accent: #06121a;
    --link: var(--accent1);
    --focus-ring: rgba(116, 198, 157, 0.18);

    --bg: #0d1318;
    --panel: #151d25;
    --panel-2: #1a232c;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);
    --hover: rgba(127, 127, 127, 0.12);
    --text: #e6eef5;
    --text-2: #c2d0dc;
    --muted: #8aa0b2;

    --moving: #5fd09a;
    --idle: #e0a458;
    --parked: #4ea8de;
    --offline: #5f6f7d;
    --alarm: #e5484d;

    --ok-bg: rgba(116, 198, 157, 0.14);
    --ok-line: rgba(116, 198, 157, 0.4);
    --ok-fg: #8fd8b2;
    --warn-bg: rgba(224, 164, 88, 0.14);
    --warn-line: rgba(224, 164, 88, 0.4);
    --warn-fg: #ecbd82;
    --err-bg: rgba(229, 72, 77, 0.14);
    --err-line: rgba(229, 72, 77, 0.45);
    --err-fg: #ff9a9d;
    --info-bg: rgba(78, 168, 222, 0.12);
    --info-line: rgba(78, 168, 222, 0.35);
    --off-bg: rgba(138, 160, 178, 0.14);
    --off-fg: #9fb1c0;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
    --control-h: 38px;
    --radius: 10px;
    --topbar-h: 56px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --tiles: saturate(0.3) invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88);
    --map-bg: #1b232b;
}

@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;
        --link: #1f7a4f;
        --focus-ring: rgba(35, 121, 78, 0.16);
        --bg: #eef0f3;
        --panel: #ffffff;
        --panel-2: #f6f7f9;
        --line: rgba(0, 0, 0, 0.1);
        --line-strong: rgba(0, 0, 0, 0.18);
        --hover: rgba(0, 0, 0, 0.05);
        --text: #16202a;
        --text-2: #33424f;
        --muted: #5b6b78;

        --moving: #23a06b;
        --idle: #d08a2c;
        --parked: #2b88c8;
        --offline: #9aa6b1;
        --alarm: #d93a3f;

        --ok-bg: rgba(116, 198, 157, 0.18);
        --ok-fg: #1b6b46;
        --warn-bg: rgba(224, 164, 88, 0.2);
        --warn-fg: #8a5a1d;
        --err-bg: rgba(217, 58, 63, 0.1);
        --err-line: rgba(217, 58, 63, 0.35);
        --err-fg: #a8262b;
        --off-bg: rgba(0, 0, 0, 0.06);
        --off-fg: #66737e;

        --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
        --shadow-lg: 0 12px 28px rgba(16, 24, 40, 0.16);
        --tiles: saturate(0.5) brightness(1.03) contrast(0.95);
        --map-bg: #e4e7eb;
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    /* Dokunmatikte yalnız kaydırma: sayfa sıkıştırmayla ya da çift dokunuşla yakınlaşmaz (harita kendi içinde yakınlaşır). */
    touch-action: pan-x pan-y;
    -webkit-text-size-adjust: 100%;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 {
    margin: 0; width: fit-content; font-size: 22px; font-weight: 800; letter-spacing: -0.01em;
    background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
h1:focus { outline: none; }
h2 { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
p { margin: 0 0 12px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ── kontroller: input = select = buton, tek yükseklik ── */

.input, .search {
    width: 100%; height: var(--control-h); padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--panel); color: var(--text); font: inherit; outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder, .search::placeholder { color: var(--muted); opacity: 0.8; }
.input:focus, .search:focus { border-color: var(--accent1); box-shadow: 0 0 0 3px var(--focus-ring); }
select.input { padding-right: 8px; }
.input.compact { height: 32px; padding: 0 10px; }
.input.auto { width: auto; min-width: 11rem; }
.input.date { width: auto; height: 32px; padding: 0 8px; }
input[type="checkbox"] { width: 1.05em; height: 1.05em; margin: 0; accent-color: var(--accent1); cursor: pointer; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control-h); padding: 0 16px;
    border: 0; border-radius: 8px; background: var(--grad); color: var(--on-accent); font: inherit; font-weight: 700;
    cursor: pointer; white-space: nowrap; transition: filter 0.15s, transform 0.15s;
}
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; filter: none; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.secondary {
    background: none; border: 1px solid var(--line-strong); color: var(--text-2); font-weight: 600;
}
.btn.secondary:hover { color: var(--text); border-color: var(--muted); filter: none; }
.btn.danger { background: linear-gradient(100deg, #e0586f, #9d2235); color: #fff; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px;
    border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }

.chip {
    display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 1px solid var(--line);
    border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600;
    cursor: pointer; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--accent1); }
.chip.on { background: var(--grad); border-color: transparent; color: var(--on-accent); }
.chip.ghost { margin-left: auto; border-color: transparent; }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.segmented button {
    height: 34px; padding: 0 14px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer;
}
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button:hover { color: var(--text); }
.segmented button.on { background: var(--grad); color: var(--on-accent); }
.segmented .count { margin-left: 4px; opacity: 0.75; font-weight: 500; }

/* ── durum noktaları, rozetler ── */

.dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--offline); }
.dot.moving { background: var(--moving); box-shadow: 0 0 0 3px color-mix(in srgb, var(--moving) 22%, transparent); }
.dot.idle { background: var(--idle); }
.dot.parked { background: var(--parked); }
.dot.offline, .dot.unknown { background: var(--offline); }
.dot.alarm { background: var(--alarm); box-shadow: 0 0 0 3px color-mix(in srgb, var(--alarm) 25%, transparent); }

.tag {
    display: inline-flex; align-items: center; justify-content: center; min-width: 76px; height: 22px; padding: 0 10px;
    border-radius: 999px; background: var(--off-bg); color: var(--off-fg); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.tag.ok { background: var(--ok-bg); color: var(--ok-fg); }
.tag.warn { background: var(--warn-bg); color: var(--warn-fg); }
.tag.alarm { background: var(--err-bg); color: var(--err-fg); }

.badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: var(--alarm); color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
}

/* ── bildirim kutuları ── */

.form-error, .form-ok, .notice {
    display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; padding: 10px 14px; border-radius: 10px;
    border: 1px solid var(--line); font-size: 13.5px;
}
.form-error { background: var(--err-bg); border-color: var(--err-line); color: var(--err-fg); }
.form-error::before { content: "!"; font-weight: 800; }
.form-ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-fg); }
.form-ok::before { content: "✓"; font-weight: 800; }
.notice { background: var(--info-bg); border-color: var(--info-line); color: var(--text-2); margin: 0; }

.code {
    display: block; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line);
    color: var(--text); font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; overflow-x: auto;
}

.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 16px; color: var(--muted); text-align: center; }
.empty svg { opacity: 0.45; margin-bottom: 4px; }

/* ── marka ── */

.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 15.5px; letter-spacing: -0.01em; }
.logo:hover { text-decoration: none; }
.logo-mark {
    display: inline-flex; width: 30px; height: 30px; flex: none; border-radius: 9px; overflow: hidden;
    box-shadow: 0 4px 14px rgba(78, 168, 222, 0.3);
}
.logo-mark img { width: 100%; height: 100%; display: block; }
.logo .wordmark { height: 24px; width: auto; display: block; }

/* ── üst çubuk ── */

.topbar {
    position: sticky; top: 0; z-index: 1000; height: var(--topbar-h); display: flex; align-items: center; gap: 22px;
    padding: 0 18px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.topbar .tabs { display: flex; align-items: center; gap: 2px; height: 100%; }
.tab {
    position: relative; display: inline-flex; align-items: center; gap: 7px; height: 100%; padding: 0 12px;
    color: var(--muted); font-weight: 600;
}
.tab svg { opacity: 0.85; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); }
.tab.active svg { color: var(--accent1); opacity: 1; }
.tab.active::after {
    content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--grad);
}
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.bell {
    position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
    border-radius: 8px; color: var(--muted);
}
.bell:hover { color: var(--text); background: var(--hover); text-decoration: none; }
.bell .badge { position: absolute; top: 1px; right: -2px; box-shadow: 0 0 0 2px var(--panel); }
.bell.ringing { color: var(--alarm); }

.user-menu { position: relative; }
.user-btn {
    display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px 0 4px; border: 1px solid transparent;
    border-radius: 10px; background: none; color: var(--text); font: inherit; cursor: pointer; text-align: left;
}
.user-btn:hover, .user-menu:focus-within .user-btn { border-color: var(--line); background: var(--hover); }
.avatar {
    display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
    background: var(--grad); color: var(--on-accent); font-size: 12.5px; font-weight: 800; letter-spacing: 0.02em;
}
.user-who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; }
.user-org { max-width: 220px; overflow: hidden; color: var(--muted); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.user-pop {
    display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 240px; padding: 6px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
}
.user-menu:focus-within .user-pop { display: block; }
.user-pop-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-pop form { margin: 0; }
.menu-item {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px;
    background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.menu-item:hover { background: var(--hover); text-decoration: none; }

/* mobil: hamburger + soldan çekmece (saf CSS onay kutusu) */
.nav-toggle, .hamburger, .drawer, .drawer-backdrop { display: none; }

/* ── sayfa iskeleti ── */

.page { min-height: 100vh; }
.content { max-width: 1280px; margin: 0 auto; padding: 24px 22px 48px; display: flex; flex-direction: column; gap: 16px; }
.content-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 38px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; min-width: 0; }
.card > h2 .muted { font-weight: 500; }
.table-card { padding: 6px 0 0; overflow-x: auto; }
.table-card > h2 { padding: 10px 18px 4px; }
.table-card > .muted, .table-card > .empty { padding-left: 18px; padding-right: 18px; }
.table-card > p.muted { padding-bottom: 14px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.form-row.three { grid-template-columns: 1.2fr 0.8fr 1.2fr auto; }
.form-row.four { grid-template-columns: 1.2fr 1fr 1.2fr 0.8fr auto; }
.form-row.four:not(:has(> :nth-child(5))) { grid-template-columns: 1fr 1.2fr 0.8fr auto; }

.table { width: 100%; border-collapse: collapse; }
.table th {
    padding: 10px 14px; text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted);
    border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.table th:last-child, .table td:last-child { padding-right: 18px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--text) 3%, transparent); }
.table tr.inactive td { color: var(--muted); }
.cell-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--muted); }
.tree { display: inline-flex; align-items: center; gap: 6px; }
.input-suffix { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.input-suffix .input { width: 76px; }

.link-box {
    margin-top: 12px; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 10px;
    background: var(--info-bg); border: 1px solid var(--info-line);
}
.link-box .code { white-space: pre-wrap; word-break: break-all; }
.content > .form-error { margin: 0; }

/* ── harita sayfası ── */

.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.workspace { flex: 1; min-height: 0; display: flex; }

.sidebar { width: 360px; flex: none; display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line); z-index: 2; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 14px 14px 10px; }
.stat {
    position: relative; display: flex; flex-direction: column; gap: 2px; padding: 8px 9px 7px; border: 1px solid var(--line);
    border-radius: 10px; background: var(--bg); font: inherit; color: inherit; text-align: left; cursor: pointer; overflow: hidden;
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c, var(--line)); }
.stat:hover { border-color: var(--line-strong); }
.stat.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--bg)); }
.stat.moving { --c: var(--moving); }
.stat.idle { --c: var(--idle); }
.stat.parked { --c: var(--parked); }
.stat.offline { --c: var(--offline); }
.stat-value { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.fleet-total { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 14px 0; }
.fleet-total b { font-size: 15px; }

.filter-box { margin: 0 14px 8px; }
.search-box { position: relative; margin: 0 14px 10px; color: var(--muted); }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); }
.search { padding-left: 34px; }

.vehicle-list { flex: 1; overflow-y: auto; padding: 0 8px 12px; border-top: 1px solid var(--line); padding-top: 6px; }
.vehicle {
    display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px; border: 0; border-radius: 10px;
    background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.vehicle:hover { background: var(--hover); }
.vehicle.selected { background: color-mix(in srgb, var(--accent1) 12%, transparent); box-shadow: inset 3px 0 0 var(--accent1); }
.v-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.v-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-alarm { color: var(--alarm); font-weight: 600; }
.v-speed { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.v-speed small { display: block; font-size: 10px; font-weight: 500; color: var(--muted); }

.map-area { position: relative; flex: 1; min-width: 0; }
.map { position: absolute; inset: 0; background: var(--map-bg); }

.live-pill {
    position: absolute; z-index: 500; top: 12px; right: 12px; display: flex; align-items: center; gap: 8px; height: 32px;
    padding: 0 12px; border-radius: 999px; background: color-mix(in srgb, var(--panel) 88%, transparent);
    border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(8px); font-size: 12px; font-weight: 600;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--moving); animation: live 2s infinite; }
@keyframes live { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--moving) 55%, transparent); } 60% { box-shadow: 0 0 0 6px transparent; } }

/* araç detayı */

.detail {
    position: absolute; z-index: 500; top: 54px; right: 12px; width: 370px; max-height: calc(100% - 66px); overflow-y: auto;
    padding: 16px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lg);
    animation: slide-in 0.18s ease-out;
}
@keyframes slide-in { from { opacity: 0; transform: translateX(10px); } }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.detail-name { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.detail-sub { font-size: 12px; color: var(--muted); }

.status-pill {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 12px; border-radius: 999px;
    background: var(--off-bg); color: var(--text-2); font-size: 12.5px; font-weight: 600;
}
.status-pill.moving { background: color-mix(in srgb, var(--moving) 16%, transparent); color: var(--moving); }
.status-pill.idle { background: color-mix(in srgb, var(--idle) 16%, transparent); color: var(--idle); }
.status-pill.parked { background: color-mix(in srgb, var(--parked) 16%, transparent); color: var(--parked); }

.alert {
    display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px;
    border-radius: 10px; background: var(--err-bg); border: 1px solid var(--err-line);
}
.alert-title { font-weight: 700; color: var(--err-fg); }
.alert-sub { font-size: 12px; color: var(--err-fg); opacity: 0.85; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.metrics > div { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.metric-value { display: inline-flex; align-items: center; gap: 4px; font-size: 16px; font-weight: 800; }
.metric-label { font-size: 11px; color: var(--muted); }
.heading { color: var(--accent2); transition: transform 0.6s ease; }

.rows { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.rows > div { display: flex; justify-content: space-between; gap: 12px; }
.rows dt { color: var(--muted); }
.rows dd { margin: 0; text-align: right; }

/* rota */

.section-title { flex: 1; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.route { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.route-head { display: flex; align-items: center; gap: 8px; }
.route-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.route-stats > div { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.route-stats .num { font-weight: 800; }
.route-stats small { font-size: 11px; color: var(--muted); }
.player { display: flex; align-items: center; gap: 10px; }
/* Zaman çubuğu: dokunma alanı geniş, iz ince; tutamaç sürüklenir (sauron-map.js). */
.progress { position: relative; flex: 1; height: 28px; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.progress::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 5px; margin-top: -2.5px; border-radius: 3px; background: var(--line); }
.progress-bar { position: absolute; left: 0; top: 50%; width: 0; height: 5px; margin-top: -2.5px; border-radius: 3px; background: var(--grad); }
.progress-bar::after {
    content: ""; position: absolute; right: -8px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%;
    background: #fff; border: 2px solid var(--accent2); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.route-time { min-width: 64px; text-align: right; font-size: 12px; color: var(--muted); }
.speeds { display: flex; gap: 6px; flex-wrap: wrap; }
.legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 4px; margin-right: 5px; border-radius: 2px; vertical-align: middle; }
.speed-0 { background: #3fb27f; }
.speed-1 { background: #d6a531; }
.speed-2 { background: #e8793a; }
.speed-3 { background: #e5484d; }

/* anlık alarm bildirimleri */

.toasts { position: absolute; z-index: 600; left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 8px; width: 330px; }
.toast {
    display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--err-line); border-left: 3px solid var(--alarm);
    border-radius: 10px; background: var(--panel); color: var(--text); box-shadow: var(--shadow-lg); font: inherit; text-align: left; cursor: pointer;
    animation: toast-in 0.2s ease-out;
}
.toast-icon {
    display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; border-radius: 50%;
    background: var(--alarm); color: #fff; font-size: 12px; font-weight: 800;
}
.toast-body { display: flex; flex-direction: column; min-width: 0; }
.toast-title { font-weight: 700; }
.toast-sub { font-size: 12px; color: var(--muted); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* harita işaretleri */

.vm { position: relative; width: 28px; height: 28px; --c: var(--offline); }
.vm--moving { --c: var(--moving); }
.vm--idle { --c: var(--idle); }
.vm--parked { --c: var(--parked); }
.vm-dot {
    position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
    background: var(--c); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.vm-arrow {
    position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin: -15px 0 0 -5px;
    border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 7px solid var(--c);
    transform: rotate(var(--rot)); transform-origin: 5px 15px;
}
.vm--parked .vm-arrow, .vm--offline .vm-arrow, .vm--unknown .vm-arrow { display: none; }
.vm-label {
    position: absolute; left: 50%; top: 26px; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
    padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--panel) 94%, transparent); border: 1px solid var(--line-strong);
    box-shadow: var(--shadow); font: 600 11px var(--font); color: var(--text);
}
.vm-label b { margin-left: 6px; font-weight: 500; color: var(--muted); }
.vm--selected .vm-dot { width: 18px; height: 18px; margin: -9px 0 0 -9px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent2) 45%, transparent), 0 1px 4px rgba(0, 0, 0, 0.45); }
.vm--alarm .vm-dot { animation: alarm-ring 1.6s infinite; }
.vm--alarm .vm-label { border-color: var(--err-line); color: var(--err-fg); }
@keyframes alarm-ring {
    0%, 100% { box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.45), 0 1px 4px rgba(0, 0, 0, 0.45); }
    50% { box-shadow: 0 0 0 9px rgba(229, 72, 77, 0.08), 0 1px 4px rgba(0, 0, 0, 0.45); }
}

.route-pin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); }
.route-pin.start { background: var(--moving); }
.route-pin.end { background: var(--alarm); }
.playhead { width: 18px; height: 18px; border-radius: 50%; background: var(--accent2); border: 3px solid #fff; box-shadow: 0 0 0 5px rgba(78, 168, 222, 0.3); }

/* Karolar temaya göre: koyu temada ters çevrilip soldurulur, açık temada hafifçe soldurulur. */
.muted-tiles { filter: var(--tiles); }
.leaflet-container { font-family: var(--font); background: var(--map-bg); }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--panel); color: var(--text); border-color: var(--line); }
.leaflet-bar { border: 1px solid var(--line) !important; box-shadow: var(--shadow) !important; border-radius: 8px !important; overflow: hidden; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--panel) 80%, transparent) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }

/* ── giriş ve şifre belirleme: hareketli aurora zemin + cam kart ── */

.auth-stage {
    position: fixed; inset: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: linear-gradient(125deg, #0a141a, #0d1f1c, #11202c, #1a1630, #201422, #0d1f1c, #0a141a);
    background-size: 400% 400%; animation: auth-shift 32s ease-in-out infinite; color-scheme: dark;
}
@keyframes auth-shift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.auth-aurora {
    position: absolute; inset: -40%;
    background:
        radial-gradient(40% 40% at 20% 30%, rgba(116, 198, 157, 0.55), transparent 70%),
        radial-gradient(35% 35% at 80% 25%, rgba(78, 168, 222, 0.5), transparent 70%),
        radial-gradient(45% 45% at 60% 80%, rgba(143, 107, 222, 0.42), transparent 70%),
        radial-gradient(30% 30% at 30% 75%, rgba(224, 164, 88, 0.32), transparent 70%);
    filter: blur(40px);
    animation: auth-float 18s ease-in-out infinite alternate, auth-hue 40s linear infinite;
}
@keyframes auth-float {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    50% { transform: translate(4%, -3%) rotate(8deg) scale(1.12); }
    100% { transform: translate(-3%, 4%) rotate(-6deg) scale(1.05); }
}
@keyframes auth-hue { from { filter: blur(40px) hue-rotate(0deg); } to { filter: blur(40px) hue-rotate(360deg); } }
.auth-grid {
    position: absolute; inset: 0; opacity: 0.35;
    background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 44px 44px; mask-image: radial-gradient(circle at 50% 45%, black, transparent 75%);
}
.auth-card {
    position: relative; z-index: 1; width: 100%; max-width: 380px; padding: 38px 32px 26px; color: #eaf2f8;
    background: rgba(20, 28, 36, 0.55); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 22px;
    backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: auth-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes auth-rise { from { opacity: 0; transform: translateY(22px) scale(0.97); } }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; }
.auth-brand .logo-mark { width: 44px; height: 44px; border-radius: 13px; }
.auth-title { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -0.01em; }
.auth-wordmark { height: 30px; width: auto; margin-top: 4px; }
.auth-sub { color: #9fb4c4; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; text-align: center; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field {
    display: flex; align-items: center; gap: 10px; padding: 2px 14px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 14px;
    background: rgba(8, 12, 16, 0.55); color: #6f8499; transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-field:focus-within { border-color: #74c69d; box-shadow: 0 0 0 3px rgba(116, 198, 157, 0.18); }
.auth-field svg { flex: none; }
.auth-field input {
    flex: 1; min-width: 0; padding: 13px 0; border: 0; outline: 0; background: transparent; color: #eaf2f8; font: inherit; font-size: 15px;
}
.auth-field input::placeholder { color: #6f8499; }
.auth-field input:-webkit-autofill { -webkit-text-fill-color: #eaf2f8; transition: background-color 9999s; }
.auth-check { display: flex; align-items: center; gap: 9px; padding-left: 2px; color: #9fb4c4; font-size: 13.5px; cursor: pointer; user-select: none; }
.auth-check:hover { color: #cfe3f0; }
.auth-btn {
    position: relative; margin-top: 6px; padding: 14px; border: 0; border-radius: 14px; cursor: pointer;
    background: linear-gradient(100deg, #74c69d, #4ea8de); color: #06121a; font: inherit; font-size: 15px; font-weight: 800;
    box-shadow: 0 10px 26px rgba(78, 168, 222, 0.35); transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.auth-btn:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 14px 32px rgba(78, 168, 222, 0.5); text-decoration: none; }
.auth-btn .arrow { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); transition: right 0.15s; }
.auth-btn:hover .arrow { right: 14px; }
a.auth-btn { display: block; text-align: center; }
.auth-error {
    margin-bottom: 16px; padding: 10px 14px; border-radius: 12px; background: rgba(157, 34, 53, 0.18); border: 1px solid rgba(224, 122, 95, 0.4);
    color: #ffb3a3; font-size: 13px; text-align: center;
}
.auth-text { color: #b6c7d4; font-size: 13.5px; text-align: center; }
.auth-text b { color: #fff; }
.auth-hint { color: #6f8499; font-size: 12px; text-align: center; margin: 0; }
.auth-foot { margin-top: 22px; color: #5f7385; font-size: 12px; text-align: center; }
@media (prefers-reduced-motion: reduce) {
    .auth-stage, .auth-aurora, .auth-card { animation: none; }
}

/* ── hata sayfaları ── */

.message-page { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 80px 20px; text-align: center; }
.message-page .big { font-size: 64px; font-weight: 800; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Blazor hata çubuğu ── */

#blazor-error-ui {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 2000; padding: 12px 18px; text-align: center;
    background: linear-gradient(100deg, #e0a458, #e0586f); color: #06121a; box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.35);
}
#blazor-error-ui a { color: #06121a; font-weight: 700; text-decoration: underline; }
#blazor-error-ui .dismiss { cursor: pointer; margin-left: 10px; font-weight: 700; }

/* ── dar ekran ── */

@media (max-width: 980px) {
    .topbar { gap: 12px; padding: 0 12px; }
    .topbar .tabs, .user-who { display: none; }
    .hamburger {
        display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none;
        border: 1px solid var(--line); border-radius: 8px; color: var(--text); cursor: pointer;
    }
    .drawer {
        display: flex; flex-direction: column; gap: 2px; position: fixed; z-index: 1200; top: 0; bottom: 0; left: 0;
        width: min(80vw, 300px); padding: 16px 12px; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line);
        transform: translateX(-105%); transition: transform 0.18s ease-out;
    }
    .drawer-backdrop {
        display: block; position: fixed; inset: 0; z-index: 1100; background: rgba(0, 0, 0, 0.45);
        opacity: 0; pointer-events: none; transition: opacity 0.18s;
    }
    .nav-toggle:checked ~ .drawer { transform: none; }
    .nav-toggle:checked ~ .drawer-backdrop { opacity: 1; pointer-events: auto; }
    .drawer .logo { padding: 4px 8px 16px; }
    .drawer .tabs { display: flex; flex-direction: column; gap: 2px; }
    .drawer .tab { height: 42px; padding: 0 12px; border-radius: 8px; color: var(--text); }
    .drawer .tab:hover { background: var(--hover); }
    .drawer .tab.active { background: color-mix(in srgb, var(--accent1) 14%, transparent); }
    .drawer .tab.active::after { display: none; }
    .grid-2, .form-row, .form-row.three, .form-row.four, .form-row.four:not(:has(> :nth-child(5))) { grid-template-columns: 1fr; }
    .content { padding: 16px 12px 40px; }
}

@media (max-width: 800px) {
    .workspace { flex-direction: column-reverse; }
    .sidebar { width: 100%; height: 50%; border-right: 0; border-top: 1px solid var(--line); }
    .detail { left: 12px; right: 12px; width: auto; }
    .toasts { left: 12px; right: 12px; width: auto; }
}

/* Telefonda liste tabloları "satır = kart" olur; her hücre solda sütun başlığını taşır (data-label, App.razor). */
@media (max-width: 640px) {
    .table, .table thead, .table tbody, .table tr, .table th, .table td { display: block; }
    .table thead tr { position: absolute; left: -9999px; top: -9999px; }
    .table-card { padding: 0; background: none; border: 0; }
    .table-card > h2 { padding: 0 2px 8px; }
    .table tr { margin: 0 0 10px; padding: 2px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
    .table td, .table td:first-child, .table td:last-child {
        display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 14px;
        padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: right; overflow-wrap: anywhere;
    }
    .table tbody tr:last-child td { border-bottom: 1px solid var(--line); }
    .table tr td:last-child { border-bottom: 0 !important; }
    .table td::before { content: attr(data-label); flex: 0 0 38%; margin-right: auto; text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; }
    .table td[data-label=""]::before { content: none; }
    .table td > div { flex-basis: 100%; }
    .table td .input.compact { width: auto; flex: 1; }
}

/* kuruluş türleri */
.tag.type-platform { background: color-mix(in srgb, var(--accent2) 16%, transparent); color: var(--accent2); }
.tag.type-dealer { background: color-mix(in srgb, #9b7be0 18%, transparent); color: #a98ce6; }
.tag.type-customer { background: var(--ok-bg); color: var(--ok-fg); }

/* özet kartları */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi {
    position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; overflow: hidden;
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.kpi::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--grad); opacity: 0.7; }
.kpi.ok::after { background: var(--moving); }
.kpi.bad::after { background: var(--alarm); }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi-value { font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; }

@media (max-width: 640px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .kpi { padding: 10px 12px; }
    .kpi-value { font-size: 22px; }
    .code { white-space: pre-wrap; word-break: break-all; }
}

.auth-link { color: #9fb4c4; font-size: 13px; }
.auth-link:hover { color: #cfe3f0; }

/* Hesabım: ayar satırı (tabanca'daki toggle-switch) */
.setting {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 14px; padding: 14px 16px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}
.setting:hover { border-color: var(--muted); }
.setting:has(input:checked) { border-color: color-mix(in srgb, var(--accent1) 55%, var(--line)); background: color-mix(in srgb, var(--accent1) 6%, var(--bg)); }
.setting-copy { display: grid; gap: 4px; min-width: 0; }
.setting-label { font-weight: 600; }
.setting-desc { color: var(--muted); font-size: 13px; line-height: 1.5; }
input[type="checkbox"].switch {
    appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 44px; height: 26px; margin: 0;
    border-radius: 999px; background: var(--offline); transition: background-color 0.18s; cursor: pointer;
}
input[type="checkbox"].switch::before {
    content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.18s;
}
input[type="checkbox"].switch:checked { background: var(--accent1); }
input[type="checkbox"].switch:checked::before { transform: translateX(18px); }
input[type="checkbox"].switch:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; }
.stack { display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.stack label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.stack .btn { align-self: flex-start; }
.content.narrow { max-width: 820px; }
dl.profile { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
dl.profile dt { color: var(--muted); }
dl.profile dd { margin: 0; font-weight: 600; }

/* ── bölgeler ── */
.zone-tip { font: 600 12px var(--font); }
.map.drawing, .map.drawing .leaflet-interactive { cursor: crosshair; }
.zone-list { flex: 1; overflow-y: auto; padding: 6px 8px 12px; border-top: 1px solid var(--line); }
.zone {
    display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px; border: 0; border-radius: 10px;
    background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.zone:hover { background: var(--hover); }
.zone.selected { background: color-mix(in srgb, var(--accent1) 12%, transparent); box-shadow: inset 3px 0 0 var(--accent1); }
.zone.inactive { opacity: 0.55; }
.zone-swatch { flex: none; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 25%, transparent); }
.zone-swatch.stay { --c: var(--moving); border-style: dashed; }
.zone-swatch.keep { --c: var(--alarm); }
.zone-swatch.path { --c: #8b5cf6; border-radius: 999px; }
.zone-vehicles { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.zone-vehicles label { gap: 8px; }
.zone-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; margin: 0 12px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.zone-form .segmented { display: flex; }
.zone-form .segmented button { flex: 1; }
.zone-form label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.zone-hint { font-size: 12.5px; color: var(--text-2); padding: 8px 10px; border-radius: 8px; background: var(--info-bg); border: 1px solid var(--info-line); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1; }
.map-tools { position: absolute; z-index: 500; top: 12px; left: 12px; display: flex; gap: 6px; }
.map-tools .chip { background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(8px); height: 32px; }
.map-tools .chip.on { background: var(--grad); }

/* araç cihaz geçmişi */
.table tr.history-row td { background: var(--bg); }
.history { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.history-item { display: flex; gap: 14px; flex-wrap: wrap; }

/* araç grupları */
.group-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.group-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-size: 13px; }
.group-chip button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.group-chip button:hover { background: var(--err-bg); color: var(--err-fg); }
.group-editor { display: flex; flex-direction: column; gap: 10px; padding: 6px 0; }
.group-editor .checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.group-editor label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.field-row { display: flex; flex-direction: column; gap: 5px; margin: 0 0 4px; }

/* sekmeler çoğaldı: orta genişlikte ikonsuz ve sıkı */
@media (max-width: 1240px) and (min-width: 981px) {
    .topbar { gap: 14px; }
    .topbar .tab { padding: 0 8px; }
    .topbar .tab svg { display: none; }
}

/* iki adımlı doğrulama */
.qr { display: flex; justify-content: center; margin: 16px 0 10px; }
.qr img { border-radius: 12px; background: #fff; padding: 8px; }
.secret { font: 600 14px ui-monospace, SFMono-Regular, Menlo, monospace; color: #eaf2f8; letter-spacing: 0.04em; word-break: break-all; }
.recovery-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.recovery-codes span {
    padding: 8px 10px; border-radius: 10px; background: rgba(8, 12, 16, 0.55); border: 1px solid rgba(255, 255, 255, 0.1);
    color: #eaf2f8; font: 600 14px ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; letter-spacing: 0.05em;
}

/* müşteri gibi gör şeridi */
.view-as {
    position: sticky; top: var(--topbar-h); z-index: 999; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-wrap: wrap; padding: 8px 18px; background: linear-gradient(100deg, #e0a458, #e0586f); color: #06121a; font-size: 13px;
}
.view-as form { margin: 0; }
.view-as .btn { background: #06121a; color: #fff; }
.app:has(.view-as) .workspace { min-height: 0; }

/* Yönetim açılır menüsü (tabanca'daki .menu gibi; :hover ve :focus-within) */
.topbar .menu { position: relative; height: 100%; display: flex; align-items: center; }
.menu-btn { border: 0; background: none; font: inherit; cursor: pointer; }
.topbar .menu-items {
    display: none; position: absolute; top: 100%; left: 0; min-width: 220px; padding: 6px; z-index: 30;
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
}
.topbar .menu:hover .menu-items, .topbar .menu:focus-within .menu-items { display: flex; flex-direction: column; }
.topbar .menu-items .tab { height: 38px; padding: 0 12px; border-radius: 6px; color: var(--text); }
.topbar .menu-items .tab:hover { background: var(--hover); }
.topbar .menu-items .tab.active { background: color-mix(in srgb, var(--accent1) 14%, transparent); }
.topbar .menu-items .tab.active::after { display: none; }
.nav-group { margin: 14px 12px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* fatura bilgileri formu */
.billing-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
.billing-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.billing-form .wide { grid-column: span 3; }
@media (max-width: 980px) { .billing-form { grid-template-columns: 1fr; } .billing-form .wide { grid-column: auto; } }

/* ── seyir defteri (araç sayfası) ── */

.vlog { gap: 14px; }
.vlog-head { display: flex; align-items: center; gap: 12px; }
.vlog-title { flex: 1; min-width: 0; }
.vlog-title h1 { margin: 0; font-size: 22px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vlog-head .status-pill { flex: none; }
.vlog-now { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-2); font-size: 13.5px; }
.day-nav { display: flex; align-items: center; gap: 8px; }
.day-pick {
    position: relative; flex: 1; display: flex; align-items: center; justify-content: center; height: 40px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-weight: 700; cursor: pointer;
}
/* Tarih seçici görünmez ama bütün alanı kaplar: dokununca telefonun kendi takvimi açılır. */
.day-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.day-nav .icon-btn { width: 40px; height: 40px; }
.day-nav .icon-btn:disabled { opacity: 0.35; cursor: default; }
.vlog-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.vlog-summary > div {
    display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.vlog-summary .num { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.vlog-summary small { color: var(--muted); font-size: 11.5px; }
.vlog-body {
    display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr); grid-template-rows: auto 1fr;
    grid-template-areas: "map head" "map list"; gap: 8px 14px; align-items: start;
}
.vlog-map {
    grid-area: map; position: sticky; top: calc(var(--topbar-h) + 14px); height: calc(100dvh - var(--topbar-h) - 40px); min-height: 320px;
    border: 1px solid var(--line); border-radius: 12px; overflow: hidden; isolation: isolate;
}
.vlog-list-head {
    grid-area: head; display: flex; align-items: center; gap: 8px; width: 100%; padding: 2px 4px; border: 0; background: none;
    color: var(--text); font: inherit; font-weight: 700; text-align: left; cursor: default;
}
.vlog-list-head .count { padding: 1px 8px; border-radius: 999px; background: var(--hover); color: var(--text-2); font-size: 12px; }
.vlog-list-head svg { display: none; margin-left: auto; color: var(--muted); }
.vlog-body > .timeline { grid-area: list; scroll-margin-top: calc(var(--topbar-h) + 64px); }
.vlog-map-reset { position: absolute; z-index: 500; top: 10px; left: 10px; }

.timeline { list-style: none; margin: 0; padding: 4px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.tl { position: relative; display: grid; grid-template-columns: 46px 18px minmax(0, 1fr); align-items: start; padding: 0 12px 0 8px; }
.tl::before { content: ""; position: absolute; left: 62px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl:first-child::before { top: 18px; }
.tl:last-child::before { bottom: calc(100% - 18px); }
.tl-time { padding-top: 11px; color: var(--muted); font-size: 12px; text-align: right; padding-right: 8px; }
.tl-dot {
    position: relative; z-index: 1; justify-self: center; width: 10px; height: 10px; margin-top: 13px; border-radius: 50%;
    background: var(--panel); border: 2px solid var(--offline);
}
.tl-body {
    display: flex; flex-direction: column; gap: 2px; min-width: 0; margin: 4px 0; padding: 7px 10px; border: 1px solid transparent;
    border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left;
}
button.tl-body { cursor: pointer; }
button.tl-body:hover { background: var(--hover); }
.tl-title { font-weight: 700; }
.tl-sub { color: var(--text-2); font-size: 13px; }
.tl-meta { color: var(--muted); font-size: 12.5px; }
.tl-gap { color: var(--muted); font-size: 12px; font-style: italic; }
.tl-harshacceleration .tl-dot, .tl-harshbraking .tl-dot, .tl-harshcornering .tl-dot { border-color: var(--idle); background: var(--idle); }
.tl-harshacceleration .tl-title, .tl-harshbraking .tl-title, .tl-harshcornering .tl-title { font-weight: 600; font-size: 13.5px; }
.tl-idle { color: var(--idle); font-size: 12.5px; font-weight: 600; }
.tl-refuel .tl-dot { border-color: var(--accent2); background: var(--accent2); }
.tl-fueldrop .tl-dot { border-color: var(--alarm); background: var(--alarm); }
.tl-refuel .tl-title, .tl-fueldrop .tl-title { font-weight: 600; font-size: 13.5px; }
.tl-fueldrop .tl-title { color: var(--err-fg); }
.tl-g { margin-left: 4px; color: var(--muted); font-weight: 500; font-size: 12.5px; }
/* Sürüş puanı */
.score-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.score-summary > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.score-summary .num { font-size: 20px; font-weight: 800; }
.score-summary small { color: var(--muted); font-size: 11.5px; }
.score-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.score-card { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.score-badge {
    flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 58px; height: 58px;
    border-radius: 14px; background: var(--hover); color: var(--text-2);
}
.score-badge b { font-size: 20px; line-height: 1.1; }
.score-badge small { font-size: 11px; font-weight: 700; }
.score-badge.grade-A { background: color-mix(in srgb, var(--moving) 18%, transparent); color: var(--moving); }
.score-badge.grade-B { background: color-mix(in srgb, var(--accent2) 18%, transparent); color: var(--accent2); }
.score-badge.grade-C { background: color-mix(in srgb, var(--idle) 18%, transparent); color: var(--idle); }
.score-badge.grade-D, .score-badge.grade-E { background: var(--err-bg); color: var(--err-fg); }
.score-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.score-title { font-weight: 700; color: var(--text); }
.score-sub { color: var(--muted); font-size: 12.5px; }
.score-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-2); }
.score-facts .warn b { color: var(--err-fg); }
.score-sub .warn-text { color: var(--err-fg); }
@media (max-width: 800px) {
    .score-summary { gap: 6px; }
    .score-summary > div { padding: 7px 8px; }
    .score-summary .num { font-size: 15px; }
}

/* Araç bilgileri (VehicleData) */
.vdata { display: flex; flex-direction: column; gap: 8px; }
.vdata-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.vpill {
    display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--panel); font-size: 13px; white-space: nowrap;
}
.vpill small { color: var(--muted); font-size: 11.5px; }
.vpill.warn { border-color: color-mix(in srgb, var(--idle) 50%, var(--line)); background: color-mix(in srgb, var(--idle) 10%, var(--panel)); }
.vpill.alarm { border-color: var(--err-line); background: var(--err-bg); color: var(--err-fg); }
.vpill.ok b { color: var(--moving); }
.vpill.more { cursor: pointer; color: var(--accent2); font-weight: 600; font: inherit; font-size: 13px; }
.vdata-all {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; margin: 0; padding: 12px 14px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-size: 13.5px;
}
.vdata-all > div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.vdata-all dt { color: var(--muted); }
.vdata-all dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.vlog-driving { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--text-2); font-size: 13px; }
.vlog-driving .chip-ish { padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--idle) 14%, transparent); }
.tl-trip .tl-dot { width: 14px; height: 14px; margin-top: 11px; border-color: var(--moving); background: var(--moving); }
.tl-trip .tl-body { background: color-mix(in srgb, var(--moving) 7%, transparent); border-color: color-mix(in srgb, var(--moving) 22%, var(--line)); }
.tl-trip.on .tl-body { border-color: var(--moving); box-shadow: inset 3px 0 0 var(--moving); }
.tl-stop .tl-dot { border-color: var(--parked); }
.tl-ignitionon .tl-dot { border-color: var(--moving); }
.tl-ignitionoff .tl-dot { border-color: var(--offline); background: var(--offline); }
.tl-ignitionon .tl-title, .tl-ignitionoff .tl-title { font-weight: 600; color: var(--text-2); font-size: 13.5px; }
.timeline .empty { padding: 30px 16px; }

/* ── araç kartları ve sıkı alarm listesi (telefonda) ── */

.detail-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.vehicle-cards, .alarm-list, .bottom-nav, .sheet-handle, .manage-toggle { display: none; }
.vehicle-cards, .alarm-list { list-style: none; margin: 0; padding: 0; flex-direction: column; gap: 8px; }
.vc {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--panel); color: var(--text);
}
.vc:hover { text-decoration: none; border-color: var(--line-strong); }
.vc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vc-title { font-weight: 700; }
.vc-sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-go { flex: none; color: var(--muted); }
.alarm-item {
    display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.alarm-item > .dot { margin-top: 6px; }
.ai-main { flex: 1; min-width: 0; }
.ai-title { font-weight: 700; }
.ai-sub { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }

/* ── telefon ── */

.app { height: 100dvh; }

@media (max-width: 980px) {
    .vlog-body { grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: "map" "head" "list"; }
    .vlog-map { position: relative; top: auto; height: 46dvh; min-height: 260px; }
}

@media (max-width: 800px) {
    :root { --bottom-nav-h: 60px; }
    /* Alt sekme çubuğu: hamburger ve zil yerine. */
    .hamburger, .bell { display: none; }
    .bottom-nav {
        display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; z-index: 1050; left: 0; right: 0; bottom: 0;
        height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
        background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    }
    .bn {
        position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent;
    }
    .bn:hover { text-decoration: none; color: var(--text); }
    .bn.active { color: var(--accent1); }
    .bn .badge { position: absolute; top: 6px; left: calc(50% + 6px); box-shadow: 0 0 0 2px var(--panel); }
    .page { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
    .app { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); box-sizing: border-box; }

    /* Harita sayfası: harita tam ekran, liste alttan açılan panel, seçili araç kendi paneli. */
    .live { position: relative; flex-direction: column; }
    .live .map-area { flex: 1; }
    .live .sidebar {
        position: absolute; z-index: 700; left: 0; right: 0; bottom: 0; width: auto; height: auto; max-height: 44%;
        border: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.28);
        transition: max-height 0.22s ease;
    }
    .live .sidebar.open { max-height: calc(100% - 8px); }
    /* Kapalıyken yalnız arama ve liste: durum kutuları ve süzgeçler panel büyüyünce. */
    .live .sidebar:not(.open) .stats, .live .sidebar:not(.open) .filter-box { display: none; }
    .live .sidebar:not(.open) .fleet-total { padding-bottom: 8px; }
    /* Leaflet denetimleri (z-index 1000) panelin üstüne taşmasın. */
    .live .map-area { z-index: 0; }
    .live.has-selection .sidebar { display: none; }
    .live .sheet-handle { display: flex; justify-content: center; flex: none; width: 100%; padding: 8px 0 2px; border: 0; background: none; cursor: pointer; }
    .live .sheet-handle span { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); }
    .live .fleet-total { padding-top: 4px; }
    .live .stats { padding: 10px 12px 8px; }
    .live .stat { padding: 6px 8px; }
    .live .stat-value { font-size: 17px; }
    .live .vehicle-list { min-height: 0; }
    .live .vehicle { padding: 12px 10px; }
    .live .detail {
        top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 72%; border-radius: 18px 18px 0 0;
        border-left: 0; border-right: 0; border-bottom: 0; padding: 14px 14px 18px; animation: sheet-up 0.2s ease-out;
    }
    /* Harita işaretlerinin ve Leaflet denetimlerinin üstünde kalsın. */
    .live .detail { z-index: 1001; }
    .live .toasts { z-index: 1002; }
    .live .metrics > div { padding: 8px; }
    /* Rota açıkken panel yalnız ad, rota özeti ve oynatıcı: harita görünsün. Sıkı dizilir, kaydırma çubuğu çıkmasın. */
    .live .detail { scrollbar-width: none; }
    .live .detail::-webkit-scrollbar { display: none; }
    .live .detail.routing { max-height: 60%; gap: 8px; padding: 12px 14px 14px; }
    .live .detail.routing .detail-name { font-size: 16px; }
    .live .detail.routing .route { gap: 8px; }
    .live .detail.routing .route-head .section-title { display: none; }
    .live .detail.routing .route-head .date { flex: 1; min-width: 0; }
    .live .detail.routing .route-stats > div { padding: 5px 8px; }
    .live .detail.routing .route-stats .num { font-size: 14px; white-space: nowrap; }
    .live .detail.routing .route-stats small { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .live .detail.routing .speeds { flex-wrap: nowrap; }
    .live .detail.routing .speeds .ghost { margin-left: auto; }
    .live .detail.routing .detail-sub, .live .detail.routing .detail-actions, .live .detail.routing > .alert,
    .live .detail.routing .metrics, .live .detail.routing .rows, .live .detail.routing .legend, .live .detail.routing .vdata { display: none; }
    .live .detail.routing .route { padding-top: 0; border-top: 0; }
    .live .detail.routing .route-stats > div { padding: 6px 8px; }
    .live .toasts { top: 52px; bottom: auto; left: 10px; right: 10px; width: auto; }
    .live .toast { padding: 10px; }
    .live .toast:nth-child(n + 2) { display: none; }
    .live .map-tools { top: 10px; left: 10px; }
    .live .live-pill { top: 10px; right: 10px; }

    /* Araçlar: liste önde, yönetim düğmenin arkasında. */
    .vehicle-cards, .alarm-list { display: flex; }
    .manage-toggle { display: inline-flex; align-self: flex-start; }
    .content.vehicles:not(.manage-open) .manage { display: none; }
    .wide-only { display: none !important; }
    /* Seyir defteri: özet tek satır, harita ekranın yarısından fazlası. */
    .vlog { gap: 10px; }
    .vlog-summary { gap: 6px; }
    .vlog-summary > div { padding: 7px 8px; border-radius: 10px; }
    .vlog-summary .num { font-size: 15px; }
    .vlog-summary small { font-size: 10.5px; }
    .vlog-map { height: 58dvh; }
    .vlog-title h1 { font-size: 19px; }
    /* Liste haritanın altında: başlığı ekranın altına yapışık durur, aşağıda devamı olduğu görünsün. */
    .vlog-body { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
    .vlog-list-head {
        position: sticky; z-index: 1; bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 8px); padding: 10px 14px;
        border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); cursor: pointer;
    }
    .vlog-list-head svg { display: block; }
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }

/* Dokunmatik ekranda iki parmakla yakınlaşılır; düğmeler haritayı kapatmasın. */
@media (pointer: coarse) {
    .leaflet-control-zoom { display: none; }
}
.tl-note { list-style: none; padding: 8px 14px; }

/* Bakım */
.maintenance-form { display: grid; grid-template-columns: 1.2fr 1.4fr 0.8fr 0.8fr 1fr 1fr; gap: 10px 12px; align-items: end; }
.maintenance-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.maintenance-form .input-suffix .input { width: 100%; }
.maintenance-form .form-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.maintenance-table td { vertical-align: top; }
.row-inline { display: inline-flex; gap: 6px; align-items: center; }
.vlog-maint { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; font-size: 13px; }
.vlog-maint:hover { border-color: var(--accent2); }
@media (max-width: 900px) {
    .maintenance-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .maintenance-form { grid-template-columns: 1fr; }
}

/* Raporlar */
.report-form { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr 1fr; gap: 10px 12px; align-items: end; }
.report-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.report-form .form-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.report-head { padding: 10px 18px 4px; }
.report-head h2 { padding: 0; margin: 0; }
.report-table td, .report-table th { font-size: 13px; }
.print-only { display: none; }
@media (max-width: 900px) { .report-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .report-form { grid-template-columns: 1fr; } }
@media print {
    @page { size: A4 landscape; margin: 10mm; }
    body { background: #fff; color: #000; }
    .table-card { overflow: visible !important; }
    .report-table { table-layout: auto; }
    .report-table th, .report-table td { white-space: normal !important; overflow-wrap: anywhere; }
    .topbar, .bottom-nav, .no-print, nav { display: none !important; }
    .print-only { display: block; }
    .report-brand { font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #555; }
    .content { padding: 0; max-width: none; }
    .card { border: 0; box-shadow: none; background: #fff; }
    .report-table { width: 100%; border-collapse: collapse; }
    .report-table th, .report-table td { color: #000; border-bottom: 1px solid #ccc; padding: 4px 6px; font-size: 10.5px; }
    .report-table tr { break-inside: avoid; }
    .report-table thead { display: table-header-group; }
}
