/* ==========================================================================
   GhostComm — Nusantara Cyber Vanguard · Sistem Desain v2
   Tema: midnight · zamrud · emas kuningan · motif kawung
   Seluruhnya lokal (tanpa CDN / font eksternal) agar berjalan pada jaringan tertutup.
   ========================================================================== */

/* ---------- 1. Token ---------- */
:root {
    --bg-0: #050810;
    --bg-1: #090e1b;
    --bg-2: #0e1526;
    --bg-3: #151e34;
    --bg-4: #1c2742;
    --line: rgba(148, 163, 184, .14);
    --line-strong: rgba(148, 163, 184, .28);

    --text: #e8edf6;
    --text-dim: #a3b1c8;
    --text-mute: #6b7a94;

    --emerald: #10b981;
    --emerald-soft: #34d399;
    --emerald-deep: #047857;
    --gold: #d4a24c;
    --gold-soft: #e9c57d;
    --danger: #ef4444;
    --danger-soft: #f87171;
    --warn: #f59e0b;
    --info: #38bdf8;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-1: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px -12px rgba(0,0,0,.6);
    --shadow-2: 0 20px 60px -20px rgba(0,0,0,.75);
    --glow-emerald: 0 0 0 1px rgba(16,185,129,.4), 0 8px 30px -8px rgba(16,185,129,.45);

    --font-sans: "Segoe UI Variable Text", "Segoe UI", "SF Pro Text", Inter, system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;

    --topbar-h: 64px;
    --kawung: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cg fill='none' stroke='%23d4a24c' stroke-opacity='.14' stroke-width='1'%3E%3Cellipse cx='11' cy='22' rx='11' ry='7'/%3E%3Cellipse cx='33' cy='22' rx='11' ry='7'/%3E%3Cellipse cx='22' cy='11' rx='7' ry='11'/%3E%3Cellipse cx='22' cy='33' rx='7' ry='11'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- 2. Reset & dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
    margin: 0; min-height: 100vh; min-height: 100dvh;
    font-family: var(--font-sans); font-size: 15px; line-height: 1.5;
    color: var(--text); background: var(--bg-0);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.theme-ops {
    background:
        radial-gradient(900px 520px at 8% -10%, rgba(16,185,129,.12), transparent 60%),
        radial-gradient(800px 500px at 100% 110%, rgba(212,162,76,.09), transparent 60%),
        var(--bg-0);
    background-attachment: fixed;
}
h1, h2, h3, h4, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--emerald-soft); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden], .hidden { display: none !important; }
code, pre, kbd { font-family: var(--font-mono); }
::selection { background: rgba(16,185,129,.35); }

:focus-visible { outline: 2px solid var(--emerald-soft); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 1000; background: var(--emerald); color: #04130d; padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

* { scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.3) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,.28); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,.45); }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 28px; height: 28px; }

.main-container { min-height: calc(100vh - var(--topbar-h)); min-height: calc(100dvh - var(--topbar-h)); }
.page-auth .main-container, .theme-decoy .main-container { min-height: 100vh; min-height: 100dvh; }

/* ---------- 3. Elemen umum ---------- */
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font: 600 11px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-soft);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-mute); flex: none; }
.dot-ok { background: var(--emerald); }
.dot-danger { background: var(--danger); }
.dot-warn { background: var(--warn); }
.dot.pulse { animation: dot-pulse 2s infinite; }
@keyframes dot-pulse {
    0% { box-shadow: 0 0 0 0 rgba(16,185,129,.55); }
    70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
    font: 700 10.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-dim); background: rgba(148,163,184,.12); border: 1px solid var(--line);
}
.badge .icon { width: 13px; height: 13px; }
.badge-ok, .badge.badge-ok { color: var(--emerald-soft); background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.35); }
.badge-danger { color: var(--danger-soft); background: rgba(239,68,68,.13); border-color: rgba(239,68,68,.4); }
.badge-emergency { color: #fff; background: var(--danger); border-color: var(--danger); animation: badge-blink 1.2s infinite; }
.badge-gold { color: var(--gold-soft); background: rgba(212,162,76,.12); border-color: rgba(212,162,76,.38); }
.badge-muted { color: var(--text-mute); }
@keyframes badge-blink { 50% { opacity: .6; } }

/* Tombol */
.btn {
    --btn-bg: var(--bg-3); --btn-fg: var(--text); --btn-bd: var(--line-strong);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--btn-bd);
    background: var(--btn-bg); color: var(--btn-fg);
    font-weight: 600; font-size: 14px; line-height: 1.2; text-decoration: none; white-space: nowrap;
    transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease, opacity .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--gold); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { --btn-bg: linear-gradient(180deg, #14c58f, var(--emerald)); --btn-fg: #04130d; --btn-bd: rgba(52,211,153,.6); box-shadow: var(--glow-emerald); }
.btn-primary:hover { --btn-bg: linear-gradient(180deg, #34d399, #12bd88); border-color: #6ee7b7; }
.btn-secondary { --btn-bg: rgba(148,163,184,.1); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); background: rgba(148,163,184,.1); border-color: var(--line); }
.btn-danger { --btn-bg: linear-gradient(180deg, #f05252, #dc2626); --btn-fg: #fff; --btn-bd: rgba(248,113,113,.6); }
.btn-danger:hover { border-color: #fecaca; }
.btn-success { --btn-bg: linear-gradient(180deg, #14c58f, var(--emerald)); --btn-fg: #04130d; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-lg { padding: 14px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon {
    display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
    border: 1px solid transparent; background: transparent; color: var(--text-dim);
    transition: background .15s, color .15s;
}
.btn-icon:hover { background: rgba(148,163,184,.14); color: var(--text); }

/* Form */
.field-label { display: block; margin-bottom: 8px; font: 600 11px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.field { margin-bottom: 14px; }
.field-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.counter { font: 500 11px var(--font-mono); color: var(--text-mute); }
.counter.is-near { color: var(--warn); }
.hint { margin-top: 12px; font-size: 12px; color: var(--text-mute); line-height: 1.5; }
textarea, input[type="text"], input[type="search"], input[type="password"] {
    width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
    background: rgba(5,8,16,.65); border: 1px solid var(--line-strong); color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 96px; }
textarea:focus, input:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
::placeholder { color: var(--text-mute); }

.form-alert { margin: 12px 0; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.45; border: 1px solid; }
.form-alert-error { color: #fecaca; background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); }
.form-alert-ok { color: #a7f3d0; background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.4); }

/* Panel */
.panel {
    padding: 18px; border-radius: var(--radius-lg); border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(21,30,52,.72), rgba(14,21,38,.72));
    backdrop-filter: blur(10px); box-shadow: var(--shadow-1);
}
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--emerald-soft); background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3); flex: none; }
.panel-icon-gold { color: var(--gold-soft); background: rgba(212,162,76,.12); border-color: rgba(212,162,76,.34); }
.panel-title { font-size: 14.5px; font-weight: 700; letter-spacing: -.005em; }
.panel-sub { font-size: 12px; color: var(--text-mute); margin-top: 2px; }

.spec-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px dashed var(--line); font-size: 12.5px; }
.spec-list dt { color: var(--text-mute); }
.spec-list dd { font-family: var(--font-mono); font-weight: 600; color: var(--text); }

/* ---------- 4. Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 500; height: var(--topbar-h); background: rgba(5,8,16,.78); backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid var(--line); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(212,162,76,.55), transparent); opacity: .6; }
.topbar-inner { height: 100%; max-width: 1760px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 24px; position: relative; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; filter: drop-shadow(0 4px 14px rgba(16,185,129,.45)); }
.brand-mark-lg { width: 52px; height: 52px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.brand-sub { font: 500 9.5px var(--font-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-soft); margin-top: 3px; }

.nav-links { display: flex; gap: 4px; }
.nav-link { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; color: var(--text-dim); font-size: 13.5px; font-weight: 600; transition: background .15s, color .15s; }
.nav-link:hover { color: var(--text); background: rgba(148,163,184,.1); text-decoration: none; }
.nav-link.active { color: var(--emerald-soft); background: rgba(16,185,129,.12); box-shadow: inset 0 0 0 1px rgba(16,185,129,.3); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nav-clock { position: absolute; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.15; }
.clock-time { font: 700 14px var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.clock-date { font: 500 10px var(--font-mono); letter-spacing: .14em; color: var(--text-mute); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(212,162,76,.1); border: 1px solid rgba(212,162,76,.32); color: var(--gold-soft); font: 700 11.5px var(--font-mono); letter-spacing: .06em; }
.logout-form { display: contents; }

/* ---------- 5. Autentikasi ---------- */
.page-auth { overflow: hidden; height: 100vh; height: 100dvh; }
.auth-layout { height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); overflow: hidden; }
.auth-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    background:
        radial-gradient(700px 420px at 15% 0%, rgba(16, 185, 129, 0.22), transparent 60%),
        radial-gradient(600px 420px at 95% 100%, rgba(212, 162, 76, 0.18), transparent 60%),
        linear-gradient(160deg, #07101d, #050810 70%);
    border-right: 1px solid var(--line);
    overflow: hidden;
    height: 100%;
}
.auth-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--kawung);
    opacity: 0.9;
    mask-image: linear-gradient(135deg, #000 0%, transparent 75%);
    -webkit-mask-image: linear-gradient(135deg, #000 0%, transparent 75%);
    pointer-events: none;
}
.auth-hero-inner {
    position: relative;
    max-width: 520px;
    z-index: 1;
}
.hero-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}
.hero-brand .brand-mark-lg {
    width: 48px;
    height: 48px;
    flex: none;
    filter: drop-shadow(0 4px 14px rgba(16, 185, 129, 0.45));
}
.hero-brand .brand-title {
    display: block;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.1;
}
.hero-brand .brand-sub {
    display: block;
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold-soft);
    margin-top: 4px;
}
.hero-headline {
    font-size: clamp(28px, 3.2vw, 42px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text);
    margin: 0 0 16px 0;
}
.hero-headline em {
    font-style: normal;
    background: linear-gradient(90deg, var(--gold-soft), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-copy {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dim);
    margin: 0 0 24px 0;
    max-width: 480px;
    font-style: italic;
}
.hero-points { margin-top: 36px; display: grid; gap: 14px; }
.hero-points li { display: flex; gap: 14px; align-items: flex-start; color: var(--text-dim); font-size: 14px; }
.hero-points .icon { margin-top: 2px; width: 34px; height: 34px; padding: 8px; border-radius: 10px; color: var(--emerald-soft); background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.28); }
.hero-points strong { color: var(--text); }

/* --- Tactical Hologram Scanner Widget --- */
.tactical-scanner-widget {
    margin-top: clamp(16px, 2.5vh, 28px);
    padding: clamp(14px, 2vh, 20px);
    border-radius: 20px;
    background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.08), rgba(10, 15, 28, 0.7) 70%);
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), inset 0 0 24px rgba(16, 185, 129, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.tactical-scanner-widget::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(16, 185, 129, 0.03) 2px,
        rgba(16, 185, 129, 0.03) 4px
    );
    pointer-events: none;
}

.scanner-radar {
    position: relative;
    width: clamp(120px, 14vh, 150px);
    height: clamp(120px, 14vh, 150px);
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto;
}

.radar-grid {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px dashed rgba(16, 185, 129, 0.35);
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.15);
}

.radar-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(16, 185, 129, 0.22);
}
.radar-ring.ring-1 { width: 100%; height: 100%; }
.radar-ring.ring-2 { width: 68%; height: 68%; border-style: dotted; border-color: rgba(16, 185, 129, 0.3); }
.radar-ring.ring-3 { width: 38%; height: 38%; }

.radar-crosshair-h, .radar-crosshair-v {
    position: absolute;
    background: rgba(16, 185, 129, 0.2);
    pointer-events: none;
}
.radar-crosshair-h { width: 100%; height: 1px; }
.radar-crosshair-v { height: 100%; width: 1px; }

.radar-sweep {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(16, 185, 129, 0.45) 60deg, transparent 65deg);
    animation: radar-sweep 3.5s linear infinite;
    pointer-events: none;
}

@keyframes radar-sweep {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.radar-core-shield {
    position: relative;
    z-index: 2;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.5);
    display: grid;
    place-items: center;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
    animation: core-pulse 2s ease-in-out infinite alternate;
}

.radar-core-shield .icon {
    width: 20px;
    height: 20px;
    color: var(--emerald-soft);
    filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.8));
}

@keyframes core-pulse {
    0% { transform: scale(0.96); box-shadow: 0 0 10px rgba(16, 185, 129, 0.2); }
    100% { transform: scale(1.05); box-shadow: 0 0 20px rgba(16, 185, 129, 0.55); }
}

.radar-ping {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 10px #34d399;
}
.radar-ping.ping-a { top: 24px; right: 30px; animation: ping-blink 2.2s infinite 0.7s; }
.radar-ping.ping-b { bottom: 26px; left: 32px; animation: ping-blink 2.8s infinite 1.4s; }

@keyframes ping-blink {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    30%, 60% { opacity: 1; transform: scale(1.2); }
    70% { opacity: 0; transform: scale(1.5); }
}

.telemetry-wave {
    width: 100%;
    max-width: 200px;
    display: flex;
    gap: 4px;
    height: 14px;
    align-items: flex-end;
    margin-top: clamp(10px, 1.5vh, 16px);
}
.telemetry-wave span {
    flex: 1;
    background: linear-gradient(180deg, #34d399, rgba(16, 185, 129, 0.2));
    border-radius: 2px;
    animation: wave-bar 1.5s ease-in-out infinite alternate;
}
.telemetry-wave span:nth-child(1) { height: 30%; animation-delay: 0.1s; }
.telemetry-wave span:nth-child(2) { height: 75%; animation-delay: 0.4s; }
.telemetry-wave span:nth-child(3) { height: 45%; animation-delay: 0.2s; }
.telemetry-wave span:nth-child(4) { height: 90%; animation-delay: 0.6s; }
.telemetry-wave span:nth-child(5) { height: 60%; animation-delay: 0.3s; }
.telemetry-wave span:nth-child(6) { height: 85%; animation-delay: 0.5s; }
.telemetry-wave span:nth-child(7) { height: 40%; animation-delay: 0.15s; }
.telemetry-wave span:nth-child(8) { height: 95%; animation-delay: 0.7s; }
.telemetry-wave span:nth-child(9) { height: 50%; animation-delay: 0.25s; }
.telemetry-wave span:nth-child(10) { height: 70%; animation-delay: 0.45s; }
.telemetry-wave span:nth-child(11) { height: 55%; animation-delay: 0.35s; }
.telemetry-wave span:nth-child(12) { height: 80%; animation-delay: 0.55s; }

@keyframes wave-bar {
    0% { transform: scaleY(0.25); opacity: 0.4; }
    100% { transform: scaleY(1); opacity: 1; }
}

.auth-panel { display: grid; place-items: center; padding: clamp(16px, 3vh, 32px) 20px; overflow: hidden; height: 100%; }
.auth-card { width: 100%; max-width: 390px; padding: clamp(20px, 2.5vh, 28px) clamp(20px, 2.5vw, 26px) clamp(16px, 2vh, 22px); border-radius: 22px; border: 1px solid var(--line-strong); background: linear-gradient(180deg, rgba(21,30,52,.85), rgba(10,15,28,.9)); box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255,255,255,.05); animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.auth-header h1 { margin: 8px 0 4px; font-size: clamp(20px, 2.2vw, 24px); font-weight: 800; letter-spacing: -.02em; }
.auth-header p { color: var(--text-dim); font-size: 13px; }
.auth-form { margin-top: clamp(14px, 2vh, 20px); }
.pin-field { position: relative; display: flex; align-items: center; }
.pin-field input { padding: clamp(10px, 1.4vh, 13px) 44px clamp(10px, 1.4vh, 13px) 40px; font: 600 20px var(--font-mono); letter-spacing: .35em; text-align: center; }
.pin-field input::placeholder { letter-spacing: .3em; }
.pin-field-icon { position: absolute; left: 14px; color: var(--text-mute); pointer-events: none; }
.pin-field .btn-icon { position: absolute; right: 6px; cursor: pointer; z-index: 2; }
.pin-field .btn-icon:hover { color: var(--text); background: rgba(148,163,184,.14); }
.pin-field .btn-icon:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--emerald); }
.pin-field .btn-icon.is-active,
.pin-field .btn-icon[aria-pressed="true"] { color: var(--emerald); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(6px, 1vh, 9px); margin: clamp(10px, 1.6vh, 15px) 0; }
.key {
    height: clamp(40px, 5.2vh, 48px); border-radius: 12px; border: 1px solid var(--line); background: rgba(148,163,184,.07);
    font: 600 18px var(--font-mono); color: var(--text); display: grid; place-items: center;
    transition: background .12s, transform .08s, border-color .12s; user-select: none; -webkit-tap-highlight-color: transparent;
}
.key:hover { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.4); }
.key:active { transform: scale(.94); background: rgba(16,185,129,.22); }
.key-fn { font-size: 15px; color: var(--text-dim); }
.auth-footer { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); font: 500 10.5px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); }
.auth-footer .icon { width: 14px; height: 14px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- 6. Ruang obrolan (Normal) ---------- */
.page-chat .main-container { height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); overflow: hidden; }
.chat-shell { height: 100%; max-width: 1760px; margin: 0 auto; padding: 18px 20px; display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; overflow: hidden; }
.chat-side { display: flex; flex-direction: column; gap: 14px; overflow-y: visible; overflow: visible; padding-right: 0; min-height: 0; }
.chat-main { display: flex; flex-direction: column; min-height: 0; height: 100%; border-radius: var(--radius-lg); border: 1px solid var(--line); background: linear-gradient(180deg, rgba(14,21,38,.7), rgba(9,14,27,.7)); box-shadow: var(--shadow-1); overflow: hidden; }
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 22px; border-bottom: 1px solid var(--line); background: rgba(5,8,16,.35); flex: none; }
.chat-header-info h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.chat-header-info p { font-size: 12.5px; color: var(--text-mute); margin-top: 2px; }
.header-badges { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Custom Tactical Channel Dropdown */
.channel-dropdown-custom {
    position: relative;
    user-select: none;
}
.channel-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.12), rgba(10, 15, 28, 0.65));
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 12px;
    color: var(--text);
    font: 600 13px var(--font-mono);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all .2s cubic-bezier(.2, .8, .2, 1);
}
.channel-trigger:hover, .channel-trigger.is-active {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.22), rgba(10, 15, 28, 0.85));
    border-color: var(--emerald-soft);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
}
.trigger-icon {
    display: grid;
    place-items: center;
    color: var(--gold-soft);
    width: 15px;
    height: 15px;
}
.trigger-icon .icon {
    width: 15px;
    height: 15px;
}
.trigger-label {
    letter-spacing: 0.04em;
    color: #e2e8f0;
    font-weight: 700;
}
.trigger-arrow {
    display: grid;
    place-items: center;
    color: var(--text-dim);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.trigger-arrow .icon {
    width: 13px;
    height: 13px;
}
.channel-trigger.is-active .trigger-arrow {
    transform: rotate(180deg);
    color: var(--emerald-soft);
}

.channel-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 210px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: rgba(11, 17, 32, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 14px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55), 0 0 20px rgba(16, 185, 129, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    pointer-events: none;
    transition: opacity .18s cubic-bezier(.2, .8, .2, 1), transform .18s cubic-bezier(.2, .8, .2, 1);
}
.channel-menu.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.channel-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 9px;
    color: var(--text-dim);
    font: 600 13px var(--font-mono);
    text-decoration: none;
    transition: background .12s, color .12s, transform .1s;
}
.channel-menu-item:hover {
    background: rgba(16, 185, 129, 0.15);
    color: #fff;
    transform: translateX(3px);
}
.channel-menu-item.is-active {
    background: rgba(16, 185, 129, 0.22);
    color: var(--emerald-soft);
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.menu-item-hash {
    color: var(--gold-soft);
    font-weight: 700;
}
.channel-menu-item.is-active .menu-item-hash {
    color: var(--emerald);
}
.menu-item-name {
    flex: 1;
}
.menu-item-badge {
    font-size: 9.5px;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.3);
    color: var(--emerald-soft);
}

/* Channel Navigasi Taktis */
.channel-nav { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.channel-link {
    display: flex; align-items: center; gap: 8px; padding: 7px 11px;
    border-radius: 8px; color: var(--text-dim); font: 600 13px var(--font-mono);
    text-decoration: none; transition: background .15s, color .15s, box-shadow .15s;
}
.channel-link:hover { background: rgba(148,163,184,.08); color: var(--text); text-decoration: none; }
.channel-link.active {
    background: rgba(16,185,129,.14); color: var(--emerald-soft);
    box-shadow: inset 0 0 0 1px rgba(16,185,129,.32);
}
.channel-hash { color: var(--gold-soft); font-weight: 700; opacity: .8; }
.channel-link.active .channel-hash { color: var(--emerald); }

.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; }
.system-notice { margin: auto; max-width: 360px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 20px; color: var(--text-mute); font-size: 13px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--kawung), transparent; }
.system-notice strong { color: var(--text); font-size: 14.5px; }
.system-notice .icon { color: var(--gold); }

.message-item { display: flex; gap: 12px; max-width: 520px; animation: rise .35s both; }
.message-item.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; font: 700 12px var(--font-mono); color: var(--gold-soft); background: rgba(212,162,76,.12); border: 1px solid rgba(212,162,76,.32); }
.is-mine .avatar { color: var(--emerald-soft); background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.34); }
.message-body { min-width: 0; }
.message-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; font-size: 12px; color: var(--text-mute); }
.is-mine .message-meta { flex-direction: row-reverse; }
.message-sender { color: var(--text); font-size: 13px; }
.message-id { font-family: var(--font-mono); font-size: 10.5px; }
.stego-card { position: relative; display: block; padding: 0; border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; background: var(--bg-2); width: 100%; max-width: 320px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.stego-card:hover { border-color: var(--emerald); transform: translateY(-2px); box-shadow: var(--glow-emerald); }
.stego-card img { width: 100%; max-height: 240px; object-fit: cover; }
.stego-overlay { position: absolute; inset: auto 0 0 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 26px 10px 10px; font: 600 11.5px var(--font-mono); letter-spacing: .06em; color: #fff; background: linear-gradient(0deg, rgba(5,8,16,.88), transparent); opacity: 0; transition: opacity .15s; }
.stego-card:hover .stego-overlay, .stego-card:focus-visible .stego-overlay { opacity: 1; }
.stego-card.is-busy { opacity: .6; pointer-events: none; }
.message-actions { display: flex; gap: 6px; margin-top: 8px; }
.is-mine .message-actions { justify-content: flex-end; }
.is-mine .stego-card { margin-left: auto; }

/* Dropzone */
.dropzone { display: block; margin-bottom: 14px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: rgba(5,8,16,.4); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--emerald); background: rgba(16,185,129,.07); }
.dropzone-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 14px; text-align: center; color: var(--text-dim); }
.dropzone-empty .icon { color: var(--emerald-soft); margin-bottom: 4px; }
.dropzone-empty strong { color: var(--text); font-size: 14px; }
.dropzone-empty small { color: var(--text-mute); font-size: 11.5px; }
.dropzone-preview { display: flex; align-items: center; gap: 12px; padding: 10px; }
.dropzone-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line-strong); }
.dropzone-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dropzone-meta strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropzone-meta small { color: var(--text-mute); font: 500 11px var(--font-mono); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 20px; background: rgba(2,4,10,.72); backdrop-filter: blur(6px); animation: fade .18s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-box { width: 100%; max-width: 480px; border-radius: 20px; border: 1px solid var(--line-strong); background: linear-gradient(180deg, var(--bg-3), var(--bg-2)); box-shadow: var(--shadow-2); animation: rise .25s cubic-bezier(.2,.8,.2,1) both; overflow: hidden; border-top: 3px solid var(--danger); }
.modal-box.variant-success { border-top-color: var(--emerald); }
.modal-box.variant-info { border-top-color: var(--info); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 6px; }
.modal-tag { font: 700 10.5px var(--font-mono); letter-spacing: .16em; color: var(--gold-soft); }
.modal-title { margin-top: 6px; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.modal-body { padding: 8px 22px 6px; }
.modal-message { color: var(--text-dim); font-size: 14px; line-height: 1.6; }
.modal-message strong { color: var(--text); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; }
.decoded-text { margin: 4px 0 0; max-height: 40vh; overflow: auto; padding: 14px 16px; border-radius: var(--radius-sm); background: rgba(5,8,16,.7); border: 1px solid rgba(16,185,129,.35); color: #bbf7d0; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

/* Toast */
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 950; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 36px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(14,21,38,.95); backdrop-filter: blur(10px); box-shadow: var(--shadow-2); font-size: 13.5px; animation: toast-in .3s cubic-bezier(.2,.8,.2,1) both; }
.toast.is-leaving { animation: toast-out .25s both; }
.toast .icon { margin-top: 1px; }
.toast-ok { border-left: 3px solid var(--emerald); } .toast-ok .icon { color: var(--emerald-soft); }
.toast-error { border-left: 3px solid var(--danger); } .toast-error .icon { color: var(--danger-soft); }
.toast-emergency { border-color: rgba(239,68,68,.6); border-left: 3px solid var(--danger); background: rgba(60,12,16,.95); } .toast-emergency .icon { color: var(--danger-soft); }
.toast-title { font-weight: 700; display: block; margin-bottom: 2px; }
.toast-text { color: var(--text-dim); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

/* ---------- 7. Dasbor Markas Komando ---------- */
.page-dashboard .main-container { height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); }
.hq { height: 100%; display: grid; grid-template-columns: 380px minmax(0, 1fr); }
.hq-panel { display: flex; flex-direction: column; min-height: 0; padding: 20px; gap: 16px; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(9,14,27,.92), rgba(5,8,16,.95)); overflow: hidden; }
.hq-head h1 { margin: 12px 0 4px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.hq-head p { font-size: 13px; color: var(--text-mute); }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(148,163,184,.05); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--text-mute); }
.stat-ok::before { background: var(--emerald); } .stat-danger::before { background: var(--danger); } .stat-muted::before { background: var(--text-mute); }
.stat-label { display: block; font: 600 10px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-mute); }
.stat-value { display: block; margin-top: 4px; font: 800 30px/1 var(--font-sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-ok .stat-value { color: var(--emerald-soft); }
.stat-danger .stat-value { color: var(--danger-soft); }
.stat-danger.is-alert { border-color: rgba(239,68,68,.55); background: rgba(239,68,68,.1); animation: stat-alert 1.4s infinite; }
@keyframes stat-alert { 50% { box-shadow: 0 0 0 4px rgba(239,68,68,.15); } }

.roster-tools { display: grid; gap: 10px; }
.search-field { position: relative; display: block; }
.search-field .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-mute); pointer-events: none; }
.search-field input { padding-left: 38px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text-dim); font-size: 12px; font-weight: 600; transition: all .15s; }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.active { color: #04130d; background: var(--emerald); border-color: var(--emerald); }

.roster { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.roster-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.roster-title h2 { font: 700 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.roster-hint { font-size: 10.5px; color: var(--text-mute); }
.roster-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.roster-empty { padding: 28px 12px; text-align: center; font-size: 13px; color: var(--text-mute); border: 1px dashed var(--line); border-radius: var(--radius); }
.roster-item { display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(148,163,184,.05); cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.roster-item:hover { border-color: var(--line-strong); background: rgba(148,163,184,.1); transform: translateX(2px); }
.roster-item.is-pinned { border-color: rgba(212,162,76,.45); background: rgba(212,162,76,.07); }
.roster-item.is-emergency { border-color: rgba(239,68,68,.6); background: rgba(239,68,68,.1); animation: stat-alert 1.6s infinite; }
.roster-item.is-blocked { opacity: .7; }
.roster-info { flex: 1; min-width: 0; }
.roster-name { display: flex; align-items: center; gap: 8px; }
.roster-callsign { font: 700 13.5px var(--font-mono); letter-spacing: .03em; }
.pinned-badge { color: var(--gold); display: inline-flex; }
.pinned-badge .icon { width: 13px; height: 13px; fill: currentColor; }
.roster-coords { display: block; margin-top: 3px; font: 500 11px var(--font-mono); color: var(--text-mute); }
.roster-kebab { opacity: .6; }
.roster-item:hover .roster-kebab { opacity: 1; }

.hq-map { position: relative; min-height: 0; }
.map-view { position: absolute; inset: 0; background: #070d1a; }
.emergency-banner { position: absolute; z-index: 700; top: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-radius: 999px; background: rgba(120,16,24,.92); border: 1px solid rgba(248,113,113,.7); color: #fff; font: 700 12px var(--font-mono); letter-spacing: .12em; box-shadow: 0 10px 40px -8px rgba(239,68,68,.6); animation: stat-alert 1.4s infinite; }
.emergency-pulse { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: dot-pulse-red 1.2s infinite; }
@keyframes dot-pulse-red { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.7); } 100% { box-shadow: 0 0 0 12px rgba(255,255,255,0); } }
.map-toolbar { position: absolute; z-index: 600; top: 98px; left: 14px; display: flex; flex-direction: column; gap: 8px; }
.map-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(9,14,27,.88); backdrop-filter: blur(8px); color: var(--text-dim); transition: all .15s; }
.map-btn:hover { color: var(--text); border-color: var(--gold); }
.map-btn[aria-pressed="false"] { color: var(--text-mute); }
.map-legend { position: absolute; z-index: 600; left: 14px; bottom: 28px; display: flex; gap: 14px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(9,14,27,.88); backdrop-filter: blur(8px); font: 600 11px var(--font-mono); color: var(--text-dim); }
.map-legend span { display: inline-flex; align-items: center; gap: 7px; }
.lg { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg-ok { background: var(--emerald); } .lg-danger { background: var(--danger); } .lg-muted { background: #6b7280; }

/* Marker */
.agent-marker { position: relative; width: 26px; height: 26px; }
.agent-marker .core { position: absolute; inset: 5px; border-radius: 50%; background: var(--emerald); border: 2px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,.6); }
.agent-marker .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--emerald); opacity: 0; }
.agent-marker.is-ok .ring { animation: ring 2.6s infinite; }
.agent-marker.is-emergency .core { background: var(--danger); }
.agent-marker.is-emergency .ring { border-color: var(--danger); animation: ring 1.1s infinite; }
.agent-marker.is-blocked .core { background: #6b7280; }
.agent-marker .label { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 4px); padding: 2px 7px; border-radius: 6px; background: rgba(5,8,16,.88); border: 1px solid var(--line-strong); color: var(--text); font: 700 10px var(--font-mono); letter-spacing: .04em; white-space: nowrap; pointer-events: none; }
@keyframes ring { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }

/* Popup & kontrol Leaflet */
.leaflet-container { font-family: var(--font-sans); background: #070d1a; }
.leaflet-popup-content-wrapper { background: var(--bg-2); color: var(--text); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-2); }
.leaflet-popup-tip { background: var(--bg-2); border: 1px solid var(--line-strong); }
.leaflet-popup-content { margin: 14px 16px; min-width: 210px; }
.leaflet-popup-close-button { color: var(--text-mute) !important; }
.agent-popup .pop-call { font: 800 15px var(--font-mono); letter-spacing: .03em; }
.agent-popup .pop-row { display: flex; justify-content: space-between; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--text-mute); }
.agent-popup .pop-row b { color: var(--text); font: 600 12px var(--font-mono); }
.agent-popup .pop-actions { display: grid; gap: 6px; margin-top: 12px; }
.leaflet-bar a, .leaflet-bar a:hover { background-color: rgba(9,14,27,.92); color: var(--text); border-bottom-color: var(--line); }
.leaflet-bar a:hover { background-color: var(--bg-4); }
.leaflet-top.leaflet-left { margin-top: 4px; }
.leaflet-bar { border: 1px solid var(--line-strong) !important; box-shadow: none !important; }
.leaflet-control-layers { background: rgba(9,14,27,.92); color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: none; }
.leaflet-control-layers-toggle, .leaflet-retina .leaflet-control-layers-toggle {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8edf6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 9 5-9 5-9-5 9-5z'/%3E%3Cpath d='m3 13 9 5 9-5'/%3E%3C/svg%3E");
    background-size: 20px 20px; width: 36px; height: 36px;
}
.leaflet-control-layers-expanded { padding: 8px 12px; font-size: 12.5px; }
.leaflet-control-attribution { background: rgba(5,8,16,.7) !important; color: var(--text-mute) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--text-dim) !important; }
.tactical-map-tooltip { background: rgba(5,8,16,.92); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; font: 600 11px var(--font-mono); box-shadow: none; }
.tactical-map-tooltip::before { display: none; }

/* Context menu */
.ctx-menu { position: fixed; z-index: 99999; min-width: 244px; padding: 8px; display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--line-strong); background: rgba(14,21,38,.97); backdrop-filter: blur(14px); box-shadow: var(--shadow-2); animation: toast-in .15s both; }
.ctx-menu.hidden { display: none !important; }
.ctx-header { padding: 8px 10px 6px; }
.ctx-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.ctx-callsign { font: 800 14px var(--font-mono); }
.ctx-divider { height: 1px; margin: 6px 4px; background: var(--line); }
.ctx-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font-size: 13px; font-weight: 500; text-align: left; transition: background .12s; }
.ctx-item:hover { background: rgba(148,163,184,.12); }
.ctx-item .icon { color: var(--text-dim); }
.ctx-danger { color: var(--danger-soft); } .ctx-danger .icon { color: var(--danger-soft); } .ctx-danger:hover { background: rgba(239,68,68,.14); }
.ctx-success { color: var(--emerald-soft); } .ctx-success .icon { color: var(--emerald-soft); } .ctx-success:hover { background: rgba(16,185,129,.14); }
.ctx-warn { color: var(--warn); } .ctx-warn .icon { color: var(--warn); }

/* ---------- 8. Tema kamuflase (Duress): netral, terang, tampak seperti aplikasi logistik biasa ---------- */
.theme-decoy { --d-bg: #f3f5f9; --d-card: #fff; --d-line: #e3e8f0; --d-text: #1f2937; --d-mute: #6b7280; --d-accent: #2563eb; background: var(--d-bg); color: var(--d-text); color-scheme: light; font-size: 14.5px; }
.theme-decoy a { color: var(--d-accent); }
.theme-decoy :focus-visible { outline-color: var(--d-accent); }
.theme-decoy ::selection { background: #bfdbfe; }
.theme-decoy * { scrollbar-color: #cbd5e1 transparent; }
.decoy-app { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.decoy-side { display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; background: #1e293b; color: #cbd5e1; }
.decoy-workspace { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: #fff; min-width: 0; }
.decoy-workspace strong { display: block; font-size: 13.5px; font-weight: 700; color: #fff; line-height: 1.25; }
.decoy-workspace small { display: block; color: #94a3b8; font-size: 11.5px; line-height: 1.25; margin-top: 2px; }
.decoy-logo { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--d-accent); color: #fff; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.decoy-label { padding: 8px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #64748b; }
.decoy-channels li {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
    transition: background .15s ease, color .15s ease, transform .1s ease;
}
.decoy-channels li:hover {
    background: rgba(255,255,255,.07);
    color: #f1f5f9;
    transform: translateX(3px);
}
.decoy-channels li.active {
    background: rgba(37,99,235,.28);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(59,130,246,.5);
}
.decoy-channels li a, .decoy-channel-link {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
}
.decoy-me {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 8px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    min-width: 0;
}
.decoy-avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #cbd5e1; color: #334155; font-weight: 700; font-size: 13px; text-transform: uppercase; }
.decoy-me .decoy-avatar {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--d-accent);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}
.decoy-me-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.decoy-me-name {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.decoy-me-role {
    display: block;
    color: #94a3b8;
    font-size: 11.5px;
    line-height: 1.25;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.decoy-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--d-card); }
.decoy-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--d-line); }
.decoy-title-row { display: flex; align-items: center; gap: 12px; }
.decoy-header h1 { font-size: 16px; font-weight: 700; margin: 0; }
.decoy-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font: 700 10px var(--font-mono);
    letter-spacing: .08em;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}
.decoy-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    animation: ping-blink 1.5s infinite;
}
.decoy-header p { font-size: 12.5px; color: var(--d-mute); margin-top: 3px; }
.decoy-link { border: 0; background: transparent; color: var(--d-mute); font-size: 13px; padding: 6px 10px; border-radius: 6px; }
.decoy-link:hover { background: #f1f5f9; color: var(--d-text); }
.decoy-messages { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; background: #fafbfd; }
.decoy-msg { display: flex; gap: 10px; align-items: flex-start; max-width: 640px; }
.decoy-msg.is-me { align-self: flex-end; flex-direction: row-reverse; }
.decoy-bubble { padding: 9px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--d-line); box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.decoy-msg.is-me .decoy-bubble { background: var(--d-accent); border-color: var(--d-accent); color: #fff; }
.decoy-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 2px; font-size: 12px; }
.decoy-meta time { color: var(--d-mute); font-size: 11px; }
.decoy-msg.is-me .decoy-meta time { color: #bfdbfe; }
.decoy-bubble p { font-size: 14px; line-height: 1.5; word-break: break-word; }
.decoy-composer { display: flex; gap: 10px; padding: 14px 24px 18px; border-top: 1px solid var(--d-line); background: var(--d-card); }
.theme-decoy .decoy-composer input { flex: 1; background: #fff; color: var(--d-text); border: 1px solid #cbd5e1; border-radius: 10px; padding: 11px 14px; }
.theme-decoy .decoy-composer input:focus { border-color: var(--d-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.theme-decoy ::placeholder { color: #94a3b8; }
.decoy-send { width: 44px; border: 0; border-radius: 10px; background: var(--d-accent); color: #fff; display: grid; place-items: center; }
.decoy-send:hover { background: #1d4ed8; }

/* ---------- 9. Responsif Mobile & Layar HP ---------- */
@media (max-width: 1100px) {
    .chat-shell { grid-template-columns: 320px minmax(0, 1fr); }
    .hq { grid-template-columns: 330px minmax(0, 1fr); }
    .brand-sub { display: none; }
}

@media (max-width: 900px) {
    /* Auth Layout Mobile: Tampilkan form PIN dengan rapi tanpa scroll liar */
    .page-auth { overflow-y: auto !important; height: auto !important; min-height: 100dvh; }
    .auth-layout { grid-template-columns: 1fr; height: auto !important; min-height: 100dvh; overflow: visible !important; }
    .auth-hero { display: none; }
    .auth-panel { padding: 20px 16px; min-height: 100dvh; }
    .auth-card { max-width: 360px; padding: 24px 18px 20px; }

    /* Topbar Mobile */
    .nav-link span { display: none; }
    .nav-link { padding: 9px 11px; }
    .topbar-inner { gap: 8px; padding: 0 12px; }
    .user-chip .user-callsign { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }

    /* Chat Layout Mobile: Berurutan, ramah jempol, tidak tumpang tindih */
    .page-chat .main-container { height: auto !important; min-height: calc(100dvh - var(--topbar-h)); overflow-y: auto !important; }
    .chat-shell { height: auto !important; grid-template-columns: 1fr; padding: 10px; gap: 14px; overflow: visible !important; }
    .chat-main { order: 1; height: 60vh; min-height: 380px; }
    .chat-header { padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
    .chat-header-info h2 { font-size: 14.5px; }
    .chat-header-info p { font-size: 11px; }
    .header-badges { width: 100%; justify-content: space-between; }
    .channel-trigger { padding: 5px 10px; font-size: 11.5px; border-radius: 9px; }
    .channel-menu { right: auto; left: 0; min-width: 190px; }
    .chat-messages { padding: 12px; gap: 12px; }
    .chat-side { order: 2; overflow: visible; padding-bottom: 24px; gap: 10px; }

    /* Compact Mobile Panel & Buttons (Sesuai Gambar) */
    .chat-side .panel {
        padding: 12px 14px;
        border-radius: 14px;
    }
    .chat-side .panel-head {
        gap: 10px;
        margin-bottom: 10px;
    }
    .chat-side .panel-icon {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }
    .chat-side .panel-icon .icon {
        width: 16px;
        height: 16px;
    }
    .chat-side .panel-title {
        font-size: 13px;
    }
    .chat-side .panel-sub {
        font-size: 11px;
    }

    /* Dropzone Compact */
    .dropzone {
        margin-bottom: 10px;
        border-radius: 10px;
    }
    .dropzone-empty {
        padding: 14px 10px;
        gap: 2px;
    }
    .dropzone-empty .icon {
        width: 22px;
        height: 22px;
        margin-bottom: 2px;
    }
    .dropzone-empty strong {
        font-size: 12.5px;
    }
    .dropzone-empty small {
        font-size: 10.5px;
    }

    /* Textarea & Inputs Compact */
    .chat-side textarea {
        min-height: 64px;
        padding: 8px 10px;
        font-size: 12.5px;
        border-radius: 9px;
    }
    .chat-side .field {
        margin-bottom: 10px;
    }
    .chat-side .field-label {
        font-size: 10px;
        margin-bottom: 5px;
    }

    /* Buttons Mobile: Proporsional, clean, dan tidak raksasa */
    .chat-side .btn {
        padding: 8px 14px;
        font-size: 12.5px;
        border-radius: 10px;
        gap: 6px;
    }
    .chat-side .btn .icon {
        width: 15px;
        height: 15px;
    }
    .chat-side .hint {
        margin-top: 8px;
        font-size: 11px;
        line-height: 1.4;
    }

    /* Dashboard Markas Komando Mobile */
    .page-dashboard .main-container { height: auto !important; min-height: calc(100dvh - var(--topbar-h)); overflow-y: auto !important; }
    .hq { height: auto !important; grid-template-columns: 1fr; grid-template-rows: auto; overflow: visible !important; }
    .hq-panel { order: 2; border-right: 0; border-top: 1px solid var(--line); overflow: visible; padding: 16px; }
    .hq-map { order: 1; height: 50vh; min-height: 320px; }
    .roster-list { max-height: 320px; }
    .map-legend { bottom: 10px; right: 10px; padding: 8px 12px; font-size: 11px; }

    /* Decoy Chat Mobile */
    .decoy-app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; }
    .decoy-side { display: none; }
    .decoy-header { padding: 10px 14px; }
    .decoy-messages { padding: 14px; }
    .decoy-composer { padding: 10px 14px; }
    .message-item { max-width: 100%; }
}

@media (max-width: 600px) {
    .brand-text { display: none; }
    .nav-clock { display: none !important; }
    .logout-form .btn span { display: none; }
    .topbar-right { gap: 6px; }
    .topbar { height: 50px; }
    :root { --topbar-h: 50px; }
    .auth-card { border-radius: 18px; }
    .keypad { gap: 6px; margin: 10px 0; }
    .key { height: 44px; font-size: 17px; }
    .stego-card { max-width: 260px; }
}

@media (max-width: 400px) {
    .user-chip .icon { display: none; }
    .user-chip { padding: 5px 8px; }
    .stat-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .stat { padding: 8px 6px; }
    .stat-value { font-size: 18px; }
    .stat-label { font-size: 10px; }
    .auth-card { padding: 20px 14px 16px; }
    .key { height: 42px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
