/* =========================================================================
   MHT Finance - Web
   Tampilan modern & ramah pengguna: navigasi berikon, toolbar menempel,
   indikator mode tambah/ubah, pencarian menu, tanpa dependensi luar
   (aman untuk jaringan intranet rumah sakit tanpa internet).
   ========================================================================= */
:root {
  --ink: #0f1d2a;
  --ink-2: #3f4f5f;
  --ink-3: #74828f;
  --line: #e1e6eb;
  --line-2: #eff2f5;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --brand: #2563eb;
  --brand-2: #3b82f6;
  --brand-ink: #ffffff;
  --brand-soft: #eaf1ff;
  --accent: #3b82f6;
  --nav: #0b2730;
  --nav-2: #12363f;
  --nav-ink: #b9cfd3;
  --danger: #c0262d;
  --danger-soft: #fdeeee;
  --ok: #16794a;
  --ok-soft: #e6f6ed;
  --warn: #8d5b00;
  --warn-soft: #fff5e0;
  --edit: #b26b00;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 29, 42, .05), 0 1px 3px rgba(15, 29, 42, .06);
  --shadow-lg: 0 18px 48px rgba(15, 29, 42, .18);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
  --sidebar-w: 252px;
  --top-h: 58px;
}

* { box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.012em; }
.muted { color: var(--ink-3); }
::selection { background: #cfe0ff; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  height: var(--top-h); padding: 0 18px 0 0;
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line); color: var(--ink-2);
}
.brand { display: flex; align-items: center; gap: 10px; width: var(--sidebar-w); height: 100%; padding: 0 18px; flex: 0 0 auto; text-decoration: none; color: #fff; background: var(--nav); }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; font-weight: 800; font-size: 11px; letter-spacing: .04em; color: #fff; background: linear-gradient(135deg, #06b6d4 0%, #2563eb 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -.01em; }
.brand-name small { display: block; font-size: 10.5px; font-weight: 500; color: var(--nav-ink); letter-spacing: .02em; margin-top: -3px; }
.nav-toggle { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); cursor: pointer; }
.nav-toggle:hover { background: var(--line-2); color: var(--ink); }
.nav-toggle .i { width: 20px; height: 20px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.chip strong { color: var(--ink); font-weight: 650; }
.chip .i { width: 15px; height: 15px; color: var(--brand); }
.company:empty, .period:empty { display: none; }
.spacer { flex: 1; }

.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; color: var(--ink); padding: 4px 10px 4px 4px; border-radius: 999px; font-weight: 600; font-size: 13.5px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover, .usermenu[open] summary { background: var(--line-2); }
.usermenu summary .i-down { width: 14px; height: 14px; color: var(--ink-3); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #06b6d4, #2563eb); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; }
.usermenu-list { position: absolute; right: 0; top: 46px; min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; animation: pop .14s ease-out; }
.usermenu-head { padding: 10px 12px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; font-size: 12.5px; color: var(--ink-3); }
.usermenu-head strong { display: block; color: var(--ink); font-size: 14px; }
.usermenu-list a, .usermenu-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; color: var(--ink); text-decoration: none; border-radius: 8px; border: 0; background: none; font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; }
.usermenu-list a:hover, .usermenu-list button:hover { background: var(--line-2); }
.usermenu-list .i { color: var(--ink-3); }
.usermenu-list a.danger, .usermenu-list a.danger .i { color: var(--danger); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* progress bar saat postback */
.busy-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; opacity: 0; transition: opacity .2s; background: linear-gradient(90deg, transparent 0, var(--brand-2) 40%, #93c5fd 60%, transparent 100%); background-size: 50% 100%; background-repeat: no-repeat; }
body.busy .busy-bar { opacity: 1; animation: busy 1s linear infinite; }
body.busy { cursor: progress; }
@keyframes busy { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: calc(100vh - var(--top-h)); }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--nav); color: var(--nav-ink);
  padding: 12px 10px 24px; position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
  transition: width .18s ease, flex-basis .18s ease;
}
.content { flex: 1; min-width: 0; padding: 20px 26px 48px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head h1 { font-size: 21px; line-height: 1.25; }
.page-ico { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); flex: 0 0 auto; }
.page-ico .i { width: 20px; height: 20px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); margin-bottom: 2px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.crumbs .i { width: 12px; height: 12px; opacity: .7; }

.nav-search { position: relative; margin: 0 2px 10px; }
.nav-search .i { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; color: var(--nav-ink); opacity: .8; }
.nav-search input { width: 100%; height: 34px; padding: 0 10px 0 32px; border-radius: 9px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.06); color: #fff; font: inherit; font-size: 13px; }
.nav-search input::placeholder { color: var(--nav-ink); opacity: .75; }
.nav-search input:focus { outline: none; border-color: rgba(147, 197, 253, .55); background: rgba(255,255,255,.1); }
.nav-empty { display: none; padding: 8px 12px; font-size: 12.5px; color: var(--nav-ink); }
.nav-home, .nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 8px; color: var(--nav-ink); text-decoration: none; font-size: 13.5px; line-height: 1.35; }
.nav-home { font-weight: 600; color: #e6f1f2; margin-bottom: 6px; }
.nav-home .i { width: 18px; height: 18px; }
.nav-home:hover, .nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-home.active, .nav-item.active { background: rgba(37, 99, 235, .18); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #3b82f6; }
.nav-item { padding-left: 40px; justify-content: space-between; }
.nav-item.pending { color: #7f9aa0; }
.nav-group { margin-top: 2px; }
.nav-group summary { list-style: none; cursor: pointer; padding: 8px 12px; font-weight: 600; font-size: 13.5px; color: #dbe8ea; border-radius: 8px; display: flex; align-items: center; gap: 10px; user-select: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: ""; margin-left: auto; width: 14px; height: 14px; background: currentColor; opacity: .55; -webkit-mask: var(--i-next) center / contain no-repeat; mask: var(--i-next) center / contain no-repeat; transition: transform .15s; }
.nav-group[open] summary::after { transform: rotate(90deg); }
.nav-group summary:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-group summary .i { width: 18px; height: 18px; opacity: .9; }
.nav-group[open] > summary { color: #fff; }
.nav-foot { margin: 18px 12px 0; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11.5px; color: #6f8a90; }
.tag { font-size: 10.5px; font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 0 7px; white-space: nowrap; }
.sidebar .tag { background: rgba(255, 196, 87, .14); color: #f7c873; }
.nav-backdrop { display: none; }

/* sidebar ringkas (ikon saja) - desktop */
@media (min-width: 861px) {
  body.nav-mini { --sidebar-w: 68px; }
  body.nav-mini .brand-name, body.nav-mini .nav-search, body.nav-mini .nav-item, body.nav-mini .nav-foot,
  body.nav-mini .nav-home span, body.nav-mini .nav-group summary span, body.nav-mini .nav-group summary::after { display: none; }
  body.nav-mini .brand { padding: 0 18px; }
  body.nav-mini .nav-home, body.nav-mini .nav-group summary { justify-content: center; padding: 10px 0; }
}

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { padding: 16px 18px; display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; }
.stat-ico { grid-row: span 3; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.stat-ico .i { width: 22px; height: 22px; }
.stat-ico.c2 { background: #eaf0ff; color: #3355c4; }
.stat-ico.c3 { background: #fff1e3; color: #b25d00; }
.stat-label { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; }
.stat-value { font-size: 16.5px; font-weight: 650; line-height: 1.3; }
.stat .muted { font-size: 12.5px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink); margin: 6px 0 12px; }
.empty-state { padding: 28px; max-width: 640px; }
.empty-state p { margin: 0 0 10px; }

/* beranda */
.hero { position: relative; overflow: hidden; padding: 22px 24px; margin-bottom: 18px; border-radius: 14px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #06b6d4 0%, #2563eb 45%, #0b2730 100%); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgba(255,255,255,.06); }
.hero-hello { font-size: 13px; color: #dbeafe; font-weight: 600; }
.hero h2 { font-size: 24px; margin: 2px 0 6px; }
.hero p { margin: 0; color: #e0ecff; max-width: 640px; }
.hero-search { position: relative; max-width: 460px; margin-top: 16px; z-index: 1; }
.hero-search .i { position: absolute; left: 13px; top: 12px; color: var(--ink-3); }
.hero-search input { width: 100%; height: 42px; padding: 0 14px 0 40px; border-radius: 11px; border: 0; font: inherit; font-size: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.hero-search input:focus { outline: 3px solid rgba(147, 197, 253, .6); }
.recent { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.recent:empty { display: none; }
.recent a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 13px; box-shadow: var(--shadow); }
.recent a:hover { border-color: var(--accent); color: var(--brand); }
.recent a .i { width: 14px; height: 14px; color: var(--ink-3); }
.recent-title { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.recent-title[hidden] { display: none; }
.menu-grid { columns: 300px; column-gap: 14px; }
.menu-grid > .menu-card { break-inside: avoid; margin-bottom: 14px; }
.menu-card { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.menu-card-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; }
.menu-card-head h3 { font-size: 15px; flex: 1; }
.menu-card-head .count { font-size: 12px; color: var(--ink-3); background: var(--line-2); border-radius: 999px; padding: 1px 9px; }
.menu-card .page-ico { width: 36px; height: 36px; border-radius: 10px; }
.menu-links { display: flex; flex-direction: column; padding: 0 8px 10px; }
.menu-link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 13.5px; }
.menu-link::after { content: ""; margin-left: auto; width: 14px; height: 14px; background: currentColor; opacity: 0; transform: translateX(-4px); transition: .15s; -webkit-mask: var(--i-arrow) center / contain no-repeat; mask: var(--i-arrow) center / contain no-repeat; }
.menu-link:hover { background: var(--brand-soft); color: var(--brand); }
.menu-link:hover::after { opacity: .9; transform: none; }
.menu-link.pending { color: var(--ink-3); }
.menu-link.pending::after { display: none; }
.menu-none { display: none; padding: 28px; text-align: center; color: var(--ink-3); }

/* ---------- Alerts ---------- */
.alert { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 11px 40px 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid; box-shadow: var(--shadow); animation: pop .18s ease-out; transition: opacity .3s, transform .3s; }
.alert::before { content: ""; flex: 0 0 18px; height: 18px; margin-top: 1px; background: currentColor; -webkit-mask: var(--i-ok) center / contain no-repeat; mask: var(--i-ok) center / contain no-repeat; }
.alert-ok { background: var(--ok-soft); border-color: #bfe5cf; color: var(--ok); }
.alert-error { background: var(--danger-soft); border-color: #f3c6c8; color: var(--danger); }
.alert-error::before { -webkit-mask-image: var(--i-alert); mask-image: var(--i-alert); }
.alert.fade { opacity: 0; transform: translateY(-4px); }
.alert-x { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; color: inherit; cursor: pointer; font-size: 13px; opacity: .65; }
.alert-x:hover { opacity: 1; background: rgba(0,0,0,.05); }

/* ---------- Toolbar ---------- */
.tb-wrap { position: sticky; top: calc(var(--top-h) + 8px); z-index: 25; margin-bottom: 14px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow); }
.tb-group { display: flex; align-items: center; gap: 4px; }
.tb-group + .tb-group { padding-left: 12px; border-left: 1px solid var(--line); }
.tb-filter { margin-left: auto; border-left: 0 !important; gap: 6px; }
.tb-filter > .muted { display: none; }
.tb-search { position: relative; display: inline-flex; }
.tb-search .i { position: absolute; left: 9px; top: 8px; width: 15px; height: 15px; color: var(--ink-3); pointer-events: none; }
.tb-search .input { padding-left: 30px; width: 220px; }
.statusbar { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); padding: 5px 12px; background: #f8fafb; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); min-height: 30px; }
.statusbar::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9fb0bb; flex: 0 0 auto; }
.statusbar span:empty::after { content: "Siap"; }
.recno { padding: 0 8px; font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
/* mode tambah / ubah: penanda warna agar user tahu sedang mengedit */
.tb-wrap.mode-add .toolbar, .tb-wrap.mode-edit .toolbar { border-color: #f0c77a; box-shadow: 0 0 0 3px rgba(240, 180, 60, .14); }
.tb-wrap.mode-add .statusbar, .tb-wrap.mode-edit .statusbar { background: #fff8e8; border-color: #f0c77a; color: var(--edit); font-weight: 600; }
.tb-wrap.mode-add .statusbar::before, .tb-wrap.mode-edit .statusbar::before { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); animation: pulse 1.6s ease-in-out infinite; }
.tb-wrap.mode-add .statusbar::after, .tb-wrap.mode-edit .statusbar::after { content: "Ctrl+S simpan · Esc batal"; margin-left: auto; font-weight: 500; color: #a87a2a; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); } }
body.editing .form-card { border-color: #f3dcae; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 550; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s, box-shadow .12s; }
.btn:hover { border-color: #c4ced7; background: #f8fafb; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .input:focus-visible { outline: 3px solid rgba(37, 99, 235, .28); outline-offset: 1px; }
.btn .ico { font-size: 13px; line-height: 1; opacity: .85; }
.btn .i { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 2px rgba(37, 99, 235, .3); }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); border-color: transparent; color: var(--ink); }
.btn-danger-ghost { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: #f3c6c8; color: var(--danger); }
.btn-icon { padding: 0; width: 34px; }
.btn-block { width: 100%; justify-content: center; height: 42px; font-size: 14.5px; }
a.btn[disabled], .btn.aspNetDisabled { opacity: .5; pointer-events: none; }

/* ---------- Inputs ---------- */
.input { height: 34px; padding: 5px 10px; border: 1px solid #cfd7df; border-radius: var(--radius-sm); font: inherit; font-size: 13.5px; color: var(--ink); background: #fff; max-width: 100%; transition: border-color .12s, box-shadow .12s; }
.input:hover:not([readonly]):not(:disabled) { border-color: #b3bfca; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); }
.input.ro, .input[readonly] { background: #f6f8fa; color: var(--ink-2); border-color: var(--line); }
.input[readonly]:focus { box-shadow: none; border-color: var(--line); }
select.input { padding-right: 6px; cursor: pointer; }
select.input:disabled { background: #f6f8fa; color: var(--ink-2); cursor: default; }
textarea.input { height: auto; min-height: 64px; }
.input-sm { height: 32px; font-size: 13px; }
.w-xs { width: 56px; } .w-sm { width: 130px; } .w-md { width: 240px; } .w-lg { width: 440px; } .w-num { width: 170px; text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 15px; height: 15px; }

/* ---------- Forms ---------- */
.form-sections { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.form-sections > * { min-width: 0; }
.form-card { padding: 18px 20px; transition: border-color .2s; }
.form-card.narrow { max-width: 540px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 14px; }
.card-title::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--accent); }
.form-card .card-title:not(:first-child) { margin-top: 22px; }
.form-grid { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px 16px; align-items: center; }
.form-grid > label, .form-grid > span { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.field.inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.field.checks { display: flex; flex-direction: column; gap: 6px; }
.field.checks.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); }
.check label { margin-left: 7px; cursor: pointer; }
.check input { vertical-align: -3px; }
.form-actions { display: flex; gap: 8px; margin-top: 18px; padding-left: 186px; }

/* ---------- Grid ---------- */
.grid-card { overflow-x: auto; }
.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.grid th { position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 650; font-size: 12px; letter-spacing: .02em; color: var(--ink-2); background: #f6f8fa; border-bottom: 1px solid var(--line); padding: 10px 12px; white-space: nowrap; }
.grid th a { color: inherit; text-decoration: none; }
.grid th a:hover { color: var(--brand); }
.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.grid tr:last-child td { border-bottom: 0; }
.grid tr.clickable { cursor: pointer; }
.grid tr:hover td { background: #f3f7ff; }
.grid tr.selected td { background: var(--brand-soft); }
.grid .col-select { width: 38px; text-align: center; }
.grid .col-select a { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 6px; border-radius: 6px; text-decoration: none; color: var(--ink-3); font-size: 11px; }
.grid tr:hover .col-select a { color: #fff; background: var(--accent); }
.grid-card > .grid th:first-child { border-top-left-radius: var(--radius); }
.grid-card > .grid th:last-child { border-top-right-radius: var(--radius); }
.pager td { padding: 10px; background: #fafbfc; }
.pager table { border-collapse: collapse; }
.pager td td { padding: 0; background: none; }
.pager a, .pager span { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; margin-right: 3px; border-radius: 7px; text-align: center; text-decoration: none; font-variant-numeric: tabular-nums; }
.pager span { background: var(--brand); color: #fff; font-weight: 600; }
.pager a:hover { background: var(--line-2); }

/* ---------- Modal (LookupDialog) ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(11, 25, 34, .5); backdrop-filter: blur(2px); display: grid; place-items: start center; padding: 6vh 16px; animation: fadein .15s ease-out; }
@keyframes fadein { from { opacity: 0; } }
.modal { width: min(860px, 100%); max-height: 86vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .18s ease-out; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.modal-head h3::before { content: ""; width: 18px; height: 18px; background: var(--brand); -webkit-mask: var(--i-search) center / contain no-repeat; mask: var(--i-search) center / contain no-repeat; }
.modal-search { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); background: #fafbfc; }
.modal-body { overflow: auto; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 12.5px; background: #fafbfc; }
.modal-foot .pager { display: flex; gap: 8px; align-items: center; }
.modal-foot .pager span { background: none; color: var(--ink-2); }

/* ---------- Dialog pintasan keyboard ---------- */
.kbd-dialog { border: 0; border-radius: 14px; padding: 0; width: min(440px, calc(100% - 32px)); box-shadow: var(--shadow-lg); color: var(--ink); }
.kbd-dialog::backdrop { background: rgba(11, 25, 34, .45); }
.kbd-dialog h3 { padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: 16px; display: flex; align-items: center; gap: 10px; }
.kbd-dialog dl { margin: 0; padding: 10px 18px 6px; display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; font-size: 13.5px; }
.kbd-dialog dd { margin: 0; color: var(--ink-2); }
.kbd-dialog .foot { padding: 12px 18px 16px; text-align: right; }
kbd { display: inline-block; min-width: 24px; padding: 2px 7px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: #f8fafb; font: 600 12px var(--mono); color: var(--ink-2); text-align: center; }

/* ---------- Login ---------- */
.login-body { min-height: 100vh; margin: 0; background: var(--bg); }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); }
.login-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; color: #fff; background: radial-gradient(110% 90% at 0% 100%, #06b6d4 0%, transparent 55%), radial-gradient(90% 90% at 100% 0%, #3b82f6 0%, transparent 60%), #0b2730; }
.login-art::before, .login-art::after { content: ""; position: absolute; border-radius: 50%; border: 48px solid rgba(255,255,255,.05); }
.login-art::before { width: 420px; height: 420px; right: -140px; top: 18%; }
.login-art::after { width: 260px; height: 260px; left: -90px; bottom: -80px; }
.login-art .brand { width: auto; height: auto; padding: 0; background: none; position: relative; z-index: 1; }
.login-art .brand-mark { width: 40px; height: 40px; font-size: 13px; border-radius: 11px; }
.login-art .brand-name { font-size: 20px; }
.login-pitch { position: relative; z-index: 1; max-width: 460px; }
.login-pitch h2 { font-size: 32px; line-height: 1.15; margin-bottom: 12px; }
.login-pitch p { color: #dbeafe; margin: 0 0 22px; font-size: 15px; }
.login-pitch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.login-pitch li { display: flex; align-items: center; gap: 10px; color: #eef4ff; }
.login-pitch li .i { color: #93c5fd; }
.login-art .foot { position: relative; z-index: 1; font-size: 12px; color: #c7d7f5; }
.login-side { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: min(380px, 100%); }
.login-card h1 { font-size: 26px; margin-bottom: 4px; }
.login-company { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px; color: var(--ink-2); font-weight: 600; }
.login-company:empty { display: none; }
.login-company .i { color: var(--brand); }
.login-sub { margin: 0 0 6px; color: var(--ink-3); }
.login-card label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 14px 0 6px; }
.login-field { position: relative; }
.login-field > .i { position: absolute; left: 12px; top: 12px; color: var(--ink-3); pointer-events: none; }
.login-card .input { width: 100%; height: 42px; padding-left: 38px; font-size: 14px; }
.pw-toggle { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border: 0; border-radius: 7px; background: none; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.pw-toggle:hover { background: var(--line-2); color: var(--ink); }
.pw-toggle.on { color: var(--brand); }
.caps { display: none; margin-top: 6px; font-size: 12.5px; color: var(--warn); }
.caps.on { display: block; }
.login-card .btn-block { margin-top: 22px; }
.login-error { display: flex; gap: 8px; align-items: flex-start; color: var(--danger); background: var(--danger-soft); border: 1px solid #f3c6c8; border-radius: 8px; font-size: 13px; margin-top: 14px; padding: 9px 12px; }
.login-error:empty { display: none; }
.login-foot { text-align: center; font-size: 12px; margin: 26px 0 0; }
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { padding: 22px 20px; min-height: 0; }
  .login-pitch, .login-art .foot { display: none; }
  .login-side { place-items: start center; padding-top: 28px; }
}

/* ---------- Form transaksi (master + detail) ---------- */
.form-head { display: flex; justify-content: flex-end; margin: -4px 0 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 3px 11px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.form-cols { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; align-items: start; }
.form-side { display: flex; flex-direction: column; gap: 12px; }
.option-group legend { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 0 6px; }
.option-group > span, .option-group input[type=radio] + label { margin-right: 10px; }
.option-group fieldset { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 9px 12px; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 14px 14px; background: #fbfcfd; }
.option-group legend { grid-column: 1 / -1; }
.option-group span { display: inline-flex; align-items: center; gap: 7px; }
.flags { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; font-size: 13px; padding: 4px 2px; }
.grid-scroll { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.grid-detail { min-width: 900px; }
.grid-detail td { padding: 5px 6px; vertical-align: middle; }
.grid-detail th { padding: 9px 6px; }
.grid-detail .col-no { width: 34px; color: var(--ink-3); text-align: right; }
.grid-detail .col-btn { width: 38px; text-align: center; }
.grid-detail tr:hover td { background: transparent; }
.grid-detail tr.row-error td { background: var(--danger-soft); }
.grid-detail tfoot td { border-top: 2px solid var(--line); background: #f8fafb; font-weight: 650; padding: 9px 6px; }
.grid-detail .total { font-variant-numeric: tabular-nums; }
.input-cell { height: 32px; width: 100%; min-width: 90px; font-size: 13px; padding: 4px 7px; }
.btn-xs { height: 28px; padding: 0 9px; font-size: 12px; }
.btn-icon.btn-xs { padding: 0; width: 28px; }
.totals { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 20px; padding-top: 14px; font-size: 13.5px; color: var(--ink-2); }
.totals strong { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 6px; font-size: 14.5px; }
.balance { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; padding: 3px 12px; border-radius: 999px; }
.balance.ok { background: var(--ok-soft); color: var(--ok); }
.balance.off { background: var(--danger-soft); color: var(--danger); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .topbar .period { display: none; }
}
@media (max-width: 860px) {
  :root { --top-h: 54px; }
  .form-cols { grid-template-columns: 1fr; }
  .brand { width: auto; background: none; color: var(--ink); padding: 0 4px 0 0; }
  .brand-name small { display: none; }
  .topbar { padding-left: 8px; gap: 8px; }
  .topbar .company { display: none; }
  .usermenu summary .uname, .usermenu summary .i-down { display: none; }
  .sidebar { position: fixed; left: 0; top: var(--top-h); z-index: 50; width: 284px; transform: translateX(-100%); transition: transform .22s ease; }
  body.nav-open .sidebar { box-shadow: 8px 0 28px rgba(0,0,0,.2); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: var(--top-h) 0 0 0; z-index: 45; background: rgba(11, 25, 34, .4); }
  .content { padding: 16px 16px 36px; }
  .page-head h1 { font-size: 19px; }
  .form-grid { grid-template-columns: 1fr; gap: 4px 0; }
  .form-grid > label { margin-top: 8px; }
  .form-actions { padding-left: 0; }
  .w-lg, .w-md { width: 100%; }
  .tb-wrap { top: calc(var(--top-h) + 4px); }
  .toolbar .btn .lbl { display: none; }
  .toolbar .btn:not(.btn-icon) { padding: 0 10px; }
  .tb-filter { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .tb-search, .tb-search .input { flex: 1 1 140px; width: auto; min-width: 0; }
  .tb-filter .input { flex: 1 1 120px; min-width: 0; }
  .tb-group + .tb-group { padding-left: 0; border-left: 0; }
  .field.checks.cols-2 { grid-template-columns: 1fr; }
  .tb-wrap.mode-add .statusbar::after, .tb-wrap.mode-edit .statusbar::after { display: none; }
  .hero { padding: 18px; }
  .hero h2 { font-size: 20px; }
}

@media print {
  .topbar, .sidebar, .tb-wrap, .toolbar, .statusbar, .alert, .busy-bar, .crumbs, .page-ico { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 0; }
}

/* ---- Invoice (Tahap 2b) ---- */
.grid td.center { text-align: center; }
.check-cell { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.totals-grid { margin-top: 14px; max-width: 560px; margin-left: auto; }
.totals-grid .input.num { text-align: right; }
.strong { font-weight: 700; }
.form-head .badge + .badge { margin-left: 6px; }
.card-title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.card-title-row .card-title { margin: 0; }
.card-title-row .btn { margin-left: auto; }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.option-group fieldset > .form-grid { grid-column: 1 / -1; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; margin-bottom: 14px; background: #e9eef2; border-radius: 10px; width: fit-content; max-width: 100%; }
.tabs a { padding: 7px 14px; text-decoration: none; color: var(--ink-2); border-radius: 7px; font-size: 13.5px; font-weight: 550; }
.tabs a:hover { background: rgba(255,255,255,.6); color: var(--ink); }
.tabs a.active { background: #fff; color: var(--brand); font-weight: 650; box-shadow: var(--shadow); }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid tr.row-beda td { color: #1d4ed8; }
.grid tr.row-nol td { color: #b91c1c; }
.period-bar { padding: 12px 18px; margin-bottom: 14px; }
.tb-menu { position: relative; display: inline-block; }
.tb-menu summary { list-style: none; }
.tb-menu summary::-webkit-details-marker { display: none; }
.tb-menu-list { position: absolute; z-index: 30; left: 0; top: 38px; min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; animation: pop .14s ease-out; }
.tb-menu-list a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; color: var(--ink); text-decoration: none; border-radius: 8px; white-space: nowrap; }
.tb-menu-list a::before { content: ""; width: 15px; height: 15px; background: var(--ink-3); -webkit-mask: var(--i-file) center / contain no-repeat; mask: var(--i-file) center / contain no-repeat; }
.tb-menu-list a:hover { background: var(--brand-soft); color: var(--brand); }
.report-sheet { overflow: visible; }
.report-head { text-align: center; margin-bottom: 14px; }
.report-company { font-weight: 700; letter-spacing: .02em; }
.report-title { font-size: 18px; margin: 4px 0; }
.report-params { font-size: 12.5px; color: var(--ink-2); }
.report-foot { margin-top: 10px; font-size: 12px; text-align: right; }
@media print {
  .sidebar, .topbar, .no-print, .alert, .statusbar { display: none !important; }
  .report-sheet { box-shadow: none; border: none; }
  .grid th { position: static; }
}
.form-cols.report-explorer { grid-template-columns: minmax(240px, 320px) 1fr; align-items: start; }
.report-list .input { width: 100%; margin-bottom: 10px; }
.report-items { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow: auto; }
.report-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 13.5px; }
.report-item::before { content: ""; flex: 0 0 15px; height: 15px; background: var(--ink-3); -webkit-mask: var(--i-file) center / contain no-repeat; mask: var(--i-file) center / contain no-repeat; }
.report-item:hover { background: var(--line-2); }
.report-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.report-item.active::before { background: var(--brand); }
@media (max-width: 900px) { .form-cols.report-explorer { grid-template-columns: 1fr; } }
.custom-items { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.custom-items .card-title-row { flex-wrap: wrap; gap: 8px; }

/* variabel ikon dipakai di pseudo-element */
:root {
  --i-next: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E");
  --i-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
  --i-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.8 2.8L16 9.5'/%3E%3C/svg%3E");
  --i-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E");
  --i-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  --i-file: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h8l5 5v13H6zM14 3v5h5'/%3E%3C/svg%3E");
}
.content:has(.hero) > .page-head { display: none; }
.modal-search .tb-search .input { width: 100%; }

/* baris kosong grid */
.grid tr:not(.pager) > td[colspan]:only-child { padding: 28px 16px; text-align: center; color: var(--ink-3); background: #fbfcfd; }

/* ---------- Form: kolom kode + tombol cari + deskripsi dalam satu baris ---------- */
.field.inline { gap: 6px; }
.field.inline > .input.w-lg { flex: 1 1 200px; width: auto; min-width: 0; max-width: 460px; }
.btn-lookup { width: 34px; padding: 0; color: var(--brand); }
.btn-lookup .i { width: 15px; height: 15px; }
.btn-lookup:hover { background: var(--brand-soft); border-color: #93b4f5; color: var(--brand); }
.field.inline > .input:has(+ .btn-lookup) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.field.inline > .input + .btn-lookup { margin-left: -7px; border-top-left-radius: 0; border-bottom-left-radius: 0; border-color: #cfd7df; background: #f6f8fa; }
.field.inline > .input + .btn-lookup:hover { background: var(--brand-soft); }
.grid-detail .btn-lookup { width: 28px; height: 28px; }
a.btn-lookup.aspNetDisabled, a.btn-lookup[disabled] { opacity: .35; }
.form-grid > label { line-height: 1.3; }
.form-card .form-grid + .form-grid { margin-top: 10px; }
.input::placeholder { color: #9aa7b3; }
.field.inline > .muted, .field.inline > span:not(.check):not(.tb-search) { font-size: 12.5px; color: var(--ink-3); }

/* ---------- Ringkasan total (bawah form transaksi) ---------- */
.totals-grid { grid-template-columns: minmax(0, 1fr) 220px; gap: 6px 14px; margin-top: 16px; max-width: 520px; margin-left: auto; padding: 12px 16px; background: #f8fafb; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.totals-grid > label, .totals-grid > span { text-align: right; color: var(--ink-2); }
.totals-grid .field { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.totals-grid .input.w-md { width: 100%; }
.totals-grid .input[readonly], .totals-grid .input.ro { background: transparent; border-color: transparent; font-weight: 600; color: var(--ink); padding-right: 10px; }
.totals-grid > :nth-last-child(-n+2) { padding-top: 8px; border-top: 1px solid var(--line); }
.totals-grid > :nth-last-child(2) { font-weight: 700; color: var(--ink); }
.totals-grid > :last-child .input { font-size: 15px; font-weight: 700; color: var(--brand); }
@media (max-width: 860px) { .totals-grid { grid-template-columns: 1fr 1fr; max-width: none; } }

/* =========================================================================
   Form generasi baru: label di atas, isian berupa "petak" 2 kolom,
   radio sebagai chip, checkbox sebagai sakelar, tabel rincian ala spreadsheet.
   ========================================================================= */
.form-card { padding: 22px 24px 24px; }
.card-title { text-transform: none; letter-spacing: -.005em; font-size: 15px; font-weight: 650; color: var(--ink); margin-bottom: 16px; }
.card-title::before { width: 3px; height: 16px; }
.stat-label, .recent-title { text-transform: none; letter-spacing: 0; font-size: 12.5px; }

.form-grid.fg-ready { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; align-items: start; }
.fg-item { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fg-item.wide { grid-column: 1 / -1; }
.fg-item > label, .fg-item > span:first-child:not(.check) { font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.3; transition: color .12s; }
.fg-item:focus-within > label { color: var(--brand); }
.fg-item .field { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.fg-item .input { height: 38px; font-size: 14px; border-radius: 9px; }
.fg-item .field > .input:only-child, .fg-item > .input { width: 100%; max-width: none; }
.fg-item .field > .input.w-md:not(:only-child) { flex: 1 1 160px; width: auto; }
.fg-item .field.inline > .input.w-sm { flex: 0 0 132px; width: 132px; }
.fg-item .field.inline > .input.w-lg { flex: 1 1 180px; max-width: none; }
.fg-item .btn-lookup { width: 38px; height: 38px; }
.fg-item .field.inline > .input + .btn-lookup { margin-left: -7px; }
.fg-item .input[readonly], .fg-item .input.ro { background: #f2f5f8; border-color: transparent; color: var(--ink); }
.fg-item select.input:disabled { background: #f2f5f8; border-color: transparent; color: var(--ink); opacity: 1; }
.fg-item.fg-check { padding-top: 2px; }
.form-cols { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; }
.form-side { padding-left: 24px; border-left: 1px solid var(--line-2); }
@media (max-width: 1180px) { .form-grid.fg-ready { grid-template-columns: minmax(0, 1fr); } .fg-item.wide { grid-column: auto; } }
@media (max-width: 860px) { .form-side { padding-left: 0; border-left: 0; } }

/* radio sebagai chip pilihan */
.option-group fieldset { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; background: none; margin: 0; }
.option-group legend { width: 100%; padding: 0 0 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); float: left; }
.option-group fieldset > * { clear: both; }
.option-group .opt { position: relative; display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 7px 12px 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: 13px; transition: background .12s, border-color .12s, color .12s; }
.option-group .opt label { margin: 0; cursor: pointer; }
.option-group .opt input { margin: 0; }
.option-group .opt:hover { border-color: #93b4f5; }
.option-group .opt:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.option-group .opt:has(input:disabled) { cursor: default; }
.option-group .opt:has(input:disabled):not(:has(input:checked)) { opacity: .55; }
.option-group .opt:has(input:focus-visible) { outline: 3px solid rgba(37, 99, 235, .28); }
.option-group fieldset > .form-grid { width: 100%; }

/* checkbox sebagai sakelar (di form; bukan di tabel) */
.form-card .check input[type=checkbox], .form-side input[type=checkbox] {
  -webkit-appearance: none; appearance: none; position: relative; flex: 0 0 auto; width: 34px; height: 20px; margin: 0; border-radius: 999px;
  background: #cfd7df; cursor: pointer; vertical-align: -5px; transition: background .15s;
}
.form-card .check input[type=checkbox]::before, .form-side input[type=checkbox]::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s;
}
.form-card .check input[type=checkbox]:checked, .form-side input[type=checkbox]:checked { background: var(--brand); }
.form-card .check input[type=checkbox]:checked::before, .form-side input[type=checkbox]:checked::before { transform: translateX(14px); }
.form-card .check input[type=checkbox]:disabled, .form-side input[type=checkbox]:disabled { cursor: default; opacity: .55; }
.form-card .check input[type=checkbox]:focus-visible, .form-side input[type=checkbox]:focus-visible { outline: 3px solid rgba(37, 99, 235, .28); outline-offset: 2px; }
.form-card .grid .check input[type=checkbox] { -webkit-appearance: auto; appearance: auto; width: 15px; height: 15px; background: none; }
.form-card .grid .check input[type=checkbox]::before { display: none; }
.check { display: inline-flex; align-items: center; gap: 9px; }
.check label { margin-left: 0; }
.flags { gap: 12px 14px; }
.flags .check { font-size: 13px; }

/* tabel rincian ala spreadsheet */
.grid-detail { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.grid-detail th { background: #f6f8fa; }
.grid-detail tbody tr:nth-child(even) td { background: #fbfcfd; }
.grid-detail .input-cell { border-color: transparent; background: transparent; border-radius: 6px; }
.grid-detail tr:hover .input-cell:not([readonly]) { border-color: #d5dde4; background: #fff; }
.grid-detail .input-cell:focus { background: #fff; border-color: var(--accent); }
.grid-detail tr:focus-within td { background: #eef4ff; }
.grid-detail tfoot td { background: #f6f8fa; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
.fg-item .field.checks { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 10px; }
.fg-item .field.checks.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-detail .input-cell:not([readonly]) { border-color: #e3e8ee; background: #fff; }
.grid-detail .input-cell[readonly] { border-color: transparent; background: transparent; }

/* ---------- Warna label form: dibedakan dari isian agar mudah dibaca ---------- */
:root { --label: #1e40af; --label-focus: #3b82f6; }
.fg-item > label, .fg-item > span:first-child:not(.check),
.form-grid > label, .form-grid > span,
.option-group legend, .totals-grid > label, .totals-grid > span { color: var(--label); font-weight: 650; }
.fg-item:focus-within > label { color: var(--label-focus); }
.totals-grid > :nth-last-child(2) { color: var(--label); }


/* =========================================================================
   TEMA CERAH: menu putih, biru cerah, warna per modul
   ========================================================================= */
:root {
  --ink: #0f172a; --ink-2: #334155; --ink-3: #64748b;
  --line: #e2e8f0; --line-2: #f1f5f9; --bg: #f5f8fe;
  --brand: #2563eb; --brand-2: #3b82f6; --brand-soft: #eaf1ff; --accent: #2563eb;
  --nav: #ffffff; --nav-ink: #475569;
  --label: #1e40af; --label-focus: #2563eb;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 6px rgba(37, 99, 235, .05);
  /* warna modul */
  --m-home: #2563eb; --m-building: #6366f1; --m-book: #0ea5e9; --m-truck: #f97316;
  --m-users: #ec4899; --m-id-card: #8b5cf6; --m-chart: #10b981; --m-file: #64748b;
}
body { background: var(--bg); }
.topbar { background: rgba(255,255,255,.9); }
.brand { background: #fff; color: var(--ink); border-right: 1px solid var(--line); }
.brand-name small { color: var(--ink-3); }
.brand-mark, .avatar { background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%); }
.sidebar { background: #fff; color: var(--nav-ink); border-right: 1px solid var(--line); scrollbar-color: #cbd5e1 transparent; }
.nav-search input { background: var(--line-2); border-color: transparent; color: var(--ink); }
.nav-search input::placeholder { color: var(--ink-3); }
.nav-search .i { color: var(--ink-3); }
.nav-search input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.nav-home, .nav-item { color: var(--ink-2); }
.nav-home { color: var(--ink); }
.nav-home:hover, .nav-item:hover, .nav-group summary:hover { background: var(--line-2); color: var(--ink); }
.nav-home.active, .nav-item.active { background: var(--brand-soft); color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.nav-item.pending { color: #94a3b8; }
.nav-group summary, .nav-group[open] > summary { color: var(--ink); }
.nav-group summary .i, .nav-home .i { width: 30px; height: 30px; padding: 7px; border-radius: 8px; box-sizing: border-box; -webkit-mask-origin: content-box; mask-origin: content-box; -webkit-mask-clip: content-box; mask-clip: content-box; }
.nav-item { padding-left: 52px; }
.nav-foot { border-top-color: var(--line); color: #94a3b8; }
.sidebar .tag { background: #fff4dc; color: #b45309; }
.nav-empty { color: var(--ink-3); }

/* ikon modul berwarna (menu samping, judul halaman, kartu beranda, terakhir dibuka) */
.i-home { color: var(--m-home); } .i-building { color: var(--m-building); } .i-book { color: var(--m-book); }
.i-truck { color: var(--m-truck); } .i-users { color: var(--m-users); } .i-id-card { color: var(--m-id-card); }
.i-chart { color: var(--m-chart); }
.page-ico:has(.i-home) { background: #e8f0ff; } .page-ico:has(.i-building) { background: #eef0ff; }
.page-ico:has(.i-book) { background: #e6f6fe; } .page-ico:has(.i-truck) { background: #fff1e6; }
.page-ico:has(.i-users) { background: #fdecf5; } .page-ico:has(.i-id-card) { background: #f3eeff; }
.page-ico:has(.i-chart) { background: #e6f8f1; } .page-ico:has(.i-file), .page-ico:has(.i-key), .page-ico:has(.i-settings), .page-ico:has(.i-shield) { background: var(--brand-soft); color: var(--brand); }
.btn .i, .toolbar .i, .chip .i, .usermenu-list .i, .recent a .i, .alert .i { color: inherit; }
.chip .i { color: var(--brand); }
.menu-card { border-top: 3px solid var(--m-file); }
.menu-card:has(.i-building) { border-top-color: var(--m-building); } .menu-card:has(.i-book) { border-top-color: var(--m-book); }
.menu-card:has(.i-truck) { border-top-color: var(--m-truck); } .menu-card:has(.i-users) { border-top-color: var(--m-users); }
.menu-card:has(.i-id-card) { border-top-color: var(--m-id-card); } .menu-card:has(.i-chart) { border-top-color: var(--m-chart); }
.recent a .i { color: var(--brand); }

/* beranda & login cerah */
.hero { background: linear-gradient(115deg, #2563eb 0%, #0ea5e9 55%, #06b6d4 100%); }
.hero::after { border-color: rgba(255,255,255,.12); }
.stat-ico { background: #e8f0ff; color: #2563eb; }
.stat-ico.c2 { background: #e6f8f1; color: #059669; }
.stat-ico.c3 { background: #fff1e6; color: #ea580c; }
.login-art { background: radial-gradient(90% 80% at 0% 100%, #06b6d4 0%, transparent 60%), radial-gradient(80% 80% at 100% 0%, #8b5cf6 0%, transparent 55%), linear-gradient(135deg, #1d4ed8, #2563eb); }
.login-pitch li .i { color: #bae6fd; }
.btn-primary { background: linear-gradient(180deg, #3b82f6, #2563eb); border-color: #2563eb; }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.card-title::before { background: linear-gradient(180deg, #3b82f6, #06b6d4); }
.grid th, .grid-detail th { background: #f4f7fd; }
.tabs { background: #e8eefb; }
.balance.ok { background: #dcfce7; color: #15803d; }
.login-art .brand { background: none; color: #fff; border: 0; }
.login-pitch li .i { color: #bae6fd !important; }

/* ---- warna modul Inventory ---- */
:root { --m-box: #6366f1; --m-archive: #0ea5e9; --m-cart: #f97316; }
.i-box { color: var(--m-box); } .i-archive { color: var(--m-archive); } .i-cart { color: var(--m-cart); }
.page-ico:has(.i-box) { background: #eef0ff; } .page-ico:has(.i-archive) { background: #e6f6fe; } .page-ico:has(.i-cart) { background: #fff1e6; }
.menu-card:has(.i-box) { border-top-color: var(--m-box); } .menu-card:has(.i-archive) { border-top-color: var(--m-archive); } .menu-card:has(.i-cart) { border-top-color: var(--m-cart); }
.login-pitch li .i-box, .login-pitch li .i-truck { color: #bae6fd !important; }
/* [web] sel grid dengan lookup (mis. kolom satuan) */
.grid-detail td.cell-lookup { white-space: nowrap; }
.grid-detail td.cell-lookup > span { display: inline-block; min-width: 48px; margin-right: 6px; vertical-align: middle; }
.grid-detail td.cell-lookup > .btn { vertical-align: middle; }
/* Tahap 3: baris total dengan beberapa kontrol (diskon %, PPn) */
.totals-grid { grid-template-columns: minmax(0, 1fr) 300px; max-width: 620px; }
.totals-grid .field > .input { min-width: 0; flex: 1 1 0; }
.totals-grid .field > .input.w-num { flex: 0 0 84px; width: 84px; }
.totals-grid .field > .check { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 860px) { .totals-grid { grid-template-columns: 1fr 1fr; max-width: none; } }
/* ---------- Ikon (SVG inline, tanpa file/font luar) ---------- */
.i { display: inline-block; width: 16px; height: 16px; flex: 0 0 auto; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; vertical-align: -3px; }
.i-plus { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.i-edit { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16v4zM14 6l4 4'/%3E%3C/svg%3E"); }
.i-trash { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3'/%3E%3C/svg%3E"); }
.i-check { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E"); }
.i-x { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E"); }
.i-list { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01'/%3E%3C/svg%3E"); }
.i-form { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='2'/%3E%3Cpath d='M4 9h16M9 9v11'/%3E%3C/svg%3E"); }
.i-refresh { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.34-5.66L20 8.5M20 4v4.5h-4.5'/%3E%3C/svg%3E"); }
.i-print { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 9V3h10v6M7 17H5a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-2M7 14h10v7H7z'/%3E%3C/svg%3E"); }
.i-search { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E"); }
.i-first { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 5v14M18 6l-7 6 7 6'/%3E%3C/svg%3E"); }
.i-prev { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 6l-6 6 6 6'/%3E%3C/svg%3E"); }
.i-next { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E"); }
.i-last { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 5v14M6 6l7 6-7 6'/%3E%3C/svg%3E"); }
.i-down { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.i-building { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16M16 9h3a1 1 0 0 1 1 1v11M3 21h18M8 7h4M8 11h4M8 15h4'/%3E%3C/svg%3E"); }
.i-book { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5a2 2 0 0 1 2-2h12v15H7a2 2 0 0 0-2 2zM5 20a2 2 0 0 0 2 1h12v-3M9 7h6'/%3E%3C/svg%3E"); }
.i-truck { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h11v10H3zM14 10h4l3 3v3h-7'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3C/svg%3E"); }
.i-users { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M3 20a6 6 0 0 1 12 0M16 4.6a3.5 3.5 0 0 1 0 6.8M18 14.2A6 6 0 0 1 21 20'/%3E%3C/svg%3E"); }
.i-id-card { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='9' cy='11' r='2.5'/%3E%3Cpath d='M5.5 17a3.5 3.5 0 0 1 7 0M15 10h3M15 14h3'/%3E%3C/svg%3E"); }
.i-chart { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4v16h16M8 16v-4M12 16V8M16 16v-6'/%3E%3C/svg%3E"); }
.i-home { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7M5 9.5V20h5v-6h4v6h5V9.5'/%3E%3C/svg%3E"); }
.i-logout { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h5v16h-5M10 8l-4 4 4 4M6 12h11'/%3E%3C/svg%3E"); }
.i-key { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='15' r='4'/%3E%3Cpath d='M11 12l9-9M16.5 6.5l3 3M14 9l2 2'/%3E%3C/svg%3E"); }
.i-settings { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h9M17 7h3M4 17h3M11 17h9'/%3E%3Ccircle cx='15' cy='7' r='2'/%3E%3Ccircle cx='9' cy='17' r='2'/%3E%3C/svg%3E"); }
.i-shield { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 3v6c0 4.5-3.4 8-8 9-4.6-1-8-4.5-8-9V6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E"); }
.i-menu { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E"); }
.i-panel { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='M9 4v16'/%3E%3C/svg%3E"); }
.i-calendar { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.i-info { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E"); }
.i-alert { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E"); }
.i-ok { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.8 2.8L16 9.5'/%3E%3C/svg%3E"); }
.i-clock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.i-keyboard { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='20' height='12' rx='2'/%3E%3Cpath d='M6 10h.01M10 10h.01M14 10h.01M18 10h.01M7 14h10'/%3E%3C/svg%3E"); }
.i-download { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E"); }
.i-database { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='5' rx='8' ry='3'/%3E%3Cpath d='M4 5v14c0 1.7 3.6 3 8 3s8-1.3 8-3V5M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3'/%3E%3C/svg%3E"); }
.i-box { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8l-9-5-9 5v8l9 5 9-5zM3 8l9 5 9-5M12 13v8'/%3E%3C/svg%3E"); }
.i-archive { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='5' rx='1'/%3E%3Cpath d='M5 9v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9M10 13h4'/%3E%3C/svg%3E"); }
.i-cart { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='20' r='1.5'/%3E%3Ccircle cx='18' cy='20' r='1.5'/%3E%3Cpath d='M2 3h3l2.7 12.2a1.5 1.5 0 0 0 1.5 1.2h8.6a1.5 1.5 0 0 0 1.5-1.1L21 8H6'/%3E%3C/svg%3E"); }
.i-arrow { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"); }
.i-file { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h8l5 5v13H6zM14 3v5h5'/%3E%3C/svg%3E"); }
.i-lock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E"); }
.i-user { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E"); }
.i-eye { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.i-star { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1-4.4-4.3 6.1-.9z'/%3E%3C/svg%3E"); }

/* [gabungan] judul bagian modul (Keuangan / Persediaan) di menu kiri & beranda */
.nav-section { margin: 14px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.nav-section:first-of-type { margin-top: 6px; }
.menu-grid > .menu-section { column-span: all; margin: 4px 2px 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

/* =========================================================================
   FORM RINGKAS
   Kotak isian tidak lagi dipaksa selebar kolom: ukurannya mengikuti kelas di form
   (w-xs / w-sm / w-md / w-lg) dan tersusun dalam kolom tetap yang rapi.
   Tinggi isian 32px, jarak antar isian lebih rapat, label di atas isian.
   ========================================================================= */
:root { --in-h: 32px; --fg-col: 228px; }
.input { height: var(--in-h); padding: 4px 9px; font-size: 13.5px; border-radius: 7px; }
textarea.input { height: auto; min-height: 58px; }
.input-sm, .input-cell { height: 28px; font-size: 13px; }
.btn { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-icon, .btn-lookup { width: 32px; }
.btn-xs { height: 26px; }
.btn-icon.btn-xs { width: 26px; }
.w-xs { width: 64px; } .w-sm { width: 120px; } .w-md { width: 210px; } .w-lg { width: 360px; } .w-num { width: 150px; }

.form-card { padding: 16px 20px 18px; }
.card-title { font-size: 14px; margin-bottom: 12px; }
.form-card .card-title:not(:first-child) { margin-top: 18px; }
.form-sections { gap: 12px; }

/* susunan isian: kolom tetap, bukan melebar memenuhi layar */
.form-grid.fg-ready { grid-template-columns: repeat(auto-fill, var(--fg-col)); gap: 12px 18px; justify-content: start; }
.fg-item { gap: 4px; }
.fg-item.wide { grid-column: span 2; }
.fg-item.full { grid-column: 1 / -1; }
.fg-item > label, .fg-item > span:first-child:not(.check) { font-size: 12.5px; }
.fg-item > label.req::after { content: " *"; color: var(--danger); }
.fg-item .input { height: var(--in-h); font-size: 13.5px; border-radius: 7px; }
.fg-item textarea.input { height: auto; max-width: 720px; }
.fg-item .field > .input:only-child, .fg-item > .input { width: 100%; max-width: 100%; }
.fg-item .field > .input.w-xs:only-child, .fg-item > .input.w-xs { width: 64px; }
.fg-item .field > .input.w-sm:only-child, .fg-item > .input.w-sm { width: 120px; }
.fg-item .field > .input.w-md:not(:only-child) { flex: 1 1 120px; }
.fg-item .field.inline > .input.w-sm { flex: 0 0 104px; width: 104px; }
.fg-item .field.inline > .input.w-xs { flex: 0 0 64px; width: 64px; }
.fg-item .field.inline > .input.w-lg { flex: 1 1 140px; width: auto; max-width: none; }
.fg-item .field.inline > .input.w-num, .fg-item .field.inline > .input.num.w-sm { flex: 0 0 auto; }
.fg-item .btn-lookup { width: 32px; height: var(--in-h); }
.fg-item .btn { height: var(--in-h); }
.fg-item.fg-check { padding-top: 0; }
.form-cols { gap: 22px; }
.form-side { padding-left: 20px; }
.flags { gap: 10px 12px; }

/* isian yang sedang diisi lebih jelas; isian baca-saja terlihat jelas tidak bisa diubah */
.fg-item:focus-within .input:focus { background: #fff; }
.fg-item .input[readonly], .fg-item .input.ro { cursor: default; }
.input:disabled { cursor: not-allowed; }

/* tabel rincian lebih rapat */
.grid-detail td { padding: 4px 6px; }
.grid-detail th { padding: 8px 6px; }
.input-cell { min-width: 70px; padding: 3px 7px; }
.grid-detail .btn-lookup { width: 26px; height: 26px; }
.grid td { padding: 8px 12px; }
.grid th { padding: 9px 12px; }

/* blok total: tetap rata kanan, isian lebih kecil */
.totals-grid { grid-template-columns: minmax(0, 1fr) 240px; max-width: 540px; gap: 4px 12px; padding: 10px 14px; }
.totals-grid .field > .input.w-num { flex: 0 0 72px; width: 72px; }

/* toolbar & pencarian sedikit lebih ringkas */
.toolbar { padding: 6px 8px; }
.tb-search .input { width: 200px; }
.form-actions { padding-left: 0; margin-top: 14px; }

@media (max-width: 640px) {
  .form-grid.fg-ready { grid-template-columns: minmax(0, 1fr); }
  .fg-item.wide, .fg-item.full { grid-column: auto; }
  .fg-item .field > .input.w-sm:only-child, .fg-item > .input.w-sm, .w-lg, .w-md { width: 100%; }
}
/* isian di dalam baris (kode + tombol cari + keterangan) boleh menyusut agar tidak turun ke baris baru */
.fg-item .field > .input, .fg-item .field > select { min-width: 0; }
.fg-item .field.inline { flex-wrap: nowrap; }
.fg-item .field.inline:has(> :nth-child(5)) { flex-wrap: wrap; }
.fg-item .field.inline > span { white-space: nowrap; }
/* kolom angka di tabel rincian tidak perlu selebar kolom */
.grid-detail .input-cell.num { max-width: 150px; margin-left: auto; display: block; }
/* layar kecil (tablet / HP): panel samping turun ke bawah, isian satu kolom */
@media (max-width: 860px) {
  .form-cols, .form-cols.report-explorer { grid-template-columns: minmax(0, 1fr); }
  .form-side { padding-left: 0; border-left: 0; padding-top: 12px; border-top: 1px solid var(--line-2); }
  .totals-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); max-width: none; }
}
@media (max-width: 640px) {
  .form-card { padding: 14px; }
  .fg-item .field.inline { flex-wrap: wrap; }
  .fg-item .field.inline > .input.w-lg:not(:has(+ .btn-lookup)), .fg-item .field.inline > .input.w-md:not(:has(+ .btn-lookup)) { flex: 1 1 100%; }
  .fg-item .field.inline > .input:has(+ .btn-lookup) { flex: 1 1 0; }
}

/* =========================================================================
   WARNA CERAH: kotak isian, toolbar, kepala tabel
   ========================================================================= */
:root {
  --in-bg: #f5f9ff; --in-line: #b9d3fb; --in-hover: #7fb0f7; --in-focus: #2f80ff;
  --ro-bg: #eef8f6; --ro-line: #c6ebe3; --ro-ink: #0f5f55;
}
/* kotak isian: latar biru muda, garis biru, fokus biru terang */
.input, .fg-item .input { background: var(--in-bg); border: 1px solid var(--in-line); color: var(--ink); }
.input:hover:not([readonly]):not(:disabled) { border-color: var(--in-hover); background: #fff; }
.input:focus, .fg-item .input:focus { background: #fff; border-color: var(--in-focus); box-shadow: 0 0 0 3px rgba(47, 128, 255, .22); }
select.input { background-color: var(--in-bg); }
/* isian baca-saja: hijau toska muda, jadi jelas bedanya dengan yang bisa diisi */
.input.ro, .input[readonly], .fg-item .input[readonly], .fg-item .input.ro,
.fg-item select.input:disabled, select.input:disabled { background: var(--ro-bg); border: 1px solid var(--ro-line); color: var(--ro-ink); }
.input[readonly]:focus { border-color: var(--ro-line); box-shadow: none; }
.fg-item .field.inline > .input + .btn-lookup { background: #e3efff; border-color: var(--in-line); color: #1d6bf0; }
.fg-item .field.inline > .input + .btn-lookup:hover, .btn-lookup:hover { background: #2f80ff; border-color: #2f80ff; color: #fff; }
.fg-item > label, .fg-item > span:first-child:not(.check) { color: #1d4ed8; }
.fg-item:focus-within > label { color: #0284c7; }
/* sel tabel rincian */
.grid-detail .input-cell:not([readonly]) { background: #fff; border-color: #cfe0fb; }
.grid-detail tr:hover .input-cell:not([readonly]) { border-color: var(--in-hover); }
.grid-detail .input-cell:focus { border-color: var(--in-focus); box-shadow: 0 0 0 2px rgba(47, 128, 255, .2); }
.grid-detail tr:focus-within td { background: #e8f3ff; }

/* toolbar: pita biru muda + tombol berwarna sesuai fungsinya */
.toolbar { background: linear-gradient(180deg, #f0f7ff 0%, #e2efff 100%); border-color: #bcd6fb; }
.statusbar { background: #f4f9ff; border-color: #bcd6fb; color: #3b5b8a; }
.statusbar::before { background: #22c55e; }
.tb-group + .tb-group { border-left-color: #c6dbf8; }
.toolbar .btn { border: 1px solid transparent; font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.toolbar .btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.toolbar [id$=tsbTambah]  { background: linear-gradient(180deg, #3b8bff, #1f6fff); color: #fff; }
.toolbar [id$=tsbUbah]    { background: linear-gradient(180deg, #ffc23d, #f5a300); color: #4a2f00; }
.toolbar [id$=tsbHapus]   { background: linear-gradient(180deg, #ff6b6b, #ef3b3b); color: #fff; }
.toolbar [id$=tsbSimpan]  { background: linear-gradient(180deg, #2fd27a, #14b45e); color: #fff; }
.toolbar [id$=tsbSaveNew] { background: linear-gradient(180deg, #34d3c4, #12b3a3); color: #fff; }
.toolbar [id$=tsbBatal]   { background: #ffffff; border-color: #fca5a5; color: #dc2626; }
.toolbar [id$=tsmListView], .toolbar [id$=tsmForm] { background: #ffffff; border-color: #c4b5fd; color: #6d28d9; }
.toolbar [id$=tsbRefresh] { background: #e0f7ff; border-color: #7dd3fc; color: #0369a1; }
.toolbar .tb-menu summary.btn, .toolbar [id$=tsbCetak] { background: #f3e8ff; border-color: #d8b4fe; color: #7e22ce; }
.toolbar .tb-nav .btn { background: #fff; border-color: #bcd6fb; color: #1d6bf0; }
.toolbar .tb-nav .btn:hover { background: #2f80ff; color: #fff; }
.toolbar [id$=tsbCari] { background: linear-gradient(180deg, #3b8bff, #1f6fff); color: #fff; }
.toolbar .tb-filter .input { background: #fff; }
.toolbar .btn.aspNetDisabled, .toolbar a.btn[disabled] { filter: grayscale(.6); opacity: .45; }
.recno { color: #1d4ed8; font-weight: 600; }
/* mode tambah / ubah tetap ditandai oranye */
.tb-wrap.mode-add .toolbar, .tb-wrap.mode-edit .toolbar { background: linear-gradient(180deg, #fffaf0 0%, #fff0d6 100%); }

/* kepala tabel & baris: biru cerah */
.grid th, .grid-detail th { background: linear-gradient(180deg, #e6f1ff, #d6e8ff); color: #1e40af; border-bottom-color: #bcd6fb; }
.grid tbody tr:nth-child(even) td { background: #f8fbff; }
.grid tr:hover td { background: #e8f3ff; }
.grid tr.selected td { background: #d6e8ff; }
.grid-detail tfoot td { background: #eef5ff; color: #1e3a8a; }

/* tombol umum di form */
.btn-primary { background: linear-gradient(180deg, #3b8bff, #1f6fff); border-color: #1f6fff; }
.form-actions .btn-primary, .modal .btn-primary { box-shadow: 0 2px 6px rgba(31, 111, 255, .3); }

/* =========================================================================
   WARNA CERAH: menu samping & kartu modul di beranda
   Setiap modul punya warna sendiri (--mc), dipakai untuk ikon, grup terbuka,
   item aktif dan kartu beranda.
   ========================================================================= */
:root {
  --m-home: #2f80ff; --m-building: #6366f1; --m-book: #0ea5e9; --m-truck: #f97316; --m-users: #ec4899;
  --m-id-card: #a855f7; --m-chart: #10b981; --m-file: #64748b; --m-box: #8b5cf6; --m-archive: #06b6d4; --m-cart: #f59e0b;
}
.nav-group, .menu-card { --mc: var(--m-file); --mc-soft: #f1f5f9; }
.nav-group:has(.i-building), .menu-card:has(.i-building) { --mc: var(--m-building); --mc-soft: #eef0ff; }
.nav-group:has(.i-book), .menu-card:has(.i-book) { --mc: var(--m-book); --mc-soft: #e3f5fe; }
.nav-group:has(.i-truck), .menu-card:has(.i-truck) { --mc: var(--m-truck); --mc-soft: #fff0e3; }
.nav-group:has(.i-users), .menu-card:has(.i-users) { --mc: var(--m-users); --mc-soft: #fdebf5; }
.nav-group:has(.i-id-card), .menu-card:has(.i-id-card) { --mc: var(--m-id-card); --mc-soft: #f5ecff; }
.nav-group:has(.i-chart), .menu-card:has(.i-chart) { --mc: var(--m-chart); --mc-soft: #e2f8ef; }
.nav-group:has(.i-box), .menu-card:has(.i-box) { --mc: var(--m-box); --mc-soft: #f1ecff; }
.nav-group:has(.i-archive), .menu-card:has(.i-archive) { --mc: var(--m-archive); --mc-soft: #e0f8fc; }
.nav-group:has(.i-cart), .menu-card:has(.i-cart) { --mc: var(--m-cart); --mc-soft: #fff5dc; }
.i-cart { color: var(--m-cart); } .i-archive { color: var(--m-archive); } .i-box { color: var(--m-box); }

/* menu samping */
.sidebar { background: linear-gradient(180deg, #f4f9ff 0%, #ffffff 40%, #fbf8ff 100%); }
.brand { background: linear-gradient(135deg, #eaf3ff, #f3ecff); }
.nav-search input { background: #fff; border: 1px solid #cfe0fb; }
.nav-home { background: linear-gradient(90deg, #e3efff, #eef5ff); color: #1d4ed8; }
.nav-home.active { background: linear-gradient(90deg, #2f80ff, #4f9bff); color: #fff; box-shadow: 0 2px 8px rgba(47, 128, 255, .3); }
.nav-home.active .i { color: #fff; }
.nav-group summary .i { background-color: var(--mc); color: var(--mc); }
.nav-group summary .i { -webkit-mask-origin: content-box; mask-origin: content-box; }
.nav-group summary { position: relative; }
.nav-group summary::before { content: ""; position: absolute; left: 12px; top: 50%; width: 30px; height: 30px; margin-top: -15px; border-radius: 8px; background: var(--mc-soft); z-index: 0; }
.nav-group summary > * { position: relative; z-index: 1; }
.nav-group summary:hover { background: var(--mc-soft); }
.nav-group[open] > summary { background: var(--mc-soft); color: var(--mc); box-shadow: inset 3px 0 0 var(--mc); }
.nav-group[open] > summary::before { background: #fff; }
.nav-group[open] { background: linear-gradient(180deg, color-mix(in srgb, var(--mc-soft) 55%, transparent), transparent); border-radius: 10px; padding-bottom: 4px; }
.nav-group .nav-item:hover { background: var(--mc-soft); color: var(--mc); }
.nav-group .nav-item.active { background: var(--mc); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--mc) 35%, transparent); }
.nav-group .nav-item.active .tag { background: rgba(255,255,255,.25); color: #fff; }
.nav-section { display: flex; align-items: center; gap: 8px; margin: 16px 8px 6px; padding: 5px 10px; border-radius: 8px; letter-spacing: .07em; }
.nav-section.sec-fin { background: linear-gradient(90deg, #dbeafe, #ede9fe); color: #4338ca; }
.nav-section.sec-inv { background: linear-gradient(90deg, #ffedd5, #fef3c7); color: #c2410c; }
.nav-section.sec-umum { background: linear-gradient(90deg, #dcfce7, #d1fae5); color: #047857; }
.nav-section::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* beranda: kartu modul berwarna */
.menu-card { border-top: 0; overflow: hidden; }
.menu-card-head { background: linear-gradient(135deg, var(--mc-soft) 0%, #ffffff 90%); border-bottom: 1px solid color-mix(in srgb, var(--mc) 18%, transparent); padding-bottom: 12px; margin-bottom: 6px; }
.menu-card-head::before { content: ""; position: absolute; }
.menu-card { box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 16px color-mix(in srgb, var(--mc) 10%, transparent); border-color: color-mix(in srgb, var(--mc) 22%, #e2e8f0); }
.menu-card .menu-card-head .page-ico { background: var(--mc); }
.menu-card .menu-card-head .page-ico .i { color: #fff; }
.menu-card-head h3 { color: color-mix(in srgb, var(--mc) 70%, #0f172a); }
.menu-card-head .count { background: var(--mc); color: #fff; font-weight: 650; }
.menu-card .menu-link:hover { background: var(--mc-soft); color: var(--mc); }
.menu-card .menu-link::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mc); opacity: .45; flex: 0 0 auto; }
.menu-card .menu-link:hover::before { opacity: 1; }
.menu-grid > .menu-section { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; width: auto; }
.menu-grid > .menu-section.sec-fin { background: linear-gradient(90deg, #dbeafe, #ede9fe); color: #4338ca; }
.menu-grid > .menu-section.sec-inv { background: linear-gradient(90deg, #ffedd5, #fef3c7); color: #c2410c; }
.menu-grid > .menu-section.sec-umum { background: linear-gradient(90deg, #dcfce7, #d1fae5); color: #047857; }
/* ikon judul halaman ikut warna modul */
.page-ico:has(.i-box) { background: #f1ecff; } .page-ico:has(.i-archive) { background: #e0f8fc; } .page-ico:has(.i-cart) { background: #fff5dc; }
/* kartu info beranda lebih cerah */
.stat { background: linear-gradient(135deg, #ffffff 40%, #f3f8ff); }
.recent a { border-color: #cfe0fb; }
.recent a:hover { background: #eaf3ff; }

/* =========================================================================
   MENU BERTINGKAT: modul (Keuangan / Persediaan) > sub modul (Farmasi / Umum) > grup > menu
   ========================================================================= */
.nav-mod { margin-top: 8px; }
.nav-mod > summary, .nav-sub > summary {
  list-style: none; cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
}
.nav-mod > summary::-webkit-details-marker, .nav-sub > summary::-webkit-details-marker { display: none; }
.nav-mod > summary::after, .nav-sub > summary::after {
  content: ""; margin-left: auto; width: 13px; height: 13px; background: currentColor; opacity: .6;
  -webkit-mask: var(--i-next) center / contain no-repeat; mask: var(--i-next) center / contain no-repeat; transition: transform .15s;
}
.nav-mod[open] > summary::after, .nav-sub[open] > summary::after { transform: rotate(90deg); }
.nav-mod > summary .dot, .nav-sub > summary .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.nav-mod > summary:hover, .nav-sub > summary:hover { filter: brightness(.97); }
.nav-mod.sec-fin > summary { background: linear-gradient(90deg, #dbeafe, #ede9fe); color: #4338ca; }
.nav-mod.sec-inv > summary { background: linear-gradient(90deg, #ffedd5, #fef3c7); color: #c2410c; }
.nav-fold { padding: 2px 0 4px; }
/* sub modul Persediaan */
.nav-sub { margin: 4px 0 0 8px; }
.nav-sub > summary { font-size: 11px; padding: 6px 10px; background: #fff; }
.nav-sub.sec-inv > summary { color: #c2410c; border: 1px solid #fed7aa; }
.nav-sub.sec-umum > summary { color: #047857; border: 1px solid #a7f3d0; }
.nav-sub.sec-inv[open] > summary { background: #fff7ed; }
.nav-sub.sec-umum[open] > summary { background: #ecfdf5; }
.nav-sub > .nav-fold { margin-left: 6px; padding-left: 2px; border-left: 2px solid transparent; }
.nav-sub.sec-inv > .nav-fold { border-left-color: #fed7aa; }
.nav-sub.sec-umum > .nav-fold { border-left-color: #a7f3d0; }
/* sidebar ringkas: modul jadi titik warna, klik untuk membuka sidebar */
@media (min-width: 861px) {
  body.nav-mini .nav-mod > summary, body.nav-mini .nav-sub > summary { justify-content: center; padding: 8px 0; }
  body.nav-mini .nav-mod > summary span:not(.dot), body.nav-mini .nav-sub > summary span:not(.dot),
  body.nav-mini .nav-mod > summary::after, body.nav-mini .nav-sub > summary::after { display: none; }
  body.nav-mini .nav-sub { margin-left: 0; }
  body.nav-mini .nav-sub > .nav-fold { margin-left: 0; border-left: 0; }
}

/* =========================================================================
   LOGIN (desain baru): kartu di tengah, panel identitas rumah sakit + form
   ========================================================================= */
.lg-body {
  min-height: 100vh; margin: 0;
  background:
    radial-gradient(60% 50% at 8% 10%, rgba(59,130,246,.18), transparent 70%),
    radial-gradient(55% 45% at 95% 90%, rgba(20,184,166,.16), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cpath d='M26 21h4v5h5v4h-5v5h-4v-5h-5v-4h5z' fill='%232563eb' fill-opacity='.06'/%3E%3C/svg%3E"),
    #f3f7fc;
}
.lg-stage { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; box-sizing: border-box; }
.lg-card {
  width: min(940px, 100%); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: #fff; border-radius: 22px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(15,23,42,.06), 0 24px 60px -18px rgba(30,64,175,.28);
}

/* panel identitas */
.lg-hero {
  position: relative; display: flex; flex-direction: column; gap: 22px; padding: 34px 36px 30px; color: #fff; overflow: hidden;
  background: radial-gradient(120% 90% at 100% 0%, rgba(45,212,191,.55), transparent 55%), linear-gradient(150deg, #1e3a8a 0%, #1d4ed8 45%, #0e7490 100%);
}
.lg-hero::after { content: ""; position: absolute; right: -70px; bottom: -70px; width: 240px; height: 240px; border-radius: 50%; border: 40px solid rgba(255,255,255,.06); }
.lg-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.lg-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #fff; color: #1d4ed8; font-weight: 800; font-size: 13px; letter-spacing: .04em; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.lg-brand-text { font-size: 17px; font-weight: 700; line-height: 1.2; }
.lg-brand-text small { display: block; font-size: 11.5px; font-weight: 500; color: #c7ddff; margin-top: 2px; }
.lg-hello { position: relative; z-index: 1; margin-top: auto; }
.lg-greet { margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #a5f3fc; }
.lg-company { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.015em; }
.lg-company:empty::before { content: "Rumah Sakit"; opacity: .85; }
.lg-clock { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 12px 0 0; }
#lgTime { font-size: 30px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.lg-date { font-size: 13px; color: #dbeafe; }
.lg-ecg { position: relative; z-index: 1; width: 100%; height: 56px; }
.lg-ecg path { fill: none; stroke: #5eead4; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 900; stroke-dashoffset: 900; animation: lg-ecg 2.8s ease-out .3s forwards; filter: drop-shadow(0 0 6px rgba(94,234,212,.6)); }
@keyframes lg-ecg { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .lg-ecg path { animation: none; stroke-dashoffset: 0; } }
.lg-modules { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lg-modules li { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); }
.lg-modules .dot { width: 8px; height: 8px; border-radius: 50%; }
.lg-modules .m-fin .dot { background: #a5b4fc; } .lg-modules .m-far .dot { background: #fdba74; } .lg-modules .m-umu .dot { background: #6ee7b7; }

/* form */
.lg-form { padding: 40px 40px 28px; display: flex; flex-direction: column; justify-content: center; }
.lg-form h1 { font-size: 26px; margin: 0 0 4px; }
.lg-sub { margin: 0 0 10px; color: var(--ink-3); }
.lg-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 16px 0 6px; }
.lg-field { position: relative; }
.lg-field > .i { position: absolute; left: 13px; top: 14px; color: #94a3b8; pointer-events: none; transition: color .15s; }
.lg-field:focus-within > .i { color: var(--brand); }
.lg-form .input { width: 100%; height: 44px; padding: 0 12px 0 40px; font-size: 14.5px; border-radius: 11px; background: #f8fafc; border: 1px solid #dbe3ee; box-sizing: border-box; }
.lg-form .input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37,99,235,.14); outline: none; }
.lg-form select.input { padding-right: 30px; }
.lg-eye { position: absolute; right: 7px; top: 7px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: #94a3b8; cursor: pointer; display: grid; place-items: center; }
.lg-eye:hover { background: #eef2f7; color: var(--ink); }
.lg-eye.on { color: var(--brand); }
.i-alert-s { --i: var(--i-alert); }
.lg-caps { display: none; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: #b45309; }
.lg-caps.on { display: flex; }
.lg-error { display: block; margin-top: 16px; padding: 10px 12px 10px 36px; position: relative; border-radius: 10px; font-size: 13px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; }
.lg-error::before { content: ""; position: absolute; left: 12px; top: 11px; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--i-alert) center / contain no-repeat; mask: var(--i-alert) center / contain no-repeat; }
.lg-error:empty { display: none; }
.lg-submit { position: relative; display: block; margin-top: 24px; }
.lg-submit .btn { width: 100%; height: 46px; border-radius: 11px; font-size: 15px; font-weight: 650; justify-content: center; box-shadow: 0 8px 18px -6px rgba(37,99,235,.55); }
.lg-submit::after { content: ""; position: absolute; right: 16px; top: 15px; width: 16px; height: 16px; background: #fff; pointer-events: none; -webkit-mask: var(--i-arrow) center / contain no-repeat; mask: var(--i-arrow) center / contain no-repeat; transition: transform .15s; }
.lg-submit:hover::after { transform: translateX(3px); }
.lg-submit.busy::after { display: none; }
.lg-foot { margin: 28px 0 0; text-align: center; font-size: 12px; color: #94a3b8; }

/* layar kecil: panel identitas jadi pita di atas form */
@media (max-width: 760px) {
  .lg-stage { padding: 16px; place-items: start center; }
  .lg-card { grid-template-columns: 1fr; border-radius: 18px; }
  .lg-hero { gap: 14px; padding: 22px 22px 18px; }
  .lg-company { font-size: 22px; }
  #lgTime { font-size: 22px; }
  .lg-ecg, .lg-modules { display: none; }
  .lg-form { padding: 26px 22px 22px; }
}
