/* ============================================================
   Binsania School — Laporan Keuangan
   Tema: corporate finance — navy #0C2239, emas #C9A227
   ============================================================ */

:root {
  --navy-900: #08182b;
  --navy-800: #0c2239;
  --navy-700: #123a5a;
  --navy-600: #17496f;
  --navy: #16324f;
  --gold: #c9a227;
  --gold-600: #b08d1c;
  --gold-light: #e8c766;
  --gold-soft: #fbf4df;
  --ink: #14263b;
  --ink-soft: #334861;
  --muted: #6b7c91;
  --muted-2: #8b9aab;
  --bg: #f1f5f9;
  --card: #ffffff;
  --line: #e2e9f1;
  --line-strong: #cfdae7;
  --pos: #0f7b5a;
  --pos-soft: #e6f4ef;
  --neg: #ad3542;
  --neg-soft: #fbeaec;
  --warn: #a9761a;
  --warn-soft: #fdf3dc;
  --info: #1d5f9e;
  --info-soft: #e8f1fa;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(12, 34, 57, .04), 0 10px 28px -12px rgba(12, 34, 57, .18);
  --base-rgb: 12, 34, 57;
  --accent-rgb: 201, 162, 39;
  --shadow-lg: 0 24px 60px -20px rgba(8, 24, 43, .35);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 320px;
  background:
    radial-gradient(900px 240px at 12% -40px, rgba(var(--base-rgb), .16), transparent 70%),
    radial-gradient(700px 200px at 88% -60px, rgba(var(--accent-rgb), .18), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4, p { margin: 0; }
.hidden { display: none !important; }

/* ------------------------------------------------------------- scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c6d3e0; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ================================================================ login */
.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}

.login-brand {
  background:
    radial-gradient(700px 420px at 85% 8%, rgba(var(--accent-rgb), .22), transparent 62%),
    radial-gradient(600px 400px at 10% 92%, rgba(var(--base-rgb), .85), transparent 68%),
    linear-gradient(155deg, var(--navy-900) 0%, var(--navy-800) 45%, #0e2c48 100%);
  color: #fff;
  padding: 54px 58px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(70% 60% at 60% 40%, #000 20%, transparent 85%);
  pointer-events: none;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 2;
}

.brand-seal {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(150deg, var(--gold-light), var(--gold-600));
  color: var(--navy-900);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -.5px;
  box-shadow: 0 12px 26px -10px rgba(var(--accent-rgb), .8), inset 0 1px 0 rgba(255, 255, 255, .6);
}

.brand-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 15px;
  background: #fff;
  display: grid;
  place-items: center;
  padding: 6px;
  box-shadow: 0 12px 26px -14px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .6);
}
.brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.brand-logo.sm { width: 44px; height: 44px; flex-basis: 44px; border-radius: 12px; padding: 5px; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.brand-sub { font-size: 12px; color: rgba(255, 255, 255, .62); letter-spacing: .08em; }

.login-hero h1 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.16;
  letter-spacing: -.02em;
  margin-bottom: 16px;
  font-weight: 700;
}
.login-hero h1 span { color: var(--gold-light); }
.login-hero p { color: rgba(255, 255, 255, .74); max-width: 440px; font-size: 14.5px; line-height: 1.7; }

.login-points { margin-top: 34px; display: grid; gap: 14px; max-width: 460px; }
.login-point { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; color: rgba(255, 255, 255, .84); }
.login-point i {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(var(--accent-rgb), .16);
  color: var(--gold-light);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.login-foot { font-size: 12px; color: rgba(255, 255, 255, .45); position: relative; z-index: 2; }

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 34px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
}

.login-card { width: 100%; max-width: 404px; }
.login-card h2 { font-size: 24px; letter-spacing: -.02em; margin-bottom: 6px; }
.login-card .lead { color: var(--muted); font-size: 13.5px; margin-bottom: 26px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; }
.field .hint { font-size: 11.5px; color: var(--muted-2); margin-top: 6px; }

input, select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  height: 42px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 84px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18);
}
input::placeholder, textarea::placeholder { color: #a9b6c5; }
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' fill='none' stroke='%236b7c91' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--navy-800);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--navy-700); box-shadow: 0 8px 18px -10px rgba(var(--base-rgb), .7); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-block { width: 100%; height: 44px; }
.btn-gold {
  background: linear-gradient(150deg, var(--gold-light), var(--gold));
  color: #2b2205;
  border-color: rgba(176, 141, 28, .35);
}
.btn-gold:hover { background: linear-gradient(150deg, #f0d27c, var(--gold)); }
.btn-ghost { background: #fff; color: var(--ink-soft); border-color: var(--line-strong); }
.btn-ghost:hover { background: #f7fafd; color: var(--ink); border-color: #b9c8d8; box-shadow: none; }
.btn-danger { background: #fff; color: var(--neg); border-color: #ecccd0; }
.btn-danger:hover { background: var(--neg-soft); box-shadow: none; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn-xs { height: 27px; padding: 0 9px; font-size: 11.5px; border-radius: 7px; }

.demo-accounts {
  margin-top: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fbfdff;
}
.demo-accounts .t { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.demo-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  padding: 6px 0;
  color: var(--ink-soft);
  border-bottom: 1px dashed var(--line);
}
.demo-chip:last-child { border-bottom: 0; }
.demo-chip code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: var(--muted); }
.demo-chip button {
  border: 0; background: var(--gold-soft); color: var(--gold-600);
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 6px; cursor: pointer;
}
.demo-chip button:hover { background: #f6e9c4; }

.login-error {
  background: var(--neg-soft);
  color: var(--neg);
  border: 1px solid #f1d3d7;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
}

/* ================================================================ shell */
.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 55%, #0b2942 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 100% 42px;
  pointer-events: none;
}
.sidebar-top { padding: 22px 20px 18px; position: relative; z-index: 2; }
.sidebar-brand { display: flex; gap: 12px; align-items: center; }
.sidebar-brand .brand-name { font-size: 12.5px; letter-spacing: .07em; line-height: 1.3; }
.sidebar-brand .brand-sub { font-size: 10.5px; letter-spacing: .04em; margin-top: 2px; }

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 6px 12px 20px; position: relative; z-index: 2; }
.nav-group-title {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .34);
  padding: 16px 12px 8px;
  font-weight: 700;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .14s, color .14s, border-color .14s;
  position: relative;
  width: 100%;
  text-align: left;
  background: transparent;
  margin-bottom: 3px;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .82; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .22), rgba(var(--accent-rgb), .05));
  color: #fff;
  border-color: rgba(var(--accent-rgb), .3);
  font-weight: 600;
}
.nav-item.active svg { color: var(--gold-light); opacity: 1; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--gold-light);
}
.nav-badge {
  margin-left: auto;
  background: rgba(var(--accent-rgb), .92);
  color: #241d03;
  font-size: 10.5px;
  font-weight: 800;
  border-radius: 99px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}
.sidebar-foot {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(255, 255, 255, .09);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(150deg, var(--gold-light), var(--gold-600));
  color: #241d03; display: grid; place-items: center;
  font-weight: 800; font-size: 12px; flex: 0 0 34px;
  object-fit: cover; overflow: hidden;
}
img.avatar { display: block; border: 1px solid rgba(255, 255, 255, .28); }
.table-wrap img.avatar { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; border-color: var(--line); }
.avatar-lg {
  width: 76px !important; height: 76px !important; flex: 0 0 76px !important;
  border-radius: 20px !important; font-size: 24px !important;
}
.avatar-lg:not(img) { background: linear-gradient(150deg, var(--navy-700), var(--navy-800)); color: #fff; }
.sidebar-foot .who { min-width: 0; flex: 1; }
.sidebar-foot .who .n { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who .r { font-size: 10.5px; color: rgba(255, 255, 255, .48); }
.sidebar-foot button {
  border: 0; background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .8);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: grid; place-items: center;
}
.sidebar-foot button:hover { background: rgba(255, 255, 255, .16); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 26px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(12px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.topbar .crumb { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.topbar .crumb b { color: var(--ink); font-weight: 600; }
.topbar-spacer { flex: 1; }
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-group label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); font-weight: 700; }
.filter-group select { height: 36px; font-size: 12.5px; width: auto; min-width: 150px; border-radius: 9px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-soft); cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { background: #f6fafd; color: var(--ink); }
.menu-toggle { display: none; }

.content { padding: 24px 26px 48px; display: grid; gap: 20px; max-width: 1520px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 23px; letter-spacing: -.025em; font-weight: 700; }
.page-head .sub { margin-top: 5px; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); display: inline-block; }

/* ================================================================= cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}
.card.tight { padding: 16px 18px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-title { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.card-actions { display: flex; align-items: center; gap: 8px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.kpi {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--navy-700);
}
.kpi.gold::before { background: linear-gradient(180deg, var(--gold-light), var(--gold)); }
.kpi.pos::before { background: linear-gradient(180deg, #35a37d, var(--pos)); }
.kpi.neg::before { background: linear-gradient(180deg, #d66b76, var(--neg)); }
.kpi .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 7px; }
.kpi .value { font-size: 22px; font-weight: 700; letter-spacing: -.03em; margin-top: 9px; font-variant-numeric: tabular-nums; }
.kpi .meta { margin-top: 7px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.trend { font-weight: 700; font-size: 11.5px; padding: 1px 6px; border-radius: 6px; }
.trend.up { color: var(--pos); background: var(--pos-soft); }
.trend.down { color: var(--neg); background: var(--neg-soft); }
.trend.flat { color: var(--muted); background: #f1f5f9; }

.progress { height: 6px; border-radius: 99px; background: #edf2f7; overflow: hidden; margin-top: 12px; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--navy-700), var(--navy-600)); }
.progress.gold > span { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.progress.neg > span { background: linear-gradient(90deg, #c4515d, var(--neg)); }

/* --------------------------------------------------------------- layout */
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.grid-2-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }

/* ---------------------------------------------------------------- table */
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; padding: 0 20px 6px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 700;
  padding: 9px 12px;
  background: #f7fafd;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th:first-child { border-radius: 8px 0 0 8px; }
th:last-child { border-radius: 0 8px 8px 0; }
td { padding: 12px; border-bottom: 1px solid #eef3f8; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfdff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.acts { text-align: right; white-space: nowrap; }
.cell-strong { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge.green { background: var(--pos-soft); color: var(--pos); border-color: #c9e7dc; }
.badge.red { background: var(--neg-soft); color: var(--neg); border-color: #f0d2d6; }
.badge.gold { background: var(--gold-soft); color: var(--gold-600); border-color: #f0e2b8; }
.badge.blue { background: var(--info-soft); color: var(--info); border-color: #cfe2f4; }
.badge.gray { background: #f1f5f9; color: var(--muted); border-color: #e2e9f1; }
.badge.navy { background: #e9eff6; color: var(--navy-700); border-color: #d5e1ee; }

.unit-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 6px;
  background: #eef3f9;
  color: var(--navy-700);
  border: 1px solid #dbe6f1;
}

.empty {
  text-align: center;
  padding: 34px 16px;
  color: var(--muted);
}
.empty .ico { width: 42px; height: 42px; margin: 0 auto 10px; border-radius: 12px; background: #f2f6fa; display: grid; place-items: center; color: #9fb0c2; }
.empty b { display: block; color: var(--ink-soft); margin-bottom: 4px; font-size: 13.5px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1; min-width: 190px; max-width: 320px; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.toolbar .search input { padding-left: 34px; height: 38px; }
.toolbar select { height: 38px; width: auto; min-width: 140px; }
.toolbar-spacer { flex: 1; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

/* -------------------------------------------------------------- charts */
.chart { width: 100%; position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar-hit { cursor: pointer; }
.chart .grid-line { stroke: #e8eef5; stroke-width: 1; }
.chart .axis-text { fill: #8697a9; font-size: 10px; font-family: var(--font); }
.chart .axis-text.strong { fill: #66788c; font-weight: 600; }
.chart-tip {
  position: fixed;
  z-index: 90;
  background: rgba(9, 26, 43, .95);
  color: #fff;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 11.5px;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity .12s;
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, .6);
  white-space: nowrap;
}
.chart-tip.show { opacity: 1; }
.chart-tip b { color: var(--gold-light); font-weight: 700; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.legend-item .sw { width: 9px; height: 9px; border-radius: 3px; }
.legend-item.off { opacity: .38; text-decoration: line-through; }

.donut-wrap { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
.donut-wrap > .chart { margin: 0 auto; }
.donut-legend { flex: 1; display: grid; gap: 9px; min-width: 0; }
.donut-row { display: flex; align-items: center; gap: 9px; font-size: 12px; min-width: 0; overflow: hidden; }
.donut-row .sw { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; }
.donut-row .nm { color: var(--ink-soft); flex: 1; min-width: 0; margin-right: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-row .vl { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11.5px; white-space: nowrap; }

/* --------------------------------------------------------- budget rows */
.budget-group { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.budget-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; background: linear-gradient(90deg, #f7fafd, #fbfdff);
  border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
}
.budget-group-head .tot { font-variant-numeric: tabular-nums; color: var(--navy-700); }
.budget-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) minmax(130px, 1fr) minmax(120px, .9fr) 90px 110px;
  gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #f1f6fb;
}
.budget-row:last-child { border-bottom: 0; }
.budget-row .nm { font-size: 12.5px; color: var(--ink-soft); font-weight: 500; }
.budget-row .num { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.budget-row input.amount { height: 34px; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.budget-row.head { background: #f9fbfe; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 8px 14px; }

/* ------------------------------------------------------------- investor */
.inv-card { display: grid; gap: 14px; }
.inv-top { display: flex; align-items: flex-start; gap: 12px; }
.inv-avatar {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 44px;
  background: linear-gradient(150deg, #eaf0f7, #dbe6f1); color: var(--navy-700);
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.inv-name { font-weight: 700; font-size: 14.5px; }
.inv-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.inv-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; border-top: 1px solid var(--line); padding-top: 13px; }
.inv-stats .s .l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); font-weight: 700; }
.inv-stats .s .v { font-size: 13px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------- urutan kategori */
.cat-move {
  width: 22px; height: 17px; padding: 0; line-height: 1;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft);
  border-radius: 5px; font-size: 8px; cursor: pointer;
  display: grid; place-items: center;
}
.cat-move:hover:not(:disabled) { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-600); }
.cat-move:disabled { opacity: .32; cursor: not-allowed; }

/* ------------------------------------------------------------- hak akses */
.perm-role-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.perm-module { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.perm-module-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  background: linear-gradient(90deg, #f7fafd, #fbfdff); border-bottom: 1px solid var(--line);
}
.perm-module-head .nm { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.perm-module-head .ds { font-size: 11px; color: var(--muted); margin-top: 1px; }
.perm-module-head .toggle-all { margin-left: auto; font-size: 11px; }
.perm-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 2px 14px; padding: 11px 14px 13px; }
.perm-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); padding: 4px 0; cursor: pointer; }
.perm-check input { width: 15px; height: 15px; accent-color: var(--gold-600); cursor: pointer; }
.perm-check.locked { opacity: .6; cursor: not-allowed; }
.perm-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-chip {
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px;
  background: #eef3f9; color: var(--navy-700); border: 1px solid #dbe6f1;
}
.perm-chip.off { background: #f6f8fa; color: var(--muted-2); border-color: var(--line); }

/* ---------------------------------------------------------------- tema */
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.theme-swatch {
  text-align: left; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 9px; cursor: pointer; display: grid; gap: 5px;
  transition: border-color .14s, box-shadow .14s, transform .12s;
}
.theme-swatch:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.theme-swatch.active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2); }
.sw-preview { display: block; height: 32px; border-radius: 8px; }
.sw-name { font-size: 11.5px; font-weight: 700; color: var(--ink); }
.sw-note { font-size: 10.5px; color: var(--muted); }
.theme-custom {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
}
.color-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.color-row input[type="color"] {
  width: 46px; height: 38px; padding: 3px; border-radius: 9px; cursor: pointer;
  background: #fff; border: 1px solid var(--line-strong);
}
.color-row input[type="text"] {
  flex: 1; height: 38px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: lowercase; letter-spacing: .04em;
}
@media (max-width: 640px) {
  .theme-grid, .theme-custom { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; background: #eaf0f7; border-radius: 11px; padding: 4px; flex-wrap: wrap; width: fit-content; }
.tab {
  border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600;
  padding: 7px 14px; border-radius: 8px; cursor: pointer; transition: background .14s, color .14s;
}
.tab:hover { color: var(--ink); }
.tab.active { background: #fff; color: var(--navy-800); box-shadow: 0 1px 3px rgba(var(--base-rgb), .14); }

/* ---------------------------------------------------------------- modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 24, 43, .55);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 42px 18px 30px;
  overflow-y: auto;
  animation: fadeIn .16s ease-out;
}
.modal {
  width: 100%; max-width: 560px;
  background: #fff; border-radius: 18px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, .6);
  animation: popIn .18s cubic-bezier(.2, .9, .3, 1);
  overflow: hidden;
}
.modal.wide { max-width: 760px; }
.modal-head {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 14px;
  background: linear-gradient(180deg, #fbfdff, #fff);
}
.modal-head h3 { font-size: 16.5px; letter-spacing: -.01em; }
.modal-head p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.modal-head .x {
  margin-left: auto; border: 1px solid var(--line-strong); background: #fff; color: var(--muted);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 15px; line-height: 1; flex: 0 0 30px;
}
.modal-head .x:hover { background: #f4f8fc; color: var(--ink); }
.modal-body { padding: 20px 22px; max-height: min(66vh, 620px); overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: #fcfdfe; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.info-box {
  background: var(--gold-soft); border: 1px solid #f0e3bd; color: #6d5410;
  border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.55;
}
.info-box.blue { background: var(--info-soft); border-color: #d3e4f4; color: #14527f; }
.info-box.red { background: var(--neg-soft); border-color: #f0d2d6; color: #8c2b36; }

/* ----------------------------------------------------------------- toast */
#toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 10px; }
.toast {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--pos);
  border-radius: 11px; padding: 12px 16px; min-width: 250px; max-width: 380px;
  box-shadow: var(--shadow-lg); font-size: 13px; color: var(--ink);
  animation: slideIn .18s ease-out;
}
.toast.err { border-left-color: var(--neg); }
.toast.warn { border-left-color: var(--gold); }
.toast .t { font-weight: 700; font-size: 12.5px; margin-bottom: 2px; }

/* -------------------------------------------------------------- skeleton */
.skeleton { background: linear-gradient(90deg, #eef3f8 25%, #f7fafc 50%, #eef3f8 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
.sk-card { height: 110px; border-radius: var(--radius); }
.sk-line { height: 12px; margin-bottom: 10px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1220px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .budget-row { grid-template-columns: minmax(150px, 1.5fr) 1fr 100px 80px 95px; }
}
.login-mobile-brand { display: none; }
@media (max-width: 1024px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-mobile-brand {
    display: flex; align-items: center; gap: 12px; margin-bottom: 22px;
    padding-bottom: 18px; border-bottom: 1px solid var(--line);
  }
  .login-mobile-brand .brand-logo { width: 46px; height: 46px; flex-basis: 46px; border-radius: 13px; padding: 5px;
    box-shadow: 0 8px 20px -14px rgba(0, 0, 0, .5), inset 0 0 0 1px var(--line); }
  .login-mobile-brand .brand-name { color: var(--ink); font-size: 13px; letter-spacing: .08em; }
  .login-mobile-brand .brand-sub { color: var(--muted); font-size: 11px; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: 262px;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: 20px 0 60px -30px rgba(0, 0, 0, .5);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: grid; }
  .topbar { padding: 11px 16px; flex-wrap: wrap; }
  .content { padding: 18px 16px 40px; gap: 16px; }
  .grid-2-even { grid-template-columns: 1fr; }
  .budget-row { grid-template-columns: minmax(140px, 1.4fr) 1fr 90px 80px; }
  .budget-row > *:nth-child(3) { display: none; }
  .scrim { position: fixed; inset: 0; background: rgba(8, 24, 43, .45); z-index: 55; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 20px; }
  .filter-group label { display: none; }
  .filter-group select { min-width: 0; width: 100%; }
  .filter-group { flex: 1 1 46%; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { border-radius: 14px; }
  .inv-stats { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------------------------- print */
@media print {
  body { background: #fff; }
  body::before, .sidebar, .topbar, .page-actions, .no-print, #toast-root { display: none !important; }
  .app-shell { grid-template-columns: 1fr; }
  .content { padding: 0; gap: 14px; }
  .card { box-shadow: none; border-color: #cbd6e2; break-inside: avoid; }
  .print-head { display: block !important; }
}

.print-head { display: none; margin-bottom: 6px; }
.print-head h2 { font-size: 18px; }
.print-head p { font-size: 12px; color: #555; }

@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
