:root {
  color-scheme: light;
  --navy-900: #0f2438;
  --navy-800: #16324b;
  --navy-700: #1d405e;
  --accent: #f97316;
  --accent-dark: #ea580c;
  --accent-ink: #c2410c;
  --accent-tint: #ffedd5;
  --accent-tint-soft: #fff7ed;
  --accent-ring: #fed7aa;
  --bg: #f6f7f9;
  --card: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --surface-hover: #f9fafb;
  --surface-hover-2: #fafafa;
  --border: #e5e7eb;
  --border-soft: #f1f5f9;
  --border-strong: #cbd5e1;
  --ring-aktif: #ffedd5;
  --text: #111827;
  --text-strong: #0f2438;
  --text-label: #374151;
  --muted: #6b7280;
  --muted-strong: #475569;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --success-ink: #166534;
  --danger: #dc2626;
  --danger-soft: #fecaca;
  --draft-bg: #fef3c7;
  --draft-ink: #92400e;
  --sidebar-1: #0f2438;
  --sidebar-2: #132d45;
  --sidebar-ink: #ffffff;
  --sidebar-text: #cbd5e1;
  --sidebar-sub: #94a3b8;
  --sidebar-judul: #7c8fa5;
  --sidebar-hover: rgba(255,255,255,.06);
  --overlay: rgba(15,36,56,.45);
  --toast-bg: #0f2438;
  --toast-sukses: #166534;
  --toast-bahaya: #991b1b;
  --shadow-1: 0 1px 2px rgba(16,24,40,.04);
  --shadow-2: 0 4px 14px rgba(16,24,40,.08);
  --chart-grid: #e5e7eb;
  --chart-teks: #6b7280;
  --chart-area: #ffedd5;
  --komp-upah: #1d405e;
  --komp-bahan: #f97316;
  --komp-alat: #94a3b8;
}

:root[data-tema="gelap"] {
  color-scheme: dark;
  --navy-900: #1b3a55;
  --navy-800: #1a3348;
  --navy-700: #24445e;
  --accent-ink: #fdba74;
  --accent-tint: #3a2413;
  --accent-tint-soft: #241a12;
  --accent-ring: rgba(249,115,22,.45);
  --bg: #0b1420;
  --card: #111f2d;
  --surface: #111f2d;
  --surface-2: #16283a;
  --surface-3: #1b3145;
  --surface-hover: #16283a;
  --surface-hover-2: #142434;
  --border: #22354a;
  --border-soft: #1b2c3f;
  --border-strong: #33506b;
  --ring-aktif: rgba(249,115,22,.22);
  --text: #e6edf5;
  --text-strong: #f3f7fb;
  --text-label: #cbd5e1;
  --muted: #93a6ba;
  --muted-strong: #b6c6d6;
  --success: #4ade80;
  --success-bg: #14351f;
  --success-ink: #86efac;
  --danger: #f87171;
  --danger-soft: #5b1f1f;
  --draft-bg: #3a2f14;
  --draft-ink: #fcd34d;
  --sidebar-1: #08111b;
  --sidebar-2: #0d1a28;
  --sidebar-text: #b9c8d6;
  --sidebar-sub: #7f95a9;
  --sidebar-judul: #6d8296;
  --overlay: rgba(2,8,14,.65);
  --toast-bg: #1b3145;
  --toast-sukses: #14532d;
  --toast-bahaya: #7f1d1d;
  --shadow-1: 0 1px 2px rgba(0,0,0,.3);
  --shadow-2: 0 4px 14px rgba(0,0,0,.45);
  --chart-grid: #22354a;
  --chart-teks: #93a6ba;
  --chart-area: rgba(249,115,22,.18);
  --komp-upah: #3b6f96;
  --komp-bahan: #f97316;
  --komp-alat: #64748b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px; flex: 0 0 250px; padding: 18px 14px;
  background: linear-gradient(180deg, var(--sidebar-1) 0%, var(--sidebar-2) 100%);
  color: var(--sidebar-text); position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--accent);
  display: grid; place-items: center; font-weight: 800; color: #fff;
}
.brand-name { color: var(--sidebar-ink); font-weight: 800; letter-spacing: .3px; }
.brand-sub { font-size: 10px; color: var(--sidebar-sub); letter-spacing: .8px; }
.menu-grup { margin-top: 16px; }
.menu-judul {
  font-size: 10px; letter-spacing: 1.2px; color: var(--sidebar-judul);
  padding: 0 10px 6px; font-weight: 700;
}
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 9px; color: var(--sidebar-text); font-size: 13px; margin-bottom: 2px;
}
.menu-item:hover { background: var(--sidebar-hover); color: var(--sidebar-ink); }
.menu-item.aktif { background: var(--accent); color: #fff; font-weight: 600; }
.menu-ikon { width: 18px; text-align: center; opacity: .9; }

.main { flex: 1; min-width: 0; }
.topbar {
  height: 62px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 20;
}
.topbar-kiri { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.topbar-kiri > .muted, .topbar-kiri .chip { flex: 0 0 auto; }
.topbar-kanan { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.judul-proyek { font-weight: 700; font-size: 16px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
}
.chip-sukses { background: var(--success-bg); color: var(--success-ink); }
.chip-bisnis { background: var(--accent-tint); color: var(--accent-ink); }
.chip-draft { background: var(--draft-bg); color: var(--draft-ink); }

.kepala-proyek { background: var(--surface); border-bottom: 1px solid var(--border); padding: 18px 24px 0; }
.kepala-baris { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tab-strip { display: flex; gap: 4px; overflow-x: auto; margin-top: 14px; }
.tab {
  padding: 9px 12px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent;
  white-space: nowrap; font-weight: 500;
}
.tab.aktif { color: var(--text-strong); border-color: var(--accent); font-weight: 700; }

.view { padding: 22px 24px 60px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { font-size: 20px; font-weight: 800; margin: 0 0 4px; }
.muted { color: var(--muted); }

.btn {
  border: 1px solid var(--border); background: var(--surface); border-radius: 9px;
  padding: 8px 14px; font-weight: 600; font-size: 13px; display: inline-flex;
  align-items: center; gap: 7px; color: var(--text);
}
.btn:hover { background: var(--surface-hover); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-danger { background: var(--surface); border-color: var(--danger-soft); color: var(--danger); }
.btn-kecil { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.tombol-tema { padding: 4px 8px; font-size: 14px; line-height: 1.1; min-width: 30px; justify-content: center; }

.grid-proyek { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 14px; }
.kartu {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow-1); position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.kartu:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.kartu.aktif { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring-aktif); }
.kartu-judul { font-weight: 700; font-size: 15px; }
.kartu-pilih {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 700;
  color: inherit; text-align: left; cursor: pointer;
}
.kartu-pilih::after { content: ''; position: absolute; inset: 0; border-radius: 14px; }
.kartu-pilih:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.kartu-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.kartu-total { font-size: 18px; font-weight: 800; color: var(--text-strong); }
.aksi-baris { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; position: relative; z-index: 1; }

.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; margin-bottom: 14px; }
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px; box-shadow: var(--shadow-1);
}
.panel-judul {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px; font-weight: 700; font-size: 13px; margin-bottom: 10px;
}
.kpi-label { font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.kpi-nilai { font-size: 21px; font-weight: 800; color: var(--text-strong); margin: 4px 0 2px; line-height: 1.2; }
.kpi-sub { font-size: 11px; color: var(--muted); }
.kpi-utama { background: var(--navy-900); border-color: var(--navy-900); }
.kpi-utama .kpi-label, .kpi-utama .kpi-sub { color: #cbd5e1; }
.kpi-utama .kpi-nilai { color: #fff; }
.grid-dashboard { display: grid; grid-template-columns: 1.1fr .9fr; gap: 14px; align-items: start; }
.kolom { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bar-komposisi { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-3); margin-bottom: 10px; }
.bar-komposisi span { display: block; height: 100%; }
.legenda { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.legenda-item { display: flex; align-items: center; gap: 8px; }
.legenda-titik { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.legenda-nominal { margin-left: auto; font-weight: 600; }
.pintasan { display: flex; flex-wrap: wrap; gap: 8px; }

.landing { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.landing-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.landing-topbar .brand { padding: 0; }
.landing-topbar .brand-name { color: var(--text-strong); }
.landing-topbar .brand-sub { color: var(--muted); }
.landing-aksi { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.landing-main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 28px 24px 8px; flex: 1; }
.landing-footer { padding: 8px 24px 28px; text-align: center; font-size: 12px; color: var(--muted); }
.hero { padding: 12px 0 4px; }
.hero h1 {
  font-size: 34px; line-height: 1.15; letter-spacing: -.5px;
  margin: 12px 0 10px; color: var(--text-strong); max-width: 720px;
}
.hero p { font-size: 15px; color: var(--muted); max-width: 620px; margin: 0 0 18px; line-height: 1.55; }
.hero-aksi { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-besar { padding: 10px 18px; font-size: 14px; border-radius: 10px; }
.grid-ringkasan { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; margin-top: 24px; }
.kpi-nama { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.landing-bagian { margin-top: 26px; }
.landing-judul { font-size: 16px; font-weight: 800; color: var(--text-strong); margin: 0 0 12px; }
.grid-ringkas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.kartu-ringkas {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  color: inherit; transition: border-color .15s, box-shadow .15s;
}
.kartu-ringkas:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.kartu-ringkas-nama { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; font-weight: 700; }
.kartu-ringkas-total { margin-top: 6px; font-size: 16px; font-weight: 800; color: var(--text-strong); }
.grid-fitur { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.fitur-ikon {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent-tint); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; margin-bottom: 8px;
}
.fitur-nama { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.fitur-teks { font-size: 12px; color: var(--muted); line-height: 1.5; }

.tabel-wadah { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.tabel-scroll { overflow-x: auto; }
table.tabel { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabel thead th {
  background: var(--surface-2); text-align: left; padding: 10px 12px; font-size: 11px;
  text-transform: uppercase; letter-spacing: .4px; color: var(--muted-strong); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
}
.tabel td { padding: 9px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.tabel tbody tr:hover { background: var(--surface-hover-2); }
.angka { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.baris-grup { background: var(--surface-2); font-weight: 700; }
.baris-subtotal { background: var(--accent-tint-soft); font-weight: 700; }
.bar-bobot { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.bar-bobot span { display: block; height: 100%; background: var(--accent); }

.kurva-grid { stroke: var(--chart-grid); }
.kurva-teks { fill: var(--chart-teks); }
.kurva-area { fill: var(--chart-area); }
.kurva-garis { stroke: var(--accent); }

.empty { padding: 40px; text-align: center; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-label); }
.form-grid label.penuh { grid-column: 1 / -1; }
input, select, textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  font: inherit; font-size: 13px; background: var(--surface); color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-ring); border-color: var(--accent); }

.modal-backdrop {
  position: fixed; inset: 0; background: var(--overlay); z-index: 60;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: 16px; width: 620px; max-width: 100%;
  box-shadow: 0 20px 60px rgba(15,36,56,.25);
}
.modal.lebar { width: 1000px; }
.modal.sempit { width: 440px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.modal-body { padding: 18px; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.icon-btn { border: none; background: transparent; font-size: 16px; color: var(--muted); padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--surface-3); }
.bantuan-intro { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.bantuan-langkah { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 8px; font-size: 13px; line-height: 1.5; }
.bantuan-langkah li::marker { color: var(--accent); font-weight: 700; }
.bantuan-langkah strong, .bantuan-tips strong { color: var(--text-strong); font-weight: 600; }
.bantuan-tips {
  border-top: 1px solid var(--border); padding-top: 12px;
  display: grid; gap: 6px; font-size: 12px; line-height: 1.5; color: var(--muted);
}

.toast-host { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast {
  background: var(--toast-bg); color: #fff; padding: 10px 14px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-width: 360px;
}
.toast-sukses { background: var(--toast-sukses); }
.toast-bahaya { background: var(--toast-bahaya); }

@media (max-width: 1100px) {
  .sidebar { width: 68px; flex-basis: 68px; padding: 14px 8px; }
  .brand-name, .brand-sub, .menu-judul, .menu-item span:not(.menu-ikon) { display: none; }
  .menu-item { justify-content: center; }
  .view { padding: 16px; }
  .grid-dashboard { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 14px; }
  .view { padding: 12px 12px 48px; }
  .page-head { flex-wrap: wrap; }
  .kepala-proyek { padding: 14px 14px 0; }
  .landing-topbar { padding: 10px 14px; }
  .landing-main { padding: 18px 14px 4px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 14px; }
}

.paper {
  --navy-900: #0f2438;
  --accent-dark: #ea580c;
  --border: #e5e7eb;
  --chart-grid: #e5e7eb;
  --chart-teks: #6b7280;
  --chart-area: #ffedd5;
  width: 210mm; min-height: 297mm; background: #fff; padding: 12mm;
  box-shadow: 0 8px 30px rgba(15,36,56,.12); margin: 0 auto;
  font-size: 10.5px; color: #111; position: relative; line-height: 1.45;
}
.doc-kop { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--navy-900); padding-bottom: 8px; }
.doc-brand { display: flex; gap: 8px; align-items: center; }
.doc-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 11px; }
.doc-brand-sub { font-size: 7px; letter-spacing: 1px; color: #6b7280; }
.doc-kop-kanan { text-align: right; font-size: 9px; color: #374151; }
.doc-judul { font-size: 16px; margin: 14px 0 2px; letter-spacing: .5px; }
.doc-sub { margin: 0 0 12px; color: #6b7280; font-size: 9.5px; }
.doc-body { display: block; }
.blok { break-inside: avoid; margin-bottom: 8px; }
.tabel-laporan { width: 100%; border-collapse: collapse; font-size: 9.5px; margin-top: 6px; }
.tabel-laporan th, .tabel-laporan td { border: 1px solid #d1d5db; padding: 4px 6px; vertical-align: top; }
.tabel-laporan thead th { background: #0f2438; color: #fff; text-align: left; font-weight: 600; }
.tabel-laporan .num { text-align: right; font-variant-numeric: tabular-nums; }
.tabel-laporan .tebal { font-weight: 700; }
.tabel-laporan .baris-grup td { background: #e8eef4; font-weight: 700; }
.tabel-laporan .baris-sub td { background: #f3f6f9; font-weight: 600; }
.tabel-laporan .baris-total td, .tabel-laporan .baris-total th { background: #ffedd5; font-weight: 800; }
.tabel-identitas th { width: 34%; background: #f3f6f9; text-align: left; }
.tabel-rekap { width: 55%; margin-left: auto; }
.terbilang { background: #f8fafc; border-left: 3px solid var(--accent); padding: 6px 8px; font-size: 9.5px; }
.cover-judul { text-align: center; margin: 12px 0 10px; }
.cover-label { font-size: 9px; letter-spacing: 2px; color: var(--accent-dark); font-weight: 700; }
.cover-judul h1 { font-size: 24px; margin: 6px 0; }
.cover-jenis { color: #6b7280; font-size: 11px; }
.cover-foto { width: 100%; max-height: 92mm; object-fit: cover; border-radius: 6px; display: block; }
.cover-kosong { height: 60mm; display: grid; place-items: center; background: #f3f4f6; color: #9ca3af; }
.cover-kaki { text-align: center; margin-top: 12px; font-size: 9px; color: #6b7280; }
.paper .baris-grup, .paper .baris-sub, .paper .baris-total { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.print-host { display: none; }
.probe-halaman {
  position: fixed; left: -10000px; top: 0; visibility: hidden;
  box-sizing: border-box; padding-bottom: 1px; font-size: 10.5px; line-height: 1.45;
}
.doc-foot {
  position: absolute; left: 12mm; right: 12mm; bottom: 6mm;
  border-top: 1px solid var(--border); padding-top: 4px;
  font-size: 8px; color: #6b7280; text-align: right;
}
