/* ═══════════════════════════════════════════════════════════
   EJÉRCITO DEL PERÚ — GPS PATROL SYSTEM
   RADAR TERMINAL THEME  ·  v3.0
   Palette: jet-black bg · neon green · red alert · mono type
═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Oswald:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* ── Core terminal palette ───────────────────────── */
    --bg: #020c04;
    /* near-black */
    --bg2: #040f06;
    --surface: #071409;
    /* card bg */
    --surface2: #0d2010;
    /* hover/raised */
    --surface3: #112918;

    /* ── Neon green (primary accent) ─────────────────── */
    --green: #4ade80;
    --green-dk: #22c55e;
    --green-dim: #16a34a;
    --green-ghost: rgba(74, 222, 128, .08);

    /* ── Secondary accents ───────────────────────────── */
    --amber: #fbbf24;
    /* warning / gold replacement */
    --amber-dk: #d97706;
    --red: #ef4444;
    /* alert / danger */
    --red-dk: #b91c1c;
    --cyan: #22d3ee;
    /* info highlights */

    /* ── Borders & text ──────────────────────────────── */
    --border: rgba(74, 222, 128, .25);
    --border-hi: rgba(74, 222, 128, .5);
    --text: #e2fdf0;
    /* soft green-white */
    --muted: #86efac;
    /* dimmer green */
    --muted-dim: rgba(134, 239, 172, .55);

    /* ── UI tokens ───────────────────────────────────── */
    --radius: 0.55rem;
    --shadow: 0 4px 24px rgba(0, 0, 0, .7);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .5);
    --glow: 0 0 16px rgba(74, 222, 128, .2);
    --glow-hi: 0 0 24px rgba(74, 222, 128, .45);
}

/* ── Reset ──────────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Scanline texture overlay ───────────────────────────── */
html::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, .08) 2px,
            rgba(0, 0, 0, .08) 4px);
}

html,
body {
    font-family: 'Inter', 'Share Tech Mono', monospace;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

h1,
h2,
h3 {
    font-family: 'Oswald', sans-serif;
    letter-spacing: 0.06em;
}

/* ─── Striped flag bar (keep for Peru identity) ─────────── */
.striped-bar {
    height: 3px;
    background: repeating-linear-gradient(90deg,
            var(--red) 0%, var(--red) 33%,
            rgba(255, 255, 255, .7) 33%, rgba(255, 255, 255, .7) 66%,
            var(--red) 66%, var(--red) 100%);
}

/* ═══ FORM CONTROLS ══════════════════════════════════════ */
.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'Share Tech Mono', monospace;
    font-size: .92rem;
    transition: border-color .2s, box-shadow .2s;
}

.form-control::placeholder {
    color: var(--muted-dim);
}

.form-control:focus {
    outline: none;
    border-color: var(--green-dk);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, .12);
}

select.form-control option {
    background: var(--surface2);
}

/* ═══ BUTTONS ════════════════════════════════════════════ */
.btn {
    display: inline-block;
    padding: .7rem 1.5rem;
    border-radius: var(--radius);
    font-family: 'Oswald', sans-serif;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    transition: all .2s;
    width: 100%;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: transparent;
    color: var(--green);
    border: 1px solid var(--green-dk);
    box-shadow: var(--glow);
}

.btn-primary:hover {
    background: var(--green-ghost);
    border-color: var(--green);
    box-shadow: var(--glow-hi);
    color: #fff;
}

/* ═══ ALERTS ═════════════════════════════════════════════ */
.alert {
    padding: .7rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .875rem;
}

.alert-danger {
    background: rgba(239, 68, 68, .07);
    color: #fca5a5;
    border: 1px solid var(--red-dk);
}

/* ═══ SUCCESS BANNER ══════════════════════════════════════ */
.alert-ok {
    background: rgba(74, 222, 128, .06);
    border: 1px solid var(--green-dim);
    color: var(--green);
    padding: .6rem 1rem;
    border-radius: .5rem;
    font-size: .85rem;
    margin-bottom: 1.2rem;
    font-family: 'Share Tech Mono', monospace;
}

/* ═══ LOGIN ══════════════════════════════════════════════ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(74, 222, 128, .07) 0%, transparent 60%),
        var(--bg);
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    box-shadow: var(--shadow), var(--glow);
}

.login-card-header {
    background: var(--bg2);
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.login-card-header::after {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--green-dk), transparent);
    margin-top: 1rem;
}

.login-emblem {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--surface2);
    border: 2px solid var(--green-dk);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1rem;
    box-shadow: 0 0 20px rgba(74, 222, 128, .2);
}

.login-card-header h1 {
    font-size: 1.35rem;
    color: var(--green);
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(74, 222, 128, .4);
}

.login-card-header p {
    font-size: .75rem;
    color: var(--muted-dim);
    margin-top: .25rem;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.login-card-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    margin-bottom: .35rem;
    font-family: 'Share Tech Mono', monospace;
}

.login-footer-note {
    text-align: center;
    font-size: .65rem;
    color: var(--muted-dim);
    margin-top: 1.2rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-family: 'Share Tech Mono', monospace;
}

/* ═══ APP SHELL ══════════════════════════════════════════ */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Global Header ──────────────────────────────────────── */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 200;
    flex-shrink: 0;
    gap: 1rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .6);
}

.app-header-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

.app-header-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
}

.app-header-emblem {
    font-size: 1.7rem;
}

.app-header-title {
    font-family: 'Oswald', sans-serif;
    font-size: .95rem;
    font-weight: 700;
    color: var(--green);
    line-height: 1.2;
    letter-spacing: .06em;
    text-shadow: 0 0 8px rgba(74, 222, 128, .3);
}

.app-header-subtitle {
    font-size: .62rem;
    color: var(--muted-dim);
    text-transform: uppercase;
    letter-spacing: .1em;
    font-family: 'Share Tech Mono', monospace;
}

/* Peru flag in header */
.app-header-flag {
    display: flex;
    gap: 3px;
    opacity: .4;
}

.app-header-flag span {
    display: block;
    width: 16px;
    height: 24px;
    border-radius: 2px;
}

.app-header-flag span:nth-child(1),
.app-header-flag span:nth-child(3) {
    background: var(--red);
}

.app-header-flag span:nth-child(2) {
    background: rgba(255, 255, 255, .9);
}

.app-header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.app-header-username {
    display: flex;
    align-items: center;
    gap: .5rem;
    text-align: right;
}

.app-header-icon {
    font-size: 1.3rem;
}

.app-header-fullname {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text);
}

.app-header-role {
    font-size: .62rem;
    color: var(--muted-dim);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-family: 'Share Tech Mono', monospace;
}

.app-header-logout {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red-dk);
    border-radius: .4rem;
    padding: .32rem .85rem;
    font-family: 'Oswald', sans-serif;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}

.app-header-logout:hover {
    background: rgba(239, 68, 68, .1);
    color: #fca5a5;
}

/* ─── Global Footer ──────────────────────────────────────── */
.app-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    color: var(--muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    z-index: 1001;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-family: 'Share Tech Mono', monospace;
}

.app-footer-sep {
    color: var(--border);
}

/* ═══ LAYOUT ══════════════════════════════════════════════ */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    flex: 1;
    overflow: hidden;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.4rem 1.2rem 1.2rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.sidebar-header .sidebar-emblem {
    font-size: 2.2rem;
    display: block;
    margin-bottom: .45rem;
}

.sidebar-header h2 {
    font-size: .95rem;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: .07em;
    line-height: 1.3;
    text-shadow: 0 0 8px rgba(74, 222, 128, .25);
}

.sidebar-header small {
    font-size: .62rem;
    color: var(--muted-dim);
    display: block;
    margin-top: .2rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-family: 'Share Tech Mono', monospace;
}

.sidebar-nav {
    padding: .85rem .7rem;
    flex: 1;
}

.nav-section-label {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--muted-dim);
    padding: 0 .5rem;
    margin: 1rem 0 .3rem;
    font-family: 'Share Tech Mono', monospace;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--muted);
    text-decoration: none;
    padding: .6rem .7rem;
    border-radius: var(--radius);
    margin-bottom: .15rem;
    transition: all .18s;
    font-size: .84rem;
    font-weight: 500;
    border: 1px solid transparent;
    font-family: 'Share Tech Mono', monospace;
}

.nav-link .nav-icon {
    font-size: .95rem;
    width: 20px;
    text-align: center;
}

.nav-link:hover {
    background: var(--green-ghost);
    color: var(--green);
    border-color: var(--border);
}

.nav-link.active {
    background: rgba(74, 222, 128, .1);
    color: var(--green);
    border-color: var(--green-dim);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--green-dk);
}

.sidebar-footer {
    padding: .9rem .7rem;
    border-top: 1px solid var(--border);
}

.sidebar-footer .nav-link {
    color: var(--red);
}

.sidebar-footer .nav-link:hover {
    background: rgba(239, 68, 68, .07);
    border-color: var(--red-dk);
}

.sidebar-user {
    margin-top: .8rem;
    padding-top: .7rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.sidebar-user-name {
    display: block;
    font-size: .78rem;
    color: var(--text);
    font-weight: 600;
    margin-bottom: .45rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Share Tech Mono', monospace;
}

.sidebar-logout-btn {
    display: inline-block;
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red-dk);
    border-radius: .4rem;
    padding: .28rem .85rem;
    font-size: .75rem;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    letter-spacing: .05em;
    text-decoration: none;
    transition: all .2s;
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, .1);
    color: #fca5a5;
}

/* ─── Main content ───────────────────────────────────────── */
.main-content {
    padding: 2rem;
    background: var(--bg);
    overflow-y: auto;
}

.main-content.map-page {
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.main-content.map-page #map {
    flex: 1;
    min-height: 0;
}

.main-content.map-page .alert-panel {
    max-height: 220px;
    overflow-y: auto;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
}

/* ─── Topbar ─────────────────────────────────────────────── */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.topbar-title {
    color: var(--green);
    font-size: 1.55rem;
    text-shadow: 0 0 10px rgba(74, 222, 128, .3);
}

.topbar-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .3rem;
}

.topbar-name {
    font-size: .78rem;
    color: var(--muted);
    background: var(--surface2);
    padding: .3rem .8rem;
    border-radius: 2rem;
    border: 1px solid var(--border);
    white-space: nowrap;
    font-family: 'Share Tech Mono', monospace;
}

.topbar-logout {
    display: inline-block;
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red-dk);
    border-radius: .4rem;
    padding: .22rem .8rem;
    font-size: .72rem;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    letter-spacing: .05em;
    text-decoration: none;
    transition: all .2s;
}

.topbar-logout:hover {
    background: rgba(239, 68, 68, .1);
    color: #fca5a5;
}

/* ═══ STATS CARDS ══════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.1rem;
    position: relative;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}

.stat-card:hover {
    border-color: var(--border-hi);
    box-shadow: var(--glow);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--green-dk), transparent);
}

.stat-card p {
    font-size: .7rem;
    color: var(--muted-dim);
    text-transform: uppercase;
    letter-spacing: .1em;
    font-family: 'Share Tech Mono', monospace;
}

.stat-card h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.85rem;
    margin-top: .25rem;
    color: var(--green);
    text-shadow: 0 0 10px rgba(74, 222, 128, .25);
}

/* ═══ MAP ═══════════════════════════════════════════════════ */
#map {
    height: 560px;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 1;
}

.patrol-label {
    background: rgba(2, 12, 4, .9) !important;
    color: var(--green) !important;
    border: 1px solid var(--green-dim) !important;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Share Tech Mono', monospace;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .05em;
    box-shadow: 0 0 8px rgba(74, 222, 128, .2);
}

.leaflet-tooltip-top.patrol-label::before {
    border-top-color: var(--green-dim) !important;
}

/* ─── Dark Popups (Radar Theme) ────────────────────────── */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border-hi) !important;
    box-shadow: var(--shadow), var(--glow) !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 0.6rem !important;
    padding: 0 !important;
}

.leaflet-popup-content {
    margin: 12px 16px !important;
}

.leaflet-container a.leaflet-popup-close-button {
    color: var(--muted) !important;
    padding: 8px 8px 0 0 !important;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: var(--green) !important;
}

/* ═══ TABLES ════════════════════════════════════════════════ */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

thead {
    background: var(--surface2);
}

th,
td {
    padding: .85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-family: 'Share Tech Mono', monospace;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--green);
}

td {
    font-size: .85rem;
    color: var(--text);
}

tbody tr:hover {
    background: var(--surface2);
}

/* ═══ MODAL SECTION (form cards) ═══════════════════════════ */
.modal-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    margin-bottom: 1.5rem;
}

.modal-section h3 {
    font-size: .95rem;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 1rem;
    padding-bottom: .55rem;
    border-bottom: 1px solid var(--border);
    text-shadow: 0 0 8px rgba(74, 222, 128, .2);
}

/* ═══ ALERT PANEL ══════════════════════════════════════════ */
.alert-panel {
    background: rgba(239, 68, 68, .04);
    border: 1px solid var(--red-dk);
    border-radius: var(--radius);
    padding: 1.4rem;
    margin-top: 1.5rem;
}

.alert-panel h3 {
    font-size: .95rem;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 1rem;
}

.alert-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .7rem;
    border-radius: var(--radius);
    background: rgba(239, 68, 68, .05);
    border: 1px solid rgba(185, 28, 28, .4);
    margin-bottom: .45rem;
    flex-wrap: wrap;
}

.alert-row span {
    font-size: .85rem;
    flex: 1;
}

/* ═══ CRUD BUTTONS ══════════════════════════════════════════ */
.btn-resolve {
    background: transparent;
    color: var(--green-dk);
    border: 1px solid var(--green-dim);
    padding: .3rem .85rem;
    border-radius: .4rem;
    cursor: pointer;
    font-size: .75rem;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    letter-spacing: .05em;
    transition: all .18s;
}

.btn-resolve:hover {
    background: var(--green-ghost);
    box-shadow: var(--glow);
}

.td-actions {
    display: flex;
    gap: .45rem;
    align-items: center;
    white-space: nowrap;
}

.btn-edit {
    background: transparent;
    color: var(--amber);
    border: 1px solid var(--amber-dk);
    border-radius: .4rem;
    padding: .25rem .7rem;
    font-size: .72rem;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    letter-spacing: .04em;
    cursor: pointer;
    transition: all .18s;
}

.btn-edit:hover {
    background: rgba(251, 191, 36, .1);
}

.btn-del {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red-dk);
    border-radius: .4rem;
    padding: .25rem .7rem;
    font-size: .72rem;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    letter-spacing: .04em;
    text-decoration: none;
    cursor: pointer;
    transition: all .18s;
}

.btn-del:hover {
    background: rgba(239, 68, 68, .1);
    color: #fca5a5;
}

.btn-cancel {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: .4rem;
    padding: .38rem 1rem;
    font-family: 'Oswald', sans-serif;
    font-size: .83rem;
    cursor: pointer;
    transition: all .18s;
}

.btn-cancel:hover {
    border-color: var(--border-hi);
    color: var(--text);
}

/* ═══ CRUD MODAL OVERLAY ════════════════════════════════════ */
.crud-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.crud-modal-box {
    background: var(--surface);
    border: 1px solid var(--border-hi);
    border-radius: .8rem;
    padding: 1.6rem 1.9rem;
    width: min(580px, 95vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .8), var(--glow);
}

.crud-modal-box h3 {
    color: var(--green);
    margin-bottom: .5rem;
    font-size: 1.05rem;
}

/* ═══ FIELD LABEL ═══════════════════════════════════════════ */
.field-label {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    margin-bottom: .28rem;
    font-family: 'Share Tech Mono', monospace;
}

/* ═══ CHART WRAP ════════════════════════════════════════════ */
.chart-wrap {
    position: relative;
    width: 100%;
    height: 260px;
}

.chart-wrap canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

/* ═══ ZONE BANNER ═══════════════════════════════════════════ */
.zone-banner {
    display: flex;
    align-items: center;
    gap: .7rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: .6rem;
    padding: .7rem 1rem;
    margin-bottom: 1.4rem;
    font-size: .82rem;
    font-family: 'Share Tech Mono', monospace;
}

.zone-banner strong {
    color: var(--green);
    font-size: .95rem;
}

/* ═══ SCROLLBAR ═════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg2);
}

::-webkit-scrollbar-thumb {
    background: var(--green-dim);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--green-dk);
}

/* ═══ COMPACT PROFILE & NAVIGATION ══════════════════════════ */
.menu-toggle-btn {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--green);
    padding: 0.4rem 0.6rem;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.app-header-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .35rem .75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 2rem;
    cursor: pointer;
    transition: all .2s;
    user-select: none;
}

.app-header-profile:hover {
    border-color: var(--green-dim);
    background: var(--bg2);
}

.app-header-profile.active {
    border-color: var(--green);
    background: var(--surface2);
    box-shadow: var(--glow);
}

.profile-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg2);
    border: 1px solid var(--border-hi);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

.profile-role {
    font-size: .6rem;
    color: var(--muted-dim);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-top: .1rem;
    font-family: 'Share Tech Mono', monospace;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    width: 180px;
    background: var(--surface);
    border: 1px solid var(--border-hi);
    border-radius: .6rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), var(--glow);
    display: none;
    z-index: 1100;
}

.app-header-profile.active .profile-dropdown {
    display: block;
    animation: slideDown .2s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1rem;
    font-size: .78rem;
    color: var(--muted);
    text-decoration: none;
    transition: all .2s;
    font-family: 'Share Tech Mono', monospace;
}

.dropdown-item:hover {
    background: var(--green-ghost);
    color: var(--green);
}

.logout-item {
    color: var(--red);
    border-top: 1px solid var(--border);
}

.logout-item:hover {
    background: rgba(239, 68, 68, .08);
    color: #fca5a5;
}

/* ═══ RESPONSIVE DESIGN ═══════════════════════════════════ */
@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 60px;
        bottom: 0;
        width: 260px;
        z-index: 1010;
        transition: left 0.3s ease;
        background: var(--bg2);
        border-right: 1px solid var(--border);
    }

    .sidebar.active {
        left: 0 !important;
    }

    .main-content {
        padding: 1.25rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .menu-toggle-btn {
        display: block;
    }
}

@media (max-width: 768px) {
    .app-header-subtitle {
        display: none !important;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .app-footer {
        flex-direction: column;
        padding: 1rem;
        text-align: center;
    }

    .app-footer>div {
        order: -1;
        width: 100%;
        margin: 0 0 10px 0 !important;
    }

    .profile-info {
        display: none;
    }

    .topbar {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .profile-info {
        display: none;
    }

    .app-header-profile {
        padding: .3rem;
        border-radius: 50%;
    }

    /* Table to Card View */
    .rpt-table,
    .rpt-table thead,
    .rpt-table tbody,
    .rpt-table th,
    .rpt-table td,
    .rpt-table tr {
        display: block;
    }

    .rpt-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .rpt-table tr {
        margin-bottom: 1.2rem;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--surface);
        padding: 0.5rem 0;
        box-shadow: var(--glow);
    }

    .rpt-table td {
        border: none;
        border-bottom: 1px solid rgba(74, 222, 128, .05);
        position: relative;
        padding-left: 45% !important;
        text-align: right;
        min-height: 2.8rem;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .rpt-table td:last-child {
        border-bottom: none;
    }

    .rpt-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 40%;
        text-align: left;
        font-family: 'Share Tech Mono', monospace;
        font-size: .65rem;
        text-transform: uppercase;
        color: var(--green-dim);
        font-weight: 700;
    }

    .td-actions {
        justify-content: flex-end;
    }

    .crud-modal-box {
        padding: 1.2rem;
        width: 95vw;
    }
}


.speed-hud {
    position: absolute;
    top: 5rem;
    right: 1.5rem;
    z-index: 1000;
    width: 140px;
    height: 140px;
    background: rgba(0, 20, 5, 0.7);
    border-radius: 50%;
    border: 2px solid rgba(74, 222, 128, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.1);
}

.speed-hud-value {
    font-family: 'Oswald', sans-serif;
    font-size: 2.2rem;
    line-height: 1;
    color: var(--green);
    text-shadow: var(--glow-hi);
}

.speed-hud-unit {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--muted-dim);
    letter-spacing: 0.1em;
}

.speed-hud-label {
    font-size: 0.55rem;
    color: var(--green-dk);
    position: absolute;
    bottom: 1rem;
    width: 80%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pulse-heartbeat {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    margin-right: 0.4rem;
    box-shadow: 0 0 8px var(--green);
    animation: heartbeat 1.5s infinite ease-in-out;
}

.pulse-yellow {
    background: #eab308;
    box-shadow: 0 0 8px #eab308;
    animation-duration: 3s;
}

.pulse-red {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    animation: none;
    opacity: 0.6;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.4;
    }
}


/* ═══ RESPONSIVE HUD ADJUSTMENTS ══════════════════════════ */
@media (max-width: 1024px) {
    .speed-hud {
        top: 4.5rem;
        right: 1rem;
        width: 100px;
        height: 100px;
    }

    .speed-hud-value {
        font-size: 1.5rem;
    }

    .speed-hud-label {
        font-size: 0.5rem;
        bottom: 0.6rem;
    }


    #radar-panel {
        width: 180px;
        bottom: 1rem;
        right: 1rem;
    }

    #radar-canvas {
        width: 156px;
        height: 156px;
    }
}

@media (max-width: 768px) {
    .speed-hud {
        top: 4rem;
        right: 0.5rem;
        width: 80px;
        height: 80px;
        background: rgba(0, 20, 5, 0.9);
    }

    .speed-hud-value {
        font-size: 1.2rem;
    }

    .speed-hud-unit {
        font-size: 0.5rem;
    }

    .speed-hud-label {
        display: none;
    }


    #radar-panel {
        bottom: 4.5rem;
        /* Move radar above terminal on mobile */
        right: 0.5rem;
        width: 160px;
        padding: 0.5rem;
    }

    #radar-canvas {
        width: 140px;
        height: 140px;
    }

    .radar-title {
        font-size: 0.55rem;
    }

    #radar-list {
        max-height: 60px;
    }
}


/* ═══ DESKTOP SIDEBAR TOGGLE OVERRIDES ═════════════════════ */
.dashboard-layout {
    transition: grid-template-columns 0.35s ease !important;
}

.sidebar-collapsed {
    grid-template-columns: 0px 1fr !important;
}

.menu-toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--green);
    width: 38px;
    height: 38px;
    border-radius: 0.5rem;
    font-size: 1.2rem;
}


/* ═══ PRESENTATION MODE (FULLSCREEN) ══════════════════════ */
body.fullscreen-active .app-header,
body.fullscreen-active .sidebar {
    display: none !important;
}

body.fullscreen-active .dashboard-layout {
    grid-template-columns: 1fr !important;
    height: 100vh !important;
    width: 100vw !important;
}

body.fullscreen-active .main-content {
    padding: 0 !important;
    height: 100vh !important;
}

body.fullscreen-active #map {
    height: 100vh !important;
}

/* ═══ HUD FILTER STYLES ═══════════════════════════════════ */
.hud-select {
    background: rgba(13, 32, 16, 0.8);
    border: 1px solid var(--border);
    color: var(--green);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.3rem;
    outline: none;
    cursor: pointer;
    text-transform: uppercase;
}

.hud-select:focus {
    border-color: var(--green);
    box-shadow: 0 0 8px var(--green-ghost);
}

.hud-select option {
    background: var(--bg);
    color: var(--green);
}

.custom-patrol-icon div {
    transition: transform 0.3s ease;
}

.custom-patrol-icon:hover div {
    transform: scale(1.5);
}

/* ═══ MOBILE REPORT ADJUSTMENTS ══════════════════════════ */
@media (max-width: 768px) {
    .report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .report-filters {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }

    .report-tabs {
        flex-direction: column;
    }

    .report-tabs button {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    /* Bigger Touch Targets */
    .menu-toggle-btn {
        width: 44px;
        height: 44px;
    }

    .btn-ops,
    .btn-export {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
}