/* =========================================================================
   PMS — tampilan berbasis template Metis (Bootstrap 5 admin, MIT, Colorlib)
   Token desain diporting dari src-modern/styles/scss/abstracts/_variables.scss:
   netral Zinc, satu aksen biru, struktur dari garis 1px (bukan bayangan),
   radius 8px, header 56px, sidebar 240px, mode gelap.
   ========================================================================= */
:root {
  --gray-50: #fafafa; --gray-100: #f4f4f5; --gray-200: #e4e4e7; --gray-300: #d4d4d8; --gray-400: #a1a1aa;
  --gray-500: #71717a; --gray-600: #52525b; --gray-700: #3f3f46; --gray-800: #27272a; --gray-900: #18181b; --gray-950: #09090b;
  --primary: #2563eb; --primary-rgb: 37, 99, 235; --success: #16a34a; --info: #0891b2; --warning: #d97706; --danger: #dc2626; --teal: #0d9488;
  --surface-app: var(--gray-50); --surface-panel: #fff; --surface-sunken: var(--gray-100); --surface-hover: var(--gray-100);
  --ink-primary: var(--gray-900); --ink-secondary: var(--gray-600); --ink-muted: var(--gray-500);
  --border: var(--gray-200); --border-strong: var(--gray-300);
  --radius: 0.5rem; --radius-sm: 0.375rem; --radius-lg: 0.625rem;
  --shadow-lg: 0 8px 24px rgba(9, 9, 11, .08), 0 2px 6px rgba(9, 9, 11, .04);
  --shadow-xl: 0 16px 40px rgba(9, 9, 11, .12), 0 4px 10px rgba(9, 9, 11, .05);
  --header-h: 56px; --sidebar-w: 240px;
  --font: "Inter", "Inter Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --good-bg: #dcfce7; --good-fg: #15803d; --bad-bg: #fee2e2; --bad-fg: #b91c1c; --warn-bg: #fef3c7; --warn-fg: #b45309; --plain-bg: var(--gray-100); --plain-fg: var(--gray-700);
  color-scheme: light;
}
[data-theme="dark"] {
  --surface-app: var(--gray-950); --surface-panel: var(--gray-900); --surface-sunken: var(--gray-950); --surface-hover: var(--gray-800);
  --ink-primary: var(--gray-100); --ink-secondary: var(--gray-400); --ink-muted: var(--gray-500);
  --border: var(--gray-800); --border-strong: var(--gray-700);
  --good-bg: rgba(22, 163, 74, .16); --good-fg: #4ade80; --bad-bg: rgba(220, 38, 38, .16); --bad-fg: #f87171; --warn-bg: rgba(217, 119, 6, .16); --warn-fg: #fbbf24; --plain-bg: var(--gray-800); --plain-fg: var(--gray-300);
  --primary: #3b82f6; --primary-rgb: 59, 130, 246;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 0.875rem/1.5 var(--font); color: var(--ink-primary); background: var(--surface-app); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.375rem; } h2 { font-size: 1.0625rem; } h3 { font-size: 0.9375rem; margin: 1.25rem 0 .5rem; }
a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
p { margin: 0 0 .5rem; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ico { width: 1.05rem; height: 1.05rem; flex: none; vertical-align: -0.2em; }
.muted { color: var(--ink-muted); } .small { font-size: .75rem; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.r { text-align: right; } .nowrap { white-space: nowrap; }
.neg { color: var(--danger); } .pos { color: var(--success); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 2000; background: var(--primary); color: #fff; padding: 8px 12px; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }

/* ---------------- Header (admin-header) ---------------- */
.admin-header { position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 1030; display: flex; align-items: center; gap: 1rem;
  padding: 0 1rem; background: var(--surface-panel); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: .55rem; width: calc(var(--sidebar-w) - 3.25rem); font-weight: 700; font-size: 1.0625rem; color: var(--ink-primary); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .95rem; }
.hdr-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; height: 36px; min-width: 36px; padding: 0 .5rem;
  border: 0; background: transparent; color: var(--ink-secondary); border-radius: var(--radius-sm); cursor: pointer; position: relative; font: inherit; }
.hdr-btn:hover { background: var(--surface-hover); color: var(--ink-primary); }
.hdr-btn .ico { width: 1.15rem; height: 1.15rem; }
.hdr-badge { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: .625rem; font-weight: 600; display: grid; place-items: center; line-height: 1; }
.hdr-search { flex: 1; max-width: 420px; margin: 0 auto; position: relative; }
.hdr-search select { width: 100%; height: 36px; border: 1px solid transparent; background: var(--surface-sunken); border-radius: var(--radius); padding: 0 2rem 0 2.25rem; font: inherit; color: var(--ink-primary); appearance: none; cursor: pointer; }
.hdr-search select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .15); }
.hdr-search .ico-l { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--ink-muted); pointer-events: none; }
.hdr-search .ico-r { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); color: var(--ink-muted); pointer-events: none; width: .85rem; }
.hdr-actions { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.hdr-sep { width: 1px; height: 24px; background: var(--border); margin: 0 .5rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-sunken); border: 1px solid var(--border); display: grid; place-items: center; font-weight: 600; font-size: .75rem; color: var(--ink-secondary); }
.user-btn { color: var(--ink-primary); font-weight: 500; }
.user-btn .ico { width: .8rem; }

/* dropdown */
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface-panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .375rem; z-index: 1060; }
.menu[hidden] { display: none; }
.menu a, .menu button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .5rem .625rem; border: 0; background: none; font: inherit; color: var(--ink-primary); border-radius: var(--radius-sm); text-align: left; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--surface-hover); text-decoration: none; }
.menu .menu-head { padding: .5rem .625rem; border-bottom: 1px solid var(--border); margin-bottom: .25rem; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: .25rem 0; }
.notif-menu { width: 360px; max-height: 70vh; overflow: auto; padding: 0; }
.notif-menu .nhead { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-weight: 600; position: sticky; top: 0; background: var(--surface-panel); }
.notif-item { display: block; padding: .625rem 1rem; border-bottom: 1px solid var(--border); color: var(--ink-primary); }
.notif-item:hover { background: var(--surface-hover); text-decoration: none; }
.notif-item.unread { box-shadow: inset 2px 0 0 var(--primary); }
.notif-item b { font-weight: 500; display: block; }

/* ---------------- Sidebar ---------------- */
.admin-sidebar { position: fixed; top: var(--header-h); left: 0; width: var(--sidebar-w); height: calc(100vh - var(--header-h)); background: var(--surface-panel);
  border-right: 1px solid var(--border); overflow-y: auto; padding: .75rem 0 2rem; z-index: 1035; transition: transform .25s cubic-bezier(.4, 0, .2, 1); scrollbar-width: thin; }
.sidebar-nav { padding: 0 .75rem; }
.nav-link { position: relative; display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; line-height: 1.5; margin-bottom: 2px; border-radius: var(--radius); color: var(--ink-primary); font-size: .875rem; cursor: pointer;
  border: 0; background: none; width: 100%; font-family: inherit; text-align: left; transition: background-color .12s ease, color .12s ease; }
.nav-link .ico { color: var(--ink-secondary); }
.nav-link:hover { background: var(--surface-sunken); text-decoration: none; }
.nav-link.active { background: var(--surface-hover); font-weight: 600; }
.nav-link.active .ico { color: var(--ink-primary); }
.nav-link.active::before { content: ""; position: absolute; left: -.75rem; top: 5px; bottom: 5px; width: 2px; border-radius: 0 2px 2px 0; background: var(--primary); }
.nav-link .chev { margin-left: auto; width: .75rem; transition: transform .2s ease; }
.nav-link[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-link .pill { margin-left: auto; font-size: .6875rem; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: var(--danger); color: #fff; }
.nav-sub { margin: 2px 0 4px; padding: 2px 0; }
.nav-sub[hidden] { display: none; }
.nav-sub .nav-link { padding: .375rem .75rem .375rem 2.6rem; font-size: .8125rem; color: var(--ink-secondary); }
.nav-sub .nav-link.active { color: var(--ink-primary); }
.nav-section { display: block; padding: 1rem .75rem .375rem; font-size: .6875rem; letter-spacing: .06em; color: var(--ink-muted); font-weight: 600; text-transform: uppercase; }
.sidebar-backdrop { display: none; }

/* ---------------- Main ---------------- */
.admin-main { margin-left: var(--sidebar-w); padding-top: var(--header-h); min-height: 100vh; }
.content { padding: 1.5rem; max-width: 1600px; }
.admin-footer { padding: 1rem 1.5rem; color: var(--ink-muted); font-size: .75rem; border-top: 1px solid var(--border); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head .sub { color: var(--ink-secondary); margin: .25rem 0 0; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.back { display: inline-block; font-size: .8125rem; color: var(--ink-secondary); margin-bottom: .25rem; }

/* ---------------- Buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; height: 36px; padding: 0 .875rem; font: 500 .875rem/1 var(--font); border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface-panel); color: var(--ink-primary); cursor: pointer; white-space: nowrap; transition: background-color .15s, border-color .15s; text-decoration: none; }
.btn:hover { background: var(--surface-hover); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-ghost { color: var(--danger); border-color: rgba(220, 38, 38, .35); }
.btn-danger-ghost:hover { background: var(--bad-bg); }
.btn-sm { height: 30px; padding: 0 .625rem; font-size: .8125rem; }
.btn-icon { width: 36px; padding: 0; }
.icon-btn { border: 0; background: none; color: var(--ink-muted); cursor: pointer; width: 28px; height: 28px; border-radius: var(--radius-sm); font-size: .9rem; }
.icon-btn:hover { background: var(--surface-hover); color: var(--ink-primary); }
.link-btn { border: 0; background: none; color: var(--danger); cursor: pointer; font-size: .75rem; padding: 0 .25rem; }
.seg { display: inline-flex; border: 1px solid var(--primary); border-radius: var(--radius); overflow: hidden; }
.seg-btn { border: 0; background: var(--surface-panel); color: var(--primary); font: 600 .8125rem var(--font); padding: 0 .75rem; height: 34px; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--primary); }
.seg-btn.on { background: var(--primary); color: #fff; }

/* ---------------- Cards ---------------- */
.card, .panel { background: var(--surface-panel); border: 1px solid var(--border); border-radius: var(--radius); }
.panel { padding: 1.25rem; }
.panel > h3:first-child, .side .panel h3 { margin-top: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .875rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-title { font-size: .9375rem; font-weight: 600; margin: 0; }
.card-body { padding: 1.25rem; }
.card-body.flush { padding: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.stats-card { padding: 1.125rem 1.25rem; display: flex; gap: 1rem; align-items: center; }
.stats-icon { width: 2.5rem; height: 2.5rem; border-radius: var(--radius-sm); background: var(--surface-sunken); border: 1px solid var(--border); color: var(--ink-secondary); display: grid; place-items: center; flex: none; }
.stats-label { font-size: .6875rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: .25rem; }
.stats-value { font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stats-delta { font-size: .75rem; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink-secondary); }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.grid-2e { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.mb { margin-bottom: 1rem; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: .45rem 1rem; margin: 0; }
.kv dt { color: var(--ink-secondary); } .kv dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.activity { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow: auto; }
.activity li { display: flex; gap: .75rem; padding: .75rem 1.25rem; border-bottom: 1px solid var(--border); }
.activity li:last-child { border-bottom: 0; }
.activity .a-ico { width: 2rem; height: 2rem; border-radius: var(--radius-sm); background: var(--surface-sunken); border: 1px solid var(--border); display: grid; place-items: center; color: var(--ink-secondary); flex: none; }
.activity .a-ico .ico { width: .9rem; height: .9rem; }
.activity small { color: var(--ink-muted); display: block; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-panel); }
.card .table-wrap { border: 0; border-radius: 0; }
table.grid { width: 100%; border-collapse: collapse; font-size: .8125rem; }
table.grid th { text-align: left; font-weight: 600; font-size: .6875rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-secondary); background: var(--surface-sunken);
  padding: .625rem .75rem; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
table.grid th.r { text-align: right; }
table.grid th[data-sort] { cursor: pointer; user-select: none; }
table.grid th[data-sort]:hover { color: var(--primary); }
table.grid td { padding: .625rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr[data-id] { cursor: pointer; }
table.grid tbody tr[data-id]:hover, table.grid tbody tr[data-id]:focus { background: rgba(var(--primary-rgb), .05); outline: none; }
table.grid tr.parent td { font-weight: 600; background: var(--surface-sunken); }
table.grid tr.best td { background: var(--good-bg); }
table.grid tfoot td { background: var(--surface-sunken); font-weight: 600; }
table.compact td, table.compact th { padding: .45rem .625rem; }
.indent-1 { padding-left: 1.75rem !important; } .indent-2 { padding-left: 2.75rem !important; } .indent-3 { padding-left: 3.75rem !important; } .indent-4 { padding-left: 4.75rem !important; }
.lines-tbl input, .lines-tbl select { width: 100%; min-width: 90px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 .5rem; font: inherit; background: var(--surface-panel); color: var(--ink-primary); }
.lines-tbl td { padding: .3rem .4rem !important; }
.lines .btn { margin-top: .5rem; }

.badge { display: inline-block; padding: .2em .6em; border-radius: 999px; font-size: .6875rem; font-weight: 600; white-space: nowrap; line-height: 1.5; }
.badge-good { background: var(--good-bg); color: var(--good-fg); } .badge-bad { background: var(--bad-bg); color: var(--bad-fg); }
.badge-warn { background: var(--warn-bg); color: var(--warn-fg); } .badge-plain { background: var(--plain-bg); color: var(--plain-fg); }
.tag { display: inline-block; padding: .1em .45em; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .6875rem; font-weight: 600; color: var(--ink-secondary); background: var(--surface-sunken); }
.tag-amber { border-color: transparent; background: var(--warn-bg); color: var(--warn-fg); }
.pbar { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: var(--surface-sunken); border: 1px solid var(--border); overflow: hidden; vertical-align: middle; }
.pbar > span { display: block; height: 100%; background: var(--primary); }
.pbar.good > span { background: var(--success); } .pbar.bad > span { background: var(--danger); } .pbar.warn > span { background: var(--warning); }
.pbar.wide { width: 100%; height: 8px; }
.pcell { display: inline-flex; gap: .5rem; align-items: center; }

/* ---------------- Filters & forms ---------------- */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
.filters .push { margin-left: auto; }
.inp, .fld input:not([type=checkbox]), .fld select, .fld textarea { height: 36px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0 .75rem; font: inherit; background: var(--surface-panel); color: var(--ink-primary); }
.inp:focus, .fld input:focus, .fld select:focus, .fld textarea:focus, .lines-tbl input:focus, .lines-tbl select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .15); }
.filters input[type=search] { min-width: 220px; }
.inline { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink-secondary); font-size: .8125rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .875rem 1rem; }
.fld { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .25rem; }
.fld > span { font-weight: 500; font-size: .8125rem; }
.fld small { color: var(--ink-muted); font-size: .75rem; }
.fld textarea { height: auto; padding: .5rem .75rem; resize: vertical; line-height: 1.5; }
.fld.wide { grid-column: 1 / -1; }
.fld.check { flex-direction: row; align-items: center; gap: .5rem; }
.fld.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-errors { background: var(--bad-bg); color: var(--bad-fg); border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1rem; }
.form-errors ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.pager { display: flex; gap: .75rem; align-items: center; justify-content: flex-end; padding: .75rem 0; color: var(--ink-secondary); font-size: .8125rem; }
.empty, .loading { color: var(--ink-muted); padding: 1.5rem; text-align: center; }
.empty-state { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 2.5rem 1rem; text-align: center; color: var(--ink-secondary); background: var(--surface-panel); }

/* ---------------- Detail ---------------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.side { display: flex; flex-direction: column; gap: 1rem; }
.fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem 1.5rem; margin: 0; }
.fields dt { font-size: .75rem; color: var(--ink-muted); margin-bottom: .15rem; }
.fields dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.fields .wide { grid-column: 1 / -1; }
.pre { white-space: pre-wrap; font-weight: 400; }
.drop { display: block; border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: .875rem; text-align: center; color: var(--ink-secondary); cursor: pointer; margin-bottom: .75rem; }
.drop:hover { border-color: var(--primary); color: var(--primary); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop:focus-within { outline: 2px solid var(--primary); }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .75rem; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; }
.files, .links { list-style: none; padding: 0; margin: 0; }
.files li { padding: .5rem 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .1rem; }
.files li span { font-size: .75rem; }
.links li { padding: .3rem 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 .875rem .5rem; }
.timeline li::before { content: ""; position: absolute; left: -1.38rem; top: .35rem; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface-panel); }
.timeline blockquote { margin: .35rem 0 0; padding: .4rem .6rem; background: var(--surface-sunken); border-radius: var(--radius-sm); }
.audit { list-style: none; padding: 0; margin: .5rem 0 0; max-height: 400px; overflow: auto; }
.audit li { padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .8125rem; }
.changes { margin-top: .25rem; font-size: .75rem; color: var(--ink-secondary); }
.changes code { font-size: .7rem; background: var(--surface-sunken); padding: 0 .25rem; border-radius: 3px; }
details summary { cursor: pointer; font-weight: 600; }

/* ---------------- Modal & toast ---------------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(9, 9, 11, .5); z-index: 1050; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; overflow-y: auto; }
.modal { background: var(--surface-panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); width: 100%; max-width: 560px; }
.modal-wide { max-width: 980px; }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-body { padding: 1.25rem; }
.modal footer { display: flex; justify-content: flex-end; gap: .5rem; padding: .875rem 1.25rem; border-top: 1px solid var(--border); }
#toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 1080; display: flex; flex-direction: column; gap: .5rem; max-width: 420px; }
.toast { background: var(--gray-900); color: #fff; padding: .75rem 1rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: .8125rem; border-left: 3px solid var(--success); }
.toast-err { border-left-color: var(--danger); }
[data-theme="dark"] .toast { background: var(--gray-800); }

/* ---------------- Charts ---------------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-dasharray: 3 3; }
.chart .axis { fill: var(--ink-muted); font-size: 11px; font-family: var(--font); }
.chart .line-planned { fill: none; stroke: var(--gray-400); stroke-width: 2; stroke-dasharray: 6 4; }
.chart .line-actual { fill: none; stroke: var(--primary); stroke-width: 2.5; }
.chart .dot-actual { fill: var(--primary); stroke: var(--surface-panel); stroke-width: 2; }
.chart .today { stroke: var(--warning); stroke-width: 1.5; }
.chart .today-lbl { fill: var(--warning); font-size: 11px; font-weight: 600; font-family: var(--font); }
.chart .bar-a { fill: var(--primary); } .chart .bar-b { fill: var(--teal); } .chart .bar-c { fill: var(--gray-400); }
.legend { display: flex; gap: 1rem; font-size: .75rem; color: var(--ink-secondary); margin-top: .5rem; flex-wrap: wrap; }
.lg::before { content: ""; display: inline-block; width: 14px; height: 3px; margin-right: .4rem; vertical-align: middle; border-radius: 2px; }
.lg-planned::before { background: var(--gray-400); } .lg-actual::before, .lg-bar-a::before { background: var(--primary); } .lg-bar-b::before { background: var(--teal); } .lg-bar-c::before { background: var(--gray-400); }
.gantt { min-width: 900px; }
.gantt .g-row { fill: transparent; } .gantt .g-row-alt { fill: var(--surface-sunken); }
.gantt .g-plan { fill: var(--gray-300); } .gantt .g-act { fill: var(--primary); } .gantt .g-late { fill: var(--danger); } .gantt .g-par { fill: var(--gray-700); }
[data-theme="dark"] .gantt .g-plan { fill: var(--gray-700); } [data-theme="dark"] .gantt .g-par { fill: var(--gray-300); }
.gantt .g-ms { fill: var(--warning); }
.gantt .g-txt { fill: var(--ink-primary); font-size: 11px; font-family: var(--font); } .gantt .g-txt.b { font-weight: 600; }
.gantt .g-head { fill: var(--ink-muted); font-size: 10px; font-family: var(--font); }
.gantt .g-line { stroke: var(--border); } .gantt .g-today { stroke: var(--warning); stroke-width: 1.5; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .625rem .875rem; color: var(--ink-secondary); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink-primary); text-decoration: none; }
.tabs a.on { color: var(--primary); border-bottom-color: var(--primary); }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem; }
.quick a { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); color: var(--ink-primary); background: var(--surface-panel); }
.quick a:hover { border-color: var(--border-strong); background: var(--surface-hover); text-decoration: none; }
.quick a .ico { color: var(--ink-secondary); }

/* ---------------- Chat (halaman Messages Metis) ---------------- */
.chat { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - var(--header-h) - 3rem); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-panel); overflow: hidden; }
.chat-rooms { border-right: 1px solid var(--border); overflow-y: auto; }
.chat-rooms .rh { padding: .875rem 1rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.room { display: block; width: 100%; padding: .75rem 1rem; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; cursor: pointer; font: inherit; color: var(--ink-primary); }
.room:hover { background: var(--surface-hover); }
.room.on { background: var(--surface-hover); box-shadow: inset 2px 0 0 var(--primary); }
.room .rn { display: flex; justify-content: space-between; font-weight: 500; gap: .5rem; }
.room .rl { display: block; color: var(--ink-muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room .cnt { background: var(--primary); color: #fff; border-radius: 9px; font-size: .6875rem; padding: 0 6px; height: 18px; display: grid; place-items: center; }
.room-type { padding: .5rem 1rem .25rem; font-size: .6875rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); font-weight: 600; }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: .875rem 1.25rem; border-bottom: 1px solid var(--border); font-weight: 600; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .75rem; background: var(--surface-app); }
.msg { max-width: 72%; align-self: flex-start; }
.msg.me { align-self: flex-end; }
.msg .bub { background: var(--surface-panel); border: 1px solid var(--border); padding: .55rem .8rem; border-radius: 12px 12px 12px 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me .bub { background: var(--primary); color: #fff; border-color: var(--primary); border-radius: 12px 12px 4px 12px; }
.msg.me .bub a { color: #fff; text-decoration: underline; }
.msg .meta { font-size: .6875rem; color: var(--ink-muted); margin: .2rem .25rem; }
.msg.me .meta { text-align: right; }
.msg .mention { font-weight: 600; }
.msg img { max-width: 260px; border-radius: 8px; display: block; margin-top: .35rem; }
.chat-form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; min-height: 38px; max-height: 140px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: .5rem .75rem; font: inherit; background: var(--surface-panel); color: var(--ink-primary); }

/* ---------------- Auth (halaman login Metis) ---------------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: var(--surface-app); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface-panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; }
.auth-card .brand { width: auto; margin-bottom: 1.5rem; }
.auth-card h1 { font-size: 1.25rem; margin-bottom: .25rem; }
.auth-card .fld { margin-bottom: .875rem; }
.auth-card .fld input { width: 100%; }
.auth-card .btn { width: 100%; height: 40px; margin-top: .5rem; }
.auth-foot { margin-top: 1.25rem; font-size: .75rem; color: var(--ink-muted); text-align: center; }
.pw-rules { font-size: .75rem; color: var(--ink-secondary); padding-left: 1.1rem; margin: .25rem 0 .75rem; }

/* ---------------- Report (print) ---------------- */
.report { background: #fff; color: #111; padding: 2rem; border: 1px solid var(--border); border-radius: var(--radius); max-width: 1000px; }
[data-theme="dark"] .report { background: var(--surface-panel); color: var(--ink-primary); }
.report h1 { font-size: 1.375rem; } .report h2 { font-size: 1rem; margin: 1.5rem 0 .5rem; padding-bottom: .35rem; border-bottom: 2px solid var(--primary); }
.report .rmeta { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin: 1rem 0; }
.report .rmeta div { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .75rem; }
.report .rmeta b { display: block; font-size: 1.125rem; }
.report .rmeta span { font-size: .7rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .05em; }
.matrix td, .matrix th { text-align: center !important; }
.matrix td:first-child, .matrix th:first-child { text-align: left !important; }
.lv { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 4px; font-size: .6875rem; font-weight: 600; }
.lv0 { color: var(--ink-muted); } .lv1 { background: var(--plain-bg); } .lv2 { background: var(--warn-bg); color: var(--warn-fg); } .lv3 { background: rgba(var(--primary-rgb), .12); color: var(--primary); } .lv4 { background: var(--good-bg); color: var(--good-fg); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } .grid-2, .grid-3 { grid-template-columns: 1fr; } .detail-grid { grid-template-columns: 1fr; } .fields { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 991.98px) {
  .admin-sidebar { transform: translateX(-100%); z-index: 1041; }
  .admin-sidebar.show { transform: none; box-shadow: 4px 0 16px rgba(0, 0, 0, .15); }
  .sidebar-backdrop.show { display: block; position: fixed; inset: var(--header-h) 0 0 0; background: rgba(9, 9, 11, .4); z-index: 1040; }
  .admin-main { margin-left: 0; }
  .brand { width: auto; }
  .hdr-name, .hdr-hide-md { display: none; }
  .chat { grid-template-columns: 1fr; } .chat.has-room .chat-rooms { display: none; } .chat:not(.has-room) .chat-main { display: none; }
}
@media (max-width: 640px) {
  .content { padding: 1rem; } .stats-grid, .grid-2e { grid-template-columns: 1fr; } .form-grid, .fields { grid-template-columns: 1fr; }
  .hdr-search { display: none; } .report .rmeta { grid-template-columns: repeat(2, 1fr); } .notif-menu { width: calc(100vw - 2rem); right: -60px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .admin-header, .admin-sidebar, .actions, .filters, .pager, .no-print, .admin-footer, .side .drop, #toasts { display: none !important; }
  .admin-main { margin: 0; padding: 0; } .content { padding: 0; max-width: none; }
  body { background: #fff; color: #000; } .panel, .card, .report { border: 0; padding: 0; }
  .detail-grid { grid-template-columns: 1fr; } table.grid th { position: static; }
  .report h2 { break-after: avoid; } tr { break-inside: avoid; }
}

/* tambahan */
body.sb-collapsed .admin-sidebar { transform: translateX(-100%); }
body.sb-collapsed .admin-main { margin-left: 0; }
.lg-late::before { background: var(--danger); }
.photo-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.photo-grid figure { margin: 0; overflow: hidden; }
.photo-grid img { border: 0; border-radius: 0; aspect-ratio: 4/3; }
.photo-grid figcaption { padding: .5rem .75rem; }
.hdr-hide-lg { display: none; }
@media (max-width: 991.98px) { .hdr-hide-lg { display: inline; } }
.filters.panel { padding: .75rem 1rem; }
.chat-form .btn-icon { flex: none; }

.sb-proj { display: none; padding: 0 .75rem .5rem; }
.sb-proj select { width: 100%; }
.brand span:last-child { white-space: nowrap; }
@media (max-width: 640px) { .sb-proj { display: block; } .brand span:last-child { display: none; } }

/* ---------------- Installer ---------------- */
.install-card { max-width: 780px; }
.steps { display: flex; gap: .25rem; list-style: none; padding: 0; margin: 0 0 1.25rem; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: .4rem; font-size: .75rem; color: var(--ink-muted); padding: .25rem .5rem .25rem .25rem; border-radius: 999px; }
.steps li span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-sunken); border: 1px solid var(--border); font-weight: 600; }
.steps li.on { color: var(--ink-primary); font-weight: 600; background: var(--surface-sunken); }
.steps li.on span { background: var(--primary); color: #fff; border-color: var(--primary); }
.steps li.done span { background: var(--good-bg); color: var(--good-fg); border-color: transparent; }
.checks { list-style: none; padding: 0; margin: 1rem 0; }
.checks li { display: flex; gap: .6rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.checks li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .75rem; flex: none; }
.checks li.ok span { background: var(--good-bg); color: var(--good-fg); } .checks li.bad span { background: var(--bad-bg); color: var(--bad-fg); } .checks li.warn span { background: var(--warn-bg); color: var(--warn-fg); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 1rem 0; }
.opt { display: grid; grid-template-columns: auto 1fr; gap: .15rem .6rem; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: .875rem 1rem; cursor: pointer; margin-bottom: 1rem; }
.opt input { grid-row: span 2; margin-top: .2rem; accent-color: var(--primary); }
.opt span { color: var(--ink-secondary); font-size: .8125rem; }
.opt.on, .opt:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .12); }
.wiz-nav { display: flex; justify-content: space-between; margin-top: 1.25rem; gap: .5rem; }
.wiz-nav .btn { width: auto; margin: 0; }
.auth-card .wiz-nav .btn { width: auto; }
.install-card .fld input, .install-card .fld select { width: 100%; }
details.help { background: var(--surface-sunken); border-radius: var(--radius); padding: .6rem .875rem; margin-bottom: 1rem; font-size: .8125rem; }
details.help ol { margin: .5rem 0 0; padding-left: 1.2rem; }
.meter { display: block; height: 4px; background: var(--surface-sunken); border-radius: 2px; overflow: hidden; margin-top: .3rem; }
.meter span { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s; }
.meter span.mid { background: var(--warning); } .meter span.strong { background: var(--success); }
.done-ico { width: 56px; height: 56px; border-radius: 50%; background: var(--good-bg); color: var(--good-fg); display: grid; place-items: center; font-size: 1.75rem; font-weight: 700; margin-bottom: .75rem; }
code.big { font-size: 1.125rem; background: var(--surface-sunken); padding: .25rem .5rem; border-radius: var(--radius-sm); user-select: all; }
.install-card .panel { margin: .75rem 0; }
@media (max-width: 640px) { .choice { grid-template-columns: 1fr; } }
code.wrap { display:block; white-space: pre-wrap; word-break: break-all; background: var(--surface-sunken); padding: .5rem; border-radius: var(--radius-sm); font-size: .75rem; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }

/* ---------------- Cetak Permintaan Barang (PB) — A4 landscape ---------------- */
body.print-mode .admin-header, body.print-mode .admin-sidebar, body.print-mode .admin-footer, body.print-mode .sidebar-backdrop { display: none; }
body.print-mode .admin-main { margin: 0; padding-top: 0; background: var(--gray-200); }
body.print-mode .content { max-width: none; padding: 1rem; }
.pb-toolbar { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; max-width: 297mm; margin: 0 auto .75rem; }
.pb-sheet { width: 297mm; min-height: 210mm; margin: 0 auto; background: #fff; color: #000; padding: 10mm 12mm; box-shadow: var(--shadow-lg);
  font-family: "Times New Roman", Times, "Liberation Serif", serif; font-size: 10.5pt; line-height: 1.3; position: relative; }
.pb-sheet b { font-weight: 700; }
.pb-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8mm; }
.pb-kop { display: flex; gap: 3mm; align-items: center; }
.pb-logo { max-height: 22mm; max-width: 40mm; object-fit: contain; }
.pb-co { font-family: Arial, Helvetica, sans-serif; font-weight: 800; font-size: 15pt; color: #e8541c; letter-spacing: .2px; line-height: 1.1; }
.pb-tag { font-family: Arial, Helvetica, sans-serif; font-weight: 700; font-size: 10pt; color: #1f3a93; }
.pb-addr { font-family: Arial, Helvetica, sans-serif; font-size: 6.5pt; color: #333; }
.pb-code { margin-top: 5mm; background: #d9d9d9; font-weight: 700; font-size: 18pt; padding: 1mm 4mm; justify-self: center; }
.pb-meta { justify-self: end; border-collapse: collapse; font-size: 10.5pt; }
.pb-meta th { text-align: left; padding: .4mm 2mm .4mm 0; font-weight: 700; }
.pb-meta td { padding: .4mm 1.5mm; }
.pb-meta td.shade { min-width: 32mm; }
.pb-sheet .shade { background: #cfe0f5; }
.pb-sheet .shade.pad { padding: 0 2mm; font-weight: 700; }
.pb-title { text-align: center; font-size: 15pt; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; margin: 5mm 0 6mm; letter-spacing: .3px; font-family: inherit; }
.pb-line { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1mm; }
.pb-line > div:first-child { margin-bottom: 4mm; }
.pb-items { width: 100%; border-collapse: collapse; margin-bottom: 4mm; }
.pb-items th, .pb-items td { border: 1px solid #000; padding: .6mm 1.5mm; vertical-align: top; }
.pb-items th { font-weight: 700; text-align: center; }
.pb-items td.c { text-align: center; }
.c-no { width: 10mm; } .c-q { width: 15mm; } .c-name { width: 88mm; } .c-job { width: 52mm; }
.pb-opts { width: 100%; border-collapse: collapse; margin-bottom: 6mm; }
.pb-opts td { border: 1px solid #000; padding: 1.5mm 2mm 3mm; vertical-align: top; }
.pb-opts .o1 { width: 26%; } .pb-opts .o2 { width: 38%; }
.pb-opts .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5mm 4mm; margin: 2mm 0 2mm 1mm; }
.pb-cb { display: inline-flex; align-items: center; gap: 2mm; }
.pb-box { display: inline-block; width: 3.2mm; height: 3.2mm; border: 1px solid #000; position: relative; flex: none; }
.pb-box.on::after { content: ""; position: absolute; left: .9mm; top: -.2mm; width: 1.1mm; height: 2.2mm; border: solid #000; border-width: 0 .45mm .45mm 0; transform: rotate(40deg); }
.pb-sign { display: grid; grid-template-columns: 45mm 1fr; gap: 20mm; align-items: start; }
.pb-req { text-align: center; }
.pb-sigbox { height: 20mm; display: flex; align-items: center; justify-content: center; }
.pb-sigimg { max-height: 18mm; max-width: 44mm; object-fit: contain; }
.pb-req .pb-sigimg { max-width: 42mm; }
.pb-name { border-bottom: 1px solid #000; padding-bottom: .5mm; }
.pb-pos { padding-top: .5mm; }
.pb-appr { text-align: center; }
.pb-appr table { width: 100%; border-collapse: collapse; margin-top: 3mm; table-layout: fixed; }
.pb-appr td { border: 1px solid #000; text-align: center; }
.pb-appr td.sig { height: 21mm; vertical-align: middle; }
.pb-appr td.lbl { padding: .5mm; }
.pb-signame { font-style: italic; font-size: 12pt; }
.pb-sigdate { font-size: 6.5pt; color: #444; }
.pb-transfer { position: absolute; right: 12mm; bottom: 10mm; font-family: Arial, Helvetica, sans-serif; font-size: 6pt; width: 48mm; }
.pb-transfer b { display: block; margin-bottom: 1.5mm; }
.pb-transfer div { display: flex; justify-content: space-between; align-items: center; }
.pb-transfer .pb-box { width: 3.6mm; height: 3.6mm; margin: -1px 0 0; }
.sigrow { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.sigpad { width: 100%; height: 150px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: #fff; touch-action: none; cursor: crosshair; display: block; }
.sig-preview { max-height: 80px; max-width: 260px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; }
.logo-preview { max-height: 60px; max-width: 200px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; }
@media print {
  /* default: A4 portrait dengan margin wajar (laporan, halaman lain) */
  @page { size: A4 portrait; margin: 10mm 10mm 12mm; @bottom-right { content: "Hal. " counter(page) " / " counter(pages); font: 7pt Arial, sans-serif; color: #555; } }
  @page land { size: A4 landscape; margin: 8mm 10mm; }
  @page inv { size: A4 portrait; margin: 8mm 10mm; }
  .pb-sheet { page: land; }
  .pb-sheet.portrait { page: inv; }
  body.print-mode .admin-main, body.print-mode .content { background: #fff; padding: 0; margin: 0; }
  /* lebar mengikuti area cetak kertas → tidak pernah "mengecil" di pojok */
  .pb-sheet { box-shadow: none; margin: 0; width: auto; min-height: 192mm; padding: 0; }
  .pb-sheet.portrait { min-height: 279mm; }
  .pb-transfer { right: 0; bottom: 0; }
  .no-print, .skip-link, #toasts, .modal-wrap { display: none !important; }
  .pb-sheet .shade { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pb-code { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.sumbar { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .875rem 1rem; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--surface-panel); margin-top: -1px; }
.sumbar span { display: block; font-size: .6875rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); font-weight: 600; }
.sumbar b { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.sumbar .r { margin-left: auto; text-align: right; }
.done-ico.bad { background: var(--bad-bg); color: var(--bad-fg); }
.verify-card { max-width: 480px; }

/* ---------------- Cetak PP / PO / AP / Invoice ---------------- */
.pb-sheet .ul { text-decoration: underline; text-underline-offset: 2px; }
.pb-sheet .r { text-align: right; } .pb-sheet .c { text-align: center; } .pb-sheet .b { font-weight: 700; }
.pb-sheet .or { color: #e8541c; } .pb-sheet .big { font-size: 12pt; }
.pb-sheet .pre { white-space: pre-wrap; }
.pb-code.plain { margin-top: 3mm; }
.sig-qr svg { width: 17mm; height: 17mm; display: block; margin: 0 auto; }
/* PP */
.pp-intro { margin-bottom: 1mm; } .pp-intro > div { margin-bottom: .6mm; }
.pp-items .c-money { width: 40mm; }
.pb-items td.money, .inv-items td.money { text-align: right; }
.pb-items td.money span, .inv-items td.money span { float: left; }
.pp-items tr.blank td { height: 5mm; }
.pp-sig { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pp-sig th { border: 1px solid #000; font-weight: 700; padding: .5mm; }
.pp-sig td { border: 1px solid #000; text-align: center; }
.pp-sig td.sig { height: 22mm; }
/* PO & AP (font sans seperti contoh) */
.po-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6mm; align-items: start; font-family: Arial, Helvetica, sans-serif; }
.po-meta, .ap-meta { justify-self: end; border-collapse: collapse; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; }
.po-meta th { text-align: left; padding: .4mm 6mm .4mm 0; font-weight: 700; }
.po-meta td, .ap-meta td { padding: .4mm 0; } .ap-meta td:first-child { padding-right: 18mm; }
.po-title { text-align: center; font-family: Arial, Helvetica, sans-serif; font-size: 15pt; font-weight: 700; text-decoration: underline; margin: 4mm 0 3mm; }
.pb-sheet:has(.po-title), .pb-sheet:has(.ap-title), .pb-sheet.portrait { font-family: Arial, Helvetica, sans-serif; font-size: 9.5pt; }
.po-party { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #000; border-bottom: 1px solid #000; margin-bottom: 5mm; }
.po-party > div { padding: 1.5mm 2mm; } .po-party > div + div { border-left: 1px solid #000; }
.po-party table { border-collapse: collapse; } .po-party td { padding: 1mm 1.5mm; vertical-align: top; } .po-party td.lb { width: 38mm; white-space: nowrap; }
.po-items, .ap-items { width: 100%; border-collapse: collapse; margin-bottom: 4mm; }
.po-items th, .po-items td, .ap-items th, .ap-items td { border: 1px solid #000; padding: 1mm 1.5mm; }
.po-items th, .ap-items th { font-weight: 400; text-align: center; } .ap-items th { font-weight: 700; background: #f2f2f2; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.po-items thead tr { border-bottom: 2px solid #000; }
.c-qb { width: 30mm; } .c-sat { width: 22mm; } .c-pr { width: 38mm; } .c-acc { width: 38mm; } .c-ref { width: 66mm; } .c-q2 { width: 22mm; }
.po-items td.terb { vertical-align: middle; padding: 3mm; }
.po-foot { width: 100%; border-collapse: collapse; }
.po-foot > tbody > tr > td { border: 1px solid #000; vertical-align: top; padding: 1.5mm 2mm; }
.po-foot .pf1 { width: 45%; } .po-foot .pf1 table td { padding: .3mm 1.5mm .3mm 0; }
.po-foot .pf2, .po-foot .pf3 { text-align: center; }
.po-signame { margin-top: 16mm; }
.po-signers { display: flex; justify-content: space-around; gap: 4mm; }
.po-signers > div { text-align: center; min-width: 28mm; }
.po-sigarea { height: 16mm; display: flex; align-items: center; justify-content: center; }
.po-sigarea .pb-sigimg { max-height: 15mm; }
/* AP */
.ap-rule { border: 0; border-top: 1.5px solid #000; margin: 3mm 0 2mm; }
.ap-title { text-align: center; font-family: "Times New Roman", Times, serif; font-size: 16pt; font-weight: 700; color: #e8541c; text-decoration: underline; margin: 0 0 3mm; }
.ap-info { display: grid; grid-template-columns: 1.1fr 1fr; gap: 6mm; margin-bottom: 3mm; font-family: "Times New Roman", Times, serif; font-size: 10.5pt; }
.ap-info table { border-collapse: collapse; } .ap-info th { text-align: left; padding: .6mm 10mm .6mm 0; white-space: nowrap; } .ap-info td { padding: .6mm 0; }
.ap-items td { vertical-align: top; height: 7mm; }
.ap-sign { width: 100%; border-collapse: collapse; font-family: "Times New Roman", Times, serif; font-size: 9pt; }
.ap-sign th, .ap-sign td { border: 1px solid #000; padding: .6mm 1mm; text-align: center; }
.ap-sign th.note, .ap-sign td.note { text-align: left; width: 38%; }
.ap-sign td.sig { height: 20mm; vertical-align: bottom; } .ap-sign td.sig .pb-sigimg { max-height: 13mm; display: block; margin: 0 auto; }
.ap-sign .sig-qr svg { width: 13mm; height: 13mm; }
/* Invoice portrait */
.pb-sheet.portrait { width: 210mm; min-height: 297mm; padding: 12mm 14mm; }
.inv-head { display: grid; grid-template-columns: 1fr 76mm; gap: 6mm; }
.inv-banner { background: #1f5296; color: #fff; text-align: center; font-weight: 700; font-size: 17pt; padding: 1mm; letter-spacing: .5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.inv-meta { width: 100%; border-collapse: collapse; font-size: 7.5pt; margin-top: 1.5mm; }
.inv-meta td { padding: .7mm 1.5mm; } .inv-meta td + td { border: 1px solid #000; }
.inv-bar { background: #1f5296; color: #fff; font-weight: 700; font-size: 8pt; padding: 1mm 2mm; margin-top: 5mm; width: 74%; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.inv-bill { font-size: 8.5pt; margin: 1.5mm 0 4mm; }
.inv-items { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
.inv-items thead th { background: #1f5296; color: #fff; padding: 1mm; border: 1px solid #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.inv-items td { border: 1px solid #000; padding: .8mm 1.5mm; }
.inv-items tr.tot td.nob { border: 0; }
.inv-terb { background: #e7e7e7; text-align: center; font-size: 7.5pt; padding: 1.2mm; margin: 4mm 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.inv-terms { font-size: 8pt; }
.inv-comments { width: 58%; } .inv-comments .inv-bar { width: auto; } .inv-comments .box { border: 1px solid #000; min-height: 18mm; padding: 1.5mm; font-size: 8pt; }
.inv-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 8mm; font-size: 8pt; }
.inv-qr { text-align: center; font-size: 6pt; color: #555; } .inv-qr svg { width: 24mm; height: 24mm; display: block; }
.inv-sign { text-align: center; min-width: 60mm; }
.inv-thanks { text-align: center; font-size: 8.5pt; margin-top: 8mm; }
.wide-inp { width: 100%; min-width: 180px; } .num-inp { width: 110px; } .mt { margin-top: .75rem; }

/* ---------------- Cetak generik A4 (semua modul, daftar, laporan) ---------------- */
.print-only { display: none; }
.ps-sheet { width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff; color: #000; padding: 12mm 12mm 14mm; box-shadow: var(--shadow-lg);
  font-family: Arial, Helvetica, sans-serif; font-size: 9pt; line-height: 1.35; display: flex; flex-direction: column; }
.ps-sheet.ps-land { width: 297mm; min-height: 210mm; }
.ps-sheet .pre { white-space: pre-wrap; }
.ps-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6mm; border-bottom: 2px solid #1f3a93; padding-bottom: 3mm; margin-bottom: 4mm; }
.ps-docbox { text-align: right; flex: none; }
.ps-code { display: inline-block; background: #d9d9d9; font-weight: 700; font-size: 14pt; padding: .5mm 4mm; margin-bottom: 2mm; font-family: "Times New Roman", Times, serif; }
.ps-meta { border-collapse: collapse; margin-left: auto; font-size: 8.5pt; text-align: left; }
.ps-meta th { padding: .3mm 1.5mm .3mm 0; font-weight: 700; white-space: nowrap; }
.ps-meta td { padding: .3mm 1.5mm; } .ps-meta td.shade { background: #cfe0f5; min-width: 38mm; }
.ps-title { text-align: center; font-size: 13pt; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-transform: uppercase; margin: 1mm 0 4mm; letter-spacing: .3px; }
.ps-filter { font-size: 8pt; margin: -2mm 0 2mm; color: #333; }
.ps-fields { width: 100%; border-collapse: collapse; margin-bottom: 3mm; table-layout: fixed; }
.ps-fields th, .ps-fields td { border: 1px solid #9aa4b2; padding: 1mm 2mm; vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.ps-fields th { background: #eef2f8; width: 20%; font-weight: 700; }
.ps-h { font-size: 10pt; font-weight: 700; margin: 4mm 0 1.5mm; padding-left: 2mm; border-left: 3px solid #e8541c; break-after: avoid; }
.ps-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
.ps-table th { background: #1f3a93; color: #fff; font-weight: 700; padding: 1mm 1.5mm; border: 1px solid #1f3a93; text-align: left; }
.ps-table td { border: 1px solid #555; padding: .8mm 1.5mm; vertical-align: top; overflow-wrap: anywhere; }
.ps-table tbody tr:nth-child(even) td { background: #f4f6fa; }
.ps-table .r { text-align: right; } .ps-table .c { text-align: center; } .ps-table .b { font-weight: 700; } .ps-table .nw { white-space: nowrap; }
.ps-table th.no { width: 8mm; }
.ps-table tfoot td { background: #eef2f8; }
.ps-sum { margin: 3mm 0 0 auto; border-collapse: collapse; font-size: 9pt; }
.ps-sum th { text-align: left; padding: .8mm 6mm .8mm 2mm; border: 1px solid #555; background: #eef2f8; }
.ps-sum td { text-align: right; padding: .8mm 2mm; border: 1px solid #555; min-width: 45mm; white-space: nowrap; }
.ps-sum tr.g th, .ps-sum tr.g td { font-weight: 700; background: #cfe0f5; }
.ps-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm; }
.ps-photos figure { margin: 0; break-inside: avoid; }
.ps-photos img { width: 100%; height: 45mm; object-fit: cover; border: 1px solid #999; display: block; }
.ps-photos figcaption { font-size: 7pt; color: #444; margin-top: .5mm; }
.ps-files { margin: 0; padding-left: 5mm; }
.ps-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10mm; margin-top: 8mm; text-align: center; break-inside: avoid; }
.ps-sign .lb { font-weight: 700; } .ps-sign .box { height: 20mm; }
.ps-sign .nm { border-top: 1px solid #000; padding-top: 1mm; margin: 0 4mm; }
.ps-foot { margin-top: auto; padding-top: 1.5mm; border-top: 1px solid #bbb; display: flex; justify-content: space-between; font-size: 7pt; color: #555; }
.ps-sheet .pb-logo, .rep-kop .pb-logo { max-width: 80mm; max-height: 18mm; }
.rep-kop { border-bottom: 2px solid #1f3a93; padding-bottom: 3mm; margin-bottom: 4mm; font-family: Arial, Helvetica, sans-serif; }
@page lst { size: A4 landscape; margin: 10mm 10mm 12mm; @bottom-right { content: "Hal. " counter(page) " / " counter(pages); font: 7pt Arial, sans-serif; color: #555; } }
@media print {
  .print-only { display: block; }
  .admin-main, body.print-mode .admin-main { min-height: 0 !important; }
  .ps-sheet { width: auto; min-height: 0; padding: 0; margin: 0; box-shadow: none; display: block; }
  .ps-sheet.ps-land { page: lst; width: auto; min-height: 0; }
  .ps-foot { margin-top: 6mm; }
  .ps-table thead { display: table-header-group; } .ps-table tr { break-inside: avoid; }
  .ps-sheet, .ps-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report { font-family: Arial, Helvetica, sans-serif; }
}
