/* ==========================================================================
   ANPD Security — Human-centered tactical (HCT)
   Command center (gelap), koordinator (terang), login.
   Prinsip: orang jadi objek utama; warna hanya untuk keadaan tidak normal
   (ISA-101); emas = identitas & aksi utama, bukan status; kalimat biasa,
   bukan kode.
   ========================================================================== */

:root {
    --bg: #ECEEE9;
    --surface: #FFFFFF;
    --surface-2: #F5F6F2;
    --raise: #E4E7E0;
    --line: #D6DAD2;
    --line-strong: #BCC2B8;
    --text: #1B2433;
    --text-2: #4E596A;
    --text-3: #737D8B;

    --gold: #C9A227;
    --gold-strong: #B08A1C;
    --gold-text: #7E6110;
    --on-gold: #221800;

    --crit: #B42318;
    --crit-bg: #FBE8E6;
    --crit-line: #F1B7B0;
    --warn: #935500;
    --warn-bg: #FCEFD6;
    --warn-line: #EFCB8A;
    --ok: #1E7F4F;
    --ok-bg: #E3F2EA;
    --info: #2D6A9F;
    --info-bg: #E5EFF8;

    --shadow: 0 1px 2px rgba(27, 36, 51, .06);
    --radius: 10px;
    --radius-sm: 7px;

    --font: 'Barlow', 'Segoe UI', Roboto, Arial, sans-serif;
    --font-display: 'Barlow Semi Condensed', 'Arial Narrow', 'Segoe UI', Arial, sans-serif;

    --bs-font-sans-serif: var(--font);
    --bs-body-font-family: var(--font);
    --bs-body-font-size: 15.5px;
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-emphasis-color: var(--text);
    --bs-secondary-color: var(--text-2);
    --bs-tertiary-color: var(--text-3);
    --bs-secondary-bg: var(--surface-2);
    --bs-tertiary-bg: var(--surface-2);
    --bs-border-color: var(--line);
    --bs-link-color: var(--info);
    --bs-link-hover-color: var(--text);
    --bs-link-color-rgb: 45, 106, 159;
    --bs-heading-color: var(--text);
    --bs-focus-ring-color: rgba(201, 162, 39, .45);
}

[data-bs-theme="dark"] {
    color-scheme: dark;
    --bg: #121923;
    --surface: #1A2230;
    --surface-2: #212A39;
    --raise: #2B3547;
    --line: #2A3445;
    --line-strong: #3A465A;
    --text: #EDEAE3;
    --text-2: #A9B2C1;
    --text-3: #7E8797;

    --gold-text: #DDBB52;

    --crit: #FF6B5E;
    --crit-bg: #3A1716;
    --crit-line: #7A2B26;
    --warn: #F5B54A;
    --warn-bg: #362810;
    --warn-line: #6B4E19;
    --ok: #5CC596;
    --ok-bg: #16302A;
    --info: #8DBBE6;
    --info-bg: #1B2B40;

    --shadow: none;

    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-emphasis-color: var(--text);
    --bs-secondary-color: var(--text-2);
    --bs-secondary-bg: var(--surface-2);
    --bs-tertiary-bg: var(--surface-2);
    --bs-border-color: var(--line);
    --bs-link-color: var(--info);
    --bs-link-color-rgb: 141, 187, 230;
    --bs-heading-color: var(--text);
}

html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15.5px;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-display);
    color: var(--text);
    letter-spacing: 0;
}
a { color: var(--info); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
code { color: var(--text); background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
hr { border-color: var(--line); opacity: 1; }
.ti { line-height: 1; vertical-align: -0.12em; }

/* ---------- Shell: sidebar + konten ---------- */
.app { min-height: 100vh; }
.side {
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
}
@media (min-width: 992px) {
    .side { position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 1030; overflow-y: auto; }
    .main { margin-left: 248px; }
}
.side.offcanvas-lg { background-color: var(--surface) !important; }
.side .offcanvas-body { display: flex; flex-direction: column; height: 100%; padding: 0; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; text-decoration: none; color: var(--text); }
.brand img { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.1; display: block; }
.brand-role { font-size: 13px; color: var(--text-2); display: block; }
[data-bs-theme="light"] .brand .mark-dark { display: none; }
[data-bs-theme="dark"] .brand .mark-light { display: none; }

.nav-side { list-style: none; margin: 4px 0 0; padding: 0 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-side a {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--text-2); text-decoration: none; font-weight: 500;
}
.nav-side a .ti { font-size: 20px; color: var(--text-3); }
.nav-side a:hover { background: var(--surface-2); color: var(--text); }
.nav-side a.active { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--gold); }
.nav-side a.active .ti { color: var(--gold-text); }
.nav-side .count { margin-left: auto; background: var(--crit); color: #fff; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; }
.nav-group { margin: 18px 24px 6px; font-size: 13px; color: var(--text-3); }

.side-foot { margin-top: auto; padding: 14px 16px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-role { font-size: 13px; color: var(--text-2); }
.side-actions { display: flex; gap: 8px; }
.side-actions .btn { flex: 1; }

.topbar-mobile { display: none; }
@media (max-width: 991.98px) {
    .topbar-mobile {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        position: sticky; top: 0; z-index: 1020;
        background: var(--surface); border-bottom: 1px solid var(--line);
        padding: 8px 12px;
    }
    .topbar-mobile .brand { padding: 0; }
    .topbar-mobile .brand img { width: 32px; height: 32px; }
    .side { width: 280px !important; }
}

.main-inner { padding: 28px 32px 96px; max-width: 1440px; }
@media (max-width: 767.98px) { .main-inner { padding: 18px 14px 96px; } }

/* ---------- Judul halaman & bagian ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.page-title { font-size: 30px; font-weight: 700; margin: 0; line-height: 1.15; }
.page-sub { margin: 4px 0 0; color: var(--text-2); max-width: 70ch; }
.page-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.section-title { font-size: 20px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.section-title .ti { color: var(--text-3); font-size: 20px; }
.section-title small { font-family: var(--font); font-size: 14px; font-weight: 400; color: var(--text-2); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small-note { font-size: 13.5px; color: var(--text-2); }

/* ---------- Panel (pengganti card-white / bg-glass) ---------- */
.panel, .card-white, .bg-glass, .card {
    background: var(--surface) !important;
    color: var(--text);
    border: 1px solid var(--line) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow) !important;
    backdrop-filter: none !important;
}
.panel { padding: 20px 22px; }
.panel + .panel { margin-top: 20px; }
.panel-sub { background: var(--surface-2) !important; border: 1px solid var(--line) !important; border-radius: var(--radius-sm) !important; }
.card-header, .card-footer { background: var(--surface-2); border-color: var(--line); color: var(--text); }

/* ---------- Utilitas Bootstrap yang dulu mengasumsikan latar putih ---------- */
.text-dark, .text-body, .text-black { color: var(--text) !important; }
.text-muted, .text-secondary { color: var(--text-2) !important; }
.text-light { color: var(--text) !important; }
.text-success { color: var(--ok) !important; }
.text-danger { color: var(--crit) !important; }
.text-warning { color: var(--warn) !important; }
.text-info, .text-primary { color: var(--info) !important; }
.bg-light, .bg-white, .table-light { background-color: var(--surface-2) !important; color: var(--text); }
.bg-dark { background-color: var(--surface-2) !important; color: var(--text) !important; }
.border-warning { border-color: var(--warn-line) !important; }
.border-danger { border-color: var(--crit-line) !important; }
.border-success { border-color: var(--ok) !important; }
.border-secondary, .border-info { border-color: var(--line) !important; }
.opacity-50 { opacity: .55 !important; }

/* ---------- Tombol ---------- */
.btn { font-weight: 600; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn .ti { font-size: 18px; }
.btn-sm .ti { font-size: 16px; }
.btn.rounded-pill { border-radius: var(--radius-sm) !important; }
.btn-gold, .btn-primary {
    --bs-btn-color: var(--on-gold); --bs-btn-bg: var(--gold); --bs-btn-border-color: var(--gold);
    --bs-btn-hover-color: var(--on-gold); --bs-btn-hover-bg: var(--gold-strong); --bs-btn-hover-border-color: var(--gold-strong);
    --bs-btn-active-color: var(--on-gold); --bs-btn-active-bg: var(--gold-strong); --bs-btn-active-border-color: var(--gold-strong);
    --bs-btn-disabled-color: var(--on-gold); --bs-btn-disabled-bg: var(--gold); --bs-btn-disabled-border-color: var(--gold);
    background: var(--bs-btn-bg); color: var(--bs-btn-color);
}
.btn-quiet, .btn-outline-dark, .btn-outline-secondary, .btn-outline-light, .btn-outline-success, .btn-outline-info, .btn-outline-primary, .btn-outline-warning, .btn-secondary, .btn-light {
    --bs-btn-color: var(--text); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: var(--text-3);
    --bs-btn-active-color: var(--text); --bs-btn-active-bg: var(--raise); --bs-btn-active-border-color: var(--text-3);
    --bs-btn-disabled-color: var(--text-3); --bs-btn-disabled-bg: var(--surface); --bs-btn-disabled-border-color: var(--line);
}
.btn-outline-danger {
    --bs-btn-color: var(--crit); --bs-btn-bg: transparent; --bs-btn-border-color: var(--crit-line);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--crit); --bs-btn-hover-border-color: var(--crit);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--crit); --bs-btn-active-border-color: var(--crit);
}
.btn-danger, .btn-crit {
    --bs-btn-color: #fff; --bs-btn-bg: #C62A1F; --bs-btn-border-color: #C62A1F;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #A8211A; --bs-btn-hover-border-color: #A8211A;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #A8211A; --bs-btn-active-border-color: #A8211A;
}
.btn-success, .btn-ok {
    --bs-btn-color: #fff; --bs-btn-bg: #1E7F4F; --bs-btn-border-color: #1E7F4F;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #186A41; --bs-btn-hover-border-color: #186A41;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #186A41; --bs-btn-active-border-color: #186A41;
}
.btn-warning {
    --bs-btn-color: #2A1A00; --bs-btn-bg: #F2B33D; --bs-btn-border-color: #F2B33D;
    --bs-btn-hover-color: #2A1A00; --bs-btn-hover-bg: #E09F22; --bs-btn-hover-border-color: #E09F22;
    --bs-btn-active-color: #2A1A00; --bs-btn-active-bg: #E09F22; --bs-btn-active-border-color: #E09F22;
}
.icon-btn { width: 38px; height: 38px; padding: 0; }
.btn-close { filter: none; }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* ---------- Badge / chip status ---------- */
.badge { font-weight: 600; font-size: 12.5px; border-radius: 999px; padding: 4px 10px; letter-spacing: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 3px 10px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.bg-success, .chip.is-ok { background: var(--ok-bg) !important; color: var(--ok) !important; border: 0; }
.badge.bg-danger, .chip.is-crit { background: var(--crit-bg) !important; color: var(--crit) !important; border: 0; }
.badge.bg-warning, .chip.is-warn { background: var(--warn-bg) !important; color: var(--warn) !important; border: 0; }
.badge.bg-info, .badge.bg-primary, .chip.is-info { background: var(--info-bg) !important; color: var(--info) !important; border: 0; }
.badge.bg-secondary, .badge.bg-dark, .badge.bg-light { background: var(--surface-2) !important; color: var(--text-2) !important; border: 1px solid var(--line); }

/* ---------- Alert ---------- */
.alert { border-radius: var(--radius-sm); border: 1px solid var(--line); border-left-width: 4px; background: var(--surface); color: var(--text); }
.alert-success { border-color: var(--ok); background: var(--ok-bg); color: var(--text); }
.alert-danger { border-color: var(--crit); background: var(--crit-bg); color: var(--text); }
.alert-warning { border-color: var(--warn); background: var(--warn-bg); color: var(--text); }
.alert-info { border-color: var(--info); background: var(--info-bg); color: var(--text); }

/* ---------- Form ---------- */
.form-label { font-weight: 600; font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.form-label.fw-bold { font-weight: 600 !important; }
.form-control, .form-select {
    background-color: var(--surface-2) !important;
    color: var(--text) !important;
    border: 1px solid var(--line-strong) !important;
    border-radius: var(--radius-sm);
}
.form-control::placeholder { color: var(--text-3); }
.form-control:focus, .form-select:focus { border-color: var(--gold) !important; box-shadow: 0 0 0 3px rgba(201, 162, 39, .28); }
.input-group-text { background: var(--surface-2) !important; color: var(--text-2) !important; border: 1px solid var(--line-strong) !important; }
.form-check-input { background-color: var(--surface-2); border-color: var(--line-strong); }
.form-check-input:checked { background-color: var(--gold); border-color: var(--gold); }
[data-bs-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-bs-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(.85); }

/* ---------- Tabel ---------- */
.table {
    --bs-table-bg: transparent; --bs-table-color: var(--text);
    --bs-table-hover-bg: var(--surface-2); --bs-table-hover-color: var(--text);
    --bs-table-striped-bg: var(--surface-2); --bs-table-border-color: var(--line);
    margin-bottom: 0;
}
.table > thead th, .table > thead td {
    background: transparent !important; color: var(--text-2); font-weight: 600; font-size: 13.5px;
    border-bottom: 1px solid var(--line-strong) !important; white-space: nowrap;
}
.table > :not(caption) > * > * { padding: 10px 12px; border-color: var(--line); }
.table-dark { --bs-table-bg: transparent; --bs-table-color: var(--text); }
.table-responsive { border-radius: var(--radius-sm); }

/* ---------- Modal & list ---------- */
.modal-content { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); }
.modal-header, .modal-footer { border-color: var(--line); }
.modal-header.bg-dark, .modal-header.bg-danger { background: var(--surface) !important; color: var(--text) !important; }
.modal-title { font-weight: 600; }
.list-group { --bs-list-group-bg: transparent; --bs-list-group-color: var(--text); --bs-list-group-border-color: var(--line); }
.list-group-item { background: transparent !important; color: var(--text) !important; border-color: var(--line) !important; }
.tooltip { --bs-tooltip-bg: var(--text); --bs-tooltip-color: var(--surface); }
.dropdown-menu { background: var(--surface); border-color: var(--line); }

/* ==========================================================================
   Komponen human-centered
   ========================================================================== */

/* Avatar inisial: wajah pengganti, ring = keadaan orang itu */
.avatar {
    --ring: var(--line-strong);
    width: 42px; height: 42px; flex: none; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--raise); color: var(--text);
    font-family: var(--font-display); font-weight: 700; font-size: 15px;
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ring);
}
.avatar.sm { width: 32px; height: 32px; font-size: 12.5px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--ring); }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar.is-ok { --ring: var(--ok); }
.avatar.is-warn { --ring: var(--warn); }
.avatar.is-crit { --ring: var(--crit); }

/* Situasi saat ini: satu kalimat yang menjawab "apakah semuanya baik?" */
.situation {
    position: relative;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px 26px 20px 30px; margin-bottom: 26px;
}
.situation::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 5px; border-radius: 0 4px 4px 0; background: var(--line-strong); }
.situation.is-warn::before { background: var(--warn); }
.situation.is-crit { border-color: var(--crit-line); background: linear-gradient(0deg, var(--surface), var(--surface)) padding-box; }
.situation.is-crit::before { background: var(--crit); }
.situation-state { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; color: var(--text-2); margin: 0 0 6px; }
.situation.is-warn .situation-state { color: var(--warn); }
.situation.is-crit .situation-state { color: var(--crit); }
.situation-headline { font-size: clamp(24px, 2.6vw, 34px); font-weight: 600; line-height: 1.15; margin: 0; max-width: 34ch; }
.situation-body { margin: 10px 0 0; font-size: 16.5px; color: var(--text-2); max-width: 78ch; }
.situation-body strong { color: var(--text); font-weight: 600; }
.situation-next { margin: 12px 0 0; display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--text-2); }
.situation-meta { position: absolute; right: 22px; top: 18px; font-size: 13px; color: var(--text-3); text-align: right; }
@media (max-width: 767.98px) { .situation-meta { position: static; text-align: left; margin-bottom: 6px; } .situation { padding: 18px 18px 16px 22px; } }

/* Kartu tindakan: siapa, di mana, konteks, lalu tindakan yang disarankan */
.act-list { display: grid; gap: 12px; margin-bottom: 28px; }
.act {
    display: grid; grid-template-columns: auto 1fr; gap: 6px 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 18px; border-left: 5px solid var(--warn);
}
.act.is-crit { border-color: var(--crit-line); border-left-color: var(--crit); background: var(--crit-bg); }
.act-title { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin: 0; line-height: 1.25; }
.act-meta { color: var(--text-2); font-size: 14.5px; margin: 2px 0 0; }
.act-context { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14.5px; color: var(--text-2); margin-top: 4px; }
.act-context span { display: inline-flex; align-items: center; gap: 6px; }
.act-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.act-audio { grid-column: 2; margin-top: 8px; }
.act-audio .chunk-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.act-audio audio { width: 100%; max-width: 520px; height: 38px; margin-top: 8px; }
@media (max-width: 575.98px) {
    .act { grid-template-columns: 1fr; }
    .act-context, .act-actions, .act-audio { grid-column: 1; }
}

/* Personil bertugas, dikelompokkan per pos */
.posts { display: grid; gap: 18px; }
.post-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.post-name { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.post-name .ti { color: var(--text-3); }
.post-count { font-size: 14px; color: var(--text-2); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.person {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: start;
}
.person.is-warn { border-color: var(--warn-line); }
.person.is-crit { border-color: var(--crit-line); background: var(--crit-bg); }
.person-name { font-weight: 600; font-size: 16.5px; line-height: 1.25; margin: 0; }
.person-role { font-size: 14px; color: var(--text-2); }
.person-call { color: var(--text-2); }
.person-body { grid-column: 1 / -1; display: grid; gap: 6px; margin-top: 8px; }
.person-line { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--text-2); }
.person-line .ti { font-size: 16px; color: var(--text-3); flex: none; }
.person-line.is-warn { color: var(--warn); }
.person-line.is-warn .ti { color: var(--warn); }

/* Bilah jam dinas: berapa lama orang ini sudah berjaga, dengan batas 12 jam */
.duty { display: grid; gap: 4px; }
.duty-text { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.duty-text b { font-weight: 600; color: var(--text); }
.duty-text span { color: var(--text-2); }
.duty-track { position: relative; height: 6px; border-radius: 999px; background: var(--raise); overflow: visible; }
.duty-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--text-3); max-width: 100%; }
.duty.is-warn .duty-fill { background: var(--warn); }
.duty-limit { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-2); border-radius: 1px; }

/* Dua kolom bawah */
.split-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; margin-top: 30px; }
@media (max-width: 1099.98px) { .split-2 { grid-template-columns: 1fr; } }

/* Garis waktu aktivitas */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 54px 28px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.feed li:first-child { border-top: 0; }
.feed time { color: var(--text-2); font-size: 14.5px; padding-top: 2px; }
.feed .feed-ic { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-2); }
.feed .feed-ic.is-warn { background: var(--warn-bg); color: var(--warn); }
.feed .feed-ic.is-crit { background: var(--crit-bg); color: var(--crit); }
.feed-what { margin: 0; line-height: 1.35; }
.feed-who { font-size: 14px; color: var(--text-2); }
.empty-note { color: var(--text-2); padding: 14px 0; margin: 0; }

.done-list { list-style: none; margin: 0; padding: 0; }
.done-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.done-list li:first-child { border-top: 0; }
.done-list .grow { flex: 1; min-width: 0; }
.done-list .t { font-size: 14px; color: var(--text-2); text-align: right; white-space: nowrap; }

.panel-tools { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Kejadian & patroli ---------- */
.incident-card { border-left: 5px solid var(--line-strong) !important; }
.incident-card.is-warn { border-left-color: var(--warn) !important; }
.incident-card.is-crit { border-left-color: var(--crit) !important; }
.evidence-thumb { width: 120px; height: 90px; object-fit: cover; border-radius: var(--radius-sm); cursor: zoom-in; border: 1px solid var(--line); background: var(--surface-2); }
.time-big { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1; }

/* ---------- Chat tim ---------- */
.chat-fab {
    position: fixed; right: 18px; bottom: 18px; z-index: 1100;
    width: 56px; height: 56px; border-radius: 50%; border: 0;
    background: var(--gold); color: var(--on-gold); font-size: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
}
.chat-fab .chat-count { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--crit); color: #fff; font: 600 12px/22px var(--font); }
.chat-panel {
    position: fixed; right: 16px; bottom: 16px; z-index: 1101;
    width: 360px; max-width: calc(100vw - 24px); height: 480px; max-height: calc(100vh - 32px);
    display: flex; flex-direction: column;
    background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .3);
}
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.chat-close { background: none; border: 0; color: var(--text-2); font-size: 22px; line-height: 1; padding: 4px; }
.chat-list { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; }
.chat-msg { max-width: 86%; }
.chat-msg.is-me { align-self: flex-end; text-align: right; }
.chat-who { font-size: 12.5px; color: var(--text-2); margin-bottom: 2px; }
.chat-who b { color: var(--text); font-weight: 600; }
.chat-bubble { display: inline-block; text-align: left; padding: 8px 11px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; }
.chat-msg.is-me .chat-bubble { background: var(--raise); }
.chat-when { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 10px; font: inherit; }
.chat-form input:focus { outline: none; border-color: var(--gold); }
.chat-form button { background: var(--gold); color: var(--on-gold); border: 0; border-radius: var(--radius-sm); padding: 0 14px; font-weight: 600; }
[hidden] { display: none !important; }

/* ---------- Live tracking ---------- */
.track { display: grid; grid-template-columns: 340px 1fr; height: 100vh; }
.track-side { background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; padding: 18px 16px 24px; }
.track-map { position: relative; }
#map { position: absolute; inset: 0; z-index: 1; background: var(--surface-2); }
.map-tools { position: absolute; top: 12px; right: 12px; z-index: 1000; display: flex; gap: 8px; }
.track-person { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: var(--radius-sm); cursor: pointer; width: 100%; background: none; border: 0; color: inherit; text-align: left; }
.track-person:hover { background: var(--surface-2); }
.track-person .grow { flex: 1; min-width: 0; }
.track-person .nm { font-weight: 600; display: block; }
.track-person .sub { font-size: 13.5px; color: var(--text-2); display: block; }
.track-person.is-crit { background: var(--crit-bg); }
.history-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.history-row:first-child { border-top: 0; }
.audio-session { padding: 10px 0; border-top: 1px solid var(--line); }
.audio-session:first-child { border-top: 0; }
.audio-session .chunk-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
@media (max-width: 991.98px) {
    .track { grid-template-columns: 1fr; height: auto; }
    .track-map { height: 62vh; order: -1; }
}
[data-bs-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.55); }
.leaflet-container { font-family: var(--font); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.map-pin {
    --ring: var(--ok);
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #1A2230; color: #EDEAE3; font: 700 12px/1 var(--font-display);
    box-shadow: 0 0 0 3px var(--ring), 0 2px 8px rgba(0, 0, 0, .45);
}
.map-pin.is-idle { --ring: #A9B2C1; }
.map-pin.is-crit { --ring: #FF6B5E; background: #7A1D18; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 28px; }
.login-card .brand { padding: 0 0 22px; }
.login-card .brand img { width: 52px; height: 52px; }
.login-title { font-size: 24px; font-weight: 600; margin: 0 0 4px; }
.login-note { color: var(--text-2); margin: 0 0 20px; font-size: 14.5px; }

/* ---------- Gerak & cetak ---------- */
.is-pulsing { animation: anpd-pulse 1.6s ease-in-out infinite; }
@keyframes anpd-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 94, .5); } 50% { box-shadow: 0 0 0 10px rgba(255, 107, 94, 0); } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
    .side, .topbar-mobile, .chat-fab, .chat-panel, .page-tools, .panel-tools, .no-print { display: none !important; }
    .main { margin-left: 0 !important; }
    .main-inner { padding: 0; }
    body { background: #fff; color: #000; }
}

/* Jam pencatatan di form buku mutasi (dipakai bersama halaman lapangan) */
.f-bigclock { text-align: center; padding: 4px 0; }
.f-bigclock .mono { display: block; font: 700 34px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.f-bigclock small { color: var(--text-2); font-size: 14px; }

/* ---------- Jadwal otomatis ---------- */
.mono { font-family: ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.sch-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.sch-tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; margin-bottom: -1px; border-bottom: 3px solid transparent; color: var(--text-2); text-decoration: none; font-weight: 600; }
.sch-tabs a:hover { color: var(--text); }
.sch-tabs a.active { color: var(--text); border-bottom-color: var(--gold); }
.sch-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.sch-filter > div:not(.sch-nav) { min-width: 200px; }
.sch-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.sch-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sch-grid { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 13px; }
.sch-grid th, .sch-grid td { padding: 4px; text-align: center; border-bottom: 1px solid var(--line); background: var(--surface); }
.sch-grid thead th { position: sticky; top: 0; z-index: 2; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.sch-grid thead th span { display: block; font-size: 11.5px; font-weight: 500; }
.sch-grid thead th b { display: block; color: var(--text); }
.sch-grid .sch-name { position: sticky; left: 0; z-index: 1; text-align: left; padding: 6px 12px; min-width: 170px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--text); border-right: 1px solid var(--line); }
.sch-grid thead .sch-name { z-index: 3; }
.sch-grid .is-today { background: var(--surface-2); }
.sch-grid thead th.is-today b { color: var(--gold-text); }
.sch-grid .is-sunday span { color: var(--crit); }
.sch-group th { text-align: left; padding: 10px 12px 6px; background: var(--surface-2); color: var(--text); font-weight: 700; }
.sch-group th .muted { font-weight: 400; margin-left: 8px; font-size: 12.5px; }
.sch-cover td { font-size: 11.5px; color: var(--text-2); line-height: 1.25; }
.sch-cover td span { display: block; }
.sch-cover td.is-gap { background: var(--crit-bg); color: var(--crit); font-weight: 700; }
.sch-cell {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 40px; border-radius: 6px; border: 1px solid var(--line);
    background: transparent; color: var(--text-3); font: 700 13px var(--font); font-style: normal; cursor: pointer;
}
i.sch-cell { cursor: default; width: 34px; height: 30px; }
i.sch-cell.sm { width: 26px; height: 26px; font-size: 11.5px; }
.sch-cell.is-day { background: var(--info-bg); color: var(--info); border-color: transparent; }
.sch-cell.is-night { background: #1F2A44; color: #E8ECF5; border-color: #3A4A6B; }
.sch-cell.is-off { background: transparent; color: var(--text-3); }
.sch-cell.is-absent { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.sch-cell.is-bad { background: var(--crit-bg); color: var(--crit); }
.sch-cell.is-none { color: var(--text-3); border-style: dashed; }
.sch-cell.is-manual::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.sch-cell.is-sub { box-shadow: inset 0 0 0 2px var(--gold); }
.sch-cell.is-elsewhere { opacity: .55; }
button.sch-cell:hover { box-shadow: 0 0 0 2px var(--ring); }
.sch-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 13px; color: var(--text-2); }
.sch-legend span { display: inline-flex; align-items: center; gap: 8px; }
.sch-legend i.sch-cell { width: 28px; height: 24px; font-size: 11.5px; }
.sch-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.sch-prev { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--text-3); }
.sch-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; max-height: 420px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sch-member { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.sch-member:hover { background: var(--surface-2); }
.sch-member input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.sch-member b { display: block; font-weight: 600; }
.sch-member small { color: var(--text-3); }
.sch-member:has(input:checked) { background: var(--info-bg); }
.sch-cell.is-eve { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line, transparent); }
.sch-cell.is-absent { background: var(--crit-bg); color: var(--crit); }
.sch-grid thead th.is-red span, .sch-grid thead th.is-red b { color: var(--crit); }
.sch-grid thead th { position: sticky; }
.sch-flag { display: block; width: 8px; height: 8px; margin: 2px auto 0; border-radius: 2px; background: var(--info); }
.sch-legend .sch-flag { display: inline-block; margin: 0; }
.sch-red-sample { color: var(--crit); }
.sch-sum { min-width: 72px; font-size: 12px; color: var(--text-2); }
.sch-holiday-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.sch-holiday-list li { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.sch-holiday-list li span { color: var(--text-3); font-size: 12px; }
.sch-holiday-list li.is-libur b, .sch-holiday-list li.is-cuti b { color: var(--crit); }
.sch-holiday-list li.is-peringatan b { color: var(--info); }
.sch-scheme { display: grid; gap: 6px; }
.sch-scheme label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.sch-scheme label:has(input:checked) { border-color: var(--gold); background: var(--surface-2); }
.sch-scheme small { color: var(--text-3); width: 100%; padding-left: 22px; }
.sch-prev.is-red small { color: var(--crit); font-weight: 700; }
i.sch-cell.is-redday { outline: 2px solid var(--crit-line, var(--crit)); outline-offset: 1px; }

/* ---------- Kesiapan unit ---------- */
.ur-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ur-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ur-card { display: flex; flex-direction: column; gap: 10px; margin: 0; border-left: 4px solid var(--line); }
.ur-card.is-siaga { border-left-color: var(--ok); }
.ur-card.is-perlu-tindakan { border-left-color: var(--warn); }
.ur-card.is-tidak-siap { border-left-color: var(--crit); }
.ur-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ur-code { font-size: 12.5px; color: var(--gold-text); font-weight: 700; }
.ur-name { font-size: 18px; font-weight: 600; margin: 2px 0; }
.ur-value { display: flex; align-items: center; gap: 12px; }
.ur-value b { font-size: 22px; min-width: 64px; }
.ur-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.ur-bar span { display: block; height: 100%; background: var(--text-3); }
.ur-card.is-siaga .ur-bar span { background: var(--ok); }
.ur-card.is-perlu-tindakan .ur-bar span { background: var(--warn); }
.ur-card.is-tidak-siap .ur-bar span { background: var(--crit); }
.ur-note { margin: 0; padding: 8px 10px; border-radius: 6px; background: var(--surface-2); font-size: 14px; }
.ur-standard { margin: 0; font-size: 13px; color: var(--text-2); }
.ur-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }

/* Teks "Belum ada aktivitas" tampil satu baris penuh, bukan terjepit di kolom jam */
.feed li.empty-note { display: block; }
