/* ==========================================================================
   ALESYA FINANCE — theme & app styles
   Theme: blue gradient sidebar, floating white top bar, soft canvas, KPI cards with
   watermark icons, one highlighted blue card, pastel status tiles.
   ========================================================================== */

@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400; font-display: swap; src: url(../vendor/fonts/pjs-400.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 500; font-display: swap; src: url(../vendor/fonts/pjs-500.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-display: swap; src: url(../vendor/fonts/pjs-600.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 700; font-display: swap; src: url(../vendor/fonts/pjs-700.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-display: swap; src: url(../vendor/fonts/pjs-800.woff2) format('woff2'); }

:root {
  /* brand */
  --blue: #0586E8; --cyan: #38BDF8; --deep: #063B70;
  --gradient: linear-gradient(135deg, #0586E8 0%, #38BDF8 100%);
  /* theme (from the reference) */
  --side-grad: linear-gradient(180deg, #2477C4 0%, #1D6FBF 45%, #135FAE 100%);
  --feature-grad: radial-gradient(120% 140% at 0% 0%, #2278CC 0%, #1C6FC2 40%, #155FAE 100%);
  --page: #FAFBFD; --canvas: #F5F8FC; --card: #FFFFFF; --field: #F3F6FA;
  --border: #E8EEF5; --border-strong: #D5DEE9;
  --ink: #0F1B2D; --ink-2: #33445C; --muted: #5E6C82; --faint: #9AA8BA;
  /* text-safe versions of the functional colors (4.5:1+ on white and canvas) */
  --income-ink: #187A44; --expense-ink: #C2414B; --link: #0A6CC2; --tab-ink: #64748B;
  /* functional */
  --income: #27AE80; --expense: #E66A73; --warning: #E7A83E; --analytics: #9471E5; --neutral: #64748B;
  --income-soft: #E3F4E9; --expense-soft: #FCE8EA; --warning-soft: #FAEFE1; --analytics-soft: #F1EBFE; --blue-soft: #E2EEF8; --cyan-soft: #E0F4FD;
  --up-bg: #E2F6E9; --up-ink: #187A44; --down-bg: #FCE8EA; --down-ink: #B4232F;
  /* status tiles */
  --tile-blue: #D6ECFB; --tile-blue-ink: #17558F;
  --tile-yellow: #FBEAB5; --tile-yellow-ink: #845A06;
  --tile-pink: #F9D8DC; --tile-pink-ink: #B4232F;
  /* type */
  --fs-xs: .8125rem; --fs-sm: .875rem; --fs-base: .9375rem; --fs-md: 1.0625rem; --fs-lg: 1.25rem; --fs-xl: 1.5rem; --fs-h1: clamp(1.75rem, 1.3rem + 1.4vw, 2.25rem);
  /* shape */
  --r-card: var(--r-surface); --r-ctl: var(--r-control); --r-chip: 999px;
  --shadow-card: 0 1px 2px rgba(15, 27, 45, .04), 0 8px 24px -12px rgba(15, 27, 45, .10);
  --shadow-pop: 0 16px 40px -12px rgba(15, 27, 45, .25);
  --shadow-feature: 0 18px 36px -16px rgba(20, 116, 202, .7);

  /* themeable component tokens (default skin: Biru Lotus) */
  --btn-grad: linear-gradient(180deg, #1C74C9, #1666B8); --btn-grad-hover: linear-gradient(180deg, #1868BA, #115AA6); --btn-shadow: rgba(20, 116, 202, .9);
  --btn-r: var(--r-control); --btn-r-inner: max(calc(var(--r-control) - 4px), 6px); --ic-r: var(--r-inner); --ring: rgba(5, 134, 232, .14);
  --fbox-focus: #9CC8EF; --fbox-active-bg: #EAF3FC; --fbox-active-border: #BFDBF5;
  --side-ink: #FFFFFF; --side-muted: rgba(255, 255, 255, .78); --side-line: rgba(255, 255, 255, .7); --side-hover: rgba(255, 255, 255, .14);
  --side-active-bg: rgba(255, 255, 255, .2); --side-active-border: rgba(255, 255, 255, .55); --side-active-ink: #FFFFFF;
  --side-badge: rgba(255, 255, 255, .28); --side-badge-ink: #FFFFFF; --side-phase-border: rgba(255, 255, 255, .45); --side-tile-ring: rgba(255, 255, 255, .55); --skyline: #FFFFFF; --side-tag: rgba(255, 255, 255, .92);
  --login-bg: var(--side-grad); --fab-bg: var(--side-grad); --avatar-grad: linear-gradient(135deg, #2FB57A, #1E9A63);
  --on-feature-neg: #FFD5D9; --wm: #EDF3F9; --track: #EEF3F8; --track-pattern: linear-gradient(transparent, transparent);
  --tile-blue-sub: #3F6383; --tile-yellow-sub: #8D6A1C; --tile-pink-sub: #A3404A; --analytics-ink: #5B3EB0;
  --pick-on-border: #8EC2EE; --pick-on-bg: var(--blue-soft); --pick-on-ink: #0E4F8C; --toast: #0F3A66; --sk-a: #EAF0F6; --sk-b: #F6F9FC;
  --ic-balance-bg: var(--blue-soft); --ic-balance: #1A7AD3; --ic-savings-bg: var(--cyan-soft); --ic-savings: #0E8AC7; --ic-debt: #D08A1E; --dot-other: #CBD5E1;
  --chart-income: #27AE80; --chart-expense: #E66A73; --chart-line: #0586E8; --chart-fill: rgba(5, 134, 232, .28); --chart-grid: #EEF2F7; --chart-zero: #94A3B8; --chart-text: #64748B; --tooltip: #063B70;
  --side-w: 288px; --tab-h: 64px;
  /* card system: one padding, gap, radius and type scale for every card */
  /* radius system — five rules, one value per skin:
     surface (cards, bars, sheets, popovers) · control (labelled buttons, inputs, nav items, segments)
     inner (icon tiles inside cards) · box (boxes nested inside a card) · round (icon-only buttons, avatars, chips: 50% / 999px) */
  --r-surface: 20px; --r-control: 12px; --r-inner: 12px; --r-box: 12px; --r-canvas: calc(var(--r-surface) + 8px);
  --card-pad: 18px; --card-gap: 16px; --card-r: var(--r-surface);
  --fs-card-title: 1rem;        /* 16px — KPI title, status label, panel title */
  --fs-figure: 1.75rem;         /* 28px — KPI and status headline number */
  --fs-card-sub: var(--fs-sm);  /* 14px — every supporting line under a card title/number */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 110px; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 var(--fs-base)/1.5 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.015em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic--sm { width: 16px; height: 16px; }
.muted { color: var(--muted); }
.pos { color: var(--income-ink); } .neg { color: var(--expense-ink); }
.kpi--feature .neg { color: var(--on-feature-neg); }
:focus-visible { outline: 3px solid rgba(5, 134, 232, .45); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--deep); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--btn-r); border: 1px solid transparent; font-weight: 600; font-size: var(--fs-sm); white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--btn-grad); color: #fff; box-shadow: 0 8px 18px -10px var(--btn-shadow); }
.btn--primary:hover { background: var(--btn-grad-hover); }
.btn--ghost { background: var(--card); border-color: var(--border); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--border-strong); }
.btn--icon { width: 44px; padding: 0; border-radius: 50%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn--block { width: 100%; min-height: 52px; font-size: var(--fs-base); }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2); position: relative; flex: none; }
.iconbtn { transition: background-color .15s; }
.iconbtn:hover { background: var(--field); }

.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--field); border-radius: var(--btn-r); }
.seg button { border: 0; background: transparent; padding: 8px 12px; border-radius: var(--btn-r-inner); font-size: var(--fs-sm); font-weight: 500; color: var(--muted); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(15, 27, 45, .12); }

.field { display: grid; gap: 6px; }
.field > span { font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); }
.input, .select { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: #fff; }
.input:focus, .select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(5, 134, 232, .15); }

/* boxed filter fields (label above value), as in the reference */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; margin-top: var(--card-gap); }
.fbox { position: relative; display: grid; align-content: center; min-width: 190px; min-height: 50px; padding: 4px 40px 4px 18px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-control); }
.fbox:focus-within { border-color: var(--fbox-focus); box-shadow: 0 0 0 3px var(--ring); }
.fbox--active { background: var(--fbox-active-bg); border-color: var(--fbox-active-border); }
.fbox small { font-size: var(--fs-xs); color: var(--muted); line-height: 1.2; }
.fbox select, .fbox input { appearance: none; -webkit-appearance: none; border: 0; background: transparent; padding: 0; font-weight: 500; font-size: var(--fs-base); color: var(--ink); width: 100%; outline: none; min-height: 26px; }
.fbox .ic { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.fbox input::-webkit-calendar-picker-indicator { opacity: 0; position: absolute; inset: 0; width: 100%; cursor: pointer; }
.filters__end { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.filters__end .btn { min-height: 50px; }
.filters__end .btn--icon { width: 50px; border-radius: 50%; }
.filters__err { width: 100%; color: var(--down-ink); font-size: var(--fs-sm); }

/* ---------- splash & login ---------- */
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: #fff; z-index: 50; }
.splash img { animation: breathe 1.4s var(--ease) infinite alternate; }
@keyframes breathe { from { opacity: .55; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--login-bg); position: relative; overflow: hidden; }
.login::after { content: ''; position: absolute; inset: auto 0 0 0; height: 180px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 120' preserveAspectRatio='none'%3E%3Cg fill='%23fff'%3E%3Cpath d='M0 120V78l26-20 26 20v42z' opacity='.08'/%3E%3Cpath d='M40 120V64l34-28 34 28v56z' opacity='.11'/%3E%3Cpath d='M96 120V86l20-15 20 15v34z' opacity='.07'/%3E%3Cpath d='M128 120V58l40-32 40 32v62z' opacity='.1'/%3E%3Cpath d='M196 120V80l32-24 32 24v40z' opacity='.08'/%3E%3C/g%3E%3C/svg%3E") bottom / 520px 180px repeat-x; pointer-events: none; }
.login__panel { position: relative; z-index: 1; width: min(440px, 100%); background: var(--card); border-radius: var(--r-surface); padding: 36px 32px 28px; display: grid; gap: 14px; box-shadow: 0 30px 60px -30px rgba(6, 40, 80, .6); }
.login__logo { width: 260px; height: auto; margin: 0 auto 8px; }
.login__title { font-size: var(--fs-xl); font-weight: 800; text-align: center; }
.login__lead { text-align: center; color: var(--muted); }
.login__gsi { display: flex; justify-content: center; min-height: 44px; margin-top: 6px; }
.login__demo { justify-self: center; }
.login__error { color: var(--down-ink); background: var(--down-bg); border-radius: var(--r-ctl); padding: 10px 12px; font-size: var(--fs-sm); }
.login__note { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-xs); color: var(--muted); border-top: 1px solid var(--border); padding-top: 14px; margin-top: 6px; }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; display: grid; grid-template-columns: calc(var(--side-w) + 16px) 1fr; transition: grid-template-columns .25s var(--ease); }
.shell.is-collapsed { grid-template-columns: 0 1fr; }
.shell.is-collapsed .sidebar { transform: translateX(calc(-100% - 32px)); }

.sidebar {
  position: sticky; top: 16px; height: calc(100dvh - 32px); margin: 16px 0 16px 16px; border-radius: var(--r-surface); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.3) transparent;
  background: var(--side-grad); color: var(--side-ink); padding: 28px 16px 0; display: flex; flex-direction: column; transition: transform .25s var(--ease); z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 12px; color: var(--side-ink); text-decoration: none; }
.brand__tile { width: 52px; height: 52px; border-radius: 15px; box-shadow: 0 0 0 2px var(--side-tile-ring), 0 8px 18px -8px rgba(0, 30, 70, .45); }
.brand__name { font-weight: 800; font-size: 1.375rem; line-height: 1.02; letter-spacing: .01em; }
.brand__tag { display: flex; align-items: center; gap: 10px; margin: 14px 12px 22px; font-size: .6875rem; font-weight: 700; letter-spacing: .22em; color: var(--side-tag); white-space: nowrap; }
.brand__tag span { flex: 1; height: 1.5px; background: var(--side-line); border-radius: 2px; }
.nav { display: grid; gap: 2px; }
.nav__group { font-size: .75rem; font-weight: 700; letter-spacing: .08em; color: var(--side-muted); padding: 16px 12px 8px; }
.nav__group:first-child { padding-top: 4px; }
.nav__item {
  display: flex; align-items: center; gap: 14px; min-height: 46px; padding: 0 14px; border-radius: var(--r-control); border: 1.5px solid transparent;
  color: var(--side-ink); text-decoration: none; font-weight: 600; font-size: var(--fs-base); background: none; width: 100%; text-align: left;
}
.nav__item { transition: background-color .15s, border-color .15s; }
.nav__item:hover { background: var(--side-hover); }
.nav__item[aria-current="page"] { background: var(--side-active-bg); border-color: var(--side-active-border); color: var(--side-active-ink); }
.nav__item .badge-side { margin-left: auto; min-width: 30px; height: 22px; padding: 0 8px; border-radius: 99px; background: var(--side-badge); color: var(--side-badge-ink); font-size: .75rem; font-weight: 700; display: grid; place-items: center; }
.nav__item .phase { margin-left: auto; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--side-phase-border); font-size: .6875rem; font-weight: 700; color: #fff; }
.skyline { display: block; flex: none; margin: auto -16px 0; width: calc(100% + 32px); height: 120px; padding-top: 16px; pointer-events: none; }

.frame { min-width: 0; display: flex; flex-direction: column; padding: 16px 20px 24px 28px; gap: 16px; }
.topbar {
  position: sticky; top: 12px; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 18px 12px 14px;
  background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-card); border: 1px solid var(--border);
}
.topbar__mark { display: none; }
.search { position: relative; flex: 1; max-width: 620px; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 12px 0 16px; background: var(--field); border-radius: var(--r-control); color: var(--muted); }
.search:focus-within { box-shadow: 0 0 0 3px var(--ring); background: var(--card); }
.search input { flex: 1; border: 0; background: transparent; outline: none; color: var(--ink); min-width: 0; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font: 600 .6875rem ui-monospace, SFMono-Regular, Menlo, monospace; padding: 3px 7px; border-radius: 7px; background: #fff; border: 1px solid var(--border); color: var(--ink-2); }
.search__results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--border); border-radius: var(--r-box); box-shadow: var(--shadow-pop); max-height: 360px; overflow-y: auto; z-index: 40; }
.search__results li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: max(calc(var(--r-box) - 6px), 6px); color: var(--ink); cursor: pointer; }
.search__results li small { margin-left: auto; color: var(--muted); font-size: var(--fs-xs); }
.search__results li[aria-selected="true"], .search__results li:hover { background: var(--blue-soft); }
.search__results .empty-row { color: var(--muted); cursor: default; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.sync { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.sync::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--sync-dot, #4CAF7A); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sync-dot, #4CAF7A) 20%, transparent); }
.sync.is-demo { --sync-dot: var(--analytics); color: var(--analytics-ink); font-weight: 600; }
.sync.is-offline { --sync-dot: var(--warning); color: #845A06; }
.bell { background: var(--field); }
.badge { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: #E5484D; color: #fff; font-size: .6875rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.profile { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 2px; border-radius: 99px; text-align: left; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--avatar-grad); color: #fff; font-weight: 700; display: grid; place-items: center; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile__text b { display: block; font-size: var(--fs-base); font-weight: 600; }
.profile__text span { font-size: var(--fs-sm); color: var(--muted); }
.pop-wrap { position: relative; }
.pop { position: absolute; right: 0; top: calc(100% + 12px); width: 320px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-surface); box-shadow: var(--shadow-pop); padding: 8px; z-index: 40; }
.pop__title { font-weight: 700; padding: 8px 10px 4px; }
.pop .rows { padding: 0 10px; }
.pop__foot { padding: 8px 10px 4px; font-size: var(--fs-xs); color: var(--muted); }
.menu { width: 250px; }
.menu__head { padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu__head b { display: block; } .menu__head span { font-size: var(--fs-xs); color: var(--muted); word-break: break-all; }
.menu__item { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 10px; border-radius: var(--r-control); text-align: left; }
.menu__item { min-height: 44px; transition: background-color .15s; }
.menu__label { font-size: var(--fs-xs); color: var(--muted); padding: 6px 10px 4px; }
.skins { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 6px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.skin { display: grid; gap: 6px; justify-items: center; padding: 8px 6px; border: 1.5px solid var(--border); border-radius: var(--r-box); background: var(--card); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); min-height: 44px; }
.skin[aria-pressed="true"] { border-color: var(--blue); color: var(--ink); box-shadow: 0 0 0 3px var(--ring); }
.skin__sw { display: flex; gap: 3px; }
.skin__sw i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.menu__item:hover { background: var(--field); }

.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--r-box); font-size: var(--fs-sm); background: var(--warning-soft); color: #845A06; }

.canvas { background: var(--canvas); border-radius: var(--r-canvas); padding: 24px 26px 28px; outline: none; min-width: 0; }
.drawer-scrim { position: fixed; inset: 0; background: rgba(8, 30, 56, .45); z-index: 29; }

/* ---------- page header ---------- */
.crumb { font-size: var(--fs-sm); color: var(--muted); }
.page-title { font-size: 1.75rem; font-weight: 800; margin-top: 4px; letter-spacing: -.025em; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; }
.pagehead .filters { margin-top: 0; flex: 0 1 auto; }
.pagehead .filters__end { margin-left: 12px; }
.page-sub { color: var(--ink-2); margin-top: 6px; font-size: var(--fs-base); }

/* ---------- grids ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--card-gap); margin-top: var(--card-gap); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--card-gap); margin-top: var(--card-gap); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--card-gap); margin-top: var(--card-gap); align-items: start; }
.c-8 { grid-column: span 8; } .c-6 { grid-column: span 6; } .c-5 { grid-column: span 5; } .c-4 { grid-column: span 4; } .c-3 { grid-column: span 3; } .c-12 { grid-column: span 12; }
.stack { display: grid; gap: var(--card-gap); align-content: start; }

/* ---------- KPI card ---------- */
.kpi { position: relative; overflow: hidden; isolation: isolate; background: var(--card); border: 1px solid var(--border); border-radius: var(--card-r); padding: var(--card-pad); box-shadow: var(--shadow-card); display: flex; flex-direction: column; }
.kpi__head { display: flex; align-items: center; gap: 12px; }
.kpi__ic { width: 40px; height: 40px; border-radius: var(--ic-r); display: grid; place-items: center; flex: none; }
.kpi__ic .ic { width: 20px; height: 20px; }
.kpi__title { font-weight: 700; font-size: var(--fs-card-title); line-height: 1.3; color: var(--ink); }
.kpi__row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 12px; }
.kpi__value { font-size: var(--fs-figure); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.kpi__value small { font-size: .5em; font-weight: 600; letter-spacing: 0; margin-left: 2px; }
.kpi__line { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.kpi__line .kbar { flex: 1; margin-top: 0; }
.kpi__sub { margin-top: 6px; font-size: var(--fs-card-sub); color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; }
.kpi__sub > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kpi__sub .delta { flex: none; }
.kpi__wm { position: absolute; z-index: -1; right: -12px; bottom: -16px; width: 76px; height: 76px; color: var(--wm); stroke-width: 1.6; }
.delta { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.delta .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.delta--good { background: var(--up-bg); color: var(--up-ink); }
.delta--bad { background: var(--down-bg); color: var(--down-ink); }
.delta--flat { background: var(--field); color: var(--muted); }

.kpi--feature { background: var(--feature-grad); color: #fff; border-color: transparent; box-shadow: var(--shadow-feature); }
.kpi--feature .kpi__ic { background: rgba(255, 255, 255, .2); color: #fff; }
.kpi--feature .kpi__title { color: #fff; }
.kpi--feature .kpi__sub { color: rgba(255, 255, 255, .92); }
.kpi--feature .kpi__wm { color: rgba(255, 255, 255, .13); }
.kbar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .32); margin-top: 10px; overflow: hidden; }
.kbar span { display: block; height: 100%; width: var(--w, 0%); background: #fff; border-radius: 99px; transition: width 1s var(--ease); }
.kbar.is-over span { background: var(--on-feature-neg); }

/* ---------- status tiles ---------- */
.tile { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--card-r); padding: var(--card-pad); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tile__text { min-width: 0; position: relative; z-index: 1; }
.tile__label { display: flex; align-items: center; gap: 10px; font-size: var(--fs-card-title); font-weight: 700; line-height: 1.3; }
.tile__label::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tile__value { font-size: var(--fs-figure); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; flex: none; position: relative; z-index: 1; display: grid; justify-items: end; }
.tile__value small { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0; margin: 2px 0 0; }
.tile__sub { margin-top: 4px; font-size: var(--fs-card-sub); max-width: 44ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile__wm { position: absolute; z-index: -1; right: 70px; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; stroke-width: 1.4; opacity: .22; }
.tile--blue { background: var(--tile-blue); color: var(--tile-blue-ink); }
.tile--blue .tile__sub { color: var(--tile-blue-sub); }
.tile--yellow { background: var(--tile-yellow); color: var(--tile-yellow-ink); }
.tile--yellow .tile__sub { color: var(--tile-yellow-sub); }
.tile--pink { background: var(--tile-pink); color: var(--tile-pink-ink); }
.tile--pink .tile__sub { color: var(--tile-pink-sub); }
.tile--blue .tile__value, .tile--yellow .tile__value { color: var(--ink); }

/* ---------- panels ---------- */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--card-r); padding: var(--card-pad); min-width: 0; box-shadow: var(--shadow-card); }
.panel.fill { display: flex; flex-direction: column; align-self: stretch; }
.panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel__title { font-size: var(--fs-card-title); font-weight: 700; line-height: 1.3; }
.panel__desc { font-size: var(--fs-card-sub); color: var(--muted); margin-top: 4px; }
.link { display: inline-flex; align-items: center; min-height: 44px; margin: -12px -8px; padding: 0 8px; border-radius: var(--r-box); color: var(--link); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; white-space: nowrap; }
.link:hover { text-decoration: underline; }

.chart { position: relative; height: 230px; }
.chartbox[hidden] { display: none; }
.seg--sm { padding: 3px; } .seg--sm button { padding: 6px 10px; font-size: var(--fs-xs); }
.panel.fill .chartbox:not([hidden]) { flex: 1; display: flex; flex-direction: column; }
.panel.fill .chart { flex: 1; min-height: 220px; height: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-sm); color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { position: relative; height: 136px; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center b { font-size: var(--fs-lg); font-weight: 800; }
.donut-center span { font-size: var(--fs-xs); color: var(--muted); }
.cats { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.cats li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 7px 12px; background: var(--canvas); border-radius: var(--r-box); }
.cats .dot { width: 10px; height: 10px; border-radius: 50%; }
.cats b { font-weight: 600; font-size: var(--fs-sm); }
.cats small { grid-column: 2; font-size: var(--fs-xs); color: var(--muted); }
.cats .pct { font-weight: 700; font-size: var(--fs-sm); white-space: nowrap; }
.cats b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* budget bars: the percentage and status word are printed, colour is only the second cue */
.bar__name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.bar__pct { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.bar__pct .ic { width: 13px; height: 13px; stroke-width: 2.4; }
.bar__pct.is-green { background: var(--up-bg); color: var(--up-ink); }
.bar__pct.is-yellow { background: var(--warning-soft); color: #845A06; }
.bar__pct.is-red { background: var(--down-bg); color: var(--down-ink); }

/* chart fallback when Chart.js cannot load: a readable table instead of an empty box */
.panel.fill.no-chart { align-self: start; }
.ftable { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.ftable caption { text-align: left; color: var(--muted); font-size: var(--fs-xs); padding-bottom: 8px; }
.ftable th, .ftable td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.ftable th:first-child, .ftable td:first-child { text-align: left; }
.ftable thead th { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.ftable-wrap { overflow-x: auto; }
/* budget bars */
.bsum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.bsum dt { font-size: var(--fs-xs); color: var(--muted); } .bsum dd { margin: 2px 0 0; }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.bar__top { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); margin-bottom: 6px; }
.bar__top { align-items: center; }
.bar__top .bar__name { min-width: 0; overflow: hidden; } .bar__amt { white-space: nowrap; flex: none; }
.bar__top > span:first-child { font-weight: 600; }
.bar__track { height: 8px; border-radius: 99px; background: var(--track-pattern), var(--track); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 99px; width: var(--w); }
.s-green { background: var(--income); } .s-yellow { background: var(--warning); } .s-red { background: var(--expense); }

/* lists */
.rows { list-style: none; padding: 0; margin: 0; }
.row { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row__main { min-width: 0; }
.row__title { font-weight: 600; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__sub { font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__amt { text-align: right; font-size: var(--fs-sm); }
.row__amt small { display: block; font-weight: 500; color: var(--muted); font-size: var(--fs-xs); }
.chip-ic { width: 36px; height: 36px; border-radius: var(--ic-r); display: grid; place-items: center; }
.due { font-size: var(--fs-xs); font-weight: 600; }
.due.is-late { color: var(--down-ink) !important; } .due.is-soon { color: #94621A !important; }

.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 28px; }
.goals .goal { border-bottom: 0; padding: 4px 0; }
.goal { padding: 9px 0; border-bottom: 1px solid var(--border); }
.goal:last-child { border-bottom: 0; padding-bottom: 0; }
.goal__top { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); }
.goal__top b { font-weight: 600; }
.goal__track { height: 8px; border-radius: 99px; background: var(--track-pattern), var(--track); margin: 8px 0 6px; overflow: hidden; }
.goal__fill { height: 100%; width: var(--w); background: var(--gradient); border-radius: 99px; }
.goal__sub { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--muted); }

.foot-note { font-size: var(--fs-xs); color: var(--muted); margin-top: 14px; }

/* empty / coming soon */
.empty { display: grid; justify-items: start; gap: 10px; padding: 18px; border: 1px dashed var(--border-strong); border-radius: var(--r-box); color: var(--muted); font-size: var(--fs-sm); }
.empty b { color: var(--ink); font-size: var(--fs-base); }
.soon { max-width: 680px; margin-top: 26px; }
.soon__phase { display: inline-block; font-size: var(--fs-xs); font-weight: 700; color: var(--analytics-ink); background: var(--analytics-soft); padding: 4px 10px; border-radius: var(--r-chip); }
.soon h2 { font-size: var(--fs-xl); font-weight: 800; margin: 12px 0 8px; }
.soon ul { margin: 14px 0 0; padding-left: 20px; color: var(--ink-2); display: grid; gap: 6px; }

.sk { background: linear-gradient(90deg, var(--sk-a) 0%, var(--sk-b) 50%, var(--sk-a) 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: var(--r-card); }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- mobile tab bar + FAB ---------- */
.tabbar, .fab { display: none; }

/* ---------- quick-add sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(8, 30, 56, .42); z-index: 60; animation: fade .2s ease; }
.sheet { position: fixed; z-index: 61; right: 24px; top: 24px; bottom: 24px; width: 440px; background: var(--card); border-radius: var(--r-surface); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; animation: slide-in .26s var(--ease); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 10px; }
.sheet__head h2 { font-size: var(--fs-lg); font-weight: 800; }
.sheet__body { padding: 6px 22px 16px; overflow-y: auto; display: grid; gap: 16px; align-content: start; flex: 1; }
.sheet__foot { padding: 12px 22px calc(16px + var(--safe-b)); border-top: 1px solid var(--border); }
.sheet .seg { display: grid; grid-template-columns: repeat(3, 1fr); }
.sheet .seg button { padding: 10px 6px; }
.sheet .seg button[aria-pressed="true"][data-type="EXPENSE"] { color: var(--down-ink); }
.sheet .seg button[aria-pressed="true"][data-type="INCOME"] { color: var(--up-ink); }
.sheet .seg button[aria-pressed="true"][data-type="TRANSFER"] { color: var(--blue); }
.amount { display: flex; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--border); padding: 4px 2px 8px; }
.amount:focus-within { border-color: var(--blue); }
.amount span { font-size: var(--fs-lg); font-weight: 700; color: var(--muted); }
.amount input { border: 0; outline: none; width: 100%; font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; background: transparent; padding: 0; }
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { transition: background-color .15s, border-color .15s; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: var(--r-chip); border: 1px solid var(--border); background: #fff; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); }
.pick:hover { border-color: var(--border-strong); }
.pick[aria-pressed="true"] { border-color: var(--pick-on-border); background: var(--pick-on-bg); color: var(--pick-on-ink); font-weight: 600; }
.pick .ic { width: 16px; height: 16px; }
.form-err { color: var(--down-ink); font-size: var(--fs-sm); background: var(--down-bg); padding: 10px 12px; border-radius: var(--r-ctl); }
.who-rec { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 80; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; gap: 10px; align-items: center; background: var(--toast); color: #fff; padding: 12px 16px; border-radius: var(--r-control); box-shadow: var(--shadow-pop); font-size: var(--fs-sm); animation: rise .25s var(--ease); }
.toast--err { background: #8F2F37; }

@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1439px) {
  :root { --side-w: 264px; }
  .canvas { padding: 22px 22px 26px; }
  :root { --card-gap: 16px; }
}
@media (max-width: 1279px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-8, .c-6 { grid-column: span 12; }
  .c-5, .c-4, .c-3 { grid-column: span 6; }
  .profile__text { display: none; }
}
/* tablet & phone: sidebar becomes a drawer opened by the menu button */
@media (max-width: 1099px) {
  .shell, .shell.is-collapsed { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 12px; top: 12px; bottom: 12px; height: auto; margin: 0; width: min(300px, 82vw); transform: translateX(-100%); box-shadow: var(--shadow-pop); z-index: 70; }
  .shell.is-drawer .sidebar { transform: none; }
  .sidebar { transform: translateX(calc(-100% - 24px)); }
  .drawer-scrim { z-index: 69; }
  .frame { padding: 12px 16px 24px; }
  .tiles { grid-template-columns: 1fr; }
  .c-5, .c-4, .c-3 { grid-column: span 12; }
  .tile { min-height: 0; }
  .tile__wm { width: 88px; height: 88px; right: 16px; }
  .sync { display: none; }
  .sync.is-demo { display: inline-flex; }
  .sync__long { display: none; }
}
@media (max-width: 767px) {
  .frame { padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 0; gap: 12px; }
  .topbar { top: calc(6px + env(safe-area-inset-top, 0px)); padding: 8px 10px; gap: 8px; }
  .search { display: none; }
  .topbar__mark { display: block; width: 34px; height: auto; }
  .topbar__right { gap: 6px; }
  .avatar { width: 40px; height: 40px; }
  .canvas { padding: 22px 14px calc(var(--tab-h) + 44px + var(--safe-b)); margin: 0 -4px; }
  .page-title { margin-top: 4px; }
  .filters { gap: 8px; margin-top: 16px; }
  .fbox { min-width: 0; flex: 1 1 140px; min-height: 54px; padding-left: 14px; }
  .filters__end { margin-left: 0; width: 100%; }
  .filters__end .btn--primary { display: none; }
  .filters__end .btn--icon { display: none; }
  :root { --r-surface: 18px; --card-pad: 16px; --card-gap: 12px; --fs-card-title: .9375rem; --fs-figure: 1.5rem; --fs-card-sub: var(--fs-xs); }
  .kpi { min-height: 150px; }
  .kpis { grid-auto-rows: auto; }
  .kpi__ic { width: 40px; height: 40px; }
  .kpi__ic .ic { width: 20px; height: 20px; }
  .kpi__head { gap: 10px; align-items: flex-start; }
  .kpi__row { margin-top: 12px; }
  .kpi__sub, .tile__sub { margin-top: 8px; }
  .tile__value { margin-top: 12px; }
  .kpi__wm { width: 80px; height: 80px; }
  .kpis { grid-auto-flow: row dense; }
  .kpi--feature, .kpi:first-child { grid-column: span 2; }
  .kpi:first-child { min-height: 0; }
  .delta__vs { display: none; }
  .panel__head { margin-bottom: 14px; }
  .chart { height: 230px; }
  .bsum { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pop { position: fixed; left: 12px; right: 12px; top: 72px; width: auto; }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr;
    height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(255, 255, 255, .97); border-radius: var(--r-surface) var(--r-surface) 0 0; box-shadow: 0 -8px 24px -16px rgba(15, 27, 45, .25);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border);
  }
  .tab { display: grid; place-items: center; align-content: center; gap: 3px; text-decoration: none; color: var(--tab-ink); font-size: .75rem; font-weight: 600; }
  .tab[aria-current="page"] { color: var(--link); }
  .tab .ic { width: 22px; height: 22px; }
  .fab {
    position: fixed; z-index: 41; left: 50%; bottom: calc(var(--safe-b) + 18px); transform: translateX(-50%);
    width: 60px; height: 60px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff;
    background: var(--fab-bg); box-shadow: 0 10px 22px -8px var(--btn-shadow), 0 0 0 5px var(--card);
  }
  .fab .ic { width: 28px; height: 28px; stroke-width: 2.4; }
  .sheet { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 92dvh; border-radius: var(--r-surface) var(--r-surface) 0 0; animation: sheet-up .28s var(--ease); }
  .sheet::before { content: ''; width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); margin: 8px auto 0; }
  .toasts { bottom: calc(var(--tab-h) + 30px + var(--safe-b)); }
}
@keyframes sheet-up { from { transform: translateY(100%); } }
@media (min-width: 768px) and (max-width: 1099px) {
  .fab { display: grid; place-items: center; position: fixed; right: 24px; bottom: 24px; width: 58px; height: 58px; border-radius: 50%; border: 0; color: #fff; background: var(--fab-bg); box-shadow: var(--shadow-feature); z-index: 41; }
}
/* ==========================================================================
   Skin: Biru Lotus — airy blue, white glass sidebar, lotus & water decoration.
   Layout follows the owner's "Alesya Finance Lotus Dashboard" reference.
   ========================================================================== */
.brand__mark, .brand__sub, .side-lotus, .profile__chev { display: none; }
.ic--xs { width: 13px; height: 13px; }
:root[data-skin~="blue"] {
  --page: #EEF5FE; --canvas: transparent; --card: #FFFFFF; --field: #F2F7FD; --border: #E4EDF8; --border-strong: #CFDDEE;
  --ink: #0F2A4A; --ink-2: #2D4563; --muted: #62748C; --faint: #9AABC0;
  --side-grad: rgba(255, 255, 255, .74); --side-ink: #1B3556; --side-muted: #6B7C93; --side-line: rgba(30, 80, 150, .25);
  --side-hover: #EEF5FE; --side-active-bg: #DCEBFB; --side-active-border: transparent; --side-active-ink: #0F2A4A; --side-tile-ring: #fff;
  --shadow-card: 0 1px 2px rgba(20, 60, 120, .04), 0 12px 30px -20px rgba(30, 90, 170, .35);
  --btn-grad: linear-gradient(180deg, #2F8CEB, #1872D9); --btn-grad-hover: linear-gradient(180deg, #2581E0, #1366C7); --btn-shadow: rgba(24, 114, 217, .75);
  --fab-bg: linear-gradient(180deg, #2F8CEB, #1872D9);
  --chart-income: #3E9BF2; --chart-income-2: #A8D3FB; --chart-expense: #B095F4; --chart-expense-2: #E4DAFD; --chart-grid: #EDF2F8; --chart-text: #6B7C93; --tooltip: #0F2A4A;
  --up-bg: #DDF5E8; --up-ink: #15803D; --down-bg: #FDE3E6; --down-ink: #C0262D; --income-ink: #16A34A; --expense-ink: #DC2626; --link: #1D6FD6;
}
:root[data-skin~="blue"] body { background: #EEF5FE url(../assets/img/waves.svg) center / cover fixed no-repeat; }

/* sidebar: white glass panel, stacked lotus logo */
:root[data-skin~="blue"] .sidebar { backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 20px 40px -28px rgba(30, 90, 170, .45); padding-top: 26px; }
:root[data-skin~="blue"] .brand { flex-direction: column; gap: 4px; padding: 0; text-align: center; }
:root[data-skin~="blue"] .brand__tile, :root[data-skin~="blue"] .brand__fin, :root[data-skin~="blue"] .brand__tag, :root[data-skin~="blue"] .nav__group,
:root[data-skin~="blue"] .nav__item .phase, :root[data-skin~="blue"] .nav__item .badge-side, :root[data-skin~="blue"] .skyline,
:root[data-skin~="blue"] .nav > button.nav__item { display: none; }
:root[data-skin~="blue"] .brand__mark { display: block; width: 92px; height: auto; }
:root[data-skin~="blue"] .brand__name { font-size: 1.75rem; font-weight: 800; color: #0D4A9E; letter-spacing: .04em; line-height: 1.1; }
:root[data-skin~="blue"] .brand__sub { display: flex; align-items: center; gap: 8px; font-size: .8125rem; font-weight: 700; letter-spacing: .3em; color: #0D4A9E; margin: 0 0 26px; }
:root[data-skin~="blue"] .brand__sub::before, :root[data-skin~="blue"] .brand__sub::after { content: ''; width: 18px; height: 2px; background: #0D4A9E; border-radius: 2px; }
:root[data-skin~="blue"] .nav { gap: 6px; }
:root[data-skin~="blue"] .side-lotus { display: block; width: 180px; height: auto; margin: auto auto 6px; opacity: .95; flex: none; }

/* top bar: no card — search, bell and profile float at the top right */
:root[data-skin~="blue"] .topbar { background: transparent; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
:root[data-skin~="blue"] .search { background: rgba(255, 255, 255, .92); box-shadow: var(--shadow-card); border: 1px solid #fff; border-radius: 999px; }
:root[data-skin~="blue"] .bell { width: 48px; height: 48px; background: #fff; box-shadow: var(--shadow-card); }
:root[data-skin~="blue"] .bell .ic { color: #1D6FD6; width: 22px; height: 22px; }
:root[data-skin~="blue"] .profile { background: #fff; border-radius: 999px; padding: 4px 14px 4px 4px; box-shadow: var(--shadow-card); }
:root[data-skin~="blue"] .profile .avatar { width: 40px; height: 40px; background: linear-gradient(135deg, #5AB0F7, #2F7FE0); }
:root[data-skin~="blue"] .profile__text b { font-size: var(--fs-sm); font-weight: 700; }
:root[data-skin~="blue"] .profile__text span { display: none; }
:root[data-skin~="blue"] .profile__chev { display: block; color: var(--ink-2); }
:root[data-skin~="blue"] .canvas { background: transparent; border: 0; box-shadow: none; padding: 0; }
:root[data-skin~="blue"] .banner { border-radius: var(--r-box); }

/* dashboard header */
.lt { position: relative; }
.lt-hello { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; margin-bottom: 18px; min-height: 112px; }
.lt-hello__title { font-size: 1.875rem; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; color: var(--ink); }
.lt-wave { font-size: .85em; }
.lt-hello__sub { color: var(--ink-2); margin-top: 6px; font-size: var(--fs-base); }
.lt-hello__lotus { position: absolute; right: 620px; top: -30px; width: 190px; height: auto; pointer-events: none; opacity: .95; z-index: 0; }
.lt-demo { font-size: var(--fs-xs); font-weight: 600; color: var(--analytics-ink); background: rgba(255, 255, 255, .85); padding: 4px 12px; border-radius: 999px; }
.lt-hello__text, .lt-hello__side { position: relative; z-index: 1; }
.lt-hello__side { display: flex; flex-direction: row-reverse; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px 12px; padding-top: 64px; }
.lt-month { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; background: #fff; border-radius: 999px; box-shadow: var(--shadow-card); border: 1px solid #fff; color: #1D6FD6; position: relative; }
.lt-month:focus-within { box-shadow: 0 0 0 3px var(--ring), var(--shadow-card); }
.lt-month select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font-weight: 700; color: var(--ink); font-size: var(--fs-base); padding-right: 22px; margin-right: -22px; cursor: pointer; outline: none; }
.lt-month .ic:last-child { color: var(--ink-2); pointer-events: none; }
.lt-range { display: flex; gap: 8px; }
.lt-date { display: grid; background: #fff; border-radius: 14px; padding: 4px 12px; box-shadow: var(--shadow-card); font-size: var(--fs-xs); color: var(--muted); }
.lt-date input { border: 0; font-weight: 600; color: var(--ink); background: transparent; outline: none; }

/* KPI row */
.lt-kpis { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(0, 5fr); gap: 14px; }
.lt-minis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.lt-hero { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r-surface); padding: 20px 22px 18px; color: #fff; min-height: 150px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 140% at 0% 0%, #4FA9F6 0%, #1E88E5 45%, #0B63CE 100%); box-shadow: 0 18px 34px -18px rgba(11, 99, 206, .8); }
.lt-hero__top { display: flex; align-items: center; gap: 14px; }
.lt-hero__ic { width: 56px; height: 56px; border-radius: 16px; background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .35); display: grid; place-items: center; flex: none; }
.lt-hero__ic .ic { width: 28px; height: 28px; }
.lt-hero__label { flex: 1; min-width: 0; font-weight: 600; font-size: var(--fs-base); opacity: .95; }
.lt-hero__value { font-size: min(2rem, 2.05vw); font-weight: 800; letter-spacing: -.02em; margin-top: 10px; white-space: nowrap; }
.lt-eye { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: #fff; display: grid; place-items: center; flex: none; }
.lt-eye:hover { background: rgba(255, 255, 255, .15); }
.lt-eye .ic { width: 24px; height: 24px; }
.lt-hero__foot { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); margin-top: 8px; position: relative; z-index: 1; }
.lt-hero__foot .lt-delta { background: rgba(255, 255, 255, .92); }
.lt-hero__wave { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 46px; z-index: -1; }
.lt-kpi { position: relative; border-radius: var(--r-surface); padding: 16px; min-height: 150px; display: flex; flex-direction: column; border: 1px solid #fff; box-shadow: var(--shadow-card); min-width: 0; }
.lt-kpi__ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 10px; }
.lt-kpi__ic .ic { width: 22px; height: 22px; }
.lt-kpi__label { font-weight: 600; font-size: var(--fs-sm); color: var(--ink); }
.lt-kpi__value { font-size: min(1.1875rem, 1.12vw); font-weight: 800; margin-top: 2px; color: var(--ink); white-space: nowrap; }
.lt-kpi__foot { margin-top: auto; padding-top: 8px; }
.lt-kpi--mint { background: linear-gradient(160deg, #E6F8EF, #FFFFFF 85%); } .lt-kpi--mint .lt-kpi__ic { background: #CFF1DF; color: #16A34A; }
.lt-kpi--rose { background: linear-gradient(160deg, #FDE8EC, #FFFFFF 85%); } .lt-kpi--rose .lt-kpi__ic { background: #FBD3DB; color: #E11D48; }
.lt-kpi--sky { background: linear-gradient(160deg, #E4F0FD, #FFFFFF 85%); } .lt-kpi--sky .lt-kpi__ic { background: #CFE3FB; color: #1D6FD6; }
.lt-kpi--lilac { background: linear-gradient(160deg, #EEE9FE, #FFFFFF 85%); } .lt-kpi--lilac .lt-kpi__ic { background: #DDD3FC; color: #7C3AED; }
.lt-kpi--peach { background: linear-gradient(160deg, #FEEEDF, #FFFFFF 85%); } .lt-kpi--peach .lt-kpi__ic { background: #FDDCBD; color: #EA7A12; }
.lt-delta { display: inline-flex; align-items: center; gap: 3px; padding: 3px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.lt-delta.is-good { background: var(--up-bg); color: var(--up-ink); } .lt-delta.is-bad { background: var(--down-bg); color: var(--down-ink); } .lt-delta.is-flat { background: #EEF2F7; color: var(--muted); }
.lt-note { font-size: var(--fs-xs); color: var(--muted); }

/* panels */
.lt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.lt-panel { background: rgba(255, 255, 255, .92); border: 1px solid #fff; border-radius: var(--r-surface); padding: 16px 20px; box-shadow: var(--shadow-card); min-width: 0; }
.lt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.lt-h { font-size: 1.0625rem; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.lt-h .ic { color: #1D6FD6; }
.lt-more { display: inline-flex; align-items: center; gap: 4px; color: var(--link); font-size: var(--fs-xs); font-weight: 600; text-decoration: none; white-space: nowrap; }
.lt-more:hover { text-decoration: underline; }
.lt-legend { display: flex; justify-content: center; gap: 18px; font-size: var(--fs-xs); color: var(--ink-2); margin: -2px 0 6px; }
.lt-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.lt-chart { position: relative; height: 176px; }
.lt-donut { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 16px; align-items: center; }
.lt-donut__chart { position: relative; height: 168px; }
.lt-donut__center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; line-height: 1.15; }
.lt-donut__center span { font-weight: 700; font-size: var(--fs-sm); color: var(--ink); }
.lt-donut__center b { font-size: .9375rem; font-weight: 800; }
.lt-cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lt-cats li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: var(--fs-xs); color: var(--ink-2); }
.lt-cats__ic .ic { width: 18px; height: 18px; }
.lt-cats__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-cats b { color: var(--ink); }
.lt-tile { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.lt-tile .ic { width: 20px; height: 20px; }
.lt-tile--round { border-radius: 50%; width: 44px; height: 44px; }
.lt-budget, .lt-goals, .lt-list { list-style: none; margin: 0; padding: 0; display: grid; }
.lt-budget { gap: 10px; }
.lt-budget li, .lt-goals li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.lt-budget__top, .lt-goals__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.lt-budget__top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-budget__pct { font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.lt-budget__pct.is-red { color: var(--down-ink); }
.lt-track { height: 8px; border-radius: 999px; background: #EAF0F7; margin-top: 6px; overflow: hidden; }
.lt-track span { display: block; height: 100%; border-radius: 999px; }
.lt-goals { gap: 12px; }
.lt-goals__top > div { display: grid; min-width: 0; }
.lt-goals__top b { font-weight: 600; }
.lt-goals__top span { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid #EEF3F9; }
.lt-list li:last-child { border-bottom: 0; }
.lt-list__main { display: grid; min-width: 0; }
.lt-list__main b { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-list__main span, .lt-list__side span { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-list__side { display: grid; justify-items: end; }
.lt-list__side b { font-size: var(--fs-sm); white-space: nowrap; }
.lt-amount { padding: 4px 10px; border-radius: 8px; font-size: var(--fs-xs); font-weight: 700; background: #FDE3E6; color: #C0262D; white-space: nowrap; }
.lt-amount.is-recv { background: #DDF5E8; color: #15803D; }

/* responsive */
@media (min-width: 1100px) {
  :root[data-skin~="blue"] .frame { position: relative; padding: 24px 28px 20px; }
  :root[data-skin~="blue"] .topbar { position: absolute; top: 24px; right: 28px; padding: 0; gap: 12px; z-index: 5; }
  :root[data-skin~="blue"] #menu-btn { display: none; }
  :root[data-skin~="blue"] .search { width: 300px; flex: none; height: 48px; }
  :root[data-skin~="blue"] .sync { display: none; }
  :root[data-skin~="blue"] .search kbd { display: none; }
  :root[data-skin~="blue"] .shell { grid-template-columns: calc(236px + 16px) 1fr; }
  :root[data-skin~="blue"] #app:not([data-route="dashboard"]) .canvas { padding-top: 76px; }
}
@media (max-width: 1599px) {
  .lt-kpis { grid-template-columns: minmax(0, 1.5fr) minmax(0, 5fr); gap: 12px; }
  .lt-minis { gap: 10px; }
  .lt-kpi { padding: 14px; }
  .lt-hero { padding: 18px; }
  .lt-hero__ic { width: 48px; height: 48px; }
  .lt-hero__top { gap: 12px; }
}
@media (max-width: 1399px) { .lt-hello__lotus { display: none; } }
@media (max-width: 1279px) {
  .lt-kpis { grid-template-columns: 1fr; }
  .lt-hero { min-height: 0; }
  .lt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lt-hello__lotus { display: none; }
}
@media (max-width: 1099px) {
  :root[data-skin~="blue"] .topbar { background: rgba(255, 255, 255, .8); border: 1px solid #fff; box-shadow: var(--shadow-card); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  :root[data-skin~="blue"] .canvas { padding: 4px 4px 24px; }
  .lt-demo { display: none; }
  .lt-kpi__value { font-size: 1.0625rem; }
  .lt-hero__value { font-size: 1.875rem; }
  .lt-hello { grid-template-columns: 1fr; min-height: 0; }
  .lt-hello__side { flex-direction: row; padding-top: 0; }
  .lt-minis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .lt-minis > :nth-child(-n+3) { grid-column: span 2; }
  .lt-minis > :nth-child(n+4) { grid-column: span 3; }
}
@media (max-width: 767px) {
  :root[data-skin~="blue"] .profile { padding: 2px; box-shadow: none; background: transparent; }
  :root[data-skin~="blue"] .profile__chev { display: none; }
  .lt-hello__title { font-size: 1.375rem; }
  .lt-hello__sub { font-size: var(--fs-sm); }
  .lt-hello__lotus { display: block; width: 120px; top: -18px; left: auto; right: -14px; transform: none; opacity: .75; }
  .lt-month { width: 100%; justify-content: flex-start; }
  .lt-month select { flex: 1; }
  .lt-hello__side { flex-direction: column; align-items: stretch; }
  .lt-hero__value { font-size: 1.75rem; }
  :root[data-skin~="blue"] .canvas { padding: 4px 2px calc(var(--tab-h) + 44px + var(--safe-b)); }
  .lt-kpi__value { font-size: 1rem; }
  .lt-kpis { gap: 10px; }
  .lt-minis > * { grid-column: auto !important; }
  .lt-minis { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 44%; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -14px; padding: 2px 14px 8px; gap: 10px; scrollbar-width: none; }
  .lt-minis::-webkit-scrollbar { display: none; }
  .lt-minis > * { scroll-snap-align: start; }
  .lt-kpi { min-height: 136px; }
  .lt-grid { grid-template-columns: 1fr; }
  .lt-donut { grid-template-columns: 140px minmax(0, 1fr); }
  .lt-donut__chart { height: 140px; }
}

/* ==========================================================================
   Skin: Sage — soft, natural, "aesthetic" (selected per user, stored in localStorage)
   Same layout and card system; only colours and shape softness change.
   ========================================================================== */
:root[data-skin="sage"] {
  --blue: #2F6B45; --cyan: #8C9E78; --deep: #1F3D2A; --gradient: linear-gradient(135deg, #2F6B45 0%, #8C9E78 100%);
  --side-grad: linear-gradient(180deg, #E9F0E5 0%, #E1EBDC 55%, #D8E6D2 100%);
  --feature-grad: radial-gradient(120% 140% at 0% 0%, #4A8560 0%, #2F6B45 45%, #23573A 100%);
  --page: #EEF2EA; --canvas: #F8F7F2; --card: #FFFFFF; --field: #F2F1EB; --border: #E8E6DD; --border-strong: #D7D4C8;
  --ink: #1F2A22; --ink-2: #3A463C; --muted: #66705F; --faint: #99A192;
  --income-ink: #2F6B45; --expense-ink: #A8452F; --link: #2F6B45; --tab-ink: #737C6F;
  --income: #3F7D52; --expense: #C8684F; --warning: #D9A93F; --analytics: #9F7BBE; --neutral: #6B7568;
  --income-soft: #E3EDDD; --expense-soft: #F8E5DE; --warning-soft: #F8EED3; --analytics-soft: #F1E8F6; --blue-soft: #E3EDDD; --cyan-soft: #DDF0EF;
  --up-bg: #E3EDDD; --up-ink: #2F6B45; --down-bg: #F8E5DE; --down-ink: #A8452F;
  --tile-blue: #E1EDDD; --tile-blue-ink: #2F5D3A; --tile-blue-sub: #4D6852;
  --tile-yellow: #F7E9BF; --tile-yellow-ink: #6F5310; --tile-yellow-sub: #7E6424;
  --tile-pink: #F4DFD7; --tile-pink-ink: #9A3D2A; --tile-pink-sub: #93503F; --analytics-ink: #6E4A8F;
  --shadow-card: 0 1px 2px rgba(31, 42, 34, .04), 0 10px 26px -14px rgba(31, 42, 34, .12);
  --shadow-feature: 0 18px 34px -16px rgba(36, 87, 58, .65);
  --r-surface: 24px; --r-control: 999px; --r-inner: 50%; --r-box: 16px; --btn-r-inner: 999px;
  --btn-grad: linear-gradient(180deg, #2F6B45, #245A39); --btn-grad-hover: linear-gradient(180deg, #285E3C, #1D4C30); --btn-shadow: rgba(36, 90, 57, .6);
  --ring: rgba(47, 107, 69, .18); --fbox-focus: #A9C59F; --fbox-active-bg: #EAF1E6; --fbox-active-border: #CADCC2;
  --side-ink: #1F3D2A; --side-muted: #5E7563; --side-line: rgba(31, 61, 42, .35); --side-hover: rgba(47, 107, 69, .09);
  --side-active-bg: #2F6B45; --side-active-border: #2F6B45; --side-active-ink: #FFFFFF;
  --side-badge: #2F6B45; --side-badge-ink: #FFFFFF; --side-phase-border: rgba(31, 61, 42, .3); --side-tile-ring: #FFFFFF; --skyline: #2F6B45; --side-tag: #3F5E48;
  --login-bg: linear-gradient(180deg, #E9F0E5, #DCE8D7); --fab-bg: linear-gradient(180deg, #2F6B45, #245A39); --avatar-grad: linear-gradient(135deg, #8C9E78, #5E7F5E);
  --on-feature-neg: #FFE0D6; --wm: #EEF1E8; --track: #F1EFE8;
  --track-pattern: repeating-linear-gradient(135deg, rgba(160, 150, 120, .18) 0 1.5px, transparent 1.5px 6px);
  --pick-on-border: #9EBC9F; --pick-on-bg: #E3EDDD; --pick-on-ink: #1F4D31; --toast: #1F3D2A; --sk-a: #ECEBE3; --sk-b: #F7F6F1;
  --ic-balance-bg: #E3EDDD; --ic-balance: #2F6B45; --ic-savings-bg: #DDF0EF; --ic-savings: #3B7F7B; --ic-debt: #A87F22; --dot-other: #D6D2C4;
  --chart-income: #456B52; --chart-expense: #E1BD6B; --chart-line: #2F6B45; --chart-fill: rgba(47, 107, 69, .2); --chart-grid: #EEEDE6; --chart-zero: #A5AC9F; --chart-text: #66705F; --tooltip: #1F3D2A;
}
:root[data-skin="sage"] .canvas { border: 1px solid #ECEAE2; }
:root[data-skin="sage"] .kpi, :root[data-skin="sage"] .panel { border-color: #EEECE4; }
:root[data-skin="sage"] .tile--blue .tile__value, :root[data-skin="sage"] .tile--yellow .tile__value { color: var(--ink); }
:root[data-skin="sage"] .brand__name { color: #1F3D2A; }
:root[data-skin="sage"] .nav__item .phase { color: var(--side-muted); }
:root[data-skin="sage"] .nav__item[aria-current="page"] .phase { color: #fff; border-color: rgba(255, 255, 255, .5); }
:root[data-skin="sage"] .fbox { padding-left: 22px; }
:root[data-skin="sage"] .bell { background: #F2F1EB; }
@media (max-width: 767px) { :root[data-skin="sage"] { --r-surface: 20px; } }

/* ==========================================================================
   Sage layout (dashboard + shell) — only active when the Sage skin is selected.
   ========================================================================== */
.greet { display: none; }
.sg { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.sg-hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.sg-hello__hi { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.sg-hello__hi .ic { color: #C9A24A; }
.sg-hello__name { font-size: 1.75rem; font-weight: 800; letter-spacing: -.025em; margin-top: 2px; }
.sg-hello__date { color: var(--muted); margin-top: 4px; font-size: var(--fs-sm); }
.sg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.sg-main, .sg-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }

.sg-search { display: flex; gap: 10px; }
.sg-search__box { flex: 1; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 18px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-control); color: var(--muted); box-shadow: var(--shadow-card); }
.sg-search__box:focus-within { border-color: var(--fbox-focus); box-shadow: 0 0 0 3px var(--ring); }
.sg-search__box input { flex: 1; border: 0; outline: none; background: transparent; font-size: var(--fs-base); color: var(--ink); min-width: 0; }
.sg-filter { width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%; background: var(--btn-grad); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px -10px var(--btn-shadow); }
.sg-filter[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--ring); }
.sg-range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sg-range .filters__err { grid-column: 1 / -1; }

.sg-quick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; max-width: 560px; }
.sg-q { display: grid; justify-items: center; gap: 6px; border: 0; background: none; padding: 0; color: var(--ink-2); font-size: var(--fs-xs); font-weight: 500; text-decoration: none; text-align: center; }
.sg-q__ic { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--border); color: var(--ink-2); box-shadow: var(--shadow-card); transition: background-color .15s, border-color .15s, transform .12s; }
.sg-q__ic .ic { width: 22px; height: 22px; stroke-width: 1.8; }
.sg-q:hover .sg-q__ic { border-color: #C5D8C0; }
.sg-q:active .sg-q__ic { transform: scale(.96); }
.sg-q.is-on .sg-q__ic { background: #DBE9D8; border-color: #C5D8C0; color: #2F6B45; }
.sg-q.is-on { color: #2F6B45; font-weight: 600; }

.sg-banner { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; padding: 18px 20px 16px 22px; border-radius: var(--card-r); background: #E1EDDD; isolation: isolate; }
.sg-banner::before { content: ''; position: absolute; z-index: -1; right: -60px; bottom: -90px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0)); }
.sg-banner h2 { font-size: var(--fs-md); font-weight: 700; color: #1F3D2A; }
.sg-banner__value { font-size: 1.75rem; font-weight: 800; color: #1F3D2A; letter-spacing: -.025em; margin-top: 6px; }
.sg-banner__sub { color: #4D6852; font-size: var(--fs-sm); margin-top: 4px; }
.sg-banner .btn { margin-top: 12px; min-height: 40px; padding: 0 18px; }
.sg-art { width: 128px; height: auto; display: block; }

.sg-pills { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sg-pill { min-height: 40px; padding: 0 18px; border-radius: var(--r-control); border: 1px solid transparent; background: #ECEBE4; color: var(--ink-2); font-weight: 600; font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: 8px; }
.sg-pill[aria-pressed="true"] { background: var(--btn-grad); color: #fff; box-shadow: 0 8px 16px -10px var(--btn-shadow); }
.sg-pill--ghost { margin-left: auto; background: var(--card); border-color: var(--border); }
.sg-pill--ghost[aria-pressed="true"] { background: var(--card); color: #2F6B45; border-color: #9EBC9F; box-shadow: none; }

.sg-card { background: var(--card); border: 1px solid #EEECE4; border-radius: var(--card-r); padding: 18px; box-shadow: var(--shadow-card); min-width: 0; }
.sg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sg-h { font-size: var(--fs-card-title); font-weight: 700; display: flex; align-items: center; gap: 10px; }
.sg-h--lg { font-size: 1.1875rem; }
.sg-h .ic { color: #2F6B45; }
.sg-sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }

.sg-summary__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sg-summary__net { font-size: 1.625rem; font-weight: 800; color: #2F6B45; letter-spacing: -.02em; }
.sg-summary__net small, .sg-stats dd small, .sg-row__side .num small { font-size: .6em; margin-left: 1px; }
.sg-summary__net.neg { color: var(--expense-ink); }
.sg-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 12px 0 0; }
.sg-stats > div { text-align: center; padding: 2px 8px; display: grid; gap: 4px; justify-items: center; align-content: start; }
.sg-stats > div + div { border-left: 1px solid var(--border); }
.sg-stats dt { font-size: var(--fs-xs); color: var(--muted); }
.sg-stats dd { margin: 0; font-size: 1.0625rem; font-weight: 700; }
.sg-delta { font-size: .6875rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.sg-delta.is-good { background: var(--up-bg); color: var(--up-ink); } .sg-delta.is-bad { background: var(--down-bg); color: var(--down-ink); }

.sg-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sg-bars li { display: grid; gap: 10px; justify-items: center; }
.sg-bar { position: relative; width: 100%; max-width: 70px; height: 150px; border-radius: 999px; background: var(--track-pattern), var(--track); overflow: hidden; }
.sg-bar__fill { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); border-radius: 999px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px; color: #fff; }
.sg-bar__fill b { font-size: var(--fs-sm); font-weight: 700; }
.sg-bar__fill.is-green { background: #456B52; } .sg-bar__fill.is-yellow { background: #E1BD6B; color: #3D2F0A; } .sg-bar__fill.is-red { background: #D9906F; color: #3F1B10; }
.sg-bar__label { font-size: var(--fs-xs); color: var(--ink-2); text-align: center; line-height: 1.3; }
.sg-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: var(--fs-xs); color: var(--muted); }
.sg-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.sg-legend .is-green { background: #456B52; } .sg-legend .is-yellow { background: #E1BD6B; } .sg-legend .is-red { background: #D9906F; }

.sg-rail { display: grid; grid-auto-flow: column; grid-auto-columns: 250px; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 10px; margin: 0 -2px; scrollbar-width: thin; }
.sg-rail > * { scroll-snap-align: start; }
.sg-list { background: var(--card); border: 1px solid #EEECE4; border-radius: var(--r-surface); overflow: hidden; box-shadow: var(--shadow-card); }
.sg-list__media { position: relative; height: 80px; display: grid; place-items: center; background: linear-gradient(160deg, #E8EFE4, #D2E1CC); }
.sg-list__media.is-recv { background: linear-gradient(160deg, #F8EFD5, #EEDCA9); }
.sg-list__art { width: 44px; height: 44px; color: #2F6B45; opacity: .55; stroke-width: 1.4; }
.sg-list__media.is-recv .sg-list__art { color: #8A6A1A; }
.sg-tag { position: absolute; top: 10px; left: 10px; padding: 4px 12px; border-radius: 999px; background: rgba(31, 42, 34, .72); color: #fff; font-size: var(--fs-xs); font-weight: 600; }
.sg-tag.is-late { background: #A8452F; }
.sg-list__body { padding: 10px 14px 12px; display: grid; gap: 4px; }
.sg-list__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sg-list__amt { font-size: 1.125rem; font-weight: 800; }
.sg-list__amt small { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.sg-chip { padding: 3px 10px; border-radius: 999px; background: #E3EDDD; color: #2F6B45; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.sg-chip.is-recv { background: #F6EAC6; color: #6F5310; }
.sg-list__name { font-weight: 600; font-size: var(--fs-sm); color: var(--ink); }
.sg-list__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: var(--fs-xs); }
.sg-list__meta span { display: inline-flex; align-items: center; gap: 5px; }

.sg-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sg-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 12px; background: var(--card); border: 1px solid #EEECE4; border-radius: var(--r-surface); box-shadow: var(--shadow-card); }
.sg-row[hidden] { display: none; }
.sg-row__ic { width: 40px; height: 40px; border-radius: var(--r-inner); display: grid; place-items: center; }
.sg-row__title { font-weight: 600; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-row__sub { color: var(--muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.sg-row__main { min-width: 0; }
.sg-row__side { display: grid; justify-items: end; gap: 4px; padding-left: 14px; border-left: 1px solid var(--border); min-width: 96px; }
.sg-row__side .num { font-size: var(--fs-base); }
.sg-row__side small { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.sg-row__side small .ic { width: 13px; height: 13px; color: #66705F; }
.sg-noresult { padding: 12px 4px; font-size: var(--fs-sm); }

.sg-cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sg-cats li { display: grid; grid-template-columns: 34px minmax(0, 1fr) 46px; gap: 12px; align-items: center; }
.sg-cats__ic { width: 34px; height: 34px; border-radius: var(--r-inner); display: grid; place-items: center; }
.sg-cats__ic .ic { width: 18px; height: 18px; }
.sg-cats__top { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); }
.sg-cats__top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-cats__track { height: 7px; border-radius: 99px; background: var(--track); margin-top: 6px; overflow: hidden; }
.sg-cats__track span { display: block; height: 100%; border-radius: 99px; }
.sg-cats__pct { text-align: right; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }

.sg-accs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sg-acc { background: var(--card); border: 1px solid #EEECE4; border-radius: var(--r-surface); padding: 12px 14px; box-shadow: var(--shadow-card); display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 10px; row-gap: 0; align-items: center; min-width: 0; }
.sg-acc__ic { width: 32px; height: 32px; border-radius: var(--r-inner); background: #E3EDDD; color: #2F6B45; display: grid; place-items: center; grid-row: span 2; }
.sg-acc__ic .ic { width: 18px; height: 18px; }
.sg-acc__name { font-weight: 600; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-acc__type { color: var(--muted); font-size: .75rem; }
.sg-acc__bal { font-size: var(--fs-base); margin-top: 6px; grid-column: 1 / -1; }

.sg-goals { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sg-goal__top { display: flex; justify-content: space-between; font-size: var(--fs-sm); }
.sg-goal__top b { font-weight: 600; }
.sg-goal__track { height: 10px; border-radius: 99px; background: var(--track-pattern), var(--track); margin: 8px 0 6px; overflow: hidden; }
.sg-goal__track span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #456B52, #8C9E78); }
.sg-goal__sub { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--muted); }
.sg-chart { height: 190px; }
.sg-chart--sm { height: 160px; }
.sg-skel { display: grid; gap: 16px; }

/* shell in the Sage skin */
:root[data-skin="sage"] .canvas { background: var(--canvas); }
@media (max-width: 1279px) { .sg-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; } }
@media (max-width: 1099px) { .sg-layout { grid-template-columns: 1fr; } .sg-accs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .sg-hello { display: none; }
  .sg-main, .sg-side { gap: 18px; }
  .sg-layout { gap: 18px; }
  .sg-search__box { height: 50px; padding: 0 16px; }
  .sg-search__box input { font-size: 16px; }
  .sg-filter { width: 50px; height: 50px; }
  .sg-quick { gap: 4px; }
  .sg-q__ic { width: 56px; height: 56px; }
  .sg-q { font-size: .75rem; }
  .sg-banner { padding: 20px 14px 18px 20px; }
  .sg-art { width: 116px; }
  .sg-pill { min-height: 42px; padding: 0 16px; }
  .sg-pill--ghost { margin-left: 0; }
  .sg-pills { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 2px 14px 4px; scrollbar-width: none; }
  .sg-pills::-webkit-scrollbar { display: none; }
  .sg-pill { flex: none; }
  .sg-card { padding: 18px 16px; }
  .sg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
  .sg-stats > div:nth-child(3) { border-left: 0; }
  .sg-summary__net { font-size: 1.5rem; }
  .sg-bar { height: 190px; }
  .sg-rail { grid-auto-columns: 82%; margin: 0 -14px; padding: 2px 14px 10px; scroll-padding-left: 14px; }
  .sg-accs { grid-auto-flow: column; grid-auto-columns: 46%; grid-template-columns: none; overflow-x: auto; margin: 0 -14px; padding: 2px 14px 8px; scroll-snap-type: x mandatory; }
  .sg-acc { scroll-snap-align: start; }
  .sg-row { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
  .sg-row__ic { width: 42px; height: 42px; }
  .sg-row__side { min-width: 84px; padding-left: 10px; }

  /* top bar becomes the reference's greeting header: avatar · greeting · bell */
  :root[data-skin="sage"] .topbar { background: transparent; border: 0; box-shadow: none; padding: 6px 4px; backdrop-filter: none; -webkit-backdrop-filter: none; position: static; }
  :root[data-skin="sage"] #menu-btn, :root[data-skin="sage"] .topbar__mark { display: none; }
  :root[data-skin="sage"] .topbar__right { display: contents; }
  :root[data-skin="sage"] .topbar__right > .pop-wrap:last-child { order: -1; }
  :root[data-skin="sage"] .greet { display: grid; flex: 1; line-height: 1.25; margin: 0; }
  :root[data-skin="sage"] .greet span { color: var(--muted); font-size: var(--fs-sm); }
  :root[data-skin="sage"] .greet b { font-size: 1.125rem; font-weight: 700; }
  :root[data-skin="sage"] .bell { background: var(--card); border: 1px solid var(--border); }
  :root[data-skin="sage"] .canvas { background: transparent; border: 0; padding-top: 6px; }
  :root[data-skin="sage"] .tabbar { grid-template-columns: repeat(4, 1fr); }
  :root[data-skin="sage"] .tabbar > span { display: none; }
  :root[data-skin="sage"] .tab[aria-current="page"] .ic { fill: color-mix(in srgb, currentColor 18%, transparent); }
  :root[data-skin="sage"] .fab { left: auto; right: 18px; transform: none; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); width: 60px; height: 60px; border-radius: 50%; box-shadow: 0 12px 24px -10px var(--btn-shadow); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ==========================================================================
   Skin: R1 Aqua — soft glass cards, icon-led tiles, floating tab bar.
   data-skin="blue r1": inherits the Biru chrome ([data-skin~="blue"]) and refines it here.
   Mockup: "ALESYA Finance — Theme R1" (mobile + desktop).
   ========================================================================== */
:root[data-skin~="r1"] {
  --page: #EEF5FD; --border: #E3EDF8; --ink: #0B2545; --ink-2: #33415C; --muted: #5B6B84; --link: #0670C9;
  --side-grad: rgba(255, 255, 255, .9); --side-ink: #33415C; --side-hover: #F1F6FC; --side-active-bg: #E6F2FD; --side-active-ink: #0670C9;
  --shadow-card: 0 8px 22px rgba(6, 59, 112, .06);
  --btn-grad: linear-gradient(140deg, #0586E8, #0670C9); --btn-grad-hover: linear-gradient(140deg, #0670C9, #0A5BAE); --btn-shadow: rgba(6, 112, 201, .55);
  --fab-bg: linear-gradient(140deg, #0586E8, #0670C9);
  --income-ink: #15803D; --expense-ink: #B42318;
  --r1-line: #E3EDF8; --r1-soft: #F1F6FC; --r1-tint: #E6F2FD; --r1-blue: #0670C9;
}
:root[data-skin~="r1-retired"], :root[data-skin~="r1-retired"] body { background: #F4F8FD linear-gradient(175deg, #DCEBFB 0%, #EEF5FD 420px, #F4F8FD 900px) no-repeat; }
:root[data-skin~="r1-retired"] .sidebar { border: 1px solid var(--r1-line); box-shadow: 0 14px 34px rgba(6, 59, 112, .08); }
:root[data-skin~="r1-retired"] .side-lotus { display: none; }
/* menu items (Biru + R1): icon in a small rounded tile, soft blue hover, filled tile when active */
:root[data-skin~="blue"] .nav__item { min-height: 48px; gap: 12px; padding: 0 8px; border-radius: 16px; font-weight: 600; transition: background-color .15s ease; }
:root[data-skin~="blue"] .nav__item .ic { width: 34px; height: 34px; padding: 8px; border-radius: 12px; background: #F1F6FC; color: #0670C9; stroke-width: 1.9; transition: background-color .15s ease, color .15s ease; }
:root[data-skin~="blue"] .nav__item:hover { background: #F1F6FC; }
:root[data-skin~="blue"] .nav__item:hover .ic { background: #E3EEFA; }
:root[data-skin~="blue"] .nav__item[aria-current="page"] { background: #E6F2FD; color: #0670C9; font-weight: 700; }
:root[data-skin~="blue"] .nav__item[aria-current="page"] .ic { background: #0670C9; color: #fff; }
@media (prefers-reduced-motion: reduce) { :root[data-skin~="blue"] .nav__item, :root[data-skin~="blue"] .nav__item .ic { transition: none; } }
:root[data-skin~="r1-retired"] .search, :root[data-skin~="r1-retired"] .bell, :root[data-skin~="r1-retired"] .profile { border: 1px solid var(--r1-line); box-shadow: 0 6px 16px rgba(6, 59, 112, .06); }
:root[data-skin~="r1-retired"] .search { border-radius: 16px; }
:root[data-skin~="r1-retired"] .bell .ic { color: var(--ink); }
:root[data-skin~="r1-retired"] .profile .avatar { background: linear-gradient(140deg, #38BDF8, #0670C9); }

/* dashboard (used by Biru Lotus and R1 Aqua) */
.r1 { position: relative; --r1-line: #E3EDF8; --r1-soft: #F1F6FC; --r1-tint: #E6F2FD; --r1-blue: #0670C9; }
.r1-hello { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; margin-bottom: 20px; }
.r1-hello__hi { color: var(--muted); font-weight: 500; }
.r1-hello { position: relative; } .r1-hello > * { position: relative; z-index: 1; }
.r1-hello__sub { margin-top: 6px; color: var(--ink-2); }
.r1-hello .r1-hello__lotus { position: absolute; z-index: 0; right: 620px; top: -34px; width: 180px; height: auto; pointer-events: none; }
@media (max-width: 1399px) { .r1-hello .r1-hello__lotus { display: none; } }
.r1-hello__name { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.r1-hello__side { display: flex; flex-direction: row-reverse; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.r1-month { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; background: #fff; border: 1px solid var(--r1-line); border-radius: 16px; color: var(--r1-blue); box-shadow: var(--shadow-card); }
.r1-month:focus-within { box-shadow: 0 0 0 3px var(--ring); }
.r1-month select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font-weight: 700; color: var(--ink); padding-right: 22px; margin-right: -22px; cursor: pointer; outline: none; }
.r1-month .ic:last-child { color: var(--ink-2); pointer-events: none; }
.r1-range { display: flex; gap: 8px; }
.r1-date { display: grid; background: #fff; border: 1px solid var(--r1-line); border-radius: 14px; padding: 4px 12px; font-size: var(--fs-xs); color: var(--muted); }
.r1-date input { border: 0; font-weight: 600; color: var(--ink); background: transparent; outline: none; }
.r1-demo { font-size: var(--fs-xs); font-weight: 600; color: var(--analytics-ink); background: rgba(255, 255, 255, .85); padding: 4px 12px; border-radius: 999px; }

.r1-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.r1-main, .r1-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.r1-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; }
.r1-card { background: #fff; border: 1px solid var(--r1-line); border-radius: 24px; box-shadow: var(--shadow-card); padding: 20px; min-width: 0; }
.r1-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.r1-h { font-size: 1.0625rem; font-weight: 700; }
.r1-more { margin-left: auto; font-size: var(--fs-sm); font-weight: 600; color: var(--link); text-decoration: none; }
.r1-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 8px; background: var(--r1-blue); color: #fff; font-size: .75rem; font-weight: 700; display: inline-grid; place-items: center; }
.r1-tile { width: 42px; height: 42px; flex: none; border-radius: 14px; display: grid; place-items: center; }
.r1-lotus { fill: currentColor; pointer-events: none; }

.r1-hero { position: relative; overflow: hidden; border-radius: 26px; padding: 22px; color: #fff; display: flex; flex-direction: column; gap: 14px; min-height: 196px;
  background: linear-gradient(140deg, #0670C9 0%, #0A5BAE 55%, #063B70 100%); box-shadow: 0 18px 36px rgba(6, 112, 201, .28); }
.r1-hero .r1-lotus { position: absolute; right: -20px; top: -24px; width: 160px; height: 160px; color: #fff; opacity: .12; }
.r1-hero__spark { position: absolute; right: 0; bottom: 0; width: 62%; height: 70px; opacity: .55; }
.r1-hero__top { position: relative; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.r1-hero__ic { width: 36px; height: 36px; border-radius: 12px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; }
.r1-eye { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; display: grid; place-items: center; }
.r1-eye:hover { background: rgba(255, 255, 255, .26); }
.r1-hero__value { position: relative; font-size: 2.125rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.r1-hero__foot { position: relative; display: flex; align-items: center; gap: 8px; font-size: .75rem; }
.r1-hero .r1-delta.r1-delta { background: rgba(255, 255, 255, .18); color: #fff; padding: 5px 10px; border-radius: 999px; }

.r1-delta { font-size: .75rem; font-weight: 700; }
.r1-delta.is-good { color: var(--income-ink); } .r1-delta.is-bad { color: var(--expense-ink); } .r1-delta.is-flat { color: var(--muted); }
.r1-note { font-size: .75rem; color: var(--muted); font-weight: 600; }

.r1-summary { display: flex; flex-direction: column; gap: 16px; }
.r1-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.r1-stat { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px; min-width: 0; }
.r1-stat__ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; }
.r1-stat__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.r1-stat__label { font-size: .75rem; color: var(--muted); }
.r1-stat b { font-size: 1.0625rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; }
.r1-stat--in { background: #F3FAF6; } .r1-stat--in .r1-stat__ic { background: #E4F6EC; color: #15803D; }
.r1-stat--out { background: #FEF6F4; } .r1-stat--out .r1-stat__ic { background: #FDECEC; color: #C2410C; }
.r1-stat--save { background: #F2F8FE; } .r1-stat--save .r1-stat__ic { background: var(--r1-tint); color: var(--r1-blue); }
.r1-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.r1-q { height: 44px; border: 0; border-radius: 14px; background: var(--r1-soft); color: var(--r1-blue); font-size: var(--fs-sm); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; min-width: 0; }
.r1-q:hover { background: var(--r1-tint); }
.r1-q__ic { display: grid; place-items: center; }
.r1-q__ic .ic { width: 16px; height: 16px; stroke-width: 2.2; }

.r1-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.r1-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 14px; background: #fff; border: 1px solid var(--r1-line); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; }
.r1-chip .ic { width: 16px; height: 16px; }
.r1-chip[aria-pressed="true"] { color: var(--r1-blue); border: 1.5px solid #0586E8; box-shadow: 0 6px 16px rgba(5, 134, 232, .14); }
.r1-chips--sm { margin: -4px 0 4px; }
.r1-chips--sm .r1-chip { height: 36px; padding: 0 12px; border-radius: 12px; background: var(--r1-soft); border-color: var(--r1-soft); }
.r1-chips--sm .r1-chip[aria-pressed="true"] { background: var(--r1-blue); border-color: var(--r1-blue); color: #fff; box-shadow: none; }

.r1-accs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.r1-acc { display: flex; flex-direction: column; text-align: left; gap: 0; padding: 16px; min-height: 164px; border-radius: 22px; background: #fff; color: var(--ink); border: 1px solid var(--r1-line); box-shadow: var(--shadow-card); min-width: 0; }
.r1-acc__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.r1-acc__ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--r1-tint); color: var(--r1-blue); }
.r1-acc__tag { font-size: .75rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: #F1F5FA; color: var(--muted); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r1-acc__name { margin-top: 14px; font-size: var(--fs-base); font-weight: 700; line-height: 1.25; }
.r1-acc__foot { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid #EEF3F9; }
.r1-acc__foot b { font-size: var(--fs-base); font-weight: 800; }
.r1-acc__go { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--r1-blue); color: #fff; }
.r1-acc__go .ic { width: 16px; height: 16px; }
.r1-acc:hover { border-color: #BFDBF5; }
.r1-acc.is-on { background: linear-gradient(150deg, #0586E8 0%, #0670C9 60%, #0A5BAE 100%); color: #fff; border-color: #0670C9; box-shadow: 0 14px 28px rgba(6, 112, 201, .3); }
.r1-acc.is-on .r1-acc__ic { background: rgba(255, 255, 255, .2); color: #fff; }
.r1-acc.is-on .r1-acc__tag { background: rgba(255, 255, 255, .18); color: #fff; }
.r1-acc.is-on .r1-acc__foot { border-color: rgba(255, 255, 255, .22); }
.r1-acc.is-on .r1-acc__go { background: #fff; color: var(--r1-blue); }

.r1-tx { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
.r1-tx li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #EEF3F9; min-width: 0; }
.r1-tx__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.r1-tx__main b { font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r1-tx__main span { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r1-tx > li > .num { font-size: var(--fs-sm); }
.r1-tx__tf { color: #475569; }
.r1-tx--due { grid-template-columns: 1fr; }
.r1-tx--due .r1-tile { width: 38px; height: 38px; border-radius: 12px; }
.r1-tx li:last-child { border-bottom: 0; }

.r1-budget { display: flex; flex-direction: column; gap: 10px; }
.r1-budget .r1-head { margin-bottom: 4px; }
.r1-dial { position: relative; align-self: center; width: 240px; max-width: 100%; aspect-ratio: 240 / 216; }
.r1-dial svg { display: block; width: 100%; height: 100%; }
.r1-dial__center { position: absolute; left: 0; right: 0; top: 33%; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
.r1-dial__center span { font-size: .8125rem; color: var(--muted); }
.r1-dial__center b { font-size: 2.25rem; font-weight: 800; line-height: 1; }
.r1-status { margin-top: 6px; font-style: normal; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.r1-status.is-green { color: #15803D; background: #E4F6EC; } .r1-status.is-yellow { color: #B45309; background: #FFF3E3; } .r1-status.is-red { color: #B42318; background: #FDECEC; }
.r1-dial__used { text-align: center; font-weight: 600; } .r1-dial__used span { color: var(--muted); font-weight: 500; }
.r1-dial__left { text-align: center; font-size: var(--fs-xs); color: var(--muted); }

.r1-tip { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; background: linear-gradient(150deg, #FFFFFF 0%, #EAF4FE 100%); border-color: #D6E7F9; }
.r1-tip .r1-lotus { position: absolute; right: -6px; bottom: -14px; width: 96px; height: 96px; color: #38BDF8; opacity: .22; }
.r1-tip__eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; color: var(--r1-blue); }
.r1-tip__title { font-size: var(--fs-base); font-weight: 700; line-height: 1.35; max-width: 260px; }
.r1-tip__body { font-size: .8125rem; color: var(--muted); line-height: 1.45; max-width: 260px; }

@media (min-width: 1100px) {
  .r1-hello__side { padding-top: 62px; }
}
/* wide screens (≥1600, e.g. 1920×1080): one 3-column grid so both columns end together and the page fits one screen */
@media (min-width: 1600px) {
  .r1-layout { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 380px; grid-template-areas: "top top dial" "acc acc dial" "tx due tip"; }
  .r1-main, .r1-side { display: contents; }
  .r1-top { grid-area: top; } .r1-accounts { grid-area: acc; } .r1-txcard { grid-area: tx; }
  .r1-duecard { grid-area: due; } .r1-tip { grid-area: tip; }
  .r1-budget { grid-area: dial; align-self: stretch; }
  .r1-budget .r1-dial { margin-block: auto 0; width: 260px; }
  .r1-txcard .r1-tx { grid-template-columns: minmax(0, 1fr); }
  .r1-hero { min-height: 220px; }
}
@media (max-width: 1279px) {
  .r1-layout { grid-template-columns: minmax(0, 1fr); }
  .r1-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .r1-side > .r1-budget { grid-row: span 2; }
}
@media (max-width: 1099px) {
  .r1-top { grid-template-columns: minmax(0, 1fr); }
  .r1-hello { grid-template-columns: 1fr; }
  .r1-hello__side { flex-direction: row; }
}
@media (max-width: 767px) {
  .r1-hello__name { font-size: 1.375rem; }
  .r1-hello__side { flex-direction: column; align-items: stretch; }
  .r1-month select { flex: 1; }
  .r1-demo { display: none; }
  .r1-layout, .r1-main, .r1-side { gap: 16px; }
  .r1-side { grid-template-columns: minmax(0, 1fr); }
  .r1-side > .r1-budget { grid-row: auto; }
  .r1-hero { min-height: 0; padding: 20px; }
  .r1-hero__value { font-size: 1.875rem; }
  /* mobile: round quick actions first, then a compact stat strip */
  .r1-summary { flex-direction: column-reverse; background: transparent; border: 0; box-shadow: none; padding: 0; }
  .r1-quick { gap: 8px; }
  .r1-q { flex-direction: column; height: auto; gap: 8px; background: transparent; color: var(--ink-2); font-size: .75rem; font-weight: 600; }
  .r1-q:hover { background: transparent; }
  .r1-q__ic { width: 56px; height: 56px; border-radius: 50%; background: #fff; border: 1px solid var(--r1-line); color: var(--r1-blue); box-shadow: 0 8px 18px rgba(6, 59, 112, .07); }
  .r1-q__ic .ic { width: 22px; height: 22px; stroke-width: 1.9; }
  .r1-stats { gap: 0; background: #fff; border: 1px solid var(--r1-line); border-radius: 20px; box-shadow: var(--shadow-card); padding: 14px 4px; }
  .r1-stat { flex-direction: row; align-items: center; gap: 6px; padding: 0 6px; border-radius: 0; background: transparent !important; }
  .r1-stat + .r1-stat { border-left: 1px solid #E8EFF8; }
  .r1-stat__ic { width: 28px; height: 28px; border-radius: 9px; }
  .r1-stat__ic .ic { width: 15px; height: 15px; }
  .r1-stat b { font-size: .8125rem; overflow: visible; }
  .r1-stat__foot { display: none; }
  .r1-head .r1-chips { margin-left: 0; width: 100%; }
  .r1-chip { height: 44px; }
  .r1-accs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .r1-tx { grid-template-columns: 1fr; }
  .r1-card { padding: 16px; border-radius: 22px; }
  /* floating glass tab bar */
  :root[data-skin~="r1-retired"] .tabbar { left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); height: 72px; padding: 0 6px; border-radius: 26px; border: 1px solid var(--r1-line);
    background: rgba(255, 255, 255, .94); box-shadow: 0 14px 34px rgba(6, 59, 112, .14); }
  :root[data-skin~="r1-retired"] .tab { font-size: .75rem; }
  :root[data-skin~="r1-retired"] .tab .ic { width: 44px; height: 30px; padding: 5px 12px; border-radius: 999px; }
  :root[data-skin~="r1-retired"] .tab[aria-current="page"] { color: var(--r1-blue); font-weight: 700; }
  :root[data-skin~="r1-retired"] .tab[aria-current="page"] .ic { background: var(--r1-tint); }
  :root[data-skin~="r1-retired"] .fab { width: 54px; height: 54px; border-radius: 20px; bottom: calc(12px + 9px + var(--safe-b)); box-shadow: 0 10px 22px rgba(6, 112, 201, .35); }
  :root[data-skin~="r1-retired"] .canvas { padding-bottom: calc(72px + 40px + var(--safe-b)); }
}

/* ==========================================================================
   Sage v3 — "Calmly" composition (23 Nov 2026).
   Light sidebar with the Biru/R1 stacked logo and pill menu (settings at the bottom),
   one white app surface, greeting header, illustrated banner, pastel health cards,
   illustrated goal cards; side column with budget ring, quick actions, timeline + quote.
   ========================================================================== */
:root[data-skin="sage"] {
  --page: #E6ECE3; --side-grad: #F5F7F3; --side-ink: #3A463C; --side-hover: #ECF1E8;
  --side-active-bg: #E1EBDB; --side-active-border: #E1EBDB; --side-active-ink: #1F3D2A;
}
:root[data-skin="sage"] .sidebar { border: 1px solid #E3E9DF; box-shadow: none; padding-top: 26px; }
:root[data-skin="sage"] .brand { flex-direction: column; gap: 4px; padding: 0; text-align: center; }
:root[data-skin="sage"] .brand__tile, :root[data-skin="sage"] .brand__fin, :root[data-skin="sage"] .brand__tag, :root[data-skin="sage"] .nav__group,
:root[data-skin="sage"] .nav__item .phase, :root[data-skin="sage"] .skyline, :root[data-skin="sage"] .side-lotus { display: none; }
:root[data-skin="sage"] .brand__mark { display: block; width: 92px; height: auto; }
:root[data-skin="sage"] .brand__name { font-size: 1.75rem; font-weight: 800; color: #24503A; letter-spacing: .04em; line-height: 1.1; }
:root[data-skin="sage"] .brand__sub { display: flex; align-items: center; gap: 8px; font-size: .8125rem; font-weight: 700; letter-spacing: .3em; color: #24503A; margin: 0 0 26px; }
:root[data-skin="sage"] .brand__sub::before, :root[data-skin="sage"] .brand__sub::after { content: ''; width: 18px; height: 2px; background: #24503A; border-radius: 2px; }
:root[data-skin="sage"] .nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
/* menu items follow R1: icon in a small rounded tile, soft hover, filled tile when active */
:root[data-skin="sage"] .nav__item { min-height: 48px; border-radius: 16px; gap: 12px; padding: 0 8px; font-weight: 600; transition: background-color .15s ease; }
:root[data-skin="sage"] .nav__item .ic { width: 34px; height: 34px; padding: 8px; border-radius: 12px; background: #ECF1E8; color: #2F6B45; stroke-width: 1.9; transition: background-color .15s ease, color .15s ease; }
:root[data-skin="sage"] .nav__item:hover { background: #EEF3EA; }
:root[data-skin="sage"] .nav__item:hover .ic { background: #DCE8D5; }
:root[data-skin="sage"] .nav__item[aria-current="page"] { background: #E1EBDB; color: #1F3D2A; font-weight: 700; }
:root[data-skin="sage"] .nav__item[aria-current="page"] .ic { background: #2F6B45; color: #fff; }
@media (prefers-reduced-motion: reduce) { :root[data-skin="sage"] .nav__item, :root[data-skin="sage"] .nav__item .ic { transition: none; } }
:root[data-skin="sage"] .nav__item[data-nav="settings"] { margin-top: auto; border-top: 0; }
:root[data-skin="sage"] .nav__item .badge-side { background: #2F6B45; color: #fff; }

@media (min-width: 1100px) {
  :root[data-skin="sage"] .frame { position: relative; background: #FFFFFF; border-radius: 28px; margin: 16px 16px 16px 20px; padding: 24px 28px 20px; box-shadow: 0 20px 44px -30px rgba(31, 61, 42, .35); }
  :root[data-skin="sage"] .topbar { position: absolute; top: 22px; right: 28px; z-index: 5; padding: 0; gap: 12px; background: transparent; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  :root[data-skin="sage"] #menu-btn, :root[data-skin="sage"] .topbar .sync { display: none; }
  :root[data-skin="sage"] .search { background: #F3F5F1; border: 1px solid #E8ECE5; border-radius: 999px; min-width: 260px; }
  :root[data-skin="sage"] .search kbd { display: none; }
  :root[data-skin="sage"] .bell { background: transparent; border: 0; }
  :root[data-skin="sage"] .profile { background: transparent; border: 0; box-shadow: none; }
  :root[data-skin="sage"] .canvas { background: transparent; border: 0; box-shadow: none; padding: 0; }
}

.cm { position: relative; }
.cm-hello { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; margin-bottom: 20px; }
.cm-hello__hi { color: var(--muted); font-weight: 500; }
.cm-hello__name { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; display: flex; align-items: center; gap: 10px; }
.cm-hello__sun { color: #E0A33E; display: inline-grid; }
.cm-hello__sun .ic { width: 28px; height: 28px; }
.cm-hello__sub { margin-top: 4px; color: var(--ink-2); }
.cm-hello__side { display: flex; flex-direction: row-reverse; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cm-month { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; background: #F3F5F1; border: 1px solid #E8ECE5; border-radius: 999px; color: #2F6B45; }
.cm-month:focus-within { box-shadow: 0 0 0 3px var(--ring); }
.cm-month select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font-weight: 700; color: var(--ink); padding-right: 22px; margin-right: -22px; cursor: pointer; outline: none; }
.cm-month .ic:last-child { color: var(--ink-2); pointer-events: none; }
.cm-range { display: flex; gap: 8px; }
.cm-date { display: grid; background: #F3F5F1; border: 1px solid #E8ECE5; border-radius: 14px; padding: 4px 12px; font-size: var(--fs-xs); color: var(--muted); }
.cm-date input { border: 0; background: transparent; font-weight: 600; color: var(--ink); outline: none; }
.cm-demo { font-size: var(--fs-xs); font-weight: 600; color: var(--analytics-ink); background: #F1E8F6; padding: 4px 12px; border-radius: 999px; }

.cm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.cm-main, .cm-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; min-width: 0; }
.cm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cm-h { font-size: 1.0625rem; font-weight: 700; }
.cm-more { margin-left: auto; font-size: var(--fs-sm); font-weight: 600; color: #2F6B45; text-decoration: none; }
.cm-more:hover { text-decoration: underline; }
.cm-card { background: #fff; border: 1px solid #E8ECE5; border-radius: 22px; padding: 18px; }

.cm-hero { position: relative; overflow: hidden; border-radius: 24px; min-height: 230px; display: flex; align-items: center; background: #E3EADB; }
.cm-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cm-hero::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(244, 246, 239, .92) 0%, rgba(244, 246, 239, .55) 48%, rgba(244, 246, 239, 0) 72%); }
.cm-hero__body { position: relative; z-index: 2; padding: 28px; max-width: 58%; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.cm-hero__eyebrow { font-size: .8125rem; font-weight: 700; letter-spacing: .04em; color: #3F5E48; }
.cm-hero__title { font-size: 1.75rem; font-weight: 700; line-height: 1.22; letter-spacing: -.01em; color: #1F2A22; }
.cm-hero__btn { margin-top: 6px; display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px 0 6px; border: 0; border-radius: 999px; background: #fff; color: #1F2A22; font-weight: 700; box-shadow: 0 8px 18px -10px rgba(31, 61, 42, .5); }
.cm-hero__btn > span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #2F6B45; color: #fff; }
.cm-hero__btn .ic { width: 16px; height: 16px; }
.cm-hero__btn:hover { background: #F6F8F3; }
.cm-hero__note { position: absolute; z-index: 2; top: 18px; right: 22px; font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-size: .9375rem; line-height: 1.3; color: #24503A; text-align: right; transform: rotate(-4deg); }

.cm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cm-stat { border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cm-stat__ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 8px; }
.cm-stat__value { font-size: 1.375rem; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-stat__label { color: var(--ink-2); font-size: var(--fs-sm); }
.cm-bar { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.cm-bar > span { flex: 1; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .8); overflow: hidden; }
.cm-bar i { display: block; height: 100%; border-radius: 99px; }
.cm-bar b { font-size: .75rem; color: var(--ink-2); }
.cm-stat__hint { font-size: .75rem; color: var(--muted); }
.cm-stat--green { background: #EEF4EA; } .cm-stat--green .cm-stat__ic { background: #DCE9D5; color: #2F6B45; } .cm-stat--green .cm-bar i { background: #4F8A5B; }
.cm-stat--blue { background: #EAF2FB; } .cm-stat--blue .cm-stat__ic { background: #D6E6F8; color: #2F6FB5; } .cm-stat--blue .cm-bar i { background: #4A8FD8; }
.cm-stat--peach { background: #FCEFE6; } .cm-stat--peach .cm-stat__ic { background: #F8DCC8; color: #A85A27; } .cm-stat--peach .cm-bar i { background: #E08A4F; }
.cm-stat--lilac { background: #F3EEFB; } .cm-stat--lilac .cm-stat__ic { background: #E5DAF6; color: #6E4A8F; } .cm-stat--lilac .cm-bar i { background: #9B6FD6; }

.cm-goals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cm-goal { position: relative; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid #E8ECE5; text-decoration: none; color: var(--ink); min-width: 0; }
.cm-goal img { width: 100%; height: 110px; object-fit: cover; display: block; }
.cm-goal__body { display: flex; flex-direction: column; gap: 2px; padding: 12px 54px 14px 14px; min-width: 0; }
.cm-goal__body b { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-goal__body span { font-size: .75rem; color: var(--muted); }
.cm-goal__go { position: absolute; right: 12px; bottom: 14px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid #E3E9DF; display: grid; place-items: center; color: var(--ink); }
.cm-goal__go .ic { width: 16px; height: 16px; }
.cm-goal:hover { border-color: #C9D8C0; } .cm-goal:hover .cm-goal__go { background: #2F6B45; color: #fff; border-color: #2F6B45; }

.cm-ring-card { background: #EEF4EA; border-color: #E1EBDB; }
.cm-ring { display: flex; align-items: center; gap: 18px; }
.cm-ring__dial { position: relative; width: 124px; flex: none; }
.cm-ring__dial svg { display: block; width: 100%; height: auto; }
.cm-ring__dial b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.5rem; font-weight: 800; }
.cm-ring__text { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.cm-ring__title { font-size: var(--fs-base); font-weight: 700; color: var(--ink); }
.cm-ring__title.is-yellow { color: #8A5A0E; } .cm-ring__title.is-red { color: #A8452F; }

.cm-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cm-q { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 14px; border: 0; border-radius: 16px; font-weight: 600; font-size: var(--fs-sm); color: var(--ink); text-decoration: none; text-align: left; }
.cm-q__ic { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .85); }
.cm-q__ic .ic { width: 18px; height: 18px; }
.cm-q--green { background: #EEF4EA; } .cm-q--green .cm-q__ic { color: #2F6B45; }
.cm-q--peach { background: #FCEFE6; } .cm-q--peach .cm-q__ic { color: #A85A27; }
.cm-q--blue { background: #EAF2FB; } .cm-q--blue .cm-q__ic { color: #2F6FB5; }
.cm-q--lilac { background: #F3EEFB; } .cm-q--lilac .cm-q__ic { color: #6E4A8F; }
.cm-q:hover { filter: brightness(.97); }

.cm-up { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 12px; align-items: stretch; }
.cm-time { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.cm-time li { display: grid; grid-template-columns: 10px 46px minmax(0, 1fr); gap: 8px; align-items: start; }
.cm-time li > i { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; }
.cm-time__date { font-size: .75rem; color: var(--muted); padding-top: 1px; }
.cm-time__main { display: flex; flex-direction: column; min-width: 0; }
.cm-time__main b { font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-time__main span { font-size: .75rem; color: var(--muted); }
.cm-time--empty { font-size: var(--fs-sm); color: var(--muted); }
.cm-quote { margin: 0; background: #EEF4EA; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.cm-quote span { font-family: Georgia, serif; font-size: 1.75rem; line-height: .8; color: #2F6B45; }
.cm-quote blockquote { margin: 0; font-size: .8125rem; line-height: 1.4; color: var(--ink-2); }

@media (min-width: 1100px) { .cm-hello__side { padding-top: 58px; } }
@media (min-width: 1600px) { .cm-layout { grid-template-columns: minmax(0, 1fr) 400px; } .cm-hero { min-height: 250px; } }
@media (max-width: 1279px) {
  .cm-layout { grid-template-columns: minmax(0, 1fr); }
  .cm-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-side > section:last-child { grid-column: 1 / -1; }
}
@media (max-width: 1099px) { .cm-hello { grid-template-columns: 1fr; } .cm-hello__side { flex-direction: row; } }
@media (max-width: 899px) { .cm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .cm-hello__name { font-size: 1.5rem; }
  .cm-hello__side { flex-direction: column; align-items: stretch; }
  .cm-month select { flex: 1; }
  .cm-demo { display: none; }
  .cm-layout, .cm-main, .cm-side { gap: 18px; }
  .cm-side { grid-template-columns: minmax(0, 1fr); }
  .cm-hero { min-height: 200px; border-radius: 22px; }
  .cm-hero::before { background: linear-gradient(90deg, rgba(244, 246, 239, .94) 0%, rgba(244, 246, 239, .6) 62%, rgba(244, 246, 239, .1) 100%); }
  .cm-hero__body { max-width: 82%; padding: 20px; }
  .cm-hero__title { font-size: 1.3125rem; }
  .cm-hero__note { display: none; }
  .cm-stats { gap: 12px; }
  .cm-stat__value { font-size: 1.1875rem; }
  .cm-goals { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; }
  .cm-goal { flex: 0 0 72%; scroll-snap-align: start; }
}
:root[data-skin="sage"] #app[data-route="dashboard"] .greet { display: none; }

/* ==========================================================================
   Phase 2 pages — Transaksi & Rekening (shared by all skins; colours come from tokens)
   ========================================================================== */
.page { display: grid; gap: 16px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.page-head > .btn { flex: none; }
.page-head__text { min-width: 0; }
:root[data-skin~="blue"] .page, :root[data-skin="sage"] .page { padding-top: 4px; }
@media (min-width: 1100px) { :root[data-skin~="blue"] .page-head, :root[data-skin="sage"] .page-head { min-height: 118px; } }

.tx-filters { display: grid; gap: 12px; }
.tx-filters__top { display: flex; flex-wrap: wrap; gap: 10px; }
.tx-search { flex: 1 1 320px; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--card); color: var(--muted); }
.tx-search:focus-within, .tx-sel:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--ring); }
.tx-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); }
.tx-sel { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--card); color: var(--muted); }
.tx-sel select { border: 0; outline: none; background: transparent; color: var(--ink); font-weight: 600; min-height: 44px; max-width: 220px; cursor: pointer; }
.tx-sel select:disabled { opacity: .5; cursor: not-allowed; }
.tx-sel--sm { min-height: 44px; } .tx-sel--sm select { font-weight: 500; font-size: var(--fs-sm); }
.tx-filters__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tx-filters__row .seg button { min-height: 36px; }
.tx-reset { border: 0; background: transparent; color: var(--link); font-weight: 600; font-size: var(--fs-sm); padding: 8px; min-height: 44px; }
.tx-reset:hover { text-decoration: underline; }
.tx-range { display: grid; grid-template-columns: repeat(2, minmax(0, 200px)); gap: 10px; }

.tx-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tx-sum > div { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-box); padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.tx-sum span { font-size: var(--fs-xs); color: var(--muted); }
.tx-sum b { font-size: var(--fs-base); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-note { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--muted); }

.tx-list { padding-top: 6px; }
.tx-day { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); padding: 14px 0 6px; border-bottom: 1px solid var(--border); }
.tx-day:first-child { padding-top: 6px; }
.tx-rows { list-style: none; margin: 0; padding: 0; }
.tx-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto 96px; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.tx-rows .tx-row:last-child { border-bottom: 0; }
.tx-tile { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; }
.tx-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tx-main > b { font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-main > span { font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-tags { display: flex; gap: 6px; margin-top: 2px; }
.tx-tag { font-style: normal; font-size: .6875rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--analytics-soft); color: var(--analytics-ink); }
.tx-tag--void { background: var(--down-bg); color: var(--down-ink); }
.tx-amt { font-size: var(--fs-sm); text-align: right; white-space: nowrap; }
.tx-amt--tf { color: var(--neutral); }
.tx-row.is-void .tx-main > b, .tx-row.is-void .tx-amt { text-decoration: line-through; color: var(--muted); }
.tx-row.is-void .tx-tile { filter: grayscale(1); opacity: .6; }
.tx-act { display: flex; justify-content: flex-end; gap: 4px; }
.tx-btn { width: 40px; min-height: 40px; height: 40px; }
.tx-btn[disabled] { opacity: .35; }
@media (hover: hover) and (min-width: 768px) { .tx-row .tx-act { opacity: .35; transition: opacity .15s; } .tx-row:hover .tx-act, .tx-row:focus-within .tx-act { opacity: 1; } }
.tx-more { display: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); place-items: center; }
.tx-more:hover { background: var(--field); }
.tx-dl { margin: 0; display: grid; gap: 10px; }
.tx-dl > div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.tx-dl dt { color: var(--muted); } .tx-dl dd { margin: 0; font-weight: 600; text-align: right; }
.tx-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; margin-top: 6px; border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--muted); }

.vd-card { display: grid; gap: 2px; padding: 14px; border-radius: var(--r-box); background: var(--field); }
.vd-card span { font-size: var(--fs-xs); color: var(--muted); }
.vd-warn { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-sm); color: var(--tile-yellow-ink); background: var(--warning-soft); padding: 10px 12px; border-radius: var(--r-ctl); }
textarea.input { min-height: 88px; padding: 10px 12px; resize: vertical; font: inherit; }

/* Rekening */
.acc-total { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.acc-total > div { display: grid; gap: 2px; }
.acc-total > div span { font-size: var(--fs-sm); color: var(--muted); }
.acc-total > div b { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
.acc-split { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: var(--fs-sm); color: var(--ink-2); }
.acc-split li { display: flex; align-items: center; gap: 8px; }
.acc-split i { width: 9px; height: 9px; border-radius: 50%; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.acc-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--card-r); box-shadow: var(--shadow-card); padding: 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.acc-card.is-archived { opacity: .75; box-shadow: none; }
.acc-card__top { display: flex; align-items: center; gap: 12px; }
.acc-ic { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; }
.acc-card__name { flex: 1; min-width: 0; display: grid; }
.acc-card__name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-card__name span { font-size: var(--fs-xs); color: var(--muted); }
.acc-card__bal { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.acc-card__meta { font-size: var(--fs-xs); color: var(--muted); }
.acc-rc { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); }
.acc-rc.is-ok { color: var(--income-ink); } .acc-rc.is-off { color: var(--tile-yellow-ink); }
.acc-card__act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.acc-card__act .btn { min-height: 40px; font-size: var(--fs-sm); }
.acc-edit { width: 40px; min-height: 40px; height: 40px; flex: none; }
#tx-out, #acc-out { display: grid; gap: 16px; min-width: 0; }
#tx-out .tx-note { margin-top: -8px; }
.acc-archived summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; color: var(--ink-2); padding: 8px 0; min-height: 44px; list-style: none; }
.acc-archived summary::-webkit-details-marker { display: none; }
.acc-archived[open] summary .ic { transform: rotate(90deg); }
.acc-archived .acc-grid { margin-top: 8px; }
.acc-zone { display: grid; gap: 6px; padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--r-box); font-size: var(--fs-sm); }
.acc-zone .btn { justify-self: start; }

.sheet--wide { width: 560px; }
.st-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.st-sum > div { background: var(--field); border-radius: var(--r-box); padding: 10px 12px; display: grid; gap: 2px; }
.st-sum span { font-size: var(--fs-xs); color: var(--muted); } .st-sum b { font-weight: 800; }
.st-rows { list-style: none; margin: 0; padding: 0; }
.st-rows li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.st-date { font-size: var(--fs-xs); color: var(--muted); }
.st-amt { display: grid; justify-items: end; }
.st-amt b { font-size: var(--fs-sm); } .st-amt small { font-size: .75rem; color: var(--muted); }

.rc-res { display: grid; gap: 10px; padding: 14px; border-radius: var(--r-box); font-size: var(--fs-sm); }
.rc-res.is-ok { background: var(--up-bg); } .rc-res.is-off { background: var(--warning-soft); }
.rc-res__title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-base); font-weight: 800; }
.rc-res.is-ok .rc-res__title { color: var(--up-ink); } .rc-res.is-off .rc-res__title { color: var(--tile-yellow-ink); }
.rc-res dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rc-res dt { font-size: var(--fs-xs); color: var(--muted); } .rc-res dd { margin: 0; font-weight: 700; }
.rc-foot { display: flex; gap: 10px; } .rc-foot .btn { flex: 1; min-height: 50px; }

@media (max-width: 1099px) {
  .tx-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .tx-page .page-head .btn--primary { display: none; }   /* the + button in the tab bar does this on phones */
  .tx-filters { padding: 14px; }
  .tx-filters__row { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 0 14px 2px; }
  .tx-filters__row > * { flex: none; }
  .tx-row { grid-template-columns: 40px minmax(0, 1fr) auto 36px; gap: 10px; }
  .tx-row .tx-act { display: none; }
  .tx-more { display: grid; width: 36px; height: 44px; }
  .tx-tile { width: 40px; height: 40px; }
  .tx-pager .btn { padding: 0 10px; }
  .acc-total > div b { font-size: 1.5rem; }
  .sheet--wide { width: auto; }
}

/* ==========================================================================
   Phase 3 pages — Anggaran, Tabungan, Utang & Piutang
   ========================================================================== */
.bd-nav { display: flex; align-items: center; gap: 8px; }
.bd-nav b { min-width: 150px; text-align: center; font-size: var(--fs-lg); font-weight: 800; }
.bd-h { font-size: var(--fs-base); font-weight: 700; margin-bottom: 12px; }
.bd-sub { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); margin: 18px 0 6px; }
.bd-sum { display: grid; grid-template-columns: minmax(200px, auto) minmax(0, 1fr); gap: 18px 28px; align-items: center; }
.bd-sum__main { display: grid; gap: 2px; }
.bd-sum__main span { font-size: var(--fs-sm); color: var(--muted); }
.bd-sum__main b { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
.bd-sum__bar { display: grid; gap: 8px; }
.bd-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.bd-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bd-row { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 0; }
.bd-row__main { display: grid; gap: 6px; min-width: 0; }
.bd-row__top { display: flex; justify-content: space-between; gap: 10px; }
.bd-row__top b { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-row__sub { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--muted); }
.bd-pct { font-size: var(--fs-xs); font-weight: 800; }
.bd-pct.is-green { color: var(--income-ink); } .bd-pct.is-yellow { color: var(--tile-yellow-ink); } .bd-pct.is-red { color: var(--expense-ink); }
.bd-bar { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bd-bar--lg { height: 12px; }
.bd-bar i { display: block; height: 100%; border-radius: 99px; min-width: 4px; }
.bd-bar.is-green i { background: var(--income); } .bd-bar.is-yellow i { background: var(--warning); } .bd-bar.is-red i { background: var(--expense); }
.bd-plain { list-style: none; margin: 0; padding: 0; }
.bd-plain li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.bd-plain li:last-child { border-bottom: 0; }
.bd-empty-act { display: flex; flex-wrap: wrap; gap: 10px; }
.bd-hist .bd-h { margin-bottom: 4px; }
.bd-legend { display: flex; gap: 14px; font-size: var(--fs-xs); color: var(--muted); margin-bottom: 10px; }
.bd-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bd-legend i { width: 10px; height: 10px; border-radius: 3px; }
.bd-cols { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; align-items: end; }
.bd-cols li { display: grid; gap: 6px; justify-items: center; font-size: var(--fs-xs); color: var(--muted); }
.bd-cols__bars { height: 150px; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--border); }
.bd-cols__bars i { width: 38%; max-width: 18px; border-radius: 5px 5px 0 0; min-height: 2px; }
.is-plan { background: color-mix(in srgb, var(--blue) 28%, white); }
.is-real { background: var(--blue); }
.bd-cols__bars i.is-over { background: var(--expense); }
.bd-form { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bd-form li { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.bd-form label { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bd-form label .tx-tile { width: 36px; height: 36px; border-radius: 12px; flex: none; }
.bd-form label > span:last-child { display: grid; min-width: 0; }
.bd-form b { font-size: var(--fs-sm); }
.bd-form small { font-size: .75rem; color: var(--muted); }
.bd-in { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: #fff; }
.bd-in:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--ring); }
.bd-in span { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.bd-in input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bd-total { display: flex; justify-content: space-between; font-size: var(--fs-sm); color: var(--ink-2); }
.bd-total b { font-size: var(--fs-base); color: var(--ink); }

.sv-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--card-r); box-shadow: var(--shadow-card); padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sv-card.is-archived { opacity: .75; box-shadow: none; }
.sv-amt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.sv-amt b { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.sv-amt span { font-size: var(--fs-xs); color: var(--muted); }
.sv-foot { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-xs); color: var(--muted); }
.sv-foot b { color: var(--ink); white-space: nowrap; }
.sv-foot span { text-align: right; }
.sv-total { display: grid; gap: 6px; flex: 1 1 320px; max-width: 520px; font-size: var(--fs-xs); color: var(--muted); }
.st-rows li.is-void b { text-decoration: line-through; color: var(--muted); }

.db-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.db-sum > div { display: grid; gap: 2px; }
.db-sum span { font-size: var(--fs-sm); color: var(--muted); }
.db-sum b { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.db-tabs { justify-self: start; }
.db-tabs button { min-height: 40px; padding: 8px 16px; }
.db-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#bd-out, #sv-out, #db-out { display: grid; gap: 16px; min-width: 0; }

@media (max-width: 1099px) { .bd-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) {
  .bd-sum { grid-template-columns: minmax(0, 1fr); }
  .bd-sum__main b, .db-sum b { font-size: 1.375rem; }
  .db-sum { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .db-sum > div { grid-template-columns: 1fr auto; align-items: baseline; }
  .bd-form li { grid-template-columns: minmax(0, 1fr) 128px; }
  .bd-nav b { min-width: 0; flex: 1; }
  .bd-cols__bars { height: 110px; }
}

/* ==========================================================================
   Phase 4 — Laporan (report, export, monthly closing) + print / PDF
   ========================================================================== */
.rp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.rp-filters .tx-sel input[type="date"] { border: 0; background: transparent; outline: none; color: var(--ink); font-weight: 600; min-height: 42px; }
#rp-out { display: grid; gap: 16px; min-width: 0; }
.rp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rp-kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--card-r); box-shadow: var(--shadow-card); padding: 16px; display: grid; gap: 4px; min-width: 0; }
.rp-kpi > span:first-child { font-size: var(--fs-sm); color: var(--muted); }
.rp-kpi b { font-size: 1.375rem; font-weight: 800; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-delta { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.rp-delta.is-good { color: var(--income-ink); } .rp-delta.is-bad { color: var(--expense-ink); }
.rp-chart { position: relative; height: 240px; margin-bottom: 14px; }
.rp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.rp-scroll { overflow-x: auto; }
.rp-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.rp-table th, .rp-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.rp-table thead th { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); white-space: nowrap; }
.rp-table tbody th { font-weight: 600; }
.rp-table th small { display: block; font-size: .75rem; font-weight: 400; color: var(--muted); }
.rp-table .num { text-align: right; white-space: nowrap; }
.rp-table tfoot th, .rp-table tfoot td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--border); }
.rp-table--compact th, .rp-table--compact td { padding: 7px 8px; }
.rp-cat { display: inline-flex; align-items: center; gap: 8px; }
.rp-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.rp-share { display: block; height: 4px; margin-top: 6px; border-radius: 99px; background: var(--track); overflow: hidden; max-width: 220px; }
.rp-share i { display: block; height: 100%; border-radius: 99px; }
.rp-lock { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 700; color: var(--income-ink); }
.rp-dl { margin: 0 0 10px; display: grid; gap: 8px; }
.rp-dl > div { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); }
.rp-dl dt { color: var(--muted); } .rp-dl dd { margin: 0; text-align: right; }
.rp-top { margin: 0; padding: 0; list-style: none; counter-reset: rp; }
.rp-top li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); counter-increment: rp; }
.rp-top li::before { content: counter(rp); font-size: var(--fs-xs); font-weight: 800; color: var(--muted); text-align: center; }
.rp-top li > b { font-size: var(--fs-sm); }
.rp-close-lead { font-size: var(--fs-sm); margin-bottom: 8px; }
.rp-close { list-style: none; margin: 0; padding: 0; }
.rp-close li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.rp-close li:last-child { border-bottom: 0; }
.rp-close__ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--field); color: var(--muted); }
.rp-close li.is-closed .rp-close__ic { background: var(--up-bg); color: var(--up-ink); }
.rp-close .btn { min-height: 40px; font-size: var(--fs-sm); }
.rp-print-head { display: none; }

@media (max-width: 1099px) { .rp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rp-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) {
  .rp-actions { width: 100%; } .rp-actions .btn { flex: 1; }
  .rp-page .page-head .btn--primary { display: inline-flex; }
  .rp-kpi b { font-size: 1.125rem; }
  .rp-close li { grid-template-columns: 36px minmax(0, 1fr); }
  .rp-close li .btn { grid-column: 2; justify-self: start; }
  .rp-close li .btn--icon { display: none; }
  .rp-share { display: none; }
}

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  html, body { background: #fff !important; }
  body * { box-shadow: none !important; }
  .sidebar, .topbar, .tabbar, .fab, .toasts, .sheet, .scrim, .rp-filters, .rp-actions, .rp-closing, .page-head, .tx-note .ic, .skin-picker, #menu-btn { display: none !important; }
  .shell, .frame, .canvas, main { display: block !important; margin: 0 !important; padding: 0 !important; background: #fff !important; border: 0 !important; width: auto !important; position: static !important; }
  .rp-print-head { display: grid; gap: 2px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #0B2545; font-size: 10pt; color: #33415C; }
  .rp-print-head b { font-size: 15pt; color: #0B2545; }
  .panel, .rp-kpi { border: 1px solid #D5DEE8 !important; border-radius: 6px !important; break-inside: avoid; page-break-inside: avoid; padding: 10px !important; }
  .rp-grid, .rp-kpis { gap: 8px; }
  .rp-kpis { grid-template-columns: repeat(4, 1fr) !important; }
  .rp-grid { grid-template-columns: 1fr 1fr !important; }
  .rp-table { font-size: 8.5pt; } .rp-table th, .rp-table td { padding: 4px 5px; }
  .rp-chart { height: 180px; }
  .rp-share { display: none; }
  a { color: inherit; text-decoration: none; }
}

/* ==========================================================================
   Phase 5 — Pengaturan
   ========================================================================== */
#set-out { display: grid; gap: 16px; min-width: 0; }
.set-panel { display: grid; gap: 16px; }
.set-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--r-ctl) + 4px); }
.set-tabs button { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.set-tabs button:hover { background: var(--field); }
.set-tabs button[aria-selected="true"] { background: var(--blue); color: #fff; }
.set-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.st-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.st-inline .muted { font-size: var(--fs-sm); align-self: center; }
.set-p { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.55; margin-bottom: 12px; }
.set-p code { font-size: .8125rem; background: var(--field); padding: 1px 5px; border-radius: 4px; }
.set-list { list-style: none; margin: 0; padding: 0; }
.set-list li { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.set-list li:last-child { border-bottom: 0; }
.set-list li.is-off { opacity: .6; }
.set-list li.is-sub { padding-left: 28px; grid-template-columns: 36px minmax(0, 1fr) auto; }
.set-list li.is-sub .tx-tile { width: 36px; height: 36px; border-radius: 12px; }
.set-list--tight li { padding: 8px 0; }
.set-av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 800; }
.set-av--sq { border-radius: 12px; background: var(--up-bg); color: var(--up-ink); width: 38px; height: 38px; }
.set-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.set-icons button { height: 44px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--ink-2); display: grid; place-items: center; }
.set-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.set-colors button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.set-colors button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.set-audit { list-style: none; margin: 0; padding: 0; }
.set-audit li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.set-audit .tx-main > span { white-space: normal; }
.set-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.set-theme { position: relative; display: grid; gap: 6px; text-align: left; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-box); background: var(--card); color: var(--ink); }
.set-theme[aria-pressed="true"] { border: 2px solid var(--blue); padding: 15px; }
.set-theme__sw { display: flex; gap: 6px; margin-bottom: 4px; }
.set-theme__sw i { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.set-theme > span:not(.set-theme__sw) { font-size: var(--fs-xs); color: var(--muted); }
.set-theme em { position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-size: var(--fs-xs); font-weight: 700; color: var(--blue); }
@media (max-width: 767px) {
  .set-audit li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .set-list li.is-sub { padding-left: 14px; }
}

/* Biru: darker pastel blue from the top-left corner so the white sidebar stands out (like R1). */
:root[data-skin~="blue"] body { background: radial-gradient(900px 620px at 0 0, #B7D2F3 0%, #CFE2F8 40%, rgba(238, 245, 254, 0) 78%), url(../assets/img/waves.svg) center / cover fixed no-repeat, #EEF5FE; }
:root[data-skin~="blue"] .sidebar { background: #FFFFFF; box-shadow: 0 18px 40px -24px rgba(6, 59, 112, .35); }

/* Dashboard numbers (Biru & R1): larger, so the figures read at a glance. Total saldo stays the largest.
   Next to the hero the summary card is narrow (≈340–430 px), so there the three stats become rows
   (icon · label · value) instead of three 90-px cards that would cut the number off. */
.r1-stat b { font-size: 1.375rem; letter-spacing: -.01em; white-space: nowrap; }
.r1-acc__foot b { font-size: 1.125rem; }
.r1-tx > li > .num { font-size: .9375rem; }
@media (min-width: 768px) {
  .r1-summary { container: r1sum / inline-size; }
  @container r1sum (max-width: 560px) {
    .r1-stats { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .r1-stat { flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; }
    .r1-stat__ic { width: 34px; height: 34px; flex: none; }
    .r1-stat__body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "foot value"; column-gap: 12px; row-gap: 0; align-items: center; }
    .r1-stat__label { grid-area: label; font-size: .8125rem; }
    .r1-stat__foot { grid-area: foot; }
    .r1-stat b { grid-area: value; text-align: right; overflow: visible; }
  }
}
@media (max-width: 767px) {
  .r1-stat { flex-direction: column; align-items: flex-start; gap: 6px; padding: 0 10px; }
  .r1-stat b { font-size: 1rem; }
}

/* Full Rupiah amounts on the dashboards (no "jt"): each figure shrinks only as far as its card needs,
   using the card's own width (container query units), so long values like Rp 430.200.000 never get cut. */
.r1-acc, .cm-stat, .r1-hero { container-type: inline-size; }
.r1-acc__foot b { font-size: clamp(.875rem, calc((100cqi - 72px) / 8), 1.125rem); white-space: nowrap; }
.cm-stat__value { font-size: clamp(.9375rem, calc((100cqi - 32px) / 7.6), 1.375rem); overflow: visible; }
.r1-hero__value { font-size: clamp(1.5rem, calc((100cqi - 44px) / 7.4), 2.125rem); white-space: nowrap; }
.cm-goal__body span { white-space: normal; }
@media (max-width: 767px) {
  /* the 3-column strip is too narrow for full amounts: show it as three rows, value on the right */
  .r1-stats { grid-template-columns: minmax(0, 1fr); padding: 6px 14px; }
  .r1-stat { flex-direction: row; align-items: center; gap: 12px; padding: 10px 0; }
  .r1-stat + .r1-stat { border-left: 0; border-top: 1px solid #E8EFF8; }
  .r1-stat__body { flex: 1; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .r1-stat__label { font-size: .875rem; }
  .r1-stat b { font-size: 1.0625rem; text-align: right; }
}
/* Biru/R1 summary rows: value size follows the summary card width so it never runs into the label. */
@media (min-width: 768px) {
  @container r1sum (max-width: 560px) {
    .r1-stat__body { grid-template-columns: auto minmax(0, 1fr); }
    .r1-stat b { font-size: clamp(.9375rem, calc((100cqi - 175px) / 7.4), 1.375rem); }
    .r1-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @container r1sum (min-width: 400px) and (max-width: 560px) { .r1-quick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
}
/* Sage: four health cards side by side only when each has room for a full amount; otherwise 2 × 2. */
section:has(> .cm-stats) { container: cmhealth / inline-size; }
@container cmhealth (max-width: 620px) { .cm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Themed dropdown list (js/dropdown.js): rounded popover, smaller type, hover and selection in the theme colour. */
.dd-pop { position: fixed; z-index: 200; overflow-y: auto; overscroll-behavior: contain; padding: 6px; background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 18px 40px -12px rgba(15, 35, 70, .28), 0 2px 6px rgba(15, 35, 70, .06); animation: dd-in .12s ease-out; }
.dd-opt { padding: 9px 14px; border-radius: 12px; font-size: .875rem; font-weight: 500; line-height: 1.35; color: var(--ink-2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-opt + .dd-opt { margin-top: 2px; }
.dd-opt.is-active { background: color-mix(in srgb, var(--blue) 8%, white); color: var(--ink); }
.dd-opt[aria-selected="true"] { background: color-mix(in srgb, var(--blue) 14%, white); color: var(--blue); font-weight: 700; }
.dd-opt[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
:root[data-skin~="r1"] .dd-opt[aria-selected="true"] { color: #0670C9; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .dd-pop { animation: none; } }
select { cursor: pointer; }
/* the list is drawn by js/dropdown.js; the select itself must not receive the click (else the browser opens its own list too) */
select:not([multiple]) { pointer-events: none; }
.tx-sel, .fbox, .lt-month, .r1-month, .cm-month, .field:has(> select), .field:has(select) { cursor: pointer; }

/* Theme button beside the bell */
.theme-pop { width: 260px; }
.theme-pop .skin { width: 100%; grid-template-columns: auto 1fr; justify-items: start; align-items: center; gap: 12px; padding: 10px 12px; font-size: var(--fs-sm); text-align: left; }
.theme-pop .skin + .skin { margin-top: 6px; }

/* Language switch ID / EN (topbar) */
.lang { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); flex: none; }
.lang button { min-width: 36px; height: 34px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .02em; }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--blue); color: #fff; }
:root[data-skin~="r1"] .lang button[aria-pressed="true"] { background: #0670C9; }
@media (max-width: 420px) { .lang button { min-width: 30px; padding: 0 5px; } }
/* phones: room for language + theme + bell + avatar — demo badge shrinks to its dot, buttons tighten */
@media (max-width: 480px) {
  .topbar .sync.is-demo { font-size: 0; gap: 0; padding: 0 4px; }
  .lang { padding: 2px; }
  .lang button { min-width: 28px; height: 30px; padding: 0 4px; font-size: .6875rem; }
  .topbar__right { gap: 6px; }
  .topbar__right .iconbtn, :root[data-skin~="blue"] .topbar__right .bell { width: 40px; height: 40px; }
}
@media (min-width: 481px) and (max-width: 1099px) {
  .topbar .search { width: auto; flex: 1 1 180px; min-width: 0; }
  .topbar .search kbd { display: none; }
  .topbar .sync.is-demo { font-size: 0; gap: 0; padding: 0 4px; }
}

/* Sage banner: dark green with a pale moon and hills, white text (Nov 2026 request) */
.cm-hero { background: #2F6B45; box-shadow: 0 18px 36px -18px rgba(22, 56, 38, .55); }
.cm-hero::before { background: linear-gradient(90deg, rgba(30, 72, 48, .55) 0%, rgba(30, 72, 48, .2) 50%, rgba(30, 72, 48, 0) 75%); }
.cm-hero__eyebrow { color: rgba(255, 255, 255, .8); letter-spacing: .01em; }
.cm-hero__title { color: #fff; }
.cm-hero__note { color: rgba(255, 255, 255, .85); }
.cm-hero__btn { box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .45); }
@media (max-width: 767px) {
  .cm-hero::before { background: linear-gradient(90deg, rgba(30, 72, 48, .6) 0%, rgba(30, 72, 48, .3) 70%, rgba(30, 72, 48, .1) 100%); }
}


/* ==========================================================================
   R1 = Biru chrome + glossy icon set (js/glossy.js). Glossy icons carry their own
   colours, so their tiles turn white with a soft raised shadow instead of a tint.
   ========================================================================== */
.ic--g { stroke: none; fill: none; overflow: visible; filter: drop-shadow(0 1px 1.5px rgba(11, 94, 215, .2)); }
:root[data-skin~="r1"] :is(.tx-tile, .r1-tile, .r1-acc__ic, .r1-stat__ic, .chip-ic, .acc-ic, .lt-mini__ic):has(> .ic--g) {
  background: linear-gradient(180deg, #FFFFFF, #EAF3FF) !important; color: inherit !important;
  box-shadow: 0 6px 14px -8px rgba(11, 72, 170, .45), inset 0 1px 0 #fff; }
/* glossy glyph sizes per container (the 64-grid drawings need a little more room than outline icons) */
:root[data-skin~="r1"] .nav__item > .ic--g { padding: 5px; background: linear-gradient(180deg, #FFFFFF, #EAF3FF); box-shadow: 0 6px 14px -8px rgba(11, 72, 170, .45), inset 0 1px 0 #fff; }
:root[data-skin~="r1"] .nav__item[aria-current="page"] > .ic--g { background: #fff; box-shadow: 0 0 0 2px #0670C9, 0 6px 14px -8px rgba(11, 72, 170, .45); }
:root[data-skin~="r1"] :is(.tx-tile, .r1-tile, .r1-acc__ic, .acc-ic) > .ic--g { width: 26px; height: 26px; }
:root[data-skin~="r1"] .r1-stat__ic > .ic--g { width: 28px; height: 28px; }
:root[data-skin~="r1"] .r1-q__ic > .ic--g { width: 22px; height: 22px; }
:root[data-skin~="r1"] .r1-hero__ic > .ic--g { width: 24px; height: 24px; }
:root[data-skin~="r1"] .tab > .ic--g { width: 26px; height: 26px; }
:root[data-skin~="r1"] .r1-acc.is-on .r1-acc__ic, :root[data-skin~="r1"] .r1-acc[aria-pressed="true"] .r1-acc__ic { background: #fff !important; }
@media (max-width: 767px) { :root[data-skin~="r1"] .r1-q__ic > .ic--g { width: 28px; height: 28px; } }

/* ==========================================================================
   R1 mobile home: no top bar or period picker; quick actions as square cards,
   a 4 × 2 menu grid, then the income/expense/savings card. (Settings, theme and
   language live in Lainnya.)
   ========================================================================== */
.r1-menu { display: none; }
.more-prefs__h { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); margin: 2px 0 8px; }
.more-prefs__h + * { margin-bottom: 14px; }
.more-themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.more-themes .skin { min-height: 44px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); font-weight: 600; font-size: var(--fs-sm); color: var(--ink-2); }
.more-themes .skin[aria-pressed="true"] { border: 2px solid var(--blue); color: var(--blue); }
.lang--wide { display: flex; width: 100%; } .lang--wide button { flex: 1; height: 40px; font-size: var(--fs-sm); }
@media (max-width: 767px) {
  :root[data-skin~="r1"][data-route="dashboard"] .topbar { display: none; }
  :root[data-skin~="r1"][data-route="dashboard"] .canvas { padding-top: 18px; }
  :root[data-skin~="r1"] .r1-hello__side, :root[data-skin~="r1"] .r1-hello__sub, :root[data-skin~="r1"] .r1-hello__lotus { display: none; }
  :root[data-skin~="r1"] .r1-summary { gap: 14px; }
  :root[data-skin~="r1"] .r1-quick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  :root[data-skin~="r1"] .r1-q { background: #fff; border-radius: 22px; padding: 14px 4px 12px; gap: 10px; color: var(--ink); font-size: .8125rem; font-weight: 600; box-shadow: 0 10px 24px -18px rgba(6, 59, 112, .55); }
  :root[data-skin~="r1"] .r1-q__ic, :root[data-skin~="r1"] .r1-m__ic { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; background: linear-gradient(180deg, #FFFFFF, #EAF3FF) !important; box-shadow: 0 8px 16px -9px rgba(11, 72, 170, .5), inset 0 1px 0 #fff; border: 0; }
  :root[data-skin~="r1"] .r1-q__ic > .ic, :root[data-skin~="r1"] .r1-m__ic > .ic { width: 32px; height: 32px; }
  :root[data-skin~="r1"] .r1-menu { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 4px; background: #fff; border-radius: 24px; padding: 18px 8px; box-shadow: 0 10px 24px -18px rgba(6, 59, 112, .55); }
  :root[data-skin~="r1"] .r1-m { display: grid; justify-items: center; align-content: start; gap: 8px; text-align: center; text-decoration: none; color: var(--ink); font-size: .8125rem; font-weight: 700; line-height: 1.2; }
}
@media (max-width: 767px) { :root[data-skin~="r1"] .r1-summary { padding: 0; background: transparent; border: 0; box-shadow: none; } }
/* R1 mobile home: visible hover / press / keyboard states for quick actions and the menu grid */
@media (max-width: 767px) {
  :root[data-skin~="r1"] .r1-q, :root[data-skin~="r1"] .r1-m { transition: background-color .15s, box-shadow .15s, transform .12s; -webkit-tap-highlight-color: transparent; }
  :root[data-skin~="r1"] .r1-m { border-radius: 18px; padding: 8px 2px; }
  :root[data-skin~="r1"] .r1-q:hover, :root[data-skin~="r1"] .r1-m:hover { background: #E6F0FC; }
  :root[data-skin~="r1"] .r1-q:hover { box-shadow: 0 0 0 2px #0670C9, 0 10px 24px -18px rgba(6, 59, 112, .55); color: #0670C9; }
  :root[data-skin~="r1"] .r1-m:hover { color: #0670C9; }
  :root[data-skin~="r1"] .r1-q:active, :root[data-skin~="r1"] .r1-m:active { transform: scale(.96); background: #D6E7FB; }
  :root[data-skin~="r1"] .r1-q:focus-visible, :root[data-skin~="r1"] .r1-m:focus-visible { outline: 3px solid #0670C9; outline-offset: 2px; }
  @media (prefers-reduced-motion: reduce) { :root[data-skin~="r1"] .r1-q:active, :root[data-skin~="r1"] .r1-m:active { transform: none; } }
}
/* R1 mobile: no top bar on any page (menu, theme, language and reminders are in Lainnya) */
@media (max-width: 767px) {
  :root[data-skin~="r1"] .topbar { display: none; }
  :root[data-skin~="r1"] .canvas { padding-top: 18px; }
}
/* R1 mobile home: compact enough that greeting → income/expense/savings card fits one phone screen */
@media (max-width: 767px) {
  :root[data-skin~="r1"][data-route="dashboard"] .canvas { padding-top: 10px; }
  :root[data-skin~="r1"] .r1-hello { margin-bottom: 0; }
  :root[data-skin~="r1"] .r1-hello__name { font-size: 1.25rem; }
  :root[data-skin~="r1"] .r1-main, :root[data-skin~="r1"] .r1-top, :root[data-skin~="r1"] .r1-summary { gap: 10px !important; }
  :root[data-skin~="r1"][data-route="dashboard"] .page, :root[data-skin~="r1"] .r1-layout { row-gap: 12px; }
  :root[data-skin~="r1"] .r1-hero { padding: 16px 18px; min-height: 0; gap: 8px; }
  :root[data-skin~="r1"] .r1-hero__value { font-size: 1.875rem; }
  :root[data-skin~="r1"] .r1-q { padding: 10px 4px 9px; gap: 6px; border-radius: 18px; }
  :root[data-skin~="r1"] .r1-q__ic, :root[data-skin~="r1"] .r1-m__ic { width: 46px; height: 46px; border-radius: 15px; }
  :root[data-skin~="r1"] .r1-q__ic > .ic, :root[data-skin~="r1"] .r1-m__ic > .ic { width: 28px; height: 28px; }
  :root[data-skin~="r1"] .r1-menu { padding: 12px 6px; gap: 4px 2px; border-radius: 22px; }
  :root[data-skin~="r1"] .r1-m { padding: 6px 2px; gap: 6px; font-size: .78rem; }
  :root[data-skin~="r1"] .r1-stats { padding: 2px 14px; }
  :root[data-skin~="r1"] .r1-stats .r1-stat { padding: 9px 0; }
}
@media (max-width: 767px) { :root[data-skin~="r1"] .r1-hello { margin-bottom: 12px; } }
/* Budget card: category dropdown (R1 phones) instead of the chip row */
.r1-bud-sel { display: none; }
@media (max-width: 767px) {
  :root[data-skin~="r1"] .r1-budget .r1-chips--sm { display: none; }
  :root[data-skin~="r1"] .r1-bud-sel { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; height: 38px; padding: 0 12px; margin-top: -2px; border: 1px solid #DCE7F5; border-radius: 12px; background: #F6FAFF; color: #0670C9; cursor: pointer; }
  :root[data-skin~="r1"] .r1-bud-sel select { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font: inherit; font-size: .8125rem; font-weight: 600; color: var(--ink); appearance: none; -webkit-appearance: none; }
  :root[data-skin~="r1"] .r1-bud-sel .ic { width: 16px; height: 16px; flex: none; }
}
@media (max-width: 767px) {
  :root[data-skin~="r1"] .r1-bud-sel select:focus { outline: none; }
  :root[data-skin~="r1"] .r1-bud-sel:focus-within { outline: 3px solid #0670C9; outline-offset: 2px; }
}
/* Rekening keluarga — compact 2-column grid on R1 phones (option C) */
.r1-accg, .r1-accg-all { display: none; }
@media (max-width: 767px) {
  :root[data-skin~="r1"] .r1-accounts { position: relative; }
  :root[data-skin~="r1"] .r1-accounts .r1-chips, :root[data-skin~="r1"] .r1-accounts .r1-accs, :root[data-skin~="r1"] .r1-accounts > .empty { display: none; }
  :root[data-skin~="r1"] .r1-accg-all { display: block; position: absolute; top: 2px; right: 0; font-size: .8125rem; }
  :root[data-skin~="r1"] .r1-accg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
  :root[data-skin~="r1"] .r1-accg__i { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px; border-radius: 16px; background: #fff; color: var(--ink); text-decoration: none; box-shadow: 0 10px 24px -18px rgba(6, 59, 112, .55); transition: background-color .15s, box-shadow .15s; }
  :root[data-skin~="r1"] .r1-accg__i:hover { background: #E6F0FC; box-shadow: 0 0 0 2px #0670C9; }
  :root[data-skin~="r1"] .r1-accg__i:active { background: #D6E7FB; }
  :root[data-skin~="r1"] .r1-accg__ic { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(180deg, #FFFFFF, #EAF3FF); box-shadow: 0 6px 14px -8px rgba(11, 72, 170, .45); }
  :root[data-skin~="r1"] .r1-accg__ic > .ic { width: 24px; height: 24px; }
  :root[data-skin~="r1"] .r1-accg__t { display: grid; min-width: 0; }
  :root[data-skin~="r1"] .r1-accg__n { font-size: .75rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  :root[data-skin~="r1"] .r1-accg__t b { font-size: .8125rem; font-weight: 800; white-space: nowrap; }
}
/* Phones: no sideways scrolling — filter rows and tabs wrap, report tables fit the screen;
   R1 phones also drop the small explanatory notes under lists. */
@media (max-width: 767px) {
  html, body { overflow-x: hidden; }
  .tx-filters__row { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .tx-filters__row > * { flex: 1 1 auto; min-width: 0; }
  .tx-filters__row .seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .tx-filters__row .seg button { padding: 0 4px; font-size: .75rem; }
  .tx-filters__row .tx-sel { min-width: 0; max-width: 100%; }
  .set-tabs { flex-wrap: wrap; overflow: visible; }
  .set-tabs button { flex: 1 1 auto; justify-content: center; }
  .rp-scroll { overflow-x: visible; }
  .rp-table { font-size: .75rem; table-layout: auto; }
  .rp-table th, .rp-table td { padding: 7px 4px; }
  .rp-table thead th { white-space: normal; }
  .rp-table .num { white-space: nowrap; }
  :root[data-skin~="r1"] .tx-note, :root[data-skin~="r1"] .page > .foot-note, :root[data-skin~="r1"] #main > .foot-note, :root[data-skin~="r1"] .r1-layout ~ .foot-note { display: none; }
}
@media (max-width: 767px) {
  .rp-table { font-size: .6875rem; }
  .rp-table .num, .rp-table td { white-space: normal; overflow-wrap: anywhere; }
  .rp-table th, .rp-table td { padding: 7px 3px; }
}
@media (max-width: 767px) {
  .rp-table .num, .rp-table td { overflow-wrap: normal; }
  .rp-table td.num, .rp-table th.num { white-space: nowrap; }
  /* the two widest report tables drop one derivable column on phones (still in the Excel export) */
  .rp-table--acc tr > :nth-child(2), .rp-table--bud tr > :nth-child(4) { display: none; }
}
@media (max-width: 767px) { :root[data-skin~="r1"] .foot-note { display: none; } }
/* R1 phones: page titles without the description line under them */
@media (max-width: 767px) { :root[data-skin~="r1"] .page-sub { display: none; } }
/* R1 phones: compact transaction filter card — search + period on one line, type tabs, 2 × 2 selects */
@media (max-width: 767px) {
  :root[data-skin~="r1"] .tx-filters { padding: 10px; gap: 8px; border-radius: 18px; }
  :root[data-skin~="r1"] .tx-filters__top { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: 8px; }
  :root[data-skin~="r1"] .tx-filters .tx-search, :root[data-skin~="r1"] .tx-filters .tx-sel { min-height: 36px; padding: 0 10px; gap: 6px; border-radius: 11px; font-size: .75rem; }
  :root[data-skin~="r1"] .tx-filters .tx-search input { font-size: .75rem; }
  :root[data-skin~="r1"] .tx-filters .tx-sel select { min-height: 34px; font-size: .75rem; max-width: none; width: 100%; }
  :root[data-skin~="r1"] .tx-filters .ic--sm { width: 14px; height: 14px; }
  :root[data-skin~="r1"] .tx-filters__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  :root[data-skin~="r1"] .tx-filters__row .seg { grid-column: 1 / -1; padding: 3px; border-radius: 11px; }
  :root[data-skin~="r1"] .tx-filters__row .seg button { min-height: 30px; font-size: .71875rem; border-radius: 9px; }
  :root[data-skin~="r1"] .tx-filters__row .tx-reset { grid-column: 1 / -1; justify-self: start; font-size: .75rem; }
  :root[data-skin~="r1"] .tx-filters .tx-range { gap: 8px; }
}
.bd-nav__edit { display: none; }
/* R1 phones: one tidy control card — month stepper on top, "Bulan ini" + "Atur anggaran" below */
@media (max-width: 767px) {
  :root[data-skin~="r1"] .bd-page .page-head [data-bd="edit"] { display: none; }
  :root[data-skin~="r1"] .bd-nav { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; grid-template-areas: "prev month next" "today today edit"; gap: 8px; padding: 10px; background: #fff; border: 1px solid #E3ECF7; border-radius: 18px; box-shadow: 0 10px 24px -20px rgba(6, 59, 112, .5); }
  :root[data-skin~="r1"] .bd-nav [data-bd="prev"] { grid-area: prev; } :root[data-skin~="r1"] .bd-nav [data-bd="next"] { grid-area: next; }
  :root[data-skin~="r1"] .bd-nav .btn--icon { width: 36px; height: 36px; min-height: 36px; border-radius: 11px; background: #F1F6FD; border: 0; }
  :root[data-skin~="r1"] .bd-nav b { grid-area: month; align-self: center; font-size: 1rem; }
  :root[data-skin~="r1"] .bd-nav [data-bd="today"] { grid-area: today; height: 36px; border: 1px solid #DCE7F5; border-radius: 11px; background: #F6FAFF; font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
  :root[data-skin~="r1"] .bd-nav__edit:not([hidden]) { display: inline-flex; grid-area: edit; grid-column: 3 / 4; }
  :root[data-skin~="r1"] .bd-nav { grid-template-columns: 36px minmax(0, 1fr) minmax(0, 1fr) 36px; grid-template-areas: "prev month month next" "today today edit edit"; }
  :root[data-skin~="r1"] .bd-nav__edit:not([hidden]) { grid-column: auto; height: 36px; min-height: 36px; border-radius: 11px; font-size: .75rem; justify-content: center; gap: 6px; }
  :root[data-skin~="r1"] .bd-nav [data-bd="today"]:only-of-type { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
  :root[data-skin~="r1"] .bd-nav__edit:not([hidden]) { width: 100%; box-shadow: none; }
  :root[data-skin~="r1"] .bd-nav:not(:has(.bd-nav__edit:not([hidden]))) [data-bd="today"] { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
  :root[data-skin~="r1"] .bd-nav__edit:not([hidden]) { grid-column: 3 / 5; grid-row: 2; height: 40px; min-height: 40px; }
  :root[data-skin~="r1"] .bd-nav [data-bd="today"] { grid-column: 1 / 3; grid-row: 2; height: 40px; }
  :root[data-skin~="r1"] .bd-nav:not(:has(.bd-nav__edit:not([hidden]))) [data-bd="today"] { grid-column: 1 / -1; }
}
@media (max-width: 767px) { :root[data-skin~="r1"] .bd-nav [data-bd="today"] { min-height: 40px; max-height: 40px; padding: 0; } :root[data-skin~="r1"] .bd-nav { align-items: center; } }
/* Anggaran (R1 phones): month as a dropdown; empty month card same height as the summary card, without the note */
.bd-month-sel { display: none; }
@media (max-width: 767px) {
  :root[data-skin~="r1"] .bd-nav [data-bd="prev"], :root[data-skin~="r1"] .bd-nav [data-bd="next"], :root[data-skin~="r1"] .bd-nav #bd-month { display: none; }
  :root[data-skin~="r1"] .bd-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-areas: none; }
  :root[data-skin~="r1"] .bd-month-sel { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid #DCE7F5; border-radius: 11px; background: #F6FAFF; color: #0670C9; cursor: pointer; }
  :root[data-skin~="r1"] .bd-month-sel select { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font: inherit; font-size: .875rem; font-weight: 700; color: var(--ink); appearance: none; -webkit-appearance: none; }
  :root[data-skin~="r1"] .bd-month-sel select:focus { outline: none; }
  :root[data-skin~="r1"] .bd-month-sel:focus-within { outline: 3px solid #0670C9; outline-offset: 2px; }
  :root[data-skin~="r1"] .bd-month-sel .ic { flex: none; width: 16px; height: 16px; }
  :root[data-skin~="r1"] .bd-empty { min-height: 200px; display: grid; align-items: center; }
  :root[data-skin~="r1"] .bd-empty .empty { padding: 8px 0; gap: 14px; }
  :root[data-skin~="r1"] .bd-empty__note { display: none; }
}
@media (max-width: 767px) {
  :root[data-skin~="r1"] .bd-empty .empty { height: 100%; align-content: center; justify-items: stretch; text-align: center; }
  :root[data-skin~="r1"] .bd-empty-act { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; width: 100%; }
  :root[data-skin~="r1"] .bd-empty-act .btn { width: 100%; height: 40px; min-height: 40px; font-size: .8125rem; justify-content: center; padding: 0 8px; }
}
@media (max-width: 767px) { :root[data-skin~="r1"] .bd-empty .empty { padding: 14px; } }

/* ==========================================================================
   Dashboard tabs (Keluarga | Per PIC) and the per-PIC view
   ========================================================================== */
.dash-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 8px 20px -18px rgba(6, 59, 112, .5); }
.dash-tabs a { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 10px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); text-decoration: none; }
.dash-tabs a:hover { background: var(--field); }
.dash-tabs a[aria-current="page"] { background: var(--blue); color: #fff; }
:root[data-skin~="r1"] .dash-tabs a[aria-current="page"] { background: #0670C9; }
.pic-page { display: grid; gap: 14px; align-content: start; }
.pic-page .dash-tabs { margin-bottom: 0; justify-self: start; }
.pic-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pic-sel { display: flex; align-items: center; gap: 8px; height: 42px; min-width: 220px; padding: 0 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--blue); cursor: pointer; }
.pic-sel select { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--ink); appearance: none; -webkit-appearance: none; }
.pic-sel select:focus { outline: none; } .pic-sel:focus-within { outline: 3px solid var(--ring); outline-offset: 1px; }
.pic-period { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--muted); }
.pic-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pic-k { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px; display: grid; gap: 4px; box-shadow: var(--shadow-card); }
.pic-k span { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; } .pic-k b { font-size: 1.125rem; }
.pic-k--in b { color: var(--up-ink, #15803D); } .pic-k--out b { color: #B42318; }
#pic-out { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
#pic-out > .pic-kpis, #pic-out > .pic-card:first-of-type { grid-column: 1 / -1; }
.pic-card { padding: 16px 18px; }
.pic-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 1rem; margin-bottom: 10px; }
.pic-sum { font-size: .9375rem; color: var(--ink); }
.pic-mem, .pic-cats, .pic-tx { list-style: none; margin: 0; padding: 0; }
.pic-mem li { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.pic-mem li:last-child { border: 0; }
.pic-mem__who { display: grid; grid-template-columns: 34px 1fr; column-gap: 10px; align-items: center; text-align: left; border: 0; background: none; padding: 4px; border-radius: 12px; cursor: pointer; color: var(--ink); }
.pic-mem__who:hover { background: var(--field); }
.pic-mem__who b { font-size: var(--fs-sm); } .pic-mem__who small { grid-column: 2; font-size: .6875rem; color: var(--muted); }
.pic-av { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(140deg, #38BDF8, #0670C9); color: #fff; font-weight: 800; }
.pic-bars { display: grid; gap: 4px; } .pic-bar { display: block; height: 8px; border-radius: 99px; min-width: 2px; }
.pic-bar--in { background: #22A35A; } .pic-bar--out { background: #E5484D; }
.pic-mem__v { display: grid; text-align: right; font-size: var(--fs-xs); font-weight: 700; }
.pic-mem__v .up { color: #15803D; } .pic-mem__v .down { color: #B42318; }
.pic-cats li, .pic-tx li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; }
.pic-ci { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; }
.pic-cn { display: grid; gap: 4px; min-width: 0; } .pic-cn b { font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pic-cn small { font-size: .6875rem; color: var(--muted); }
.pic-track { display: block; height: 6px; border-radius: 99px; background: var(--field); overflow: hidden; } .pic-track span { display: block; height: 100%; border-radius: 99px; }
.pic-cv { display: grid; text-align: right; } .pic-cv b { font-size: var(--fs-sm); } .pic-cv small { font-size: .6875rem; color: var(--muted); }
.pic-tx .up { color: #15803D; } .pic-tx .down { color: #B42318; } .pic-tx b.num { font-size: var(--fs-sm); white-space: nowrap; }
.pic-accs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pic-acc { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 14px; text-decoration: none; color: var(--ink); }
.pic-acc:hover { background: var(--field); }
.pic-acc__ic { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.pic-acc__t { display: grid; min-width: 0; } .pic-acc__t span { font-size: .75rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pic-acc__t b { font-size: .8125rem; }
.pic-empty { font-size: var(--fs-sm); }
:root[data-skin~="r1"] :is(.pic-ci, .pic-acc__ic):has(> .ic--g) { background: linear-gradient(180deg, #FFFFFF, #EAF3FF) !important; box-shadow: 0 6px 14px -8px rgba(11, 72, 170, .45); }
:root[data-skin~="r1"] :is(.pic-ci, .pic-acc__ic) > .ic--g { width: 24px; height: 24px; }
@media (max-width: 1023px) { #pic-out { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) {
  .dash-tabs { display: flex; width: 100%; margin-bottom: 12px; }
  .dash-tabs a { flex: 1; justify-content: center; height: 34px; font-size: .8125rem; }
  .pic-sel { flex: 1; min-width: 0; height: 40px; }
  .pic-period { width: 100%; font-size: .75rem; }
  .pic-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pic-k { padding: 12px; } .pic-k b { font-size: 1rem; }
  .pic-mem li { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .pic-bars { grid-column: 1 / -1; grid-row: 2; }
  .pic-card { padding: 14px; }
}

/* ---- PDF preview (Laporan → Unduh PDF) ---- */
.pdfv{background:#E9EEF5;border-radius:12px;padding:12px;margin:-4px 0}
.pdfv__page{background:#fff;color:#14233B;border-radius:4px;box-shadow:0 2px 10px rgba(20,35,59,.12);padding:18px 16px 20px;font-size:11px;line-height:1.35}
.pdfv__band{background:#0670C9;color:#fff;border-radius:3px;padding:10px 12px;display:flex;flex-direction:column;gap:2px}
.pdfv__band small{color:#CFE4FA;font-weight:700;font-size:9px}
.pdfv__band b{font-size:15px}
.pdfv__sub{color:#5B6B82;margin:10px 0 0}
.pdfv__sec{margin-top:14px}
.pdfv__sec h3{font-size:12.5px;margin:0 0 6px}
.pdfv__t{width:100%;border-collapse:collapse;table-layout:fixed}
.pdfv__t th{background:#EEF4FB;text-align:left;font-weight:700;padding:5px 4px;font-size:10px}
.pdfv__t td{padding:4px;border-bottom:1px solid #E2E8F0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pdfv__t .n{text-align:right;font-variant-numeric:tabular-nums}
.pdfv__t .neg{color:#B42318}
.pdfv__t tr.tot td{font-weight:700;border-top:1px solid #94A3B8}
.pdfv__note{color:#7A8AA0;font-size:9.5px;margin:6px 0 0}
#txn-sheet .sheet__foot a.btn{text-decoration:none}
@media (max-width:600px){.pdfv{padding:6px}.pdfv__page{padding:12px 10px;font-size:9.5px}.pdfv__t th{font-size:8.5px}.pdfv__t td{padding:3px 2px}}

/* Laporan layout: big panel beside a stack of smaller ones */
.rp-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rp-stack > .panel { margin: 0; }
.rp-grid--split > .panel { margin: 0; }
.rp-stack .rp-closing { margin: 0; }
.rp-grid--split { align-items: stretch; }

/* ---- Hapus permanen (rekening, target, utang/piutang) ---- */
.del-zone { display: grid; gap: 6px; padding: 14px; border: 1px dashed #F1B4AE; border-radius: var(--r-box); font-size: var(--fs-sm); background: color-mix(in srgb, #B42318 4%, transparent); }
.del-zone > b { color: #B42318; }
.del-zone .btn { justify-self: start; }
.btn--danger { color: #B42318 !important; border-color: #F1B4AE !important; }
.btn--danger:hover { background: #FDECEA !important; }
.btn--danger-solid { background: #B42318; color: #fff; border: 1px solid #B42318; }
.btn--danger-solid:hover { background: #912018; }
.btn--danger-solid:disabled { opacity: .7; }
.del-zone.is-confirm { border-style: solid; border-color: #E8847A; }
.del-zone__warn { display: flex; gap: 8px; align-items: flex-start; margin: 0; color: #7A1A12; line-height: 1.45; }
.del-zone__warn .ic { color: #B42318; flex: none; margin-top: 2px; }
.del-zone__row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.del-zone__row .btn { justify-self: auto; }

/* Rekening: filter per PIC & tipe */
.acc-filters { padding: 10px 12px; margin-bottom: 16px; }
.acc-filters .acc-f-reset { min-height: 36px; padding-inline: 12px; font-size: var(--fs-sm); }

/* Dashboard per PIC: 5 KPI cards (Saldo rekening first) */
.pic-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pic-k small { font-size: var(--fs-xs); color: var(--muted); }
.pic-k--acc b { color: var(--brand-ink, #0B4F94); }
@media (max-width: 1099px) { .pic-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .pic-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pic-k--acc { grid-column: 1 / -1; } }

/* ==== Summary tiles with icon (pastel, like the R1 home stats) — every page ==== */
.kt { --bg: #F0F6FE; --ib: #E1EDFC; --ic: #2F6FB5; }
.kt--in { --bg: #F1FAF4; --ib: #DFF3E7; --ic: #15803D; }
.kt--out { --bg: #FFF4F2; --ib: #FCE4E4; --ic: #C0392B; }
.kt--blue { --bg: #F0F6FE; --ib: #E1EDFC; --ic: #2F6FB5; }
.kt--amber { --bg: #FFF8EC; --ib: #FDEDD0; --ic: #B7791F; }
.kt--violet { --bg: #F6F2FD; --ib: #ECE3FB; --ic: #7C4DBE; }
.kt--save { --bg: #F1FAF2; --ib: #DDF2E0; --ic: #3FA84A; }
.kt { background: var(--card) !important; border: 1px solid var(--border) !important; border-radius: 18px;
  box-shadow: var(--shadow-card); padding: 14px 16px; display: grid; gap: 2px; align-content: start; min-width: 0; }
.kt__ic, .kt-panel > .kt__ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--ib); color: var(--ic); margin-bottom: 8px; flex: none; }
.kt__ic .ic { width: 18px; height: 18px; }
.kt__ic .ic--g { width: 24px; height: 24px; }
.kt .kt__l { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.kt > b { font-size: 1.125rem; font-weight: 800; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.kt--in > b { color: #15803D; } .kt--out > b { color: #B42318; }
.kt .kt__s { font-size: var(--fs-xs); color: var(--muted); }
.kt .rp-delta { margin-top: 2px; }
/* R1: white tile so the glossy icon pops, as on the home screen */
:root[data-skin~="r1"] .kt__ic { background: #fff; box-shadow: 0 6px 14px -8px rgba(11, 72, 170, .35); }
/* panels that keep their own layout (Rekening, Tabungan, Anggaran): tint + icon at the start */
.acc-total.kt-panel { justify-content: flex-start; }
.acc-total.kt-panel > .kt__ic { margin: 0; }
.acc-total.kt-panel > .acc-split, .acc-total.kt-panel > .sv-total { margin-left: auto; }
.bd-sum.kt-panel { grid-template-columns: auto minmax(200px, auto) minmax(0, 1fr); }
.bd-sum.kt-panel > .kt__ic { margin: 0; }
.db-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 4px; }
.db-sum .kt > b { font-size: 1.375rem; }
@media (max-width: 767px) {
  .bd-sum.kt-panel { grid-template-columns: auto minmax(0, 1fr); }
  .bd-sum.kt-panel > .bd-sum__bar { grid-column: 1 / -1; }
  .acc-total.kt-panel > .acc-split, .acc-total.kt-panel > .sv-total { margin-left: 0; flex-basis: 100%; }
  .db-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .db-sum .kt:first-child { grid-column: 1 / -1; }
  .db-sum .kt > b, .kt > b { font-size: 1rem; }
  .kt { padding: 12px; }
}
.db-sum > .kt { grid-template-columns: minmax(0, 1fr); align-items: start; }
