:root {
  --navy-900: #081f35;
  --navy-800: #0b2a47;
  --navy-700: #11395e;
  --navy-600: #174b79;
  --teal-700: #0b6b62;
  --teal-600: #0f7f73;
  --teal-500: #149b8b;
  --teal-50: #e9f7f4;
  --gold-500: #c48a2c;
  --gold-50: #fdf6e8;
  --red-600: #b42318;
  --red-50: #fef3f2;
  --green-700: #067647;
  --green-50: #ecfdf3;
  --blue-700: #175cd3;
  --blue-50: #eff8ff;
  --amber-700: #b54708;
  --amber-50: #fffaeb;
  --slate-900: #101828;
  --slate-700: #344054;
  --slate-600: #475467;
  --slate-500: #667085;
  --slate-400: #98a2b3;
  --slate-300: #d0d5dd;
  --slate-200: #e4e7ec;
  --slate-100: #f2f4f7;
  --slate-50: #f9fafb;
  --bg: #f4f7fa;
  --card: #ffffff;
  --line: #e3e8ef;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.07);
  --shadow-lg: 0 24px 60px rgba(8, 31, 53, 0.18);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar: 264px;
  --font: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--slate-900);
  background: var(--bg);
  font-size: 14.5px;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--teal-700); }
h1, h2, h3, h4, p { margin: 0; }
svg { flex: none; }

.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;
}

/* ---------------- Login ---------------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 46%) 1fr;
  background: var(--bg);
}
.auth-brand {
  position: relative;
  overflow: hidden;
  padding: 56px 56px 48px;
  color: #fff;
  background:
    radial-gradient(1000px 500px at 110% 10%, rgba(20, 155, 139, 0.32), transparent 60%),
    radial-gradient(700px 400px at -10% 100%, rgba(196, 138, 44, 0.18), transparent 55%),
    linear-gradient(145deg, var(--navy-900) 0%, var(--navy-800) 55%, #0d3355 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent 85%);
  pointer-events: none;
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-logo { display: flex; align-items: center; gap: 14px; }
.auth-logo .logo-mark { width: 48px; height: 48px; }
.auth-logo strong { display: block; letter-spacing: 0.18em; font-size: 13px; font-weight: 700; color: #b9e8e1; }
.auth-logo span { display: block; font-size: 13px; color: rgba(255,255,255,0.62); margin-top: 2px; }
.auth-copy { max-width: 470px; margin: 48px 0; }
.auth-copy .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; letter-spacing: 0.16em; font-weight: 700;
  color: #a9ded6; text-transform: uppercase; margin-bottom: 18px;
}
.auth-copy .eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--teal-500); }
.auth-copy h1 { font-size: clamp(30px, 3.1vw, 44px); line-height: 1.12; letter-spacing: -0.025em; font-weight: 700; }
.auth-copy h1 em { color: #7fd8cc; font-style: normal; }
.auth-copy p { margin-top: 18px; color: rgba(255,255,255,0.72); font-size: 15px; max-width: 420px; }
.auth-points { display: grid; gap: 13px; margin-top: 30px; }
.auth-points div { display: flex; gap: 12px; align-items: flex-start; color: rgba(255,255,255,0.83); font-size: 13.5px; }
.auth-points .dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(20,155,139,0.22); border: 1px solid rgba(127,216,204,0.4);
  display: grid; place-items: center; color: #9ee8dd; font-size: 12px; flex: none; margin-top: 1px;
}
.auth-foot { font-size: 11.5px; letter-spacing: 0.04em; color: rgba(255,255,255,0.42); }
.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 28px; position: relative;
}
.auth-card { width: min(410px, 100%); }
.auth-card .mini-brand { display: none; }
.auth-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal-700); }
.auth-card h2 { font-size: 27px; letter-spacing: -0.02em; margin-top: 8px; }
.auth-card .sub { color: var(--slate-500); margin-top: 6px; font-size: 14px; }
.form-stack { display: grid; gap: 17px; margin-top: 30px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--slate-700); margin-bottom: 7px; }
.field .hint { font-weight: 400; color: var(--slate-400); font-size: 12px; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--slate-300); background: #fff;
  border-radius: 10px; padding: 10.5px 13px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20,155,139,0.14);
}
.input:disabled, .select:disabled, .textarea:disabled { background: var(--slate-50); color: var(--slate-500); }
.textarea { min-height: 102px; resize: vertical; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--slate-400);
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px;
}
.password-toggle:hover { background: var(--slate-100); color: var(--slate-700); }
.auth-submit { width: 100%; justify-content: center; padding: 12px 16px; font-size: 15px; }
.auth-note { margin-top: 26px; font-size: 11.5px; color: var(--slate-400); text-align: center; }
.form-alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px;
  border-radius: 10px; font-size: 13px; background: var(--red-50);
  border: 1px solid #fecdca; color: var(--red-600);
}
.form-alert[hidden] { display: none; }

/* ---------------- App shell ---------------- */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  background:
    radial-gradient(700px 300px at 110% 0%, rgba(20,155,139,0.2), transparent 60%),
    linear-gradient(180deg, var(--navy-900), #0a2741 70%, #0a233a);
  color: #fff; display: flex; flex-direction: column;
  transition: transform 0.22s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 20px; }
.brand .logo-mark { width: 38px; height: 38px; }
.brand-text strong { display: block; font-size: 15px; letter-spacing: 0.13em; }
.brand-text span { display: block; font-size: 10.5px; color: rgba(255,255,255,0.5); margin-top: 2px; letter-spacing: 0.02em; }
.side-divider { height: 1px; background: rgba(255,255,255,0.09); margin: 2px 20px 18px; }
.nav-label { padding: 0 22px 8px; font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(255,255,255,0.36); font-weight: 700; }
.nav { display: grid; gap: 4px; padding: 0 12px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10.5px 12px;
  border-radius: 9px; color: rgba(255,255,255,0.7); text-decoration: none;
  font-size: 13.5px; font-weight: 500; transition: background 0.15s, color 0.15s;
  position: relative;
}
.nav-item svg { color: rgba(255,255,255,0.48); transition: color 0.15s; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(20,155,139,0.19); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--teal-500);
}
.nav-item.active svg { color: #7fd8cc; }
.sidebar-foot { margin-top: auto; padding: 18px 20px 22px; }
.period-mini {
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.045);
  border-radius: 10px; padding: 11px 12px;
}
.period-mini .lbl { font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.4); font-weight: 700; }
.period-mini .val { font-size: 12px; color: rgba(255,255,255,0.86); margin-top: 4px; line-height: 1.35; }
.sidebar-version { margin-top: 14px; font-size: 10.5px; color: rgba(255,255,255,0.3); display: flex; justify-content: space-between; }

.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 68px;
  display: flex; align-items: center; gap: 16px; padding: 0 28px;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.topbar-title { min-width: 0; }
.topbar-title h2 { font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; }
.topbar-title p { font-size: 11.5px; color: var(--slate-400); margin-top: 1px; }
.topbar-spacer { flex: 1; }
.topbar-period {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
  background: var(--teal-50); border: 1px solid #c9ebe5; color: var(--teal-700);
  padding: 6px 11px; border-radius: 999px; white-space: nowrap; max-width: 300px;
}
.topbar-period .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal-500); flex: none; }
.topbar-period.closed { background: var(--slate-100); border-color: var(--slate-200); color: var(--slate-600); }
.topbar-period.closed .dot { background: var(--slate-400); }
.topbar-period span { overflow: hidden; text-overflow: ellipsis; }
.user-menu-wrap { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px;
  border: 1px solid transparent; background: transparent; border-radius: 999px;
}
.user-btn:hover { background: var(--slate-50); border-color: var(--slate-200); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--navy-700), var(--teal-700));
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; flex: none;
}
.user-meta { text-align: left; line-height: 1.25; }
.user-meta strong { display: block; font-size: 12.5px; font-weight: 600; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { display: block; font-size: 10.5px; color: var(--slate-400); text-transform: uppercase; letter-spacing: 0.06em; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); width: 220px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-md); padding: 6px; z-index: 50;
}
.user-dropdown[hidden] { display: none; }
.dropdown-info { padding: 10px 11px 11px; border-bottom: 1px solid var(--slate-100); margin-bottom: 5px; }
.dropdown-info strong { display: block; font-size: 13px; }
.dropdown-info span { display: block; font-size: 11.5px; color: var(--slate-400); margin-top: 2px; }
.dropdown-item {
  width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent;
  padding: 9px 10px; border-radius: 7px; font-size: 13px; text-align: left; color: var(--slate-700);
}
.dropdown-item:hover { background: var(--slate-50); }
.dropdown-item.danger { color: var(--red-600); }
.dropdown-item.danger:hover { background: var(--red-50); }

.page { padding: 28px 32px 56px; max-width: 1420px; width: 100%; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .grow { flex: 1; min-width: 240px; }
.page-kicker { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--teal-700); margin-bottom: 7px; }
.page-kicker::before { content: ""; width: 20px; height: 2px; background: var(--teal-500); border-radius: 2px; }
.page-head h1 { font-size: 25px; line-height: 1.2; letter-spacing: -0.025em; font-weight: 700; }
.page-head .desc { color: var(--slate-500); font-size: 13.5px; margin-top: 6px; max-width: 720px; }
.page-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; padding-top: 4px; }

/* ---------------- Buttons & badges ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 9px; padding: 9px 14px;
  font-size: 13px; font-weight: 600; text-decoration: none; line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--teal-700); color: #fff; box-shadow: 0 1px 2px rgba(11,107,98,0.25); }
.btn-primary:hover { background: var(--teal-600); }
.btn-navy { background: var(--navy-800); color: #fff; }
.btn-navy:hover { background: var(--navy-700); }
.btn-secondary { background: #fff; color: var(--slate-700); border-color: var(--slate-300); }
.btn-secondary:hover { background: var(--slate-50); border-color: var(--slate-400); }
.btn-ghost { background: transparent; color: var(--slate-600); }
.btn-ghost:hover { background: var(--slate-100); }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover { background: #921d14; }
.btn-danger-ghost { background: #fff; color: var(--red-600); border-color: #fecdca; }
.btn-danger-ghost:hover { background: var(--red-50); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 7px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.is-loading { pointer-events: none; opacity: 0.75; }
.btn.is-loading .btn-label { visibility: hidden; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 15px; height: 15px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn { position: relative; }
@keyframes spin { to { transform: rotate(360deg); } }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.45; white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.badge-draft { background: var(--slate-100); color: var(--slate-600); }
.badge-diajukan { background: var(--blue-50); color: var(--blue-700); }
.badge-disetujui { background: var(--green-50); color: var(--green-700); }
.badge-ditolak { background: var(--red-50); color: var(--red-600); }
.badge-dibuka { background: var(--green-50); color: var(--green-700); }
.badge-ditutup { background: var(--slate-100); color: var(--slate-600); }
.badge-teal { background: var(--teal-50); color: var(--teal-700); }
.badge-amber { background: var(--amber-50); color: var(--amber-700); }
.badge-red { background: var(--red-50); color: var(--red-600); }

/* ---------------- Cards, stats ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--slate-100); }
.card-head h3 { font-size: 14.5px; font-weight: 650; }
.card-head p { font-size: 12px; color: var(--slate-400); margin-top: 2px; }
.card-head .grow { flex: 1; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 13px;
  padding: 16px 17px 15px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 11.5px; color: var(--slate-500); font-weight: 600; letter-spacing: 0.01em; }
.stat-ico { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-700); }
.stat-ico svg { width: 16px; height: 16px; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; margin-top: 8px; line-height: 1.05; }
.stat-sub { font-size: 11px; color: var(--slate-400); margin-top: 4px; }
.stat.gold .stat-ico { background: var(--gold-50); color: var(--gold-500); }
.stat.navy .stat-ico { background: #edf3f9; color: var(--navy-700); }
.stat.green .stat-ico { background: var(--green-50); color: var(--green-700); }
.stat.red .stat-ico { background: var(--red-50); color: var(--red-600); }
.stat.amber .stat-ico { background: var(--amber-50); color: var(--amber-700); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-2.even { grid-template-columns: 1fr 1fr; }
.stack { display: grid; gap: 18px; }

.notice {
  display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px;
  border-radius: 10px; font-size: 12.5px; line-height: 1.5; border: 1px solid transparent;
}
.notice svg { width: 17px; height: 17px; margin-top: 1px; flex: none; }
.notice strong { font-weight: 650; }
.notice-info { background: var(--blue-50); color: #1849a9; border-color: #d1e0ff; }
.notice-warn { background: var(--amber-50); color: var(--amber-700); border-color: #fedf89; }
.notice-success { background: var(--green-50); color: var(--green-700); border-color: #abefc6; }
.notice-danger { background: var(--red-50); color: var(--red-600); border-color: #fecdca; }
.notice-neutral { background: var(--slate-50); color: var(--slate-600); border-color: var(--slate-200); }

.progress-wrap { margin-top: 14px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--slate-500); margin-bottom: 6px; }
.progress { height: 8px; border-radius: 999px; background: var(--slate-100); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal-600), var(--teal-500)); transition: width 0.4s ease; }
.progress.gold > span { background: linear-gradient(90deg, #a76f1c, var(--gold-500)); }

/* ---------------- Tables ---------------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--slate-100); }
.toolbar .grow { flex: 1; }
.search-box { position: relative; min-width: 230px; flex: 1; max-width: 360px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--slate-400); pointer-events: none; }
.search-box .input { padding-left: 35px; }
.select-sm { padding: 8px 11px; border-radius: 8px; font-size: 12.5px; }
.table-wrap { overflow: auto; max-width: 100%; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.7px; }
table.data th {
  text-align: left; font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--slate-500); font-weight: 700; padding: 11px 14px; background: var(--slate-50);
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--slate-100); vertical-align: middle; color: var(--slate-700); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fbfcfe; }
table.data tbody tr.clickable { cursor: pointer; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .strong { color: var(--slate-900); font-weight: 600; }
table.data .sub { font-size: 11px; color: var(--slate-400); margin-top: 2px; }
table.data .nowrap { white-space: nowrap; }
table.data .actions { text-align: right; white-space: nowrap; }
.cell-jabatan { min-width: 220px; }
.cell-satker { min-width: 170px; }
.table-empty { padding: 42px 20px; text-align: center; color: var(--slate-400); font-size: 13px; }
.table-empty svg { width: 34px; height: 34px; color: var(--slate-300); margin-bottom: 10px; }
.table-empty strong { display: block; color: var(--slate-600); font-size: 13.5px; margin-bottom: 3px; }
.table-foot { padding: 10px 16px; font-size: 11.5px; color: var(--slate-400); border-top: 1px solid var(--slate-100); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; }
.muted { color: var(--slate-400); }
.text-sm { font-size: 12px; }
.text-right { text-align: right; }
.fw-600 { font-weight: 600; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab {
  appearance: none; border: 0; background: transparent; padding: 10px 14px 12px;
  font-size: 13px; font-weight: 600; color: var(--slate-500); border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap; display: flex; align-items: center; gap: 8px;
}
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--slate-800); }
.tab.active { color: var(--teal-700); border-bottom-color: var(--teal-600); }
.tab .count { font-size: 10.5px; background: var(--slate-100); color: var(--slate-500); padding: 1px 7px; border-radius: 999px; }

/* ---------------- Period & import ---------------- */
.period-list { display: grid; gap: 12px; }
.period-item { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 15px 17px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.period-item .p-main { flex: 1; min-width: 210px; }
.period-item .p-title { font-weight: 650; font-size: 14px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.period-item .p-meta { font-size: 11.5px; color: var(--slate-400); margin-top: 4px; display: flex; gap: 13px; flex-wrap: wrap; }
.period-item .p-actions { display: flex; gap: 7px; flex-wrap: wrap; }

.dropzone {
  border: 1.5px dashed var(--slate-300); border-radius: 12px; padding: 28px 20px;
  text-align: center; background: var(--slate-50); transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--teal-500); background: var(--teal-50); }
.dropzone .dz-ico { width: 44px; height: 44px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 12px; color: var(--teal-700); }
.dropzone strong { display: block; font-size: 13.5px; }
.dropzone p { font-size: 12px; color: var(--slate-400); margin-top: 4px; }
.dropzone input[type="file"] { display: none; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--slate-300); border-radius: 8px; padding: 6px 10px; font-size: 12px; margin-top: 10px; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.summary-item { background: var(--slate-50); border: 1px solid var(--slate-100); border-radius: 9px; padding: 10px 12px; }
.summary-item .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--slate-400); font-weight: 700; }
.summary-item .val { font-size: 18px; font-weight: 700; margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.inline-form { display: grid; grid-template-columns: 1.4fr 110px auto; gap: 10px; align-items: end; }
.hint-text { font-size: 11.5px; color: var(--slate-400); margin-top: 6px; }

/* ---------------- Modal ---------------- */
body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(8, 31, 53, 0.5);
  backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 18px; overflow-y: auto; animation: fadeIn 0.14s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: min(700px, 100%); background: #fff; border-radius: 16px;
  box-shadow: var(--shadow-lg); animation: pop 0.16s ease; margin: auto;
}
.modal.wide { width: min(980px, 100%); }
.modal.small { width: min(460px, 100%); }
@keyframes pop { from { transform: translateY(7px) scale(0.99); opacity: 0; } }
.modal-head { display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px 17px; border-bottom: 1px solid var(--slate-100); }
.modal-head .grow { flex: 1; min-width: 0; }
.modal-head h3 { font-size: 17px; letter-spacing: -0.01em; line-height: 1.3; }
.modal-head .modal-sub { font-size: 12px; color: var(--slate-400); margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.modal-close { width: 31px; height: 31px; border-radius: 8px; border: 0; background: var(--slate-50); color: var(--slate-500); display: grid; place-items: center; flex: none; }
.modal-close:hover { background: var(--slate-100); color: var(--slate-800); }
.modal-body { padding: 20px 22px; }
.modal-body.loading { min-height: 220px; display: grid; place-items: center; }
.modal-foot { padding: 15px 22px; border-top: 1px solid var(--slate-100); display: flex; gap: 9px; justify-content: flex-end; flex-wrap: wrap; background: var(--slate-50); border-radius: 0 0 16px 16px; }
.modal-foot .left { margin-right: auto; }

.comp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.comp {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; background: #fff;
}
.comp .comp-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; color: var(--slate-400); display: flex; align-items: center; gap: 6px; }
.comp .comp-value { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.comp .comp-detail { font-size: 11px; color: var(--slate-500); margin-top: 2px; }
.comp .comp-desc { font-size: 11px; color: var(--slate-400); line-height: 1.45; margin-top: 7px; }
.comp.highlight { background: var(--teal-50); border-color: #bfe7e0; }
.comp.highlight .comp-label { color: var(--teal-700); }
.comp.highlight .comp-value { color: var(--teal-700); }
.comp.warn { background: var(--red-50); border-color: #fecdca; }
.comp.warn .comp-label { color: var(--red-600); }
.comp.warn .comp-value { color: var(--red-600); }
.comp.wide { grid-column: 1 / -1; }

.calc {
  margin-top: 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--slate-50); padding: 12px 14px; overflow-x: auto;
}
.calc-title { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate-400); font-weight: 700; margin-bottom: 7px; }
.calc-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12px; color: var(--slate-600); font-variant-numeric: tabular-nums; }
.calc-line + .calc-line { margin-top: 6px; }
.calc-num { font-weight: 700; color: var(--slate-900); }
.calc-op { color: var(--slate-400); }
.calc-res { color: var(--teal-700); font-weight: 700; }
.calc-res-bad { color: var(--red-600); font-weight: 700; }
.calc-eq { color: var(--slate-400); margin: 0 1px; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--slate-500); margin: 20px 0 10px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--slate-100); }
.usulan-box { border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; background: var(--slate-50); display: grid; gap: 8px; }
.usulan-box .row { display: flex; justify-content: space-between; gap: 14px; font-size: 12px; }
.usulan-box .row span:first-child { color: var(--slate-500); }
.usulan-box .row span:last-child { text-align: right; font-weight: 600; }
.usulan-form { border: 1px solid var(--line); border-radius: 12px; padding: 15px; background: #fff; }
.usulan-form h4 { font-size: 13.5px; }
.usulan-form .form-stack { margin-top: 13px; gap: 13px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.maks-note { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; font-size: 11px; color: var(--slate-400); }
.maks-note strong { color: var(--slate-600); }
.char-count { text-align: right; font-size: 10.5px; color: var(--slate-400); margin-top: 3px; }
.empty-inline { padding: 14px; text-align: center; color: var(--slate-400); font-size: 12px; border: 1px dashed var(--slate-200); border-radius: 9px; }
.history-list { display: grid; gap: 7px; }
.history-item { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 11.5px; }
.history-item .h-main { min-width: 0; }
.history-item .h-main strong { display: block; font-size: 12px; }
.history-item .h-main span { color: var(--slate-400); }

/* ---------------- Audit ---------------- */
.audit-list { display: grid; gap: 0; }
.audit-row { display: grid; grid-template-columns: 135px 150px 1fr; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--slate-100); font-size: 12px; align-items: start; }
.audit-row:last-child { border-bottom: 0; }
.audit-row .a-time { color: var(--slate-400); font-variant-numeric: tabular-nums; font-size: 11px; }
.audit-row .a-actor { color: var(--slate-600); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.audit-row .a-act strong { color: var(--slate-900); font-weight: 600; display: block; }
.audit-row .a-act span { color: var(--slate-400); font-size: 11px; word-break: break-word; }
.detail-pre { font-family: ui-monospace, Consolas, monospace; font-size: 10.5px; color: var(--slate-500); white-space: pre-wrap; word-break: break-word; max-height: 80px; overflow: auto; margin-top: 3px; }

/* ---------------- Token box ---------------- */
.token-box { border: 1px solid #fedf89; background: var(--amber-50); border-radius: 10px; padding: 13px; }
.token-value { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.token-value code { flex: 1; background: #fff; border: 1px solid #fedf89; border-radius: 7px; padding: 8px 10px; font-size: 11.5px; word-break: break-all; font-family: ui-monospace, Consolas, monospace; }
.code-block { background: var(--navy-900); color: #c8e6e1; border-radius: 10px; padding: 13px 15px; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; overflow-x: auto; line-height: 1.6; }
.code-block .c-muted { color: #6f8fa5; }

/* ---------------- Misc ---------------- */
.divider { height: 1px; background: var(--slate-100); margin: 18px 0; }
.empty-state { padding: 36px 20px; text-align: center; color: var(--slate-400); }
.empty-state .big { width: 52px; height: 52px; border-radius: 14px; background: var(--slate-50); border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 12px; color: var(--slate-300); }
.empty-state strong { display: block; color: var(--slate-600); font-size: 14px; margin-bottom: 3px; }
.empty-state p { font-size: 12.5px; max-width: 380px; margin: 0 auto; }
.loading-block { padding: 50px 20px; text-align: center; color: var(--slate-400); font-size: 13px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--slate-200); border-top-color: var(--teal-600); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
.skeleton { background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-50) 37%, var(--slate-100) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
#toast-stack { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: grid; gap: 9px; max-width: min(380px, calc(100vw - 36px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; background: var(--navy-900); color: #fff;
  border-radius: 10px; padding: 11px 13px; box-shadow: var(--shadow-md); font-size: 12.5px;
  animation: toastIn 0.2s ease; border-left: 3px solid var(--teal-500);
}
.toast.error { border-left-color: #f97066; background: #451a16; }
.toast.success { border-left-color: #32d583; }
.toast svg { width: 16px; height: 16px; margin-top: 1px; flex: none; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }
.mobile-overlay { display: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2.even { grid-template-columns: 1fr; }
  .comp-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .mobile-overlay { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(8,31,53,0.4); backdrop-filter: blur(2px); }
  .mobile-overlay[hidden] { display: none; }
  .topbar { padding: 0 18px; }
  .page { padding: 22px 18px 48px; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { min-height: 100vh; padding: 34px 20px; background:
    radial-gradient(600px 300px at 100% 0%, rgba(20,155,139,0.12), transparent 60%),
    var(--bg); }
  .auth-card .mini-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; }
  .auth-card .mini-brand .logo-mark { width: 40px; height: 40px; }
  .auth-card .mini-brand strong { display: block; font-size: 13px; letter-spacing: 0.14em; color: var(--navy-800); }
  .auth-card .mini-brand span { display: block; font-size: 10.5px; color: var(--slate-400); }
}
@media (max-width: 760px) {
  .topbar-period { display: none; }
  .user-meta { display: none; }
  .page-head h1 { font-size: 22px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 22px; }
  .comp-grid { grid-template-columns: 1fr; }
  .comp.wide { grid-column: auto; }
  .modal-overlay { padding: 16px 10px; }
  .modal { border-radius: 13px; }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
  .modal-foot { padding-left: 16px; padding-right: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
  .audit-row { grid-template-columns: 1fr; gap: 2px; }
  .audit-row .a-time { font-size: 10px; }
  .toolbar { padding: 12px 14px; }
  table.data th, table.data td { padding: 9px 11px; }
  .search-box { max-width: none; }
  .period-item .p-actions { width: 100%; }
  .auth-copy h1 { font-size: 31px; }
}
@media (max-width: 460px) {
  .stats { grid-template-columns: 1fr; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .modal-foot .left { margin-right: 0; }
}
@media print {
  .sidebar, .topbar, .page-actions, .toolbar, .btn { display: none !important; }
  .main { margin-left: 0; }
  .page { padding: 0; }
  .card { box-shadow: none; }
}
