/* BUSINESS FINANCIAL ANALYSIS — gaya antarmuka */
@font-face { font-family: 'BFA Montserrat'; src: url('../fonts/montserrat-var.woff') format('woff'); font-weight: 100 900; font-display: swap; }

:root, [data-theme="navy"] {
  --bg: #F2F5FB; --surface: #FFFFFF; --surface-2: #EEF3FA; --surface-3: #E3EBF7;
  --ink: #0B1B3A; --ink-2: #22324F; --muted: #5B6B85; --line: #DCE4F0;
  --primary: #0B2D63; --primary-2: #1565C0; --accent: #20B6CF; --accent-2: #F7931E; --on-primary: #FFFFFF;
  --pos: #12A47E; --neg: #E5484D; --warn: #F5A524;
  --c1: #1565C0; --c2: #F7931E; --c3: #20B6CF; --c4: #0B2D63; --c5: #12A47E; --c6: #E5484D; --c7: #8B5CF6; --c8: #94A3B8;
  --hero: linear-gradient(118deg, #0B2D63 0%, #1565C0 58%, #20B6CF 100%);
  --shadow: 0 1px 2px rgba(11, 27, 58, .06), 0 8px 24px rgba(11, 27, 58, .07);
  --ring: 0 0 0 3px rgba(32, 182, 207, .35);
  color-scheme: light;
}
[data-theme="agro"] {
  --bg: #F3F7F1; --surface: #FFFFFF; --surface-2: #EDF4EA; --surface-3: #E1ECDC;
  --ink: #0F2A20; --ink-2: #1F3F31; --muted: #587063; --line: #D6E3D2;
  --primary: #0F3D2E; --primary-2: #1E6B52; --accent: #2FA36B; --accent-2: #E0A526; --on-primary: #FFFFFF;
  --pos: #2FA36B; --neg: #C8443A; --warn: #E0A526;
  --c1: #1E6B52; --c2: #E0A526; --c3: #2FA36B; --c4: #0F3D2E; --c5: #7CC46F; --c6: #C8443A; --c7: #8C6D1F; --c8: #9AAFA3;
  --hero: linear-gradient(118deg, #0F3D2E 0%, #1E6B52 55%, #2FA36B 100%);
  --ring: 0 0 0 3px rgba(47, 163, 107, .35);
}
[data-theme="fintech"] {
  --bg: #0A1120; --surface: #111A2E; --surface-2: #16213A; --surface-3: #1C2947;
  --ink: #E8EEF9; --ink-2: #C9D4E8; --muted: #93A4C3; --line: #243354;
  --primary: #0EA5E9; --primary-2: #14B8A6; --accent: #2DD4BF; --accent-2: #F59E0B; --on-primary: #04121F;
  --pos: #22C55E; --neg: #F43F5E; --warn: #F59E0B;
  --c1: #38BDF8; --c2: #F59E0B; --c3: #2DD4BF; --c4: #818CF8; --c5: #22C55E; --c6: #F43F5E; --c7: #E879F9; --c8: #64748B;
  --hero: linear-gradient(118deg, #0B1730 0%, #0E3B5C 55%, #0F766E 100%);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .35);
  --ring: 0 0 0 3px rgba(45, 212, 191, .4);
  color-scheme: dark;
}
[data-theme="marun"] {
  --bg: #FBF7F0; --surface: #FFFFFF; --surface-2: #F6EFE4; --surface-3: #EFE4D3;
  --ink: #2A1016; --ink-2: #47222B; --muted: #7A5A60; --line: #EADCC9;
  --primary: #5A1A2B; --primary-2: #8C2F45; --accent: #C9A227; --accent-2: #E07A5F; --on-primary: #FFFFFF;
  --pos: #2E8B57; --neg: #B23A48; --warn: #C9A227;
  --c1: #8C2F45; --c2: #C9A227; --c3: #E07A5F; --c4: #5A1A2B; --c5: #2E8B57; --c6: #B23A48; --c7: #6D597A; --c8: #B8A99A;
  --hero: linear-gradient(118deg, #5A1A2B 0%, #8C2F45 60%, #C9A227 100%);
  --ring: 0 0 0 3px rgba(201, 162, 39, .35);
}
[data-theme="neon"] {
  --bg: #F6F4FF; --surface: #FFFFFF; --surface-2: #F0ECFF; --surface-3: #E6DFFF;
  --ink: #1B0B3A; --ink-2: #2E1A55; --muted: #6B5E8C; --line: #E1DAF5;
  --primary: #2E1065; --primary-2: #7C3AED; --accent: #A3E635; --accent-2: #F472B6; --on-primary: #FFFFFF;
  --pos: #16A34A; --neg: #E11D48; --warn: #F59E0B;
  --c1: #7C3AED; --c2: #F472B6; --c3: #A3E635; --c4: #2E1065; --c5: #16A34A; --c6: #E11D48; --c7: #06B6D4; --c8: #A1A1AA;
  --hero: linear-gradient(118deg, #2E1065 0%, #7C3AED 60%, #F472B6 100%);
  --ring: 0 0 0 3px rgba(163, 230, 53, .5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 'BFA Montserrat', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}
a { color: var(--primary-2); }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 10px; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1480px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand img { height: 44px; width: auto; display: block; }
.brand .logo-dark { display: none; }
[data-theme="fintech"] .brand .logo-light { display: none; }
[data-theme="fintech"] .brand .logo-dark { display: block; }
.proj-name {
  flex: 1 1 200px; min-width: 140px; max-width: 420px; border: 1px solid transparent; background: var(--surface-2);
  border-radius: 12px; padding: 8px 12px; font-weight: 700; color: var(--ink);
}
.proj-name:hover { border-color: var(--line); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-left: auto; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.btn.accent { background: var(--accent-2); color: #1b1200; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.danger { color: var(--neg); }
.select, .input {
  border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 10px; min-height: 38px; color: var(--ink);
}
.swatches { display: flex; gap: 6px; align-items: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.sw-navy { background: linear-gradient(135deg, #0B2D63 50%, #F7931E 50%); }
.sw-agro { background: linear-gradient(135deg, #0F3D2E 50%, #E0A526 50%); }
.sw-fintech { background: linear-gradient(135deg, #0A1120 50%, #2DD4BF 50%); }
.sw-marun { background: linear-gradient(135deg, #5A1A2B 50%, #C9A227 50%); }
.sw-neon { background: linear-gradient(135deg, #7C3AED 50%, #A3E635 50%); }
.menu-btn { display: none; }
.file-wrap { position: relative; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; min-width: 250px; z-index: 60; display: flex; flex-direction: column; }
.dropdown[hidden] { display: none; }
.dropdown button { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 10px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; color: var(--ink); }
.dropdown button:hover { background: var(--surface-2); }
.dropdown kbd { font: inherit; font-size: 11px; color: var(--muted); }
#tplSelect { max-width: 230px; }

/* ---------- Hero / KPI band ---------- */
.hero { background: var(--hero); color: #fff; position: relative; overflow: hidden; }
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background: radial-gradient(600px 220px at 85% -10%, #fff, transparent 70%), radial-gradient(400px 200px at 10% 120%, #fff, transparent 70%);
}
.hero-in { max-width: 1480px; margin: 0 auto; padding: 16px 20px 18px; position: relative; z-index: 1; }
.hero-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.hero h1 { margin: 0; font-size: 15px; letter-spacing: 2px; font-weight: 800; text-transform: uppercase; opacity: .95; }
.hero .meta { font-size: 12.5px; opacity: .85; }
.status {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-weight: 800; letter-spacing: 1px; font-size: 13px;
  background: rgba(255, 255, 255, .16); border: 1.5px solid rgba(255, 255, 255, .5);
}
.status .dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .25); }
.status.ok .dot { background: #34F5B4; box-shadow: 0 0 12px #34F5B4; }
.status.warn .dot { background: #FFD166; box-shadow: 0 0 12px #FFD166; }
.status.bad .dot { background: #FF6B6B; box-shadow: 0 0 12px #FF6B6B; }
.kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.kpi {
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); border-radius: 16px; padding: 10px 12px; min-width: 0;
  backdrop-filter: blur(6px); transition: transform .15s ease, background .15s ease;
}
.kpi:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .18); }
.kpi .lbl { font-size: 11px; font-weight: 700; letter-spacing: .4px; opacity: .88; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .val { font-size: 21px; font-weight: 800; line-height: 1.2; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.3px; }
.kpi .sub { font-size: 11px; opacity: .85; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.ok { box-shadow: inset 0 3px 0 #34F5B4; }
.kpi.bad { box-shadow: inset 0 3px 0 #FF6B6B; }
.kpi.neutral { box-shadow: inset 0 3px 0 rgba(255, 255, 255, .5); }
.partner-strip { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.chip { display: inline-flex; gap: 6px; align-items: center; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); padding: 4px 10px; border-radius: 999px; }
.hero.compact .kpis { grid-template-columns: repeat(7, minmax(0, 1fr)); }

/* ---------- Layout ---------- */
.layout { max-width: 1480px; margin: 0 auto; padding: 18px 20px 40px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.sidenav { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 96px); overflow: auto; padding-bottom: 12px; }
.sidenav .grp { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; color: var(--muted); margin: 10px 10px 4px; text-transform: uppercase; }
.navlink {
  display: flex; gap: 10px; align-items: center; padding: 7px 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 13.5px;
  border: 1px solid transparent; background: none; cursor: pointer; text-align: left; width: 100%;
}
.navlink .n { width: 22px; height: 22px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-size: 11px; font-weight: 800; color: var(--primary-2); flex: none; }
.navlink:hover { background: var(--surface); border-color: var(--line); }
.navlink[aria-current="page"] { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); color: var(--ink); }
.navlink[aria-current="page"] .n { background: var(--primary); color: var(--on-primary); }
.mode-switch { display: flex; background: var(--surface-2); border-radius: 999px; padding: 3px; margin: 4px 6px 6px; border: 1px solid var(--line); }
.mode-switch button { flex: 1; border: 0; background: none; padding: 6px 8px; border-radius: 999px; font-weight: 700; font-size: 12px; cursor: pointer; color: var(--muted); }
.mode-switch button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }

/* ---------- Cards & forms ---------- */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.page-h h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.page-h h2 small { display: block; font-size: 12px; font-weight: 700; letter-spacing: 1.5px; color: var(--accent-2); text-transform: uppercase; margin-bottom: 2px; }
.page-h p { margin: 4px 0 0; color: var(--muted); max-width: 820px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card h3 { margin: 0 0 10px; font-size: 15.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h3 .tag { font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); padding: 2px 8px; border-radius: 999px; }
.card .hint { color: var(--muted); font-size: 12.5px; margin: -4px 0 12px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.field > span em { font-style: normal; font-weight: 600; color: var(--muted); }
.field .control { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.field .control:focus-within { box-shadow: var(--ring); border-color: var(--accent); }
.field input, .field select, .field textarea { border: 0; background: transparent; padding: 8px 10px; width: 100%; min-width: 0; outline: none; }
.field textarea { min-height: 70px; resize: vertical; }
.field .suf { display: flex; align-items: center; padding: 0 10px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.field small { color: var(--muted); font-size: 11.5px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary-2); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface-2); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-weight: 700; cursor: pointer; color: var(--muted); font-size: 12.5px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Tables ---------- */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; max-width: 100%; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.8px; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { background: var(--surface-2); font-weight: 800; color: var(--ink-2); position: sticky; top: 0; z-index: 1; font-size: 12px; }
td:first-child, th:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 2; max-width: 340px; white-space: normal; min-width: 210px; }
th:first-child { background: var(--surface-2); z-index: 3; }
tr.b td { font-weight: 800; background: var(--surface-2); }
tr.b td:first-child { background: var(--surface-2); }
tr.sec td { font-weight: 800; color: var(--primary-2); background: var(--surface); text-transform: uppercase; font-size: 11px; letter-spacing: 1px; }
td.neg { color: var(--neg); }
.edit-tbl td, .edit-tbl th { padding: 4px 5px; text-align: left; }
.edit-tbl td:first-child, .edit-tbl th:first-child { min-width: 0; position: static; }
.edit-tbl input, .edit-tbl select { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 6px 7px; min-width: 64px; }
.edit-tbl input:hover, .edit-tbl select:hover { border-color: var(--line); background: var(--surface); }
.edit-tbl input:focus, .edit-tbl select:focus { border-color: var(--accent); background: var(--surface); outline: none; box-shadow: var(--ring); }
.edit-tbl input.num { text-align: right; }
.edit-tbl .w-xs { min-width: 52px; } .edit-tbl .w-s { min-width: 80px; } .edit-tbl .w-m { min-width: 120px; } .edit-tbl .w-l { min-width: 210px; } .edit-tbl .w-xl { min-width: 260px; }
.row-act { display: flex; gap: 2px; justify-content: flex-end; }
.icon-btn { border: 0; background: none; cursor: pointer; padding: 5px; border-radius: 8px; color: var(--muted); display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.del:hover { color: var(--neg); }
.icon-btn svg { width: 15px; height: 15px; }
.tbl-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.sumline { color: var(--muted); font-size: 12.5px; }
.sumline b { color: var(--ink); }

/* ---------- Dashboard ---------- */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
.chart { width: 100%; min-height: 120px; }
.chart-svg { width: 100%; height: auto; display: block; font-family: 'BFA Montserrat', 'Segoe UI', sans-serif; }
.chart-tip {
  position: fixed; z-index: 100; display: none; background: var(--ink); color: var(--surface); padding: 8px 10px; border-radius: 10px; font-size: 12px; pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); max-width: 300px;
}
.chart-tip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.bluf { font-size: 14.5px; line-height: 1.65; }
.bluf b { color: var(--primary-2); }
[data-theme="fintech"] .bluf b { color: var(--accent); }
.crit { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.crit li { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.crit .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #fff; flex: none; }
.crit .ok .ic { background: var(--pos); } .crit .bad .ic { background: var(--neg); } .crit .soft .ic { background: var(--warn); }
.warns { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); font-size: 12.8px; }
.warns ul { margin: 4px 0 0 18px; padding: 0; }
.info { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line); font-size: 12.8px; color: var(--ink-2); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; }
.pill.ok { background: color-mix(in srgb, var(--pos) 16%, transparent); color: var(--pos); }
.pill.bad { background: color-mix(in srgb, var(--neg) 16%, transparent); color: var(--neg); }
.pill.warn { background: color-mix(in srgb, var(--warn) 20%, transparent); color: color-mix(in srgb, var(--warn) 70%, var(--ink)); }
.statgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.stat .l { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.stat .v { font-size: 18px; font-weight: 800; }
.heat { display: grid; grid-template-columns: 26px repeat(5, 1fr); gap: 4px; font-size: 11px; max-width: 360px; }
.heat div { aspect-ratio: 1.6; border-radius: 8px; display: grid; place-items: center; font-weight: 800; }
.heat .ax { background: none; color: var(--muted); }
.welcome { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.step { background: var(--surface-2); border-radius: 16px; padding: 12px 14px; }
.step b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.step .k { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--accent-2); color: #1b1200; font-weight: 900; margin-bottom: 6px; }

/* ---------- Modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 12, 30, .55); z-index: 80; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-bg.open { display: flex; }
.modal { background: var(--surface); color: var(--ink); border-radius: 22px; width: min(720px, 100%); max-height: 86vh; overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); padding: 20px 22px; }
.modal h3 { margin: 0 0 12px; font-size: 18px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.plist { display: grid; gap: 8px; }
.pitem { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; flex-wrap: wrap; }
.pitem .nm { font-weight: 800; } .pitem .dt { color: var(--muted); font-size: 12px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 14px; font-weight: 700; opacity: 0; transition: all .25s ease; z-index: 90; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

footer.site { max-width: 1480px; margin: 0 auto; padding: 18px 20px 30px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); }

/* ---------- Laporan (cetak) ---------- */
.report { background: #fff; color: #0B1B3A; border-radius: 18px; padding: 28px 32px; border: 1px solid var(--line); }
.report .cover { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 3px solid #0B2D63; padding-bottom: 14px; margin-bottom: 18px; }
.report .cover img { height: 86px; }
.report h1 { margin: 0; font-size: 22px; }
.report h2 { font-size: 16px; margin: 22px 0 8px; color: #0B2D63; border-left: 5px solid #F7931E; padding-left: 10px; }
.report table { font-size: 11.5px; }
.report td:first-child, .report th:first-child { position: static; }
.report .kgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.report .kbox { border: 1px solid #DCE4F0; border-radius: 12px; padding: 8px 10px; }
.report .kbox .l { font-size: 10.5px; color: #5B6B85; font-weight: 700; text-transform: uppercase; }
.report .kbox .v { font-size: 16px; font-weight: 800; }
.report .disc { font-size: 10.5px; color: #5B6B85; margin-top: 20px; border-top: 1px solid #DCE4F0; padding-top: 10px; }

/* ---------- Responsif ---------- */
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .sidenav { position: static; flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 6px; gap: 6px; }
  .sidenav .grp { display: none; }
  .navlink { width: auto; white-space: nowrap; background: var(--surface); border-color: var(--line); }
  .mode-switch { min-width: 180px; margin: 0; }
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
}
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome, .statgrid { grid-template-columns: 1fr 1fr; }
  #tplSelect { max-width: 150px; }
  .swatches { padding: 3px 6px; }
  .swatch { width: 18px; height: 18px; }
  .brand img { height: 36px; }
  .topbar { position: static; }
  .report .kgrid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g2 { grid-template-columns: 1fr; }
  .kpi .val { font-size: 18px; }
  .welcome, .statgrid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .topbar, .hero, .sidenav, footer.site, .no-print, .toast, .modal-bg { display: none !important; }
  .layout { display: block; padding: 0; max-width: none; }
  .report { border: 0; padding: 0; border-radius: 0; }
  .report h2 { break-after: avoid; }
  .report .blk { break-inside: avoid; }
  .report table { font-size: 9.5px; }
  .report .kgrid { grid-template-columns: repeat(4, 1fr) !important; }
  .report .kbox .v { font-size: 13px; }
  .report .disc { break-inside: avoid; }
  .report th, .report td { padding: 3px 5px; }
  .tbl-wrap { overflow: visible; border: 0; }
  th { position: static; }
}
