:root {
    --bg: #eef2f7;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --line: #e2e8f0;
    --line-soft: #eef2f8;
    --line-strong: #cbd5e1;
    --topbar-bg: rgba(255, 255, 255, .92);
    --tint-red: #fdeff1;
    --tint-amber: #fbf4e8;
    --tint-green: #ebf8f2;
    --tint-blue: #edf3fd;
    --tint-violet: #eef0fb;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-soft: #eff6ff;
    --green: #059669;
    --yellow: #d97706;
    --red: #dc2626;
    --blue: #2563eb;
    --ink: #0b1220;
    --orange: #f59e0b;
    --radius: 16px;
    --sidebar-w: 236px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .04);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Tahoma, Arial, sans-serif;
}

body {
    font-size: 13px;
    letter-spacing: -0.01em;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.auth-overlay {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 28px;
    display: grid;
    gap: 8px;
    box-shadow: var(--shadow);
}

.login-card h2 {
    margin: 0;
    font-size: 20px;
}

.login-card p {
    margin: 0 0 6px;
    color: var(--muted);
}

.login-card label {
    font-size: 12px;
    color: var(--muted);
}

.login-card input {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: var(--surface);
}

.login-card small {
    color: var(--muted);
}

.login-error {
    min-height: 16px;
    color: var(--red);
    font-size: 12px;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--ink);
    border-right: 1px solid #1e293b;
    padding: 22px 14px 16px;
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 8px 20px;
}

.brand-mark {
    width: 36px;
    height: 36px;
    background: transparent;
    display: grid;
    place-items: center;
}

.brand-logo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.brand strong {
    display: block;
    font-size: 15px;
    color: #fff;
    letter-spacing: .02em;
}

.brand span {
    color: #94a3b8;
    font-size: 11px;
}

.nav {
    display: grid;
    gap: 4px;
}

.nav-label {
    color: #64748b;
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 4px 10px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    border-radius: 12px;
    padding: 0 12px;
    text-decoration: none;
    color: #94a3b8;
    border: 1px solid transparent;
    position: relative;
    font-weight: 500;
    transition: background .2s ease, color .2s ease, transform .2s ease, border-color .2s ease;
}

.nav-item .ico {
    width: 18px;
    height: 18px;
    flex: none;
}

.nav-item:hover {
    background: #151d2e;
    color: #e2e8f0;
    transform: translateX(3px);
}

.nav-item.active {
    background: #1e293b;
    color: #fff;
    border-color: #334155;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--orange);
}

.nav-item.active::before {
    display: none;
}

.nav-badge {
    margin-left: auto;
    background: var(--orange);
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    padding: 2px 7px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 14px 4px 0;
    border-top: 1px solid #1e293b;
    display: grid;
    gap: 10px;
}

.account-nav {
    display: grid;
    gap: 2px;
}

.settings-toggle {
    width: 100%;
    height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #94a3b8;
    font: inherit;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.settings-toggle .ico {
    width: 18px;
    height: 18px;
    flex: none;
}

.settings-toggle span {
    flex: 1;
}

.settings-chevron {
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    margin-right: 4px;
    transition: transform .18s ease;
}

.settings-toggle[aria-expanded="true"] {
    color: #e2e8f0;
}

.settings-toggle[aria-expanded="true"] .settings-chevron {
    transform: rotate(45deg);
}

.settings-toggle:hover {
    background: #151d2e;
    color: #e2e8f0;
}

.settings-menu {
    display: grid;
    margin: 0 8px 4px 22px;
    padding-left: 12px;
    border-left: 1px solid #334155;
}

.settings-link {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 0 8px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.settings-link:hover {
    color: #e2e8f0;
    background: #151d2e;
}

.settings-link.active {
    color: #fff;
    background: #1e293b;
    box-shadow: inset 2px 0 0 var(--orange);
}

.sidebar .btn.ghost {
    border-color: #334155;
    background: transparent;
    color: #cbd5e1;
    border-radius: 12px;
}

.main {
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    min-width: 0;
}

.topbar {
    height: 76px;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--line);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.eyebrow,
.section-kicker {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.section-kicker .ico {
    width: 13px;
    height: 13px;
}

.topbar h1 {
    margin: 4px 0 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.live-pill {
    border: 0;
    color: var(--green);
    background: var(--tint-green);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 11px;
    font-weight: 600;
}

.live-pill span {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    margin-right: 6px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    font-size: 11px;
}

.content {
    padding: 22px 28px 44px;
    max-width: 1760px;
    margin: 0 auto;
}

.page-head {
    margin-bottom: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.head-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 12px;
    padding: 9px 14px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.btn:hover {
    border-color: var(--line-strong);
}

.btn.primary {
    border-color: var(--orange);
    background: var(--orange);
    color: #fff;
}

.btn.primary:hover {
    background: #d97706;
    border-color: #d97706;
}

.btn.ghost {
    background: var(--surface);
    color: var(--text);
}

.btn.tiny {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 999px;
}

.stats-grid,
.dispatch-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 96px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    flex: none;
    background: var(--primary-soft);
    color: var(--primary);
}

.stat-icon .ico {
    width: 20px;
    height: 20px;
}

.stat-card > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.stat-card strong {
    font-size: 22px;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.panel-head {
    min-height: 54px;
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--surface);
}

.panel-head > div:first-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.panel-head h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-head h2 .ico {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.command-grid,
.analytics-grid,
.dispatch-grid,
.lower-grid,
.split-layout,
.report-layout {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}

.user-chip strong {
    display: block;
    font-size: 11px;
}

.user-chip small {
    color: var(--muted);
    font-size: 10px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}

.notif-dot {
    display: none;
}

.mobile-menu {
    display: none;
}

.btn.full {
    width: 100%;
}

.stat-card > .stat-icon {
    display: grid;
    place-items: center;
}

.stat-icon.blue { background: var(--primary-soft); color: var(--primary); }
.stat-icon.green { background: var(--tint-green); color: var(--green); }
.stat-icon.yellow { background: var(--tint-amber); color: var(--yellow); }
.stat-icon.violet { background: var(--tint-violet); color: #4f46e5; }
.stat-icon.red { background: var(--tint-red); color: var(--red); }

.stat-card span {
    display: block;
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
}

.stat-card em {
    font-style: normal;
    font-size: 11px;
    margin-left: 0;
}

.up {
    color: var(--green);
}

.down {
    color: var(--muted);
}

.panel-head span {
    color: var(--muted);
    font-size: 11px;
}

.command-grid,
.traffic-map-grid {
    grid-template-columns: minmax(0, 1.72fr) minmax(330px, 0.78fr);
}

.lower-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
}

.analytics-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.8fr);
}

.report-layout,
.split-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
}

.dispatch-grid,
.assign-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.9fr);
}

.map-panel {
    position: relative;
    display: flex;
    flex-direction: column;
}

.map-panel:fullscreen,
.map-panel:-webkit-full-screen {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    background: var(--surface);
}

.map-panel:fullscreen .map,
.map-panel:-webkit-full-screen .map {
    flex: 1;
    min-height: 0;
    height: auto;
}

.map {
    flex: 1;
    min-height: 470px;
    border-bottom: 1px solid var(--line);
}

.map-legend {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 10px;
}

.map-legend-fixed {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 500;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    font-size: 11px;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.dot.critical {
    background: #8b1a1a;
}

.dot.red,
.timeline-dot.red {
    background: var(--red);
}

.dot.yellow,
.timeline-dot.yellow {
    background: var(--yellow);
}

.dot.green,
.timeline-dot.green {
    background: var(--green);
}

.dot.blue,
.timeline-dot.blue {
    background: var(--blue);
}

.panel-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.map-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.map-type select {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.chip {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chip.active {
    border-color: transparent;
    color: #fff;
    background: #0f172a;
}

.snapshot-preview {
    padding: 12px 12px 8px;
}

.snapshot-preview img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.snapshot-frame {
    position: relative;
}

.snapshot-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(10, 17, 31, 0.86);
    color: #E6ECF5;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.snapshot-placeholder {
    height: 190px;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--muted);
    background: var(--surface-2);
}

.snapshot-placeholder .ico {
    width: 28px;
    height: 28px;
    opacity: .7;
}

.snapshot-meta {
    padding: 0 12px;
    color: var(--muted);
    font-size: 11px;
}

.vision-summary {
    display: grid;
    gap: 5px;
    padding: 10px 12px 8px;
    color: var(--muted);
    font-size: 11px;
}

.snapshot-panel {
    display: flex;
    flex-direction: column;
}

.snapshot-list {
    flex: 1;
    overflow: auto;
    padding: 0 12px 12px;
}

.snapshot-list:empty::after {
    content: 'No evidence stills yet.';
    display: block;
    color: var(--muted);
    font-size: 11px;
    padding: 10px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    text-align: center;
}

.snapshot-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 6px;
}

.accounts-layout {
    display: grid;
    gap: 16px;
}

.account-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
}

.account-row small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
}

.account-row .row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.account-row .row-actions input {
    width: 180px;
}

.password-field {
    display: flex;
    gap: 8px;
    align-items: center;
}

.password-field input {
    flex: 1;
    min-width: 0;
}

.form-grid {
    padding: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

label {
    display: block;
    color: var(--muted);
    margin-bottom: 4px;
    font-size: 11px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 9px 12px;
    background: var(--surface);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 105, 209, .12);
}

textarea {
    resize: vertical;
}

.full-width {
    grid-column: 1 / -1;
}

.activity-panel {
    min-height: 140px;
}

.timeline {
    padding: 8px 10px;
}

.timeline > div {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line-soft);
}

.timeline > div:last-child {
    border-bottom: 0;
}

.timeline-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-top: 5px;
    flex: none;
}

.timeline strong {
    display: block;
    font-size: 12px;
}

.timeline small,
.timeline-empty {
    color: var(--muted);
    font-size: 11px;
}

.rank {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line-soft);
}

.rank b {
    color: var(--muted);
}

.rank div {
    flex: 1;
}

.rank strong {
    display: block;
    font-size: 12px;
}

.rank small {
    color: var(--muted);
}

.rank > span {
    color: var(--text);
    font-weight: 600;
}

.kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--surface-2);
}

.kpi-grid > div {
    background: var(--surface);
    padding: 12px;
}

.analytics-evidence {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
    background: transparent;
}

.analytics-evidence > div {
    min-height: 94px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: grid;
    align-content: center;
    gap: 5px;
    padding: 14px;
}

.analytics-evidence span,
.analytics-evidence small {
    color: var(--muted);
    font-size: 11px;
}

.analytics-evidence strong {
    color: var(--text);
    font-size: 22px;
    line-height: 1;
}

.analytics-widgets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.analytics-widget {
    min-height: 94px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    display: grid;
    align-content: center;
    gap: 5px;
}

.analytics-widget span,
.analytics-widget small {
    color: var(--muted);
    font-size: 11px;
}

.analytics-widget strong {
    font-size: 22px;
    line-height: 1;
}

.analytics-widget[data-severity="light"] {
    border-left: 3px solid var(--green);
}

.analytics-widget[data-severity="moderate"] {
    border-left: 3px solid var(--yellow);
}

.analytics-widget[data-severity="heavy"] {
    border-left: 3px solid var(--red);
}

.analytics-widget[data-severity="light"] strong {
    color: var(--green);
}

.analytics-widget[data-severity="moderate"] strong {
    color: var(--yellow);
}

.analytics-widget[data-severity="heavy"] strong {
    color: var(--red);
}

.seven-day-panel {
    margin-bottom: 12px;
}

.seven-day-chart {
    height: 150px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    align-items: end;
    padding: 12px 18px 14px;
}

.seven-day-bar-wrap {
    height: 100%;
    display: grid;
    grid-template-rows: 16px 1fr 16px;
    gap: 5px;
    align-items: end;
    text-align: center;
}

.seven-day-bar-wrap span,
.seven-day-bar-wrap small {
    color: var(--muted);
    font-size: 10px;
}

.seven-day-bar-wrap i {
    width: 100%;
    align-self: end;
    min-height: 4px;
    border-radius: 5px 5px 2px 2px;
    background: #8daee4;
}

.seven-day-bar-wrap i.today {
    background: var(--red);
}

.seven-day-bar-wrap i.today + small {
    color: var(--red);
    font-weight: 700;
}

.progress {
    height: 5px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface-2);
    margin-top: 8px;
}

.progress i {
    display: block;
    height: 100%;
    background: var(--primary);
}

.simple-bars {
    height: 190px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    align-items: end;
    padding: 0 12px 12px;
}

.bar-wrap {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    justify-content: end;
}

.bar {
    width: 100%;
    max-width: 28px;
    border-radius: 8px;
    background: var(--primary);
}

.bar-wrap small,
.chart-empty {
    color: var(--muted);
    font-size: 11px;
}

.report-cards {
    max-height: 560px;
    overflow: auto;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.report-card {
    width: 100%;
    border: 1px solid var(--line);
    border-left: 4px solid var(--line);
    border-radius: 14px;
    padding: 12px 12px;
    background: var(--surface);
    color: var(--text);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    cursor: pointer;
    text-align: left;
}

.report-card:hover {
    background: var(--surface-2);
}

.report-card.sev-low { border-left-color: var(--blue); }
.report-card.sev-moderate { border-left-color: var(--green); }
.report-card.sev-high { border-left-color: var(--yellow); }
.report-card.sev-severe { border-left-color: var(--red); }

.report-card-badges {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.report-card.empty {
    display: block;
    text-align: center;
    color: var(--muted);
    cursor: default;
    border-left-width: 1px;
}

.report-card.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.report-card strong {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.report-card strong .ico {
    width: 14px;
    height: 14px;
    color: var(--primary);
    flex: none;
}

.report-card small {
    color: var(--muted);
    font-size: 11px;
}

.report-evidence {
    min-height: 74px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-2);
}

.report-evidence img {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
}

.case-body {
    padding: 0 0 8px;
}

.case-evidence {
    margin: 10px 12px 0;
    min-height: 74px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-2);
}

.case-evidence img {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: cover;
}

.case-log {
    margin: 12px 12px 8px;
    padding: 10px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.case-log span {
    display: block;
    font-size: 10px;
    letter-spacing: .04em;
    color: var(--muted);
    margin-bottom: 4px;
}

.case-log p {
    margin: 0;
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    color: var(--muted);
}

.case-editor {
    border-top: 1px solid var(--line);
    padding: 12px;
}

a.btn.is-disabled {
    pointer-events: none;
    opacity: 0.45;
}

.dispatch-evidence {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-2);
    margin-bottom: 8px;
}

.dispatch-evidence img {
    display: block;
    width: 100%;
    max-height: 140px;
    object-fit: cover;
}

.report-evidence small,
.report-evidence-empty {
    display: block;
    padding: 8px 10px;
    color: var(--muted);
    font-size: 11px;
}

.editor-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.editor-actions .btn {
    white-space: nowrap;
}

.head-actions .search-input {
    width: 220px;
}

.head-actions .filter-select {
    width: auto;
    min-width: 132px;
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px 12px 0;
}

.report-stats > div {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--surface-2);
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 8px;
    align-items: center;
}

.report-stats > div .ico {
    grid-row: 1 / span 2;
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.report-stats strong {
    display: block;
    font-size: 18px;
}

.report-stats span {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.report-meta-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 12px 14px 0;
}

.report-meta-strip > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px 9px;
    background: var(--surface-2);
}

.report-meta-strip span {
    display: block;
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.report-meta-strip strong {
    display: block;
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

textarea.system-log {
    background: var(--surface-2);
    color: var(--muted);
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    border-style: dashed;
}

textarea.system-log:focus {
    border-color: var(--line);
    box-shadow: none;
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    display: grid;
    place-items: center;
    z-index: 1200;
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    width: min(380px, 90vw);
    background: var(--surface);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .25);
}

.modal-card h3 {
    font-size: 14px;
    margin-bottom: 6px;
}

.modal-card p {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 14px;
}

#advisoryConfirmText {
    white-space: pre-line;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.tag {
    font-size: 10px;
    border-radius: 999px;
    padding: 4px 8px;
    border: 1px solid transparent;
}

.tag.danger {
    background: var(--tint-red);
    color: var(--red);
    border-color: #f4cfd5;
}

.tag.warning {
    background: var(--tint-amber);
    color: var(--yellow);
    border-color: #ecd9b0;
}

.tag.success {
    background: var(--tint-green);
    color: var(--green);
    border-color: #c8e9dc;
}

.tag.info {
    background: var(--tint-blue);
    color: var(--blue);
    border-color: #d1dff8;
}

.tag.status-open {
    background: var(--surface-2);
    color: #475569;
    border-color: var(--line-strong);
}

.tag.status-assigned {
    background: var(--tint-violet);
    color: #4f46a5;
    border-color: #d5d8f0;
}

.tag.status-resolved {
    background: #334155;
    color: #fff;
    border-color: #334155;
}

.tag-mini {
    display: inline-block;
    margin-left: 6px;
    font-size: 8px;
    letter-spacing: .06em;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    vertical-align: middle;
}

.dispatch-clock {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--muted);
}

.dispatch-clock strong {
    color: var(--text);
    font-family: Consolas, "Courier New", monospace;
}

#dispatchQueue,
#officerPool,
#assignmentList {
    padding: 8px;
}

.dispatch-card,
.recommendation {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
}

.dispatch-card.selected {
    background: var(--primary-soft);
    border-color: #cddcf7;
}

.priority {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
}

.priority.danger {
    color: var(--red);
    background: var(--tint-red);
}

.priority.warning {
    color: var(--yellow);
    background: var(--tint-amber);
}

.dispatch-main {
    flex: 1;
}

.dispatch-main strong {
    display: block;
}

.dispatch-main span,
.dispatch-meta {
    color: var(--muted);
    font-size: 11px;
}

.dispatch-meta {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.score {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--tint-green);
    color: var(--green);
    font-weight: 700;
}

.score.muted {
    background: var(--surface-2);
    color: var(--muted);
}

.recommendation > div:nth-child(2) {
    flex: 1;
}

.recommendation p,
.recommendation small {
    margin: 2px 0;
    color: var(--muted);
}

.audit-row {
    display: grid;
    grid-template-columns: 80px 92px 1fr auto;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 7px;
}

.audit-time {
    color: var(--muted);
    font-family: Consolas, "Courier New", monospace;
}

.selected-audit {
    background: var(--primary-soft);
}

.dispatch-kpis {
    margin-bottom: 10px;
}

.page-head .segmented {
    background: var(--surface);
    border-radius: 999px;
    padding: 3px;
}

.page-head .segmented button {
    border-radius: 999px;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.page-head .segmented button .ico {
    width: 14px;
    height: 14px;
}

.page-head .segmented button.active {
    background: #0f172a;
    color: #fff;
}

.dispatch-card {
    border-left: 3px solid var(--line);
}

.dispatch-card.sev-low { border-left-color: var(--blue); }
.dispatch-card.sev-moderate { border-left-color: var(--green); }
.dispatch-card.sev-high { border-left-color: var(--yellow); }
.dispatch-card.sev-severe { border-left-color: var(--red); }

#dispatchQueue,
#officerPool {
    max-height: 460px;
    overflow: auto;
}

.dispatch-selected {
    padding: 10px 12px 0;
}

.selected-report {
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 10px;
    display: grid;
    gap: 6px;
    margin-bottom: 8px;
}

.selected-report strong,
.profile-hero strong,
.profile-block strong {
    display: block;
}

.selected-report span,
.profile-hero span,
.profile-block span,
.roster-card small {
    color: var(--muted);
    font-size: 11px;
}

.selected-report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.recommendation.recommended {
    border-color: #a7f3d0;
    background: var(--tint-green);
}

.sla-ok { color: var(--muted); }
.sla-breach { color: var(--red); font-weight: 600; }

.kanban {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
}

.kanban-col {
    min-height: 180px;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    padding: 10px;
    background: var(--surface-2);
}

.kanban-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--surface);
    display: grid;
    gap: 3px;
}

.kanban-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.kanban-head span,
.kanban-empty {
    color: var(--muted);
    font-size: 11px;
}

.kanban-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
    background: var(--surface);
    display: grid;
    gap: 3px;
}

.kanban-card strong { font-size: 12px; }
.kanban-card span,
.kanban-card small { color: var(--muted); font-size: 11px; }
.kanban-card.selected { background: var(--primary-soft); border-color: #cddcf7; }
.kanban-card.sla-hot { border-color: #f0c7cc; }
.kanban-card .btn { margin-top: 6px; justify-self: start; }

.roster-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 10px;
}

.roster-left {
    display: grid;
    gap: 10px;
    align-content: start;
}

.officer-create-form {
    padding-top: 8px;
}

.form-error {
    grid-column: 1 / -1;
    margin: 0;
    color: #b44e58;
    font-size: 12px;
}

#deskSaveNotice {
    margin: 0 0 12px;
}

.roster-grid {
    padding: 8px;
    display: grid;
    gap: 8px;
}

.roster-card {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: var(--surface);
    color: var(--text);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    text-align: left;
    cursor: pointer;
}

.roster-card.selected {
    background: var(--primary-soft);
    border-color: #cddcf7;
}

.roster-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    font-size: 12px;
}

.roster-avatar.lg {
    width: 48px;
    height: 48px;
    font-size: 16px;
}

.roster-tasks {
    color: var(--muted);
    font-size: 11px;
}

.profile-hero {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px 14px 0;
}

.profile-actions {
    display: flex;
    gap: 8px;
    padding: 12px 14px 0;
}

.form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.profile-block {
    padding: 0 14px 10px;
}

.tag.status-enroute {
    background: var(--tint-violet);
    color: #4f46a5;
    border-color: #d5d8f0;
}

.tag.status-onscene {
    background: var(--tint-amber);
    color: var(--yellow);
    border-color: #ead9b5;
}

.priority.success {
    color: var(--green);
    background: var(--tint-green);
}

.priority.info {
    color: var(--blue);
    background: var(--primary-soft);
}

/* A metric the current data cannot support: dashed and muted, never a number. */
.stat-card.unavailable {
    border-style: dashed;
    background: var(--surface-2);
}

.stat-card.unavailable strong {
    color: var(--muted);
}

.stat-card.unavailable em {
    color: var(--muted);
    font-size: 10px;
}

.stat-card.unavailable .stat-icon {
    background: var(--surface-2);
    color: var(--muted);
}

.camera-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    border-left: 3px solid var(--muted);
}

.camera-banner .ico {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    flex: none;
}

.camera-banner > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.camera-banner strong,
.camera-banner span {
    display: block;
}

.camera-banner strong {
    font-size: 12px;
}

.camera-banner span {
    color: var(--muted);
    font-size: 11px;
}

.camera-banner[data-state="offline"] {
    border-left-color: var(--red);
    background: var(--tint-red);
}

.camera-banner[data-state="offline"] strong {
    color: var(--red);
}

.auto-assign-alerts {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.auto-assign-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    border-left: 3px solid var(--yellow);
    background: var(--tint-amber);
}

.auto-assign-alert .ico {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    flex: none;
    color: var(--yellow);
}

.auto-assign-alert > div {
    display: grid;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.auto-assign-alert strong {
    font-size: 12px;
}

.auto-assign-alert span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.auto-assign-alert button {
    flex: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.camera-banner[data-state="simulated"] {
    border-left-color: var(--yellow);
    background: var(--tint-amber);
}

.camera-banner[data-state="simulated"] strong {
    color: var(--yellow);
}

.data-scope {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    padding: 9px 14px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    border-left: 3px solid var(--green);
}

.data-scope strong {
    font-size: 12px;
}

.data-scope span {
    color: var(--muted);
    font-size: 11px;
}

.data-scope[data-state="partial"] {
    border-left-color: var(--yellow);
}

.data-scope[data-state="empty"] {
    border-left-color: var(--muted);
}

.axis-note {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .03em;
}

.panel-note {
    padding: 0 14px 12px;
    color: var(--muted);
    font-size: 11px;
}

.analytics-widgets-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* --- incident detection + forecast --- */

.analytics-grid-alerts {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

#anomalyList,
.forecast-row {
    padding: 10px 14px 14px;
}

#anomalyList .chart-empty,
.forecast-row .chart-empty {
    padding: 4px 0 6px;
}

.anomaly-row {
    border-left: 3px solid var(--line);
    background: rgba(255, 255, 255, .02);
    border-radius: 0 6px 6px 0;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.anomaly-row:last-child {
    margin-bottom: 0;
}

.anomaly-row.severity-severe { border-left-color: #8b1a1a; }
.anomaly-row.severity-high { border-left-color: #e74c3c; }
.anomaly-row.severity-moderate { border-left-color: #f39c12; }

.anomaly-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.anomaly-head strong {
    font-size: 12px;
}

.anomaly-row p {
    margin: 4px 0 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.anomaly-row small {
    color: var(--muted);
    font-size: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.forecast-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.forecast-card {
    border: 1px solid var(--line);
    border-top: 3px solid var(--level, var(--line));
    border-radius: 6px;
    padding: 9px 10px;
    display: grid;
    gap: 2px;
}

.forecast-card span {
    color: var(--muted);
    font-size: 10px;
}

.forecast-card strong {
    font-size: 21px;
    line-height: 1.1;
}

.forecast-card b {
    font-size: 10px;
    letter-spacing: .05em;
    color: var(--level, var(--muted));
}

.forecast-card em {
    color: var(--muted);
    font-size: 10px;
    font-style: normal;
}

.forecast-card.unavailable {
    border-style: dashed;
    border-top-color: var(--line);
}

.forecast-card.unavailable strong {
    color: var(--muted);
}

/* --- heatmap --- */

.heatmap-panel {
    margin-bottom: 10px;
}

.segmented {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}

.segmented button {
    background: transparent;
    border: 0;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .04em;
    padding: 5px 10px;
    cursor: pointer;
}

.segmented button.active {
    background: rgba(255, 255, 255, .07);
    color: var(--text);
}

.heatmap {
    padding: 10px 14px 4px;
    display: grid;
    gap: 3px;
}

.heat-row {
    display: grid;
    grid-template-columns: 30px repeat(24, minmax(0, 1fr));
    gap: 3px;
    align-items: center;
}

.heat-day {
    color: var(--muted);
    font-size: 10px;
}

.heat-hour {
    color: var(--muted);
    font-size: 9px;
    text-align: center;
}

.heat-cell {
    height: 17px;
    border-radius: 2px;
    background: var(--line);
}

/* A never-observed slot must not read as "light traffic". */
.heat-cell.empty {
    background: repeating-linear-gradient(45deg,
        rgba(255, 255, 255, .04) 0 2px,
        transparent 2px 4px);
}

.heatmap-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px 12px;
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
}

.heat-key {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.heat-key i {
    width: 9px;
    height: 9px;
    border-radius: 2px;
}

.heat-ramp {
    width: 70px;
    height: 9px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(231, 76, 60, .12), rgba(231, 76, 60, 1));
}

.analytics-widget[data-severity="critical"] {
    border-left: 3px solid #8b1a1a;
}

.analytics-widget[data-severity="critical"] strong {
    color: #8b1a1a;
}

.report-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-kpis strong {
    display: block;
    font-size: 18px;
    margin: 2px 0;
}

.report-kpis span,
.report-kpis small {
    color: var(--muted);
    font-size: 11px;
}

.mix-list {
    padding: 10px 14px 14px;
    display: grid;
    gap: 9px;
}

.mix-row {
    display: grid;
    grid-template-columns: 78px 1fr 40px 34px;
    align-items: center;
    gap: 8px;
}

.mix-label {
    font-size: 11px;
    text-transform: capitalize;
    color: var(--text);
}

.mix-row .progress {
    margin-top: 0;
}

.mix-row strong {
    font-size: 12px;
    text-align: right;
}

.mix-row small {
    color: var(--muted);
    font-size: 10px;
    text-align: right;
}

.progress i.mix-car { background: var(--primary); }
.progress i.mix-motorcycle { background: var(--orange); }
.progress i.mix-bus { background: var(--green); }
.progress i.mix-truck { background: var(--red); }

.progress i.sev-fill-low { background: var(--blue); }
.progress i.sev-fill-moderate { background: var(--green); }
.progress i.sev-fill-high { background: var(--yellow); }
.progress i.sev-fill-severe { background: var(--red); }

.bar-value {
    color: var(--muted);
    font-size: 10px;
}

.seven-day-bar-wrap i.no-data {
    background: var(--surface-2);
}

@media (max-width: 1100px) {
    .stats-grid,
    .dispatch-kpis,
    .logs-kpis {
        grid-template-columns: 1fr 1fr;
    }

    .analytics-widgets-4 {
        grid-template-columns: 1fr 1fr;
    }

    .command-grid,
    .traffic-map-grid,
    .lower-grid,
    .analytics-grid,
    .analytics-grid-alerts,
    .report-layout,
    .split-layout,
    .dispatch-grid,
    .assign-grid,
    .roster-layout,
    .logs-split {
        grid-template-columns: 1fr;
    }

    .kanban {
        grid-template-columns: 1fr 1fr;
    }

    .heat-row {
        grid-template-columns: 26px repeat(24, minmax(0, 1fr));
        gap: 2px;
    }
}

@media (max-width: 760px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
        width: 100%;
    }

    .content {
        padding: 14px;
    }

    .topbar {
        padding: 0 12px;
    }

    .topbar h1 {
        font-size: 18px;
    }

    .user-chip,
    .live-pill {
        display: none;
    }

    .page-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .head-actions {
        width: 100%;
    }

    .head-actions .btn {
        flex: 1;
    }

    .head-actions .search-input {
        width: 100%;
    }

    .report-meta-strip {
        grid-template-columns: 1fr 1fr;
    }

    .form-grid,
    .report-card {
        grid-template-columns: 1fr;
    }

    .analytics-evidence {
        grid-template-columns: 1fr;
    }

    .analytics-widgets,
    .analytics-widgets-4,
    .report-kpis {
        grid-template-columns: 1fr;
    }

    .mix-row {
        grid-template-columns: 70px 1fr 38px 30px;
    }

    .editor-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .audit-row {
        grid-template-columns: 1fr;
    }

    .kanban {
        grid-template-columns: 1fr;
    }

    .roster-card {
        grid-template-columns: auto 1fr;
    }
}

@media (max-width: 460px) {
    .stats-grid,
    .dispatch-kpis {
        grid-template-columns: 1fr;
    }

    .topbar h1 {
        font-size: 16px;
    }

    .panel-head span,
    .section-kicker,
    .eyebrow {
        display: none;
    }
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.ico {
    width: 16px;
    height: 16px;
    display: block;
    flex: none;
    overflow: hidden;
}

.login-mark {
    width: 72px;
    height: 72px;
    background: transparent;
    display: grid;
    place-items: center;
    margin-bottom: 4px;
}

.login-mark .ico {
    width: 24px;
    height: 24px;
}

.login-card {
    animation: rise .45s ease both;
}

.field-wrap,
.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-wrap .ico,
.search-wrap .ico {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--muted);
    pointer-events: none;
}

.field-wrap input,
.search-wrap input {
    padding-left: 38px;
}

.icon-btn {
    display: grid;
    place-items: center;
}

.icon-btn.mobile-menu {
    display: none;
}

@media (max-width: 760px) {
    .icon-btn.mobile-menu {
        display: grid;
    }
}

.icon-btn .ico {
    width: 18px;
    height: 18px;
}

.sidebar .btn.ghost {
    justify-content: flex-start;
}

.live-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.live-text i,
.live-pill span {
    animation: live-pulse 1.8s ease-out infinite;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 36px 20px;
    color: var(--muted);
    min-height: 220px;
}

.empty-state-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    animation: float-soft 3.2s ease-in-out infinite;
}

.empty-state-icon .ico {
    width: 24px;
    height: 24px;
}

.empty-state strong {
    color: var(--text);
    font-size: 14px;
}

.empty-state span {
    max-width: 320px;
    font-size: 12px;
    line-height: 1.45;
}

.pane-in {
    animation: rise .32s ease both;
}

.btn.tiny .ico {
    width: 13px;
    height: 13px;
}

.timeline .empty-state,
.snapshot-list .empty-state {
    min-height: 140px;
    padding: 18px 12px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled:hover,
.btn.is-disabled:hover {
    transform: none;
    box-shadow: none;
}

.stat-card,
.panel,
.analytics-widget,
.analytics-evidence > div {
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.stat-card:hover,
.analytics-widget:hover,
.analytics-evidence > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}

.report-card,
.dispatch-card,
.recommendation,
.roster-card,
.kanban-card {
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.report-card:hover,
.dispatch-card:hover,
.recommendation:hover,
.roster-card:hover,
.kanban-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

.chip,
.page-head .segmented button {
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.content > * {
    animation: rise .42s ease both;
}

.content > *:nth-child(1) { animation-delay: .02s; }
.content > *:nth-child(2) { animation-delay: .06s; }
.content > *:nth-child(3) { animation-delay: .1s; }
.content > *:nth-child(4) { animation-delay: .14s; }
.content > *:nth-child(5) { animation-delay: .18s; }
.content > *:nth-child(6) { animation-delay: .22s; }
.content > *:nth-child(7) { animation-delay: .26s; }
.content > *:nth-child(8) { animation-delay: .3s; }

.modal-card {
    animation: rise .28s ease both;
}

.brand-mark {
    animation: brand-pop .6s ease both;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, .45); }
    70% { box-shadow: 0 0 0 8px rgba(5, 150, 105, 0); }
    100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

@keyframes float-soft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes brand-pop {
    from { transform: scale(.86); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.logs-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.logs-kpis .stat-card {
    min-height: 92px;
}

.logs-kpis .stat-card strong {
    font-size: 18px;
    line-height: 1.2;
}

.logs-split {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 16px;
    margin-bottom: 16px;
    align-items: start;
}

.log-list {
    display: grid;
    gap: 8px;
    max-height: 520px;
    overflow: auto;
    padding: 12px;
    background: var(--bg);
}

.log-list .empty-state {
    min-height: 180px;
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: 14px;
}

.log-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.log-row.level-light,
.log-row.is-resolved,
.log-row.is-closed { border-left-color: var(--green); }

.log-row.level-moderate,
.log-row.is-assigned { border-left-color: var(--yellow); }

.log-row.level-heavy,
.log-row.level-critical,
.log-row.is-onscene { border-left-color: var(--red); }

.log-row.is-open { border-left-color: var(--primary); }
.log-row.is-enroute { border-left-color: var(--orange); }

.log-row:hover {
    border-top-color: var(--line-strong);
    border-right-color: var(--line-strong);
    border-bottom-color: var(--line-strong);
}

.log-main {
    min-width: 0;
}

.log-main strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.log-main small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.log-row.assignment {
    grid-template-columns: minmax(160px, 1.2fr) auto auto;
}

.log-durations {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.log-duration,
.log-time {
    min-width: 108px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--primary-soft);
}

.log-duration.short {
    background: var(--tint-amber);
    border-color: var(--yellow);
}

.log-duration small,
.log-time small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.log-duration b,
.log-time b {
    display: block;
    margin-top: 2px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.log-duration.short b {
    color: var(--yellow);
}

.log-times {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.log-time {
    min-width: 148px;
    background: var(--surface-2);
}

@media (max-width: 800px) {
    .log-row,
    .log-row.assignment {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
    .logs-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .logs-split {
        grid-template-columns: 1fr;
    }

    .logs-kpis {
        grid-template-columns: 1fr 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
