﻿/* ============================================
   INTIPOS — THEME SYSTEM v4.0
   Mode: gelap / terang · Aksen: blue/emerald/orange/rose
   Token aksen di-set via JS (data-accent + inline style)
   ============================================ */
:root {
  color-scheme: dark;

  /* Aksen (default biru — ditimpa JS saat ada preferensi) */
  --c1: #6366f1;
  --c2: #3b82f6;
  --soft: rgba(99,102,241,.22);
  --soft-weak: rgba(99,102,241,.09);
  --soft-strong: rgba(99,102,241,.45);
  --glow: rgba(59,130,246,.28);
  --accent-text: #60a5fa;

  /* Surfaces */
  --bg-body: #070b16;
  --bg-surface: #0d1424;
  --bg-surface-2: #0a101f;
  --bg-card: linear-gradient(180deg, rgba(23,32,54,.72), rgba(12,18,33,.86));
  --bg-card-hover: linear-gradient(180deg, rgba(30,42,70,.78), rgba(15,23,42,.9));
  --bg-sidebar: linear-gradient(180deg, #0b1220 0%, #070b16 75%);
  --bg-inset: #0a0f1c;
  --bg-inset-2: #0d1526;
  --bg-input: linear-gradient(180deg, #0c1322, #0a0f1c);
  --bg-input-solid: #0d1526;
  --bg-input-focus: #0d1526;
  --bg-chip: rgba(148,163,184,.06);
  --bg-th: linear-gradient(180deg, #131e35, #0e1729);
  --th-text: #9db8e8;
  --zebra: rgba(148,163,184,.025);
  --form-side: linear-gradient(180deg, #0d1424, #080d1a);
  --body-bg: radial-gradient(1100px 600px at 12% -10%, var(--soft), transparent 60%), radial-gradient(900px 560px at 108% 4%, rgba(14,165,233,.07), transparent 55%), #070b16;
  --content-bg: radial-gradient(1000px 480px at 8% -8%, var(--soft), transparent 60%), radial-gradient(820px 460px at 108% 0%, rgba(14,165,233,.05), transparent 55%);
  --login-bg: radial-gradient(900px 500px at 15% 0%, var(--soft), transparent 60%), radial-gradient(800px 500px at 95% 100%, rgba(14,165,233,.10), transparent 55%), #05080f;
  --topbar-bg: rgba(9,14,27,.88);
  --overlay-bg: rgba(3,6,14,.72);
  --overlay-full-bg: rgba(4,7,15,.9);
  --menu-footer-grad: linear-gradient(180deg, transparent, rgba(0,0,0,.22));

  /* Borders */
  --border-subtle: rgba(148,163,184,.09);
  --border-default: rgba(148,163,184,.16);
  --border-strong: rgba(148,163,184,.3);

  /* Text */
  --text-primary: #e9effc;
  --text-secondary: #b7c2d8;
  --text-muted: #8b99b5;
  --text-dim: #5d6b87;
  --btn-text: #dbe4f5;
  --err-text: #fca5a5;
  --icon-dim: #3b4a6b;
  --grad-text: linear-gradient(180deg, #ffffff, #c3d2ee);

  /* Buttons */
  --btn-bg: linear-gradient(180deg, #2a3752, #1c2740);
  --btn-bg-hover: linear-gradient(180deg, #33436a, #232f4e);

  /* Accents semantic */
  --accent-blue: #60a5fa;
  --accent-blue-deep: #3b82f6;
  --accent-orange: #f59e0b;
  --accent-orange-deep: #d97706;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, var(--c1) 0%, var(--c2) 100%);
  --grad-primary-soft: linear-gradient(90deg, var(--soft), rgba(148,163,184,.04));
  --grad-green: linear-gradient(135deg, #16a34a, #15803d);
  --grad-red: linear-gradient(135deg, #ef4444, #dc2626);
  --grad-amber: linear-gradient(135deg, #f59e0b, #d97706);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(1,4,12,.5);
  --shadow-md: 0 6px 18px rgba(1,4,12,.42);
  --shadow-lg: 0 14px 40px rgba(1,4,12,.55);
  --shadow-glow: 0 6px 20px rgba(59,130,246,.28);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Fonts */
  --font-body: 'Plus Jakarta Sans', 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  --transition-fast: .16s ease;
  --transition-normal: .25s ease;
}

/* ===== MODE TERANG ===== */
html[data-theme="terang"] {
  color-scheme: light;
  --bg-body: #edf1f8;
  --bg-surface: #ffffff;
  --bg-surface-2: #f1f5fb;
  --bg-card: linear-gradient(180deg, #ffffff, #f8fafd);
  --bg-card-hover: linear-gradient(180deg, #ffffff, #eef4fb);
  --bg-sidebar: linear-gradient(180deg, #f8fafd 0%, #e9eff8 75%);
  --bg-inset: #f1f5fb;
  --bg-inset-2: #eef2f9;
  --bg-input: #ffffff;
  --bg-input-solid: #ffffff;
  --bg-input-focus: #ffffff;
  --bg-chip: rgba(15,23,42,.05);
  --bg-th: linear-gradient(180deg, #eef2f9, #e4ebf6);
  --th-text: #475569;
  --zebra: rgba(15,23,42,.028);
  --form-side: linear-gradient(180deg, #ffffff, #eef2f9);
  --body-bg: radial-gradient(1100px 600px at 12% -10%, var(--soft), transparent 60%), radial-gradient(900px 560px at 108% 4%, rgba(14,165,233,.06), transparent 55%), #edf1f8;
  --content-bg: radial-gradient(1000px 480px at 8% -8%, var(--soft), transparent 60%), radial-gradient(820px 460px at 108% 0%, rgba(14,165,233,.05), transparent 55%);
  --login-bg: radial-gradient(900px 500px at 15% 0%, var(--soft), transparent 60%), radial-gradient(800px 500px at 95% 100%, rgba(14,165,233,.08), transparent 55%), #e9eef7;
  --topbar-bg: rgba(255,255,255,.88);
  --overlay-bg: rgba(15,23,42,.35);
  --overlay-full-bg: rgba(15,23,42,.45);
  --menu-footer-grad: linear-gradient(180deg, transparent, rgba(15,23,42,.05));
  --border-subtle: rgba(15,23,42,.08);
  --border-default: rgba(15,23,42,.14);
  --border-strong: rgba(15,23,42,.28);
  --text-primary: #101f38;
  --text-secondary: #3d4c63;
  --text-muted: #5c6b84;
  --text-dim: #8593ab;
  --btn-text: #3d4c63;
  --err-text: #b91c1c;
  --icon-dim: #c3cede;
  --grad-text: linear-gradient(180deg, #101f38, #475569);
  --btn-bg: linear-gradient(180deg, #ffffff, #e8eef7);
  --btn-bg-hover: linear-gradient(180deg, #f8fafc, #dbe4f0);
  --shadow-sm: 0 1px 3px rgba(15,35,70,.08);
  --shadow-md: 0 6px 18px rgba(15,35,70,.10);
  --shadow-lg: 0 14px 40px rgba(15,35,70,.14);
  --shadow-glow: 0 6px 20px rgba(59,130,246,.20);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--body-bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-width: thin;
  scrollbar-color: #2b3a5e var(--bg-surface-2);
}
html[data-theme="terang"] body { scrollbar-color: #b6c3d8 #e6ecf5; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-surface); border-radius: 6px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #33456e, #22304f);
  border-radius: 6px; border: 2px solid var(--bg-surface);
}
html[data-theme="terang"] ::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #b6c3d8, #94a3b8); }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #3f5588, #2a3c63); }
html[data-theme="terang"] ::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #94a3b8, #64748b); }
::-webkit-scrollbar-corner { background: var(--bg-surface); }

::selection { background: var(--soft); color: var(--text-primary); }
:focus-visible { outline: 2px solid var(--soft-strong); outline-offset: 2px; }

@keyframes panelFadeIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes pop { from { opacity: 0; transform: scale(.955) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes pulseDot { 0%,100% { opacity: 1; box-shadow: 0 0 8px rgba(74,222,128,.45); } 50% { opacity: .8; box-shadow: 0 0 14px rgba(74,222,128,.75); } }

/* ===== LOGIN (split layout) ===== */
.login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--login-bg);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .4s ease;
}
.login-split {
  display: grid; grid-template-columns: 1.05fr 1fr;
  width: min(960px, 94vw); height: min(600px, 94vh);
  border-radius: 22px; overflow: hidden;
  border: 1px solid var(--border-default);
  box-shadow: 0 40px 100px rgba(0,0,0,.65), 0 0 0 1px var(--soft);
  animation: slideUpFade .55s cubic-bezier(.22,1,.36,1);
  background: var(--bg-surface);
}
html[data-theme="terang"] .login-split { box-shadow: 0 40px 100px rgba(15,35,70,.25), 0 0 0 1px var(--soft); }
.login-brand {
  position: relative; overflow: hidden;
  padding: 42px 40px 34px;
  background:
    radial-gradient(600px 300px at 110% -10%, rgba(34,211,238,.35), transparent 60%),
    radial-gradient(500px 380px at -20% 110%, rgba(139,92,246,.35), transparent 60%),
    linear-gradient(155deg, #1e1b4b 0%, #1e3a8a 52%, #0c4a6e 100%);
  color: #fff; display: flex; flex-direction: column;
}
.login-brand::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .35; pointer-events: none;
}
.brand-mark { display: flex; align-items: center; gap: 14px; position: relative; }
.brand-logo {
  width: 140px; height: 140px; border-radius: 0; flex-shrink: 0;
  background: transparent; border: none;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: none; box-shadow: none;
  padding: 0;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-size: 25px; font-weight: 800; letter-spacing: -.6px; line-height: 1.1; }
.brand-tag { font-size: 12.5px; color: #bfdbfe; margin-top: 2px; font-weight: 500; }
.brand-hero { margin-top: auto; position: relative; }
.brand-hero h1 { font-size: 25px; font-weight: 800; letter-spacing: -.7px; line-height: 1.25; margin-bottom: 8px; }
.brand-hero p { font-size: 13.5px; color: #dbeafe; opacity: .92; margin-bottom: 20px; max-width: 380px; }
.feature-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.feature-list li { display: flex; align-items: center; gap: 11px; font-size: 13px; font-weight: 600; color: #e0edff; }
.feat-ic {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; font-size: 13px; color: #bae6fd;
}
.brand-foot { margin-top: 26px; font-size: 11px; color: #93c5fd; opacity: .85; position: relative; }
.login-form-side {
  padding: 46px 44px; display: flex; flex-direction: column; justify-content: center;
  background: var(--form-side);
}
.login-form-head { margin-bottom: 22px; }
.login-form-head .login-title { font-size: 22px; font-weight: 800; letter-spacing: -.4px; color: var(--text-primary); }
.login-form-head .login-sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.input-wrap { position: relative; margin-bottom: 14px; }
.input-wrap > i {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); font-size: 14px; pointer-events: none; transition: color var(--transition-fast);
}
.input-wrap .inp { height: 47px; padding-left: 40px; border-radius: 12px; margin-bottom: 0; }
.input-wrap:focus-within > i { color: var(--c1); }
/* Alamat panjang: textarea 2 baris (tinggi tetap, tidak auto-membesar) */
.input-wrap-ta .inp { height: 78px; padding: 8px 12px 8px 40px; border-radius: 12px; margin-bottom: 0; resize: vertical; line-height: 1.45; font-size: 13px; }
textarea.inp.ta2 { height: 62px; resize: vertical; line-height: 1.45; }
.login-form-side .btn.block { height: 47px; font-size: 14px; margin-top: 4px; }
.login-form-side .btn.ghost { background: transparent; border: 1px solid var(--border-default); color: var(--text-muted); box-shadow: none; }
.login-form-side .btn.ghost:hover { background: var(--bg-chip); color: var(--text-secondary); transform: none; box-shadow: none; }
.login-foot { margin-top: 16px; text-align: center; font-size: 11.5px; color: var(--text-dim); }

/* Kartu aktivasi */
.login-box {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--soft-strong); border-radius: 18px;
  padding: 36px 34px; width: 480px; max-width: 94vw;
  box-shadow: var(--shadow-lg);
  animation: slideUpFade .5s cubic-bezier(.22,1,.36,1);
}
.login-box::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--c1), var(--c2), #22d3ee);
  border-radius: 18px 18px 0 0;
}
.login-title {
  font-size: 21px; font-weight: 800; color: var(--text-primary);
  letter-spacing: -.4px; margin-bottom: 4px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.login-title .logo-badge {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--grad-primary);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px; box-shadow: var(--shadow-glow);
}
.login-logo { width: 110px; height: 110px; border-radius: 0; object-fit: contain; background: transparent; box-shadow: none; }
.login-sub { color: var(--text-muted); margin: 6px 0 18px; font-size: 13px; text-align: center; line-height: 1.5; }
.login-err {
  color: var(--err-text); min-height: 20px; font-size: 12.5px; margin-bottom: 8px; font-weight: 600;
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25);
  border-radius: 9px; padding: 7px 11px;
}
.login-err:empty { display: none; }

/* ===== INPUT & TOMBOL ===== */
.inp {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border-default); border-radius: 10px;
  font-size: 13.5px; font-family: var(--font-body);
  margin-bottom: 10px; color: var(--text-primary);
  background: var(--bg-input);
  line-height: 1.4;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.inp:focus { outline: none; border-color: var(--c1); box-shadow: 0 0 0 3px var(--soft); background: var(--bg-input-focus); }
.inp::placeholder { color: var(--text-dim); }
.inp.sm { height: 34px; font-size: 12.5px; padding: 0 10px; margin-bottom: 0; }
select.inp {
  appearance: none; cursor: pointer; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b99b5' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
/* Opsi dropdown WAJIB punya background+color eksplisit.
   Tanpa ini, popup native (bukan .inp) memakai background putih sistem
   sementara teksnya putih -> tidak terlihat di mode gelap. */
select option, select optgroup option, datalist option {
  background-color: var(--bg-input-solid);
  color: var(--text-primary);
}
select.inp option { background: var(--bg-input-solid); color: var(--text-primary); }
/* Popup native ikut warna tema (Chrome/Electron) */
select, input[list=""], input[list] { color-scheme: inherit; }
textarea.inp { height: auto; padding: 10px 12px; resize: vertical; min-height: 76px; line-height: 1.45; }
input[type="date"].inp { color-scheme: inherit; }
input[type="number"].inp { font-variant-numeric: tabular-nums; }
label {
  font-size: 10.5px; font-weight: 800; color: var(--text-muted);
  display: block; margin: 10px 0 5px; letter-spacing: .7px; text-transform: uppercase;
}
.btn {
  border: 1px solid var(--border-default); border-radius: 10px;
  padding: 0 16px; height: 38px; cursor: pointer;
  font-size: 13px; font-weight: 700; font-family: var(--font-body); letter-spacing: .1px;
  background: var(--btn-bg); color: var(--btn-text);
  transition: all var(--transition-fast); box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  user-select: none; white-space: nowrap;
}
.btn:hover { background: var(--btn-bg-hover); border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0) scale(.985); }
.btn.primary { background: var(--grad-primary); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255,255,255,.18); }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 8px 24px var(--glow), inset 0 1px 0 rgba(255,255,255,.18); }
.btn.warn { background: var(--grad-amber); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(245,158,11,.25); }
.btn.warn:hover { filter: brightness(1.07); box-shadow: 0 6px 16px rgba(245,158,11,.32); }
.btn.danger { background: var(--grad-red); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(239,68,68,.25); }
.btn.danger:hover { filter: brightness(1.07); box-shadow: 0 6px 16px rgba(239,68,68,.32); }
.btn.success { background: var(--grad-green); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(34,197,94,.25); }
.btn.small { height: 30px; padding: 0 11px; font-size: 11.5px; border-radius: 8px; gap: 5px; }
.btn.block { width: 100%; justify-content: center; margin-top: 8px; }
.btn.outline { background: transparent; border-color: var(--border-default); color: var(--text-secondary); box-shadow: none; }
.btn.outline:hover { background: var(--soft-weak); border-color: var(--soft-strong); color: var(--text-primary); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none; }
.linkbtn { background: none; border: none; color: var(--accent-text); cursor: pointer; font-size: 12px; font-weight: 600; font-family: var(--font-body); }
.linkbtn:hover { text-decoration: underline; }

/* ===== LAYOUT ===== */
.app { display: flex; min-height: 100vh; width: 100%; }
.side {
  width: 248px; height: 100vh; flex-shrink: 0; position: fixed; left: 0; top: 0; z-index: 100;
  background: var(--bg-sidebar); color: var(--text-primary);
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border-subtle);
  box-shadow: 1px 0 0 rgba(255,255,255,.02) inset, 6px 0 24px rgba(0,0,0,.35);
  overflow-y: auto;
}
html[data-theme="terang"] .side { box-shadow: 1px 0 0 rgba(15,23,42,.04) inset, 6px 0 24px rgba(15,35,70,.08); }
.side::-webkit-scrollbar { width: 7px; }
.side::-webkit-scrollbar-track { background: transparent; }
.side::-webkit-scrollbar-thumb { background: #26345a; border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
html[data-theme="terang"] .side::-webkit-scrollbar-thumb { background: #b6c3d8; }

.brand {
  padding: 14px 14px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(90deg, var(--soft), transparent 75%);
}
.logo-icon {
  width: 62px; height: 62px; border-radius: 12px; flex-shrink: 0;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.logo-icon img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 8px rgba(0,0,0,.22)); }
.brand-text { line-height: 1.25; min-width: 0; }
.brand-text strong { color: var(--text-primary); font-size: 16.5px; font-weight: 800; letter-spacing: -.2px; display: block; }
.brand-text small { color: var(--text-dim); font-size: 10.5px; font-weight: 600; letter-spacing: .2px; display: block; margin-top: 1px; }

.userbox {
  margin: 12px 12px 4px; padding: 9px 12px;
  display: flex; align-items: center; gap: 11px;
  font-size: 12.5px; color: var(--text-muted); font-weight: 600;
  background: var(--bg-chip); border: 1px solid var(--border-subtle);
  border-radius: 12px;
}
.userbox::before {
  content: '\f007'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--grad-primary); color: #fff; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px var(--glow);
}
.userbox span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side nav { display: flex; flex-direction: column; padding: 8px 8px 12px; overflow: auto; flex: 1; }
.mgroup {
  padding: 16px 14px 7px; color: var(--text-dim); font-size: 10px;
  font-weight: 800; text-transform: uppercase; letter-spacing: 1.6px;
  user-select: none; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; border-radius: 8px; transition: color var(--transition-fast);
}
.mgroup:hover { color: var(--text-muted); }
.mgroup .mg-label { display: inline-flex; align-items: center; gap: 8px; }
.mgroup .mg-label i { color: var(--accent-text); font-size: 11px; width: 14px; text-align: center; }
.mgroup .arrow i { font-size: 9px; color: var(--text-dim); transition: transform .2s ease; }
.menu-items { display: none; }
.menu-items.show { display: block; animation: menuSlide .22s ease; }
@keyframes menuSlide { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.side nav button {
  background: none; border: none; color: var(--text-muted); text-align: left;
  padding: 9px 12px; border-left: 3px solid transparent; cursor: pointer;
  font-size: 13px; font-weight: 500; font-family: var(--font-body);
  display: flex; align-items: center; gap: 11px;
  width: calc(100% - 8px); border-radius: 10px; margin: 0 4px 2px 4px;
  transition: all var(--transition-fast); position: relative;
}
.side nav button:hover { background: var(--soft-weak); color: var(--text-secondary); transform: translateX(3px); }
.side nav button.on {
  background: var(--grad-primary-soft);
  color: var(--text-primary); border-left-color: var(--c1); font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--soft-strong);
}
.side nav button i {
  width: 29px; height: 29px; border-radius: 9px; flex-shrink: 0;
  background: var(--bg-chip); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; transition: all var(--transition-fast);
}
.side nav button:hover i { background: var(--soft-weak); color: var(--accent-text); }
.side nav button.on i { background: var(--grad-primary); color: #fff; box-shadow: 0 3px 10px var(--glow); }
.side nav button .cnt {
  margin-left: auto; background: var(--grad-red); color: #fff;
  padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 800;
  box-shadow: 0 2px 8px rgba(239,68,68,.35); min-width: 20px; text-align: center;
}
.menu-footer {
  padding: 12px 8px 14px; border-top: 1px solid var(--border-subtle);
  margin-top: auto; background: var(--menu-footer-grad);
}
.menu-footer button {
  width: 100%; background: none; border: none; color: var(--text-muted);
  text-align: left; padding: 10px 12px; border-left: 3px solid transparent;
  cursor: pointer; font-size: 13px; font-weight: 600; font-family: var(--font-body);
  display: flex; align-items: center; gap: 10px; border-radius: 10px;
  transition: all var(--transition-fast);
}
.menu-footer button:hover { background: rgba(239,68,68,.1); color: #fca5a5; border-left-color: #ef4444; }
html[data-theme="terang"] .menu-footer button:hover { color: #dc2626; }
.menu-footer button i { color: #ef4444; }

.intipos-box {
  margin: 0 12px 12px; padding: 12px; border-radius: 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-inset); font-size: 10px; line-height: 1.55; color: var(--text-dim);
  text-align: center;
}
.intipos-box .ib-copy { font-weight: 800; color: var(--accent-text); font-size: 10.5px; letter-spacing: .5px; margin-bottom: 5px; }
.intipos-box .ib-sub { margin-bottom: 5px; }
.intipos-box .ib-order {
  display: inline-block; text-align: center;
  margin-top: 8px; padding: 9px 14px; border-radius: 10px;
  background: var(--grad-primary); color: #fff; box-shadow: 0 4px 14px var(--glow);
}
.intipos-box .ib-order .lbl { display: block; font-size: 9.5px; font-weight: 700; opacity: .85; margin-bottom: 2px; }
.intipos-box .ib-order a { display: block; color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .5px; text-decoration: none; }
.intipos-box .ib-order a:hover { text-decoration: underline; }

/* ===== MAIN ===== */
.main { margin-left: 248px; flex: 1; min-width: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.topbar {
  height: 62px; flex-shrink: 0; position: relative; z-index: 10;
  display: flex; align-items: center; padding: 0 24px; gap: 14px;
  background: var(--topbar-bg); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--soft-strong), rgba(34,211,238,.45), transparent);
}
.topbar h2 {
  font-size: 18.5px; color: var(--text-primary); font-weight: 800; letter-spacing: -.4px;
  display: flex; align-items: center; gap: 11px;
}
.topbar h2::before {
  content: ''; width: 5px; height: 21px; border-radius: 3px;
  background: var(--grad-primary); box-shadow: 0 0 12px var(--glow);
}
.topbar .right { margin-left: auto; display: flex; gap: 9px; align-items: center; font-size: 12.5px; color: var(--text-muted); }
.topbar .right span { display: inline-flex; align-items: center; gap: 6px; }
.top-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 10px;
  background: var(--bg-chip); border: 1px solid var(--border-subtle);
  font-size: 12px; color: var(--text-muted); font-weight: 600;
  transition: border-color var(--transition-fast);
}
.top-chip:hover { border-color: var(--border-default); }
.top-chip i { color: var(--accent-text); font-size: 13px; }
.top-chip.mono, #topClock, #sbClock { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: .4px; }

/* ===== CONTENT & PANEL ===== */
.content {
  flex: 1; min-width: 0; padding: 24px 28px; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--content-bg);
}
.panel { display: none; flex-direction: column; flex: 1; min-height: 0; overflow: auto; animation: panelFadeIn .32s ease; }
.panel.active { display: flex; }
#p-dashboard { display: flex; }
.panel-content { flex: 1; overflow: auto; min-height: 0; padding-bottom: 8px; }

/* ===== STATUSBAR ===== */
.statusbar {
  height: 40px; flex-shrink: 0;
  display: flex; align-items: center; padding: 0 22px; gap: 20px;
  background: var(--bg-surface-2); border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -4px 14px rgba(0,0,0,.25);
  font-size: 12px; font-weight: 600; color: var(--text-muted);
}
html[data-theme="terang"] .statusbar { box-shadow: 0 -4px 14px rgba(15,35,70,.06); }
.statusbar .dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #4ade80, #22c55e);
  display: inline-block; margin-right: 7px;
  box-shadow: 0 0 8px rgba(74,222,128,.5);
  animation: pulseDot 2.5s infinite ease-in-out;
}
.statusbar .sp { flex: 1; }
.statusbar span { display: inline-flex; align-items: center; gap: 6px; }

/* ===== KPI & STAT CARD ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; margin-bottom: 12px; }
.kpi {
  --kpi-c: var(--accent-blue-deep);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-default); border-left: 4px solid var(--kpi-c);
  border-radius: var(--radius-lg); padding: 9px 12px;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.kpi::after {
  content: ''; position: absolute; top: 0; right: 0; width: 56px; height: 56px;
  background: radial-gradient(circle at top right, var(--kpi-c), transparent 70%);
  opacity: .12; pointer-events: none;
}
.kpi .l {
  font-size: 9.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .3px; font-weight: 800;
  flex: 1 1 auto; min-width: 0; white-space: normal; overflow: hidden; line-height: 1.22;
  hyphens: none; word-break: break-word;
}
.kpi .v {
  font-size: 15.5px; font-weight: 800; line-height: 1.2; letter-spacing: -.3px; margin-top: 0;
  flex: 0 0 auto; text-align: right; white-space: nowrap;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.kpi.biru { --kpi-c: #3b82f6; }
.kpi.hijau { --kpi-c: #22c55e; }
.kpi.merah { --kpi-c: #ef4444; }
.kpi.oranye { --kpi-c: #f59e0b; }
.kpi.ungh { --kpi-c: #8b5cf6; }

.stat-card {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.stat-ic {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.ic-blue { background: rgba(59,130,246,.15); color: #60a5fa; box-shadow: inset 0 0 0 1px rgba(59,130,246,.3); }
.ic-pink { background: rgba(236,72,153,.13); color: #f472b6; box-shadow: inset 0 0 0 1px rgba(236,72,153,.3); }
.ic-green { background: rgba(34,197,94,.13); color: #4ade80; box-shadow: inset 0 0 0 1px rgba(34,197,94,.3); }
.ic-amber { background: rgba(245,158,11,.13); color: #fbbf24; box-shadow: inset 0 0 0 1px rgba(245,158,11,.3); }
.stat-card .sl { font-size: 9.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .4px; font-weight: 800; white-space: nowrap; }
.stat-card .sv { font-size: 16px; font-weight: 800; color: var(--text-primary); letter-spacing: -.3px; margin-top: 1px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===== CARD ===== */
.card {
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: 19px 20px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
  transition: box-shadow var(--transition-normal), border-color var(--transition-normal), transform var(--transition-normal);
}
.card:hover { box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card h3 {
  font-size: 14.5px; margin-bottom: 13px; color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle); padding-bottom: 10px;
  font-weight: 800; letter-spacing: -.1px; display: flex; align-items: center; gap: 9px;
}
.card h3 i { color: var(--accent-text); font-size: 15px; }
.card h4 { font-size: 13.5px; margin: 12px 0 6px; color: var(--text-secondary); font-weight: 700; }
.card p { color: var(--text-muted); font-size: 13px; }
.card-title {
  font-size: 11px; font-weight: 800; text-align: center; margin-bottom: 8px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }

.section-title {
  font-size: 12.5px; font-weight: 800; color: var(--text-secondary); margin: 18px 0 8px;
  display: flex; align-items: center; gap: 8px; letter-spacing: .4px;
}
.section-title i { color: var(--accent-text); font-size: 14px; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-dim); padding: 42px 20px; font-size: 13.5px; text-align: center; gap: 10px;
}
.empty-state i { font-size: 34px; color: var(--icon-dim); opacity: .85; }
.empty-state b { color: var(--text-muted); font-weight: 700; }

/* ===== TOOLBAR & TABLE ===== */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; flex: 0 0 auto; position: relative; z-index: 6; }
.toolbar .sp { flex: 1; }
.toolbar input[type="date"].inp { width: 150px; flex: 0 0 auto; }
.tblwrap {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 14px; overflow: auto; box-shadow: var(--shadow-md); margin-bottom: 15px;
  flex: 0 1 auto; min-height: 0;
}
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th {
  background: var(--bg-th);
  color: var(--th-text); padding: 12px 14px; text-align: left; white-space: nowrap;
  font-size: 10.5px; letter-spacing: .9px; text-transform: uppercase; font-weight: 800;
  border-bottom: 1px solid var(--soft-strong); position: sticky; top: 0; z-index: 2;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; color: var(--text-secondary); }
.tbl tbody tr { transition: background .14s ease; }
.tbl tr:nth-child(even) td { background: var(--zebra); }
.tbl tbody tr:hover td { background: var(--soft-weak); }
.tbl tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-primary); }
.tbl .c { text-align: center; }
.tbl b { color: var(--text-primary); }
/* Nama barang 1 BARIS (tidak wrapped) + ellipsis bila kepanjangan.
   Nama lengkap tetap bisa dibaca lewat tooltip (title). */
.nm1 {
  display: block; max-width: 340px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nm1.nm-sm { max-width: 160px; }

/* ---------- KOLOM SPAREPART (tampil/sembunyi) ---------- */
.tblwrap.hide-merek    .c-merek,
.tblwrap.hide-kategori .c-kategori,
.tblwrap.hide-supplier .c-supplier,
.tblwrap.hide-satuan  .c-satuan,
.tblwrap.hide-stok     .c-stok,
.tblwrap.hide-hbeli    .c-hbeli,
.tblwrap.hide-hjual    .c-hjual { display: none !important; }

/* Menu pilihan kolom (diposisi manual oleh JS agar tidak terpotong toolbar) */
#p-part { position: relative; }
.kolom-menu {
  position: absolute; top: 0; left: 0; z-index: 60;
  min-width: 178px; padding: 8px;
  background: var(--bg-card-solid, var(--bg-surface));
  border: 1px solid var(--border-default);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 2px;
}
.kolom-menu-head {
  font-size: 9.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
  color: var(--text-dim); padding: 3px 6px 6px;
}
.kolom-menu label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px !important; font-weight: 600 !important;
  letter-spacing: 0 !important; text-transform: none !important;
  color: var(--text-secondary) !important;
  margin: 0 !important; padding: 5px 7px; border-radius: 8px; cursor: pointer;
}
.kolom-menu label:hover { background: var(--soft-weak); color: var(--text-primary) !important; }
.kolom-menu input[type="checkbox"] { accent-color: var(--c1); width: 14px; height: 14px; cursor: pointer; }
.kolom-menu-foot {
  display: flex; gap: 6px; margin-top: 6px; padding-top: 7px;
  border-top: 1px solid var(--border-subtle);
}
.kolom-menu-foot .btn { flex: 1; height: 30px; font-size: 11px; padding: 0 8px; }
.kolom-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 8px; border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--text-secondary);
  font-size: 12px; font-weight: 600; font-family: var(--font-body); text-align: left;
}
.kolom-menu-item:hover { background: var(--soft-weak); color: var(--text-primary); }
.kolom-menu-item i { font-size: 13px; color: var(--accent-text); width: 15px; text-align: center; }
.tbl .badge-cell { display: flex; align-items: center; gap: 6px; }

/* ===== FORM ===== */
.form-field { margin-bottom: 13px; }
.form-field.inline { margin-bottom: 0; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-col { flex: 1; min-width: 160px; }
.form-section {
  font-size: 10.5px; font-weight: 800; color: var(--accent-text); text-transform: uppercase;
  letter-spacing: .9px; margin: 16px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--border-subtle);
}
.form-group { flex: 1; min-width: 0; }
.form-group label { display: block; font-size: 10.5px; color: var(--text-dim); font-weight: 700; margin-bottom: 5px; letter-spacing: .4px; text-transform: none; }
.form-group label .req { color: var(--accent-red); margin-left: 3px; font-weight: 800; }
.form-ctrl {
  width: 100%; height: 37px; border: 1px solid var(--border-default); border-radius: 9px;
  padding: 0 11px; font-size: 13px; font-family: var(--font-body);
  color: var(--text-primary); background: var(--bg-input); box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-ctrl:focus { outline: none; border-color: var(--c1); box-shadow: 0 0 0 3px var(--soft); }
select.form-ctrl { cursor: pointer; }
.form-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
}
.form-modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 800; color: var(--text-primary); letter-spacing: -.2px; }
.form-modal-foot {
  display: flex; justify-content: flex-end; gap: 10px; padding: 13px 20px;
  border-top: 1px solid var(--border-subtle); background: var(--bg-inset);
}
.form-ctrl[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
.margin-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; min-height: 14px; font-weight: 600; letter-spacing: .2px; }

/* Row helpers */
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.frow { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }

/* ===== MODAL ===== */
.overlay {
  position: fixed; inset: 0; background: var(--overlay-bg);
  display: flex; align-items: flex-start; justify-content: center; padding: 24px;
  z-index: 200; overflow: auto; backdrop-filter: blur(8px); animation: fadeIn .2s ease;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--soft-strong); border-radius: var(--radius-lg);
  padding: 26px 28px; width: 560px; max-width: 96vw; color: var(--text-primary);
  box-shadow: 0 24px 60px rgba(0,0,0,.55); animation: slideUpFade .32s cubic-bezier(.22,1,.36,1);
  backdrop-filter: blur(10px);
}
html[data-theme="terang"] .modal { box-shadow: 0 24px 60px rgba(15,35,70,.25); }
.modal.wide { width: min(940px, 96vw); }
.modal h3 { margin-bottom: 12px; color: var(--text-primary); font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.modal h3 .tagno { color: var(--accent-orange); }
.shortcuts {
  display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; padding: 9px 14px;
  background: var(--bg-inset); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  font-size: 11.5px; color: var(--text-dim);
}
.shortcuts b { color: var(--accent-orange); font-weight: 700; }

/* ===== FULLSCREEN MODAL (kasir / job / PO) ===== */
.overlay-full {
  position: fixed; inset: 0; background: var(--overlay-full-bg);
  display: flex; align-items: stretch; justify-content: stretch;
  padding: 0; z-index: 300; overflow: hidden;
  backdrop-filter: blur(7px); animation: fadeIn .2s ease;
}
.overlay-full:has(.modal-full.simple) { align-items: center; justify-content: center; overflow: auto; padding: 24px; }
.modal-full {
  background: var(--bg-card);
  border: none; border-radius: 0; padding: 0; width: 100vw; height: 100vh;
  max-width: none; color: var(--text-primary);
  display: flex; flex-direction: column;
}
.modal-full.simple {
  width: min(680px, 94vw); height: auto; max-height: 92vh; border-radius: 18px;
  border: 1px solid var(--border-default); align-self: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden;
  animation: pop .3s cubic-bezier(.22,1.15,.36,1);
}
html[data-theme="terang"] .modal-full.simple { box-shadow: 0 30px 80px rgba(15,35,70,.3); }
.modal-full .modal-head {
  background: var(--bg-surface-2);
  padding: 0 20px; height: 58px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-default);
}
.modal-full .modal-head h3 {
  margin: 0; color: var(--text-primary); font-size: 15.5px; font-weight: 800; letter-spacing: -.2px;
  display: flex; align-items: center; gap: 11px;
}
.modal-full .modal-head h3::before {
  content: ''; width: 4px; height: 18px; border-radius: 3px;
  background: var(--grad-primary); box-shadow: 0 0 10px var(--glow);
}
.modal-full .modal-head .btn-close {
  background: var(--bg-chip); border: 1px solid var(--border-default);
  color: var(--text-muted); font-size: 17px; cursor: pointer;
  width: 34px; height: 34px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast); font-family: var(--font-body);
}
.modal-full .modal-head .btn-close:hover { background: rgba(239,68,68,.16); color: #fca5a5; border-color: rgba(239,68,68,.45); }
html[data-theme="terang"] .modal-full .modal-head .btn-close:hover { color: #dc2626; }
.modal-full .modal-body { padding: 16px 20px; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.modal-full .modal-body.trans { flex: 1; overflow: auto; }
.modal-full .modal-body.trans > .grid2 { flex: 1; min-height: 0; gap: 14px; }
.modal-full .modal-body.trans > .grid2 > div { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.modal-full .modal-body.trans .frow { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-subtle); flex-shrink: 0; }
.modal-full .modal-body.trans .items { flex: 1; min-height: 0; overflow: auto; max-height: none; border: 1px solid var(--border-default); border-radius: 12px; background: var(--bg-inset); }
.modal-full .modal-body.trans .tblwrap { flex: 1; min-height: 0; overflow: auto; max-height: none; }
.modal-full .modal-body.trans .paygrid { flex-shrink: 0; }
.modal-full .modal-body.trans .grand { flex-shrink: 0; font-size: 21px; }
.modal-full .modal-body.trans .scan { font-size: 15px; padding: 11px 14px 11px 38px; }
.modal-full .modal-body:not(.trans) {
  flex: 0 0 auto; overflow: auto; max-width: 720px; margin: 0 auto; width: 100%;
  max-height: calc(92vh - 70px); background: transparent;
}

/* ===== ITEM GRID (kasir) ===== */
.items {
  margin-top: 8px; border: 1px solid var(--border-default); border-radius: 12px;
  overflow: auto; max-height: 320px; background: var(--bg-inset);
}
.itable { width: 100%; border-collapse: collapse; font-size: 13px; }
.itable th {
  background: var(--bg-inset-2); color: var(--accent-orange); padding: 10px; text-align: left;
  font-size: 10.5px; position: sticky; top: 0; font-weight: 800; letter-spacing: .6px;
  text-transform: uppercase; border-bottom: 1px solid rgba(245,158,11,.3); z-index: 1;
}
.itable td { padding: 7px 10px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); }
.itable tbody tr { transition: background .12s ease; }
.itable tbody tr:hover td { background: var(--soft-weak); }
.itable .rn { color: var(--text-dim); width: 38px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.itable .pr { text-align: right; font-weight: 700; white-space: nowrap; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.itemrow {
  display: flex; gap: 8px; align-items: center; padding: 7px 4px;
  border-bottom: 1px dashed var(--border-default); font-size: 13px;
}
.itemrow .nm { flex: 1; color: var(--text-secondary); min-width: 0; }
.itemrow .pr { white-space: nowrap; font-weight: 700; color: var(--text-primary); }
.itemrow button {
  border: none; background: rgba(239,68,68,.12); color: #f87171; border-radius: 7px;
  cursor: pointer; padding: 4px 10px; font-size: 11px; font-weight: 700;
  transition: all var(--transition-fast); font-family: var(--font-body);
}
.itemrow button:hover { background: var(--accent-red); color: #fff; }
.emptyrow { text-align: center; color: var(--text-dim); padding: 22px; font-style: italic; font-size: 12.5px; }

/* ===== SCAN + SUGGEST ===== */
.scan {
  border: 2px solid var(--accent-orange) !important; font-size: 14.5px;
  background-color: var(--bg-input-solid) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center;
  padding-left: 38px !important;
}
.scan:focus { border-color: #fb923c !important; box-shadow: 0 0 0 4px rgba(245,158,11,.16) !important; }
.suggest {
  border: 1px solid var(--accent-orange); border-radius: 12px; max-height: 210px; overflow: auto;
  margin: -4px 0 10px; background: var(--bg-surface); box-shadow: var(--shadow-lg);
}
.sgrow {
  display: flex; gap: 10px; align-items: center; padding: 9px 12px; cursor: pointer;
  border-bottom: 1px solid var(--border-subtle); font-size: 13px; color: var(--text-secondary);
  transition: background var(--transition-fast);
}
.sgrow:last-child { border-bottom: none; }
.sgrow:hover, .sgrow.hot { background: rgba(245,158,11,.1); }
.sgrow .tag {
  font-size: 9.5px; font-weight: 800; padding: 3px 7px; border-radius: 6px;
  color: #fff; flex-shrink: 0; letter-spacing: .5px;
}
.tag.jasa { background: linear-gradient(135deg, var(--c1), var(--c2)); }
.tag.part { background: linear-gradient(135deg, #16a34a, #15803d); }
.sgrow .inf { flex: 1; min-width: 0; }
.sgrow .inf b { color: var(--text-primary); font-weight: 700; }
.sgrow .pr { font-weight: 700; white-space: nowrap; color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* ===== PAY GRID + GRAND ===== */
.paygrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.paygrid .pr {
  background: var(--bg-inset); border: 1px solid var(--border-subtle); border-radius: 10px;
  padding: 9px 12px; display: flex; justify-content: space-between; align-items: center; font-size: 13px;
}
.paygrid .pr span { color: var(--text-dim); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.paygrid .pr b { font-size: 15px; color: var(--text-primary); font-weight: 800; font-variant-numeric: tabular-nums; }
.paygrid .inp.sm { width: 110px; margin: 0; text-align: right; background: var(--bg-inset); font-size: 13px; padding: 0 10px; }
/* price/summary rows */
.pr { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 10px; border-radius: 8px; background: var(--bg-inset); }
.pr span { color: var(--text-secondary); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.pr b { color: var(--text-primary); font-weight: 800; font-size: 13.5px; font-variant-numeric: tabular-nums; text-align: right; }
.pr select, .pr input.inp { flex: 0 0 170px; width: 170px; max-width: 170px; }
.grand {
  position: relative; overflow: hidden;
  background: var(--grad-green); color: #fff; font-weight: 800;
  font-size: 21px; text-align: right; border-radius: 12px; padding: 12px 16px;
  margin-top: 10px; border: 1px solid rgba(74,222,128,.45);
  box-shadow: 0 6px 18px rgba(34,197,94,.28); letter-spacing: -.3px;
  font-variant-numeric: tabular-nums;
}
.grand::before {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.14), transparent);
  transform: skewX(-18deg);
}
.kembali { color: #4ade80; font-weight: 700; }
.kurang { color: #f87171; font-weight: 700; }
.qinput, .pinput {
  border: 1px solid var(--border-default); border-radius: 8px;
  background: var(--bg-inset); color: var(--text-primary);
  font-size: 12.5px; font-variant-numeric: tabular-nums;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  font-family: var(--font-body);
}
.qinput { width: 58px; padding: 5px 6px; text-align: center; }
.pinput { width: 100px; padding: 5px 6px; text-align: right; }
.qinput:focus, .pinput:focus { border-color: var(--c1); outline: none; box-shadow: 0 0 0 3px var(--soft); }
.ibtn {
  border: 1px solid rgba(239,68,68,.3); background: rgba(239,68,68,.1); color: #f87171;
  border-radius: 7px; cursor: pointer; padding: 4px 10px; font-weight: 700; font-size: 11.5px;
  transition: all var(--transition-fast); font-family: var(--font-body);
}
.ibtn:hover { background: var(--accent-red); color: #fff; border-color: var(--accent-red); }

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; appearance: textfield; }

/* ===== BADGE STATUS ===== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: 10.5px; font-weight: 800;
  color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3);
  letter-spacing: .5px; text-transform: uppercase; white-space: nowrap;
}
.badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.9); box-shadow: 0 0 6px rgba(255,255,255,.55); flex-shrink: 0;
}
.badge.b-Aktif { background: linear-gradient(135deg, #16a34a, #15803d); }
.badge.b-Nonaktif { background: linear-gradient(135deg, #64748b, #475569); }
.b-Antri { background: linear-gradient(135deg, #f59e0b, #d97706); }
.b-Dikerjakan { background: linear-gradient(135deg, var(--c1), var(--c2)); }
.b-Selesai { background: linear-gradient(135deg, #22c55e, #16a34a); }
.b-Diambil { background: linear-gradient(135deg, #94a3b8, #475569); }
.b-Lunas { background: linear-gradient(135deg, #22c55e, #16a34a); }
.b-Kredit { background: linear-gradient(135deg, #ef4444, #dc2626); }

tr[style*="1e293b"] td:first-child { box-shadow: inset 3px 0 0 var(--c1); }

/* ===== PERMISSION CHIPS ===== */
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.perm-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-chip); border: 1px solid var(--border-default);
  border-radius: 10px; padding: 8px 11px; font-size: 12.5px; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition-fast); user-select: none;
}
.perm-chip:hover { border-color: var(--soft-strong); color: var(--text-primary); }
.perm-chip input { accent-color: var(--c1); width: 14px; height: 14px; cursor: pointer; }
.perm-chip:has(input:checked) {
  background: var(--soft); border-color: var(--soft-strong); color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--soft);
}
.perm-chip.all { border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.07); }

/* ===== USER MANAGEMENT ===== */
#p-users .panel-content { padding: 16px 20px; gap: 12px; }
#p-users .toolbar { align-items: center; }
#p-users .tblwrap { border: 1px solid var(--border-default); border-radius: 14px; background: var(--bg-card); overflow: hidden; }
#p-users table { width: 100%; border-collapse: separate; border-spacing: 0; }
#p-users thead th { padding: 12px 16px; font-size: 11px; letter-spacing: .8px; text-align: left; background: var(--bg-th); color: var(--th-text); }
#p-users tbody td { padding: 13px 16px; font-size: 13px; vertical-align: middle; color: var(--text-secondary); }
#p-users tbody td { border-top: 1px solid var(--border-subtle); }
#p-users thead th:nth-child(1), #p-users tbody td:nth-child(1) { width: 16%; }
#p-users thead th:nth-child(2), #p-users tbody td:nth-child(2) { width: 36%; }
#p-users thead th:nth-child(3), #p-users tbody td:nth-child(3) { width: 16%; }
#p-users thead th:nth-child(4), #p-users tbody td:nth-child(4) { width: 15%; text-align: center; }
#p-users thead th:nth-child(5), #p-users tbody td:nth-child(5) { width: 17%; text-align: center; }
#p-users tbody tr { cursor: pointer; transition: background .15s ease; }
#p-users tbody tr:hover { background: var(--soft-weak); }
#p-users tbody tr[style*="1e293b"] { box-shadow: inset 3px 0 0 var(--c1); }
#p-users .usr-muted { color: var(--text-muted); font-size: 11px; }
#p-users #usrTotal { color: var(--text-muted); font-size: 12px; padding: 2px 4px; }

/* ===== PART FORM ===== */
.part-grid { display: grid; grid-template-columns: 1fr 350px; gap: 18px; align-items: start; }
.part-col-left { display: flex; flex-direction: column; gap: 15px; }
.part-col-right { display: flex; flex-direction: column; gap: 15px; }
.part-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); overflow: hidden; display: flex; flex-direction: column;
  transition: border-color var(--transition-normal);
}
.part-card:hover { border-color: var(--border-strong); }
.part-card-head {
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-subtle); padding: 11px 15px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; font-weight: 800; color: var(--text-primary);
}
.part-card-head i { color: var(--accent-text); width: 16px; text-align: center; font-size: 14px; }
.part-card-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.pf-row { display: flex; gap: 12px; flex-wrap: wrap; }
.pf-col { flex: 1; min-width: 0; }
.pf-col.pf-wide { flex: 2; }
.pf-col label { font-size: 10.5px; font-weight: 800; color: var(--text-dim); display: block; margin-bottom: 5px; letter-spacing: .5px; text-transform: uppercase; }
.pf-col label .req { color: var(--accent-red); margin-left: 2px; font-weight: 800; }
.pf-ctrl {
  width: 100%; height: 38px; border: 1px solid var(--border-default); border-radius: 9px;
  padding: 0 12px; font-size: 13.5px; font-family: var(--font-body);
  background: var(--bg-input); color: var(--text-primary); box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.pf-ctrl:focus { outline: none; border-color: var(--c1); box-shadow: 0 0 0 3px var(--soft); }
select.pf-ctrl { cursor: pointer; }
.pf-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; min-height: 14px; font-weight: 600; letter-spacing: .2px; }
/* Input barcode + tombol isi otomatis */
.pf-barcode-wrap { position: relative; display: flex; gap: 6px; }
.pf-barcode-wrap .pf-ctrl { flex: 1; min-width: 0; font-family: var(--font-mono, ui-monospace, Consolas, monospace); letter-spacing: .4px; }
.pf-barcode-btn {
  flex: 0 0 auto; width: 38px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border-default); background: var(--bg-input); color: var(--accent-text);
  font-size: 14px; display: inline-flex; align-items: center; justify-content: center;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.pf-barcode-btn:hover { border-color: var(--c1); background: var(--soft-weak); }
.part-summary { flex: 0 0 auto; }
.summary-body { padding: 15px; display: flex; flex-direction: column; gap: 15px; }
.summary-section { font-size: 11px; font-weight: 800; color: var(--accent-text); text-transform: uppercase; letter-spacing: .7px; margin: 6px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--border-subtle); }
.summary-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 4px; }
.skpi {
  background: var(--bg-inset); border: 1px solid var(--border-subtle);
  border-radius: 12px; padding: 11px 12px 10px; display: flex; flex-direction: column; gap: 2px;
  position: relative; overflow: hidden;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.skpi:hover { border-color: var(--border-default); transform: translateY(-1px); }
.sk-ic {
  width: 26px; height: 26px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px; margin-bottom: 4px;
}
.sk-ic.sk-blue { background: rgba(59,130,246,.16); color: #60a5fa; }
.sk-ic.sk-emerald { background: rgba(16,185,129,.16); color: #34d399; }
.sk-ic.sk-orange { background: rgba(245,158,11,.16); color: #fbbf24; }
.sk-ic.sk-violet { background: rgba(139,92,246,.16); color: #a78bfa; }
html[data-theme="terang"] .sk-ic.sk-blue { background: rgba(37,99,235,.12); color: #1d4ed8; }
html[data-theme="terang"] .sk-ic.sk-emerald { background: rgba(5,150,105,.13); color: #047857; }
html[data-theme="terang"] .sk-ic.sk-orange { background: rgba(217,119,6,.13); color: #b45309; }
html[data-theme="terang"] .sk-ic.sk-violet { background: rgba(124,58,237,.13); color: #6d28d9; }
.sk-l { font-size: 9.5px; color: var(--text-dim); font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.sk-v { font-size: 19px; font-weight: 800; color: var(--text-primary); letter-spacing: -.3px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.sk-n { font-size: 10px; color: var(--text-muted); font-weight: 600; letter-spacing: .1px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-title {
  font-size: 10.5px; font-weight: 800; color: var(--accent-text); text-transform: uppercase;
  letter-spacing: .7px; margin: 6px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--border-subtle);
}
.summary-margins { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.sm-item {
  background: var(--bg-inset); border: 1px solid var(--border-subtle); border-radius: 10px;
  padding: 8px 5px 7px; text-align: center; display: flex; flex-direction: column; gap: 3px;
  transition: border-color var(--transition-fast);
}
.sm-item:hover { border-color: var(--border-default); }
.sm-l { font-size: 9.5px; color: var(--text-dim); font-weight: 800; }
.sm-v { font-size: 14px; font-weight: 800; color: var(--text-primary); letter-spacing: -.2px; font-variant-numeric: tabular-nums; }
.sm-bar { height: 3px; border-radius: 3px; background: var(--bg-chip); overflow: hidden; margin-top: 1px; }
.sm-bar > i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--text-dim); transition: width .25s ease, background .25s ease; }

/* ---------- HEADER MODAL PART ---------- */
.part-modal-head {
  background: linear-gradient(180deg, var(--bg-surface-2), transparent);
  border-bottom: 1px solid var(--border-default);
}
.part-modal-badge {
  width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; font-size: 14px; flex: 0 0 auto;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
.part-modal-sub { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-top: 1px; line-height: 1.3; }
.part-foot { display: flex; gap: 12px; justify-content: flex-end; padding-top: 8px; }
.part-foot .btn { min-width: 120px; font-size: 13.5px; padding: 0 18px; height: 40px; }

/* ===== STRUK (layar) ===== */
.struk { font-family: 'Courier New', monospace; font-size: 11px; color: var(--text-primary); width: 58mm; margin: 0 auto; }
.struk .c { text-align: center; } .struk .r { text-align: right; }
.struk .frow2 { display: flex; justify-content: space-between; }
.struk hr { border: none; border-top: 1px dashed var(--border-default); margin: 6px 0; }

/* ===== PRINT AREA ===== */
#printArea { display: none; }
@media print {
  body > * { display: none !important; }
  #printArea { display: block !important; }
  .inv-paper { font-family: Arial, sans-serif; font-size: 12px; color: #000; max-width: 800px; margin: 0 auto; padding: 16px; }
  .inv-paper table { width: 100%; border-collapse: collapse; }
  .inv-paper th { background: #ddd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .inv-paper th, .inv-paper td { border: 1px solid #999; padding: 6px 8px; }

  /* Cetak laporan gaya KasirPro: hanya isi printArea yang tampil */
  .kp-paper {
    width: auto; max-width: none; margin: 0;
    padding: 10px 14px; box-sizing: border-box;
    box-shadow: none !important; border-radius: 0;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .kp-paper table { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .struk { font-family: 'Courier New', monospace; font-size: 11px; color: #000; width: 58mm; margin: 0 auto; }
  .struk .c { text-align: center; } .struk .r { text-align: right; }
  .struk .frow2 { display: flex; justify-content: space-between; }
  .struk hr { border: none; border-top: 1px dashed #000; margin: 6px 0; }
  .inv-half { font-family: Arial, sans-serif; font-size: 11px; color: #000; width: 100%; max-width: 105mm; margin: 0 auto; padding: 8mm; }
  .inv-half .inv-header { text-align: center; margin-bottom: 8px; }
  .inv-half .inv-header h2 { font-size: 16px; font-weight: 800; margin: 0; }
  .inv-half .inv-header h3 { font-size: 13px; font-weight: 700; margin: 4px 0; }
  .inv-half .inv-header p { font-size: 10px; margin: 2px 0; }
  .inv-half .inv-info { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; font-size: 10px; margin-bottom: 8px; border-bottom: 1px solid #000; padding-bottom: 6px; }
  .inv-half .inv-table { width: 100%; border-collapse: collapse; font-size: 10px; margin-bottom: 8px; }
  .inv-half .inv-table th { background: #ddd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border: 1px solid #999; padding: 3px 5px; font-size: 10px; }
  .inv-half .inv-table td { border: 1px solid #999; padding: 3px 5px; }
  .inv-half .inv-total { font-size: 10px; margin-bottom: 8px; }
  .inv-half .inv-total div { display: flex; justify-content: space-between; padding: 2px 0; }
  .inv-half .inv-total .grand-total { border-top: 1px solid #000; padding-top: 4px; margin-top: 2px; font-weight: 700; }
  .inv-half .inv-footer { text-align: center; font-size: 10px; border-top: 1px dashed #000; padding-top: 6px; margin-top: 6px; }
  .inv-half.inv-dot { font-family: 'Courier New', monospace; font-size: 10px; }
  .inv-half.inv-dot .inv-table th { background: none !important; }
}

/* ===== LAPORAN PENJUALAN — PREVIEW GAYA KASIRPRO (berlaku di layar + cetak) ===== */
.kp-viewer { background: #9e9e9e; }
.kp-viewer .kp-viewer-head { background: #1f3b66 !important; height: 46px; padding: 0 14px; border-bottom: none !important; }
.kp-viewer-head h3::before { display: none !important; }
.kp-viewer .kp-viewer-head h3 { color: #fff; font-size: 14px; font-weight: 700; margin: 0; display: block; }
.kp-viewer-head h3::before { display: none !important; }
.kp-viewer-actions { display: flex; align-items: center; gap: 10px; }
.kp-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; cursor: pointer; color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.2;
  padding: 7px 16px; border-radius: 5px;
}
.kp-btn i { font-size: 12px; }
.kp-btn-print { background: #4b5563; }
.kp-btn-print:hover { background: #3f4753; }
.kp-btn-exit { background: #6f757b; }
.kp-btn-exit:hover { background: #5f656b; }
.kp-viewer-body { flex: 1 1 auto; min-height: 0; overflow: auto; background: #9e9e9e; padding: 26px 22px 40px; }

.kp-paper {
  background: #fff; color: #111;
  width: min(940px, 100%); margin: 0 auto 26px;
  padding: 24px 30px 42px; box-sizing: border-box; min-height: 420px;
  font-family: Arial, Helvetica, sans-serif; font-size: 11.5px; line-height: 1.45;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .4); border-radius: 3px;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.kp-kop-name { font-size: 19px; font-weight: 800; letter-spacing: -.2px; color: #111; }
.kp-kop-sub { font-size: 11px; color: #333; line-height: 1.55; }
.kp-badge-row { display: flex; justify-content: flex-end; margin-top: 16px; }
.kp-badge {
  background: #f09112; color: #fff; font-size: 13px; font-weight: 700;
  padding: 7px 16px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.kp-meta-strip { margin: 12px 0; font-size: 11.5px; color: #111; }
.kp-meta-strip span { margin-left: 34px; }

/* judul & blok Laba Rugi di atas kertas putih */
.kp-title { font-size: 14px; font-weight: 800; text-align: center; margin: 4px 0 16px; letter-spacing: .3px; color: #111; }
.lr-cols { display: flex; gap: 28px; align-items: flex-start; }
.lr-cols .lr-col { flex: 1; min-width: 0; }
.lr-sec { font-weight: 700; font-size: 11.5px; margin-bottom: 6px; letter-spacing: .4px; }
.lr-row { display: flex; justify-content: space-between; gap: 12px; padding: 4.5px 2px; border-bottom: 1px dashed #d7dde3; font-size: 11.5px; }
.lr-row span:last-child { white-space: nowrap; }
.lr-row.strong { border-bottom: 1px solid #c9d2dc; font-weight: 700; }
.lr-row.gold span { color: #b45309; font-weight: 700; }
.lr-box {
  margin-top: 26px; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-radius: 10px; font-size: 17px; font-weight: 800;
  background: linear-gradient(90deg, #14532d, #22c55e); color: #fff;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.lr-box.minus { background: linear-gradient(90deg, #7f1d1d, #ef4444); }
.cf-strip { display: flex; gap: 10px; margin: 4px 0 12px; }
.cf-strip .cf-item {
  flex: 1; border: 1px solid #c9d2dc; border-radius: 8px; background: #f8fafc;
  padding: 7px 10px; font-size: 10.5px; color: #555;
}
.cf-strip .cf-item b { display: block; font-size: 13px; color: #111; margin-top: 2px; }

.kp-paper table.kp-table, .kp-paper table.kp-grand-table {
  width: 100%; border-collapse: collapse; font-family: Arial, Helvetica, sans-serif;
  font-size: 11.5px; color: #111;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.kp-table thead th {
  background: #009b96; color: #fff; font-weight: 700; text-align: left;
  font-size: 11.5px; padding: 6px 8px; border: 1px solid #00867f;
}
.kp-table thead th.r { text-align: right; }
.kp-table thead th.c, .kp-table td.c { text-align: center; }
.kp-table td { border: 1px solid #b8c1c9; background: #fff; padding: 4px 8px; vertical-align: middle; }
.kp-table td.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kp-fk-row td { font-weight: 700; }
.kp-fk-row .kp-fk-plg { float: right; font-weight: 600; }
.kp-fk-row .kp-fk-plg b { font-weight: 800; }
.kp-st-ok { color: #00a651; }
.kp-st-warn { color: #e07b00; }
.kp-sum-row td { background: #e9fbec; font-weight: 700; }
.kp-terima-row td { color: #00a651; font-weight: 700; }
.kp-grand { margin-top: 12px; }
.kp-grand-table td {
  border: 1px solid #b8c1c9; background: #cfe3f6; font-weight: 700;
  font-size: 12px; padding: 6px 8px; color: #111;
}
.kp-grand-table td.r { text-align: right; font-variant-numeric: tabular-nums; }
.kp-grand-table tr + tr td { border-top: 2px solid #fff; }
.kp-grand-table tr.terima td { color: #00a651; }
.kp-empty { text-align: center; color: #666; padding: 30px 8px; font-size: 12px; }

/* tabel ringkasan & cashflow (laporan umum) di atas kertas putih */
.kp-paper .tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; color: #111; }
.kp-paper .tbl th { background: #009b96 !important; color: #fff !important; font-weight: 700; text-align: left; padding: 6px 8px; border: 1px solid #b8c1c9; position: static !important; }
.kp-paper .tbl td { background: #fff !important; border: 1px solid #b8c1c9; padding: 4px 8px; color: #111 !important; }
.kp-paper .tbl tr:nth-child(even) td { background: #f8fafc !important; }
.kp-paper .tbl .num, .kp-paper .tbl b { color: #111 !important; }
.kp-paper .tbl .badge { background: #e2e8f0; color: #334155; }

/* ===== MODE TERANG: PENYEMPURNAAN ELEMEN ===== */
html[data-theme="terang"] .side nav button.on { color: #101f38; }
html[data-theme="terang"] .side nav button.on i { color: var(--c1); }
html[data-theme="terang"] .kpi::after { opacity: .08; }
html[data-theme="terang"] .ic-blue { color: #2563eb; }
html[data-theme="terang"] .ic-pink { color: #db2777; }
html[data-theme="terang"] .ic-green { color: #16a34a; }
html[data-theme="terang"] .ic-amber { color: #d97706; }
html[data-theme="terang"] .ibtn { color: #dc2626; background: rgba(239,68,68,.08); }
html[data-theme="terang"] .itemrow button { color: #dc2626; background: rgba(239,68,68,.08); }
html[data-theme="terang"] .sgrow:hover, html[data-theme="terang"] .sgrow.hot { background: rgba(245,158,11,.12); }
html[data-theme="terang"] .kembali { color: #16a34a; }
html[data-theme="terang"] .kurang { color: #dc2626; }
html[data-theme="terang"] .shortcuts b { color: #d97706; }
html[data-theme="terang"] .itable th { color: #d97706; }
html[data-theme="terang"] .struk { color: #1f2937; }
html[data-theme="terang"] .modal-full .modal-head .btn-close:hover { color: #dc2626; }
html[data-theme="terang"] .menu-footer button:hover { background: rgba(239,68,68,.08); }
html[data-theme="terang"] .menu-footer button i { color: #dc2626; }
html[data-theme="terang"] .intipos-box .ib-copy { color: #0369a1; }
html[data-theme="terang"] .brand-text small { color: var(--text-dim); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .part-grid { grid-template-columns: 1fr; }
  .side { width: 224px; }
  .main { margin-left: 224px; }
}
@media (max-width: 900px) {
  .side { width: 200px; }
  .main { margin-left: 200px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .topbar h2 { font-size: 17px; }
  .topbar { height: 58px; padding: 0 18px; }
  .content { padding: 18px; }
  .login-split { grid-template-columns: 1fr; height: auto; max-height: 94vh; overflow: auto; }
  .login-brand { padding: 30px 28px; }
  .brand-hero { margin-top: 22px; }
  .login-form-side { padding: 30px 28px 36px; }
}
@media (max-width: 640px) {
  .summary-kpis { grid-template-columns: repeat(2, 1fr); }
  .summary-margins { grid-template-columns: repeat(3, 1fr); }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===== TOAST (notifikasi non-blocking, ganti alert()) ===== */
.toast-wrap {
  position: fixed; z-index: 99999; right: 16px; bottom: 16px;
  display: flex; flex-direction: column; gap: 8px;
  max-width: min(420px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 14px; border-radius: 10px;
  background: var(--bg-panel, #111c33);
  border: 1px solid var(--border-default, #24324d);
  border-left: 3px solid var(--c2, #3b82f6);
  box-shadow: 0 10px 30px rgba(2, 8, 23, .45);
  color: var(--text-primary, #e2e8f0);
  font-size: 13px; line-height: 1.45; font-weight: 500;
  animation: toastIn .18s ease-out;
  word-break: break-word;
}
.toast .toast-ico { flex: 0 0 auto; font-size: 14px; line-height: 1.3; color: var(--c2, #3b82f6); }
.toast.ok    { border-left-color: #22c55e; }
.toast.ok .toast-ico { color: #4ade80; }
.toast.warn  { border-left-color: #f59e0b; }
.toast.warn .toast-ico { color: #fbbf24; }
.toast.error { border-left-color: #ef4444; }
.toast.error .toast-ico { color: #f87171; }
.toast.hide { animation: toastOut .18s ease-in forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(14px); } }
html[data-theme="terang"] .toast {
  background: #fff; border-color: #dbe3ef;
  box-shadow: 0 10px 30px rgba(15, 35, 70, .18);
}

/* ===== FORM KOSONG / DAFTAR LEGACY ===== */
.itemlist { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.itemlist .itemrow {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border-radius: 8px;
  background: var(--bg-inset, #0f172a); border: 1px solid var(--border-subtle, #1e293b);
  font-size: 12px;
}
.itemlist .itemrow button {
  background: transparent; border: 1px solid var(--border-default, #24324d);
  color: var(--text-muted, #94a3b8); border-radius: 6px;
  width: 22px; height: 22px; cursor: pointer; font-size: 13px; line-height: 1;
}
.itemlist .itemrow button:hover { color: #f87171; border-color: #ef4444; }

/* ---------- Tombol ikon + keterangan (tooltip) ---------- */
.btn-ico {
  width: 38px; min-width: 38px; padding: 0; gap: 0; flex: 0 0 auto;
  font-size: 14px; line-height: 1;
}
.btn-ico i { font-size: 15px; }
.app-tip {
  position: fixed; z-index: 999999; pointer-events: none;
  background: #0f172a; color: #f8fafc;
  padding: 7px 11px; border-radius: 9px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .2px;
  white-space: nowrap; line-height: 1.25;
  box-shadow: 0 10px 26px rgba(2, 6, 23, .45);
  border: 1px solid rgba(255, 255, 255, .12);
  opacity: 0; transform: translateY(-4px);
  transition: opacity .13s ease, transform .13s ease;
}
.app-tip.tampil { opacity: 1; transform: translateY(0); }
.app-tip::after {
  content: ''; position: absolute; left: 50%; bottom: -5px;
  width: 9px; height: 9px; margin-left: -4.5px;
  background: #0f172a; transform: rotate(45deg);
  border-right: 1px solid rgba(255, 255, 255, .12);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.app-tip.atas { transform: translateY(4px); }
.app-tip.atas.tampil { transform: translateY(0); }
.app-tip.atas::after { bottom: auto; top: -5px; border: none; border-left: 1px solid rgba(255, 255, 255, .12); border-top: 1px solid rgba(255, 255, 255, .12); }

/* ---------- Modal Edit User: tombol Simpan selalu terlihat ---------- */
#userModal .form-modal-foot {
  position: sticky; bottom: 0; z-index: 6;
  margin: 14px -16px -14px; padding: 12px 16px;
  background: var(--bg-inset);
  box-shadow: 0 -12px 22px rgba(2, 6, 23, .22);
}
#userModal .perm-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { #userModal .perm-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Catatan panel (dasar perhitungan) ---------- */
.panel-note {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 10px; padding: 9px 12px;
  font-size: 11.5px; line-height: 1.55; color: var(--text-muted);
  background: var(--bg-chip); border: 1px solid var(--border-default);
  border-radius: 10px;
}
.panel-note > i { color: var(--accent-text); margin-top: 1px; flex-shrink: 0; }
.panel-note b { color: var(--text-secondary); }
.badge.b-Lunas { background: linear-gradient(135deg, #16a34a, #15803d); }

/* ============================================================
   PENERIMAAN BARANG (FAKTUR PEMBELIAN)
   ============================================================ */

/* --- Tabel daftar yang padat: bisa muat lebih banyak data --- */
#p-pembelian .tbl th { padding: 7px 10px; }
#p-pembelian .tbl td { padding: 4px 10px; font-size: 12.5px; line-height: 1.4; }
#p-pembelian .tbl td b { font-weight: 700; }
#p-pembelian .tbl td code {
  font-size: 11.5px; white-space: nowrap;
  background: var(--bg-chip); padding: 2px 6px; border-radius: 5px;
}
#p-pembelian .tbl .badge { padding: 2px 8px; font-size: 9px; }
#p-pembelian .tbl .badge::before { width: 5px; height: 5px; }
#p-pembelian .tbl .btn.small { height: 25px; padding: 0 9px; font-size: 11px; gap: 5px; }
#p-pembelian .toolbar { gap: 7px; }

/* --- Form Faktur Pembelian (tanpa inline style) --- */
.po-form-grid { display: grid; grid-template-columns: 2fr 1.4fr 0.8fr 1fr 1fr 1fr; gap: 8px; flex: 0 0 auto; }
.po-form-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.po-form-grid label { font-size: 10px; color: var(--text-muted); font-weight: 700; letter-spacing: .2px; }
.po-form-grid .inp { height: 30px; margin-bottom: 0; font-size: 12px; }
.po-tempo { display: flex; gap: 4px; }
.po-tempo .inp { height: 34px; margin-bottom: 0; flex: 1 1 auto; min-width: 0; }
.po-tempo .inp:last-child { flex: 0 0 62px; width: 62px; }
.po-scan { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.po-scan > div { flex: 1 1 auto; min-width: 0; }
.po-scan label { display: block; margin-bottom: 2px; font-size: 10px; color: var(--text-muted); font-weight: 700; }
.po-scan .inp.scan { margin-bottom: 0; height: 32px; }
/* --- Penerimaan Barang: ringkasan bawah 1 baris (hemat tinggi) --- */
.po-foot { display: flex; gap: 14px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; flex: 0 0 auto; }
.po-foot-left { flex: 0 0 auto; display: flex; gap: 10px; align-items: flex-end; }
.po-foot-left > div { display: flex; flex-direction: column; gap: 2px; width: 138px; }
.po-foot-left label { font-size: 10px; color: var(--text-muted); font-weight: 700; letter-spacing: .2px; }
.po-foot-left .inp { margin-bottom: 0; height: 30px; font-size: 12px; }
.po-foot-right {
  flex: 1 1 auto; display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  background: var(--bg-inset); border: 1px solid var(--border-subtle); border-radius: 11px; padding: 7px 11px;
}
.po-foot-right .pr { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.po-foot-right .pr > span { font-size: 10.5px; font-weight: 700; color: var(--text-dim); letter-spacing: .2px; }
.po-foot-right .pr b { font-size: 13px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
/* Kotak Kas/Bank & Dibayar: ukuran, latar, sudut & posisi disamakan */
.po-foot-right .inp.sm {
  flex: 0 0 132px; max-width: 132px; margin-bottom: 0; height: 30px; width: 132px; padding: 0 9px;
  font-size: 11.5px; font-weight: 700; line-height: 28px;
  border-radius: 8px; text-align: left;
  background-color: var(--bg-input-solid);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.po-foot-right select.inp.sm {
  padding-right: 26px; background-position: right 8px center; cursor: pointer;
}
.po-foot-right .inp.sm:focus { border-color: var(--c2); box-shadow: 0 0 0 3px var(--soft); }
.po-foot-right .grand {
  flex: 0 0 auto; font-size: 15px !important; text-align: right; padding: 6px 12px;
  border-radius: 9px; margin-top: 0 !important; box-shadow: none; letter-spacing: -.2px;
}

/* --- Tabel item lebih rapat: muat banyak item --- */
/* --- Penerimaan Barang: keranjang gotong royong ruang --- */
.po-items { max-height: none; flex: 1 1 auto; min-height: 150px; margin-top: 0; }
#poModal .modal-body.trans { overflow: hidden; }
#poModal .modal-body.trans > .frow { flex-shrink: 0; }
.po-itbl { width: max-content; min-width: 100%; }
.po-itbl th.c-no { width: 42px; }
.po-itbl th.c-item { min-width: 360px; white-space: nowrap; }
.po-itbl th.c-qty { width: 84px; }
.po-itbl th.c-harga { width: 124px; }
.po-itbl th.c-disk { width: 96px; }
.po-itbl th.c-sub { width: 138px; text-align: right; }
.po-itbl th.c-x { width: 38px; }
.po-itbl td { padding: 1px 8px; }
.po-itbl thead th { padding: 5px 8px; }
.po-itbl td.po-nm { white-space: nowrap; }
.po-itbl td.po-nm code { font-size: 11px; color: var(--text-muted); margin-right: 4px; }
.po-itbl .qinput, .po-itbl .pinput { padding: 3px 5px; font-size: 12px; height: 26px; }
.po-itbl .qinput { width: 54px; }
.po-itbl .pinput { width: 94px; }
.po-itbl .ibtn { height: 24px; padding: 0 9px; font-size: 11px; }

/* ---------- Petunjuk di daftar saran (scan transaksi) ---------- */
.sug-hint {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 11px; margin-top: 3px;
  font-size: 10.5px; color: var(--text-dim);
  background: var(--bg-inset); border-top: 1px solid var(--border-subtle);
  letter-spacing: .2px;
  position: sticky; bottom: 0; z-index: 2;
  backdrop-filter: blur(4px);
}
/* ---------- Kepala daftar saran (semua barang) ---------- */
.sug-head {
  position: sticky; top: 0; z-index: 2;
  padding: 8px 11px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  color: var(--text-muted); text-transform: uppercase;
  background: var(--bg-inset); border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(4px);
}
.sug-head + .sgrow { border-top: none; }
.sug-hint b { color: var(--accent-text); font-weight: 800; }
.sug-hint i { font-size: 11px; opacity: .8; }

/* Alamat pada kop struk/laporan: ikut multi-baris seperti dari lisensi */
.kp-alamat { white-space: pre-line; }
/* Alamat multi-baris ikut tercetak di invoice/struk (A4, half, thermal) */
.inv-paper > p, .inv-header > p, .kp-kop-addr { white-space: pre-line; }
/* ============================================================
   BUG#56 — WARNA SEMUA HALAMAN
   Mengikuti "Warna Aksen" (Pengaturan > Tampilan > Warna Aksen)
   Berlaku: judul halaman, kepala semua tabel, pita header semua modal
   ============================================================ */

/* --- 1) Judul halaman (atas): batang aksen warna --- */
.topbar h2 { position: relative; padding-left: 15px; }
.topbar h2::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 5px; height: 22px; border-radius: 3px;
  background: var(--grad-primary); box-shadow: 0 0 10px var(--glow);
}

/* --- 2) Kepala semua tabel utama jadi berwarna --- */
.tbl thead th,
#p-users thead th {
  background: var(--grad-primary);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.16);
  text-shadow: 0 1px 1px rgba(0,0,0,.18);
}

/* --- 3) Pita header semua modal jadi berwarna --- */
.modal-full .modal-head,
.form-modal-head,
.part-modal-head {
  background: var(--grad-primary);
  border-bottom: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 10px 24px -14px var(--glow);
  position: relative; overflow: hidden;
}
.modal-full .modal-head::before,
.form-modal-head::before,
.part-modal-head::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.14) 50%, transparent 70%);
}
.modal-full .modal-head > *,
.form-modal-head > *,
.part-modal-head > * { position: relative; z-index: 1; }
.modal-full .modal-head h3,
.form-modal-head h3,
.part-modal-head h3 { color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.18); }
.modal-full .modal-head h3::before,
.form-modal-head h3::before { background: rgba(255,255,255,.92); box-shadow: none; }
.modal-full .modal-head h3 .tagno,
.form-modal-head h3 .tagno { color: #fff; opacity: .92; }
.part-modal-sub { color: rgba(255,255,255,.86); font-weight: 700; }
.part-modal-badge {
  background: rgba(255,255,255,.2); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.modal-full .modal-head .btn-close,
.form-modal-head .btn-close,
.part-modal-head .btn-close {
  background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.95);
}
.modal-full .modal-head .btn-close:hover,
.form-modal-head .btn-close:hover,
.part-modal-head .btn-close:hover {
  background: rgba(255,255,255,.26); border-color: rgba(255,255,255,.55); color: #fff;
}

/* --- 4) Ikon judul kartu ikut warna aksen --- */
.card > h3 > i { color: var(--c2); }