/* ============================================================
   ATRIA — Marketing Ops Platform · SaaS Professional skin
   Brand layer + app-shell. Load AFTER v2.css.
   Design language: modern B2B SaaS (flat, cool-neutral slate,
   crisp 1px borders, subtle shadows). Atria yellow #FFDD00 is
   reserved for identity moments: brand mark, active-nav bar,
   period chip, highlights — NOT for large surfaces.
   Typography: Plus Jakarta Sans (UI) + Fira Code (numbers only).
   Selector API unchanged — pages & role-nav.js depend on it.
   ============================================================ */

:root {
  /* --- Surfaces --- */
  --bg: #F7F8FA;            /* app background, cool light gray */
  --bg-soft: #FAFBFC;       /* lighter wash */
  --surface: #FFFFFF;       /* card / panel surface */
  --surface-2: #F2F4F7;     /* filled surface (thead, chips) */
  --sidebar: #101828;       /* dark slate sidebar — high contrast */
  --sidebar-2: #0C111D;

  /* --- Ink (text) --- */
  --ink: #101828;           /* primary text */
  --ink-soft: #344054;      /* secondary text */
  --muted: #667085;         /* muted / captions */
  --faint: #6C7686;         /* faint, hint text (4.59:1 on white) */
  --on-dark: #F2F4F7;       /* text on dark sidebar */
  --on-dark-mute: #98A2B3;  /* muted text on dark sidebar */

  /* --- Lines --- */
  --line: #E4E7EC;          /* hairline border */
  --line-soft: #F0F2F5;     /* softest divider */

  /* --- Brand accents --- */
  --brand: #FFDD00;         /* Atria yellow — identity accent */
  --brand-strong: #A16207;  /* amber-700 — readable brand text/links */
  --brand-hover: #F2CE00;   /* yellow hover */
  --brand-soft: #FEFBE8;    /* faint yellow tint */
  --brand-ink: #111111;     /* ink sitting ON yellow */
  --brass: #475467;         /* was warm brass → neutral slate */
  --brass-soft: #F2F4F7;
  --accent: var(--brand);   /* alias required by contract */

  /* --- Secondary calm accent (names kept for page compat) --- */
  --olive: #6FAE2F;         /* meters / positive fills — logo green */
  --olive-soft: #F0F7E6;
  --slate: #475467;
  --slate-soft: #F2F4F7;

  /* --- Status — dari palet pinwheel logo Atria, versi kontras-aman --- */
  --ok: #4C7A1B;            --ok-soft: #F0F7E6;   /* hijau logo */
  --warn: #B54708;          --warn-soft: #FFFAEB; /* oranye logo */
  --danger: #C22026;        --danger-soft: #FDEBEA; /* merah logo */
  --info: #0B6E96;          --info-soft: #E5F4FB; /* biru logo (5.07:1 on soft) */

  /* --- Shape & motion --- */
  --radius: 8px;
  --radius-lg: 12px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 20px 40px rgba(16, 24, 40, 0.12);
  --gap: 14px;
  --pad: 16px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --mono: 'Fira Code', ui-monospace, monospace;
  --ease: 180ms cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-w: 248px;
}

/* base re-assert */
html, body { background: var(--bg); color: var(--ink); font-family: var(--font); }
a { color: var(--brand-strong); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar (light, bordered) ---------- */
.sidebar {
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: var(--on-dark-mute);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 5px; }

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 10px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar__brand .mark {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--brand) url('brand/atria-logo.png') center/cover no-repeat;
  display: grid; place-items: center;
  color: transparent; font-size: 0;
  flex-shrink: 0;
}
.sidebar__brand .wordmark { display: flex; flex-direction: column; line-height: 1.15; }
.sidebar__brand .wordmark b {
  color: #FFFFFF; font-weight: 800; font-size: 15px; letter-spacing: 0.12em;
}
.sidebar__brand .wordmark span {
  color: var(--on-dark-mute); font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; margin-top: 3px;
}

/* ---------- Nav ---------- */
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav__group { margin-top: 14px; }
.nav__group-label {
  color: #7D8797; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 6px 10px 4px; font-weight: 700;
}
.nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; color: #CDD5DF; text-decoration: none;
  border-radius: var(--radius); font-size: 13px; font-weight: 500;
  position: relative; cursor: pointer;
  transition: background var(--ease), color var(--ease);
}
.nav__item:hover { background: rgba(255, 255, 255, 0.06); color: #FFFFFF; }
.nav__item .ic { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.75; }
.nav__item.is-active {
  background: rgba(255, 255, 255, 0.09);
  color: #FFFFFF; font-weight: 700;
}
.nav__item.is-active::before {
  content: ''; position: absolute; left: 0; top: 7px; bottom: 7px;
  width: 3px; background: var(--brand); border-radius: 0 3px 3px 0;
}
.nav__item.is-active .ic { opacity: 1; }
.nav__item .badge { margin-left: auto; }
.nav__item .ext { margin-left: auto; opacity: 0.4; width: 14px; height: 14px; }

.sidebar__foot {
  margin-top: auto; padding: 10px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.05); border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar__foot .who { color: #FFFFFF; font-size: 12.5px; font-weight: 600; }
.sidebar__foot .role { color: var(--on-dark-mute); font-size: 10.5px; }

/* ---------- Main / Topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 58px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.topbar__title { display: flex; flex-direction: column; line-height: 1.2; }
.topbar__title b { font-size: 14.5px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.topbar__title small { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.topbar__meta { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar__period {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; background: var(--brand-soft); color: var(--brand-strong);
  border: 1px solid #F3E88A; border-radius: var(--radius);
  font-size: 12px; font-weight: 600;
}
.topbar__bell {
  width: 36px; height: 36px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); display: grid; place-items: center;
  cursor: pointer; position: relative; color: var(--ink-soft);
  transition: border-color var(--ease), background var(--ease);
}
.topbar__bell:hover { border-color: var(--faint); background: var(--bg-soft); }
.topbar__bell .dot {
  position: absolute; top: 6px; right: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: #F04438; border: 2px solid var(--surface);
}
.topbar__role {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 6px 4px 10px; border: 1px solid var(--line); border-radius: 99px;
  background: var(--surface); cursor: pointer; font-size: 12px; color: var(--ink-soft);
  transition: border-color var(--ease);
}
.topbar__role:hover { border-color: var(--faint); }
.topbar__role b { color: var(--ink); font-weight: 600; }
.topbar__role .ic { width: 13px; height: 13px; opacity: 0.5; }

/* ---------- Page wrapper ---------- */
.page { padding: 24px; flex: 1; }
.page__head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; margin-bottom: 20px;
}
.page__head h1 { margin: 0 0 4px; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.page__head .sub { margin: 0; font-size: 13px; color: var(--muted); }
.page__actions { display: flex; gap: 8px; align-items: center; }

/* ============================================================
   GRID
   ============================================================ */
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1180px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* ============================================================
   CARD + STAT — full-color skin (revisi batch-2):
   kartu tidak lagi putih/abu template; stat = blok warna solid
   dari palet logo, card = header band gelap slate + tick kuning.
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--ease), border-color var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); }
.card__head {
  padding: 13px 18px 12px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  border-bottom: 1px solid var(--sidebar-2);
}
.card__title { margin: 0; font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; color: #FFFFFF; }
.card__head .card__title { color: #FFFFFF; }
.card__title::before {
  content: ''; display: inline-block; width: 8px; height: 8px;
  border-radius: 2px; background: var(--brand); margin-right: 8px;
  vertical-align: 1px;
}
.card__title .hint { display: block; font-size: 11.5px; font-weight: 400; color: rgba(255, 255, 255, 0.66); margin-top: 3px; }
.card__head .u-muted { color: rgba(255, 255, 255, 0.66); }
.card__body { padding: 18px; }

.stat {
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  border: 1px solid transparent; color: #FFFFFF;
  border-radius: var(--radius-lg); padding: 16px 18px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--ease);
}
.stat:hover { box-shadow: var(--shadow-md); }
.stat::after {
  content: ''; position: absolute; left: 18px; right: auto; top: 0;
  width: 26px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--brand); opacity: 0.9;
}
/* ikon bulat pojok kanan atas — identitas isi kartu */
.stat__ic {
  position: absolute; top: 13px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.13);
  color: #FFFFFF;
}
.stat__ic .ic { width: 16px; height: 16px; }
.stat__label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.78); font-weight: 600;
  padding-right: 48px;
}
.stat__num {
  font-family: var(--mono); font-size: 23px; font-weight: 700;
  color: #FFFFFF; margin-top: 7px; letter-spacing: -0.02em;
  line-height: 1.1; font-variant-numeric: tabular-nums;
}
.stat__num small { font-size: 13px; color: rgba(255, 255, 255, 0.72); font-weight: 500; }
.stat__delta {
  font-size: 11.5px; margin-top: 6px;
  display: inline-flex; align-items: center; gap: 4px; color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}
.stat__delta .ic { width: 13px; height: 13px; }
.stat__delta--up { color: #FFFFFF; }
.stat__delta--down { color: #FFFFFF; }
/* meter di dalam stat berwarna: track & fill putih-transparan */
.stat .meter__bar { background: rgba(255, 255, 255, 0.24); border: none; }
.stat .meter__fill,
.stat .meter__fill--warn,
.stat .meter__fill--danger { background: #FFFFFF; }

/* ============================================================
   STATUS PILL
   ============================================================ */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 600; line-height: 1.6;
  background: var(--surface-2); color: var(--ink-soft);
  border: 1px solid transparent;
}
.pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.pill--ok     { background: var(--ok-soft);     color: var(--ok);     }
.pill--warn   { background: var(--warn-soft);   color: var(--warn);   }
.pill--danger { background: var(--danger-soft); color: var(--danger); }
.pill--info   { background: var(--info-soft);   color: var(--info);   }
.pill--muted  { background: var(--surface-2);   color: var(--muted);  }

/* ============================================================
   TABLE
   ============================================================ */
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 600; padding: 10px 16px;
  background: var(--bg-soft); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table thead th.num { text-align: right; }
.table tbody tr { border-bottom: 1px solid var(--line-soft); transition: background var(--ease); }
.table tbody tr:hover { background: var(--bg-soft); }
.table tbody tr:last-child { border-bottom: none; }
.table td { padding: 12px 16px; font-size: 12.5px; color: var(--ink); vertical-align: middle; }
.table .num {
  text-align: right; font-family: var(--mono);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.table--zebra tbody tr:nth-child(even) { background: var(--bg-soft); }
.table--zebra tbody tr:nth-child(even):hover { background: var(--surface-2); }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tab {
  border: none; background: transparent; padding: 6px 14px;
  font-family: var(--font); font-size: 12.5px; font-weight: 500; color: var(--ink-soft);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--ease), color var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 700; }
.tab-pane { display: none; }
.tab-pane.is-active { display: block; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-size: 12.5px; font-weight: 600;
  font-family: var(--font); display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; text-decoration: none; line-height: 1.2;
  box-shadow: var(--shadow-sm);
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.btn:hover { background: var(--bg-soft); border-color: #D0D5DD; }
.btn .ic { width: 15px; height: 15px; }
.btn--primary { background: #111827; color: #FFFFFF; border-color: #111827; font-weight: 600; }
.btn--primary:hover { background: #1F2937; border-color: #1F2937; color: #FFFFFF; }
.btn--brand { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 700; }
.btn--brand:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn--ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-soft); }
.btn--ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--ink); }
.btn--danger { background: #D92D20; color: #fff; border-color: #D92D20; }
.btn--danger:hover { background: #B42318; border-color: #B42318; }
.btn--sm { padding: 5px 10px; font-size: 11.5px; border-radius: var(--radius-sm); gap: 5px; }
.btn--sm .ic { width: 13px; height: 13px; }

/* ============================================================
   KANBAN
   ============================================================ */
.kanban {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr);
  gap: var(--gap); overflow-x: auto; padding-bottom: 6px;
}
.kanban__col {
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg); padding: 12px;
  display: flex; flex-direction: column; gap: 10px; min-height: 120px;
}
.kanban__col-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 700; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.kanban__count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); padding: 1px 8px; border-radius: 99px;
  font-variant-numeric: tabular-nums;
}
.kanban__card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px; cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--ease), border-color var(--ease);
}
.kanban__card:hover { box-shadow: var(--shadow-md); border-color: #D0D5DD; }
.kanban__card-title { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.kanban__card-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 11px; color: var(--muted);
}

/* ============================================================
   TIMELINE / LOG
   ============================================================ */
.timeline { position: relative; padding-left: 6px; }
.timeline::before {
  content: ''; position: absolute; left: 11px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line);
}
.timeline__item {
  position: relative; padding: 0 0 16px 30px;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute; left: 5px; top: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--faint);
  z-index: 1; box-sizing: border-box;
}
.timeline__dot--ok     { border-color: var(--ok); }
.timeline__dot--warn   { border-color: var(--warn); }
.timeline__dot--danger { border-color: var(--danger); }
.timeline__dot--muted  { border-color: var(--line); }
.timeline__body { font-size: 12.5px; color: var(--ink); }
.timeline__body .when { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.timeline__body b { font-weight: 600; }

/* ============================================================
   MODAL
   ============================================================ */
.modal { display: none; position: fixed; inset: 0; z-index: 100; }
.modal.is-open { display: block; }
.modal__overlay { position: absolute; inset: 0; background: rgba(16, 24, 40, 0.45); backdrop-filter: blur(2px); }
.modal__box {
  position: relative; z-index: 1; margin: 7vh auto 0; width: min(560px, calc(100% - 32px));
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; animation: atria-modal-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes atria-modal-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
.modal__head {
  padding: 16px 20px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.modal__head h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.modal__head .close { border: none; background: transparent; cursor: pointer; color: var(--muted); display: grid; place-items: center; padding: 4px; border-radius: 6px; }
.modal__head .close:hover { background: var(--surface-2); color: var(--ink); }
.modal__head .close .ic { width: 18px; height: 18px; }
.modal__body { padding: 20px; font-size: 13px; color: var(--ink-soft); max-height: 60vh; overflow-y: auto; }
.modal__foot { padding: 14px 20px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 8px; background: var(--bg-soft); }

/* ============================================================
   BUDGET METER
   ============================================================ */
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter__top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; }
.meter__top b { font-family: var(--mono); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.meter__top .lbl { color: var(--ink-soft); font-weight: 500; }
.meter__bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter__fill {
  height: 100%; border-radius: 99px;
  background: var(--olive);
  transition: width var(--ease);
}
.meter__fill--warn   { background: #F7941D; }
.meter__fill--danger { background: #E23B3B; }

/* ============================================================
   CHAT (WhatsApp style)
   ============================================================ */
.chat { display: grid; grid-template-columns: 280px 1fr; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.chat__list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 560px; }
.chat__list-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft); cursor: pointer;
  transition: background var(--ease);
}
.chat__list-item:hover, .chat__list-item.is-active { background: var(--bg-soft); }
.chat__list-item .who { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.chat__list-item .last { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.chat__thread {
  display: flex; flex-direction: column; gap: 10px; padding: 18px;
  background: var(--bg);
  overflow-y: auto; max-height: 560px;
}
.bubble {
  max-width: 74%; padding: 9px 13px; border-radius: 12px;
  font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow-sm);
  position: relative;
}
.bubble .time { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; text-align: right; }
.bubble--in  { align-self: flex-start; background: var(--surface); color: var(--ink); border: 1px solid var(--line-soft); border-top-left-radius: 3px; }
.bubble--out { align-self: flex-end; background: #E7F6EC; color: var(--ink); border-top-right-radius: 3px; }
.bubble--out .time { color: #4B7A5E; }

/* ============================================================
   LEDGER (poin / saldo)
   ============================================================ */
.ledger { display: flex; flex-direction: column; }
.ledger__row {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 14px; align-items: center;
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft);
}
.ledger__row:last-child { border-bottom: none; }
.ledger__row .desc { font-size: 12.5px; color: var(--ink); }
.ledger__row .desc small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.ledger__amt { font-family: var(--mono); font-size: 13px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger__plus  { color: var(--ok); }
.ledger__minus { color: var(--danger); }
.ledger__bal { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* ============================================================
   MISC: avatar, badge, chip
   ============================================================ */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px; color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--line);
}
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.avatar--olive { background: var(--olive-soft); border-color: #C8E9D6; color: var(--ok); }
.avatar--slate { background: var(--info-soft); border-color: #CBE0F7; color: var(--info); }

.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px;
  padding: 0 6px; border-radius: 99px;
  background: #F04438; color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.badge--brand { background: var(--brand); color: var(--brand-ink); }
.badge--muted { background: var(--surface-2); color: var(--muted); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line);
  font-family: var(--font);
  font-size: 11.5px; font-weight: 500; color: var(--ink-soft);
  cursor: pointer; transition: background var(--ease), border-color var(--ease);
}
.chip:hover { background: var(--bg-soft); border-color: #D0D5DD; color: var(--ink); }
.chip .ic { width: 13px; height: 13px; }
.chip.is-active { background: #111827; color: #fff; border-color: #111827; font-weight: 600; }

/* ============================================================
   FORM
   ============================================================ */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.toolbar .spacer { margin-left: auto; }

.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; }
.label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.label .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; font-family: var(--font); font-size: 13px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: #98A2B3;
  box-shadow: 0 0 0 3px rgba(16, 24, 40, 0.08);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}

/* ============================================================
   NOTES
   ============================================================ */
.empty-note {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 40px 20px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius-lg); background: var(--bg-soft);
}
.empty-note .ic { width: 30px; height: 30px; opacity: 0.5; }
.empty-note b { color: var(--ink-soft); font-weight: 600; font-size: 13px; }

.disclaimer {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--radius);
  background: var(--warn-soft); border: 1px solid #FEDF89;
  font-size: 11.5px; color: var(--warn); line-height: 1.5;
}
.disclaimer .ic { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: #F79009; }

/* ============================================================
   IKON KANAL — warna asli brand supaya langsung dikenali
   (berlaku global: chip, label, header tabel, stat, sidebar)
   ============================================================ */
use[href$="#i-whatsapp"]  { color: #25D366; }
use[href$="#i-instagram"] { color: #E1306C; }
use[href$="#i-mail"]      { color: #1A73E8; }
use[href$="#i-phone"]     { color: #12B76A; }
use[href$="#i-bell"]      { color: #F59E0B; }

/* ============================================================
   SMALL UTILITIES (Atria-scoped)
   ============================================================ */
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.u-mono { font-family: var(--mono); }
.u-muted { color: var(--muted); }
.u-right { text-align: right; }
.u-mt0 { margin-top: 0; } .u-mb0 { margin-bottom: 0; }

/* ============================================================
   RESPONSIVE SHELL (desktop-first, don't break small screens)
   ============================================================ */
@media (max-width: 980px) {
  :root { --sidebar-w: 64px; }
  .sidebar { padding: 14px 8px; }
  .sidebar__brand .wordmark,
  .nav__group-label,
  .nav__item span:not(.badge),
  .sidebar__foot .who, .sidebar__foot .role { display: none; }
  .nav__item { justify-content: center; }
  .chat { grid-template-columns: 1fr; }
  .chat__list { display: none; }
}
