/* ═══════════════════════════════════════════════════════════════
   ILSO PLATFORM — Design System v2.0
   PT. Kleenviro Dinamika Utama
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Variables ──────────────────────────────────────────────── */
:root {
    /* Brand */
    --navy-950: #060f1e;
    --navy-900: #0c1a2e;
    --navy-800: #0f2444;
    --navy-700: #163358;
    --navy-600: #1e4678;
    --navy-500: #2558a0;

    /* Accent */
    --blue:    #2563eb;
    --blue-lt: #eff6ff;
    --green:   #16a34a;
    --green-lt:#f0fdf4;
    --amber:   #d97706;
    --amber-lt:#fffbeb;
    --red:     #dc2626;
    --red-lt:  #fef2f2;
    --purple:  #7c3aed;
    --purple-lt:#f5f3ff;
    --teal:    #0891b2;
    --teal-lt: #ecfeff;
    --pink:    #db2777;
    --pink-lt: #fdf2f8;

    /* Surface */
    --page-bg:   #f0f4f9;
    --card-bg:   #ffffff;
    --sidebar-bg: linear-gradient(175deg, #0c1a2e 0%, #0f2444 60%, #163358 100%);

    /* Text */
    --text:       #0f172a;
    --text-2:     #334155;
    --text-muted: #64748b;
    --text-faint: #94a3b8;

    /* Border */
    --border:     #e2e8f0;
    --border-md:  #cbd5e1;

    /* Radius */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 18px;

    /* Shadow */
    --shadow-xs: 0 1px 3px rgba(15,23,42,.06);
    --shadow-sm: 0 2px 8px rgba(15,23,42,.08);
    --shadow-md: 0 4px 16px rgba(15,23,42,.10);
    --shadow-lg: 0 8px 32px rgba(15,23,42,.14);

    /* Legacy compat */
    --blue-accent: #2563eb;
    --green-accent: #16a34a;
    --orange-accent: #d97706;
    --red-accent: #dc2626;
    --purple-accent: #7c3aed;
    --teal-accent: #0891b2;
    --bg-page: #f0f4f9;
    --card-bg: #ffffff;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border-soft: #e2e8f0;
    --radius-lg: 14px;
    --radius-md: 10px;
    --shadow-card: 0 2px 8px rgba(15,23,42,.08);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--page-bg);
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
}

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

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: #c8d8f0;
    padding: 0 10px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,.04);
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 20px 8px 18px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    margin-bottom: 6px;
    flex-shrink: 0;
}

.brand-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    flex-shrink: 0;
    overflow: hidden;
    padding: 3px;
}
.brand-icon img { width: 100%; height: 100%; object-fit: contain; }

.brand-title {
    font-size: 14px; font-weight: 800;
    color: #fff; line-height: 1.2;
    letter-spacing: -.01em;
}
.brand-sub {
    font-size: 10.5px; color: #7e9abf;
    font-weight: 500; margin-top: 1px;
}

/* Nav */
.nav-group { margin-top: 14px; }

.nav-group-label {
    font-size: 9.5px; font-weight: 800;
    letter-spacing: .09em;
    color: #4a6a96;
    padding: 0 12px 6px;
    text-transform: uppercase;
}

.nav-item {
    display: flex; align-items: center; gap: 9px;
    padding: 8.5px 12px;
    border-radius: var(--r-md);
    font-size: 12.8px; font-weight: 500;
    color: #9ab8d8;
    margin-bottom: 1px;
    transition: background .15s, color .15s;
    cursor: pointer;
}
.nav-item .nav-ic {
    width: 18px; text-align: center;
    font-size: 13.5px; flex-shrink: 0;
}
.nav-item:hover {
    background: rgba(255,255,255,.07);
    color: #e8f0fb;
}
.nav-item.active {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(37,99,235,.4);
}

/* ── Main ───────────────────────────────────────────────────── */
.main {
    flex: 1; min-width: 0;
    padding: 0 24px 48px;
    background: var(--page-bg);
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
    background: linear-gradient(100deg, var(--navy-900) 0%, var(--navy-700) 100%);
    border-radius: 0 0 var(--r-xl) var(--r-xl);
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 4px 24px rgba(12,26,46,.3);
}

.topbar::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0 0 var(--r-xl) var(--r-xl);
    background: linear-gradient(180deg, rgba(255,255,255,.04) 0%, transparent 100%);
    pointer-events: none;
}

.topbar-title {
    display: flex; align-items: center; gap: 11px;
    font-size: 16px; font-weight: 800;
    letter-spacing: -.01em;
}
.topbar-title .ic-badge {
    width: 32px; height: 32px; border-radius: 9px;
    background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.topbar-sub {
    font-size: 11.5px; color: #a8c0e0;
    font-weight: 400; margin-top: 2px;
}
.topbar-controls {
    display: flex; gap: 8px; align-items: center;
}
.topbar-controls select {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--r-md);
    padding: 7px 12px;
    font-size: 12px; font-weight: 600; color: #fff;
    backdrop-filter: blur(4px);
}
.topbar-controls select option { background: #0f2444; }

/* ── Stat cards ─────────────────────────────────────────────── */
.grid { display: grid; gap: 14px; }
.stat-cards {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    margin-bottom: 20px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    border: 1px solid var(--border);
}

.stat-card {
    position: relative; overflow: hidden;
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: var(--accent-color, var(--blue));
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.stat-icon {
    width: 40px; height: 40px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    margin-bottom: 14px;
}
.stat-label {
    font-size: 10.5px; letter-spacing: .05em;
    color: var(--text-muted); font-weight: 700;
    margin-bottom: 4px; text-transform: uppercase;
}
.stat-value {
    font-size: 28px; font-weight: 900;
    line-height: 1; letter-spacing: -.02em;
    color: var(--text);
}
.stat-unit {
    font-size: 12px; font-weight: 600;
    color: var(--text-muted); margin-left: 3px;
}
.stat-caption {
    font-size: 11px; color: var(--text-muted); margin-top: 5px;
}

/* ── Alert strip ────────────────────────────────────────────── */
.alert-strip {
    background: linear-gradient(135deg, #f8fbff, #eef4ff);
    border: 1px solid #dde8fa;
    border-radius: var(--r-xl);
    padding: 18px 22px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-xs);
}
@media(max-width:900px) { .alert-strip { grid-template-columns: repeat(2,1fr); } }

.alert-item { display: flex; gap: 12px; align-items: flex-start; }
.alert-ic {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
.alert-title { font-size: 10.5px; font-weight: 800; color: var(--text-muted); letter-spacing: .04em; text-transform: uppercase; }
.alert-value { font-size: 20px; font-weight: 900; color: var(--text); }
.alert-caption { font-size: 10.5px; color: var(--text-muted); }

/* ── Section ─────────────────────────────────────────────────── */
.section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 800;
    color: var(--navy-900); margin-bottom: 14px;
}
.two-col {
    display: grid; grid-template-columns: 2.1fr 1fr;
    gap: 16px; margin-bottom: 18px;
}
.three-col {
    display: grid; grid-template-columns: 1fr 1fr .9fr;
    gap: 16px; margin-bottom: 18px;
}
@media(max-width:980px) { .two-col, .three-col { grid-template-columns: 1fr; } }

/* ── Rank rows ─────────────────────────────────────────────── */
.rank-row {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 6px; border-bottom: 1px solid var(--border);
}
.rank-row:last-child { border-bottom: none; }
.rank-badge {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.rank-name { font-size: 13px; font-weight: 700; }
.rank-score { margin-left: auto; font-size: 15px; font-weight: 900; color: var(--navy-900); }
.rank-score-label { font-size: 10px; color: var(--text-muted); }

/* ── Simple table ───────────────────────────────────────────── */
table.simple-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.simple-table th {
    text-align: left; padding: 8px 8px;
    color: var(--text-muted); font-weight: 700;
    border-bottom: 2px solid var(--border);
    font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
}
table.simple-table td { padding: 8px 8px; border-bottom: 1px solid var(--border); }
table.simple-table tr:last-child td { border-bottom: none; }
.table-title { font-weight: 800; font-size: 13px; margin-bottom: 12px; color: var(--text); }

/* ── Page toolbar ───────────────────────────────────────────── */
.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 10px; flex-wrap: wrap;
}

.search-box {
    position: relative;
}
.search-box::before {
    content: '🔍';
    position: absolute; left: 10px; top: 50%;
    transform: translateY(-50%);
    font-size: 12px; opacity: .5; pointer-events: none;
}
.search-box input {
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    padding: 8px 12px 8px 32px;
    font-size: 12.5px; width: 250px;
    background: var(--card-bg);
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-add {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff; border: none;
    padding: 8.5px 16px;
    border-radius: var(--r-md);
    font-size: 12.5px; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37,99,235,.35);
    transition: opacity .15s, transform .1s, box-shadow .15s;
    white-space: nowrap;
}
.btn-add:hover {
    opacity: .92;
    box-shadow: 0 4px 14px rgba(37,99,235,.45);
    transform: translateY(-1px);
}
.btn-add:active { transform: scale(.97); }

.btn-cancel {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--page-bg); color: var(--text-2);
    border: 1.5px solid var(--border);
    padding: 8.5px 16px;
    border-radius: var(--r-md);
    font-size: 12.5px; font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-cancel:hover { background: var(--border); }

.btn-primary {
    background: var(--navy-800);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff; padding: 8px 16px;
    border-radius: var(--r-md);
    font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.btn-primary:hover { background: var(--navy-700); }

.btn-sm {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 9px; border-radius: 6px;
    font-size: 11.5px; font-weight: 600;
    cursor: pointer; border: none;
    transition: opacity .12s;
}
.btn-sm:hover { opacity: .82; }

/* ── Data table wrapper ─────────────────────────────────────── */
.data-table-wrap {
    background: var(--card-bg);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

table.data-table, table.mu-table, table.stk-table,
table.pend-table, table.laporan-table, table.po-table,
table.kn-table {
    width: 100%; border-collapse: collapse;
    font-size: 12.5px;
}

table.data-table th, table.mu-table th, table.stk-table th,
table.pend-table th, table.laporan-table th, table.po-table th,
table.kn-table th {
    text-align: left;
    padding: 11px 12px;
    background: var(--navy-900);
    color: rgba(255,255,255,.85);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: none;
    position: sticky; top: 0; z-index: 10;
}

table.data-table td, table.mu-table td, table.stk-table td,
table.pend-table td, table.laporan-table td, table.po-table td,
table.kn-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: var(--text-2);
}

table.data-table tbody tr:last-child td,
table.mu-table tbody tr:last-child td,
table.stk-table tbody tr:last-child td {
    border-bottom: none;
}

table.data-table tbody tr:hover td,
table.mu-table tbody tr:hover td,
table.stk-table tbody tr:hover td,
table.pend-table tbody tr:hover td {
    background: #f8fafc;
}

table.data-table tbody tr:nth-child(even) td,
table.mu-table tbody tr:nth-child(even) td {
    background: #fafbfd;
}
table.data-table tbody tr:nth-child(even):hover td,
table.mu-table tbody tr:nth-child(even):hover td {
    background: #f1f5fb;
}

/* Row states */
table.data-table tr.row-nonaktif td { background: #fff5f5 !important; opacity: .7; }
table.data-table tr.row-duplicate td { background: #fffbeb !important; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px; font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
}
.badge-green   { background: #dcfce7; color: #15803d; }
.badge-orange  { background: #fef3c7; color: #b45309; }
.badge-red     { background: #fee2e2; color: #b91c1c; }
.badge-blue    { background: #dbeafe; color: #1e40af; }
.badge-grey    { background: #f1f5f9; color: #475569; }
.badge-purple  { background: #ede9fe; color: #6d28d9; }
.badge-teal    { background: #ccfbf1; color: #0f766e; }
.badge-pink    { background: #fce7f3; color: #9d174d; }
.badge-indigo  { background: #e0e7ff; color: #3730a3; }
.badge-navy    { background: #dbeafe; color: #1e3a8a; }

/* ── Row actions ─────────────────────────────────────────────── */
.row-actions { white-space: nowrap; }
.row-actions a, .row-actions button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 7px;
    font-size: 12px; margin-right: 3px;
    border: none; cursor: pointer;
    transition: transform .1s;
}
.row-actions a:hover, .row-actions button:hover { transform: scale(1.1); }
.row-actions .edit-link, .edit-btn { background: #dbeafe; color: #1e40af; }
.row-actions .del-link,  .del-btn  { background: #fee2e2; color: #b91c1c; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(8,16,30,.55);
    backdrop-filter: blur(3px);
    align-items: flex-start; justify-content: center;
    z-index: 999; padding: 24px 16px; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }

.modal-box {
    background: var(--card-bg);
    border-radius: var(--r-xl);
    width: 100%; max-width: 500px;
    padding: 0;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    position: relative; margin: auto; flex-shrink: 0;
    box-shadow: 0 20px 60px rgba(8,16,30,.25);
    border: 1px solid var(--border);
}
.modal-box.modal-wide { max-width: 680px; }

.modal-box h3 {
    margin: 0; padding: 18px 22px 14px;
    font-size: 15px; font-weight: 800;
    color: var(--navy-900);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0;
    background: var(--card-bg); z-index: 1;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.modal-box > form { padding: 18px 22px; }

.form-row { margin-bottom: 14px; }
.form-row label {
    display: block; font-size: 11.5px; font-weight: 700;
    color: var(--text-muted); margin-bottom: 5px;
    text-transform: uppercase; letter-spacing: .03em;
}
.form-row input, .form-row select, .form-row textarea,
.frm-inp, .finp {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    font-size: 13px; color: var(--text);
    background: var(--card-bg);
    transition: border-color .15s, box-shadow .15s;
}
.form-row input:focus, .form-row select:focus,
.frm-inp:focus, .finp:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-row input:read-only, .form-row input[readonly] {
    background: #f8fafc; color: var(--text-muted);
}

.form-grid-2, .g2 {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media(max-width:560px) { .form-grid-2, .g2 { grid-template-columns: 1fr; } }

.modal-actions {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 22px 18px;
    border-top: 1px solid var(--border);
    background: #fafbfc;
    border-radius: 0 0 var(--r-xl) var(--r-xl);
    position: sticky; bottom: 0;
}

/* ── Flash message ──────────────────────────────────────────── */
.flash-msg {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    border-radius: var(--r-lg);
    font-size: 13px; font-weight: 600;
    margin-bottom: 18px;
    background: var(--green-lt);
    color: #15803d;
    border: 1px solid #bbf7d0;
    box-shadow: var(--shadow-xs);
}
.flash-msg.flash-warn {
    background: var(--amber-lt); color: #92400e;
    border-color: #fde68a;
}

/* ── Summary pills ──────────────────────────────────────────── */
.summary-inline {
    display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.summary-pill {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 13px 18px;
    box-shadow: var(--shadow-xs);
    min-width: 140px;
    position: relative; overflow: hidden;
    transition: transform .15s;
}
.summary-pill:hover { transform: translateY(-1px); }
.summary-pill::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--pill-color, var(--blue));
    border-radius: 3px 0 0 3px;
}
.summary-pill .lbl {
    font-size: 10.5px; color: var(--text-muted);
    font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.summary-pill .val {
    font-size: 22px; font-weight: 900; margin-top: 3px;
    color: var(--pill-color, var(--text));
    letter-spacing: -.02em;
}

/* ── Stok tabs ──────────────────────────────────────────────── */
.stok-tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    margin-bottom: 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 5px;
    box-shadow: var(--shadow-xs);
}
.stok-tab {
    padding: 7px 16px; border-radius: var(--r-md);
    font-size: 12.5px; font-weight: 600;
    border: none; background: transparent;
    color: var(--text-muted); cursor: pointer;
    transition: background .15s, color .15s;
}
.stok-tab.active {
    background: var(--navy-900); color: #fff;
    box-shadow: var(--shadow-xs);
}
.stok-tab:not(.active):hover { background: var(--page-bg); color: var(--text); }

/* Sisa stok colors */
.sisa-ok   { color: var(--green); font-weight: 800; }
.sisa-warn { color: var(--amber); font-weight: 800; }
.sisa-low  { color: var(--red); font-weight: 800; }

/* ── Followup ───────────────────────────────────────────────── */
.followup-section { margin-bottom: 28px; }
.followup-section-head {
    display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px;
}
.followup-section-icon { font-size: 22px; line-height: 1; }
.followup-section-title {
    font-weight: 800; font-size: 15px; color: var(--text);
    display: flex; align-items: center; gap: 10px;
}
.followup-section-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Legend ─────────────────────────────────────────────────── */
.legend-dot {
    display: inline-block; width: 9px; height: 9px;
    border-radius: 50%; margin-right: 6px; vertical-align: middle;
}
.legend-row {
    display: flex; align-items: flex-start;
    gap: 6px; margin-bottom: 10px; font-size: 12px;
}
.legend-text b { display: block; font-size: 12.5px; }

/* ── Misc ───────────────────────────────────────────────────── */
.footer-note {
    text-align: center; font-size: 11px;
    color: var(--text-muted); padding: 16px 0 4px;
}

.donut-mini { display: flex; justify-content: center; margin: 8px 0 6px; }

code {
    background: #f1f5f9; color: var(--text-2);
    padding: 1px 6px; border-radius: 4px;
    font-size: 11.5px; font-family: 'SF Mono', 'Cascadia Code', monospace;
}

/* ── Sticky table headers ───────────────────────────────────── */
.stk-table thead th, .po-table thead th,
.pend-table thead th, .laporan-table thead th,
.mu-table thead th, .kn-table thead th {
    position: sticky; top: 0; z-index: 10;
}

/* ── Import/Export dropdown ─────────────────────────────────── */
[id^="impexp-"] button {
    font-size: 12px; font-weight: 700;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Responsive ─────────────────────────────────────────────── */
@media(max-width:768px) {
    .sidebar { display: none; }
    .main { padding: 0 12px 32px; }
    .search-box input { width: 100%; }
    .stat-cards { grid-template-columns: repeat(2,1fr); }
}

/* ── Toggle switch ──────────────────────────────────────────── */
.sw { position:relative; display:inline-block; width:40px; height:22px; }
.sw input { opacity:0; width:0; height:0; }
.sw-slider { position:absolute; cursor:pointer; inset:0; background:#e2e8f0; border-radius:22px; transition:.2s; }
.sw-slider:before { position:absolute; content:''; height:16px; width:16px; left:3px; bottom:3px; background:#fff; border-radius:50%; transition:.2s; }
.sw input:checked + .sw-slider { background:#16a34a; }
.sw input:disabled + .sw-slider { opacity:.4; cursor:not-allowed; }
.sw input:checked + .sw-slider:before { transform:translateX(18px); }
.sw.edit-sw input:checked + .sw-slider { background:#2563eb; }

/* ── View-only banner ───────────────────────────────────────── */
.view-only-banner {
    background: linear-gradient(90deg,#6d28d9,#7c3aed);
    color: #fff; text-align: center;
    padding: 8px 16px; font-size: 12px; font-weight: 700;
    letter-spacing: .03em; position: sticky; top: 0; z-index: 200;
    box-shadow: 0 2px 8px rgba(109,40,217,.4);
}
