/* ============================================================
   Inventaris Barang - Application styles
   ============================================================ */

:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-soft: #eff6ff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-soft: #eef2f7;
    --bg: #f5f7fb;
    --sidebar: #0b1220;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(15, 23, 42, .05);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--brand); }

code {
    font-size: .84em;
    color: #1e40af;
    background: #eef2ff;
    padding: 2px 6px;
    border-radius: 5px;
    white-space: nowrap;
}

.btn-brand {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 600;
}

.btn-brand:hover, .btn-brand:focus {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.btn { border-radius: 8px; font-weight: 500; font-size: .8125rem; padding: .375rem .75rem; }
.btn-sm { border-radius: 7px; font-size: .75rem; padding: .25rem .55rem; }

/* ------------------------------------------------------------------
   Shell
   ------------------------------------------------------------------ */
.app-body { background: var(--bg); }

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 248px;
    background: linear-gradient(180deg, #0b1220 0%, #0e1a30 60%, #0b1424 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 15px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    object-fit: contain;
    background: #fff;
    padding: 4px;
    flex: 0 0 40px;
}

.brand-logo-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand), #7c3aed);
    color: #fff;
    font-size: 21px;
    padding: 0;
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong {
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-text small { color: #94a3b8; font-size: 10px; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-role { padding: 12px 15px 2px; }
.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #93c5fd;
    background: rgba(37, 99, 235, .14);
    border: 1px solid rgba(96, 165, 250, .25);
    padding: 3px 9px;
    border-radius: 999px;
}

.sidebar-nav {
    padding: 10px 10px 16px;
    overflow-y: auto;
    flex: 1;
}

.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 5px; }

.nav-section {
    display: block;
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    padding: 7px 11px;
}

/* Pemilih jurusan di dalam sidebar (tersedia juga di layar kecil) */
.sidebar-dept-form { padding: 0 11px 4px; }
.sidebar-dept-form .form-select {
    background-color: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .16);
    color: #e2e8f0;
    font-size: 12px;
}
.sidebar-dept-form .form-select:focus {
    border-color: rgba(96, 165, 250, .7);
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .25);
}
.sidebar-dept-form .form-select option { color: #0f172a; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 9px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    margin-bottom: 1px;
    border: 0;
    width: 100%;
    background: transparent;
    text-align: left;
    transition: background .15s ease, color .15s ease;
}

.nav-item i { font-size: 15px; width: 17px; text-align: center; color: #7c8ba1; }

.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item:hover i { color: #bfdbfe; }

.nav-item.active {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .35);
}
.nav-item.active i { color: #fff; }

.nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    padding: 0 6px;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,.25); }

.nav-item-form { margin: 0; }
.nav-item-button { cursor: pointer; }

.sidebar-footer { padding: 0 14px 16px; }
.sidebar-card {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 11px;
    padding: 10px 12px;
}
.sidebar-card-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .8px; color: #64748b; }
.sidebar-card-value { color: #e2e8f0; font-weight: 600; font-size: 12.5px; margin-top: 2px; }
.sidebar-meta { text-align: center; font-size: 9.5px; color: #475569; margin-top: 10px; }

.sidebar-close { opacity: .8; }

.app-main {
    margin-left: 248px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: 64px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 24px;
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-heading h1 { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.2; }
.topbar-heading span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 9px;
    font-size: 16px;
}

.topbar-notify {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: #475569;
    background: #f1f5f9;
    text-decoration: none;
    font-size: 15px;
}
.topbar-notify:hover { background: #e2e8f0; color: var(--ink); }
.notify-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    padding: 4px 9px 4px 5px;
}
.user-menu:hover { border-color: #cbd5e1; background: #f8fafc; }
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand), #7c3aed);
    color: #fff;
    font-weight: 700;
    font-size: 12.5px;
}
.user-meta { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-meta strong { font-size: 11.5px; }
.user-meta small { font-size: 10px; color: var(--muted); }

.app-content { flex: 1; padding: 20px 24px 8px; }
.content-inner { max-width: 1420px; margin: 0 auto; }

.app-footer {
    max-width: 1420px;
    width: 100%;
    margin: 0 auto;
    padding: 14px 24px 22px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 11px;
    color: #94a3b8;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 1035;
}

/* ------------------------------------------------------------------
   Page heading / cards
   ------------------------------------------------------------------ */
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.page-heading h2 { font-size: 21px; font-weight: 700; margin: 0 0 3px; letter-spacing: -.2px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 12.5px; max-width: 760px; }
.page-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.app-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: #fff;
}
.app-card > .card-body { padding: 18px; }

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.card-title-sm { font-size: 14px; font-weight: 700; margin: 0; }
.card-subtitle { font-size: 11.5px; color: var(--muted); margin: 2px 0 0; }

.bg-blue { background: #e0ecff; color: #1d4ed8; }
.bg-green { background: #dcfce7; color: #15803d; }
.bg-amber { background: #fef3c7; color: #b45309; }
.bg-red { background: #fee2e2; color: #b91c1c; }
.bg-violet { background: #ede9fe; color: #6d28d9; }

.stat-grid { margin-bottom: 6px; }

.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
}
.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 19px;
    flex: 0 0 42px;
}
.stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--muted);
    font-weight: 600;
}
.stat-value { font-size: 23px; font-weight: 700; line-height: 1.1; margin-top: 1px; }
.stat-sub { font-size: 11px; color: #94a3b8; margin-top: 1px; }

.mini-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px 13px;
    height: 100%;
    color: inherit;
    text-decoration: none;
}
.mini-stat-link:hover { border-color: #bfdbfe; background: #f8fbff; color: inherit; }
.mini-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-size: 16px;
    flex: 0 0 34px;
}
.mini-stat span:not(.mini-icon) {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    font-weight: 600;
}
.mini-stat strong { font-size: 17px; }

/* ------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------ */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    border-radius: 10px;
}
.app-table { margin-bottom: 0; font-size: 12.5px; }
.app-table thead th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    font-weight: 600;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    padding: 9px 10px;
    white-space: nowrap;
}
.app-table tbody td { padding: 10px; border-color: var(--line-soft); vertical-align: middle; }
.app-table tbody tr:hover td { background: #fbfdff; }
.app-table tbody tr:last-child td { border-bottom: 0; }
.table-title { font-weight: 600; color: var(--ink); }
.table-meta { font-size: 11px; color: var(--muted); margin-top: 1px; display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }

.stock-cell { min-width: 110px; }
.stock-cell .text-muted { font-size: 11px; }
.stock-progress { height: 5px; border-radius: 999px; margin-top: 5px; width: 110px; background: #eef2f7; }

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.pagination { gap: 2px; }
.page-link {
    border-radius: 8px !important;
    border-color: var(--line);
    color: #475569;
    font-size: 12px;
    min-width: 30px;
    text-align: center;
}
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); }

/* ------------------------------------------------------------------
   Forms / filters
   ------------------------------------------------------------------ */
.form-control, .form-select {
    border-radius: 8px;
    border-color: #cbd5e1;
    font-size: 12.5px;
    padding: 7px 10px;
}
.form-select { padding-right: 2rem; }
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
.form-label { font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 4px; }
.form-text { font-size: 11px; color: #94a3b8; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.filter-extra { display: contents; }
.filter-toggle { display: none; }
.filter-bar-wrap { align-items: flex-start; }
.filter-search { position: relative; flex: 1 1 260px; min-width: 220px; }
.filter-search i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
}
.filter-search .form-control { padding-left: 38px; }
.filter-bar .form-select { min-width: 130px; width: auto; }
.filter-bar input[type="date"], .filter-bar input[type="month"] { width: auto; min-width: 130px; }
.filter-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap;
}
.filter-date input[type="date"], .filter-date input[type="month"] { min-width: 130px; }
.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: #475569;
    white-space: nowrap;
}

/* ------------------------------------------------------------------
   Detail, timeline & notes
   ------------------------------------------------------------------ */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 26px;
}
.detail-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px dotted #dbe3ec;
    font-size: 13px;
}
.detail-item span { color: var(--muted); font-size: 12px; }
.detail-item strong { font-weight: 600; text-align: right; }
.detail-item small { display: block; font-size: 11px; color: #94a3b8; text-align: right; }

.note-box {
    margin-top: 16px;
    background: #f8fafc;
    border-left: 3px solid var(--brand);
    border-radius: 0 10px 10px 0;
    padding: 11px 15px;
    font-size: 12.5px;
}
.note-box strong { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 3px; }
.note-box p { margin: 0; color: #334155; }

.status-timeline { position: relative; padding-left: 4px; }
.status-step {
    display: flex;
    gap: 12px;
    position: relative;
    padding-bottom: 22px;
    color: #94a3b8;
}
.status-step:last-child { padding-bottom: 0; }
.status-step::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 30px;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}
.status-step:last-child::before { display: none; }
.status-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    display: grid;
    place-items: center;
    font-size: 13px;
    flex: 0 0 32px;
    z-index: 1;
}
.status-step strong { display: block; font-size: 12.5px; font-weight: 600; color: #64748b; }
.status-step small { display: block; font-size: 11px; color: #94a3b8; margin-top: 1px; }
.status-step.done .status-dot { background: #dcfce7; border-color: #86efac; color: #15803d; }
.status-step.done strong { color: var(--ink); }
.status-step.danger .status-dot { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.status-step.danger strong { color: #b91c1c; }

.low-stock-list { display: flex; flex-direction: column; }
.low-stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
    text-decoration: none;
    color: inherit;
}
.low-stock-item:last-child { border-bottom: 0; }
.low-stock-item:hover .low-stock-main strong { color: var(--brand); }
.low-stock-main strong { display: block; font-size: 12.5px; }
.low-stock-main small { font-size: 11px; color: var(--muted); }
.low-stock-value { text-align: right; white-space: nowrap; }
.low-stock-value small { color: #94a3b8; font-size: 11px; }

.timeline-list { display: flex; flex-direction: column; gap: 14px; }
.timeline-item { display: flex; gap: 10px; }
.timeline-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--brand);
    margin-top: 5px;
    flex: 0 0 9px;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.timeline-dot.danger { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .12); }
.timeline-body { min-width: 0; font-size: 12px; }
.timeline-body .badge { font-size: 9.5px; }

.activity-list { display: flex; flex-direction: column; gap: 12px; }
.activity-item { display: flex; gap: 10px; }
.activity-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #f1f5f9;
    color: #64748b;
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    font-size: 13px;
}
.activity-text { font-size: 12px; }
.activity-desc { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.activity-time { font-size: 10.5px; color: #94a3b8; margin-top: 2px; }

/* ------------------------------------------------------------------
   Paket / item picker rows
   ------------------------------------------------------------------ */
.package-card .card-body { display: flex; flex-direction: column; height: 100%; padding: 14px; }
.package-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.package-card .package-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--brand-soft);
    color: var(--brand);
    display: grid;
    place-items: center;
    font-size: 15px;
    flex: 0 0 32px;
}
.package-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    margin: 8px 0 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.package-desc {
    font-size: 11px;
    line-height: 1.4;
    color: var(--muted);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.package-head > .badge { flex: 0 0 auto; white-space: nowrap; }
.package-stats { display: flex; flex-wrap: wrap; gap: 5px; font-size: 10px; color: var(--muted); margin: 8px 0 7px; }
.package-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    background: #f8fafc;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    padding: 2px 7px;
    white-space: nowrap;
}
.package-stats strong { color: var(--ink); font-weight: 600; }
.package-items {
    list-style: none;
    padding: 6px 9px;
    margin: 0 0 10px;
    background: #f8fafc;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    font-size: 11px;
    line-height: 1.3;
    color: #475569;
}
.package-items li { display: flex; align-items: center; gap: 6px; padding: 2.5px 0; min-width: 0; }
.package-items li:not(.package-note)::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #cbd5e1;
    flex: 0 0 auto;
}
.package-item-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.package-item-qty {
    flex: 0 0 auto;
    font-size: 9.5px;
    font-variant-numeric: tabular-nums;
    color: #475569;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 5px;
    line-height: 1.6;
}
.package-note { color: var(--muted); font-size: 10px; }
.package-actions { display: flex; gap: 6px; align-items: center; border-top: 1px solid var(--line-soft); padding-top: 9px; margin-top: auto; }
.package-actions form { margin: 0; display: flex; }
.package-actions .package-edit { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.package-delete { display: inline-flex; align-items: center; justify-content: center; width: 30px; padding: 0; }

.package-rows { display: flex; flex-direction: column; gap: 10px; }
.package-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px 40px;
    gap: 8px;
    align-items: start;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 11px;
}
.package-row .package-row-info { grid-column: 1 / -1; padding-left: 2px; }
.package-qty { text-align: center; }
.package-remove { padding: 7px 0; }
.package-total {
    display: flex;
    justify-content: flex-end;
    font-size: 12.5px;
    color: var(--muted);
    border-top: 1px dashed var(--line);
    padding-top: 12px;
}
.package-total strong { color: var(--ink); }
.package-preview { border: 1px dashed #cbd5e1; border-radius: 11px; padding: 4px 12px; background: #fbfdff; }
.package-preview table { margin: 0; }

.type-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.type-choice { cursor: pointer; margin: 0; }
.type-choice input { position: absolute; opacity: 0; pointer-events: none; }
.type-choice-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1.5px solid var(--line);
    border-radius: 13px;
    padding: 15px;
    height: 100%;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.type-choice-body strong { font-size: 13px; }
.type-choice-body small { font-size: 11.5px; color: var(--muted); }
.type-choice-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
    display: grid;
    place-items: center;
    font-size: 17px;
    margin-bottom: 5px;
}
.type-choice input:checked + .type-choice-body {
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.type-choice input:checked + .type-choice-body .type-choice-icon { background: var(--brand); color: #fff; }

/* ------------------------------------------------------------------
   Catalog
   ------------------------------------------------------------------ */
.catalog-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
    display: grid;
    place-items: center;
    font-size: 20px;
    flex: 0 0 44px;
}
.catalog-item-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.catalog-item-row .catalog-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 10px;
    font-size: 16px;
}
.catalog-item-main { min-width: 0; }
.catalog-item-main .table-title,
.catalog-item-main .m-card-title { overflow-wrap: anywhere; }
.m-card-head .catalog-item-row { flex: 1 1 auto; }
.catalog-table tbody td { padding: 6px 10px; }
.catalog-table .catalog-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 8px;
    font-size: 14px;
}
.catalog-table .table-title { line-height: 1.25; }
.catalog-table .table-meta { margin-top: 0; font-size: 10.5px; }
.catalog-table .stock-cell { min-width: 150px; }
.catalog-table .stock-progress { height: 4px; margin-top: 3px; width: 100%; max-width: 140px; }

/* ------------------------------------------------------------------
   Profile / settings
   ------------------------------------------------------------------ */
.profile-card .profile-avatar {
    width: 82px;
    height: 82px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--brand), #7c3aed);
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
}
.profile-name { font-size: 17px; font-weight: 700; margin: 0 0 8px; }
.profile-meta { text-align: left; }
.profile-meta > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 12px;
}
.profile-meta > div:last-child { border-bottom: 0; }
.profile-meta span { color: var(--muted); }
.profile-meta strong { text-align: right; font-weight: 600; }

.logo-preview {
    height: 150px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    display: grid;
    place-items: center;
    padding: 14px;
}
.logo-preview img { max-width: 100%; max-height: 120px; object-fit: contain; }
.logo-preview-empty { color: #94a3b8; font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.logo-preview-empty i { font-size: 30px; }

.color-field { display: flex; gap: 8px; }
.color-field .form-control-color { width: 58px; flex: 0 0 58px; padding: 4px; }
.color-preview { display: flex; align-items: center; gap: 12px; }
.color-preview-dot { width: 42px; height: 42px; border-radius: 12px; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.color-preview strong { display: block; font-size: 12.5px; }
.color-preview small { color: var(--muted); font-size: 11.5px; }

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #e0ecff;
    color: #1d4ed8;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    flex: 0 0 34px;
}

/* ------------------------------------------------------------------
   Reports & tabs
   ------------------------------------------------------------------ */
.tab-switch {
    display: inline-flex;
    gap: 3px;
    background: #e9eef6;
    padding: 3px;
    border-radius: 10px;
    margin-bottom: 16px;
}
.tab-switch a {
    padding: 7px 14px;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}
.tab-switch a.active { background: #fff; color: var(--brand); box-shadow: 0 2px 8px rgba(15,23,42,.08); }

.report-toolbar .card-body { padding: 16px 18px; }
.report-period-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.report-period-info { display: flex; align-items: center; gap: 9px; min-width: 0; }
.report-period-label {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--brand);
    background: var(--brand-soft);
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 3px 9px;
    white-space: nowrap;
}
.report-period-info .card-title-sm { font-size: 14px; }
.report-period-info .card-subtitle { margin-top: 1px; }
.report-export { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.report-export-form { display: flex; gap: 6px; flex-wrap: wrap; }
.report-filter { margin-bottom: 0; padding-top: 14px; border-top: 1px solid var(--line-soft); }

.chart-wrap { position: relative; height: 240px; }
.chart-wrap canvas { width: 100% !important; }

.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-head { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; min-width: 0; }
.rank-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-head strong { font-size: 11px; color: var(--brand); white-space: nowrap; }
.rank-bar { height: 5px; background: #eef2f7; border-radius: 999px; margin-top: 4px; overflow: hidden; }
.rank-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #60a5fa); border-radius: 999px; }
.rank-sub { font-size: 10px; color: #94a3b8; margin-top: 2px; }

.import-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.import-summary-item {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px;
    text-align: center;
}
.import-summary-item strong { display: block; font-size: 22px; }
.import-summary-item span { font-size: 11px; color: var(--muted); }
.import-summary-item.success strong { color: #15803d; }
.import-summary-item.warning strong { color: #b45309; }

.export-form { display: flex; gap: 8px; align-items: center; }
.export-form .form-select { flex: 1; }

.stock-history-list { display: flex; flex-direction: column; }
.stock-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 12px;
}
.stock-history-item:last-child { border-bottom: 0; }
.stock-history-item strong { font-weight: 600; }

.proc-gallery { display: flex; flex-wrap: wrap; gap: 5px; }
.proc-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    display: block;
    background: #f8fafc;
    transition: transform .15s ease;
}
.proc-thumb:hover { transform: scale(1.04); }

.active-loan-list { display: flex; flex-direction: column; }
.active-loan {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 2px;
    border-bottom: 1px solid var(--line-soft);
    color: inherit;
    text-decoration: none;
}
.active-loan:last-child { border-bottom: 0; }
.active-loan:hover .active-loan-main strong { color: var(--brand); }
.active-loan-date {
    width: 50px;
    height: 52px;
    border-radius: 11px;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 50px;
}
.active-loan-date strong { font-size: 17px; line-height: 1; }
.active-loan-date span { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.active-loan-main { flex: 1; min-width: 0; }
.active-loan-main strong { font-size: 13px; }

.loan-terms { line-height: 1.65; white-space: normal; }

/* ------------------------------------------------------------------
   Alerts / empty / misc
   ------------------------------------------------------------------ */
.app-alert { border-radius: 12px; font-size: 12.5px; border-width: 1px; }
.alert { border-radius: 12px; }

.empty-state { text-align: center; padding: 34px 18px; }
.empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 22px;
    display: grid;
    place-items: center;
    margin: 0 auto 11px;
}
.empty-state h3 { font-size: 13.5px; font-weight: 700; margin: 0 0 4px; }
.empty-state p { font-size: 11.5px; color: var(--muted); margin: 0; }

.border-warning-subtle { border-color: #fde68a !important; }
.border-info-subtle { border-color: #bae6fd !important; }
.border-success-subtle { border-color: #a7f3d0 !important; }

.dropdown-menu { border-radius: 12px; border-color: var(--line); padding: 6px; }
.dropdown-item { border-radius: 8px; font-size: 12.5px; padding: 8px 10px; }
.dropdown-header { font-size: 11px; color: #94a3b8; }

.form-switch .form-check-input { width: 2.4em; height: 1.3em; }

/* ------------------------------------------------------------------
   Login
   ------------------------------------------------------------------ */
.login-body { background: #eef2f7; }

.login-shell {
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    min-height: 100vh;
}

.login-visual {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 18%, rgba(96, 165, 250, .28), transparent 42%),
        radial-gradient(circle at 88% 82%, rgba(124, 58, 237, .3), transparent 45%),
        linear-gradient(140deg, #0b1220 0%, #12224a 55%, #1d3a8a 100%);
    color: #fff;
    padding: 48px 56px;
    display: flex;
}
.login-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.13) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: .35;
    pointer-events: none;
}
.login-visual-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: auto; }
.login-logo { width: 54px; height: 54px; border-radius: 14px; background: #fff; padding: 5px; object-fit: contain; }
.login-logo-fallback { display: grid; place-items: center; background: rgba(255,255,255,.14); color: #fff; font-size: 25px; padding: 0; }
.login-instansi { font-size: 14px; font-weight: 700; }
.login-tagline { font-size: 11.5px; color: #bfdbfe; margin-top: 2px; }

.login-visual h1 {
    font-size: clamp(26px, 2.4vw, 38px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.6px;
    margin: 60px 0 14px;
    max-width: 560px;
}
.login-lead { color: #bfdbfe; font-size: 14px; line-height: 1.65; max-width: 520px; margin: 0 0 32px; }

.login-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 17px; }
.login-features li { display: flex; gap: 13px; align-items: flex-start; }
.login-features li > span {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: rgba(255,255,255,.11);
    border: 1px solid rgba(255,255,255,.13);
    display: grid;
    place-items: center;
    font-size: 16px;
    flex: 0 0 38px;
    color: #bfdbfe;
}
.login-features strong { display: block; font-size: 13px; font-weight: 600; }
.login-features small { display: block; font-size: 11.5px; color: #93c5fd; margin-top: 2px; line-height: 1.45; }

.login-visual-footer {
    margin-top: auto;
    padding-top: 38px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 11px;
    color: #93c5fd;
}
.login-visual-footer i { margin-right: 5px; }
.login-year { white-space: nowrap; }

.login-panel {
    display: grid;
    place-items: center;
    padding: 34px;
    background: #f5f7fb;
}
.login-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .1);
    padding: 38px 38px 26px;
}
.login-mobile-brand { display: none; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; margin-bottom: 22px; }
.login-logo-sm { width: 34px; height: 34px; object-fit: contain; border-radius: 9px; }
.login-heading .eyebrow {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--brand);
    font-weight: 700;
    margin-bottom: 6px;
}
.login-heading h2 { font-size: 23px; font-weight: 700; margin: 0 0 5px; letter-spacing: -.3px; }
.login-heading p { font-size: 12.5px; color: var(--muted); margin: 0 0 24px; }

.login-form .field { margin-bottom: 16px; }
.login-form label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.input-icon { position: relative; }
.input-icon > i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
}
.input-icon .form-control { padding: 12px 42px; height: 46px; }
.input-icon .password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #94a3b8;
    width: 34px;
    height: 34px;
    border-radius: 8px;
}
.input-icon .password-toggle:hover { background: #f1f5f9; color: #475569; }
.login-submit { height: 46px; font-size: 13.5px; border-radius: 11px; }
.login-help {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 20px;
    padding: 11px 13px;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    font-size: 11.5px;
    line-height: 1.45;
}
.login-help i { color: #94a3b8; margin-top: 1px; }
.login-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 28px;
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
    font-size: 10.5px;
    color: #94a3b8;
}

/* ------------------------------------------------------------------
   Mobile app shell (bottom navigation + card lists)
   ------------------------------------------------------------------ */
.mobile-bottom-nav { display: none; }

.mobile-only { display: none !important; }

.m-card-list { display: flex; flex-direction: column; gap: 11px; }

.m-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.m-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}
.m-card-title { font-size: 14px; font-weight: 700; line-height: 1.35; margin: 0; }
.m-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 7px;
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.4;
}
.m-card-meta code { font-size: 10.5px; }
.m-card-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.m-card-stock {
    background: #f8fafc;
    border-radius: 11px;
    padding: 9px 11px;
    font-size: 11.5px;
    color: #475569;
}
.m-card-stock .stock-progress { width: 100%; margin-top: 5px; }
.m-card-stock-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.m-card-actions { display: flex; gap: 8px; margin-top: 2px; }
.m-card-actions .btn {
    flex: 1;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
}
.m-card-actions form { margin: 0; flex: 1; display: flex; }
.m-card-actions form .btn { width: 100%; }
.m-card-note { font-size: 11.5px; color: var(--muted); }

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 1199.98px) {
    .app-content { padding: 22px 22px 6px; }
    .app-topbar { padding: 0 22px; }
    .app-footer { padding: 16px 22px 22px; }
}

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); box-shadow: 20px 0 50px rgba(15,23,42,.25); }
    .sidebar-open .app-sidebar { transform: translateX(0); }
    .sidebar-open .sidebar-overlay { display: block; }
    .app-main { margin-left: 0; }
    .login-shell { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .login-panel { padding: 22px; }
    .login-card { max-width: 460px; padding: 30px 26px 22px; }
    .login-mobile-brand { display: flex; }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1032;
        justify-content: space-around;
        align-items: stretch;
        background: rgba(255, 255, 255, .98);
        backdrop-filter: blur(16px);
        border-top: 1px solid #e6ebf2;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, .06);
        padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    }
    .mobile-nav-item {
        position: relative;
        flex: 1;
        min-height: 52px;
        border: 0;
        background: transparent;
        color: #7b8798;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 3px 2px;
        font-size: 10px;
        font-weight: 600;
        text-decoration: none;
        border-radius: 12px;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }
    .mobile-nav-item:hover, .mobile-nav-item:focus { color: var(--brand); text-decoration: none; }
    .mobile-nav-icon {
        position: relative;
        width: 44px;
        height: 28px;
        display: grid;
        place-items: center;
        border-radius: 10px;
        font-size: 18px;
        transition: background .15s ease, color .15s ease;
    }
    .mobile-nav-item.active { color: var(--brand); }
    .mobile-nav-item.active .mobile-nav-icon { background: var(--brand-soft); }
    .mobile-nav-item.accent { color: var(--brand); }
    .mobile-nav-item.accent .mobile-nav-icon {
        background: var(--brand);
        color: #fff;
        box-shadow: 0 6px 16px rgba(37, 99, 235, .3);
    }
    .mobile-nav-item.accent.active .mobile-nav-icon { background: var(--brand-dark); }
    .mobile-nav-badge {
        position: absolute;
        top: -4px;
        right: 0;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 999px;
        background: #ef4444;
        color: #fff;
        font-size: 9px;
        font-weight: 700;
        display: grid;
        place-items: center;
        border: 2px solid #fff;
    }
    .has-bottom-nav .app-content { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
    .has-bottom-nav .app-footer { display: none; }
    .app-topbar { box-shadow: 0 1px 0 var(--line); }
}

@media (max-width: 767.98px) {
    .app-content { padding: 18px 15px 4px; }
    .app-topbar { height: 62px; padding: 0 15px; background: #fff; }
    .topbar-heading h1 { font-size: 17px; }
    .topbar-heading span { display: none; }
    .page-heading h2 { font-size: 20px; }
    .page-actions { width: 100%; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 22px; }
    .detail-grid { grid-template-columns: 1fr; }
    .login-card { padding: 26px 20px 20px; border-radius: 18px; }
    .type-choice-grid { grid-template-columns: 1fr; }
    .import-summary { grid-template-columns: 1fr; }
    .app-footer { flex-direction: column; gap: 4px; }
    .filter-bar .form-select, .filter-bar input[type="date"], .filter-bar input[type="month"] { flex: 1 1 45%; width: 100%; }
    .filter-search { flex: 1 1 100%; }
    .export-form { flex-direction: column; align-items: stretch; }
    .report-period-head { flex-direction: column; }

    .mobile-only { display: block !important; }
    .desktop-only { display: none !important; }
    .btn { min-height: 38px; }
    .btn-sm { min-height: 34px; }
    .app-card > .card-body { padding: 16px; }
    .stat-grid > [class*="col-"] { width: 50%; }
    .stat-grid .stat-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 13px;
        gap: 8px;
    }
    .stat-grid .stat-icon { width: 36px; height: 36px; flex-basis: 36px; font-size: 17px; }
    .stat-grid .stat-value { font-size: 20px; }
    .stat-grid .stat-label { font-size: 9.5px; letter-spacing: .4px; }
    .stat-grid .stat-sub { font-size: 10.5px; }
    .stat-grid .mini-stat { padding: 10px; gap: 9px; }
    .stat-grid .mini-icon { width: 32px; height: 32px; flex-basis: 32px; font-size: 15px; }
    .stat-grid .mini-stat strong { font-size: 16px; }
    .stat-grid-3 > [class*="col-"] { width: 33.333%; }
    .stat-grid-3 .mini-stat {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 9px;
    }
    .stat-grid-3 .mini-stat span:not(.mini-icon) { font-size: 9px; letter-spacing: .2px; line-height: 1.25; }
    .stat-grid-3 .mini-stat strong { font-size: 15px; }
    .stat-grid-3 .mini-icon { width: 28px; height: 28px; flex-basis: 28px; font-size: 13px; }
}

@media (max-width: 575.98px) {
    .stat-grid .col-6, .stat-grid [class*="col-"] { width: 50%; }
    .stat-grid-3 > [class*="col-"] { width: 33.333%; }
    .table-footer { flex-direction: column; align-items: flex-start; }
    .app-content { padding: 16px 12px 4px; }
    .app-topbar { padding: 0 12px; gap: 10px; }
    .app-card > .card-body { padding: 16px; }
    .card-head { flex-wrap: wrap; }
    .page-heading { margin-bottom: 16px; gap: 12px; }
    .page-heading h2 { font-size: 19px; }
    .page-actions { gap: 6px; }
    .page-actions .btn { flex: 1 1 auto; }
    .stat-card { padding: 15px; gap: 12px; }
    .stat-icon { width: 44px; height: 44px; flex-basis: 44px; font-size: 19px; }
    .stat-value { font-size: 21px; }
    .mini-stat { padding: 11px 12px; }
    .package-row { grid-template-columns: minmax(0, 1fr) 74px 38px; gap: 6px; padding: 8px; }
    .package-row .form-select, .package-row .form-control { font-size: 12px; padding: 7px 8px; }
    .package-row-info { font-size: 10.5px; }
    .package-preview { overflow-x: auto; padding: 4px 8px; }
    .package-preview table { min-width: 320px; }
    .chart-wrap { height: 215px; }
    .tab-switch { display: flex; width: 100%; }
    .tab-switch a { flex: 1; text-align: center; padding: 8px 6px; font-size: 11px; }
    .import-summary { grid-template-columns: 1fr; }
    .login-panel { padding: 14px; }
    .login-card { padding: 24px 18px 18px; border-radius: 16px; }
    .login-heading h2 { font-size: 20px; }
    .app-sidebar { width: min(280px, 84vw); }
    .topbar-notify { width: 36px; height: 36px; }
    .user-menu { padding: 4px 7px 4px 4px; }
    .user-avatar { width: 32px; height: 32px; border-radius: 9px; }
    .detail-item { flex-direction: column; align-items: flex-start; gap: 2px; }
    .detail-item strong, .detail-item small { text-align: left; }
    .profile-meta strong { max-width: 62%; word-break: break-word; }
    .report-period-head { gap: 10px; }
    .report-export { width: 100%; }
    .report-export form { display: flex; gap: 6px; width: 100%; }
    .report-export .btn { flex: 1; }
    .filter-bar .form-select, .filter-bar input[type="date"], .filter-bar input[type="month"], .filter-bar .btn { flex: 1 1 100%; width: 100%; }
    .filter-bar .btn { justify-content: center; }
    .check-inline { flex: 1 1 100%; }
}

/* ------------------------------------------------------------------
   Compact mobile refinement
   ------------------------------------------------------------------ */
@media (max-width: 767.98px) {
    body { font-size: 13px; }

    .app-content { padding: 13px 11px 4px; }
    .app-topbar { height: 56px; padding: 0 11px; gap: 8px; }
    .topbar-left { gap: 9px; }
    .topbar-heading h1 { font-size: 16px; }
    .topbar-heading span { display: none; }
    .btn-icon { width: 34px; height: 34px; font-size: 16px; border-radius: 9px; }
    .topbar-notify { width: 34px; height: 34px; font-size: 15px; border-radius: 9px; }
    .notify-dot { min-width: 16px; height: 16px; font-size: 9px; }
    .user-menu { padding: 3px 6px 3px 3px; border-radius: 10px; gap: 6px; }
    .user-avatar { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; }
    .topbar-right { gap: 7px; }

    .page-heading { margin-bottom: 12px; gap: 8px; }
    .page-heading h2 { font-size: 18px; margin-bottom: 2px; }
    .page-heading p { font-size: 11.5px; line-height: 1.4; }
    .page-actions { gap: 6px; }
    .page-actions .btn { font-size: 11.5px; padding: 5px 9px; min-height: 33px; }

    .app-card { border-radius: 13px; }
    .app-card > .card-body { padding: 13px; }
    .card-head { margin-bottom: 11px; gap: 8px; }
    .card-title-sm { font-size: 14px; }
    .card-subtitle { font-size: 10.5px; margin-top: 2px; }

    .stat-grid .stat-card { padding: 10px; gap: 6px; border-radius: 12px; }
    .stat-grid .stat-icon { width: 29px; height: 29px; flex-basis: 29px; font-size: 14px; border-radius: 9px; }
    .stat-grid .stat-value { font-size: 18px; }
    .stat-grid .stat-label { font-size: 8.5px; letter-spacing: .25px; }
    .stat-grid .stat-sub { font-size: 9.5px; }
    .stat-grid .mini-stat { padding: 8px; gap: 7px; border-radius: 10px; }
    .stat-grid .mini-icon { width: 26px; height: 26px; flex-basis: 26px; font-size: 12px; border-radius: 8px; }
    .stat-grid .mini-stat strong { font-size: 15px; }
    .stat-grid .mini-stat span:not(.mini-icon) { font-size: 8.5px; letter-spacing: .1px; }
    .stat-grid-3 .mini-stat { gap: 4px; padding: 7px; }
    .stat-grid-3 .mini-icon { width: 25px; height: 25px; flex-basis: 25px; font-size: 12px; }
    .stat-grid-3 .mini-stat strong { font-size: 14px; }

    .filter-bar { gap: 6px; margin-bottom: 11px; }
    .filter-search { flex: 1 1 100%; min-width: 0; }
    .filter-bar.has-mobile-filter .filter-search { flex: 1 1 0; min-width: 0; }
    .filter-bar .filter-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        flex: 0 0 auto;
        width: auto;
        min-height: 35px;
        padding: 5px 10px;
        font-size: 11.5px;
        border-radius: 8px;
    }
    .filter-extra {
        display: none;
        width: 100%;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
    }
    .filter-bar.filter-open .filter-extra { display: flex; }
    .filter-bar.filter-open .filter-toggle {
        background: var(--brand-soft);
        border-color: #bfdbfe;
        color: var(--brand);
    }
    .filter-active-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--brand);
        display: inline-block;
        margin-left: 1px;
    }
    .filter-search .form-control { height: 35px; padding-left: 32px; }
    .filter-search i { left: 10px; font-size: 12px; }
    .filter-bar .form-select, .filter-bar input[type="date"], .filter-bar input[type="month"] { min-height: 35px; }
    .filter-date { font-size: 10.5px; gap: 4px; }
    .filter-date input[type="date"], .filter-date input[type="month"] { min-width: 122px; min-height: 35px; }
    .check-inline { font-size: 11px; }
    .filter-bar .btn { min-height: 35px; font-size: 11.5px; padding: 5px 10px; }

    .form-control, .form-select { font-size: 12.5px; padding: 6px 9px; min-height: 35px; border-radius: 8px; }
    .form-control-color { min-height: 35px; }
    .form-label { font-size: 11.5px; margin-bottom: 4px; }
    .form-text { font-size: 10.5px; }
    .form-check-label { font-size: 12px; }

    .btn { font-size: 12px; padding: 6px 10px; min-height: 34px; border-radius: 8px; }
    .btn-sm { font-size: 11px; padding: 4px 8px; min-height: 31px; border-radius: 7px; }
    .badge { font-size: .66em; padding: .32em .55em; }
    .pagination { gap: 2px; }
    .page-link { min-width: 28px; font-size: 11px; padding: 4px 6px; }

    .m-card { padding: 11px; gap: 7px; border-radius: 13px; }
    .m-card-title { font-size: 13px; }
    .m-card-meta { font-size: 10.5px; gap: 3px 5px; }
    .m-card-meta code { font-size: 9.5px; }
    .m-card-stock { padding: 7px 9px; font-size: 10.5px; border-radius: 9px; }
    .m-card-actions { gap: 6px; }
    .m-card-actions .btn { min-height: 33px; font-size: 10.5px; padding: 4px 6px; gap: 4px; }
    .m-card-actions .btn i { font-size: 12px; }

    .app-table { font-size: 11.5px; }
    .app-table thead th { font-size: 9.5px; padding: 7px 8px; }
    .app-table tbody td { padding: 8px; }
    .table-title { font-size: 12px; }
    .table-meta { font-size: 10px; }
    .table-footer { gap: 8px; margin-top: 11px; }
    .stock-progress { height: 4px; }

    .alert { font-size: 11.5px; padding: 9px 11px; border-radius: 10px; }
    .app-alert { font-size: 11.5px; }
    .empty-state { padding: 28px 14px; }
    .empty-icon { width: 46px; height: 46px; font-size: 20px; border-radius: 14px; margin-bottom: 10px; }
    .empty-state h3 { font-size: 12.5px; }
    .empty-state p { font-size: 11px; }

    .detail-grid { gap: 0 14px; }
    .detail-item { padding: 6px 0; font-size: 11.5px; }
    .detail-item span { font-size: 10.5px; }
    .detail-item small { font-size: 10px; }
    .note-box { padding: 8px 11px; font-size: 11.5px; border-radius: 0 8px 8px 0; margin-top: 11px; }

    .status-step { padding-bottom: 16px; gap: 9px; }
    .status-dot { width: 27px; height: 27px; flex-basis: 27px; font-size: 11px; }
    .status-step strong { font-size: 11.5px; }
    .status-step small { font-size: 10px; }
    .status-step::before { left: 13px; top: 26px; }

    .profile-avatar { width: 66px; height: 66px; border-radius: 20px; font-size: 26px; }
    .profile-name { font-size: 15px; }
    .profile-meta > div { padding: 6px 0; font-size: 11.5px; }

    .active-loan { padding: 10px 0; gap: 10px; }
    .active-loan-date { width: 44px; height: 46px; flex-basis: 44px; border-radius: 10px; }
    .active-loan-date strong { font-size: 15px; }
    .active-loan-date span { font-size: 9px; }
    .active-loan-main strong { font-size: 11.5px; }
    .active-loan-main .small { font-size: 10px; }

    .catalog-icon { width: 34px; height: 34px; flex-basis: 34px; font-size: 15px; border-radius: 9px; }

    .package-row { padding: 7px; gap: 5px; border-radius: 9px; }
    .package-row .form-select, .package-row .form-control { font-size: 11.5px; padding: 6px 7px; min-height: 33px; }
    .package-row .package-remove { min-height: 33px; padding: 4px 0; }
    .package-row-info { font-size: 9.5px; }
    .package-total { padding-top: 9px; font-size: 11px; }
    .type-choice-body { padding: 11px; gap: 3px; border-radius: 11px; }
    .type-choice-icon { width: 31px; height: 31px; font-size: 14px; margin-bottom: 3px; }
    .type-choice-body strong { font-size: 12px; }
    .type-choice-body small { font-size: 10.5px; }

    .chart-wrap { height: 190px; }
    .tab-switch { padding: 3px; border-radius: 10px; margin-bottom: 14px; }
    .tab-switch a { font-size: 10.5px; padding: 6px 8px; border-radius: 8px; }
    .report-period-head { margin-bottom: 10px; gap: 8px; }
    .rank-item { gap: 4px; }
    .rank-head { font-size: 11px; }
    .rank-head strong { font-size: 10.5px; }
    .rank-sub { font-size: 9.5px; }
    .import-summary { gap: 8px; }
    .import-summary-item { padding: 9px; border-radius: 10px; }
    .import-summary-item strong { font-size: 18px; }
    .import-summary-item span { font-size: 10px; }
    .stock-history-item { padding: 7px 0; font-size: 11px; }
    .logo-preview { height: 120px; }
    .logo-preview img { max-height: 96px; }

    .app-sidebar { width: min(272px, 82vw); }
    .sidebar-brand { padding: 15px 14px 13px; }
    .brand-logo { width: 38px; height: 38px; flex-basis: 38px; font-size: 18px; }
    .brand-text strong { font-size: 13px; }
    .brand-text small { font-size: 9.5px; }
    .sidebar-role { padding: 10px 14px 2px; }
    .role-chip { font-size: 9.5px; padding: 3px 8px; }
    .sidebar-nav { padding: 9px 9px 14px; }
    .nav-section { font-size: 9px; padding: 6px 10px; }
    .nav-item { font-size: 12.5px; padding: 8px 10px; gap: 10px; border-radius: 9px; }
    .nav-item i { font-size: 14px; width: 16px; }
    .sidebar-card { padding: 9px 11px; }
    .sidebar-card-label { font-size: 9px; }
    .sidebar-card-value { font-size: 12px; }
    .sidebar-footer { padding: 0 12px 14px; }
    .sidebar-meta { font-size: 9px; margin-top: 9px; }

    .mobile-bottom-nav { padding: 5px 4px calc(5px + env(safe-area-inset-bottom)); }
    .mobile-nav-item { min-height: 47px; font-size: 9px; gap: 1px; padding: 2px 1px; }
    .mobile-nav-icon { width: 38px; height: 24px; font-size: 16px; border-radius: 9px; }
    .mobile-nav-badge { min-width: 14px; height: 14px; font-size: 8px; top: -3px; border-width: 1.5px; }
    .has-bottom-nav .app-content { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }

    .login-panel { padding: 12px; }
    .login-card { padding: 22px 17px 16px; border-radius: 16px; }
    .login-heading h2 { font-size: 18px; }
    .login-heading p { font-size: 11.5px; margin-bottom: 18px; }
    .login-form .field { margin-bottom: 13px; }
    .login-form label { font-size: 11.5px; }
    .input-icon .form-control { height: 42px; padding: 10px 38px; font-size: 13px; }
    .login-submit { height: 42px; font-size: 12.5px; }
    .login-help { font-size: 10.5px; padding: 9px 11px; margin-top: 15px; }
    .login-footer { margin-top: 20px; padding-top: 11px; font-size: 9.5px; }
    .login-mobile-brand { margin-bottom: 17px; }
}

/* =========================================================
   Mode pantau (super admin) — aksi tulis dinonaktifkan
   ========================================================= */
.is-readonly-mode .content-inner .btn-brand,
.is-readonly-mode .content-inner .btn-success,
.is-readonly-mode .content-inner .btn-danger,
.is-readonly-mode .content-inner [data-write-action],
.is-readonly-mode .content-inner form[data-write] button[type="submit"] {
    pointer-events: none;
    opacity: .45;
    cursor: not-allowed;
}

.is-readonly-mode .content-inner .page-actions .btn-brand,
.is-readonly-mode .content-inner .page-actions .btn-success {
    filter: grayscale(.5);
}

/* =========================================================
   Pemilih warna tema jurusan
   ========================================================= */
.dept-color-presets { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.dept-color-dot {
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .12);
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}

.dept-color-dot:hover { transform: scale(1.12); }
.dept-color-dot:focus-visible { outline: 2px solid #0f172a; outline-offset: 2px; }

/* Opsi "ikuti warna sekolah": lingkaran bergaris diagonal */
.dept-color-dot.is-default {
    background:
        linear-gradient(135deg, transparent 45%, #94a3b8 45%, #94a3b8 55%, transparent 55%),
        #f1f5f9;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .18) inset;
}

/* Penanda warna jurusan pada kartu daftar jurusan */
.dept-color-chip {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: 1px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .15);
}
