:root {
    /* Palette: Tactical Modern Slate, Deep Navy, & Military Accents */
    --bg-slate: #f8fafc;
    --bg-slate-50: #f8fafc;
    --bg-slate-100: #f1f5f9;
    --bg-slate-200: #e2e8f0;
    --bg-slate-300: #cbd5e1;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);

    /* Command Primary (Deep Tactical Navy) */
    --primary-navy: #0f172a;
    --primary-slate: #1e293b;
    --navy-border: #1e293b;
    --navy-hover: #334155;

    /* Tactical Status Accents */
    --accent-emerald: #059669; /* Kondisi Baik (B) */
    --accent-emerald-light: #10b981;
    --accent-emerald-bg: #ecfdf5;
    --accent-emerald-border: #a7f3d0;

    --accent-amber: #d97706; /* Kondisi Rusak Ringan (RR) */
    --accent-amber-light: #f59e0b;
    --accent-amber-bg: #fffbeb;
    --accent-amber-border: #fde68a;

    --accent-crimson: #dc2626; /* Kondisi Rusak Berat (RB) */
    --accent-crimson-light: #ef4444;
    --accent-crimson-bg: #fef2f2;
    --accent-crimson-border: #fecaca;

    --accent-blue: #0284c7; /* Status Mutasi Dipinjam */
    --accent-blue-bg: #f0f9ff;
    --accent-blue-border: #bae6fd;

    /* Text Hierarchy */
    --text-primary: #0f172a; /* Slate 900 */
    --text-secondary: #334155; /* Slate 700 */
    --text-muted: #64748b; /* Slate 500 */
    --text-light: #94a3b8; /* Slate 400 */

    /* Typography */
    --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;

    /* Backward Compatible Legacy Aliases */
    --mil-black: #0f172a;
    --mil-dark-green: #0f172a;
    --mil-card-bg: #ffffff;
    --mil-border: #e2e8f0;
    --mil-green-accent: #059669;
    --mil-gold: #0f172a;
    --mil-red: #dc2626;
    --mil-amber: #d97706;
    --mil-text: #0f172a;
    --mil-text-muted: #64748b;
    --mil-bg: #f8fafc;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg-slate);
    color: var(--text-primary);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   HALAMAN LOGIN MILITER DENGAN LATAR BELAKANG IMAGE.PNG
   ========================================================================== */

body.login-body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0d1b12;
    position: relative;
    margin: 0;
    padding: 24px 16px;
    overflow-x: hidden;
}

body.login-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(135deg, rgba(14, 30, 20, 0.72) 0%, rgba(27, 67, 50, 0.58) 50%, rgba(10, 22, 14, 0.82) 100%),
        url('../../image.png');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    z-index: 0;
    pointer-events: none;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: auto;
    padding: 10px 0;
}

.login-card {
    background: rgba(244, 251, 246, 0.95);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-top: 5px solid var(--mil-green-accent);
    border-radius: 14px;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.48), 0 0 35px rgba(45, 106, 79, 0.28);
    padding: 32px 28px;
    position: relative;
}

.login-card::before {
    content: "[ RESTRICTED ACCESS - LEVEL 4 ]";
    display: block;
    font-size: 10.5px;
    font-weight: bold;
    color: var(--mil-green-accent);
    text-align: center;
    letter-spacing: 2.5px;
    margin-bottom: 20px;
}

/* ==========================================================================
   LAYOUT SISTEM KOMANDO: SIDEBAR KIRI (DESKTOP) & DRAWER RESPONSIF (HP)
   Tata letak menu di sebelah kiri berurutan mulai dari atas ke bawah:
   1. Prajurit, 2. Rekap Materil, 3. Nominatif Senjata, 
   4. Stok Senjata, 5. Log Transaksi, 6. Operator
   ========================================================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    position: relative;
    background: var(--bg-slate);
}

/* SIDEBAR KIRI: TACTICAL NAVY */
.app-sidebar {
    width: 270px;
    flex-shrink: 0;
    background: #0f172a;
    border-right: 1px solid #1e293b;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    z-index: 1000;
}

/* Brand Medali di Sidebar */
.sidebar-brand {
    padding: 20px 18px 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;
    border-bottom: 1px solid #1e293b;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.2s ease;
}

.sidebar-brand:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-brand-emblem {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
    user-select: none;
    -webkit-user-drag: none;
    flex-shrink: 0;
}

.sidebar-brand:hover .sidebar-brand-emblem {
    transform: scale(1.06);
    filter: drop-shadow(0 3px 10px rgba(16, 185, 129, 0.4));
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-brand-title {
    font-family: 'Rajdhani', var(--font-sans);
    font-size: 18px;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 1.5px;
    line-height: 1.15;
    text-transform: uppercase;
}

.sidebar-brand-subtitle {
    font-size: 9.5px;
    font-weight: 600;
    color: #10b981;
    letter-spacing: 0.5px;
    line-height: 1.25;
}

/* Kartu Profil Operator Login */
.sidebar-user-card {
    padding: 12px 14px;
    margin: 14px 14px 10px 14px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}

.user-pulse {
    width: 7px;
    height: 7px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
    display: inline-block;
    animation: userPulseGlow 2s infinite ease-in-out;
}

@keyframes userPulseGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

.user-role {
    font-size: 9.5px;
    font-weight: 800;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    padding: 2px 7px;
    border-radius: 9999px;
    letter-spacing: 0.6px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Navigasi Menu Vertikal */
.sidebar-nav {
    padding: 10px 12px 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-section-title {
    font-size: 9.5px;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 10px 12px 6px 12px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    border: 1px solid transparent;
}

.sidebar-nav a .link-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.sidebar-nav a .link-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

.sidebar-nav a.active {
    background: #10b981;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    border-color: #10b981;
}

.sidebar-nav a.active .link-icon {
    transform: scale(1.15);
}

.sidebar-section-divider {
    height: 1px;
    background: #1e293b;
    margin: 8px 6px;
}

.sidebar-nav a.nav-link-logout {
    color: #f87171;
    margin-top: 6px;
}

.sidebar-nav a.nav-link-logout:hover {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    border-color: rgba(220, 38, 38, 0.3);
}

.sidebar-footer-badge {
    padding: 12px 16px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #94a3b8;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    border-top: 1px solid #1e293b;
    background: rgba(15, 23, 42, 0.9);
}

.status-pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 6px #10b981;
    animation: userPulseGlow 2s infinite ease-in-out;
}

/* AREA KONTEN UTAMA KANAN */
.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-slate);
}

.container {
    max-width: 100% !important;
    margin: 10px 0 24px 0 !important;
    padding: 0 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex: 1;
}

.footer-security-banner {
    text-align: center;
    padding: 18px;
    color: #64748b;
    font-size: 11px;
    font-family: var(--font-mono);
    border-top: 1px solid #e2e8f0;
    margin-top: 36px;
    background: #ffffff;
    letter-spacing: 1px;
}

/* TOP BAR MOBILE (LAYAR KECIL / HP) */
.mobile-top-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #ffffff;
}

.mobile-brand-emblem {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.mobile-brand-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.mobile-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.mobile-user-mini {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #cbd5e1;
    background: #1e293b;
    border: 1px solid #334155;
    padding: 4px 8px;
    border-radius: 14px;
}

.mobile-toggler-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 6px 12px;
    color: #f8fafc;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.mobile-toggler-btn:hover {
    background: #334155;
    color: #ffffff;
    border-color: #475569;
}

.mobile-toggler-btn:hover {
    background: var(--mil-dark-green);
    color: #ffffff;
    border-color: var(--mil-dark-green);
}

.toggler-bars {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 16px;
    height: 12px;
}

.toggler-bars span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: currentColor;
    border-radius: 2px;
}

/* MEDIA QUERIES UNTUK RESPONSIVITAS MOBILE (< 992px) */
@media (max-width: 991px) {
    .mobile-top-bar {
        display: flex;
    }

    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1050;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.35);
    }
    
    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(10, 25, 18, 0.55);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1040;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-backdrop.is-active {
        opacity: 1;
        pointer-events: auto;
    }

    /* Tombol Tutup Sidebar pada Mode Layar HP */
    .sidebar-close-btn {
        position: absolute;
        top: 14px;
        right: 14px;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        border: 1px solid #334155;
        background: #1e293b;
        color: #f8fafc;
        font-size: 22px;
        font-weight: 700;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1060;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
        transition: all 0.2s ease;
    }

    .sidebar-close-btn:hover,
    .sidebar-close-btn:active {
        background: #dc2626;
        color: #ffffff;
        border-color: #ef4444;
    }

    /* Mobile Bottom Navigation Bar (Khusus Layar HP Smartphone) */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        height: calc(60px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: rgba(15, 23, 42, 0.96);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-top: 1px solid #1e293b;
        box-shadow: 0 -3px 18px rgba(0, 0, 0, 0.25);
        z-index: 1020;
        display: flex;
        align-items: center;
        justify-content: space-around;
        box-sizing: border-box;
    }

    body {
        padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .bottom-nav-item {
        flex: 1;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #94a3b8;
        text-decoration: none;
        background: transparent;
        border: none;
        padding: 4px 2px;
        position: relative;
        transition: color 0.15s ease, transform 0.1s ease;
        cursor: pointer;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav-item:active {
        transform: scale(0.92);
    }

    .bottom-nav-icon {
        font-size: 19px;
        line-height: 1.1;
        margin-bottom: 2px;
        transition: transform 0.2s ease;
    }

    .bottom-nav-label {
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.3px;
        line-height: 1;
    }

    .bottom-nav-item.active {
        color: #10b981;
        font-weight: 800;
    }

    .bottom-nav-item.active .bottom-nav-icon {
        transform: scale(1.12);
    }

    .bottom-nav-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 24px;
        height: 3px;
        background: #10b981;
        border-radius: 0 0 3px 3px;
    }

    .container {
        padding: 0 16px;
        margin: 14px auto 30px auto;
    }
}

@media (min-width: 992px) {
    .mobile-top-bar {
        display: none !important;
    }
    .sidebar-backdrop {
        display: none !important;
    }
    .sidebar-close-btn {
        display: none !important;
    }
    .mobile-bottom-nav {
        display: none !important;
    }
}

.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 18px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

.card h2 {
    margin-top: 0;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
    margin-bottom: 18px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.stat-box {
    background: #ffffff;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.04);
}

.stat-box.alert {
    border-color: #fecaca;
    background: #fef2f2;
}

.stat-box h3 {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    font-family: var(--font-sans);
}

.stat-box.alert h3 {
    color: #dc2626;
}

.stat-box p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

/* Responsive Table Container & Full Width Desktop Fit */
.table-responsive {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
}

@media (min-width: 992px) {
    .table-responsive {
        overflow-x: visible !important;
    }
    .table-responsive table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: auto !important;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 11.5px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

th, td {
    padding: 7px 8px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    box-sizing: border-box;
}

th {
    background-color: #f1f5f9;
    color: #334155;
    font-weight: 700;
    border-top: none;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.4px;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

tr:hover {
    background-color: #f1f5f9;
}

.btn {
    padding: 8px 16px;
    background: #0f172a;
    color: #ffffff;
    border: 1px solid #0f172a;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn:hover {
    background: #1e293b;
    border-color: #1e293b;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.15);
}

.btn-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.25);
}

.btn-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 6px;
}

/* Global Action Buttons for Data Tables */
.action-btn-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.2;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    min-height: 26px;
    box-sizing: border-box;
}

.action-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn-kembalikan {
    background: #059669;
    border-color: #047857;
    color: #ffffff !important;
}

.action-btn-kembalikan:hover {
    background: #047857;
    box-shadow: 0 3px 8px rgba(5, 150, 105, 0.3);
}

.action-btn-edit {
    background: #0284c7;
    border-color: #0369a1;
    color: #ffffff !important;
}

.action-btn-edit:hover {
    background: #0369a1;
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.3);
}

.action-btn-hapus {
    background: #dc2626;
    border-color: #b91c1c;
    color: #ffffff !important;
}

.action-btn-hapus:hover {
    background: #b91c1c;
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.3);
}

.action-btn-secondary {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155 !important;
}

.action-btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    padding: 9px 13px;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13.5px;
    color-scheme: light;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select.form-control option {
    background-color: #ffffff;
    color: #0f172a;
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.toggle-password:hover,
.toggle-password:focus {
    color: #0f172a;
}

.toggle-password:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

.form-control:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.badge {
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.4;
}

.badge-success, .badge-baik { background-color: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-warning, .badge-rr   { background-color: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-danger,  .badge-rb   { background-color: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-info,    .badge-dipinjam { background-color: #f0f9ff; color: #0284c7; border: 1px solid #bae6fd; }

/* Technical Monospace Badges */
.barcode-badge, .badge-code, .tech-badge {
    font-family: var(--font-mono) !important;
    font-size: 11.5px;
    font-weight: 600;
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    padding: 3px 8px;
    border-radius: 5px;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Weapon Number Tactical Barcode Badge */
.weapon-barcode-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 9px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #0f172a;
    font-family: var(--font-mono) !important;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    white-space: nowrap !important;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 28px;
    box-sizing: border-box;
    line-height: 1;
}

.weapon-barcode-badge:hover {
    background: #f0fdf4;
    border-color: #10b981;
    color: #047857;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.2);
}

.weapon-barcode-badge:active {
    transform: translateY(0);
}

.weapon-barcode-badge .barcode-svg-icon {
    flex-shrink: 0;
    color: #475569;
    transition: color 0.15s ease;
}

.weapon-barcode-badge:hover .barcode-svg-icon {
    color: #059669;
}

/* Tactical Role Badges */
.badge-role-admin {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: 9999px;
    padding: 2px 10px;
}
.badge-role-pasilog {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: 9999px;
    padding: 2px 10px;
}
.badge-role-danyon {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: 9999px;
    padding: 2px 10px;
}
.badge-role-petugas {
    background-color: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: 9999px;
    padding: 2px 10px;
}
.badge-role-prajurit {
    background-color: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: 9999px;
    padding: 2px 10px;
}

.kondisi-select {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-transform: uppercase;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    outline: none;
}
.kondisi-select.baik {
    background-color: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}
.kondisi-select.rusak {
    background-color: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}
.kondisi-select:hover, .kondisi-select:focus {
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.alert-msg {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 13px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box,
.table-actions,
.pagination {
    color: var(--mil-text-muted);
}

.barcode-control {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.barcode-control .form-control {
    flex: 1;
}

.barcode-scan-button {
    white-space: nowrap;
}

.weapon-barcode {
    display: block;
    width: 150px;
    height: 48px;
    max-width: 100%;
}

.barcode-code {
    display: block;
    color: var(--mil-text-muted);
    font-size: 10px;
    letter-spacing: 1px;
    margin-top: 2px;
}

.barcode-scanner[hidden] {
    display: none;
}

.barcode-scanner {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(16, 37, 26, 0.58);
}

.barcode-scanner-dialog {
    width: min(100%, 520px);
    padding: 20px;
    background: #ffffff;
    border: 1px solid var(--mil-border);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(16, 37, 26, 0.24);
}

.barcode-scanner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.barcode-scanner-header h2 {
    margin: 0;
    color: var(--mil-gold);
    font-size: 16px;
}

.barcode-scanner-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--mil-border);
    border-radius: 6px;
    background: #f5faf7;
    color: var(--mil-text);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.barcode-video {
    display: block;
    width: 100%;
    min-height: 220px;
    max-height: 60vh;
    object-fit: cover;
    border-radius: 8px;
    background: #10251a;
}

.barcode-scanner-status {
    min-height: 20px;
    margin: 12px 0 16px;
    color: var(--mil-text-muted);
    font-size: 12px;
}

.barcode-scanner-result {
    display: grid;
    gap: 4px;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid #b7ddc3;
    border-left: 4px solid var(--mil-green-accent);
    border-radius: 8px;
    background: #eff9f2;
    color: var(--mil-text);
}

.barcode-scanner-result[hidden] {
    display: none;
}

.barcode-scanner-result-label {
    color: var(--mil-green-accent);
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
}

.barcode-scanner-result strong {
    font-size: 18px;
    letter-spacing: 1px;
}

.barcode-scanner-result span:last-child {
    color: var(--mil-text-muted);
    font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
    body::before {
        animation: none;
    }
}

@media (max-width: 992px) {
    .navbar-container {
        padding: 10px 16px;
    }

    .navbar-toggler {
        display: inline-flex;
    }

    .navbar.menu-expanded {
        background: rgba(240, 249, 243, 0.99);
        box-shadow: 0 10px 25px rgba(27, 67, 50, 0.15);
    }

    /* Collapsible Navigation Menu on Mobile/HP */
    .nav-menu {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
        pointer-events: none;
    }

    .nav-menu.is-open {
        max-height: 800px;
        opacity: 1;
        pointer-events: auto;
        padding-top: 10px;
        border-top: 1px dashed var(--mil-border);
        margin-top: 6px;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: 100%;
    }

    .nav-links a {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 11px 14px;
        font-size: 13.5px;
        border-radius: 8px;
        background: #ffffff;
        border: 1px solid var(--mil-border);
        min-height: 44px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
    }

    .nav-links a .link-icon {
        font-size: 15px;
        width: 24px;
        display: inline-block;
        text-align: center;
    }

    .nav-links a.active {
        background: var(--mil-dark-green);
        color: #ffffff;
        border-color: var(--mil-dark-green);
        font-weight: 800;
        box-shadow: 0 4px 12px rgba(27, 67, 50, 0.25);
        position: relative;
    }

    .nav-links a.active::after {
        content: "[ AKTIF ]";
        margin-left: auto;
        font-size: 10px;
        letter-spacing: 1px;
        background: rgba(255, 255, 255, 0.2);
        padding: 2px 7px;
        border-radius: 4px;
    }

    .nav-links a.nav-link-logout {
        margin-left: 0;
        margin-top: 4px;
        background: rgba(192, 57, 43, 0.08);
        border-color: rgba(192, 57, 43, 0.4);
        color: var(--mil-red);
    }

    .mobile-user-drawer {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-top: 12px;
        padding: 10px 14px;
        background: rgba(27, 67, 50, 0.05);
        border: 1px solid var(--mil-border);
        border-radius: 8px;
        font-size: 11.5px;
    }

    .mobile-user-info {
        display: flex;
        align-items: center;
        gap: 8px;
        color: var(--mil-text);
    }

    .mobile-system-status {
        color: var(--mil-green-accent);
        font-weight: 700;
        letter-spacing: 1px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .navbar-container {
        padding: 8px 12px;
    }

    .brand-title {
        font-size: 13.5px;
        letter-spacing: 0.6px;
    }

    .brand-subtitle {
        font-size: 8.5px;
        letter-spacing: 0.8px;
    }

    .brand-badge {
        font-size: 9.5px;
        padding: 3px 6px;
    }

    .navbar-user-pill {
        display: none;
    }

    .navbar-toggler {
        padding: 6px 10px;
        min-height: 36px;
    }
}

@media (max-width: 768px) {

    .container {
        padding: 16px 12px;
        max-width: 100%;
    }

    .card {
        padding: 16px 12px;
        border-radius: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 580px;
        font-size: 12px;
    }

    th, td {
        padding: 8px 10px;
    }
}

.quiz-hero {
    align-items: center;
    background: linear-gradient(135deg, #142e22 0%, #1b4332 55%, #245842 100%);
    border: 1px solid rgba(222, 216, 205, 0.4);
    border-left: 6px solid #b08938;
    border-radius: 12px;
    color: #f7f5ef;
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    min-height: 180px;
    overflow: hidden;
    padding: 28px 32px;
    position: relative;
    box-shadow: 0 10px 30px rgba(20, 46, 34, 0.16);
}

.quiz-hero::after {
    border: 1px solid rgba(245, 242, 235, 0.15);
    content: "";
    height: 220px;
    position: absolute;
    right: 50px;
    top: -70px;
    transform: rotate(35deg);
    width: 220px;
    pointer-events: none;
}

.quiz-hero-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
}

/* HIERARKI TEKS: JUDUL BESAR HEADER */
.quiz-hero h2 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #ffffff;
    margin: 4px 0 10px 0;
    text-transform: uppercase;
}

.quiz-hero-desc {
    color: #e2ded5;
    font-size: 13.5px;
    line-height: 1.6;
    margin: 0;
}

.quiz-hero-mark {
    color: rgba(245, 242, 235, 0.18);
    font-size: 88px;
    font-weight: 900;
    line-height: 1;
    position: relative;
    z-index: 1;
    font-family: monospace;
}

/* DUA KARTU KONTEN BERDAMPINGAN DI BAWAH */
.quiz-layout {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
}

.game-panel,
.quiz-panel {
    background: #ffffff;
    border: 1px solid var(--mil-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(36, 40, 38, 0.05);
    display: flex;
    flex-direction: column;
}

/* HIERARKI TEKS: JUDUL KARTU KONTEN */
.section-heading-row {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 12px;
}

.section-heading-row h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--mil-dark-green);
    margin: 3px 0;
    letter-spacing: 0.5px;
    border-bottom: none;
    padding-bottom: 0;
}

/* HIERARKI TEKS: TEKS KECIL (KICKER & SUB-TITLE) */
.quiz-kicker {
    color: var(--mil-green-accent);
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
}

.quiz-hero .quiz-kicker {
    color: #d8c393;
}

.quiz-sub-title {
    color: var(--mil-text-muted);
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
}

/* HIERARKI TEKS: PETUNJUK (INSTRUCTION CALLOUT) */
.instruction-box {
    background: #eaf5ee;
    border-left: 4px solid var(--mil-dark-green);
    border-radius: 0 6px 6px 0;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.instruction-badge {
    display: block;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--mil-dark-green);
    margin-bottom: 4px;
}

.quiz-instruction-text {
    color: var(--mil-text);
    font-size: 12.5px;
    line-height: 1.55;
    margin: 0;
}

/* KARTU KIRI: SIMULASI VISUAL (DEFENSE GRID) */
.game-hud {
    background: #242826;
    border-radius: 8px;
    color: #f5f2eb;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 4px 0 14px;
    padding: 12px;
    text-align: center;
}

.game-hud div {
    border-right: 1px solid rgba(222, 216, 205, 0.2);
}

.game-hud div:last-child {
    border-right: 0;
}

.game-hud span {
    color: #a2aba5;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: block;
}

.game-hud strong {
    color: #f7f4ec;
    font-size: 22px;
    font-weight: 800;
    margin-top: 3px;
    display: block;
}

.game-arena {
    background-color: #162e21;
    background-image:
        linear-gradient(rgba(222, 216, 205, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(222, 216, 205, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    border: 2px solid #2d6a4f;
    border-radius: 8px;
    height: 270px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(18, 32, 23, 0.6);
}

.game-start-state {
    color: #d8deda;
    left: 50%;
    position: absolute;
    text-align: center;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
}

.game-start-state strong {
    color: #f7f4ec;
    font-size: 18px;
    letter-spacing: 2px;
    display: block;
}

.game-start-state span {
    font-size: 12px;
    color: #97a39b;
    margin-top: 6px;
    display: block;
}

.game-target {
    align-items: center;
    background: #b08938;
    border: 3px solid #f5f2eb;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(176, 137, 56, 0.4), 0 0 16px rgba(176, 137, 56, 0.7);
    color: #122017;
    cursor: crosshair;
    display: flex;
    height: 40px;
    justify-content: center;
    position: absolute;
    transform: translate(-50%, -50%);
    width: 40px;
}

.game-target span {
    font-size: 22px;
    font-weight: 800;
}

.game-actions,
.quiz-actions {
    align-items: center;
    display: flex;
    gap: 15px;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--mil-border);
}

.game-status,
.quiz-actions strong {
    color: var(--mil-text-muted);
    font-size: 12px;
    font-weight: 600;
}

/* KARTU KANAN: TEKS EVALUASI */
.quiz-question-number {
    color: var(--mil-green-accent);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 8px 0 6px;
}

.quiz-question-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--mil-text);
    line-height: 1.5;
    margin: 0 0 16px;
}

.answer-grid {
    display: grid;
    gap: 9px;
}

.answer-option {
    align-items: center;
    background: #f0f9f3;
    border: 1px solid var(--mil-border);
    border-radius: 8px;
    color: var(--mil-text);
    cursor: pointer;
    display: flex;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    gap: 12px;
    padding: 12px 14px;
    text-align: left;
    transition: all 0.2s ease;
}

.answer-option:hover {
    border-color: var(--mil-green-accent);
    background: #dcf2e4;
    transform: translateX(3px);
}

.answer-option span {
    align-items: center;
    background: var(--mil-dark-green);
    border-radius: 50%;
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 24px;
    font-size: 11px;
    font-weight: 800;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.answer-option.correct {
    background: #eaf5ee;
    border-color: var(--mil-green-accent);
    color: var(--mil-dark-green);
    font-weight: 600;
}

.answer-option.correct span {
    background: var(--mil-green-accent);
}

.answer-option.wrong {
    background: #fdf0ee;
    border-color: var(--mil-red);
    color: #a32215;
}

.answer-option.wrong span {
    background: var(--mil-red);
}

.quiz-feedback {
    font-size: 12px;
    line-height: 1.55;
    min-height: 38px;
    margin: 14px 0 0;
    padding: 8px 12px;
    border-radius: 6px;
}

.quiz-feedback.correct-text {
    background: #eaf5ee;
    color: var(--mil-dark-green);
    border-left: 3px solid var(--mil-green-accent);
}

.quiz-feedback.wrong-text {
    background: #fdf0ee;
    color: var(--mil-red);
    border-left: 3px solid var(--mil-red);
}

.quiz-result {
    align-items: center;
    display: flex;
    flex-direction: column;
    min-height: 260px;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.quiz-result strong {
    color: var(--mil-dark-green);
    font-size: 56px;
    font-weight: 900;
    line-height: 1;
    margin: 10px 0;
}

.quiz-result p {
    color: var(--mil-text-muted);
    font-size: 13px;
    margin: 0 0 20px;
}

.quiz-message {
    border-left-color: var(--mil-green-accent);
    color: var(--mil-green-accent);
}

.question-form {
    margin-top: 20px;
}

.question-form textarea {
    resize: vertical;
}

.question-options {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, 1fr);
}

.question-full {
    grid-column: 1 / -1;
}

.question-form-bottom {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: 180px 1fr;
    margin-top: 12px;
}

.question-explanation {
    margin-bottom: 0;
}

.question-list {
    border-top: 1px solid var(--mil-border);
    margin-top: 22px;
}

.question-row {
    align-items: center;
    border-bottom: 1px solid var(--mil-border);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 14px 0;
}

.question-row strong,
.question-row small {
    display: block;
}

.question-row strong {
    font-size: 13px;
    line-height: 1.45;
}

.question-row small {
    color: var(--mil-text-muted);
    font-size: 11px;
    margin-top: 5px;
}

.question-row-actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: 7px;
}

@media (max-width: 800px) {
    .quiz-layout,
    .question-options,
    .question-form-bottom {
        grid-template-columns: 1fr;
    }

    .quiz-hero {
        min-height: 160px;
        padding: 22px;
    }

    .quiz-hero-mark {
        font-size: 58px;
    }

    .question-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ==========================================================================
   REAL-TIME AVAILABILITY STATUS & DENAH GUDANG VISUAL STYLES
   ========================================================================== */
.denah-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    background: var(--mil-card-bg);
    border: 1px solid var(--mil-border);
    border-radius: 12px;
    padding: 22px 26px;
    box-shadow: 0 4px 18px rgba(39, 91, 59, 0.06);
}

.denah-title-group h2 {
    margin: 4px 0;
    font-size: 20px;
    color: var(--mil-dark-green);
    letter-spacing: 1px;
}

.denah-kicker {
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--mil-green-accent);
    font-weight: bold;
}

.denah-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--mil-text-muted);
}

.denah-live-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(25, 135, 84, 0.1);
    border: 1px solid rgba(25, 135, 84, 0.25);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: bold;
    color: var(--mil-green-accent);
}

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #198754;
    box-shadow: 0 0 10px #198754;
}

.sync-countdown {
    background: var(--mil-dark-green);
    color: #ffffff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-family: monospace;
}

/* Status Legend Grid (4 Warna + Total) */
.status-legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.legend-card {
    background: var(--mil-card-bg);
    border: 1px solid var(--mil-border);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.legend-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.legend-card.active-filter {
    border-color: var(--mil-dark-green);
    box-shadow: 0 0 0 2px var(--mil-green-accent), 0 6px 18px rgba(25, 135, 84, 0.15);
}

.legend-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-indicator {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.ind-all    { background: #176b46; box-shadow: 0 0 8px rgba(23, 107, 70, 0.6); }
.ind-green  { background: #198754; box-shadow: 0 0 8px rgba(25, 135, 84, 0.7); }
.ind-yellow { background: #f39c12; box-shadow: 0 0 8px rgba(243, 156, 18, 0.7); }
.ind-red    { background: #dc3545; box-shadow: 0 0 8px rgba(220, 53, 69, 0.7); }
.ind-grey   { background: #6c757d; box-shadow: 0 0 8px rgba(108, 117, 125, 0.7); }

.legend-content {
    flex: 1;
}

.legend-label {
    display: block;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.5px;
    color: var(--mil-text-muted);
}

.legend-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--mil-text);
    line-height: 1.2;
    margin: 2px 0;
}

.legend-desc {
    display: block;
    font-size: 11px;
    color: var(--mil-text-muted);
}

/* Border warna khusus tiap kartu legend */
.legend-green { border-left: 4px solid #198754; }
.legend-yellow { border-left: 4px solid #f39c12; }
.legend-red { border-left: 4px solid #dc3545; }
.legend-grey { border-left: 4px solid #6c757d; }

/* Panel Pencarian Kode Senjata Disederhanakan */
.denah-search-panel {
    margin-bottom: 24px;
    padding: 20px 24px;
    background: var(--mil-card-bg);
    border: 1px solid var(--mil-border);
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

.search-panel-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--mil-border);
}

.search-panel-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-controls-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 900px) {
    .search-controls-row {
        grid-template-columns: 1fr;
    }
}

.control-label {
    display: block;
    font-size: 11px;
    font-weight: bold;
    color: var(--mil-text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.search-input-group {
    position: relative;
    width: 100%;
}

.search-input-group .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--mil-text-muted);
}

.search-input-group .form-control {
    padding-left: 36px;
    padding-right: 32px;
}

.btn-clear-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: var(--mil-text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.btn-clear-icon:hover {
    color: var(--mil-red);
}

/* Quick Pills */
.quick-pills-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.pills-label {
    font-size: 11px;
    font-weight: bold;
    color: var(--mil-text-muted);
    letter-spacing: 0.5px;
}

.pills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill-btn {
    background: #ffffff;
    border: 1px solid var(--mil-border);
    color: var(--mil-text);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.pill-btn:hover {
    border-color: var(--mil-green-accent);
    color: var(--mil-dark-green);
    transform: translateY(-1px);
}

.pill-btn.active {
    background: var(--mil-dark-green);
    border-color: var(--mil-dark-green);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(23, 107, 70, 0.3);
}

/* Active Search Banner */
.search-active-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 18px;
    background: rgba(25, 135, 84, 0.08);
    border: 1px solid rgba(25, 135, 84, 0.3);
    border-radius: 8px;
    animation: fadeIn 0.2s ease;
}

.banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.banner-icon {
    font-size: 20px;
}

.banner-desc {
    display: block;
    font-size: 12px;
    color: var(--mil-text-muted);
    margin-top: 2px;
}

.slot-matched {
    box-shadow: 0 0 0 2px var(--mil-green-accent), 0 8px 24px rgba(25, 135, 84, 0.2) !important;
    transform: translateY(-2px);
}

.search-active-banner .btn-sm {
    padding: 6px 12px;
    font-size: 11px;
}

.btn-warning {
    background: #f39c12;
    color: #ffffff;
    border-color: #e67e22;
}

.btn-warning:hover {
    background: #d68910;
}

/* Floorplan Layout & Sektor */
.denah-floorplan-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.denah-sector-card {
    background: var(--mil-card-bg);
    border: 1px solid var(--mil-border);
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

.sector-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--mil-border);
}

.sector-badge-icon {
    font-size: 20px;
    color: var(--mil-green-accent);
}

.sector-title-info h3 {
    margin: 0;
    font-size: 16px;
    color: var(--mil-dark-green);
    letter-spacing: 0.5px;
}

.sector-counter {
    font-size: 11px;
    color: var(--mil-text-muted);
}

/* Grid Slots Kompartemen */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.slot-box {
    background: #ffffff;
    border: 1px solid var(--mil-border);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 145px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    position: relative;
    outline: none;
}

.slot-box:hover,
.slot-box:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.09);
}

/* Warna Status 4 Warna pada Slot */
.slot-green {
    border-top: 5px solid #198754;
    background: linear-gradient(180deg, rgba(25, 135, 84, 0.04) 0%, #ffffff 40%);
}
.slot-green:hover { border-color: #198754; }

.slot-yellow {
    border-top: 5px solid #f39c12;
    background: linear-gradient(180deg, rgba(243, 156, 18, 0.05) 0%, #ffffff 40%);
}
.slot-yellow:hover { border-color: #f39c12; }

.slot-red {
    border-top: 5px solid #dc3545;
    background: linear-gradient(180deg, rgba(220, 53, 69, 0.05) 0%, #ffffff 40%);
}
.slot-red:hover { border-color: #dc3545; }

.slot-grey {
    border-top: 5px solid #6c757d;
    background: linear-gradient(180deg, rgba(108, 117, 125, 0.04) 0%, #ffffff 40%);
}
.slot-grey:hover { border-color: #6c757d; }

.slot-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.slot-code {
    font-size: 13px;
    font-weight: bold;
    color: var(--mil-dark-green);
    letter-spacing: 0.5px;
}

.slot-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-green  { background: #198754; box-shadow: 0 0 6px #198754; }
.dot-yellow { background: #f39c12; box-shadow: 0 0 6px #f39c12; }
.dot-red    { background: #dc3545; box-shadow: 0 0 6px #dc3545; }
.dot-grey   { background: #6c757d; box-shadow: 0 0 6px #6c757d; }

.slot-body {
    margin-bottom: 12px;
}

.slot-weapon-name {
    font-size: 13px;
    font-weight: bold;
    color: var(--mil-text);
    margin-bottom: 3px;
}

.slot-weapon-sub {
    font-size: 11px;
    color: var(--mil-text-muted);
}

.empty-slot {
    color: #999999;
    font-style: italic;
}

.slot-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px dashed var(--mil-border);
    padding-top: 8px;
}

.badge-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.5px;
    width: fit-content;
}

.badge-green  { background: rgba(25, 135, 84, 0.12); color: #157347; }
.badge-yellow { background: rgba(243, 156, 18, 0.14); color: #b7791f; }
.badge-red    { background: rgba(220, 53, 69, 0.12); color: #b02a37; }
.badge-grey   { background: rgba(108, 117, 125, 0.12); color: #495057; }

.slot-borrower {
    font-size: 11px;
    color: #855d14;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.slot-notes {
    font-size: 10px;
    color: var(--mil-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Animasi Pulse */
.pulse {
    animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.18);
        opacity: 1;
    }
    100% {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

/* Loading & Empty State */
.denah-loading-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--mil-card-bg);
    border: 1px solid var(--mil-border);
    border-radius: 12px;
}

.denah-spinner {
    width: 38px;
    height: 38px;
    border: 4px solid rgba(25, 135, 84, 0.15);
    border-top-color: var(--mil-green-accent);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.slot-empty-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px;
    color: var(--mil-text-muted);
    font-size: 12px;
    font-style: italic;
}

/* Custom Modal */
.custom-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.custom-modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 37, 26, 0.6);
    backdrop-filter: blur(4px);
}

.modal-dialog {
    position: relative;
    background: #ffffff;
    border: 1px solid var(--mil-border);
    border-radius: 14px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    z-index: 1051;
    overflow: hidden;
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    background: #fbfdfc;
    border-bottom: 1px solid var(--mil-border);
}

.modal-kicker {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: var(--mil-green-accent);
    font-weight: bold;
}

.modal-header h3 {
    margin: 3px 0 0;
    font-size: 18px;
    color: var(--mil-dark-green);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--mil-text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    color: var(--mil-red);
}

.modal-body {
    padding: 24px;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-info-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
}

.banner-green  { background: rgba(25, 135, 84, 0.12); color: #157347; border: 1px solid rgba(25, 135, 84, 0.25); }
.banner-yellow { background: rgba(243, 156, 18, 0.14); color: #b7791f; border: 1px solid rgba(243, 156, 18, 0.25); }
.banner-red    { background: rgba(220, 53, 69, 0.12); color: #b02a37; border: 1px solid rgba(220, 53, 69, 0.25); }
.banner-grey   { background: rgba(108, 117, 125, 0.12); color: #495057; border: 1px solid rgba(108, 117, 125, 0.25); }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--mil-border);
}

/* ==========================================================================
   MODERN RESPONSIVE DASHBOARD (index.php) - TACTICAL ARMORY
   ========================================================================== */

/* ==========================================================================
   MODERN RESPONSIVE DASHBOARD (index.php) - TACTICAL ARMORY
   ========================================================================== */

/* Hero Banner Command Center */
.dashboard-hero-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 26px 30px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.dashboard-hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #0284c7, #10b981);
}

.dashboard-hero-main h1 {
    margin: 6px 0 8px 0;
    font-size: 22px;
    color: #f8fafc;
    letter-spacing: 0.8px;
    font-weight: 800;
}

.dashboard-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: #10b981;
    text-transform: uppercase;
}

.dashboard-hero-kicker .pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
    display: inline-block;
    animation: heroPulseGlow 2s infinite ease-in-out;
}

@keyframes heroPulseGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.7; }
}

.dashboard-hero-main p {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
    max-width: 640px;
    line-height: 1.5;
}

.dashboard-hero-meta {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 12px;
    min-width: 240px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dashboard-hero-meta .meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 7px;
}
.dashboard-hero-meta .meta-row:last-child {
    margin-bottom: 0;
}
.dashboard-hero-meta .meta-label {
    color: #94a3b8;
    font-size: 10.5px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.dashboard-hero-meta .meta-val {
    font-weight: 700;
    color: #f8fafc;
    font-family: var(--font-mono);
}

/* Quick Actions Ribbon */
.dashboard-quick-ribbon {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    align-items: center;
}

.dashboard-quick-ribbon .ribbon-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #475569;
    text-transform: uppercase;
    margin-right: 4px;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.quick-action-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px -1px rgba(0, 0, 0, 0.08);
}

.quick-action-btn.primary {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}
.quick-action-btn.primary:hover {
    background: #1e293b;
    border-color: #1e293b;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

/* Modern Adaptive KPI Stat Cards with Corner Watermark Icon */
.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.kpi-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #0f172a;
    transition: height 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

.kpi-card:hover::before {
    height: 4px;
}

.kpi-card.kpi-alert::before {
    background-color: #dc2626;
}
.kpi-card.kpi-alert:hover {
    border-color: #fca5a5;
    box-shadow: 0 12px 20px -3px rgba(220, 38, 38, 0.15);
}

.kpi-watermark-icon {
    position: absolute;
    right: -10px;
    bottom: -15px;
    font-size: 76px;
    opacity: 0.06;
    pointer-events: none;
    user-select: none;
    line-height: 1;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.kpi-card:hover .kpi-watermark-icon {
    transform: scale(1.1) rotate(-6deg);
    opacity: 0.12;
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.kpi-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
}

.kpi-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.kpi-card:hover .kpi-icon-badge {
    transform: scale(1.08);
}

.kpi-card.kpi-alert .kpi-icon-badge {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.kpi-value {
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 6px;
    font-family: var(--font-sans);
}

.kpi-card.kpi-alert .kpi-value {
    color: #dc2626;
}

.kpi-subtext {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
    line-height: 1.4;
}

.kpi-footer-link {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    font-size: 11.5px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.15s ease;
}

.kpi-card:hover .kpi-footer-link {
    color: #059669;
}

.kpi-card.kpi-alert .kpi-footer-link {
    color: #dc2626;
}

/* Modern Search Box */
.dashboard-search-wrap {
    background: var(--mil-card-bg);
    border: 1px solid var(--mil-border);
    border-left: 4px solid var(--mil-gold);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 14px rgba(39, 91, 59, 0.05);
}

.dashboard-search-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.dashboard-search-input-wrap {
    flex: 1;
    min-width: 240px;
    position: relative;
}

.dashboard-search-input-wrap input {
    padding-left: 36px;
}

.dashboard-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mil-text-muted);
    font-size: 14px;
}

/* Dashboard Two-Column Adaptive Grid */
.dashboard-main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
    gap: 22px;
    margin-bottom: 24px;
}

.dashboard-section-card {
    background: var(--mil-card-bg);
    border: 1px solid var(--mil-border);
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(39, 91, 59, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-section-card .card-head {
    padding: 16px 20px;
    background: linear-gradient(180deg, #ffffff, #f7faf8);
    border-bottom: 1px solid var(--mil-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.dashboard-section-card .card-head h2 {
    margin: 0;
    font-size: 14px;
    letter-spacing: 0.8px;
    color: var(--mil-dark-green);
    border-bottom: none;
    padding-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 992px) {
    .table-responsive {
        overflow-x: visible !important;
    }
}

.table-responsive table {
    margin-top: 0;
    border-top: none;
    width: 100%;
    min-width: 0;
    table-layout: auto;
}

.table-responsive th {
    font-size: 11px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #dcf2e4 0%, #ccead7 100%);
    background-color: #d1e7dd;
    color: #123824;
    padding: 8px 6px;
    vertical-align: middle;
    line-height: 1.25;
    box-sizing: border-box;
}

.table-responsive td {
    vertical-align: middle;
    padding: 6px 6px;
    box-sizing: border-box;
}

/* Sector / Location Overview Widget */
.sector-overview-card {
    background: var(--mil-card-bg);
    border: 1px solid var(--mil-border);
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(39, 91, 59, 0.06);
    margin-bottom: 24px;
    overflow: hidden;
}

.sector-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    padding: 18px 20px;
}

.sector-chip {
    background: #ffffff;
    border: 1px solid var(--mil-border);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.sector-chip:hover {
    border-color: var(--mil-green-accent);
    background: #e2f4e8;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(36, 40, 38, 0.08);
}

.sector-chip-code {
    font-family: monospace;
    font-size: 13px;
    font-weight: 800;
    background: rgba(45, 106, 79, 0.12);
    color: var(--mil-dark-green);
    padding: 6px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.sector-chip-info {
    flex: 1;
    min-width: 0;
}

.sector-chip-title {
    font-size: 12px;
    font-weight: bold;
    color: var(--mil-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sector-chip-sub {
    font-size: 11px;
    color: var(--mil-text-muted);
}

/* ==========================================================================
   SISTEM RESPENSIF HP & TABLET (MOBILE OPTIMIZATION <= 768px & <= 480px)
   ========================================================================== */

@media (max-width: 992px) {
    .dashboard-hero-card {
        padding: 20px;
    }
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Mencegah goyangan / overflow horizontal pada layar ponsel */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    .app-layout, .app-main {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* Kontainer & Kartu Layout pada Layar HP */
    .container {
        padding: 12px 10px !important;
        margin: 10px auto 20px auto !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .card {
        padding: 15px 12px !important;
        margin-bottom: 14px !important;
        border-radius: 10px !important;
        box-sizing: border-box !important;
    }

    .card h2 {
        font-size: 14.5px !important;
        letter-spacing: 0.5px !important;
        margin-bottom: 12px !important;
    }

    /* Tabel Horizontal Scroll & Touch Friendly */
    .table-responsive,
    div[style*="overflow-x: auto"] {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        position: relative;
        margin-bottom: 10px;
    }

    table {
        min-width: 580px !important;
        font-size: 11.5px !important;
    }

    th, td {
        padding: 8px 8px !important;
        font-size: 11px !important;
    }

    .weapon-barcode {
        width: 110px !important;
        height: 34px !important;
    }

    .barcode-code {
        font-size: 9px !important;
    }

    .kondisi-select {
        padding: 3px 6px !important;
        font-size: 10px !important;
    }

    /* Table Scrollbar Hint */
    .card::-webkit-scrollbar,
    .table-responsive::-webkit-scrollbar,
    div[style*="overflow-x: auto"]::-webkit-scrollbar {
        height: 5px;
    }

    .card::-webkit-scrollbar-thumb,
    .table-responsive::-webkit-scrollbar-thumb,
    div[style*="overflow-x: auto"]::-webkit-scrollbar-thumb {
        background: #52b788;
        border-radius: 4px;
    }

    .table-responsive::-webkit-scrollbar-track,
    div[style*="overflow-x: auto"]::-webkit-scrollbar-track {
        background: rgba(191, 224, 204, 0.3);
        border-radius: 4px;
    }

    /* Search & Filter Toolbar Full-Width Stack on HP */
    .search-box {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .search-box input.form-control,
    .search-box select.form-control {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        font-size: 13.5px !important;
        height: 38px !important;
    }

    .search-box .btn,
    .search-box a.btn {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        display: flex !important;
        height: 38px !important;
    }

    /* Action Toolbar (Print, Excel, Import) Full-Width Stack */
    .table-actions-toolbar {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .table-actions-toolbar .btn,
    .table-actions-toolbar a.btn {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        display: flex !important;
        padding: 10px 14px !important;
        font-size: 12px !important;
    }

    /* Pagination Mobile Stack */
    .pagination {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 10px !important;
    }

    .pagination > div {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 4px !important;
    }

    .pagination a.btn,
    .pagination span.btn {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }

    /* Form Grids Collapse to 1 Column on Mobile */
    form [style*="grid-template-columns"],
    .form-row,
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    form > button[type="submit"].btn {
        width: 100% !important;
        padding: 11px 16px !important;
        font-size: 12.5px !important;
        justify-content: center !important;
        display: flex !important;
    }

    /* Touch Friendly Inputs (Mencegah auto-zoom pada browser iOS Safari / Chrome Mobile) */
    .form-control,
    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    select.form-control,
    select {
        font-size: 16px !important; /* Standar emas: >= 16px tidak memicu auto-zoom paksa di iOS */
        padding: 9px 12px !important;
        min-height: 42px !important;
        box-sizing: border-box !important;
    }

    .btn {
        min-height: 42px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 13px !important;
        padding: 10px 16px !important;
        touch-action: manipulation;
    }

    .btn.btn-sm,
    a.btn.btn-sm,
    button.btn.btn-sm {
        min-height: 32px !important;
        padding: 6px 10px !important;
        font-size: 11px !important;
    }

    /* Barcode Scanner Modal on HP */
    .barcode-scanner {
        padding: 10px !important;
    }

    .barcode-scanner-dialog {
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px 14px !important;
        border-radius: 10px !important;
    }

    .barcode-video {
        min-height: 180px !important;
        max-height: 40vh !important;
    }

    .barcode-control {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .barcode-scan-button {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Modal Dialogs on HP Smartphone (Safe bottom sheet with internal scroll) */
    .modal-backdrop,
    div[id^="modal"] {
        padding: 10px !important;
        box-sizing: border-box !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .modal-backdrop > div,
    div[id^="modal"] > div,
    .modal-dialog {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 88vh !important;
        max-height: 88dvh !important;
        margin: auto !important;
        display: flex !important;
        flex-direction: column !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .modal-backdrop > div > div:first-child,
    div[id^="modal"] > div > div:first-child {
        flex-shrink: 0 !important;
    }

    .modal-backdrop form,
    div[id^="modal"] form,
    .modal-body {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        flex: 1 1 auto !important;
        padding: 16px 14px !important;
        max-height: calc(88vh - 54px) !important;
        max-height: calc(88dvh - 54px) !important;
    }

    /* Dashboard Komando on HP */
    .dashboard-hero-card {
        padding: 16px 14px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 14px !important;
    }

    .dashboard-hero-main h1 {
        font-size: 18px !important;
    }

    .dashboard-hero-meta {
        width: 100% !important;
        padding: 10px 14px !important;
    }

    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .kpi-card {
        padding: 14px 14px !important;
    }

    .kpi-value {
        font-size: 22px !important;
    }

    .dashboard-quick-ribbon {
        gap: 6px !important;
    }

    .quick-action-btn {
        flex: 1 1 calc(50% - 6px) !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 8px 10px !important;
        font-size: 11px !important;
    }

    .sector-overview-grid {
        grid-template-columns: 1fr !important;
        padding: 12px 14px !important;
        gap: 10px !important;
    }

    .dashboard-search-wrap {
        padding: 14px 14px !important;
    }

    .dashboard-search-form {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .dashboard-search-form .btn {
        width: 100% !important;
        text-align: center !important;
    }
}

/* Layar HP Sangat Kecil / Extra Small Mobile (Screen <= 480px) */
@media (max-width: 480px) {
    .dashboard-kpi-grid {
        grid-template-columns: 1fr !important;
    }

    .quick-action-btn {
        flex: 1 1 100% !important;
    }

    .mobile-top-bar {
        padding: 8px 10px !important;
    }

    .mobile-brand-title {
        font-size: 14px !important;
        letter-spacing: 0.8px !important;
    }

    .mobile-user-mini {
        display: none !important; /* Sembunyikan badge nama mini agar navbar ringkas dan rapi di layar sempit */
    }

    .mobile-toggler-btn {
        padding: 5px 9px !important;
        font-size: 10px !important;
    }

    .bottom-nav-label {
        font-size: 9.5px !important;
    }

    .login-container {
        margin: 16px auto !important;
        padding: 10px !important;
        max-width: 100% !important;
    }

    .login-card {
        padding: 20px 14px !important;
    }
}

