/* ============================================================
   NEXOR SUPLAY APP - Stylesheet
   Tema: Blue banking-app style (terinspirasi Livin' by Mandiri)
   ============================================================ */

:root {
    --navy: #0F1E3D;
    --navy-deep: #060A14;
    --blue: #2563EB;
    --blue-light: #3B82F6;
    --gold: #F59E0B;
    --bg: #F5F7FA;
    --card: #FFFFFF;
    --line: #E7EAF0;
    --text: #111827;
    --muted: #6B7280;
    --faint: #9CA3AF;
    --green: #16A34A;
    --teal: #0D9488;
    --purple: #7C3AED;
    --red: #DC2626;
    --gradient: linear-gradient(135deg, #1E3A8A 0%, #2563EB 100%);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { text-decoration: none; color: inherit; }

.mono { font-family: 'Courier New', monospace; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; position: relative; }

.sidebar {
    width: 230px;
    background: var(--navy);
    color: #fff;
    padding: 24px 16px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.sidebar nav { flex: 1; }
.sidebar .nav-badge {
    background: var(--red); color: #fff; font-size: 9px; font-weight: 800;
    width: 16px; height: 16px; border-radius: 999px; display: inline-flex;
    align-items: center; justify-content: center; float: right; margin-top: 2px;
}
.sidebar .sys-status {
    background: rgba(255,255,255,0.05); border-radius: 10px; padding: 9px 11px;
    display: flex; align-items: center; gap: 8px; margin-top: 10px;
}
.sidebar .sys-status .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--green); flex-shrink: 0; }
.sidebar .sys-status .t1 { font-size: 10.5px; color: #fff; font-weight: 700; display: block; }
.sidebar .sys-status .t2 { font-size: 8.5px; color: #7C8DB5; }
.sidebar .footer-note { font-size: 8.5px; color: #5A6688; margin-top: 8px; display: block; }
.sidebar .brand { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.sidebar .role-badge {
    display: inline-block; font-size: 10px; font-weight: 700;
    background: rgba(255,255,255,0.15); padding: 3px 10px; border-radius: 999px;
    margin-bottom: 24px;
}
.role-badge-super_admin { background: #7F1D1D !important; color: #fff !important; }
.role-badge-admin_yayasan { background: #0D9488 !important; color: #fff !important; }
.role-badge-admin_mitra { background: #2563EB !important; color: #fff !important; }
.role-badge-admin_gudang { background: #EA580C !important; color: #fff !important; }
.role-badge-admin_persiapan { background: #16A34A !important; color: #fff !important; }
.role-badge-suplier { background: #7C3AED !important; color: #fff !important; }
.role-badge-ahli_gizi { background: #059669 !important; color: #fff !important; }
.role-badge-akuntan { background: #B45309 !important; color: #fff !important; }
.sidebar nav a {
    display: block; padding: 10px 12px; border-radius: 8px;
    font-size: 13.5px; font-weight: 600; color: #D6E2FF; margin-bottom: 4px;
}
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,0.15); color: #fff; }
.sidebar nav summary::-webkit-details-marker { display: none; }
.sidebar nav summary:hover { background: rgba(255,255,255,0.08); }

.main-content { flex: 1; padding: 28px 32px; min-width: 0; }

.topbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.topbar h1 { font-size: 20px; margin: 0; color: var(--navy); }
.topbar .subtitle { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Mobile hamburger + drawer sidebar ---------- */
.hamburger-btn {
    display: none;
    width: 38px; height: 38px; border-radius: 10px;
    background: #fff; border: 1px solid var(--line);
    align-items: center; justify-content: center;
    font-size: 18px; cursor: pointer; flex-shrink: 0;
}
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0; background: rgba(8,20,45,0.45); z-index: 40;
}
.mobile-topbar {
    display: none;
    align-items: center; gap: 12px;
    padding: 14px 16px; background: var(--card); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.mobile-topbar .brand-mini { font-weight: 800; color: var(--navy); font-size: 15px; }

/* ---------- Cards ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
}
.card-hero {
    background: var(--gradient);
    color: #fff;
    border-radius: 16px;
    padding: 20px;
}

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.kpi-card .kpi-value { font-size: 20px; font-weight: 800; color: var(--navy); font-family: monospace; }
.kpi-card .kpi-label { font-size: 11px; color: var(--text); margin-top: 2px; }
.kpi-card .kpi-sub { font-size: 9.5px; color: var(--faint); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.form-control {
    width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
    font-size: 13px; background: var(--bg);
}
.form-control:focus { outline: none; border-color: var(--blue); background: #fff; }

.btn {
    display: inline-flex; align-items: center; gap: 6px; justify-content: center;
    padding: 10px 18px; border-radius: 8px; font-size: 13px; font-weight: 700;
    border: none; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--gradient); color: #fff; }
.btn-success { background: #E8F7EF; color: var(--green); }
.btn-danger { background: #FDECEA; color: var(--red); }
.btn-outline { background: #fff; border: 1px solid var(--navy); color: var(--navy); }
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Tables ---------- */
table.report-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.report-table th {
    text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line);
    color: var(--muted); font-weight: 700; background: var(--bg);
}
table.report-table td { padding: 9px 8px; border-bottom: 1px solid var(--bg); }
table.report-table tr:hover td { background: #FAFBFF; }
.sort-link { color: var(--muted); font-weight: 700; }
.sort-link:hover { color: var(--navy); }
.text-right { text-align: right; }
.text-center { text-align: center; }

.badge { font-size: 9.5px; padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.badge-pending { background: #FEF6E6; color: #8A5B00; }
.badge-approved { background: #E8F7EF; color: var(--green); }
.badge-rejected { background: #FDECEA; color: var(--red); }
.badge-nexora { background: #FBEFDC; color: #96631E; }
.badge-umkm { background: #E9EFEA; color: #2F6E5C; }

/* ---------- Invoice print ---------- */
.invoice-box {
    max-width: 620px; margin: 24px auto; background: #fff; padding: 40px;
    border-radius: 4px; box-shadow: 0 4px 20px rgba(11,46,99,0.12);
}
.invoice-box .invoice-header {
    display: flex; justify-content: space-between; border-bottom: 2px solid var(--navy);
    padding-bottom: 16px; margin-bottom: 16px;
}
.invoice-box .billing-block { display: flex; justify-content: space-between; margin-bottom: 16px; }
.invoice-logo { max-height: 52px; max-width: 90px; object-fit: contain; }

/* Template Klasik (default) — pakai warna brand sebagai garis aksen */
.tpl-klasik .invoice-header { border-bottom-color: var(--brand, var(--navy)) !important; }

/* Template Modern — header berwarna, tabel selang-seling */
.tpl-modern .invoice-header { background: var(--brand, var(--navy)); color: #fff; margin: -40px -40px 20px -40px; padding: 24px 40px; border-bottom: none; border-radius: 4px 4px 0 0; }
.tpl-modern .invoice-header div[style*="color:var(--navy)"] { color: #fff !important; }
.tpl-modern .invoice-header div[style*="color:var(--muted)"] { color: rgba(255,255,255,0.75) !important; }
.tpl-modern .invoice-logo { border-radius: 8px; background: #fff; padding: 4px; }
.tpl-modern .report-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--brand, var(--blue)) 8%, white); }
.tpl-modern .report-table thead th { background: var(--brand, var(--blue)); color: #fff; }

/* Template Minimalis — banyak whitespace, garis halus, aksen tipis dari warna brand */
.tpl-minimalis { padding: 56px 48px; }
.tpl-minimalis .invoice-header { border-bottom: none !important; padding-bottom: 0; margin-bottom: 36px; }
.tpl-minimalis .invoice-header div[style*="font-size:17px"] { font-weight: 400 !important; letter-spacing: 1px; text-transform: uppercase; font-size: 14px !important; }
.tpl-minimalis .billing-block { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; margin-bottom: 28px !important; }
.tpl-minimalis .report-table { border-collapse: collapse; }
.tpl-minimalis .report-table th, .tpl-minimalis .report-table td { border: none; border-bottom: 1px solid var(--line); padding: 12px 8px; }
.tpl-minimalis .report-table thead th { background: transparent; color: var(--faint); font-weight: 600; text-transform: uppercase; font-size: 9.5px; letter-spacing: 1px; border-bottom: 2px solid var(--brand, var(--navy)); }
.tpl-minimalis .invoice-logo { max-height: 36px; filter: grayscale(1); opacity: 0.85; }
.tpl-minimalis div[style*="border-top:2px solid var(--navy)"] { border-top: 1px solid var(--brand, var(--navy)) !important; font-weight: 400 !important; letter-spacing: 0.5px; }

/* Template Estetik — gradient lembut (dari warna brand), elemen dekoratif, gaya branding */
.tpl-estetik { border-top: 4px solid transparent; border-image: linear-gradient(90deg, var(--brand, #7C3AED), #2563EB, #22D3EE) 1; }
.tpl-estetik .invoice-header { background: linear-gradient(135deg, color-mix(in srgb, var(--brand, #7C3AED) 12%, white), color-mix(in srgb, var(--brand, #2563EB) 6%, white)); margin: -40px -40px 20px -40px; padding: 28px 40px; border-radius: 4px 4px 0 0; border-bottom: none; }
.tpl-estetik .invoice-logo { border-radius: 50%; box-shadow: 0 2px 10px rgba(124,58,237,0.2); }
.tpl-estetik .invoice-header div[style*="font-size:17px"] { font-family: 'Georgia', serif; font-style: italic; }
.tpl-estetik .report-table thead th { background: linear-gradient(90deg,#EDE9FE,#DBEAFE); }

/* Ukuran & margin kertas saat cetak invoice — FULL BLEED (mepet ke tepi kertas) */
@page { size: A4; margin: 0; }

@media print {
    .no-print { display: none !important; }
    /* Hilangkan shell aplikasi supaya invoice memenuhi seluruh kertas */
    html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
    .app-shell { display: block !important; }
    .sidebar, .mobile-topbar, .sidebar-overlay, .hamburger-btn { display: none !important; }
    .main-content { padding: 0 !important; margin: 0 !important; width: 100% !important; flex: none !important; }
    /* Invoice memenuhi kertas hingga ke tepi. Padding dalam dikecilkan supaya konten lebih penuh;
       margin negatif header disesuaikan agar header berwarna tetap bleed ke tepi kertas. */
    .invoice-box {
        box-shadow: none !important; margin: 0 !important;
        max-width: 100% !important; width: 100% !important; border-radius: 0 !important;
        padding: 26px 30px !important;
    }
    .tpl-modern .invoice-header, .tpl-estetik .invoice-header {
        margin: -26px -30px 18px -30px !important;
    }
    .tpl-minimalis { padding: 30px !important; }
    body { background: #fff; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
}

/* ============================================================
   SUPPLY CHAIN OS THEME — komponen baru untuk Ringkasan & fitur baru
   ============================================================ */
.sc-eyebrow { font-size: 10.5px; letter-spacing: 1.5px; color: var(--blue); font-weight: 700; font-family: 'IBM Plex Mono', monospace; display: block; margin-bottom: 4px; }

.sc-kpi-row { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.sc-kpi-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 1; min-width: 220px; }
.sc-kpi-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px; }
.sc-kpi-label { font-size: 11.5px; color: var(--muted); display: block; }
.sc-kpi-value { font-size: 21px; font-weight: 800; color: var(--text); display: block; margin-top: 2px; font-family: 'IBM Plex Mono', monospace; }
.sc-kpi-delta { font-size: 10.5px; color: var(--green); display: flex; align-items: center; gap: 3px; margin-top: 2px; }

.sc-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 18px; }
.sc-panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.sc-panel-title { font-size: 14px; font-weight: 800; color: var(--text); }
.sc-panel-sub { font-size: 11px; color: var(--muted); display: block; }
.sc-panel-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.sc-period-btn { font-size: 10.5px; font-weight: 700; padding: 5px 10px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; }
.sc-period-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.sc-link { font-size: 11px; color: var(--blue); font-weight: 700; display: flex; align-items: center; gap: 4px; }

.sc-pipeline { display: flex; justify-content: space-between; margin: 16px 0; flex-wrap: wrap; gap: 12px; position: relative; }
.sc-pipeline-step { display: flex; align-items: center; gap: 8px; }
.sc-pipeline-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sc-pipeline-n { font-size: 15px; font-weight: 800; font-family: 'IBM Plex Mono', monospace; }
.sc-pipeline-l { font-size: 9.5px; color: var(--muted); display: block; }

.sc-pipeline-anim { position: relative; margin: 24px 0 16px; padding: 0 6px; }
.sc-pipeline-track { position: relative; display: flex; justify-content: space-between; }
.sc-pipeline-line {
    position: absolute; top: 26px; left: 30px; right: 30px; height: 4px; border-radius: 999px; z-index: 0;
    background: linear-gradient(90deg, var(--bg) 0%, var(--bg) 42%, #60A5FA 50%, var(--bg) 58%, var(--bg) 100%);
    background-size: 220% 100%;
    animation: sc-flow 2.4s linear infinite;
}
@keyframes sc-flow { 0% { background-position: 130% 0; } 100% { background-position: -30% 0; } }

.sc-pstage { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; width: 74px; }
.sc-pstage .sc-pipeline-icon { width: 44px; height: 44px; border-radius: 50%; margin-bottom: 6px; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.06); background: var(--bg) !important; }
.sc-pstage.active .sc-pipeline-icon { background: #2563EB !important; animation: sc-ring-pulse 1.6s infinite; }
@keyframes sc-ring-pulse { 0% { box-shadow: 0 0 0 0 rgba(37,99,235,0.35), 0 2px 8px rgba(0,0,0,0.06); } 70% { box-shadow: 0 0 0 9px rgba(37,99,235,0), 0 2px 8px rgba(0,0,0,0.06); } 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0), 0 2px 8px rgba(0,0,0,0.06); } }
.sc-pstage.pending .sc-pipeline-icon { background: var(--bg) !important; }
.sc-pstage .sc-pipeline-n { color: var(--navy); }
.sc-pstage.pending .sc-pipeline-n { color: var(--faint); }
.sc-pstage.active .sc-pipeline-l { color: #2563EB; font-weight: 700; }
.sc-live-badge { font-size: 9.5px; font-weight: 700; color: var(--green); background: #DCFCE7; padding: 3px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; }
.sc-live-dot { width: 5px; height: 5px; border-radius: 999px; background: var(--green); display: inline-block; }

.sc-alert-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--bg); }
.sc-alert-item:last-child { border-bottom: none; }
.sc-alert-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sc-alert-title { font-size: 11.5px; font-weight: 700; display: block; }
.sc-alert-desc { font-size: 10px; color: var(--muted); }

.sc-badge { font-size: 9.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.sc-badge-kritis { background: #FEE2E2; color: var(--red); }
.sc-badge-tindakan { background: #FEF3C7; color: #92400E; }
.sc-badge-info { background: #DBEAFE; color: var(--blue); }
.sc-badge-baik { background: #DCFCE7; color: var(--green); }
.sc-badge-sangatbaik { background: #D1FAE5; color: #065F46; }
.sc-badge-aman { background: #DCFCE7; color: var(--green); }
.sc-badge-menipis { background: #FEF3C7; color: #92400E; }

.sc-donut-legend { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.sc-dot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; }

.sc-supplier-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }

.sc-cta { background: var(--gradient); border-radius: 16px; padding: 22px; color: #fff; }
.sc-cta-eyebrow { font-size: 9.5px; letter-spacing: 1.5px; color: #93C5FD; font-family: 'IBM Plex Mono', monospace; display: block; margin-bottom: 8px; }
.sc-cta-title { font-size: 17px; font-weight: 800; display: block; margin-bottom: 8px; line-height: 1.3; }
.sc-cta-desc { font-size: 11px; color: #BFDBFE; display: block; margin-bottom: 18px; }
.sc-cta-btn { background: #fff; color: var(--blue); font-size: 11.5px; font-weight: 800; padding: 9px 16px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 768px) {
    .sc-grid-2 { grid-template-columns: 1fr; }
    .sc-kpi-row { flex-direction: column; }
    .sc-pipeline { overflow-x: auto; flex-wrap: nowrap; }
}

.alert { padding: 12px 16px; border-radius: 8px; font-size: 12.5px; margin-bottom: 16px; }
.alert-info { background: #EAF0FB; border: 1px solid var(--line); color: var(--muted); }
.alert-warning { background: #FEF6E6; border: 1px solid #FCE4B0; color: #8A5B00; }
.alert-danger { background: #FDECEA; color: var(--red); }

/* Wrapper otomatis untuk tabel supaya bisa di-scroll horizontal di layar sempit
   (dipasang otomatis lewat JS di footer.php, tidak perlu ubah tiap halaman) */
.table-scroll-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 1024px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .sidebar { width: 200px; }
    .main-content { padding: 22px 20px; }
}

@media (max-width: 768px) {
    .sc-grid-2 { grid-template-columns: 1fr; }
    .sc-kpi-row { flex-direction: column; }
    .sc-pipeline { overflow-x: auto; flex-wrap: nowrap; }

    .hamburger-btn { display: flex; }
    .mobile-topbar { display: flex; }
    #sidebarCloseBtn { display: flex !important; }

    .app-shell { display: block; }

    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 250px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 50;
        overflow-y: auto;
    }
    .sidebar.sidebar-open { transform: translateX(0); }
    .sidebar-overlay.active { display: block; }

    /* Sidebar berkelompok: hemat ruang drawer di HP */
    .sidebar .sys-status { display: none; }
    .sidebar .footer-note { display: none; }

    .main-content { padding: 16px; width: 100%; }

    .topbar { flex-direction: column; align-items: flex-start; }
    .topbar > a, .topbar > div:last-child { width: 100%; }
    .topbar .btn { width: 100%; justify-content: center; }

    .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
    .kpi-card { padding: 12px; }
    .kpi-card .kpi-value { font-size: 16px; }

    /* Grid dua kolom custom (dashboard suplier, laporan, dll) jadi 1 kolom */
    [style*="grid-template-columns:repeat(3,1fr)"],
    [style*="grid-template-columns: repeat(3,1fr)"],
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Form & tombol lebih besar untuk disentuh jari */
    .form-control { padding: 11px 12px; font-size: 14px; }
    .btn { padding: 12px 16px; font-size: 13px; width: auto; }
    .btn-block, form > .btn { width: 100%; }

    table.report-table { font-size: 12px; min-width: 560px; }

    .invoice-box { padding: 20px !important; margin: 12px auto; }

    /* Layout dua kolom (form + tabel) di master data / surat teguran jadi 1 kolom */
    div[style*="display:flex"][style*="align-items:flex-start"] {
        flex-direction: column !important;
    }
    div[style*="display:flex"][style*="align-items:flex-start"] > * {
        width: 100% !important;
        flex-shrink: 1 !important;
    }
}

@media (max-width: 420px) {
    .kpi-grid { grid-template-columns: 1fr !important; }
    .sidebar { width: 85%; }
}

@media print {
    .sidebar, .hamburger-btn, .mobile-topbar, .sidebar-overlay { display: none !important; }
    .nx-searchbar, .nx-tabs, .nx-viewtoggle { display: none !important; }
}

/* ============ Komponen enhancement global (nx-*) ============ */
/* Ikon di kepala halaman */
.nx-page-icon { display: inline-block; margin-right: 8px; font-size: 20px; line-height: 1; vertical-align: -2px; }

/* Search box otomatis di atas tabel */
.nx-searchbar { margin-bottom: 12px; }
.nx-search-input { width: 100%; max-width: 340px; }

/* Tab filter generik */
.nx-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.nx-tab {
    display: inline-flex; align-items: center; gap: 7px;
    background: #fff; border: 1px solid var(--line); color: var(--muted);
    font-size: 12px; font-weight: 700; padding: 8px 14px; border-radius: 999px;
    cursor: pointer; transition: all 0.15s ease; font-family: inherit; text-decoration: none;
}
.nx-tab:hover { border-color: var(--navy); color: var(--navy); }
.nx-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.nx-tab .nx-tab-count {
    font-size: 10.5px; font-weight: 800; padding: 1px 8px; border-radius: 999px;
    background: var(--bg); color: var(--navy); font-family: 'IBM Plex Mono', monospace;
}
.nx-tab.active .nx-tab-count { background: rgba(255,255,255,0.25); color: #fff; }

/* Pesan "tidak ada hasil" */
.nx-noresult { padding: 16px 8px; color: var(--muted); font-size: 12.5px; font-style: italic; }

/* Toggle tampilan Card / List */
.nx-viewtoggle { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.nx-viewtoggle button {
    background: #fff; border: none; color: var(--muted); font-size: 11.5px; font-weight: 700;
    padding: 7px 14px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 6px;
}
.nx-viewtoggle button + button { border-left: 1px solid var(--line); }
.nx-viewtoggle button.active { background: var(--navy); color: #fff; }

