/* ==========================================================================
   Toko Sembako POS — satu lembar gaya untuk semua halaman.
   Tema: 6 pilihan warna x 2 mode (terang/gelap), dipilih dari Pengaturan.
   Semua warna lewat variabel; jangan menulis warna tetap di view.
   ========================================================================== */

/* ---------- 1. Token ----------
   Identitas Kasirin: kertas hangat, tinta gelap, aksi limau.
   --primary  = warna aksi (tombol, sidebar aktif, grafik)
   --link     = warna teks yang harus terbaca di atas kertas
   --on-primary = teks di atas --primary (selalu kontras)
   ------------------------------------------------------------------ */
:root {
    --primary: #c9f25c;
    --primary-dark: #a9ce49;
    --primary-light: #edf4dc;
    --on-primary: #14210a;
    --link: #24330f;
    --accent: #a9ce49;
    --glow: 201, 242, 92;

    --bg: #f4f1e8;
    --surface: #fffdf7;
    --surface-2: #f7f4ea;
    --border: #ddd9cc;
    --border-strong: #c9c4b4;

    --text: #111310;
    --text-soft: #3c4038;
    --text-muted: #6c7065;

    --success: #1f6b45;
    --success-bg: #e6f4ec;
    --success-text: #14502f;
    --danger: #a52a2a;
    --danger-bg: #fbe9e7;
    --danger-text: #7e1d1d;
    --warning: #8a5a12;
    --warning-bg: #fbf1dc;
    --warning-text: #6b430a;
    --info: #2f5f6b;
    --info-bg: #e6f0f1;
    --info-text: #234a53;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-xs: 0 1px 0 rgba(17, 19, 16, .03);
    --shadow-sm: 0 1px 0 rgba(17, 19, 16, .04), 0 10px 22px -20px rgba(17, 19, 16, .4);
    --shadow: 0 1px 0 rgba(17, 19, 16, .04), 0 18px 34px -26px rgba(17, 19, 16, .45);
    --shadow-lg: 0 26px 60px -30px rgba(17, 19, 16, .55);
    --ring: 0 0 0 3px rgba(36, 51, 15, .13);
    --sidebar-w: 268px;
    --rail-w: 78px;
    --header-h: 60px;
    --font-sans: "Archivo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --sidebar-1: #0b0c0d;
    --sidebar-2: #101210;
}

/* Tema warna: pasangan aksi + tautan yang sudah diuji kontrasnya. */
html[data-theme="lime"]   { --primary:#c9f25c; --primary-dark:#a9ce49; --primary-light:#edf4dc; --on-primary:#14210a; --link:#24330f; --accent:#a9ce49; --glow:201,242,92; --sidebar-1:#0b0c0d; --sidebar-2:#101210; }
html[data-theme="olive"]  { --primary:#b7d97a; --primary-dark:#96b95a; --primary-light:#eef3df; --on-primary:#1d2a0b; --link:#2f4a10; --accent:#8fbf3f; --glow:183,217,122; --sidebar-1:#0d100a; --sidebar-2:#171d10; }
html[data-theme="clay"]   { --primary:#e8a077; --primary-dark:#cf8258; --primary-light:#fbeee6; --on-primary:#2a1308; --link:#6b3320; --accent:#d98a5f; --glow:232,160,119; --sidebar-1:#140d0a; --sidebar-2:#221410; }
html[data-theme="teal"]   { --primary:#8fdcc9; --primary-dark:#6ec0ac; --primary-light:#e3f6f1; --on-primary:#08211c; --link:#0f4a40; --accent:#5fb8a4; --glow:143,220,201; --sidebar-1:#07100f; --sidebar-2:#0e1c19; }
html[data-theme="plum"]   { --primary:#dcb0d5; --primary-dark:#c08fb8; --primary-light:#f6eaf4; --on-primary:#2a1026; --link:#4a2344; --accent:#b982b0; --glow:220,176,213; --sidebar-1:#120a11; --sidebar-2:#1e121c; }
html[data-theme="mono"]   { --primary:#d6d1c2; --primary-dark:#b8b2a2; --primary-light:#f0ede4; --on-primary:#1a1915; --link:#2b2a24; --accent:#a39d8c; --glow:214,209,194; --sidebar-1:#0b0b0a; --sidebar-2:#151512; }

html[data-mode="dark"] {
    --bg: #0b0c0d;
    --surface: #141613;
    --surface-2: #1a1c18;
    --border: #2a2c26;
    --border-strong: #3a3d35;
    --text: #f1efe6;
    --text-soft: #c9cbc0;
    --text-muted: #9b9e93;
    --link: #e5e2d4;
    --primary-light: #2a3320;
    --success-bg: #0e2b1e; --success-text: #7fd6a8;
    --danger-bg: #321413; --danger-text: #f0a9a2;
    --warning-bg: #2e2310; --warning-text: #e8c07a;
    --info-bg: #13262a; --info-text: #a7d5de;
    --shadow-xs: 0 1px 0 rgba(0,0,0,.5);
    --shadow-sm: 0 1px 0 rgba(0,0,0,.5), 0 10px 22px -20px #000;
    --shadow: 0 1px 0 rgba(0,0,0,.5), 0 18px 34px -26px #000;
    --shadow-lg: 0 26px 60px -30px #000;
    --ring: 0 0 0 3px rgba(201, 242, 92, .16);
    --sidebar-1: #080908;
    --sidebar-2: #0e100e;
}
html[data-mode="dark"][data-theme="lime"]  { --link:#d8f39a; --primary-light:#29331a; }
html[data-mode="dark"][data-theme="olive"] { --link:#d3e6a9; --primary-light:#242d17; }
html[data-mode="dark"][data-theme="clay"]  { --link:#f0c3a6; --primary-light:#33211a; }
html[data-mode="dark"][data-theme="teal"]  { --link:#b3ece0; --primary-light:#122a25; }
html[data-mode="dark"][data-theme="plum"]  { --link:#ecc7e6; --primary-light:#2b1a28; }
html[data-mode="dark"][data-theme="mono"]  { --link:#e7e2d4; --primary-light:#2a2822; }

/* ---------- 2. Dasar ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-sans);
    background: var(--bg); color: var(--text);
    margin: 0; font-size: 14px; line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--text); }
h1, h2, h3, h4 { color: var(--text); letter-spacing: -.02em; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- 3. Kerangka ---------- */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    background: linear-gradient(180deg, var(--sidebar-1) 0%, var(--sidebar-2) 100%);
    color: #e7e7ef;
    position: fixed; inset: 0 auto 0 0;
    display: flex; flex-direction: column;
    z-index: 50;
    transition: width .2s ease, transform .22s ease;
}

.main {
    flex: 1; margin-left: var(--sidebar-w); min-width: 0;
    padding: 22px clamp(14px, 2.2vw, 30px) 40px;
    transition: margin-left .2s ease;
}
.main-inner { max-width: 1440px; margin: 0 auto; }

/* --- tombol kerangka (hamburger, mode) --- */
.mobile-bar { display: none; }

/* ---------- 4. Sidebar ---------- */
.sidebar-brand {
    display: flex; align-items: center; gap: 12px; flex-shrink: 0;
    padding: 16px 14px; border-bottom: 1px solid rgba(255,255,255,.09);
}
.sidebar-brand .logo {
    width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
    background: var(--primary); color: #fff; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 18px;
}
.sidebar-brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-brand .brand-txt { min-width: 0; }
.sidebar-brand .name { font-weight: 700; font-size: 14.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand .sub { font-size: 11px; color: rgba(255,255,255,.5); }
.sidebar-x { display: none; margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.7); cursor: pointer; padding: 4px; }
.sidebar-rail {
    display: none; margin-left: auto; background: rgba(255,255,255,.07);
    border: 0; color: rgba(255,255,255,.72); cursor: pointer;
    padding: 7px; border-radius: 9px; line-height: 0;
}
@media (min-width: 1025px) {
    .sidebar-rail { display: inline-flex; }
    html[data-rail="1"] .sidebar-rail { margin: 0 auto; }
    html[data-rail="1"] .sidebar-brand { flex-direction: column; gap: 8px; padding: 14px 8px; }
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px 16px; overscroll-behavior: contain; }
.nav-group {
    font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
    color: rgba(255,255,255,.38); font-weight: 700;
    padding: 16px 12px 7px;
}
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: 12px; margin-bottom: 3px;
    color: rgba(255,255,255,.8); font-weight: 500;
    transition: background .14s, color .14s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav a.active {
    background: var(--primary); color: #fff;
    box-shadow: 0 6px 16px rgba(var(--glow), .45);
}
.sidebar-nav a .ico { width: 20px; height: 20px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.sidebar-nav a .ico svg { display: block; }
.sidebar-nav a .txt { min-width: 0; display: flex; flex-direction: column; }
.sidebar-nav a .t-label { font-size: 13.5px; line-height: 1.3; }
.sidebar-nav a .t-desc {
    font-size: 10.5px; line-height: 1.3; font-weight: 400;
    color: rgba(255,255,255,.5); margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-nav a.active .t-desc { color: rgba(255,255,255,.85); }

.sidebar-foot { flex-shrink: 0; padding: 12px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-foot .user { display: flex; align-items: center; gap: 10px; }
.sidebar-foot .avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    background: var(--accent); color: #241a02; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.sidebar-foot .u-txt { min-width: 0; flex: 1; }
.sidebar-foot .u-name { display: block; font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-foot .u-role { font-size: 11px; color: rgba(255,255,255,.5); }
.sidebar-foot .u-out { color: rgba(255,255,255,.55); display: inline-flex; padding: 6px; border-radius: 8px; }
.sidebar-foot .u-out:hover { color: #fff; background: rgba(255,255,255,.1); }

/* --- sidebar jadi rel ikon (layar sedang / desktop diciutkan) --- */
@media (min-width: 1025px) {
    html[data-rail="1"] .sidebar { width: var(--rail-w); }
    html[data-rail="1"] .main { margin-left: var(--rail-w); }
    html[data-rail="1"] .sidebar-brand { justify-content: center; padding: 16px 8px; }
    html[data-rail="1"] .sidebar-brand .brand-txt,
    html[data-rail="1"] .sidebar-nav .t-desc,
    html[data-rail="1"] .sidebar-nav .t-label,
    html[data-rail="1"] .nav-group,
    html[data-rail="1"] .sidebar-foot .u-txt { display: none; }
    html[data-rail="1"] .sidebar-nav a { justify-content: center; padding: 11px 0; }
    html[data-rail="1"] .sidebar-foot .user { justify-content: center; }
    html[data-rail="1"] .sidebar-foot .u-out { display: none; }
}
/* Rail otomatis dihapus: di bawah 1025px sidebar menjadi drawer penuh.
   Rail tetap tersedia lewat tombol #railToggle di desktop. */

/* ---------- 5. Header halaman ---------- */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 20px;
}
.topbar h1 { font-size: 21px; font-weight: 700; margin: 0; }
.topbar .lead { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- 6. Kartu & statistik ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-xs);
    padding: 20px;
}
.grid { display: grid; gap: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

.stat-card {
    position: relative; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 18px;
    box-shadow: var(--shadow-xs);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.stat-card .label { font-size: 12px; color: var(--text-muted); font-weight: 600; letter-spacing: .01em; }
.stat-card .value { font-size: 23px; font-weight: 800; margin-top: 7px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.stat-card .delta { font-size: 12px; margin-top: 7px; color: var(--text-muted); }
/* ikon lama (halaman laporan/kas/gudang) menempel di pojok kartu;
   .kpi-ico di dashboard baru TIDAK boleh kena aturan ini. */
.stat-card .icon:not(.kpi-ico) {
    position: absolute; top: 16px; right: 16px;
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.icon.purple { background: var(--primary-light); color: var(--primary-dark); }
.icon.green  { background: var(--success-bg); color: var(--success-text); }
.icon.orange { background: var(--warning-bg); color: var(--warning-text); }
.icon.red    { background: var(--danger-bg); color: var(--danger-text); }
.icon.blue   { background: var(--info-bg); color: var(--info-text); }

/* kartu KPI gaya dashboard baru */
.kpi { display: flex; align-items: flex-start; gap: 14px; }
.kpi .kpi-body { min-width: 0; flex: 1; }
.kpi .kpi-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.kpi .kpi-value { font-size: 24px; font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; margin-top: 4px; line-height: 1.15; }
.kpi .kpi-note { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }
.kpi .kpi-ico { width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.kpi-spark { display: flex; align-items: flex-end; gap: 3px; height: 26px; margin-top: 10px; }
.kpi-spark i { flex: 1; background: var(--primary-light); border-radius: 2px; min-height: 3px; }
.kpi-spark i.on { background: var(--primary); }

/* ---------- 7. Tombol ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 15px; border-radius: 11px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text);
    font: inherit; font-weight: 600; font-size: 13.5px; line-height: 1.2;
    cursor: pointer; transition: background .14s, border-color .14s, transform .1s, box-shadow .14s;
    white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn:active { transform: translateY(1px); }
.btn svg { flex-shrink: 0; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--on-primary); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.92); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 13px; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; border-radius: 10px; }
.btn-outline-primary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-outline-secondary { background: transparent; color: var(--text-soft); }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 8. Form ---------- */
.form-group { margin-bottom: 15px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--text-soft); }
.form-control, .form-select {
    width: 100%; padding: 10px 13px; font: inherit; font-size: 14px;
    color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 11px;
    transition: border-color .14s, box-shadow .14s;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.form-control-sm { padding: 6px 10px; font-size: 13px; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-text { font-size: 12px; color: var(--text-muted); }
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.form-check-input { width: 17px; height: 17px; accent-color: var(--primary); margin: 0; flex-shrink: 0; }
.form-check-label { font-size: 13.5px; cursor: pointer; }

/* ---------- 9. Tabel ---------- */
.table-wrap {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-xs);
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left; padding: 12px 15px; white-space: nowrap;
    font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-muted); font-weight: 700;
    background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.table td { padding: 12px 15px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num, .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 10. Lencana & peringatan ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-danger  { background: var(--danger-bg); color: var(--danger-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-info    { background: var(--info-bg); color: var(--info-text); }
.badge-purple  { background: var(--primary-light); color: var(--primary-dark); }
.badge-gray    { background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border); }

.alert { padding: 12px 15px; border-radius: 12px; margin-bottom: 15px; font-size: 13.5px; border: 1px solid transparent; }
.alert-danger  { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success-text); border-color: var(--success); }

/* ---------- 11. Keranjang & pemindai (kasir pakai /assets/css/kasir.css) ---------- */
.sum-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; font-size: 13.5px; }
.sum-row.total { font-size: 21px; font-weight: 800; color: var(--primary); padding: 11px 0; font-variant-numeric: tabular-nums; }
.sum-row .big { font-weight: 800; font-variant-numeric: tabular-nums; }

.search-results {
    position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 13px;
    box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; z-index: 100;
}
.search-results button { display: block; width: 100%; text-align: left; padding: 12px 15px; background: none; border: none; border-bottom: 1px solid var(--border); cursor: pointer; color: var(--text); font: inherit; }
.search-results button:last-child { border-bottom: none; }
.search-results button:hover { background: var(--primary-light); }
.sr-notfound { padding: 12px 15px; font-size: 13.5px; color: var(--text-muted); }
.sr-notfound strong { color: var(--text); }
.search-results .sr-notfound button { border-bottom: none; padding: 9px 0; color: var(--primary); font-weight: 600; }
.search-results .sr-notfound button:last-child { color: var(--text-muted); font-weight: 500; }

/* ---------- 12. Widget dashboard ---------- */
.hero-card {
    position: relative; overflow: hidden; border-radius: var(--radius-lg);
    color: #fff; padding: 24px; margin-bottom: 18px;
    background: radial-gradient(760px 320px at 92% -20%, rgba(255,255,255,.2), transparent 62%),
                linear-gradient(118deg, var(--sidebar-1) 0%, var(--sidebar-2) 58%, var(--primary) 100%);
    box-shadow: 0 14px 32px rgba(var(--glow), .26);
}
.hero-card h2 { margin: 0 0 6px; font-size: 22px; color: #fff; }
.hero-card p { margin: 0; color: rgba(255,255,255,.85); font-size: 13.5px; }
.hero-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; }
.hero-meta div { font-size: 12.5px; color: rgba(255,255,255,.82); }
.hero-meta strong { display: block; font-size: 17px; color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 18px; }
.hero-actions .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; backdrop-filter: blur(6px); }
.hero-actions .btn:hover { background: rgba(255,255,255,.26); color: #fff; }
.hero-actions .btn.solid { background: #fff; color: var(--primary-dark); border-color: #fff; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 11px; }
.quick-btn {
    display: flex; align-items: center; gap: 11px;
    text-decoration: none; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 13px 14px; font-weight: 600; font-size: 13.5px;
    transition: border-color .14s, transform .14s, box-shadow .14s;
}
.quick-btn:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.quick-btn .qi { width: 36px; height: 36px; border-radius: 11px; background: var(--primary-light); color: var(--primary-dark); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.trend { display: flex; align-items: flex-end; gap: 8px; height: 168px; padding-top: 14px; }
.trend .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.trend .bar { width: 100%; max-width: 46px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--primary), var(--primary-dark)); min-height: 4px; transition: filter .14s; }
.trend .bar:hover { filter: brightness(1.12); }
.trend .bar.today { background: linear-gradient(180deg, var(--accent), #c2740a); }
.trend .lbl { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.trend .val { font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }

.list-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row .lr-name { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; }
.list-row .lr-sub { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.list-row .lr-val { font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress { height: 7px; border-radius: 6px; background: var(--primary-light); overflow: hidden; margin-top: 6px; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 6px; }

.chart-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); padding: 18px; min-width: 0; }
.chart-box h3 { margin: 0 0 14px; font-size: 15px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.chart-head h3 { margin: 0; }

/* ---------- 13. Halaman publik (landing) ----------
   Gaya halaman depan ada di SATU berkas: /assets/css/landing.css.
   Halaman depan dimuat tanpa sidebar/kasir, jadi tidak perlu ikut mengunduh
   seluruh app.css; sisa di sini hanya tombol di atas latar gelap yang juga
   dipakai halaman lain. */
.btn-white { background: #fff; color: var(--link); border: 1px solid #fff; }
.btn-white:hover { background: #fff; color: var(--link); box-shadow: var(--shadow); }
.btn-outline-w { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.5); }
.btn-outline-w:hover { color: #fff; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.8); }

/* ---------- 14. Halaman masuk ---------- */
.auth-wrap {
    min-height: 100vh; min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: radial-gradient(900px 420px at 20% -10%, rgba(var(--glow), .55), transparent 60%),
                linear-gradient(150deg, var(--sidebar-1) 0%, var(--sidebar-2) 60%, var(--primary) 100%);
}
.auth-card {
    width: 100%; max-width: 404px; background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: 22px;
    box-shadow: var(--shadow-lg); padding: 34px 30px; text-align: center;
}
.auth-logo {
    width: 62px; height: 62px; border-radius: 17px; margin: 0 auto 15px;
    background: var(--primary); color: var(--on-primary); font-size: 26px; font-weight: 800;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.auth-logo img { width: 100%; height: 100%; object-fit: cover; }
.auth-card h2 { margin: 0 0 4px; font-size: 21px; }
.auth-card .sub { color: var(--text-muted); font-size: 13.5px; margin-bottom: 22px; }
.auth-card form { text-align: left; }

/* ---------- 15. Struk ----------
   Gaya .receipt TIDAK ada di sini: satu sumber = struk-content.css
   (di-link layout lewat $extraCss, halaman struk, dan overlay). Dua sumber
   = struk tercetak "kadang tebal kadang tipis" di printer termal. */
@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .sidebar, .mobile-bar, .backdrop { display: none !important; }
    .main { margin: 0 !important; padding: 0 !important; }
}

/* ---------- 16. Pemindai kamera ---------- */
.pscan { position: fixed; inset: 0; z-index: 400; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.75); padding: 16px; }
.pscan.open { display: flex; }
.pscan-box { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.pscan-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pscan-head strong { font-size: 15px; }
.pscan-x { background: none; border: 0; color: var(--text-muted); font-size: 26px; line-height: 1; cursor: pointer; padding: 0 6px; }
.pscan-box video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #000; border-radius: 12px; display: block; }
.pscan-hint { font-size: 12.5px; color: var(--text-muted); margin: 10px 0; min-height: 32px; }
.pscan-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.pscan-manual input { width: 100%; }

/* ---------- 17. Utilitas ---------- */
.flex { display: flex; flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.position-absolute { position: absolute; }
.shadow { box-shadow: var(--shadow); }
.p-3 { padding: 20px; }

/* sisa kelas gaya Bootstrap di halaman lama */
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row > [class*="col-"] { min-width: 0; }
.g-3 { gap: 14px; }
.col-md-3 { flex: 1 1 210px; }
.col-md-4 { flex: 1 1 300px; }
.col-md-6 { flex: 1 1 380px; }
.col-md-8 { flex: 1 1 480px; }
.col-md-12 { flex: 1 1 100%; }
.col-lg-8 { flex: 1 1 520px; }
.list-group { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.list-group-item { padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13.5px; }
.list-group-item:last-child { border-bottom: none; }
.list-group-item-action:hover { background: var(--primary-light); }
.unit-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }

/* ---------- 18. Penyesuaian layar ---------- */
@media (max-width: 1024px) {
    /* grid dua kolom dari style inline (dashboard, detail hutang) jatuh jadi satu kolom */
    .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

@media (max-width: 1024px) {
    .mobile-bar {
        display: flex; align-items: center; gap: 10px;
        position: sticky; top: 0; z-index: 60;
        min-height: var(--header-h);
        padding: 9px 14px;
        background: var(--surface);
        background: color-mix(in srgb, var(--surface) 88%, transparent);  /* HP lama tetap pakai baris di atas */
        backdrop-filter: saturate(160%) blur(12px);
        border-bottom: 1px solid var(--border);
    }
    .mobile-bar .mb-title { font-weight: 700; flex: 1; font-size: 14.5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .mobile-bar .mb-title small { display: block; font-weight: 500; font-size: 10.5px; color: var(--text-muted); }
    .mobile-bar .mb-btn {
        background: none; border: 1px solid var(--border); border-radius: 11px;
        padding: 8px 9px; cursor: pointer; color: var(--text);
        display: inline-flex; align-items: center; gap: 6px;
        font: inherit; font-size: 12.5px; font-weight: 600; text-decoration: none; flex-shrink: 0;
    }
    .mobile-bar .mb-btn:hover { border-color: var(--border-strong); }

    .sidebar { width: min(84vw, 300px); transform: translateX(-100%); z-index: 200; }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,.55); }
    .sidebar-brand { justify-content: flex-start; padding: 16px 14px; }
    .sidebar-brand .brand-txt { display: block; }
    .sidebar-x { display: inline-flex; }
    .sidebar-nav a { justify-content: flex-start; padding: 11px 12px; }
    .sidebar-nav .t-label { display: block; font-size: 14px; }
    .sidebar-nav .t-desc { display: block; }
    .nav-group { text-align: left; font-size: 10px; padding: 15px 12px 6px; }
    .nav-group::after { display: none; }
    .sidebar-foot .u-txt, .sidebar-foot .u-out { display: block; }
    .sidebar-foot .u-out { display: inline-flex; }
    .sidebar-foot .user { justify-content: flex-start; }

    .backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 190; }
    .main { margin-left: 0 !important; padding: 16px 14px 40px; }
    .topbar { margin-bottom: 16px; }
    .topbar h1 { font-size: 19px; }
    .topbar-actions { width: 100%; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 11px; }
    .stat-card { padding: 15px; border-radius: 16px; }
    .stat-card .value { font-size: 19px; }
    .stat-card .icon:not(.kpi-ico) { width: 34px; height: 34px; top: 13px; right: 13px; }
    .kpi .kpi-value { font-size: 20px; }
    .kpi .kpi-ico { width: 36px; height: 36px; border-radius: 11px; }
    .chart-box { padding: 15px; }
    .hero-card { padding: 19px; }
    .hero-card h2 { font-size: 19px; }
    .quick-grid { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
    .trend { height: 142px; gap: 6px; }
    .table th, .table td { padding: 10px 12px; }
    .card { padding: 16px; }
}

@media (max-width: 820px) {
    .btn { min-height: 42px; }
    .btn-sm { min-height: 36px; }
    .form-control, .form-select { min-height: 44px; font-size: 16px; }  /* 16px: cegah zoom otomatis iOS */
    .pos-search input { font-size: 16px; }
    .table th, .table td { font-size: 12.5px; }
    .pscan-actions .btn { flex: 1; }
}

@media (max-width: 560px) {
    .main { padding: 12px 11px 34px; }
    .card { padding: 14px; border-radius: 14px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { padding: 13px; }
    .stat-card .value { font-size: 17px; }
    .stat-card .icon:not(.kpi-ico) { display: none; }
    .kpi { flex-direction: column-reverse; gap: 10px; }
    .kpi .kpi-ico { width: 34px; height: 34px; }
    .topbar h1 { font-size: 18px; }
    .topbar > .btn, .topbar-actions > .btn { flex: 1 1 auto; justify-content: center; }
    .hero-card { padding: 16px; }
    .hero-card .hero-actions { flex-direction: column; gap: 8px; }
    .hero-card .hero-actions .btn { width: 100%; }
    .hero-meta { gap: 13px; }
    .hero-meta strong { font-size: 15px; }
    .trend .val { display: none; }
    .quick-grid { grid-template-columns: 1fr 1fr; }
    .btn-lg { width: 100%; }
    .lp-cta { flex-direction: column; }
    .lp-cta .btn { width: 100%; }
    .auth-card { padding: 26px 20px; }
    .unit-row { flex-wrap: wrap; }
    .pscan { padding: 0; align-items: stretch; }
    .pscan-box { max-width: 100%; border-radius: 0; min-height: 100dvh; display: flex; flex-direction: column; }
    .pscan-box video { aspect-ratio: 3 / 4; flex: 1; min-height: 240px; }
    .pscan-manual { margin-top: auto; }
}

@media (hover: none) {
    .sidebar-nav a { padding-top: 12px; padding-bottom: 12px; }
    .quick-btn { padding: 15px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ---------- 19. Brand sidebar & logo mobile lebih besar dan rapi ---------- */
.sidebar-brand{gap:14px;padding:18px 16px}
.sidebar-brand .logo{width:52px;height:52px;border-radius:16px;font-size:22px;box-shadow:0 4px 14px rgba(0,0,0,.28)}
.sidebar-brand .logo-fallback{width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--primary),#4c1d95);color:#fff;font-weight:800;font-size:22px;border-radius:16px}
.sidebar-brand .name{font-size:16px}
.sidebar-brand .sub{font-size:12px}
.mobile-bar{gap:10px}
.mobile-bar .mb-logo{width:36px;height:36px;border-radius:11px;overflow:hidden;flex:none;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--primary),#4c1d95);color:#fff;font-weight:800;font-size:16px}
.mobile-bar .mb-logo img{width:100%;height:100%;object-fit:cover}

/* ---------- 20. Responsif tambahan (audit 2026-10-05) ---------- */
@media (max-width: 560px) {
    /* kartu flex min-width:320px (laporan detail) muat di HP 360px */
    .row > .card[style*="min-width:320px"] { min-width: 0 !important; flex: 1 1 100% !important; }
    /* aksi baris tabel tetap nyaman disentuh */
    .table .btn-sm { min-height: 36px; }
    /* cegah teks panjang (nama barang, catatan) mendorong layout */
    .table td { overflow-wrap: anywhere; }
}

/* ---------- Kartu paket di sidebar (integrasi Kasirin) ---------- */
.sidebar-plan {
    margin: 10px 12px 0;
    padding: 11px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(201, 242, 92, .10), rgba(36, 51, 15, .16));
    border: 1px solid rgba(201, 242, 92, .22);
}
.sidebar-plan .sp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-plan .sp-plan { font-size: 12px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.sidebar-plan .sp-days { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(5, 150, 105, .16); color: #047857; white-space: nowrap; }
.sidebar-plan .sp-days.warn { background: rgba(220, 38, 38, .14); color: #b91c1c; }
.sidebar-plan a { display: block; margin-top: 6px; font-size: 11.5px; color: var(--primary); text-decoration: none; font-weight: 600; }
.sidebar-plan a:hover { text-decoration: underline; }
[data-rail="1"] .sidebar-plan { display: none; }

/* ---------- Pencarian menu & fitur terkunci ---------- */
.sidebar-search { padding: 6px 12px 8px; }
.sidebar-search input {
    width: 100%; padding: 8px 11px; border-radius: 9px; font: inherit; font-size: 12.5px;
    background: rgba(255, 255, 255, .07); color: #ececf4;
    border: 1px solid rgba(255, 255, 255, .12); outline: none;
}
.sidebar-search input::placeholder { color: #9aa0b5; }
.sidebar-search input:focus { border-color: rgba(167, 139, 250, .7); background: rgba(255,255,255,.1); }
.sidebar-nav a.locked { opacity: .72; }
.sidebar-nav a.locked:hover { opacity: 1; }
.lock-badge {
    display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 999px;
    font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
    background: rgba(129, 140, 248, .22); color: #c7d2fe; vertical-align: middle;
}
[data-rail="1"] .sidebar-search, [data-rail="1"] .lock-badge { display: none; }

/* ---------- Panel bantuan (tombol ?) ---------- */
.help-fab {
    position: fixed; right: 18px; bottom: 18px; z-index: 60;
    width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--surface, #fff); color: var(--primary);
    font-size: 19px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow, 0 8px 24px -12px rgba(0,0,0,.35));
    display: grid; place-items: center;
}
.help-fab:hover { border-color: var(--primary); }
.help-overlay {
    position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 70;
    opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.help-overlay.show { opacity: 1; pointer-events: auto; }
.help-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 92vw); z-index: 71;
    background: var(--surface, #fff); border-left: 1px solid var(--border);
    transform: translateX(102%); transition: transform .22s ease;
    display: flex; flex-direction: column; box-shadow: -20px 0 40px -30px rgba(15,23,42,.4);
}
.help-drawer.open { transform: translateX(0); }
.help-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px;
}
.help-head button { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-muted); }
.help-body { padding: 16px; overflow-y: auto; font-size: 13.5px; line-height: 1.6; color: var(--text-soft); }
.help-body h3 { margin: 0 0 6px; font-size: 16px; color: var(--text); letter-spacing: -.01em; }
.help-body h4 { margin: 16px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.help-body ol, .help-body ul { margin: 0; padding-left: 18px; }
.help-body li { margin-bottom: 5px; }
.help-more {
    display: inline-flex; margin-top: 18px; padding: 9px 14px; border-radius: 9px;
    background: var(--primary); color: #fff; font-weight: 600; font-size: 13px; text-decoration: none;
}
@media print { .help-fab, .help-drawer, .help-overlay { display: none !important; } }
/* Di halaman kasir, tombol bantuan bisa menutupi tombol bayar pada layar kecil. */
@media (max-width: 900px) { .help-fab-kasir { display: none; } }

/* ==========================================================================
   TEMA KASIRIN POS — lapisan tampilan 2026
   Semua kelas lama dipertahankan; lapisan ini hanya menimpa warna, bentuk,
   dan tipografi. Tidak ada id atau nama kelas baru yang dibutuhkan JS.
   ========================================================================== */

/* ---------- Kerangka & latar ---------- */
body {
    background:
        radial-gradient(900px 420px at 100% -10%, rgba(201, 242, 92, .10), transparent 62%),
        var(--bg);
    color: var(--text);
    font-size: 14px;
    letter-spacing: -.006em;
}
h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 750; letter-spacing: -.035em; }
.mono, .num, .angka, .value, .kpi-value, .stat-card .value, .klines, .sum-row,
.table .num, .badge, .kcount, .kp-price, .kp-stock, .kscan-status { font-variant-numeric: tabular-nums; }

.shell { background: transparent; }
.main { padding: 26px clamp(16px, 2.4vw, 34px) 46px; }
.main-inner { max-width: 1480px; }

/* ---------- Sidebar: malam, grid halus, aksi limau ---------- */
.sidebar {
    background:
        radial-gradient(620px 320px at 10% 0%, rgba(201, 242, 92, .08), transparent 70%),
        linear-gradient(180deg, var(--sidebar-1), var(--sidebar-2));
    border-right: 1px solid #1d201a;
    color: #e9e7de;
}
.sidebar::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(180deg, #000, transparent 55%);
}
.sidebar > * { position: relative; }
.sidebar-brand { padding: 18px 16px; border-bottom: 1px solid #20231d; gap: 12px; }
.sidebar-brand .logo {
    width: 46px; height: 46px; border-radius: 12px;
    background: var(--primary); color: var(--on-primary);
    box-shadow: 0 0 0 1px rgba(201,242,92,.25), 0 10px 22px -16px #000;
}
.sidebar-brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-brand .logo-fallback {
    background: var(--primary); color: var(--on-primary);
    font-family: var(--font-sans); font-weight: 800; border-radius: 12px;
}
.sidebar-brand .name { color: #f7f5ec; font-weight: 750; letter-spacing: -.03em; font-size: 15.5px; }
.sidebar-brand .sub {
    color: #8c8f84; font-family: var(--font-mono); font-size: 9.5px;
    letter-spacing: .12em; text-transform: uppercase; margin-top: 2px;
}
.sidebar-rail { background: #1a1d17; color: #b9bcb0; border-radius: 8px; }
.sidebar-rail:hover { background: #242820; color: #fff; }
.sidebar-search { padding: 12px 12px 6px; }
.sidebar-search input {
    background: #141713; border-color: #2a2d26; color: #e9e7de;
    border-radius: 8px; font-family: var(--font-mono); font-size: 11.5px;
}
.sidebar-search input::placeholder { color: #7f8278; }
.sidebar-search input:focus { border-color: rgba(201,242,92,.6); background: #181b16; box-shadow: none; }
.sidebar-nav { padding: 6px 10px 14px; }
.nav-group {
    color: #71756a; font-family: var(--font-mono); font-size: 9.5px;
    letter-spacing: .14em; font-weight: 500; padding: 18px 12px 7px;
}
.sidebar-nav a {
    border-radius: 8px; color: #c5c7bd; padding: 8px 11px; margin-bottom: 2px;
}
.sidebar-nav a:hover { background: #1b1f18; color: #fff; }
.sidebar-nav a.active {
    background: var(--primary); color: var(--on-primary);
    box-shadow: 0 2px 0 var(--primary-dark);
}
.sidebar-nav a.active .t-desc { color: rgba(20, 33, 10, .72); }
.sidebar-nav a .t-label { font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.sidebar-nav a .t-desc { color: #85897e; font-size: 10px; }
.sidebar-nav a .ico { color: #9a9d92; }
.sidebar-nav a:hover .ico { color: #fff; }
.sidebar-nav a.active .ico { color: var(--on-primary); }
.sidebar-nav a.locked { opacity: .6; }
.lock-badge {
    background: rgba(201,242,92,.14); color: #d8f39a;
    font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .04em;
}
.sidebar-nav a.active .lock-badge { background: rgba(20,33,10,.16); color: #24330f; }

.sidebar-plan {
    margin: 8px 12px 10px; padding: 12px;
    background: #141713; border: 1px solid #262a22; border-radius: 10px;
}
.sidebar-plan .sp-plan { color: #e9e7de; font-size: 11.5px; font-weight: 650; }
.sidebar-plan .sp-days {
    background: rgba(201,242,92,.14); color: #d8f39a;
    font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
}
.sidebar-plan .sp-days.warn { background: rgba(240,169,162,.14); color: #f0a9a2; }
.sidebar-plan a { color: #b9bcb0; font-size: 10.5px; font-weight: 500; margin-top: 7px; }
.sidebar-plan a:hover { color: var(--primary); }
.sidebar-foot { border-top: 1px solid #20231d; padding: 12px; }
.sidebar-foot .avatar {
    background: #1d2119; color: var(--primary); border: 1px solid #2c3127;
    font-family: var(--font-mono); font-weight: 600; border-radius: 8px;
}
.sidebar-foot .u-name { color: #f1efe6; font-size: 12.5px; }
.sidebar-foot .u-role { color: #7f8278; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-foot .u-out { color: #8c8f84; }
.sidebar-foot .u-out:hover { background: #1d2119; color: #fff; }

/* ---------- Bar atas & judul halaman ---------- */
.mobile-bar {
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    border-bottom: 1px solid var(--border);
    padding: 10px 14px; gap: 10px;
}
.mobile-bar .mb-title { font-weight: 700; letter-spacing: -.03em; }
.mobile-bar .mb-title small { font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.mobile-bar .mb-btn { background: var(--surface); border-color: var(--border-strong); border-radius: 8px; }
.mobile-bar .mb-logo { background: var(--primary); color: var(--on-primary); border-radius: 8px; }

.topbar { margin-bottom: 24px; align-items: flex-end; }
.topbar h1 {
    font-size: clamp(1.45rem, 2.3vw, 1.85rem); font-weight: 780;
    letter-spacing: -.045em; line-height: 1.05;
}
.topbar h1::before {
    content: ""; display: block; width: 26px; height: 3px;
    background: var(--primary); margin-bottom: 9px;
}
.topbar .lead {
    color: var(--text-muted); font-size: 13px; margin-top: 6px;
    letter-spacing: 0;
}
.topbar-actions { gap: 8px; }

/* ---------- Kartu ---------- */
.card, .chart-box, .table-wrap, .stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}
.card { padding: 20px; }
.card h3 { font-size: 15px; letter-spacing: -.025em; }
.card > h3:first-child { margin-top: 0; }
.card-pad { padding: 20px; }

.stat-card { border-radius: var(--radius); padding: 17px 18px; }
.stat-card:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.stat-card .label, .kpi .kpi-label {
    font-family: var(--font-mono); font-size: 10px; font-weight: 500;
    letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
}
.stat-card .value, .kpi .kpi-value {
    font-family: var(--font-mono); font-size: 22px; font-weight: 600;
    letter-spacing: -.04em; color: var(--text);
}
.kpi .kpi-value { font-size: 23px; }
.kpi .kpi-note, .stat-card .delta { font-size: 11.5px; color: var(--text-muted); }
.kpi .kpi-ico, .stat-card .icon:not(.kpi-ico) { border-radius: 9px; }
.icon.purple { background: var(--primary-light); color: var(--link); }
.icon.green { background: var(--success-bg); color: var(--success-text); }
.icon.orange { background: var(--warning-bg); color: var(--warning-text); }
.icon.red { background: var(--danger-bg); color: var(--danger-text); }
.icon.blue { background: var(--info-bg); color: var(--info-text); }
.kpi-spark i { background: #e6e1d2; border-radius: 1px; }
.kpi-spark i.on { background: var(--primary); }

/* ---------- Tombol ---------- */
.btn {
    border-radius: 8px; border-color: var(--border-strong);
    background: var(--surface); color: var(--text);
    font-weight: 600; font-size: 13px; padding: 9px 14px;
    box-shadow: 0 1px 0 rgba(17,19,16,.04);
}
.btn:hover { background: var(--surface-2); border-color: var(--text-muted); box-shadow: none; }
.btn-primary {
    background: var(--primary); border-color: var(--primary);
    color: var(--on-primary); box-shadow: 0 2px 0 var(--primary-dark);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--on-primary); box-shadow: 0 2px 0 #8aab39; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: 0 2px 0 #7e1d1d; }
.btn-danger:hover { background: #8f2323; color: #fff; }
.btn-success { background: #2f6b46; border-color: #2f6b46; color: #f4f1e8; box-shadow: 0 2px 0 #1f4a2f; }
.btn-success:hover { background: #275c3b; color: #fff; }
.btn-outline-primary { color: var(--link); border-color: var(--border-strong); background: transparent; }
.btn-outline-primary:hover { background: var(--primary-light); border-color: var(--link); color: var(--link); }
.btn-outline-secondary { color: var(--text-soft); border-color: var(--border); }
.btn-lg { padding: 13px 20px; font-size: 14.5px; border-radius: 9px; }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 7px; }
.btn-icon { padding: 8px; border-radius: 7px; }
.btn[disabled] { box-shadow: none; }

/* ---------- Formulir ---------- */
.form-label {
    font-family: var(--font-mono); font-size: 11px; font-weight: 500;
    letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 6px;
}
.form-control, .form-select {
    background: #fffefb; border-color: var(--border-strong);
    border-radius: 8px; font-size: 14px; padding: 9px 12px;
    color: var(--text);
}
.form-control:focus, .form-select:focus {
    border-color: var(--link); box-shadow: var(--ring);
}
.form-control::placeholder { color: #9a9d92; }
.form-control-sm { padding: 6px 9px; font-size: 13px; }
.form-text, .hint { color: var(--text-muted); font-size: 11.5px; }
.form-check-input { accent-color: var(--link); }
.input-group .form-control { border-radius: 8px 0 0 8px; }
.input-group .suffix, .input-group-text { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-muted); }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
table.table { font-size: 13px; }
.table th {
    background: var(--surface-2); color: var(--text-muted);
    font-family: var(--font-mono); font-size: 10px; font-weight: 500;
    letter-spacing: .08em; padding: 11px 14px; border-bottom: 1px solid var(--border);
}
.table td { padding: 11px 14px; border-bottom: 1px dashed #e7e2d3; }
.table tbody tr:hover { background: #f9f7ee; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num, .num { font-family: var(--font-mono); font-size: 12.5px; }
.table .btn-sm { min-height: 0; }

/* ---------- Lencana & peringatan ---------- */
.badge {
    border-radius: 5px; padding: 2px 7px; font-family: var(--font-mono);
    font-size: 10px; font-weight: 500; letter-spacing: .02em;
}
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-info { background: var(--info-bg); color: var(--info-text); }
.badge-purple { background: var(--primary-light); color: var(--link); }
.badge-gray { background: var(--surface-2); color: var(--text-soft); border-color: var(--border); }
.alert { border-radius: 9px; border-left-width: 3px; font-size: 13px; padding: 11px 14px; }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success-text); border-color: var(--success); }

/* ---------- Dashboard ---------- */
.hero-card {
    background:
        radial-gradient(620px 260px at 88% -30%, rgba(201, 242, 92, .18), transparent 65%),
        linear-gradient(135deg, #0b0c0d 0%, #121412 62%, #1a2013 100%);
    border: 1px solid #24271f;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    position: relative;
}
.hero-card::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background-image: linear-gradient(to right, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(70% 90% at 80% 0%, #000, transparent 75%);
}
.hero-card > * { position: relative; }
.hero-card h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.045em; margin-bottom: 8px; }
.hero-card p { color: #a9aba1; font-size: 13px; max-width: 60ch; }
.hero-meta { gap: 28px; margin-top: 22px; }
.hero-meta div {
    font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em;
    text-transform: uppercase; color: #8c8f84;
}
.hero-meta strong {
    font-family: var(--font-mono); font-size: 18px; color: var(--primary);
    font-weight: 500; letter-spacing: -.02em; margin-top: 4px;
}
.hero-actions .btn {
    background: transparent; border-color: #33372f; color: #e9e7de;
    box-shadow: none; backdrop-filter: none;
}
.hero-actions .btn:hover { background: #1d2119; border-color: #4a4f43; color: #fff; }
.hero-actions .btn.solid {
    background: var(--primary); border-color: var(--primary); color: var(--on-primary);
    box-shadow: 0 2px 0 var(--primary-dark);
}
.hero-actions .btn.solid:hover { background: var(--primary-dark); color: var(--on-primary); }

.quick-btn { border-radius: 10px; border-color: var(--border); background: var(--surface); font-size: 12.5px; padding: 12px 13px; }
.quick-btn:hover { border-color: var(--link); box-shadow: var(--shadow-sm); transform: none; }
.quick-btn .qi { background: var(--primary-light); color: var(--link); border-radius: 8px; }

.trend .bar { background: #cfd8b0; border-radius: 3px 3px 1px 1px; }
.trend .bar.today { background: var(--primary); }
.trend .lbl, .trend .val { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .02em; }
.trend .val { color: var(--text-soft); font-weight: 500; }
.list-row { border-bottom-style: dashed; border-bottom-color: #e7e2d3; }
.list-row .lr-name { font-size: 12.5px; }
.list-row .lr-sub { font-family: var(--font-mono); font-size: 10px; }
.list-row .lr-val { font-family: var(--font-mono); font-weight: 500; }
.progress { background: #e9e4d5; }
.progress > span { background: var(--primary); }

/* ---------- Keranjang ringkas & pencarian ---------- */
.sum-row { font-size: 12.5px; }
.sum-row.total { color: var(--text); font-family: var(--font-mono); font-weight: 600; font-size: 19px; letter-spacing: -.03em; }
.sum-row .big { font-family: var(--font-mono); font-weight: 600; }
.search-results { border-radius: 10px; border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.search-results button:hover { background: var(--primary-light); }

/* ---------- Pemindai kamera ---------- */
.pscan { background: rgba(11, 12, 13, .82); backdrop-filter: blur(6px); }
.pscan-box { background: var(--surface); border-color: var(--border-strong); border-radius: 14px; }
.pscan-x { color: var(--text-muted); }

/* ---------- Bantuan ---------- */
.help-fab {
    background: var(--surface); color: var(--link); border-color: var(--border-strong);
    box-shadow: var(--shadow); font-family: var(--font-mono); font-size: 15px;
}
.help-fab:hover { border-color: var(--link); }
.help-drawer { background: var(--surface); border-left-color: var(--border); }
.help-head { font-size: 13px; letter-spacing: -.02em; }
.help-more { background: var(--primary); color: var(--on-primary); border-radius: 7px; font-weight: 700; }

/* ---------- Tema kustom: tetap terbaca ---------- */
html[data-theme="custom"] .btn-primary { color: var(--on-primary); }
html[data-theme="custom"] .sidebar-nav a.active { color: var(--on-primary); }
html[data-theme="custom"] .sidebar-nav a.active .t-desc,
html[data-theme="custom"] .sidebar-nav a.active .ico { color: var(--on-primary); opacity: .75; }

/* ---------- Penyesuaian layar ---------- */
@media (max-width: 1024px) {
    .sidebar { border-right: 0; }
    .topbar h1 { font-size: 1.35rem; }
}
@media (max-width: 900px) {
    .main { padding: 18px 14px 44px; }
    .mobile-bar .mb-title { font-size: 13.5px; }
    .stat-card .value, .kpi .kpi-value { font-size: 19px; }
    .hero-card { padding: 20px; border-radius: 14px; }
    .hero-card h2 { font-size: 1.35rem; }
    .hero-meta { gap: 18px; }
    .hero-meta strong { font-size: 15px; }
    .topbar { margin-bottom: 18px; }
    .topbar h1::before { width: 20px; height: 2px; margin-bottom: 7px; }
}
@media (max-width: 560px) {
    .main { padding: 14px 11px 38px; }
    .card { padding: 15px; }
    .hero-card { padding: 17px; }
    .hero-actions .btn { width: 100%; }
    .topbar h1 { font-size: 1.25rem; }
    .form-label { font-size: 10.5px; }
}

/* ---------- Halaman masuk toko (login) ---------- */
.login-body { background: var(--bg); }
.login-split {
    display: grid; grid-template-columns: .95fr 1.05fr;
    min-height: 100vh; min-height: 100dvh;
}
.login-aside {
    position: relative; overflow: hidden; background: #0b0c0d; color: #f2f0e7;
    padding: 40px 44px; display: flex; flex-direction: column; gap: 34px; justify-content: space-between;
}
.login-aside::before {
    content: ""; position: absolute; inset: 0;
    background-image:
        linear-gradient(to right, rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(90% 80% at 30% 20%, #000, transparent 80%);
}
.login-aside::after {
    content: ""; position: absolute; width: 460px; height: 460px; right: -180px; bottom: -220px;
    background: radial-gradient(closest-side, rgba(201,242,92,.18), transparent 70%);
}
.login-aside > * { position: relative; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-mark {
    width: 42px; height: 42px; border-radius: 11px; background: var(--primary);
    color: var(--on-primary); display: grid; place-items: center;
    font-weight: 800; font-size: 18px; overflow: hidden; flex: none;
}
.login-mark img { width: 100%; height: 100%; object-fit: cover; }
.login-brand b { display: block; font-size: 15px; letter-spacing: -.03em; color: #f7f5ec; }
.login-brand small {
    font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em;
    text-transform: uppercase; color: #8c8f84;
}
.login-copy { margin-top: auto; }
.login-kicker {
    font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em;
    text-transform: uppercase; color: var(--primary);
}
.login-copy h1 {
    font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: .98; letter-spacing: -.05em;
    margin: 12px 0 14px; color: #f7f5ec;
}
.login-copy h1 em {
    font-family: Georgia, "Times New Roman", serif; font-style: italic;
    font-weight: 400; color: var(--primary);
}
.login-copy p { color: #a9aba1; font-size: 14px; line-height: 1.65; max-width: 36ch; margin: 0; }
.login-art { display: flex; align-items: flex-end; gap: 18px; }
.login-receipt {
    width: 190px; background: #fffdf7; color: #111310; padding: 14px;
    font-family: var(--font-mono); font-size: 8.5px; line-height: 1.7;
    transform: rotate(-3deg); box-shadow: 0 24px 44px -22px #000;
    clip-path: polygon(0 0,100% 0,100% 96%,94% 100%,88% 96%,82% 100%,76% 96%,70% 100%,64% 96%,58% 100%,52% 96%,46% 100%,40% 96%,34% 100%,28% 96%,22% 100%,16% 96%,10% 100%,4% 96%,0 100%);
}
.login-receipt b { display: block; text-align: center; font-size: 9px; letter-spacing: .06em; }
.login-receipt i { display: block; border-top: 1px dashed #a8a494; margin: 6px 0; }
.login-receipt span, .login-receipt strong { display: flex; justify-content: space-between; gap: 6px; }
.login-receipt em { font-style: normal; }
.login-receipt strong { font-size: 9.5px; margin-top: 2px; }
.login-bars { display: flex; gap: 5px; align-items: flex-end; height: 74px; }
.login-bars i { width: 8px; background: var(--primary); opacity: .9; }
.login-bars i:nth-child(1) { height: 26%; } .login-bars i:nth-child(2) { height: 48%; }
.login-bars i:nth-child(3) { height: 38%; } .login-bars i:nth-child(4) { height: 72%; }
.login-bars i:nth-child(5) { height: 96%; }
.login-foot { font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; color: #7f8278; margin: 0; }
.login-main { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.login-card { width: 100%; max-width: 410px; }
.login-card-head { margin-bottom: 22px; }
.login-card-head h2 { font-size: 1.7rem; margin: 8px 0 6px; letter-spacing: -.045em; }
.login-card-head p { color: var(--text-muted); font-size: 13px; margin: 0; }
.login-links {
    display: flex; flex-direction: column; gap: 6px; margin-top: 22px;
    padding-top: 16px; border-top: 1px solid var(--border);
    font-size: 11.5px; color: var(--text-muted);
}
.login-links a { font-weight: 600; color: var(--link); }
.login-card .btn-lg { margin-top: 4px; }
@media (max-width: 860px) {
    .login-split { grid-template-columns: 1fr; min-height: 0; }
    .login-aside { padding: 24px 22px; gap: 18px; }
    .login-copy { margin-top: 4px; }
    .login-copy h1 { font-size: 1.9rem; margin: 8px 0; }
    .login-copy p { max-width: none; font-size: 12.5px; }
    .login-art, .login-foot { display: none; }
    .login-main { padding: 26px 18px 44px; }
    .login-card-head h2 { font-size: 1.4rem; }
}

/* Fokus keyboard: limau terlalu pucat di atas kertas */
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.sidebar :focus-visible, .hero-card :focus-visible, .login-aside :focus-visible { outline-color: var(--primary); }

/* Mobile: pertahankan aturan lama yang penting (iOS zoom & grid 2 kolom) */
@media (max-width: 820px) {
    .form-control, .form-select { font-size: 16px; min-height: 44px; }
}
@media (max-width: 560px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 13px; }
    .kpi .kpi-value, .stat-card .value { font-size: 17px; }
    .kpi .kpi-label, .stat-card .label { font-size: 9px; }
    .kpi .kpi-note { font-size: 10.5px; }
}

/* Tombol tutup drawer cukup besar untuk jari */
@media (max-width: 1024px) {
    .sidebar-x {
        width: 36px; height: 36px; padding: 0; border-radius: 8px;
        display: grid; place-items: center; background: #1a1d17; color: #e9e7de;
    }
    .sidebar-x:hover { background: #262a22; color: #fff; }
}

/* Hasil scan tidak ditemukan: arahkan ke halaman Produk, bukan form di kasir */
.search-results .sr-notfound .sr-hint {
    font-size: 12px; line-height: 1.55; color: var(--text-muted);
    margin: 6px 0 10px; max-width: 42ch;
}
.search-results .sr-notfound .sr-tambah {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 11px; border-radius: 7px; border: 1px solid var(--primary);
    background: var(--primary); color: var(--on-primary);
    font-size: 12px; font-weight: 700; text-decoration: none; margin-right: 6px;
}
.search-results .sr-notfound .sr-tambah:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--on-primary); }
