/* ==========================================================================
   SIRAGA — Sistem Informasi Realisasi Anggaran
   Gaya antarmuka utama
   ========================================================================== */

:root {
  --navy-950: #05111f;
  --navy-900: #0a203d;
  --navy-800: #10325a;
  --navy-700: #17416f;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-100: #ccfbf1;
  --gold-600: #8a6508;
  --gold-500: #d9a521;
  --gold-300: #f3d48a;
  --gold-100: #fdf4da;
  --bg: #f1f4f9;
  --bg-deep: #e8edf5;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f8;
  --text: #0f1f33;
  --text-soft: #33445c;
  --muted: #5c6c82;
  --muted-2: #5f7088;
  --line: #e1e7f0;
  --line-strong: #cfd8e6;
  --danger: #c62f3a;
  --danger-2: #a7212c;
  --danger-bg: #fdf0f1;
  --success: #157347;
  --success-bg: #eaf7ef;
  --warning: #a16207;
  --warning-bg: #fdf6e3;
  --info: #1d4ed8;
  --info-bg: #eef4ff;
  --purple: #6d28d9;
  --purple-bg: #f3efff;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-xs: 0 1px 2px rgba(15, 31, 51, .05);
  --shadow-sm: 0 2px 10px rgba(15, 31, 51, .06);
  --shadow: 0 14px 36px rgba(15, 31, 51, .09);
  --shadow-lg: 0 24px 70px rgba(5, 17, 31, .28);
  --sidebar-w: 268px;
  --font: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--teal-700); text-decoration: none; }
a:hover { color: var(--teal-600); }
img, svg { vertical-align: middle; }
::selection { background: var(--teal-100); color: var(--navy-900); }

:focus-visible {
  outline: 3px solid rgba(13, 148, 136, .35);
  outline-offset: 2px;
  border-radius: 6px;
}

.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.tnum { font-variant-numeric: tabular-nums; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-2 { margin-bottom: 16px !important; }
.w-full { width: 100% !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

/* --------------------------------------------------------------------------
   Tombol
   -------------------------------------------------------------------------- */

.btn {
  --btn-bg: var(--surface);
  --btn-color: var(--text-soft);
  --btn-border: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 16px;
  border: 1px solid var(--btn-border); border-radius: 11px;
  background: var(--btn-bg); color: var(--btn-color);
  font-weight: 600; font-size: 13.5px; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, color .18s ease,
              transform .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); color: var(--btn-color); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .icon { width: 18px; height: 18px; }

.btn-primary {
  --btn-bg: linear-gradient(135deg, var(--navy-800), var(--navy-900));
  --btn-color: #fff;
  --btn-border: transparent;
  box-shadow: 0 6px 18px rgba(10, 32, 61, .22);
}
.btn-primary:hover { --btn-bg: linear-gradient(135deg, var(--navy-700), var(--navy-800)); }

.btn-accent {
  --btn-bg: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  --btn-color: #33240a;
  --btn-border: transparent;
  box-shadow: 0 6px 18px rgba(184, 134, 11, .25);
}
.btn-accent:hover { --btn-bg: linear-gradient(135deg, #e5b234, #c49112); }

.btn-soft { --btn-bg: var(--surface); }
.btn-soft:hover { --btn-bg: var(--surface-2); }

.btn-ghost {
  --btn-bg: transparent;
  --btn-border: transparent;
  --btn-color: var(--text-soft);
}
.btn-ghost:hover { --btn-bg: var(--surface-3); box-shadow: none; }

.btn-danger { --btn-bg: var(--danger); --btn-color: #fff; --btn-border: transparent; }
.btn-danger:hover { --btn-bg: var(--danger-2); }

.btn-sm { min-height: 34px; padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-icon { min-height: 34px; width: 34px; padding: 0; border-radius: 9px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border: 1px solid var(--line-strong);
  border-radius: 11px; background: var(--surface); color: var(--text-soft);
}
.icon-btn:hover { background: var(--surface-2); }

/* --------------------------------------------------------------------------
   Kerangka aplikasi
   -------------------------------------------------------------------------- */

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  padding: 22px 16px 18px;
  color: #dfe8f5;
  background:
    radial-gradient(circle at 18% 0%, rgba(20, 184, 166, .22), transparent 46%),
    radial-gradient(circle at 100% 78%, rgba(217, 165, 33, .14), transparent 42%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  border-right: 1px solid rgba(255, 255, 255, .06);
}

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 8px 20px;
  color: #fff;
}
.brand:hover { color: #fff; }
.brand-logo { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .3)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 20px; letter-spacing: .14em; font-weight: 700; }
.brand-text small { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: #9db2cc; margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; padding-bottom: 10px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 999px; }

.nav-label {
  padding: 16px 12px 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: #7f96b3;
}

.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 11px;
  color: #c3d3e7; font-size: 13.5px; font-weight: 500;
  transition: background .16s ease, color .16s ease;
}
.nav-link .icon { color: #8fa8c4; transition: color .16s ease; }
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-link:hover .icon { color: #d7e6f7; }
.nav-link.is-active {
  background: linear-gradient(90deg, rgba(20, 184, 166, .28), rgba(20, 184, 166, .07));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, .32);
}
.nav-link.is-active .icon { color: var(--teal-500); }
.nav-link.is-active::before {
  content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 4px 4px 0; background: var(--gold-500);
}

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .09); }
.agency-mini { display: flex; align-items: center; gap: 10px; padding: 6px 6px 10px; }
.agency-mini-icon {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border-radius: 10px; background: rgba(255, 255, 255, .08); color: var(--gold-300);
}
.agency-mini strong { display: block; font-size: 12px; color: #e7eef8; }
.agency-mini small { display: block; font-size: 10px; color: #90a6c1; }
.version { font-size: 10px; color: #7388a3; padding: 0 6px; }

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.page-heading { min-width: 0; }
.page-heading h1 {
  font-size: 20px; font-weight: 700; letter-spacing: -.01em;
  color: var(--navy-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.page-heading p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.year-picker {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--surface);
}
.year-picker-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  padding-right: 4px; border-right: 1px solid var(--line);
}
.year-picker-label .icon { width: 15px; height: 15px; }
.year-picker select {
  border: 0; background: transparent; font-weight: 700; font-size: 13px;
  color: var(--navy-800); padding: 2px 4px; outline: none;
}

.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 10px 5px 5px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.user-chip:hover { border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.avatar {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border-radius: 50%; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--teal-600), var(--navy-800));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.user-chip-text { display: flex; flex-direction: column; line-height: 1.15; max-width: 150px; }
.user-chip-text strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-text small { font-size: 10.5px; color: var(--muted); }
.user-chip > .icon { color: var(--muted-2); }

.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px;
  padding: 8px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.user-dropdown-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-dropdown-head strong { display: block; font-size: 13px; }
.user-dropdown-head small { font-size: 11.5px; color: var(--muted); }
.user-dropdown a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px;
  font-size: 13px; color: var(--text-soft);
}
.user-dropdown a:hover { background: var(--surface-3); }
.user-dropdown a .icon { width: 17px; height: 17px; }
.user-dropdown a.is-danger { color: var(--danger); }
.user-dropdown a.is-danger:hover { background: var(--danger-bg); }

.content { flex: 1; padding: 24px 28px 32px; max-width: 1500px; width: 100%; }

.site-foot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 28px 22px; font-size: 11.5px; color: var(--muted-2);
  border-top: 1px solid var(--line);
}

.menu-toggle { display: none; }
.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 35;
  background: rgba(5, 17, 31, .55); backdrop-filter: blur(2px);
}

/* --------------------------------------------------------------------------
   Halaman & panel
   -------------------------------------------------------------------------- */

.page-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-actions .spacer { flex: 1; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.card-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 15px; font-weight: 700; color: var(--navy-900); }
.card-head p { font-size: 12px; color: var(--muted); }
.card-head .spacer { flex: 1; }
.card-body { padding: 20px; }
.card-body.is-flush { padding: 0; }
.card-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius);
}

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.grid-even { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  margin: 26px 0 12px;
}
.section-title:first-child { margin-top: 0; }

/* KPI */
.kpi { position: relative; overflow: hidden; padding: 18px 20px; }
.kpi::after {
  content: ""; position: absolute; right: -36px; top: -46px;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 184, 166, .09), transparent 68%);
}
.kpi-top { display: flex; align-items: flex-start; gap: 12px; }
.kpi-icon {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none;
  border-radius: 12px; background: var(--surface-3); color: var(--navy-700);
}
.kpi-icon .icon { width: 21px; height: 21px; }
.kpi-label { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.kpi-value {
  font-size: 23px; font-weight: 750; letter-spacing: -.015em; color: var(--navy-900);
  font-variant-numeric: tabular-nums; line-height: 1.25; margin-top: 3px;
}
.kpi-sub { font-size: 11.5px; color: var(--muted); margin-top: 10px; display: flex; align-items: center; gap: 6px; }
.kpi-sub .icon { width: 14px; height: 14px; }

.kpi.is-teal .kpi-icon { background: var(--teal-100); color: var(--teal-700); }
.kpi.is-gold .kpi-icon { background: var(--gold-100); color: var(--gold-600); }
.kpi.is-danger .kpi-icon { background: var(--danger-bg); color: var(--danger); }
.kpi.is-purple .kpi-icon { background: var(--purple-bg); color: var(--purple); }
.kpi.is-info .kpi-icon { background: var(--info-bg); color: var(--info); }

.kpi.is-hero {
  color: #eaf2fb;
  background:
    radial-gradient(circle at 90% 0%, rgba(20, 184, 166, .3), transparent 55%),
    linear-gradient(135deg, var(--navy-800), var(--navy-950));
  border-color: transparent;
}
.kpi.is-hero .kpi-label { color: #9fb6d2; }
.kpi.is-hero .kpi-value { color: #fff; font-size: 25px; }
.kpi.is-hero .kpi-sub { color: #b6c9e0; }
.kpi.is-hero .kpi-icon { background: rgba(255, 255, 255, .1); color: var(--gold-300); }
.kpi.is-hero::after { background: radial-gradient(circle, rgba(217, 165, 33, .18), transparent 65%); }

/* Badge & chip */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
  background: var(--surface-3); color: var(--text-soft);
}
.badge .icon { width: 12px; height: 12px; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-gold { background: var(--gold-100); color: var(--gold-600); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

/* Progress */
.progress {
  position: relative; height: 8px; border-radius: 999px;
  background: var(--surface-3); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: inherit; min-width: 2px;
  background: linear-gradient(90deg, var(--teal-600), var(--teal-500));
  transition: width .5s ease;
}
.progress.is-success .progress-fill { background: linear-gradient(90deg, #0f766e, #14b8a6); }
.progress.is-warning .progress-fill { background: linear-gradient(90deg, #b45309, #eab308); }
.progress.is-danger .progress-fill { background: linear-gradient(90deg, #b91c1c, #ef4444); }
.progress-lg { height: 11px; }

.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .progress { flex: 1; }
.progress-val { font-size: 11.5px; font-weight: 700; color: var(--text-soft); min-width: 46px; text-align: right; }

/* Peringatan */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; margin-bottom: 16px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13px;
}
.alert .icon { width: 18px; height: 18px; margin-top: 1px; }
.alert span { flex: 1; }
.alert-close {
  border: 0; background: transparent; font-size: 18px; line-height: 1;
  color: inherit; opacity: .55; padding: 0 2px;
}
.alert-close:hover { opacity: 1; }
.alert-success { background: var(--success-bg); border-color: #c6ebd4; color: #0f5c39; }
.alert-danger { background: var(--danger-bg); border-color: #f3ccd0; color: #8e1f28; }
.alert-warning { background: var(--warning-bg); border-color: #f0e2b8; color: #7a4b06; }
.alert-info { background: var(--info-bg); border-color: #cfdffb; color: #1a3f8f; }

/* --------------------------------------------------------------------------
   Formulir
   -------------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label {
  font-size: 12px; font-weight: 600; color: var(--text-soft);
}
.field .hint { font-size: 11.5px; color: var(--muted); }
.field .req { color: var(--danger); }

.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font-size: 13.5px; transition: border-color .16s ease, box-shadow .16s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .14);
}
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--muted); }
.textarea { min-height: 92px; resize: vertical; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23697a91' stroke-width='1.7' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 34px;
}
.input-affix { position: relative; }
.input-affix .affix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 12.5px; font-weight: 700; color: var(--muted);
}
.input-affix .input { padding-left: 40px; font-variant-numeric: tabular-nums; font-weight: 600; }
.input-affix input[type="password"] { padding-right: 42px; }
.input-affix .affix-right {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 11.5px; color: var(--muted);
}

.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-full { grid-column: 1 / -1; }
.form-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line);
}
.form-actions .spacer { flex: 1; }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--teal-600); }

.toolbar {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.toolbar .field { min-width: 150px; }
.toolbar .field.is-search { flex: 1; min-width: 220px; }
.toolbar .spacer { flex: 1; }

.search-box { position: relative; }
.search-box .icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--muted-2);
}
.search-box .input { padding-left: 38px; }

/* --------------------------------------------------------------------------
   Tabel
   -------------------------------------------------------------------------- */

.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  padding: 11px 14px; text-align: left; white-space: nowrap;
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcff; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .strong { font-weight: 650; color: var(--navy-900); }
.table .sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; }
.table.is-compact td, .table.is-compact th { padding: 8px 11px; }
.table tfoot td {
  padding: 12px 14px; font-weight: 700; background: var(--surface-2);
  border-top: 1px solid var(--line-strong); color: var(--navy-900);
}

.table-wrap.has-scroll { max-height: 560px; overflow: auto; }
.table-wrap.has-scroll thead th { position: sticky; top: 0; z-index: 2; }

.kode {
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 11px; color: var(--muted); letter-spacing: -.02em;
}

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 48px 20px; text-align: center; color: var(--muted);
}
.empty .icon { width: 40px; height: 40px; color: var(--line-strong); }
.empty strong { font-size: 14px; color: var(--text-soft); }
.empty p { font-size: 12.5px; }

/* Paginasi */
.pagination {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px solid var(--line);
}
.pagination .info { flex: 1; font-size: 12px; color: var(--muted); }
.page-link {
  display: inline-grid; place-items: center; min-width: 34px; height: 34px;
  padding: 0 9px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-soft); font-size: 12.5px; font-weight: 600;
}
.page-link:hover { background: var(--surface-2); color: var(--text); }
.page-link.is-active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.page-link.is-disabled { opacity: .45; pointer-events: none; }
.page-link .icon { width: 15px; height: 15px; }

/* --------------------------------------------------------------------------
   Grafik
   -------------------------------------------------------------------------- */

.chart-bars {
  display: flex; align-items: flex-end; gap: 8px;
  height: 210px; padding: 8px 2px 0;
}
.bar-col { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; height: 100%; }
.bar-track {
  flex: 1; display: flex; align-items: flex-end;
  background: var(--surface-3); border-radius: 7px; overflow: hidden;
}
.bar-fill {
  width: 100%; border-radius: 7px 7px 0 0; min-height: 3px;
  background: linear-gradient(180deg, var(--teal-500), var(--teal-700));
  transition: height .5s ease;
}
.bar-col.is-gold .bar-fill { background: linear-gradient(180deg, var(--gold-300), var(--gold-600)); }
.bar-col:hover .bar-fill { filter: brightness(1.06); }
.bar-label {
  font-size: 10px; color: var(--muted); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-legend {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; font-size: 11.5px; color: var(--muted); margin-top: 12px;
}
.chart-note { font-size: 11px; color: var(--muted-2); }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut {
  position: relative; width: 148px; height: 148px; flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--teal-600) 0 40%, var(--gold-500) 40% 70%, var(--navy-800) 70% 100%);
}
.donut::before {
  content: ""; position: absolute; inset: 17px; border-radius: 50%;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 1px;
}
.donut-center strong { font-size: 19px; font-weight: 750; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.donut-center small { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.legend { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 160px; }
.legend-item { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.legend-item .dot { width: 9px; height: 9px; }
.legend-item .legend-name { flex: 1; color: var(--text-soft); }
.legend-item .legend-val { font-weight: 700; color: var(--navy-900); font-variant-numeric: tabular-nums; }

.stat-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.stat-line:last-child { border-bottom: 0; }
.stat-line span { font-size: 12.5px; color: var(--muted); }
.stat-line strong { font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Tab, dialog, lain-lain
   -------------------------------------------------------------------------- */

.tabs { display: flex; gap: 6px; padding: 5px; background: var(--surface-3); border-radius: 12px; flex-wrap: wrap; }
.tab {
  padding: 8px 15px; border-radius: 9px; font-size: 13px; font-weight: 600;
  color: var(--muted); border: 1px solid transparent;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface); color: var(--navy-900); box-shadow: var(--shadow-xs); border-color: var(--line); }

dialog.dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.dialog::backdrop { background: rgba(5, 17, 31, .55); backdrop-filter: blur(3px); }
.dialog-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.dialog-head h2 { font-size: 16px; font-weight: 700; color: var(--navy-900); }
.dialog-head .close {
  margin-left: auto; border: 0; background: transparent; font-size: 22px;
  line-height: 1; color: var(--muted); padding: 2px 6px; border-radius: 8px;
}
.dialog-head .close:hover { background: var(--surface-3); color: var(--text); }
.dialog-body { padding: 22px; }
.dialog-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 22px; border-top: 1px solid var(--line); background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.note-box {
  display: flex; gap: 10px; padding: 13px 15px;
  border-radius: 11px; background: var(--surface-2);
  border: 1px dashed var(--line-strong); font-size: 12.5px; color: var(--text-soft);
}
.note-box .icon { width: 18px; height: 18px; color: var(--teal-700); margin-top: 1px; }

/* Komponen perjalanan dinas */
.perjalanan-box {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); padding: 16px;
}
.perjalanan-head { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.perjalanan-head strong { display: block; font-size: 13px; color: var(--navy-900); }
.perjalanan-head .sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.perjalanan-total { text-align: right; }
.perjalanan-total span { display: block; font-size: 11px; }
.perjalanan-total strong {
  font-size: 16px; color: var(--teal-700); font-variant-numeric: tabular-nums;
}
.input[readonly] { background: var(--surface-2); color: var(--text-soft); }

.kv { display: flex; flex-direction: column; gap: 2px; }
.kv strong { font-size: 13px; color: var(--navy-900); }
.kv small { font-size: 11.5px; color: var(--muted); }

.sep { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* --------------------------------------------------------------------------
   Halaman masuk
   -------------------------------------------------------------------------- */

.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, rgba(20, 184, 166, .16), transparent 40%),
    linear-gradient(135deg, var(--navy-950), #0d2a4c 58%, #0a203d);
  display: grid; place-items: center; padding: 28px;
}
.auth-shell {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  width: min(1040px, 100%); min-height: 610px;
  border-radius: 26px; overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .1);
  background: var(--surface);
}
.auth-brandside {
  position: relative; overflow: hidden;
  padding: 42px 44px; color: #e9f1fb;
  background:
    radial-gradient(circle at 88% 8%, rgba(217, 165, 33, .22), transparent 42%),
    radial-gradient(circle at 4% 92%, rgba(20, 184, 166, .3), transparent 46%),
    linear-gradient(155deg, #0d2c51, var(--navy-950));
  display: flex; flex-direction: column;
}
.auth-brandside::after {
  content: ""; position: absolute; right: -120px; bottom: -140px;
  width: 380px; height: 380px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 0 0 42px rgba(255, 255, 255, .03), 0 0 0 84px rgba(255, 255, 255, .02);
}
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-brand img { width: 58px; height: 58px; object-fit: contain; }
.auth-brand strong { display: block; font-size: 25px; letter-spacing: .14em; }
.auth-brand small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #a9bed6; }
.auth-hero { margin-top: auto; position: relative; z-index: 1; }
.auth-hero h1 { font-size: 30px; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; }
.auth-hero h1 .accent { color: var(--gold-300); }
.auth-hero p { margin-top: 12px; font-size: 13.5px; color: #b3c7de; max-width: 38ch; line-height: 1.65; }
.auth-points { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.auth-point { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #cfdcec; }
.auth-point span.i {
  display: grid; place-items: center; width: 27px; height: 27px; flex: none;
  border-radius: 8px; background: rgba(20, 184, 166, .16); color: var(--teal-500);
}
.auth-point .icon { width: 14px; height: 14px; }
.auth-agency {
  margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: 11.5px; color: #93a9c4;
}
.auth-agency strong { display: block; color: #dce8f6; font-size: 12.5px; margin-bottom: 2px; }

.auth-formside { display: flex; flex-direction: column; justify-content: center; padding: 44px 42px; }
.auth-formside h2 { font-size: 22px; font-weight: 700; color: var(--navy-900); letter-spacing: -.01em; }
.auth-formside > p { font-size: 12.5px; color: var(--muted); margin-top: 4px; margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .btn { margin-top: 4px; min-height: 46px; }
.auth-foot { margin-top: 22px; font-size: 11px; color: var(--muted-2); line-height: 1.65; }
.auth-error { display: flex; gap: 9px; padding: 11px 13px; border-radius: 10px; background: var(--danger-bg); color: #8e1f28; font-size: 12.5px; border: 1px solid #f3ccd0; }
.auth-error .icon { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--muted); padding: 6px; border-radius: 8px;
  display: grid; place-items: center;
}
.pw-toggle:hover { background: var(--surface-3); color: var(--text-soft); }

/* --------------------------------------------------------------------------
   Halaman galat & pemasangan
   -------------------------------------------------------------------------- */

.error-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.error-card {
  max-width: 460px; text-align: center; padding: 40px 34px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.error-icon {
  display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 16px;
  border-radius: 18px; background: var(--danger-bg); color: var(--danger);
}
.error-icon .icon { width: 30px; height: 30px; }
.error-card h1 { font-size: 20px; color: var(--navy-900); }
.error-card p { font-size: 13px; color: var(--muted); margin: 8px 0 22px; }

.install-body { min-height: 100vh; padding: 36px 18px; background: var(--bg); }
.install-wrap { width: min(820px, 100%); margin: 0 auto; }
.install-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.install-head img { width: 54px; height: 54px; }
.install-head h1 { font-size: 21px; color: var(--navy-900); }
.install-head p { font-size: 12.5px; color: var(--muted); }
.install-step { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.install-step:last-child { border-bottom: 0; }
.install-step .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.install-step.ok { color: var(--success); }
.install-step.err { color: var(--danger); }
.install-step code { font-size: 11.5px; color: var(--muted); }
.install-code {
  display: block; padding: 12px 14px; border-radius: 10px; background: var(--navy-950);
  color: #d6e4f4; font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px; overflow: auto;
}

/* --------------------------------------------------------------------------
   Responsif
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .24s ease; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 12px 18px; }
  .content { padding: 20px 18px 28px; }
  .site-foot { padding: 16px 18px 22px; }
  .auth-shell { grid-template-columns: 1fr; max-width: 480px; min-height: 0; }
  .auth-brandside { padding: 28px 30px; }
  .auth-hero { margin-top: 22px; }
  .auth-hero h1 { font-size: 22px; }
  .auth-hero p, .auth-points, .auth-agency { display: none; }
  .auth-formside { padding: 30px; }
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .page-heading { order: 3; width: 100%; }
  .page-heading h1 { font-size: 18px; white-space: normal; }
  .topbar-actions { margin-left: auto; }
  .year-picker-label { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .user-chip-text { display: none; }
  .card-body { padding: 16px; }
  .toolbar { padding: 14px 16px; }
  .toolbar .field.is-search { min-width: 100%; }
  .kpi-value { font-size: 20px; }
  .chart-bars { height: 170px; gap: 5px; }
  .donut-wrap { justify-content: center; }
  .auth-body { padding: 14px; }
  .auth-formside { padding: 24px 22px; }
  .auth-brandside { padding: 22px; }
}

/* --------------------------------------------------------------------------
   Cetak
   -------------------------------------------------------------------------- */

@media print {
  @page { size: A4 landscape; margin: 12mm 10mm; }
  body { background: #fff; font-size: 11px; }
  .sidebar, .topbar, .site-foot, .page-actions, .toolbar, .pagination,
  .no-print, .alert, .btn { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; max-width: none; }
  .card { border: 1px solid #b9c3d2; box-shadow: none; border-radius: 0; break-inside: avoid; }
  .card-head { padding: 10px 12px; }
  .card-body { padding: 12px; }
  .table th, .table td { padding: 6px 8px; font-size: 10px; }
  .table-wrap { overflow: visible !important; max-height: none !important; }
  .grid { display: block; }
  .grid > * { margin-bottom: 10px; }
  .kpi { padding: 10px; }
  .print-head { display: block !important; }
  .badge { border: 1px solid #cbd5e1; }
  a { color: inherit; }
}

.print-head { display: none; }
