/* =====================================================================
   SIPITA - tema mengikuti contoh-ui.png (navbar pil di atas, kartu putih
   membulat, latar abu kebiruan) dgn palet color-palete.png:
   Deep Sapphire #002D72 (dasar), Royal Blue Beam #1E88E5 (aksi),
   Golden Pulse #F9A825 (sorotan), Luxe Ivory Mist #FFF8E1 (latar lembut).
   ===================================================================== */
:root {
    --sapphire: #002D72;
    --sapphire-2: #0B3F8F;
    --royal: #1E88E5;
    --royal-soft: #E3F0FC;
    --gold: #F9A825;
    --gold-2: #E08E00;
    --gold-soft: #FFF3D1;
    --ivory: #FFF8E1;
    --bg: #EEF1F6;
    --card: #FFFFFF;
    --ink: #101828;
    --ink-2: #344054;
    --muted: #667085;
    --muted-2: #98A2B3;
    --line: #EAECF0;
    --line-2: #D0D5DD;
    --soft: #F6F7F9;
    --succ: #12A150;
    --succ-soft: #E3F7EA;
    --warn: #E08E00;
    --warn-soft: #FFF1D6;
    --dang: #E5484D;
    --dang-soft: #FDE8E8;
    --info: #1E88E5;
    --info-soft: #E3F0FC;
    --primary-line: rgba(0, 45, 114, .12);
    --radius: 22px;
    --radius-sm: 14px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04);
    --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { background: var(--bg); }
body {
    font-family: var(--font);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    margin: 0;
}
a { color: var(--royal); text-decoration: none; }
a:hover { color: var(--sapphire); }
code { color: var(--dang); }
/* Ikon Lucide (font lokal di assets/vendor/lucide) */
[class^="icon-"], [class*=" icon-"] { display: inline-block; line-height: 1; vertical-align: -0.14em; }
.text-muted, .cell-sub { color: var(--muted) !important; }
.num { font-variant-numeric: tabular-nums; }

/* ============================== NAVBAR ============================== */
.topnav {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 18px;
    /* isi navbar tetap sejajar konten (maks 1720px), latar selebar layar */
    padding: 14px max(28px, calc((100% - 1664px) / 2));
    background: rgba(238, 241, 246, .86);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    backdrop-filter: saturate(160%) blur(12px);
    transition: box-shadow .2s ease, background-color .2s ease;
}
.topnav.tergulir { background: rgba(238, 241, 246, .96); box-shadow: 0 6px 20px rgba(16, 24, 40, .08); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-logo {
    width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px;
    background: var(--sapphire); color: var(--gold);
    display: grid; place-items: center; font-size: 20px;
}
.brand-logo.has-img { background: #fff; border: 1px solid var(--primary-line); padding: 3px; overflow: hidden; }
.brand-logo.has-img img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.brand-text { line-height: 1.15; min-width: 0; }
.brand-text b { display: block; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.brand-text small { color: var(--muted); font-size: 12px; }

.nav-pill {
    display: flex; align-items: center; gap: 2px;
    background: var(--card); border-radius: 999px; padding: 5px;
    box-shadow: var(--shadow);
    margin: 0 auto;
}
.nav-pill .nav-top {
    border: 0; background: transparent; color: var(--ink-2);
    font-size: 14.5px; font-weight: 500; padding: 9px 16px; border-radius: 999px;
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer;
}
.nav-pill .nav-top:hover { background: var(--soft); color: var(--ink); }
.nav-pill .nav-top.active { background: var(--sapphire); color: #fff; font-weight: 600; }
.nav-pill .nav-top .icon-chevron-down { font-size: 11px; opacity: .6; }
.nav-pill .dropdown-menu, .mega {
    border: 0; border-radius: 18px; padding: 8px; min-width: 300px;
    box-shadow: 0 16px 40px rgba(16, 24, 40, .14);
}
.mega-item {
    display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; color: var(--ink);
}
.mega-item:hover { background: var(--soft); color: var(--ink); }
.mega-item.active { background: var(--ivory); }
.mega-ico {
    width: 36px; height: 36px; border-radius: 10px; flex: 0 0 36px; display: grid; place-items: center;
    background: var(--royal-soft); color: var(--royal); font-size: 17px;
}
.mega-item.active .mega-ico { background: var(--gold); color: var(--sapphire); }
.mega-item b { display: block; font-weight: 600; font-size: 14px; }
.mega-item small { color: var(--muted); font-size: 12.5px; }
.mega-badge { margin-left: auto; background: var(--gold); color: var(--sapphire); font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }

.nav-kanan { display: flex; align-items: center; gap: 10px; }
.ico-btn {
    width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card);
    color: var(--ink); display: grid; place-items: center; font-size: 18px; position: relative;
    box-shadow: var(--shadow); cursor: pointer;
}
.ico-btn:hover { background: #fff; color: var(--royal); }
.ico-badge {
    position: absolute; top: -2px; right: -2px; min-width: 19px; height: 19px; padding: 0 5px;
    background: var(--gold); color: var(--sapphire); border-radius: 999px; font-size: 11px; font-weight: 700;
    display: grid; place-items: center; border: 2px solid var(--bg);
}
.user-btn {
    display: flex; align-items: center; gap: 8px; background: var(--card); border: 0; border-radius: 999px;
    padding: 4px 12px 4px 4px; box-shadow: var(--shadow); cursor: pointer; color: var(--ink);
}
.avatar {
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 36px;
    color: #fff; font-weight: 700; font-size: 13px; background: var(--royal);
}
.avatar.sm { width: 32px; height: 32px; flex-basis: 32px; font-size: 12px; }
.av-1 { background: #F97316; } .av-2 { background: #6366F1; } .av-3 { background: #EC4899; }
.av-4 { background: #1E88E5; } .av-5 { background: #12A150; }
.user-btn .icon-chevron-down { font-size: 12px; color: var(--muted); }
.drop-panel { border: 0; border-radius: 18px; padding: 8px; box-shadow: 0 16px 40px rgba(16, 24, 40, .14); min-width: 240px; }
.drop-panel .dropdown-item { border-radius: 10px; padding: 9px 12px; display: flex; gap: 10px; align-items: center; }
.drop-panel .dropdown-item:active { background: var(--royal); }
.drop-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.drop-head b { display: block; }
.drop-head small { color: var(--muted); }

.notif-panel { width: 360px; max-height: 70vh; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink); }
.notif-item:hover { background: var(--soft); color: var(--ink); }
.notif-ico { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px; display: grid; place-items: center; }
.notif-ico.warn { background: var(--warn-soft); color: var(--warn); }
.notif-ico.info { background: var(--info-soft); color: var(--info); }
.notif-ico.dang { background: var(--dang-soft); color: var(--dang); }
.notif-title { font-weight: 600; font-size: 13.5px; }
.notif-sub { color: var(--muted); font-size: 12.5px; }
.notif-empty { padding: 18px 12px; color: var(--muted); text-align: center; }
.notif-label { font-size: 11.5px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px 4px; }

.btn-menu-hp { display: none; }
.offcanvas-menu .offcanvas-body { padding: 10px; }
.offcanvas-menu .grup-label { font-size: 11.5px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; padding: 12px 12px 4px; }

/* ============================== ISI HALAMAN ============================== */
.content { max-width: 1720px; margin: 0 auto; padding: 14px 28px 10px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 27px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.page-sub { color: var(--muted); font-size: 15px; margin: 2px 0 0; }
.page-head .aksi { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.card-x {
    background: var(--card); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow);
    min-width: 0;
}
.card-x + .card-x { margin-top: 20px; }
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title { font-size: 18px; font-weight: 600; margin: 0; }
.card-sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.card-head .ms-auto { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Kartu statistik (contoh-ui: Karyawan Aktif, Hadir Hari Ini) */
.stat-card { background: #fff; border: 1px solid var(--primary-line); border-radius: var(--radius); padding: 22px 24px; height: 100%; display: flex; flex-direction: column; min-width: 0; }
.stat-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.stat-label { color: var(--ink-2); font-size: 15px; }
.stat-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; flex: 0 0 44px; }
.stat-ico.blue { background: var(--royal-soft); color: var(--royal); }
.stat-ico.gold { background: var(--gold-soft); color: var(--gold-2); }
.stat-ico.navy { background: #E2E8F3; color: var(--sapphire); }
.stat-ico.red { background: var(--dang-soft); color: var(--dang); }
.stat-ico.green { background: var(--succ-soft); color: var(--succ); }
.stat-value { font-size: 36px; font-weight: 700; margin-top: auto; padding-top: 18px; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.stat-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.stat-foot a { color: var(--ink-2); white-space: nowrap; }
.stat-foot a:hover { color: var(--royal); }

/* Kotak ringkas berwarna (contoh-ui: Status Karyawan) */
.tile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.tile { background: #fff; border: 1px solid var(--primary-line); border-radius: 16px; padding: 16px 18px; min-width: 0; }
.tile.hl { background: #fff; border-color: rgba(0, 45, 114, .3); }
.tile-label { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; }
.tile-dot { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 11px; }
.tile-value { font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile-sub { color: var(--muted-2); font-size: 12.5px; }

.big-number { font-size: 38px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; }
.chip.gold { background: var(--gold-soft); color: var(--gold-2); }
.chip.blue { background: var(--royal-soft); color: var(--royal); }
.legend-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; }
.legend-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--muted-2)); }

/* Bar bergaris (contoh-ui: Komposisi Karyawan) */
.stripe-bar { height: 34px; border-radius: 8px; background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 8px); }
.mini-list { width: 100%; }
.mini-list td, .mini-list th { padding: 11px 4px; border-bottom: 1px solid var(--line); }
.mini-list th { color: var(--ink-2); font-weight: 500; font-size: 13.5px; }
.mini-list tr:last-child td { border-bottom: 0; }

/* ============================== TOMBOL ============================== */
.btn-brand, .btn-save, .btn-danger, .btn-ghost, .btn-text, .btn-gold, .btn-outline {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 999px;
    font-weight: 600; font-size: 14px; padding: 10px 20px; border: 1px solid transparent; cursor: pointer;
    white-space: nowrap; line-height: 1.2; text-decoration: none;
}
.btn-brand, .btn-save { background: var(--royal); color: #fff; }
.btn-brand:hover, .btn-save:hover { background: #1576CC; color: #fff; }
.btn-gold { background: var(--gold); color: var(--sapphire); }
.btn-gold:hover { background: #F0A010; color: var(--sapphire); }
.btn-danger { background: var(--dang); color: #fff; }
.btn-danger:hover { background: #CF3B40; color: #fff; }
.btn-ghost, .btn-outline { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover, .btn-outline:hover { background: var(--soft); color: var(--ink); }
.btn-text { background: transparent; color: var(--ink-2); }
.btn-text:hover { background: var(--soft); }
button:disabled { opacity: .6; cursor: not-allowed; }
.btn-sm-x { padding: 7px 14px; font-size: 13px; }

.btn-icon-sm {
    width: 32px; height: 32px; border-radius: 10px; border: 0; display: inline-grid; place-items: center;
    background: var(--soft); color: var(--ink-2); font-size: 14px; cursor: pointer;
}
.btn-icon-sm:hover { background: var(--line); }
.btn-icon-sm.info { color: var(--royal); background: var(--royal-soft); }
.btn-icon-sm.warn { color: var(--gold-2); background: var(--gold-soft); }
.btn-icon-sm.dang { color: var(--dang); background: var(--dang-soft); }
.btn-icon-sm.succ { color: var(--succ); background: var(--succ-soft); }

/* ============================== BADGE ============================== */
.badge-soft { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge-soft.succ { background: var(--succ-soft); color: var(--succ); }
.badge-soft.warn { background: var(--warn-soft); color: var(--warn); }
.badge-soft.dang { background: var(--dang-soft); color: var(--dang); }
.badge-soft.info { background: var(--info-soft); color: var(--info); }
.badge-soft.muted { background: var(--soft); color: var(--muted); }
.badge-soft.navy { background: #E2E8F3; color: var(--sapphire); }
.badge-soft.gold { background: var(--gold-soft); color: var(--gold-2); }
.kode { font-weight: 700; color: var(--sapphire); font-size: 13px; letter-spacing: .01em; }

/* ============================== TOOLBAR & FILTER ============================== */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .ms-auto { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.searchbox { position: relative; display: flex; align-items: center; }
.searchbox i { position: absolute; left: 15px; color: var(--muted); pointer-events: none; }
.searchbox input {
    border: 1px solid var(--line-2); border-radius: 999px; padding: 9px 16px 9px 40px; min-width: 240px;
    font-size: 14px; background: #fff; outline: none; color: var(--ink);
}
.searchbox input:focus { border-color: var(--royal); box-shadow: 0 0 0 3px var(--royal-soft); }
.filter-select, .toolbar .form-select, .toolbar .form-control {
    border: 1px solid var(--line-2); border-radius: 999px; padding: 9px 36px 9px 16px; font-size: 14px; width: auto; min-width: 140px;
}
.toolbar .form-control[type=date] { padding-right: 14px; }
.toolbar label.mini { font-size: 12px; color: var(--muted); display: block; margin: 0 0 2px 12px; }
.tabs-x { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs-x a, .tabs-x button {
    border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 15px; padding: 6px 12px; border-radius: 999px;
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.tabs-x a:hover, .tabs-x button:hover { color: var(--ink); background: var(--soft); }
.tabs-x .active { color: var(--ink); background: var(--soft); }
.tabs-x .count { background: var(--line); color: var(--ink-2); border-radius: 999px; font-size: 11.5px; padding: 0 8px; min-width: 22px; text-align: center; }
.tabs-x .active .count { background: var(--gold); color: var(--sapphire); }

/* ============================== TABEL ============================== */
.table-wrap { border: 1px solid var(--line); border-radius: 16px; overflow-x: auto; }
.table-wrap table { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; }
.table-x th, .table-wrap table.table th {
    background: var(--soft); color: var(--ink-2); font-weight: 500; font-size: 13.5px; padding: 13px 16px;
    border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left;
}
.table-x td, .table-wrap table.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink); background: #fff; }
.table-wrap table tbody tr:last-child td { border-bottom: 0; }
.table-wrap table tbody tr:hover td { background: #FBFCFE; }
.table-wrap table tbody tr.terpilih td { background: var(--ivory); }
.table-wrap table tfoot td, .table-wrap table tfoot th { background: var(--soft); font-weight: 700; padding: 12px 16px; border-top: 1px solid var(--line); }
.table-wrap .text-end { text-align: right !important; }
.table-wrap .text-center { text-align: center !important; }
table.dataTable thead .sorting, table.dataTable thead .sorting_asc, table.dataTable thead .sorting_desc { cursor: pointer; }
table.dataTable thead .sorting_asc::after { content: " \2191"; color: var(--royal); }
table.dataTable thead .sorting_desc::after { content: " \2193"; color: var(--royal); }
td.dataTables_empty { text-align: center; color: var(--muted) !important; padding: 34px !important; }
.cell-title { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 12.5px; }
.person { display: flex; align-items: center; gap: 12px; }
.minus { color: var(--dang) !important; }
.plus { color: var(--succ) !important; }

.table-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.table-info { color: var(--muted); font-size: 13.5px; }
.pagination { margin: 0 0 0 auto; display: flex; gap: 4px; list-style: none; padding: 0; }
.pagination .page-link {
    border: 0; border-radius: 10px !important; min-width: 34px; height: 34px; display: grid; place-items: center;
    color: var(--ink-2); background: transparent; font-size: 13.5px; padding: 0 8px;
}
.pagination .page-item.active .page-link { background: var(--sapphire); color: #fff; }
.pagination .page-item.disabled .page-link { color: var(--muted-2); }
.pagination .page-link:hover { background: var(--soft); }

/* Tabel laporan (report stok) dgn sel gabung */
.table-report { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table-report th, .table-report td { border: 1px solid var(--line); padding: 9px 12px; }
.table-report thead th { background: var(--soft); text-align: center; font-weight: 600; color: var(--ink-2); }
.table-report td.grup { font-weight: 700; color: var(--sapphire); background: #FAFBFD; text-align: center; vertical-align: middle; }
.table-report tr.total td { background: var(--ivory); font-weight: 700; }
.table-report .text-end { text-align: right; }

/* ============================== FORM (modern) ==============================
   Field 44px, latar lembut -> putih + cincin biru saat fokus. Error baru tampil
   setelah user selesai mengisi / mencoba simpan (:user-invalid), bukan saat
   modal baru dibuka. */
.form-label {
    display: flex; align-items: center; gap: 4px;
    font-weight: 600; font-size: 12.5px; color: var(--ink-2); margin-bottom: 7px; letter-spacing: .01em;
}
.form-label code { color: var(--dang); font-family: inherit; font-size: 13px; font-weight: 700; padding: 0; background: none; }
.form-control, .form-select {
    min-height: 44px; border: 1px solid #DDE2EA; border-radius: 12px; padding: 10px 14px;
    font-size: 14px; color: var(--ink); background-color: #FBFCFE;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.form-select { padding-right: 40px; background-position: right 14px center; background-size: 14px 10px; }
.form-control::placeholder { color: var(--muted-2); opacity: 1; }
.form-control:hover:not(:focus):not(:disabled):not([readonly]), .form-select:hover:not(:focus):not(:disabled) { border-color: #B9C2D0; }
.form-control:focus, .form-select:focus {
    background-color: #fff; border-color: var(--royal); box-shadow: 0 0 0 4px rgba(30, 136, 229, .16); outline: none;
}
.form-control[readonly] { background: var(--soft); border-style: dashed; color: var(--ink-2); }
.form-control:disabled, .form-select:disabled { background-color: var(--soft); color: var(--muted); opacity: 1; }
textarea.form-control { min-height: 88px; resize: vertical; }
input[type=date].form-control { cursor: pointer; }
input[type=date]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; border-radius: 6px; padding: 2px; }
input[type=date]::-webkit-calendar-picker-indicator:hover { opacity: 1; background: var(--royal-soft); }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
input[type=checkbox], input[type=radio] { accent-color: var(--royal); }
.input-angka { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .01em; }

/* Error setelah interaksi (Baseline widely available) */
.form-control:user-invalid, .form-select:user-invalid { border-color: var(--dang); background-color: #FFFBFB; }
.form-control:user-invalid:focus, .form-select:user-invalid:focus { box-shadow: 0 0 0 4px rgba(229, 72, 77, .15); }
[class*="col"]:has(> :user-invalid) > .form-label { color: var(--dang); }

.form-hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; line-height: 1.45; }

/* Select2 disamakan dgn field biasa */
.select2-container--default .select2-selection--single {
    min-height: 44px; height: 44px; border: 1px solid #DDE2EA; border-radius: 12px; background: #FBFCFE;
    display: flex; align-items: center; transition: border-color .15s ease, box-shadow .15s ease;
}
.select2-container--default .select2-selection--single:hover { border-color: #B9C2D0; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single { background: #fff; border-color: var(--royal); box-shadow: 0 0 0 4px rgba(30, 136, 229, .16); }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 42px; padding-left: 14px; padding-right: 34px; color: var(--ink); }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--muted-2); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 42px; right: 8px; }
.select2-dropdown { border: 1px solid #DDE2EA; border-radius: 12px; overflow: hidden; box-shadow: 0 14px 34px rgba(16, 24, 40, .14); }
.select2-container--open .select2-dropdown--below { margin-top: 6px; }
.select2-container--open .select2-dropdown--above { margin-top: -6px; }
.select2-search--dropdown { padding: 8px; }
.select2-search--dropdown .select2-search__field { border: 1px solid #DDE2EA; border-radius: 10px; padding: 8px 10px; outline: none; }
.select2-search--dropdown .select2-search__field:focus { border-color: var(--royal); box-shadow: 0 0 0 3px rgba(30, 136, 229, .16); }
.select2-results__option { padding: 9px 12px; font-size: 13.5px; }
.select2-container--default .select2-results__option--highlighted[aria-selected], .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--royal); }
.select2-container--default .select2-results__option--selected { background: var(--royal-soft); color: var(--sapphire); }

/* Tabel baris detail (CK-1, request, pelekatan) */
.detail-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; margin-top: -8px; }
.detail-table thead th { font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 0 6px; white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
.detail-table tbody td { padding: 8px 6px; vertical-align: middle; background: var(--soft); }
.detail-table tbody td:first-child { border-radius: 12px 0 0 12px; padding-left: 10px; }
.detail-table tbody td:last-child { border-radius: 0 12px 12px 0; padding-right: 10px; }
.detail-table .form-control, .detail-table .form-select { min-height: 40px; padding: 8px 12px; background-color: #fff; }
.detail-table .select2-container--default .select2-selection--single { min-height: 40px; height: 40px; background: #fff; }
.detail-table .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 38px; }
.detail-table .select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px; }
.detail-table tfoot td { padding: 10px 6px 0; font-weight: 700; }
.detail-table tfoot td.text-end { padding-right: 19px; }
.btn-tambah-baris {
    border: 1.5px dashed #C7D3E6; background: transparent; border-radius: 12px; padding: 10px 14px;
    color: var(--royal); font-weight: 600; width: 100%; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn-tambah-baris:hover { background: var(--royal-soft); border-color: var(--royal); }
.info-box { background: var(--ivory); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; color: var(--ink-2); }
.info-box.blue { background: var(--royal-soft); }
.info-box.red { background: var(--dang-soft); color: #9B1C1F; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; }

/* ============================== MODAL ============================== */
.modal-content { border: 0; border-radius: 24px; box-shadow: 0 24px 60px rgba(16, 24, 40, .22); }
.modal-header { border-bottom: 1px solid var(--line); padding: 18px 24px; }
.modal-title-custom { font-size: 18px; font-weight: 700; margin: 0; }
.modal-x { margin-left: auto; border: 0; background: var(--soft); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.modal-x:hover { background: var(--line); }
.modal-body { padding: 20px 24px; }
.modal-footer { border-top: 1px solid var(--line); padding: 14px 24px; gap: 8px; }
.loading-box { padding: 48px; text-align: center; color: var(--muted); }
.modal-confirm .modal-body { display: flex; gap: 16px; align-items: flex-start; }
.confirm-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 46px; font-size: 20px; }
.confirm-ico.dang { background: var(--dang-soft); color: var(--dang); }
.confirm-ico.warn { background: var(--warn-soft); color: var(--warn); }
.confirm-ico.info { background: var(--info-soft); color: var(--info); }
.confirm-title { font-size: 17px; font-weight: 700; margin: 2px 0 6px; }
.confirm-text { color: var(--muted); margin: 0; }
.modal-confirm .modal-footer { border-top: 0; padding-top: 0; }

/* ============================== TOAST ============================== */
.toast-stack { position: fixed; top: 84px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 40px); }
.toast-item {
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; background: #fff;
    border-radius: 16px; padding: 12px 14px; min-width: 280px; max-width: 420px;
    box-shadow: 0 14px 36px rgba(16, 24, 40, .18); transform: translateX(30px); opacity: 0; transition: all .25s ease;
}
.toast-item.show { transform: none; opacity: 1; }
.toast-item.hide { transform: translateX(30px); opacity: 0; }
.toast-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 30px; color: #fff; }
.toast-item.success .toast-ico { background: var(--succ); }
.toast-item.error .toast-ico { background: var(--dang); }
.toast-item.info .toast-ico { background: var(--royal); }
.toast-msg { flex: 1; font-size: 14px; }
.toast-close { border: 0; background: transparent; color: var(--muted); }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--gold); transform-origin: left; }

/* ============================== FOOTER ============================== */
.foot { text-align: center; color: var(--muted-2); font-size: 13px; padding: 26px 16px 30px; }
.foot b { color: var(--muted); }

/* ============================== LOGIN ============================== */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.login-hero {
    background: var(--sapphire); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden;
}
.login-hero::after {
    content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%;
    background: repeating-linear-gradient(90deg, rgba(249, 168, 37, .5) 0 6px, transparent 6px 14px);
}
.login-hero h1 { font-size: 40px; font-weight: 700; line-height: 1.15; margin: 0 0 14px; max-width: 520px; }
.login-hero p { color: #C9D6EE; font-size: 16px; max-width: 480px; }
.login-hero .brand-text b { color: #fff; }
.login-hero .brand-text small { color: #C9D6EE; }
.login-hero .brand-logo { background: var(--gold); color: var(--sapphire); }
.login-fitur { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.login-fitur span { background: rgba(255, 255, 255, .1); border-radius: 999px; padding: 6px 14px; font-size: 13px; }
.login-box { display: grid; place-items: center; padding: 32px 20px; }
.login-card { background: #fff; border-radius: 26px; padding: 34px; width: 100%; max-width: 420px; box-shadow: var(--shadow); }
.login-card h2 { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.login-demo { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.login-demo-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.login-demo-item { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 10px; text-align: left; cursor: pointer; }
.login-demo-item:hover, .login-demo-item.aktif { border-color: var(--royal); background: var(--royal-soft); }
.login-demo-item b { display: block; font-size: 13px; }
.login-demo-item small { color: var(--muted); font-size: 12px; }
.alert-soft { background: var(--dang-soft); color: #9B1C1F; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }

/* ============================== RESPONSIF ============================== */
@media (max-width: 1560px) {
    .brand-text small { display: none; }
    .brand-text b { max-width: 190px; font-size: 15px; }
    .topnav { gap: 12px; }
}
@media (max-width: 1280px) {
    .nav-pill .nav-top { padding: 9px 11px; font-size: 14px; }
    .nav-pill .nav-top > i:first-child { display: none; }
    .brand-text b { max-width: 160px; }
}
@media (max-width: 1100px) {
    .nav-pill { display: none; }
    .btn-menu-hp { display: grid; }
    .nav-kanan { margin-left: auto; }
}
@media (max-width: 768px) {
    .topnav { padding: 10px 16px; gap: 10px; }
    .content { padding: 14px 16px 10px; }
    .brand-text small, .user-btn .nama, .nav-kanan .ico-btn.hp-sembunyi { display: none; }
    .ico-btn { width: 40px; height: 40px; }
    .page-title { font-size: 22px; }
    .card-x, .stat-card { padding: 18px; border-radius: 18px; }
    .stat-value { font-size: 30px; }
    .searchbox input { min-width: 0; width: 100%; }
    .searchbox, .toolbar .ms-auto, .toolbar .ms-auto > * { width: 100%; }
    .filter-select, .toolbar .form-select, .toolbar .form-control { width: 100%; }
    .login-page { grid-template-columns: 1fr; }
    .login-hero { padding: 28px 22px; }
    .login-hero h1 { font-size: 28px; }
    .kv { grid-template-columns: 110px 1fr; }
    .pagination { margin-left: 0; }
    .notif-panel { width: calc(100vw - 32px); }
}

/* ============================== CETAK ============================== */
@media print {
    body { background: #fff; }
    .no-print { display: none !important; }
}

/* ============================== HAK AKSES (Jabatan) ============================== */
:root { --lv0: #D0D5DD; --lv1: #7C9CC9; --lv2: #1E88E5; --lv3: #F9A825; --lv4: #002D72; }
.akses-strip { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.akses-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--lv0); }
.akses-dot.lv1 { background: var(--lv1); } .akses-dot.lv2 { background: var(--lv2); } .akses-dot.lv3 { background: var(--lv3); } .akses-dot.lv4 { background: var(--lv4); }
.akses-grup th { background: var(--ivory) !important; color: var(--sapphire) !important; font-weight: 700 !important; }
.akses-pilih { display: flex; gap: 6px; flex-wrap: wrap; }
.akses-pilih label { cursor: pointer; margin: 0; }
.akses-pilih input { position: absolute; opacity: 0; pointer-events: none; }
.akses-pilih label span { display: inline-block; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: #fff; }
.akses-pilih input:checked + span { color: #fff; border-color: transparent; }
.akses-pilih .lv0 input:checked + span { background: var(--muted-2); }
.akses-pilih .lv1 input:checked + span { background: var(--lv1); }
.akses-pilih .lv2 input:checked + span { background: var(--lv2); }
.akses-pilih .lv3 input:checked + span { background: var(--lv3); color: var(--sapphire); }
.akses-pilih .lv4 input:checked + span { background: var(--lv4); }
.akses-pilih input:disabled + span { opacity: .4; cursor: not-allowed; }
.akses-pilih input:focus-visible + span { box-shadow: 0 0 0 3px var(--royal-soft); }
.akses-na { display: inline-block; min-width: 58px; text-align: center; color: var(--muted-2); }

/* ============================== LOGO (Pengaturan) ============================== */
.logo-box { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.logo-preview {
    width: 112px; height: 112px; border-radius: 20px; border: 1.5px dashed #C7D3E6; background: var(--soft);
    display: grid; place-items: center; overflow: hidden; color: var(--muted-2); font-size: 34px; flex: 0 0 112px;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; padding: 8px; background: #fff; }
.logo-aksi { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.logo-aksi .d-flex { gap: 8px; flex-wrap: wrap; }
.logo-aksi input[type=file] { display: none; }
/* Halaman login: nama perusahaan tampil penuh */
.login-hero .brand-text b { max-width: none; white-space: normal; font-size: 17px; }
.login-hero .brand-text small { display: block; }

/* ============================== JUDUL TABEL MENEMPEL ==============================
   Kotak tabel punya scroll sendiri (setinggi layar dikurangi navbar & judul halaman)
   supaya tetap bisa digeser ke samping di HP, dan baris <th> menempel di atasnya.
   Tabel bertingkat (2 baris judul, mis. Report Stok): posisi baris ke-2 dst diatur
   aturJudulTabel() di main.js. Pindah halaman / cari -> kembali ke atas (table-helper.js). */
.table-wrap, .report-wrap { overflow: auto; max-height: max(360px, calc(100vh - 230px)); overscroll-behavior: contain; }
.table-wrap thead th, .report-wrap thead th { position: sticky; top: 0; z-index: 3; }
.table-wrap thead th { box-shadow: inset 0 -1px 0 var(--line); }
.modal .table-wrap { max-height: none; }
.report-wrap { border-radius: 12px; border: 1px solid var(--line); }
/* Garis sel dibuat per sisi (bukan border-collapse) supaya ikut menempel saat digulir */
.table-report { border-collapse: separate; border-spacing: 0; }
.table-report th, .table-report td { border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.table-report tr > :last-child { border-right: 0; }
.table-report tbody tr:last-child td { border-bottom: 0; }
.table-report thead th { background: var(--soft); }

/* ============================== FORM TRANSAKSI (2 kolom + ringkasan) ==============================
   Dipakai CK-1, Request, Release, Terima, Pelekatan, Switching, Mutasi, Opname.
   Struktur: <form><div class="trx"><div class="trx-main">...</div><aside class="trx-side">...</aside></div></form>
   Tombol simpan ada di panel ringkasan (tanpa modal-footer). */
.modal-ajax-body { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; } /* isi non-form (detail) bisa di-scroll saat layar pendek / diperbesar */
.modal-ajax-body > form { display: flex; flex-direction: column; min-height: 0; }
.modal-ajax-body > form > .modal-body, .modal-ajax-body > .modal-body { overflow-y: auto; }
.trx { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 26px; align-items: start; padding: 24px 26px; overflow-y: auto; min-height: 0; }
.trx-main { min-width: 0; }
.trx-side {
    position: sticky; top: 0; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--sapphire);
    border-radius: 22px; padding: 20px 22px 22px;
}
.trx-side-label { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.trx-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; font-size: 14px; color: var(--ink-2); }
.trx-line b { color: var(--ink); font-variant-numeric: tabular-nums; }
.trx-line .form-control { max-width: 170px; min-height: 42px; }
.trx-sep { border-top: 1.5px dashed var(--line-2); margin: 12px 0 10px; }
.trx-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.trx-total span { color: var(--ink-2); font-size: 14px; }
.trx-total b { font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.trx-total small { display: block; text-align: right; color: var(--muted); font-size: 12.5px; width: 100%; margin-top: 2px; }
.trx-box { background: var(--soft); border-radius: 16px; padding: 14px 16px; margin-top: 16px; }
.trx-box .form-label { margin-bottom: 6px; }
.trx-box .form-control, .trx-box .form-select { background-color: #fff; }
.trx-box + .trx-box { margin-top: 10px; }
.trx-field { margin-top: 16px; }
.trx-section { display: flex; align-items: baseline; gap: 6px; font-weight: 700; font-size: 14px; color: var(--ink); margin: 22px 0 10px; }
.trx-section code { color: var(--dang); font-family: inherit; }
.trx-section small { font-weight: 500; color: var(--muted); font-size: 12.5px; margin-left: auto; }
.btn-trx {
    width: 100%; margin-top: 18px; border: 0; border-radius: 999px; padding: 14px 18px; background: var(--sapphire); color: #fff;
    font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
    transition: background .15s ease, transform .05s ease;
}
.btn-trx:hover { background: var(--sapphire-2); }
.btn-trx:active { transform: translateY(1px); }
.btn-trx-batal { width: 100%; margin-top: 6px; justify-content: center; }
.trx-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.45; }

/* Isian dgn satuan / awalan di dalam kotak: <div class="affix"><input><span>kpg</span></div> */
.affix { position: relative; }
.affix > .form-control { padding-right: 46px; }
.affix > span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 12.5px; font-weight: 600; pointer-events: none; }
.affix.pre > .form-control { padding-right: 14px; padding-left: 44px; text-align: left; }
.affix.pre > span { right: auto; left: 14px; }
.affix-lg > .form-control { min-height: 52px; font-size: 20px; font-weight: 700; }

/* Pilihan berbentuk pil (contoh lampiran: Lunas / Tempo) */
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 13px; color: var(--ink-2); transition: all .15s; }
.seg input:checked + span { background: var(--sapphire); border-color: var(--sapphire); color: #fff; }
.seg input:focus-visible + span { box-shadow: 0 0 0 4px rgba(30, 136, 229, .2); }
.seg.dang input:checked + span { background: var(--dang); border-color: var(--dang); }
.seg.succ input:checked + span { background: var(--succ); border-color: var(--succ); }

/* Baris detail versi lampiran: tiap baris kartu putih bergaris */
.trx .detail-table tbody td { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trx .detail-table tbody td:first-child { border-left: 1px solid var(--line); }
.trx .detail-table tbody td:last-child { border-right: 1px solid var(--line); }
.trx .detail-table .form-control, .trx .detail-table .form-select { background-color: #fff; }
.trx .detail-table .sel-total, .trx .detail-table .sel-keping { font-size: 15px; font-weight: 800; color: var(--ink); }
.trx .btn-tambah-baris { margin-top: 4px; padding: 12px; font-size: 14.5px; color: var(--ink); border-color: var(--line-2); }
.trx .btn-tambah-baris:hover { color: var(--royal); }
.trx-panel { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.stok-geser { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.stok-geser .icon-arrow-right { color: var(--muted-2); }

@media (max-width: 991.98px) {
    .trx { grid-template-columns: 1fr; padding: 18px; }
    .trx-side { position: static; }
}
.trx .detail-table td:last-child { width: 44px; }
.trx .detail-table .input-angka { padding-left: 8px; padding-right: 10px; }
.trx .detail-table .affix > .input-angka { padding-right: 40px; }
.seg .dang input:checked + span { background: var(--dang); border-color: var(--dang); }

/* ============================== SEL TABEL TIDAK TERLIPAT ==============================
   Angka, tanggal, kode, badge & nama tetap 1 baris ("12 btg", "Rp 17.825", "18 Nov 2026").
   Hanya kolom teks panjang (rincian / keterangan / alasan, ditandai inline max-width)
   yg boleh terlipat. Tabel lebar -> kotak tabel bisa digeser ke samping. */
.table-wrap td, .table-wrap th, .table-report td, .table-report th, .mini-list td, .mini-list th, .detail-table td { white-space: nowrap; }
.table-wrap td[style*="max-width"], .table-report td[style*="max-width"] { white-space: normal; min-width: 180px; }
.table-wrap td .cell-sub { white-space: nowrap; }
.table-wrap td[style*="max-width"] .cell-sub, .table-wrap td.cell-sub[style*="max-width"] { white-space: normal; }

/* ============================== MODAL MODERN ==============================
   Kerangka: latar blur, kartu membulat, animasi muncul, header berikon + subjudul
   (bukaModalAjax opsi `ikon` & `sub`). Isi detail memakai komponen dt-* di bawah. */
.modal-backdrop.show { opacity: 1; background: rgba(15, 23, 42, .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal-content { border-radius: 28px; overflow: hidden; box-shadow: 0 30px 80px rgba(2, 16, 52, .28); }
.modal.fade .modal-dialog { transform: translateY(14px) scale(.98); transition: transform .22s cubic-bezier(.2, .8, .2, 1), opacity .22s; }
.modal.show .modal-dialog { transform: none; }
.modal-header { padding: 18px 22px 18px 24px; gap: 14px; background: #fff; border-bottom: 1px solid var(--line); }
.modal-head-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 44px; background: var(--royal-soft); color: var(--royal); font-size: 20px; }
.modal-head-ico[hidden] { display: none; }
.modal-head-teks { min-width: 0; }
.modal-title-custom { font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.modal-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.modal-sub:empty { display: none; }
.modal-x { width: 38px; height: 38px; background: var(--soft); transition: background .15s, transform .15s; }
.modal-x:hover { background: var(--line); transform: rotate(90deg); }
.modal-footer { background: #FBFCFE; }

/* Hero dokumen: nomor besar + status + meta */
.dt-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border-radius: 20px;
    background: linear-gradient(135deg, var(--sapphire) 0%, #0B4AA8 100%); color: #fff; margin-bottom: 18px; position: relative; overflow: hidden; }
.dt-hero::after { content: ""; position: absolute; left: 38%; bottom: -120px; width: 220px; height: 220px; border-radius: 50%;
    background: repeating-linear-gradient(90deg, rgba(249, 168, 37, .22) 0 5px, transparent 5px 12px); pointer-events: none; }
.dt-hero-ico { width: 48px; height: 48px; border-radius: 14px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; font-size: 22px; flex: 0 0 48px; position: relative; z-index: 1; }
.dt-hero-main { min-width: 0; position: relative; z-index: 1; }
.dt-hero-kode { font-size: 22px; font-weight: 800; letter-spacing: .01em; line-height: 1.15; }
.dt-hero-sub { color: #C9D6EE; font-size: 13px; margin-top: 3px; }
.dt-hero-kanan { margin-left: auto; text-align: right; position: relative; z-index: 1; }
.dt-hero-kanan .angka { font-size: 26px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dt-hero-kanan small { color: #C9D6EE; font-size: 12px; }
.dt-hero .badge-soft { background: rgba(255, 255, 255, .16); color: #fff; }
.dt-hero .badge-soft.succ { background: #DDF7E6; color: #0B7A3B; }
.dt-hero .badge-soft.warn { background: var(--gold); color: var(--sapphire); }
.dt-hero .badge-soft.info { background: #D7E9FB; color: var(--sapphire); }
.dt-hero .badge-soft.dang { background: #FDE2E2; color: #B42318; }

/* Alur status (stepper) */
.dt-steps { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 0; margin: 4px 0 18px; }
.dt-step { position: relative; padding-top: 34px; text-align: center; padding-inline: 6px; }
.dt-step::before { content: ""; position: absolute; top: 13px; left: -50%; right: 50%; height: 3px; background: var(--line); }
.dt-step:first-child::before { display: none; }
.dt-step.selesai::before, .dt-step.aktif::before { background: var(--royal); }
.dt-step-dot { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    background: #fff; border: 2px solid var(--line-2); color: var(--muted-2); font-size: 14px; z-index: 1; }
.dt-step.selesai .dt-step-dot { background: var(--royal); border-color: var(--royal); color: #fff; }
.dt-step.aktif .dt-step-dot { background: var(--gold); border-color: var(--gold); color: var(--sapphire); box-shadow: 0 0 0 5px var(--gold-soft); }
.dt-step.gagal .dt-step-dot { background: var(--dang); border-color: var(--dang); color: #fff; }
.dt-step b { display: block; font-size: 13.5px; }
.dt-step small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }

/* Kartu info */
.dt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.dt-info { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: #fff; min-width: 0; }
.dt-info > span:first-child { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); }
.dt-info b { display: block; margin-top: 4px; font-size: 14.5px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.dt-info small { display: block; color: var(--muted); font-size: 12.5px; }
.dt-info.lebar { grid-column: 1 / -1; }

/* Strip total di bawah daftar */
.dt-total { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.dt-total > div { flex: 1 1 140px; border-radius: 16px; padding: 12px 16px; background: var(--soft); }
.dt-total > div.utama { background: var(--sapphire); color: #fff; }
.dt-total span { display: block; font-size: 12px; color: var(--muted); }
.dt-total .utama span { color: #C9D6EE; }
.dt-total b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dt-badan { padding: 22px 24px 24px; }

/* Dialog konfirmasi: ikon besar di tengah, tombol penuh */
.modal-confirm { max-width: 420px; }
.modal-confirm .modal-body { flex-direction: column; align-items: center; text-align: center; padding: 30px 28px 8px; gap: 6px; }
.modal-confirm .confirm-ico { width: 64px; height: 64px; flex-basis: 64px; font-size: 28px; margin-bottom: 8px; box-shadow: 0 0 0 8px rgba(229, 72, 77, .07); }
.modal-confirm .confirm-ico.warn { box-shadow: 0 0 0 8px rgba(224, 142, 0, .08); }
.modal-confirm .confirm-ico.info { box-shadow: 0 0 0 8px rgba(30, 136, 229, .08); }
.modal-confirm .confirm-title { font-size: 19px; }
.modal-confirm .konfirmasi-extra { width: 100%; text-align: left; }
.modal-confirm .modal-footer { background: #fff; padding: 16px 28px 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-confirm .modal-footer > * { width: 100%; margin: 0; padding: 12px; border-radius: 14px; }
.modal-confirm .modal-footer .btn-text { background: var(--soft); }
.modal-confirm .modal-footer .btn-text:hover { background: var(--line); }
.modal-confirm .modal-footer [hidden] { display: none; }
@media (max-width: 575.98px) {
    .dt-hero-kanan { margin-left: 0; text-align: left; width: 100%; }
    .dt-steps { font-size: 12px; }
}

/* Report Stok: kelompok kolom Office / Produksi / Total diberi warna & judul */
.table-report.rs thead th { font-size: 12.5px; }
.table-report.rs thead tr:first-child th.g-office, .table-report.rs thead tr:first-child th.g-prod, .table-report.rs thead tr:first-child th.g-total { text-transform: uppercase; letter-spacing: .06em; font-weight: 700; font-size: 12px; }
.table-report.rs th.g-office { background: #E3E9F4; color: var(--sapphire); }
.table-report.rs th.g-prod { background: var(--royal-soft); color: #0B5CAB; }
.table-report.rs th.g-total { background: var(--gold-soft); color: #8A5A00; }
.table-report.rs td.c-office { background: #F5F8FC; }
.table-report.rs td.c-prod { background: #F4F9FE; }
.table-report.rs td.c-total { background: #FFFCF2; }
.table-report.rs .text-start { text-align: left; }
.table-report.rs tfoot td { background: var(--ivory); font-weight: 700; border-top: 2px solid var(--line-2); }

/* ============================== DETAIL MODAL: GAYA DOKUMEN (tanpa blok warna solid) ==============================
   Menimpa versi hero biru: header dokumen = teks, info = daftar label -> nilai, total rata kanan. */
.dt-badan { padding: 24px 28px 26px; }
.dt-hero { background: none; color: var(--ink); padding: 0 0 18px; margin-bottom: 18px; border-radius: 0; border-bottom: 1px solid var(--line); gap: 12px 16px; align-items: flex-end; }
.dt-hero::after { display: none; }
.dt-hero-ico { display: none; }
.dt-hero-kode { font-size: 24px; font-weight: 750; letter-spacing: -.01em; color: var(--ink); }
.dt-hero-sub { color: var(--muted); }
.dt-hero-kanan .angka { font-size: 28px; color: var(--ink); }
.dt-hero-kanan small { color: var(--muted); }
.dt-hero .badge-soft { background: var(--soft); color: var(--ink-2); align-self: center; }
.dt-hero .badge-soft.succ { background: var(--succ-soft); color: var(--succ); }
.dt-hero .badge-soft.warn { background: var(--warn-soft); color: var(--warn); }
.dt-hero .badge-soft.info { background: var(--info-soft); color: var(--info); }
.dt-hero .badge-soft.dang { background: var(--dang-soft); color: var(--dang); }

.dt-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 28px; padding-bottom: 18px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.dt-info { border: 0; border-radius: 0; padding: 0; background: none; }
.dt-info > span:first-child { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.dt-info > span:first-child i { display: none; }
.dt-info b { font-size: 14.5px; margin-top: 2px; }

.dt-badan .detail-table { border-spacing: 0; margin-top: 4px; }
.dt-badan .detail-table thead th { font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); }
.dt-badan .detail-table tbody td { background: none; border-radius: 0 !important; padding: 11px 8px; border-bottom: 1px solid var(--line); }
.dt-badan .detail-table tbody tr:last-child td { border-bottom: 0; }

.dt-total { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; margin-top: 8px; border-top: 1.5px solid var(--ink); }
.dt-total > div, .dt-total > div.utama { background: none; color: var(--ink); border-radius: 0; padding: 12px 8px 0; text-align: right; }
.dt-total span, .dt-total .utama span { color: var(--muted); font-size: 12.5px; }
.dt-total b { font-size: 17px; font-weight: 700; }
.dt-total .utama b { font-size: 20px; color: var(--sapphire); }

.dt-steps { margin: 2px 0 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.dt-step.aktif .dt-step-dot { box-shadow: none; }

/* header modal: ikon tanpa blok warna */
.modal-head-ico { background: none; border: 1px solid var(--line); color: var(--ink-2); width: 40px; height: 40px; flex-basis: 40px; font-size: 18px; border-radius: 12px; }
/* Panel ringkasan form transaksi: tanpa blok abu solid */
.trx-box { background: #fff; border: 1px solid var(--line); }

/* ============================== TOOLBAR TABEL SEJAJAR ==============================
   Kontrol berlabel (Dari / Sampai) & tanpa label (cari, tombol) disejajarkan di DASAR,
   dan semua kontrol tinggi sama 44px. Judul kiri tetap di atas. */
.toolbar { align-items: flex-end; }
.toolbar > div:first-child:not(.ms-auto):not(.tabs-x) { align-self: center; }
.toolbar .ms-auto { align-items: flex-end; }
.toolbar .filter-periode { align-items: flex-end; }
.toolbar .form-control, .toolbar .form-select, .toolbar .searchbox input { height: 44px; min-height: 44px; padding-top: 0; padding-bottom: 0; }
.toolbar .btn-ghost, .toolbar .btn-brand { height: 44px; padding-top: 0; padding-bottom: 0; }
.toolbar .tabs-x { align-self: center; }
.toolbar label.mini { margin-bottom: 4px; line-height: 1.2; }

/* ============================== HEADER TABEL 1 BARIS ==============================
   Pola semua halaman daftar: [judul + keterangan | tab]  ......  [filter][periode][cari].
   Periode = 1 pil ringkas tanpa label (htmlFilterPeriode). Turun baris hanya di layar sempit. */
.toolbar { align-items: center; gap: 12px 16px; }
.toolbar > :first-child:not(.ms-auto):not(.filter-periode) { flex: 1 1 260px; min-width: 0; align-self: center; }
.toolbar .ms-auto { align-items: center; gap: 10px; flex: 0 1 auto; justify-content: flex-end; }
.toolbar .card-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filter-periode { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }

.periode-pill { display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 4px 0 14px; border: 1px solid var(--line-2);
    border-radius: 999px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.periode-pill:hover { border-color: #B9C2D0; }
.periode-pill:focus-within { border-color: var(--royal); box-shadow: 0 0 0 4px rgba(30, 136, 229, .16); }
.periode-pill > i { color: var(--muted); font-size: 16px; margin-right: 2px; }
.periode-pill input[type=date] { border: 0; background: transparent; height: 40px; padding: 0 2px; font-size: 14px; color: var(--ink); width: 128px; outline: none; font-variant-numeric: tabular-nums; }
.periode-pill input[type=date]::-webkit-calendar-picker-indicator { opacity: .45; margin-left: 2px; }
.periode-pill .sep { color: var(--muted-2); font-size: 12.5px; padding: 0 2px; }
.periode-pill .pp-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; margin-left: 4px;
    background: var(--soft); color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s; }
.periode-pill .pp-btn:hover { background: var(--sapphire); color: #fff; }

@media (max-width: 1200px) {
    .toolbar .ms-auto { flex-wrap: wrap; justify-content: flex-start; flex-basis: 100%; }
}
@media (max-width: 768px) {
    .periode-pill { width: 100%; justify-content: space-between; }
    .periode-pill input[type=date] { width: auto; flex: 1; min-width: 0; }
    .filter-periode { width: 100%; }
}

/* ============================== SCROLLBAR: PRIMARY SANGAT MUDA ============================== */
:root { --scroll-thumb: #D4E1F4; --scroll-thumb-hover: #B4CBEA; }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-corner { background: transparent; }

/* ============================== TABEL FREEZE PANE (ala hris_gatra_mapan) ==============================
   Tidak ada gulir atas-bawah di dalam tabel (max-height dilepas): tabel memanjang mengikuti
   halaman, judul kolom ikut menempel di bawah navbar lewat header melayang (main.js).
   Tabel lebar digeser ke samping: kolom pertama terkunci kiri, kolom Aksi terkunci kanan. */
.table-wrap, .report-wrap { max-height: none; overflow-x: auto; overflow-y: hidden; }
.table-wrap thead th, .report-wrap thead th { position: static; }
.table-wrap.freeze table tr > :first-child { position: sticky; left: 0; z-index: 2; }
.table-wrap.freeze.freeze-aksi table tr > :last-child { position: sticky; right: 0; z-index: 2; }
.table-wrap.freeze tbody tr > :first-child, .table-wrap.freeze.freeze-aksi tbody tr > :last-child { background: #fff; }
.table-wrap.freeze tbody tr:hover > :first-child, .table-wrap.freeze.freeze-aksi tbody tr:hover > :last-child { background: #FBFCFE; }
.table-wrap.freeze tbody tr.terpilih > :first-child, .table-wrap.freeze.freeze-aksi tbody tr.terpilih > :last-child { background: var(--ivory); }
/* bayangan tepi kolom beku hanya saat ada isi yg tersembunyi di sisi itu */
.table-wrap.geser-kiri table tr > :first-child { box-shadow: 6px 0 10px -6px rgba(16, 24, 40, .18); }
.table-wrap.freeze-aksi.geser-kanan table tr > :last-child { box-shadow: -6px 0 10px -6px rgba(16, 24, 40, .18); }

/* Header melayang (salinan thead) */
.thead-melayang { position: fixed; z-index: 1020; overflow: hidden; display: none; background: var(--soft);
    border: 1px solid var(--line); border-radius: 0 0 12px 12px; box-shadow: 0 8px 16px -10px rgba(16, 24, 40, .25); }
.thead-melayang table { border-collapse: separate; border-spacing: 0; margin: 0; }
.thead-melayang th { background: var(--soft); color: var(--ink-2); font-weight: 500; font-size: 13.5px; padding: 13px 16px; white-space: nowrap; border-bottom: 1px solid var(--line); text-align: left; box-sizing: border-box; }
.thead-melayang.report th { font-size: 12.5px; padding: 9px 12px; border: 1px solid var(--line); }
.thead-melayang.freeze th:first-child { position: sticky; left: 0; z-index: 2; }
.thead-melayang.freeze.freeze-aksi th:last-child { position: sticky; right: 0; z-index: 2; }

/* ============================== MEGA MENU NAVBAR (ala lampiran user) ==============================
   Panel putih lebar, kolom per seksi (judul seksi kecil kapital), item: ikon bulat abu muda +
   judul + keterangan; item aktif berlatar primary sangat muda. */
.nav-pill .dropdown-menu.mega { padding: 18px; border-radius: 22px; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(16, 24, 40, .14); margin-top: 10px !important; }
.mega { display: none; gap: 8px 18px; }
.mega.show { display: grid; }
.mega.mega-1 { grid-template-columns: 300px; }
.mega.mega-2 { grid-template-columns: repeat(2, 300px); }
.mega.mega-3 { grid-template-columns: repeat(3, 290px); }
.mega-kolom { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mega-seksi { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 2px 12px 8px; }
.mega-item { padding: 10px 12px; border-radius: 16px; gap: 14px; transition: background .12s; }
.mega-item:hover { background: #F7F9FC; }
.mega-ico { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; background: #F1F3F6; color: var(--ink-2); font-size: 18px; }
.mega-item b { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.mega-item small { font-size: 13px; color: var(--muted); line-height: 1.35; display: block; }
.mega-item.active { background: #EAF2FC; }
.mega-item.active .mega-ico { background: #fff; color: var(--sapphire); box-shadow: 0 0 0 1px #D6E4F7; }
.mega-item.active b { color: var(--sapphire); }
.offcanvas-menu .mega-item { margin-bottom: 2px; }
/* Sel gabungan (colspan, mis. baris total / "belum ada data") TIDAK ikut dibekukan:
   kalau ikut, sel lebar itu menempel di kiri / kanan dan menutupi kolom lain. */
.table-wrap.freeze table tr > [colspan]:first-child,
.table-wrap.freeze.freeze-aksi table tr > [colspan]:last-child { position: static; box-shadow: none; }

/* Tabel baris form transaksi yg kolomnya banyak (Request: merk, jalur, rencana produksi, qty):
   di layar kecil tabel bisa digeser ke samping, bukan dijepit */
@media (max-width: 767.98px) {
    .trx-geser { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
    .trx-geser > .detail-table { min-width: 660px; }
}
