﻿/* =========================================================
   CASHLY â€” daily money tracker
   Dark-first mobile UI. Designed for 390px and upward.
   ========================================================= */

:root {
  --font-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", "Manrope", "Segoe UI", sans-serif;

  --bg: #05080d;
  --bg-alt: #080d14;
  --surface: #0d131c;
  --surface-2: #121a25;
  --surface-3: #182230;
  --surface-soft: #101720;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f3f7f8;
  --text-soft: #cbd5dd;
  --muted: #8c99a7;
  --muted-2: #637182;
  --topbar-bg: rgba(5, 8, 13, 0.8);
  --modal-bg: #111923;

  --accent: #c3f53c;
  --accent-rgb: 195, 245, 60;
  --accent-ink: #0b1104;
  --income: #5ee6b0;
  --income-rgb: 94, 230, 176;
  --expense: #ff718e;
  --expense-rgb: 255, 113, 142;
  --violet: #a78bfa;
  --violet-rgb: 167, 139, 250;
  --cyan: #67e8f9;
  --amber: #fbbf24;
  --danger: #ff6b81;

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sidebar-w: 250px;

  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.36);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, 0.24);
  --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

html[data-theme="navy"] {
  --bg: #040b16;
  --bg-alt: #071221;
  --surface: #0b1727;
  --surface-2: #102034;
  --surface-3: #162941;
  --surface-soft: #0d1a2b;
  --line: rgba(164, 198, 255, 0.09);
  --line-strong: rgba(172, 204, 255, 0.16);
  --text: #f2f7ff;
  --text-soft: #c7d5e8;
  --muted: #8295ab;
  --muted-2: #5e738c;
  --topbar-bg: rgba(4, 11, 22, 0.82);
  --modal-bg: #0e1b2c;
}

html[data-theme="plum"] {
  --bg: #0b0610;
  --bg-alt: #100917;
  --surface: #170f1f;
  --surface-2: #1e1529;
  --surface-3: #281d35;
  --surface-soft: #1a1123;
  --line: rgba(255, 215, 255, 0.08);
  --line-strong: rgba(255, 215, 255, 0.15);
  --text: #fbf6ff;
  --text-soft: #ddcee7;
  --muted: #a290af;
  --muted-2: #756581;
  --topbar-bg: rgba(11, 6, 16, 0.82);
  --modal-bg: #1b1125;
}

html[data-mode="light"] {
  color-scheme: light;
  --bg: #f3f6f4;
  --bg-alt: #e9efeb;
  --surface: #ffffff;
  --surface-2: #f1f5f2;
  --surface-3: #e4ebe6;
  --surface-soft: #f7f9f7;
  --line: rgba(27, 43, 34, 0.1);
  --line-strong: rgba(27, 43, 34, 0.18);
  --text: #17231c;
  --text-soft: #33443a;
  --muted: #5e6e64;
  --muted-2: #78867e;
  --topbar-bg: rgba(243, 246, 244, 0.9);
  --modal-bg: #ffffff;
  --income: #087c53;
  --income-rgb: 8, 124, 83;
  --expense: #c33d59;
  --expense-rgb: 195, 61, 89;
  --violet: #6b4acb;
  --violet-rgb: 107, 74, 203;
  --shadow-lg: 0 24px 70px rgba(26, 43, 34, 0.15);
  --shadow-md: 0 12px 34px rgba(26, 43, 34, 0.1);
  --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
html[data-mode="light"] body { color-scheme: light; }
html[data-mode="light"] .bottom-nav { background: rgba(255, 255, 255, 0.94); }
html[data-mode="light"] .sidebar-profile:hover,
html[data-mode="light"] .nav-item:hover { background: rgba(27, 43, 34, 0.045); }
html[data-mode="light"] .balance-card h2 { color: #f4f8ef; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.18); }

html[data-accent="lime"] { --accent: #c3f53c; --accent-rgb: 195, 245, 60; --accent-ink: #0b1104; }
html[data-accent="mint"] { --accent: #5eead4; --accent-rgb: 94, 234, 212; --accent-ink: #03110f; }
html[data-accent="coral"] { --accent: #ff7a90; --accent-rgb: 255, 122, 144; --accent-ink: #1a0509; }
html[data-accent="violet"] { --accent: #a78bfa; --accent-rgb: 167, 139, 250; --accent-ink: #0f081e; }
html[data-accent="cyan"] { --accent: #67e8f9; --accent-rgb: 103, 232, 249; --accent-ink: #041013; }
html[data-accent="amber"] { --accent: #fbbf24; --accent-rgb: 251, 191, 36; --accent-ink: #171003; }
html[data-accent="pink"] { --accent: #f472b6; --accent-rgb: 244, 114, 182; --accent-ink: #190611; }
html[data-accent="azure"] { --accent: #60a5fa; --accent-rgb: 96, 165, 250; --accent-ink: #040d1c; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 780px at 90% -20%, rgba(var(--accent-rgb), 0.055), transparent 60%),
    radial-gradient(1000px 700px at -10% 110%, rgba(167, 139, 250, 0.06), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; cursor: pointer; background: none; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
::selection { background: rgba(var(--accent-rgb), 0.3); color: var(--text); }
[hidden] { display: none !important; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border: 3px solid var(--bg); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ambient { position: fixed; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; }
.ambient span { position: absolute; width: 46vw; height: 46vw; min-width: 440px; min-height: 440px; border-radius: 50%; filter: blur(120px); opacity: 0.11; }
.ambient span:nth-child(1) { background: var(--accent); top: -22vw; right: 2vw; }
.ambient span:nth-child(2) { background: #7c5cff; bottom: -30vw; left: 18vw; opacity: 0.08; }
.ambient span:nth-child(3) { background: #1dbfe5; top: 38vh; left: -30vw; opacity: 0.055; }

/* ---------- app shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  width: 100%;
  max-width: 1720px;
  min-height: 100vh;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px 18px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 45%);
  backdrop-filter: blur(24px);
  z-index: 20;
}

.brand { display: inline-flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  color: var(--accent-ink);
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 68%, #ffffff));
  box-shadow: 0 8px 26px rgba(var(--accent-rgb), 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-mark.small { width: 36px; height: 36px; border-radius: 12px; }
.brand-mark.small svg { width: 23px; height: 23px; }
.brand-mark.mini { width: 34px; height: 34px; border-radius: 11px; }
.brand-mark.mini svg { width: 22px; height: 22px; }
.brand-mark.large { width: 56px; height: 56px; border-radius: 18px; }
.brand-mark.large svg { width: 34px; height: 34px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-copy strong { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: -0.045em; }
.brand-copy small { color: var(--muted); font-size: 0.67rem; letter-spacing: 0.09em; text-transform: uppercase; margin-top: 5px; }

.sidebar-balance {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 4px;
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.09), rgba(255, 255, 255, 0.018));
  overflow: hidden;
}
.sidebar-balance::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  top: -44px;
  right: -24px;
  background: var(--accent);
  opacity: 0.13;
  filter: blur(8px);
}
.sidebar-balance strong { font-family: var(--font-display); font-size: 1.18rem; letter-spacing: -0.035em; }
.mini-label { color: var(--muted); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.mini-trend { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; color: var(--income); font-size: 0.7rem; font-weight: 700; }
.mini-trend .icon { width: 13px; height: 13px; stroke-width: 2.2; }

.side-nav { display: flex; flex-direction: column; gap: 4px; padding: 0 2px; }
.nav-label { margin: 14px 12px 6px; color: var(--muted-2); font-size: 0.61rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 13px;
  color: var(--muted);
  font-weight: 650;
  font-size: 0.85rem;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.nav-item .icon { width: 19px; height: 19px; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav-item.active { color: var(--text); background: rgba(var(--accent-rgb), 0.11); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 50%;
  width: 3px;
  height: 20px;
  border-radius: 3px;
  background: var(--accent);
  transform: translateY(-50%);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.55);
}
.nav-item.active .icon { color: var(--accent); }
.nav-count {
  margin-left: auto;
  min-width: 25px;
  height: 21px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text-soft);
  font-size: 0.64rem;
  font-weight: 800;
}
.nav-item.active .nav-count { background: var(--accent); color: var(--accent-ink); }

.side-add {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 4px;
  padding: 12px 13px;
  border-radius: 17px;
  text-align: left;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #ffffff));
  box-shadow: 0 12px 30px rgba(var(--accent-rgb), 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.side-add:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(var(--accent-rgb), 0.22); }
.side-add-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(0, 0, 0, 0.13); }
.side-add-icon .icon { width: 17px; height: 17px; stroke-width: 2.5; }
.side-add strong { display: block; font-size: 0.83rem; line-height: 1.2; }
.side-add small { display: block; margin-top: 2px; opacity: 0.6; font-size: 0.66rem; font-weight: 700; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.sync-mini {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.017);
}
.sync-mini-icon { color: var(--muted); }
.sync-mini-icon .icon { width: 18px; height: 18px; }
.sync-mini strong { display: block; font-size: 0.72rem; line-height: 1.2; }
.sync-mini small { display: block; color: var(--muted); font-size: 0.65rem; margin-top: 2px; }
.sync-dot { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: var(--muted-2); }
.sync-mini.connected .sync-dot { background: var(--income); box-shadow: 0 0 10px rgba(var(--income-rgb), 0.7); }
.sync-mini.connected .sync-mini-icon { color: var(--income); }
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  width: 100%;
  text-align: left;
  border-radius: 14px;
}
.sidebar-profile:hover { background: rgba(255, 255, 255, 0.035); }
.sidebar-profile > .icon { margin-left: auto; width: 16px; height: 16px; color: var(--muted-2); }
.profile-meta { display: flex; flex-direction: column; min-width: 0; }
.profile-meta strong { font-size: 0.76rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-meta small { color: var(--muted); font-size: 0.64rem; }
.avatar {
  width: 35px;
  height: 35px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: -0.02em;
  color: #100719;
  background: linear-gradient(135deg, #e7d4ff, #b99af6 55%, #f4a9c4);
  border: 1px solid rgba(255, 255, 255, 0.17);
}
.avatar.xl { width: 64px; height: 64px; border-radius: 20px; font-size: 1.25rem; }
.avatar-btn { cursor: pointer; padding: 0; }
.avatar-btn:hover { filter: brightness(1.08); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  padding: 14px clamp(24px, 3.4vw, 46px);
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(26px) saturate(140%);
}
.mobile-brand { display: none; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 1.04rem; letter-spacing: -0.03em; }
.page-head { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.page-kicker { color: var(--accent); font-size: 0.63rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.page-title { margin: 0; font-family: var(--font-display); font-size: 1.38rem; font-weight: 650; letter-spacing: -0.04em; line-height: 1.2; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.range-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 700;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.range-trigger:hover { border-color: var(--line-strong); background: var(--surface-2); }
.range-trigger > .icon:first-child { color: var(--accent); width: 16px; height: 16px; }
.range-trigger .chev { width: 13px; height: 13px; color: var(--muted); }
.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.icon-btn.subtle { background: transparent; border-color: transparent; color: var(--muted); }
.icon-btn.subtle:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .icon { width: 17px; height: 17px; }
.has-dot::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  top: 9px;
  right: 9px;
  border-radius: 50%;
  background: var(--expense);
  border: 2px solid var(--surface);
}
.topbar .avatar-btn { margin-left: 3px; }
.content {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px clamp(24px, 3.4vw, 46px) 64px;
}
.screen { display: none; }
.screen.active { display: block; animation: screen-in 0.36s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- shared bits ---------- */
h1, h2, h3, h4, p { margin-top: 0; }
h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.035em; }
.card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0) 42%),
    var(--surface);
  box-shadow: var(--inset-highlight);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-head h3 { margin: 3px 0 4px; font-size: 1.06rem; font-weight: 650; }
.card-sub { margin: 0; color: var(--muted); font-size: 0.72rem; line-height: 1.45; }
.eyebrow { margin: 0; color: var(--muted); font-size: 0.61rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 17px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 0.79rem;
  font-weight: 750;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.btn .icon { width: 16px; height: 16px; stroke-width: 2; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { color: var(--accent-ink); background: var(--accent); box-shadow: 0 8px 26px rgba(var(--accent-rgb), 0.16); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #ffffff); }
.btn.ghost { color: var(--text-soft); border-color: var(--line); background: var(--surface); }
.btn.ghost:hover { border-color: var(--line-strong); background: var(--surface-2); }
.btn.soft { color: var(--accent); background: rgba(var(--accent-rgb), 0.1); border-color: rgba(var(--accent-rgb), 0.17); }
.btn.soft:hover { background: rgba(var(--accent-rgb), 0.16); }
.btn.danger { color: #22070d; background: var(--danger); }
.btn.danger.ghost { color: var(--danger); border-color: rgba(255, 107, 129, 0.2); background: rgba(255, 107, 129, 0.07); }
.btn.danger.ghost:hover { background: rgba(255, 107, 129, 0.12); }
.btn.small { min-height: 36px; padding: 0 13px; border-radius: 10px; font-size: 0.73rem; }
.btn.tiny { min-height: 31px; padding: 0 11px; border-radius: 9px; font-size: 0.68rem; }
.text-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 0.71rem; font-weight: 750; white-space: nowrap; }
.text-btn .icon { width: 14px; height: 14px; }
.text-btn:hover { color: color-mix(in srgb, var(--accent) 72%, #ffffff); }
.soft-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 750;
  white-space: nowrap;
}
.soft-chip.button-chip { cursor: pointer; color: var(--text-soft); }
.soft-chip.button-chip:hover { border-color: var(--line-strong); color: var(--text); }
.soft-chip .icon { width: 13px; height: 13px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dot.income { background: var(--income); box-shadow: 0 0 8px rgba(var(--income-rgb), 0.55); }
.dot.expense { background: var(--expense); box-shadow: 0 0 8px rgba(var(--expense-rgb), 0.5); }
.chart-legend { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.66rem; font-weight: 700; white-space: nowrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.live-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12); }
.positive { color: var(--income) !important; }
.negative { color: var(--expense) !important; }

/* ---------- page intros ---------- */
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-intro h2 { margin: 3px 0 6px; font-size: clamp(1.55rem, 2.3vw, 2.1rem); font-weight: 650; line-height: 1.12; }
.intro-sub { margin: 0; color: var(--muted); font-size: 0.78rem; max-width: 620px; }
.intro-actions { display: flex; align-items: center; gap: 8px; padding-bottom: 2px; }
.greeting { margin: 3px 0 6px; font-family: var(--font-display); font-size: clamp(1.55rem, 2.3vw, 2.1rem); line-height: 1.15; }
.filter-row { display: flex; align-items: center; justify-content: flex-start; gap: 12px; margin-bottom: 16px; }
.country-picker { display: flex; flex: 0 0 auto; align-items: center; }
.country-picker select { width: 132px; min-height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface-soft); font-size: .68rem; font-weight: 700; letter-spacing: 0; text-transform: none; }
.range-chips { display: flex; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, 0.018); overflow-x: auto; scrollbar-width: none; }
.range-chips::-webkit-scrollbar { display: none; }
.range-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 9px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}
.range-chip .icon { width: 13px; height: 13px; }
.range-chip:hover { color: var(--text); }
.range-chip.active { color: var(--accent-ink); background: var(--accent); }
.filter-note { margin-left: auto; color: var(--muted-2); font-size: 0.66rem; font-weight: 700; }
/* ---------- dashboard ---------- */
.balance-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.85fr); gap: 16px; }
.balance-card {
  position: relative;
  min-height: 230px;
  padding: 24px;
  border: 1px solid rgba(var(--accent-rgb), 0.19);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 83% 8%, rgba(var(--accent-rgb), 0.35), transparent 32%),
    radial-gradient(circle at 100% 110%, rgba(102, 231, 190, 0.12), transparent 42%),
    linear-gradient(140deg, #17210d 0%, #101a12 44%, #0c131b 100%);
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.2);
}
html[data-theme="navy"] .balance-card {
  background:
    radial-gradient(circle at 83% 8%, rgba(var(--accent-rgb), 0.3), transparent 32%),
    radial-gradient(circle at 100% 110%, rgba(58, 126, 255, 0.16), transparent 42%),
    linear-gradient(140deg, #112019 0%, #0b1b25 46%, #081525 100%);
}
html[data-theme="plum"] .balance-card {
  background:
    radial-gradient(circle at 83% 8%, rgba(var(--accent-rgb), 0.29), transparent 32%),
    radial-gradient(circle at 100% 110%, rgba(206, 92, 255, 0.15), transparent 42%),
    linear-gradient(140deg, #1d1720 0%, #1b1128 46%, #100c1b 100%);
}
.balance-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; position: relative; z-index: 2; }
.balance-label { display: inline-flex; align-items: center; gap: 7px; color: #d8e0cf; font-size: 0.72rem; font-weight: 750; }
.balance-label .icon { width: 15px; height: 15px; color: var(--accent); }
.balance-badge { display: inline-flex; align-items: center; gap: 7px; color: #bdc6b8; font-size: 0.63rem; font-weight: 650; padding: 5px 9px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; background: rgba(0, 0, 0, 0.12); }
.balance-card h2 { position: relative; z-index: 2; margin: 25px 0 8px; font-family: var(--font-display); font-size: clamp(2.15rem, 4vw, 3.1rem); line-height: 1; letter-spacing: -0.055em; font-weight: 600; }
.balance-split { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; color: #94a195; font-size: .62rem; font-weight: 650; }
.balance-split span { display: inline-flex; align-items: center; gap: 5px; }
.balance-split strong { color: #d8e0cf; font-size: .66rem; font-weight: 750; }
.balance-meta { position: relative; z-index: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: #94a195; font-size: 0.66rem; }
.balance-delta { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 7px; color: #d8ffac; background: rgba(var(--accent-rgb), 0.12); font-weight: 750; }
.balance-delta .icon { width: 12px; height: 12px; stroke-width: 2.2; }
.balance-delta.down { color: #ffd1d8; background: rgba(var(--expense-rgb), 0.14); }
.balance-quick { position: relative; z-index: 2; display: flex; gap: 8px; margin-top: 22px; }
.balance-quick button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(8, 14, 8, 0.32);
  color: #e8f0e0;
  font-size: 0.68rem;
  font-weight: 700;
  backdrop-filter: blur(12px);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.balance-quick button:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.18); }
.balance-quick button span { width: 21px; height: 21px; border-radius: 6px; display: grid; place-items: center; background: rgba(var(--accent-rgb), 0.18); color: var(--accent); }
.balance-quick button:last-child span { background: rgba(var(--expense-rgb), 0.17); color: var(--expense); }
.balance-quick .icon { width: 12px; height: 12px; stroke-width: 2.2; }
.balance-shape { position: absolute; z-index: 1; width: 240px; height: 240px; border-radius: 50%; right: -70px; bottom: -130px; border: 1px solid rgba(var(--accent-rgb), 0.18); }
.balance-shape::after, .balance-shape::before { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(var(--accent-rgb), 0.13); inset: 28px; }
.balance-shape::before { inset: 58px; }
.balance-spark { position: absolute; z-index: 1; right: 22px; bottom: 27px; width: 180px; height: 66px; opacity: 0.55; pointer-events: none; }
.balance-spark svg { width: 100%; height: 100%; overflow: visible; }

.stat-stack { display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini-stat {
  position: relative;
  min-height: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  overflow: hidden;
}
.mini-stat::after { content: ""; position: absolute; left: 0; top: 15px; bottom: 15px; width: 2px; border-radius: 2px; background: var(--muted-2); }
.mini-stat.income::after { background: var(--income); box-shadow: 0 0 12px rgba(var(--income-rgb), 0.45); }
.mini-stat.expense::after { background: var(--expense); box-shadow: 0 0 12px rgba(var(--expense-rgb), 0.4); }
.mini-stat.net::after { background: var(--violet); box-shadow: 0 0 12px rgba(var(--violet-rgb), 0.4); }
.mini-stat-head { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 0.68rem; font-weight: 700; }
.mini-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; }
.mini-icon .icon { width: 13px; height: 13px; stroke-width: 2.1; }
.mini-stat.income .mini-icon { color: var(--income); background: rgba(var(--income-rgb), 0.1); }
.mini-stat.expense .mini-icon { color: var(--expense); background: rgba(var(--expense-rgb), 0.1); }
.mini-stat.net .mini-icon { color: var(--violet); background: rgba(var(--violet-rgb), 0.11); }
.mini-stat .delta { margin-left: auto; font-size: 0.62rem; font-weight: 800; color: var(--muted-2); }
.mini-stat strong { display: block; margin-top: 7px; font-family: var(--font-display); font-size: clamp(1rem, 1.3vw, 1.25rem); font-weight: 650; letter-spacing: -0.035em; white-space: nowrap; }
.mini-stat small { display: block; color: var(--muted-2); font-size: 0.62rem; margin-top: 1px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.8fr); gap: 16px; margin-top: 16px; }
.chart-card { display: flex; flex-direction: column; }
.chart-host { position: relative; height: 252px; min-width: 0; margin: 2px -4px 0; }
.chart-host.tall { height: 296px; }
.chart-host svg { width: 100%; height: 100%; overflow: visible; }
.chart-host .chart-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; color: var(--muted); font-size: 0.73rem; }
.chart-host .chart-empty .icon { width: 28px; height: 28px; color: var(--muted-2); }
.chart-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.66rem; }
.chart-foot > span { display: inline-flex; align-items: center; gap: 7px; }
.chart-foot > span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.donut-card { display: flex; flex-direction: column; }
.chart-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); gap: 2px; }
.chart-switch button { padding: 5px 8px; border-radius: 6px; color: var(--muted); font-size: .61rem; font-weight: 750; }
.chart-switch button.active { color: var(--text); background: var(--surface-3); }
.spending-bars { display: flex; flex-direction: column; gap: 10px; padding: 9px 2px 13px; }
.spending-bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; align-items: center; font-size: .65rem; }
.spending-bar-row > span { display: flex; align-items: center; gap: 7px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.spending-bar-row > span i { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--bar-color); }
.spending-bar-row strong { font-size: .65rem; }
.spending-bar-row > div { grid-column: 1 / -1; height: 5px; border-radius: 9px; background: var(--surface-3); overflow: hidden; }
.spending-bar-row b { display: block; height: 100%; border-radius: inherit; background: var(--bar-color); }
.hidden { display: none !important; }
.donut-wrap { display: grid; place-items: center; flex: 1; padding: 8px 0 14px; }
.donut {
  position: relative;
  width: min(178px, 62%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--surface-3) 0 100%);
  box-shadow: 0 0 0 1px var(--line), 0 16px 40px rgba(0, 0, 0, 0.2);
}
.donut::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.045); }
.donut-center { position: absolute; inset: 23%; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface); box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--line); }
.donut-center span { color: var(--muted); font-size: 0.57rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.donut-center strong { font-family: var(--font-display); font-size: 1rem; margin: 2px 0; letter-spacing: -0.04em; }
.donut-center small { color: var(--muted-2); font-size: 0.57rem; }
.donut-legend { display: flex; flex-direction: column; gap: 7px; margin-top: 2px; }
.donut-legend-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 0.68rem; }
.donut-legend-row .donut-dot { width: 7px; height: 7px; border-radius: 50%; }
.donut-legend-row span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-legend-row strong { font-size: 0.68rem; font-weight: 750; }
.donut-legend-row em { color: var(--muted-2); font-style: normal; font-size: 0.61rem; margin-left: 3px; }

.dashboard-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; margin-top: 16px; }
.compare-rows { display: flex; flex-direction: column; gap: 14px; }
.compare-item { display: flex; flex-direction: column; gap: 7px; }
.compare-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.7rem; }
.compare-item-head > span { color: var(--muted); font-weight: 650; }
.compare-item-head strong { font-family: var(--font-display); font-size: 0.82rem; font-weight: 650; }
.compare-item-head em { font-style: normal; margin-left: 5px; font-family: var(--font-body); font-size: 0.62rem; color: var(--muted); }
.compare-track { height: 8px; background: var(--surface-2); border-radius: 10px; overflow: hidden; display: flex; gap: 3px; padding: 1px; }
.compare-track i { display: block; height: 100%; border-radius: 8px; min-width: 2px; }
.compare-track .current { background: var(--accent); }
.compare-track .previous { background: rgba(255, 255, 255, 0.15); }
.compare-item.income .current { background: var(--income); }
.compare-item.expense .current { background: var(--expense); }
.compare-item.net .current { background: var(--violet); }
.compare-legend { display: flex; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 0.62rem; }
.compare-legend span { display: inline-flex; align-items: center; gap: 5px; }
.compare-legend i { width: 12px; height: 5px; border-radius: 4px; background: var(--accent); display: inline-block; }
.compare-legend i.previous { background: rgba(255, 255, 255, 0.15); }

.recent-list { display: flex; flex-direction: column; }
.txn-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  width: 100%;
  text-align: left;
  color: var(--text);
  transition: background 0.16s ease;
  border-radius: 9px;
}
.txn-row:last-child { border-bottom: 0; }
.txn-row:hover { background: rgba(255, 255, 255, 0.027); }
.txn-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cat-color, var(--accent));
  background: color-mix(in srgb, var(--cat-color, var(--accent)) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--cat-color, var(--accent)) 15%, transparent);
}
.txn-body { min-width: 0; display: flex; flex-direction: column; }
.txn-body strong { font-size: 0.75rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-meta { color: var(--muted); font-size: 0.62rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-meta i { font-style: normal; color: var(--muted-2); }
.txn-amount { font-family: var(--font-display); font-size: 0.79rem; font-weight: 650; letter-spacing: -0.02em; white-space: nowrap; text-align: right; }
.txn-amount.income { color: var(--income); }
.txn-amount.expense { color: var(--text); }
.txn-action { width: 26px; height: 30px; display: grid; place-items: center; border-radius: 7px; color: var(--muted-2); opacity: 0; }
.txn-row:hover .txn-action, .txn-action:focus-visible { opacity: 1; }
.txn-action:hover { background: var(--surface-2); color: var(--text); }
.txn-action .icon { width: 14px; height: 14px; }
.recent-list .txn-row:last-child .txn-action, .recent-list .txn-row:last-child { border-bottom: 0; }

.insight-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 16px;
  padding: 15px 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 17px;
  background:
    radial-gradient(700px 180px at 0% 50%, rgba(var(--accent-rgb), 0.1), transparent 60%),
    var(--surface);
}
.insight-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--accent); background: rgba(var(--accent-rgb), 0.1); }
.insight-icon .icon { width: 17px; height: 17px; }
.insight-banner > div { flex: 1; min-width: 0; }
.insight-banner strong { display: block; font-size: 0.73rem; }
.insight-banner p { margin: 2px 0 0; color: var(--muted); font-size: 0.7rem; }
.empty-state { padding: 38px 20px; text-align: center; color: var(--muted); }
.empty-state .empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 15px; color: var(--muted-2); background: var(--surface-2); border: 1px solid var(--line); }
.empty-state .empty-icon .icon { width: 22px; height: 22px; }
.empty-state strong { display: block; color: var(--text-soft); font-family: var(--font-display); font-size: 0.9rem; }
.empty-state p { max-width: 290px; margin: 5px auto 14px; font-size: 0.7rem; line-height: 1.5; }

/* ---------- entries ---------- */
.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 16px; }
.summary-card { display: flex; align-items: flex-start; gap: 11px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); min-width: 0; }
.summary-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; }
.summary-icon .icon { width: 15px; height: 15px; }
.summary-icon.violet { color: var(--violet); background: rgba(var(--violet-rgb), 0.1); }
.summary-icon.mint { color: var(--income); background: rgba(var(--income-rgb), 0.09); }
.summary-icon.coral { color: var(--expense); background: rgba(var(--expense-rgb), 0.09); }
.summary-icon.lime { color: var(--accent); background: rgba(var(--accent-rgb), 0.09); }
.summary-card > div { min-width: 0; display: flex; flex-direction: column; }
.summary-card small { color: var(--muted); font-size: 0.62rem; font-weight: 650; }
.summary-card strong { margin: 3px 0 1px; font-family: var(--font-display); font-size: 1rem; letter-spacing: -0.035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-card span:not(.summary-icon) { color: var(--muted-2); font-size: 0.59rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.entries-card { padding: 18px; }
.entries-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 8px; flex: 1 1 230px; min-width: 180px; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); color: var(--muted); transition: border-color 0.18s ease; }
.search-box:focus-within { border-color: rgba(var(--accent-rgb), 0.44); }
.search-box .icon { width: 15px; height: 15px; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 0.73rem; }
.search-box input::placeholder { color: var(--muted-2); }
.search-box kbd { display: inline-grid; place-items: center; min-width: 19px; height: 19px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted-2); font-family: inherit; font-size: 0.59rem; }
.segment { display: flex; align-items: center; gap: 2px; height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.segment button { height: 32px; padding: 0 12px; border-radius: 8px; color: var(--muted); font-size: 0.68rem; font-weight: 700; transition: background 0.18s ease, color 0.18s ease; }
.segment button:hover { color: var(--text); }
.segment button.active { color: var(--text); background: var(--surface-3); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.entries-toolbar select { height: 40px; max-width: 150px; padding: 0 30px 0 11px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background-color: var(--surface-soft); color: var(--text-soft); font-size: 0.7rem; cursor: pointer; }
.entries-toolbar select:focus { border-color: rgba(var(--accent-rgb), 0.44); }
.entries-toolbar .icon-btn { width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface-soft); }
.entries-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 17px 2px 3px; padding-bottom: 9px; border-bottom: 1px solid var(--line); color: var(--muted-2); font-size: 0.64rem; }
.entries-meta span:first-child { color: var(--text-soft); font-weight: 700; }
.entry-list { display: flex; flex-direction: column; }
.entry-day + .entry-day { margin-top: 7px; }
.entry-day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 2px 8px; }
.entry-day-label { display: flex; align-items: baseline; gap: 8px; }
.entry-day-label strong { font-size: 0.74rem; font-weight: 750; }
.entry-day-label span { color: var(--muted-2); font-size: 0.61rem; }
.entry-day-totals { display: flex; gap: 10px; font-size: 0.62rem; font-weight: 700; }
.entry-day-totals .in { color: var(--income); }
.entry-day-totals .out { color: var(--muted); }
.entry-day-body { display: flex; flex-direction: column; padding: 0 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, 0.012); }
.entry-day-body .txn-row { min-height: 61px; padding: 9px 3px; }
.entry-day-body .txn-action { opacity: 0.55; }
.entry-day-body .txn-row:hover .txn-action { opacity: 1; }
.entry-empty { padding: 50px 20px; }
/* ---------- cash flow ---------- */
.cf-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.month-switch { display: flex; align-items: center; gap: 11px; }
.month-switch > div { display: flex; flex-direction: column; min-width: 148px; text-align: center; }
.month-switch strong { font-family: var(--font-display); font-size: 0.91rem; letter-spacing: -0.03em; }
.month-switch .icon-btn { width: 34px; height: 34px; }
.cf-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 16px; }
.cf-stat {
  position: relative;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  overflow: hidden;
}
.cf-stat::after { content: ""; position: absolute; width: 80px; height: 80px; right: -28px; top: -34px; border-radius: 50%; background: var(--stat-color); opacity: 0.1; filter: blur(2px); }
.cf-stat.opening { --stat-color: var(--violet); }
.cf-stat.inflow { --stat-color: var(--income); }
.cf-stat.outflow { --stat-color: var(--expense); }
.cf-stat.closing { --stat-color: var(--accent); border-color: rgba(var(--accent-rgb), 0.19); background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.07), var(--surface) 72%); }
.cf-stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 0.65rem; font-weight: 650; }
.cf-stat-top .icon { width: 15px; height: 15px; color: var(--stat-color); }
.cf-stat strong { display: block; margin: 10px 0 3px; font-family: var(--font-display); font-size: clamp(1.05rem, 1.5vw, 1.32rem); letter-spacing: -0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-stat small { display: block; color: var(--muted-2); font-size: 0.59rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cashflow-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(275px, 0.72fr); gap: 16px; }
.cash-chart-card .card-head { margin-bottom: 12px; }
.cash-chart-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 13px; margin-top: 9px; border-top: 1px solid var(--line); }
.cash-chart-foot div { display: flex; flex-direction: column; gap: 2px; }
.cash-chart-foot span { color: var(--muted-2); font-size: 0.59rem; }
.cash-chart-foot strong { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: -0.025em; }
.cash-chart-foot strong.in { color: var(--income); }
.cash-chart-foot strong.out { color: var(--expense); }
.breakdown-card { display: flex; flex-direction: column; }
.breakdown-list { display: flex; flex-direction: column; gap: 13px; }
.breakdown-row { display: flex; flex-direction: column; gap: 6px; }
.breakdown-head { display: flex; align-items: center; gap: 7px; font-size: 0.68rem; }
.breakdown-head strong { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-head em { font-style: normal; color: var(--muted); font-family: var(--font-display); font-size: 0.68rem; }
.breakdown-head small { color: var(--muted-2); font-size: 0.59rem; min-width: 28px; text-align: right; }
.breakdown-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--bar-color); }
.breakdown-track { height: 6px; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.breakdown-track i { display: block; height: 100%; border-radius: inherit; background: var(--bar-color); box-shadow: 0 0 12px color-mix(in srgb, var(--bar-color) 28%, transparent); }
.cashflow-lower { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr); gap: 16px; margin-top: 16px; }
.month-bars { display: flex; flex-direction: column; gap: 14px; padding-top: 5px; }
.month-bar-row { display: flex; flex-direction: column; gap: 5px; }
.month-bar-head { display: flex; align-items: center; gap: 8px; font-size: 0.65rem; }
.month-bar-head strong { min-width: 32px; font-weight: 700; }
.month-bar-head span { color: var(--muted-2); font-size: 0.59rem; margin-left: auto; }
.month-bar-head em { font-style: normal; color: var(--muted-2); font-size: 0.58rem; }
.month-bar-lines { display: flex; flex-direction: column; gap: 3px; }
.month-line { height: 5px; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.month-line i { display: block; height: 100%; border-radius: inherit; }
.month-line.income i { background: var(--income); }
.month-line.expense i { background: var(--expense); opacity: 0.78; }
.month-bar-row.current .month-bar-head strong { color: var(--accent); }
.month-bar-row.current .month-line { box-shadow: inset 0 0 0 1px var(--line-strong); }
.income-list { display: flex; flex-direction: column; gap: 9px; }
.income-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.income-row:last-child { border-bottom: 0; }
.income-row .txn-icon { width: 31px; height: 31px; border-radius: 9px; font-size: 0.68rem; }
.income-row > div { min-width: 0; }
.income-row strong { display: block; font-size: 0.7rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.income-row small { color: var(--muted-2); font-size: 0.59rem; }
.income-row > span:last-child { font-family: var(--font-display); color: var(--income); font-size: 0.72rem; font-weight: 650; white-space: nowrap; }

/* ---------- calendar ---------- */
.calendar-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 16px; }
.cal-stat { min-width: 0; padding: 14px 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.cal-stat strong { display: block; margin: 3px 0 4px; font-family: var(--font-display); font-size: 0.99rem; letter-spacing: -0.035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-stat-bar { display: block; height: 3px; width: 100%; border-radius: 3px; background: var(--surface-2); overflow: hidden; position: relative; margin-top: 7px; }
.cal-stat-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--fill, 0%); border-radius: inherit; background: currentColor; }
.cal-stat-bar.mint { color: var(--income); }
.cal-stat-bar.coral { color: var(--expense); }
.cal-stat-bar.lime { color: var(--accent); }
.cal-stat-note { display: block; color: var(--muted-2); font-size: 0.59rem; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.68fr); gap: 16px; align-items: start; }
.calendar-card { padding: 20px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.calendar-head h3 { margin: 2px 0 0; font-size: 1.14rem; font-weight: 650; }
.calendar-controls { display: flex; align-items: center; gap: 4px; }
.calendar-controls .icon-btn { width: 32px; height: 32px; }
.calendar-legend { display: inline-flex; align-items: center; gap: 5px; color: var(--muted-2); font-size: 0.6rem; margin-right: 7px; }
.calendar-legend .dot { width: 5px; height: 5px; margin-left: 5px; }
.calendar-legend .dot:first-child { margin-left: 0; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; padding: 0 1px 6px; }
.calendar-weekdays span { text-align: center; color: var(--muted-2); font-size: 0.57rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 76px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.016);
  color: var(--text-soft);
  text-align: left;
  overflow: hidden;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}
.cal-day:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-1px); }
.cal-day.outside { opacity: 0.3; }
.cal-day.today .cal-day-num { color: var(--accent-ink); background: var(--accent); }
.cal-day.selected { border-color: rgba(var(--accent-rgb), 0.6); background: rgba(var(--accent-rgb), 0.07); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.12); }
.cal-day-num { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 7px; font-family: var(--font-display); font-size: 0.68rem; font-weight: 600; }
.cal-day.has-income .cal-day-num { color: var(--income); }
.cal-day.has-expense:not(.today) .cal-day-num { color: var(--expense); }
.cal-day.today .cal-day-num { color: var(--accent-ink) !important; }
.cal-day-dots { display: flex; gap: 3px; }
.cal-day-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }
.cal-day-dots i.in { background: var(--income); }
.cal-day-dots i.out { background: var(--expense); }
.cal-day-amount { font-size: 0.51rem; color: var(--muted); white-space: nowrap; margin-top: auto; line-height: 1.2; }
.cal-day-amount b { display: block; font-weight: 650; }
.cal-day-amount b.out { color: color-mix(in srgb, var(--expense) 75%, var(--muted)); }
.cal-day-amount b.in { color: var(--income); }
.day-panel { padding: 20px; position: sticky; top: 92px; }
.day-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.day-panel-head h3 { margin: 2px 0 0; font-size: 0.98rem; line-height: 1.35; }
.day-panel-head .icon-btn { width: 32px; height: 32px; border: 1px solid var(--line); background: var(--surface-soft); }
.day-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 16px 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.day-totals div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.day-totals span { color: var(--muted-2); font-size: 0.57rem; }
.day-totals strong { font-family: var(--font-display); font-size: 0.7rem; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-totals div:nth-child(1) strong { color: var(--income); }
.day-totals div:nth-child(2) strong { color: var(--expense); }
.day-entries { display: flex; flex-direction: column; max-height: 370px; overflow-y: auto; }
.day-entries .txn-row { min-height: 55px; padding: 7px 2px; }
.day-entries .txn-action { display: none; }
.day-empty { padding: 28px 10px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 13px; }
.day-empty span { width: 40px; height: 40px; margin: 0 auto 9px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); color: var(--muted-2); }
.day-empty span .icon { width: 18px; height: 18px; }
.day-empty strong { display: block; font-size: 0.72rem; }
.day-empty small { color: var(--muted-2); font-size: 0.63rem; }
/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.settings-card.wide { grid-column: span 2; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--muted); font-size: 0.65rem; font-weight: 700; }
.field.full { grid-column: span 2; }
.field input, .field select, .mini-form input, .mini-form select {
  width: 100%;
  height: 41px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.field input:focus, .field select:focus, .mini-form input:focus, .mini-form select:focus { border-color: rgba(var(--accent-rgb), 0.5); background: var(--surface-2); }
.field input::placeholder, .mini-form input::placeholder { color: var(--muted-2); }
.field input:disabled, .field select:disabled { opacity: .42; cursor: not-allowed; }
.field select, .mini-form select { cursor: pointer; }
.input-wrap { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); overflow: hidden; transition: border-color 0.16s ease; }
.input-wrap:focus-within { border-color: rgba(var(--accent-rgb), 0.5); }
.input-wrap > span { padding-left: 12px; color: var(--muted); font-size: 0.66rem; font-weight: 700; }
.input-wrap input { border: 0; border-radius: 0; background: transparent; padding-left: 7px; }
.input-wrap input:focus { background: transparent; }
.settings-form { display: flex; flex-direction: column; gap: 17px; }
.profile-hero { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(120deg, rgba(var(--accent-rgb), 0.05), var(--surface-soft)); }
.profile-hero > div { display: flex; flex-direction: column; min-width: 0; }
.profile-hero strong { font-family: var(--font-display); font-size: 0.95rem; letter-spacing: -0.02em; }
.profile-hero span:not(.avatar) { color: var(--muted); font-size: 0.68rem; overflow: hidden; text-overflow: ellipsis; }
.profile-hero small { color: var(--muted-2); font-size: 0.59rem; margin-top: 3px; }
.profile-tag { margin-left: auto; display: inline-flex !important; align-items: center; gap: 5px; flex: 0 0 auto; padding: 6px 9px; border-radius: 8px; border: 1px solid rgba(var(--accent-rgb), 0.15); background: rgba(var(--accent-rgb), 0.07); color: var(--accent) !important; font-size: 0.59rem !important; font-weight: 700; }
.profile-tag .icon { width: 12px; height: 12px; }
.settings-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-note { color: var(--muted-2); font-size: 0.61rem; line-height: 1.45; }
.settings-tip { display: flex; align-items: flex-start; gap: 6px; margin: 12px 0 0; color: var(--muted-2); font-size: 0.61rem; line-height: 1.45; }
.settings-tip .icon { width: 13px; height: 13px; color: var(--accent); margin-top: 1px; }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dark-mode-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 13px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); cursor: pointer; }
.dark-mode-row > span { display: flex; flex-direction: column; gap: 2px; }
.dark-mode-row strong { color: var(--text-soft); font-size: .68rem; }
.dark-mode-row small { color: var(--muted-2); font-size: .58rem; }
.dark-mode-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dark-mode-row i { position: relative; width: 42px; height: 24px; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-3); transition: background .18s ease, border-color .18s ease; }
.dark-mode-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .18s ease, background .18s ease; }
.dark-mode-row input:checked + i { border-color: var(--accent); background: var(--accent); }
.dark-mode-row input:checked + i::after { transform: translateX(18px); background: var(--accent-ink); }
.dark-mode-row input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 3px; }
.theme-option { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); color: var(--muted); text-align: left; transition: border-color 0.18s ease, background 0.18s ease; }
.theme-option:hover { border-color: var(--line-strong); }
.theme-option.active { border-color: rgba(var(--accent-rgb), 0.55); background: rgba(var(--accent-rgb), 0.055); }
.theme-option strong { color: var(--text-soft); font-size: 0.65rem; margin-top: 2px; }
.theme-option small { font-size: 0.55rem; color: var(--muted-2); }
.theme-preview { display: flex; flex-direction: column; gap: 3px; width: 100%; height: 38px; padding: 6px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, 0.08); }
.theme-preview i { display: block; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.16); }
.theme-preview i:first-child { width: 60%; background: var(--accent); }
.theme-preview i:last-child { width: 75%; }
.theme-preview.onyx { background: #080d14; }
.theme-preview.navy { background: #071426; }
.theme-preview.plum { background: #160c1d; }
.accent-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 9px; color: var(--muted); font-size: 0.65rem; font-weight: 700; }
.accent-grid { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.accent-grid button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; background: var(--swatch); box-shadow: inset 0 0 0 2px var(--surface-soft); transition: transform 0.18s ease, border-color 0.18s ease; }
.accent-grid button:hover { transform: scale(1.12); }
.accent-grid button.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px rgba(var(--accent-rgb), 0.5); }
.accent-grid button[data-accent-value="lime"] { --swatch: #c3f53c; }
.accent-grid button[data-accent-value="mint"] { --swatch: #5eead4; }
.accent-grid button[data-accent-value="coral"] { --swatch: #ff7a90; }
.accent-grid button[data-accent-value="violet"] { --swatch: #a78bfa; }
.accent-grid button[data-accent-value="cyan"] { --swatch: #67e8f9; }
.accent-grid button[data-accent-value="amber"] { --swatch: #fbbf24; }
.accent-grid button[data-accent-value="pink"] { --swatch: #f472b6; }
.accent-grid button[data-accent-value="azure"] { --swatch: #60a5fa; }
.status-dot { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 7px; background: rgba(255, 255, 255, 0.04); color: var(--muted); font-size: 0.59rem; font-weight: 700; white-space: nowrap; }
.status-dot i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2); }
.status-dot.on { color: var(--income); background: rgba(var(--income-rgb), 0.08); }
.status-dot.on i { background: var(--income); box-shadow: 0 0 7px rgba(var(--income-rgb), 0.7); }
.status-dot.warn { color: var(--amber); background: rgba(251, 191, 36, 0.08); }
.status-dot.warn i { background: var(--amber); box-shadow: 0 0 7px rgba(251, 191, 36, 0.6); }
.setting-list { display: flex; flex-direction: column; }
.setting-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-icon { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: var(--muted); background: var(--surface-2); }
.setting-icon.mint { color: var(--income); background: rgba(var(--income-rgb), 0.08); }
.setting-icon.violet { color: var(--violet); background: rgba(var(--violet-rgb), 0.09); }
.setting-icon .icon { width: 14px; height: 14px; }
.setting-row > div { flex: 1; min-width: 0; }
.setting-row strong { display: block; font-size: 0.71rem; font-weight: 700; }
.setting-row small { display: block; color: var(--muted-2); font-size: 0.61rem; margin-top: 2px; line-height: 1.4; }
.switch { position: relative; width: 38px; height: 22px; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: var(--surface-3); border: 1px solid var(--line); transition: background 0.2s ease; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: var(--muted); transition: transform 0.2s ease, background 0.2s ease; }
.switch input:checked + span { background: rgba(var(--accent-rgb), 0.28); border-color: rgba(var(--accent-rgb), 0.3); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--accent); }
.security-note { display: flex; gap: 7px; margin-top: 12px; padding: 9px 10px; border-radius: 9px; color: var(--muted-2); background: rgba(var(--accent-rgb), 0.035); border: 1px solid rgba(var(--accent-rgb), 0.09); font-size: 0.6rem; line-height: 1.45; }
.security-note .icon { width: 13px; height: 13px; color: var(--accent); flex: 0 0 auto; margin-top: 1px; }
.card-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.drive-settings { display: flex; flex-direction: column; gap: 13px; }
.cloudflare-sync-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0 2px; }
.cloudflare-sync-form .field { min-width: 0; margin: 0; }
.cloudflare-sync-form input { width: 100%; }
.cloudflare-sync-form input[type="password"] { letter-spacing: .04em; }
.google-tile { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.google-mark { width: 33px; height: 33px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: var(--surface-2); color: var(--text); }
.google-mark .icon { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.google-tile > div { display: flex; flex-direction: column; min-width: 0; }
.google-tile strong { font-size: 0.71rem; }
.google-tile small { color: var(--muted-2); font-size: 0.61rem; }
.drive-sync-row { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 0.65rem; padding: 0 1px; }
.drive-sync-row strong { color: var(--text-soft); font-size: 0.65rem; }
.group-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.group-overview-card { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.group-overview-head { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.group-overview-head span { width: 8px; height: 8px; border-radius: 3px; background: var(--group-color); }
.group-overview-head strong { font-size: 0.7rem; font-weight: 700; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.group-overview-head small { margin-left: auto; color: var(--muted-2); font-size: 0.56rem; }
.group-overview p { margin: 0; color: var(--muted-2); font-size: 0.6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.data-card { overflow: hidden; }
.data-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.data-action { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); text-align: left; color: var(--text); transition: border-color 0.18s ease, background 0.18s ease; }
.data-action:hover { border-color: var(--line-strong); background: var(--surface-2); }
.data-action.danger:hover { border-color: rgba(var(--expense-rgb), 0.26); }
.data-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: var(--accent); background: rgba(var(--accent-rgb), 0.08); }
.data-icon.mint { color: var(--income); background: rgba(var(--income-rgb), 0.08); }
.data-icon.coral { color: var(--expense); background: rgba(var(--expense-rgb), 0.08); }
.data-icon .icon { width: 14px; height: 14px; }
.data-action > span:nth-child(2) { min-width: 0; flex: 1; }
.data-action strong { display: block; font-size: 0.68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.data-action small { display: block; color: var(--muted-2); font-size: 0.58rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.data-action > .chev { width: 14px; height: 14px; color: var(--muted-2); }
.about-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.about-row > div { flex: 1; min-width: 0; }
.about-row strong { display: block; font-family: var(--font-display); font-size: 0.77rem; letter-spacing: -0.02em; }
.about-row small { display: block; color: var(--muted-2); font-size: 0.6rem; }

/* shared custom form controls */
input[type="date"] { color-scheme: dark; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
/* ---------- overlays and modals ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 6, 10, 0.7);
  backdrop-filter: blur(9px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  position: relative;
  width: min(565px, 100%);
  max-height: min(90vh, 930px);
  overflow-y: auto;
  padding: 29px;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background:
    radial-gradient(600px 260px at 100% 0%, rgba(var(--accent-rgb), 0.045), transparent 60%),
    var(--modal-bg);
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.overlay.open .modal { opacity: 1; transform: translateY(0) scale(1); }
.modal-close { position: absolute; top: 17px; right: 17px; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); color: var(--muted); transition: color 0.16s ease, background 0.16s ease; }
.modal-close:hover { color: var(--text); background: var(--surface-2); }
.modal-close .icon { width: 15px; height: 15px; }
.modal-head { margin-bottom: 20px; padding-right: 26px; }
.modal-head h3 { margin: 4px 0 5px; font-size: 1.37rem; font-weight: 650; }
.modal-head p:last-child { margin: 0; color: var(--muted); font-size: 0.72rem; line-height: 1.5; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.modal-foot .foot-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.modal-foot .form-note { display: inline-flex; align-items: center; gap: 5px; }
.modal-foot .form-note .icon { width: 13px; height: 13px; }
.form-error { min-height: 16px; margin: 8px 0 0; color: var(--expense); font-size: 0.65rem; font-weight: 650; }
.entry-modal { width: min(620px, 100%); }
.entry-kind-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.entry-kind-toggle button { display: flex; align-items: center; justify-content: center; gap: 7px; height: 38px; border-radius: 9px; color: var(--muted); font-size: 0.73rem; font-weight: 750; transition: background 0.17s ease, color 0.17s ease; }
.entry-kind-toggle button .icon { width: 15px; height: 15px; }
.entry-kind-toggle button.income.active { color: #041610; background: var(--income); }
.entry-kind-toggle button.expense.active { color: #21070d; background: var(--expense); }
.amount-field { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 9px; padding: 13px 16px 10px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.amount-field > span { color: var(--muted); font-family: var(--font-display); font-size: 0.9rem; font-weight: 650; }
.amount-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font-family: var(--font-display); font-size: 2rem; font-weight: 600; letter-spacing: -0.045em; color: var(--text); }
.amount-field input::placeholder { color: var(--muted-2); }
.amount-field small { grid-column: 2; color: var(--muted-2); font-size: 0.6rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.field-hint { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 0 0; color: var(--muted-2); font-size: 0.62rem; }
.field-hint .icon { width: 13px; height: 13px; }
.field-hint button { color: var(--accent); font-size: inherit; padding: 0; }
.range-modal { width: min(520px, 100%); }
.preset-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.preset-grid button { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 9px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); text-align: left; transition: border-color 0.17s ease, background 0.17s ease; }
.preset-grid button:hover { border-color: var(--line-strong); }
.preset-grid button.active { border-color: rgba(var(--accent-rgb), 0.46); background: rgba(var(--accent-rgb), 0.055); }
.preset-icon { width: 31px; height: 31px; display: grid; place-items: center; grid-row: span 2; border-radius: 9px; }
.preset-icon .icon { width: 15px; height: 15px; }
.preset-icon.lime { color: var(--accent); background: rgba(var(--accent-rgb), 0.09); }
.preset-icon.mint { color: var(--income); background: rgba(var(--income-rgb), 0.08); }
.preset-icon.violet { color: var(--violet); background: rgba(var(--violet-rgb), 0.08); }
.preset-icon.coral { color: var(--expense); background: rgba(var(--expense-rgb), 0.08); }
.preset-grid strong { font-size: 0.7rem; align-self: end; }
.preset-grid small { color: var(--muted-2); font-size: 0.59rem; align-self: start; }
.custom-range { display: flex; align-items: flex-end; gap: 8px; margin-top: 15px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.015); }
.custom-range .field { flex: 1; }
.custom-range .field input:disabled { opacity: 0.35; }
.range-dash { height: 41px; display: grid; place-items: center; color: var(--muted-2); }
.range-dash .icon { width: 15px; height: 15px; }
.wide-modal { width: min(900px, 100%); }
.manage-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 14px; }
.manage-section { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255, 255, 255, 0.012); }
.manage-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.manage-section-head h4 { margin: 2px 0 0; font-size: 0.82rem; }
.count-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 0.61rem; font-weight: 800; }
.manage-list { display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow-y: auto; margin-bottom: 13px; padding-right: 3px; }
.manage-group-item { display: flex; align-items: center; gap: 7px; padding: 8px; border-radius: 9px; background: var(--surface-soft); border: 1px solid var(--line); }
.manage-group-item > span:first-child { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 3px; background: var(--group-color); }
.manage-group-item strong { font-size: 0.68rem; flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.manage-group-item small { color: var(--muted-2); font-size: 0.56rem; }
.manage-del { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 6px; color: var(--muted-2); flex: 0 0 auto; }
.manage-del:hover { color: var(--expense); background: rgba(var(--expense-rgb), 0.08); }
.manage-del .icon { width: 12px; height: 12px; }
.head-group-label { display: flex; align-items: center; gap: 6px; margin: 2px 0 4px; color: var(--muted); font-size: 0.57rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.head-group-label i { width: 5px; height: 5px; border-radius: 2px; background: var(--group-color); }
.head-chip-grid { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.head-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--text-soft); font-size: 0.6rem; }
.head-chip i { width: 5px; height: 5px; border-radius: 50%; background: var(--head-color); }
.head-chip .manage-del { width: 15px; height: 15px; margin-right: -3px; }
.head-chip .manage-del .icon { width: 10px; height: 10px; }
.mini-form { display: flex; flex-direction: column; gap: 7px; padding-top: 11px; border-top: 1px solid var(--line); }
.mini-form-title { margin: 0; color: var(--muted); font-size: 0.61rem; font-weight: 750; }
.mini-form-row { display: flex; align-items: center; gap: 6px; }
.mini-form input, .mini-form select { height: 34px; font-size: 0.66rem; }
.mini-form select { max-width: 104px; }
.mini-form .btn { min-height: 34px; flex: 0 0 auto; }
.color-input { display: flex; align-items: center; gap: 5px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted-2); font-size: 0.59rem; white-space: nowrap; }
.color-input input { width: 22px; height: 22px; padding: 0; border: 0; cursor: pointer; background: transparent; }
.drive-modal { width: min(565px, 100%); }
.drive-hero { display: flex; align-items: center; gap: 16px; padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(125deg, rgba(var(--accent-rgb), 0.06), var(--surface-soft)); }
.drive-cloud { position: relative; width: 62px; height: 62px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 19px; color: var(--accent); background: rgba(var(--accent-rgb), 0.085); border: 1px solid rgba(var(--accent-rgb), 0.14); }
.drive-cloud > .icon { width: 27px; height: 27px; }
.drive-orbit { position: absolute; inset: 7px; border: 1px dashed rgba(var(--accent-rgb), 0.25); border-radius: 50%; animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.drive-status-pill { display: inline-flex; padding: 3px 7px; border-radius: 5px; background: var(--surface-2); color: var(--muted); font-size: 0.55rem; font-weight: 750; }
.drive-status-pill.on { color: var(--income); background: rgba(var(--income-rgb), 0.1); }
.drive-hero h4 { margin: 5px 0 2px; font-size: 0.92rem; }
.drive-hero p { margin: 0; color: var(--muted); font-size: 0.65rem; }
.drive-progress { margin-top: 13px; padding: 11px 13px; border: 1px solid rgba(var(--accent-rgb), 0.16); border-radius: 10px; background: rgba(var(--accent-rgb), 0.045); }
.drive-progress > span { display: block; height: 4px; overflow: hidden; border-radius: 4px; background: var(--surface-3); }
.drive-progress > span::after { content: ""; display: block; height: 100%; width: 35%; border-radius: inherit; background: var(--accent); animation: progress 1.1s ease-in-out infinite; }
@keyframes progress { 0% { transform: translateX(-110%); } 100% { transform: translateX(310%); } }
.drive-progress p { margin: 6px 0 0; color: var(--muted); font-size: 0.62rem; }
.drive-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 13px; }
.drive-steps > div { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.012); }
.drive-steps span { font-family: var(--font-display); color: var(--accent); font-size: 0.59rem; }
.drive-steps p { margin: 5px 0 0; }
.drive-steps strong { display: block; font-size: 0.61rem; }
.drive-steps small { display: block; color: var(--muted-2); font-size: 0.55rem; line-height: 1.35; margin-top: 2px; }
.drive-account-card { display: flex; align-items: center; gap: 9px; margin-top: 13px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.drive-account-card > div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.drive-account-card strong { font-size: 0.68rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.drive-account-card small { color: var(--muted-2); font-size: 0.59rem; }
.drive-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.drive-actions .btn { flex: 1 1 auto; }
.drive-file-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.data-action.compact { padding: 9px; }
.data-action.compact .data-icon { width: 27px; height: 27px; }
.notice-box { display: flex; gap: 8px; margin-top: 14px; padding: 10px 12px; border: 1px solid rgba(var(--accent-rgb), 0.12); border-radius: 10px; background: rgba(var(--accent-rgb), 0.04); }
.notice-box > .icon { width: 14px; height: 14px; color: var(--accent); flex: 0 0 auto; margin-top: 1px; }
.notice-box strong { display: block; font-size: 0.64rem; }
.notice-box p { margin: 2px 0 0; color: var(--muted); font-size: 0.59rem; line-height: 1.5; }
.notice-box code { padding: 1px 4px; border-radius: 4px; background: var(--surface-2); color: var(--text-soft); font-size: 0.56rem; }
.notice-box.compact { margin-top: 13px; }
.pin-modal { width: min(480px, 100%); }
.pin-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.pin-fields input { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0.35em; text-align: center; }
.confirm-modal { width: min(420px, 100%); text-align: center; }
.confirm-icon { width: 48px; height: 48px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 14px; color: var(--expense); background: rgba(var(--expense-rgb), 0.09); border: 1px solid rgba(var(--expense-rgb), 0.14); }
.confirm-icon .icon { width: 21px; height: 21px; }
.confirm-modal .modal-head { padding: 0; }
.confirm-modal .modal-foot { justify-content: center; }
.confirm-modal .modal-foot .btn { min-width: 110px; }
.about-overlay { position: fixed; inset: 0; z-index: 130; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(3, 6, 10, 0.78); backdrop-filter: blur(10px); }
.about-overlay.open { display: flex; animation: screen-in 0.25s ease; }
.about-card { position: relative; width: min(430px, 100%); padding: 28px; border: 1px solid var(--line-strong); border-radius: 24px; background: var(--modal-bg); text-align: center; box-shadow: var(--shadow-lg); }
.about-card .brand-mark { margin: 0 auto 13px; }
.about-card h3 { margin: 0 0 7px; font-size: 1.4rem; }
.about-card h3 span { color: var(--muted-2); font-family: var(--font-body); font-size: 0.65rem; font-weight: 500; }
.about-card > p { margin: 0 auto 15px; max-width: 320px; color: var(--muted); font-size: 0.72rem; line-height: 1.6; }
.about-meta { display: flex; justify-content: center; gap: 5px; flex-wrap: wrap; margin-bottom: 14px; }
.about-meta span { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 0.57rem; }
.about-card .about-small { color: var(--muted-2); font-size: 0.63rem; }
.about-card .btn { margin-top: 4px; }
/* ---------- lock screen ---------- */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  background:
    radial-gradient(700px 560px at 50% -10%, rgba(var(--accent-rgb), 0.12), transparent 65%),
    radial-gradient(700px 700px at 100% 100%, rgba(167, 139, 250, 0.12), transparent 65%),
    #06090e;
}
.lock-screen::-webkit-scrollbar { display: none; }
.lock-screen.show { display: flex; animation: screen-in 0.3s ease; }
.lock-orb { position: absolute; border-radius: 50%; filter: blur(120px); pointer-events: none; }
.lock-orb.one { width: 460px; height: 460px; top: -200px; right: 10%; background: rgba(var(--accent-rgb), 0.13); }
.lock-orb.two { width: 500px; height: 500px; bottom: -260px; left: 4%; background: rgba(167, 139, 250, 0.15); }
.lock-inner { position: relative; z-index: 2; width: min(390px, 100%); max-height: calc(100vh - 30px); overflow-y: auto; padding: 20px 12px 8px; text-align: center; scrollbar-width: none; }
.lock-inner::-webkit-scrollbar { display: none; }
.lock-brand { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 15px; font-family: var(--font-display); font-size: 1rem; letter-spacing: -0.03em; }
.lock-brand .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.lock-brand .brand-mark svg { width: 20px; height: 20px; }
.lock-time-wrap { margin-bottom: 16px; }
.lock-time { margin: 0; font-family: var(--font-display); font-size: clamp(2.8rem, 9vh, 4.3rem); font-weight: 500; line-height: 1; letter-spacing: -0.07em; }
.lock-date { margin: 5px 0 0; color: var(--muted); font-size: 0.69rem; font-weight: 600; }
.lock-identity .avatar { margin: 0 auto 8px; }
.lock-identity h2 { margin: 0 0 2px; font-size: 1.05rem; }
.lock-identity p { margin: 0; color: var(--muted); font-size: 0.66rem; }
.lock-fingerprint { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 12px 0 8px; }
.fingerprint-btn { position: relative; width: 53px; height: 53px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(var(--accent-rgb), 0.24); color: var(--accent); background: rgba(var(--accent-rgb), 0.075); transition: transform 0.18s ease, background 0.18s ease; }
.fingerprint-btn::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(var(--accent-rgb), 0.1); animation: breathe 3s ease-in-out infinite; }
.fingerprint-btn:hover { background: rgba(var(--accent-rgb), 0.13); transform: scale(1.04); }
.fingerprint-btn .icon { width: 27px; height: 27px; stroke-width: 1.5; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.06); opacity: 0.25; } }
.lock-fingerprint > span { color: var(--muted-2); font-size: 0.59rem; }
.pin-dots { display: flex; justify-content: center; gap: 9px; height: 11px; }
.pin-dots i { width: 8px; height: 8px; border: 1.5px solid var(--muted-2); border-radius: 50%; transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease; }
.pin-dots i.filled { background: var(--accent); border-color: var(--accent); transform: scale(1.1); }
.lock-error { height: 16px; margin: 4px 0 0; color: var(--expense); font-size: 0.61rem; font-weight: 650; }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 52px); justify-content: center; gap: 5px 22px; margin-top: 3px; }
.pin-keypad button { height: 43px; display: grid; place-items: center; border-radius: 50%; color: var(--text); font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; transition: background 0.15s ease; }
.pin-keypad button:hover, .pin-keypad button:active { background: rgba(255, 255, 255, 0.075); }
.pin-keypad .key-sub { color: var(--muted); }
.pin-keypad .key-sub .icon { width: 19px; height: 19px; }
.pin-keypad .key-sub:hover { color: var(--accent); }
.lock-hint { margin: 5px 0 0; color: var(--muted-2); font-size: 0.57rem; }
.lock-foot { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 13px; color: var(--muted-2); font-size: 0.56rem; }
.lock-foot .icon { width: 11px; height: 11px; color: var(--income); }
.lock-screen.shake .pin-keypad { animation: shake 0.34s ease; }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* ---------- toast / nav / fab ---------- */
.toast-stack { position: fixed; left: 50%; bottom: 24px; z-index: 300; width: min(380px, calc(100vw - 30px)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 7px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(18, 26, 36, 0.97); box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4); color: var(--text-soft); font-size: 0.7rem; font-weight: 600; pointer-events: auto; opacity: 0; transform: translateY(8px); transition: opacity 0.25s ease, transform 0.25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast .toast-icon { width: 23px; height: 23px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; color: var(--accent); background: rgba(var(--accent-rgb), 0.1); }
.toast .toast-icon .icon { width: 12px; height: 12px; }
.toast.success .toast-icon { color: var(--income); background: rgba(var(--income-rgb), 0.1); }
.toast.error .toast-icon { color: var(--expense); background: rgba(var(--expense-rgb), 0.1); }
.toast.info .toast-icon { color: var(--violet); background: rgba(var(--violet-rgb), 0.1); }
html[data-theme="navy"] .toast { background: rgba(14, 27, 44, 0.98); }
html[data-theme="plum"] .toast { background: rgba(27, 17, 37, 0.98); }

.bottom-nav { display: none; }
.fab { position: fixed; right: 27px; bottom: 27px; z-index: 55; width: 51px; height: 51px; display: grid; place-items: center; border-radius: 17px; color: var(--accent-ink); background: var(--accent); box-shadow: 0 12px 34px rgba(var(--accent-rgb), 0.28); transition: transform 0.18s ease; }
.fab:hover { transform: translateY(-2px) rotate(4deg); }
.fab .icon { width: 20px; height: 20px; stroke-width: 2.4; }

/* ---------- responsive ---------- */
@media (max-width: 1300px) {
  :root { --sidebar-w: 226px; }
  .sidebar { padding-left: 14px; padding-right: 14px; }
  .dashboard-grid, .cashflow-lower { grid-template-columns: 1fr; }
  .donut-card { display: flex; flex-direction: column; align-items: stretch; }
  .donut-card .card-head { grid-column: 1 / -1; }
  .donut-wrap { padding: 4px 0; }
  .donut { width: min(178px, 100%); }
  .calendar-layout { grid-template-columns: 1fr; }
  .day-panel { position: static; }
  .day-entries { max-height: 280px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-card.wide { grid-column: span 1; }
  .group-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1120px) {
  .balance-grid { grid-template-columns: 1fr; }
  .stat-stack { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; }
  .mini-stat { min-height: 92px; }
  .summary-strip, .cf-summary, .calendar-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cashflow-main { grid-template-columns: 1fr; }
  .entries-toolbar select { max-width: 130px; }
}
@media (max-width: 950px) {
  .dashboard-lower { grid-template-columns: 1fr; }
  .profile-tag { display: none !important; }
}

@media (max-width: 880px) {
  :root { --sidebar-w: 0px; }
  .app { display: block; }
  .sidebar { display: none; }
  .mobile-brand { display: inline-flex; }
  .topbar { gap: 12px; min-height: 66px; padding: 11px 16px; }
  .page-head { flex: 1; }
  .page-kicker { display: none; }
  .page-title { font-size: 1.16rem; }
  .content { padding: 21px 16px 106px; }
  .topbar > .page-head { min-width: 0; }
  .topbar-actions { gap: 6px; }
  .range-trigger { min-height: 36px; padding: 0 10px; font-size: 0.69rem; }
  .range-trigger .chev { display: none; }
  .icon-btn { width: 36px; height: 36px; }
  .topbar .avatar-btn { display: inline-grid; }
  .topbar #searchBtn, .topbar #notifBtn { display: none; }
  .fab { display: none; }
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: block;
    padding: 6px 10px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(6, 10, 15, 0.91);
    backdrop-filter: blur(22px) saturate(140%);
  }
  html[data-theme="navy"] .bottom-nav { background: rgba(4, 11, 22, 0.93); }
  html[data-theme="plum"] .bottom-nav { background: rgba(11, 6, 16, 0.93); }
  .bottom-nav-inner { position: relative; max-width: 500px; margin: 0 auto; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: center; }
  .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; min-height: 48px; justify-content: center; color: var(--muted-2); font-size: 0.54rem; font-weight: 700; border-radius: 10px; white-space: nowrap; }
  .bottom-nav button .icon { width: 19px; height: 19px; }
  .bottom-nav button.active { color: var(--accent); }
  .toast-stack { bottom: 83px; }
  .text-btn { min-height: 32px; padding-block: 6px; }
  .manage-del { width: 30px; height: 30px; }
  .manage-del .icon { width: 14px; height: 14px; }
  .head-chip .manage-del { width: 20px; height: 20px; }
  .field-hint button { min-height: 30px; padding-block: 5px; }
  .page-intro { align-items: flex-start; margin-bottom: 18px; }
  .intro-actions { padding: 0; }
  .balance-grid { gap: 10px; }
  .balance-card { min-height: 222px; }
  .dashboard-grid, .dashboard-lower { gap: 10px; margin-top: 10px; }
  .card { padding: 18px; border-radius: 19px; }
  .chart-host { height: 235px; }
  .chart-host.tall { height: 255px; }
  .insight-banner { margin-top: 10px; }
  .summary-strip { gap: 8px; margin-bottom: 10px; }
  .cf-summary { gap: 8px; }
  .settings-grid { gap: 10px; }
  .credit-report-summary { gap: 7px; margin: 10px 0; }
  .credit-report-stat { padding: 11px 9px; }
  .credit-report-stat small { font-size: .49rem; }
  .credit-report-stat strong { font-size: .88rem; }
  .credit-report-stat span { font-size: .52rem; }
  .credit-report-card { padding: 13px; }
  .credit-report-table th, .credit-report-table td { padding: 8px 6px; font-size: .57rem; }
  .entries-card { padding: 13px; }
  .entries-toolbar { gap: 6px; }
  .search-box { flex-basis: 100%; }
  .entries-toolbar .segment { flex: 1; justify-content: stretch; }
  .segment button { flex: 1; padding: 0 8px; }
  .entries-toolbar select { flex: 1; max-width: none; }
  .entries-toolbar .icon-btn { width: 36px; height: 36px; }
  .cashflow-main, .cashflow-lower { gap: 10px; }
  .preset-grid { gap: 6px; }
  .modal { max-height: 92vh; }
}

@media (max-width: 640px) {
  .topbar .mobile-brand strong { display: none; }
  .page-intro .intro-actions { display: none; }
  .greeting, .page-intro h2 { font-size: 1.42rem; }
  .intro-sub { font-size: 0.72rem; }
  .filter-row { margin-bottom: 12px; }
  .filter-note { display: none; }
  .range-chips { width: auto; flex: 1; }
  .country-picker select { width: 112px; }
  .range-chip { flex: 1; justify-content: center; padding: 0 6px; }
  .balance-card { min-height: 213px; padding: 20px; border-radius: 23px; }
  .balance-card h2 { margin-top: 22px; font-size: clamp(2rem, 10vw, 2.8rem); }
  .balance-badge { display: none; }
  .balance-quick { margin-top: 17px; }
  .balance-quick button { flex: 1; justify-content: center; }
  .balance-spark { width: 130px; height: 48px; opacity: 0.35; }
  .stat-stack { gap: 6px; }
  .mini-stat { padding: 11px 10px 10px 13px; border-radius: 14px; min-height: 89px; }
  .mini-stat::after { top: 10px; bottom: 10px; }
  .mini-stat-head { gap: 5px; font-size: 0.6rem; }
  .mini-icon { width: 20px; height: 20px; }
  .mini-icon .icon { width: 11px; height: 11px; }
  .mini-stat .delta { display: none; }
  .mini-stat strong { margin-top: 9px; font-size: clamp(0.74rem, 3.3vw, 0.96rem); }
  .mini-stat small { font-size: 0.53rem; }
  .donut-card { display: flex; }
  .donut { width: 166px; }
  .chart-host { height: 216px; }
  .chart-card .card-head { margin-bottom: 9px; }
  .chart-legend { gap: 8px; font-size: 0.6rem; }
  .chart-foot { flex-wrap: wrap; gap: 8px; }
  .summary-strip, .cf-summary, .calendar-stats { gap: 7px; }
  .summary-card { padding: 11px; gap: 8px; border-radius: 13px; }
  .summary-icon { width: 27px; height: 27px; border-radius: 8px; }
  .summary-icon .icon { width: 13px; height: 13px; }
  .summary-card small { font-size: 0.56rem; }
  .summary-card strong { font-size: 0.82rem; }
  .summary-card span:not(.summary-icon) { font-size: 0.52rem; }
  .cf-stat { padding: 12px; border-radius: 14px; }
  .cf-stat strong { font-size: 0.94rem; }
  .cf-stat small { font-size: 0.52rem; }
  .cf-stat-top { font-size: 0.59rem; }
  .cf-toolbar { margin-bottom: 10px; }
  .month-switch { min-width: 0; }
  .month-switch > div { min-width: 120px; }
  .month-switch .mini-label { display: none; }
  .month-switch strong { font-size: 0.82rem; }
  .cf-toolbar .soft-chip { font-size: 0.56rem; padding: 0 7px; min-height: 30px; }
  .cf-toolbar .soft-chip .icon { width: 11px; height: 11px; }
  .cash-chart-foot { gap: 5px; }
  .cash-chart-foot strong { font-size: 0.68rem; }
  .cash-chart-foot span { font-size: 0.52rem; }
  .calendar-card { padding: 13px; }
  .calendar-head { margin-bottom: 12px; }
  .calendar-head h3 { font-size: 0.96rem; }
  .calendar-legend { display: none; }
  .calendar-grid { gap: 3px; }
  .calendar-weekdays { gap: 3px; }
  .calendar-weekdays span { font-size: 0.51rem; }
  .cal-day { min-height: 55px; padding: 5px; border-radius: 8px; gap: 2px; }
  .cal-day-num { width: 18px; height: 18px; font-size: 0.6rem; border-radius: 5px; }
  .cal-day-amount { display: none; }
  .cal-day-dots { margin-top: auto; }
  .cal-day-dots i { width: 3px; height: 3px; }
  .cal-stat { padding: 11px; border-radius: 13px; }
  .cal-stat strong { font-size: 0.8rem; }
  .cal-stat .mini-label { font-size: 0.55rem; }
  .cal-stat-note { font-size: 0.54rem; }
  .day-panel { padding: 15px; }
  .day-entries { max-height: 260px; }
  .entries-toolbar { align-items: stretch; }
  .entries-toolbar .segment { flex: 1 1 100%; }
  .entries-toolbar select { flex: 1 1 0; width: auto; min-width: 0; }
  .entries-toolbar .icon-btn { flex: 0 0 36px; }
  .search-box kbd { display: none; }
  .entries-meta { margin-top: 12px; }
  .entry-day-totals { font-size: 0.56rem; gap: 6px; }
  .entry-day-label strong { font-size: 0.68rem; }
  .entry-day-body { padding: 0 7px; }
  .txn-row { gap: 8px; min-height: 54px; padding: 7px 1px; }
  .txn-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 0.7rem; }
  .txn-body strong { font-size: 0.7rem; }
  .txn-meta { font-size: 0.57rem; }
  .txn-amount { font-size: 0.7rem; }
  .recent-card { padding: 16px; }
  .recent-card .card-head { margin-bottom: 6px; }
  .settings-card { padding: 17px; }
  .settings-card.wide { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; gap: 10px; }
  .field.full { grid-column: auto; }
  .profile-hero { align-items: flex-start; padding: 11px; gap: 10px; }
  .profile-hero .avatar.xl { width: 48px; height: 48px; border-radius: 15px; font-size: 0.95rem; }
  .profile-tag { display: none !important; }
  .theme-grid { gap: 5px; }
  .theme-option { padding: 6px; border-radius: 9px; }
  .theme-preview { height: 32px; padding: 4px; }
  .data-actions { grid-template-columns: 1fr; gap: 6px; }
  .data-action { padding: 10px; }
  .group-overview { grid-template-columns: 1fr 1fr; gap: 6px; }
  .group-overview-card { padding: 9px; }
  .drive-steps { grid-template-columns: 1fr; }
  .drive-steps > div { display: flex; align-items: flex-start; gap: 8px; }
  .drive-steps p { margin-top: 0; }
  .overlay { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-height: 93vh; padding: 22px 17px calc(18px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; border-left: 0; border-right: 0; border-bottom: 0; }
  .modal-head { margin-bottom: 17px; }
  .modal-head h3 { font-size: 1.18rem; }
  .modal-foot { flex-wrap: wrap; margin-top: 18px; }
  .entry-modal .modal-foot { align-items: center; }
  .entry-modal .modal-foot .foot-right { flex: 1; justify-content: flex-end; }
  .entry-modal #entryDelete { min-height: 36px; padding: 0 9px; font-size: 0.65rem; }
  .entry-kind-toggle button { height: 35px; }
  .amount-field input { font-size: 1.8rem; }
  .preset-grid { grid-template-columns: 1fr 1fr; }
  .preset-grid button { padding: 9px; column-gap: 7px; }
  .preset-icon { width: 26px; height: 26px; border-radius: 7px; }
  .preset-grid strong { font-size: 0.65rem; }
  .preset-grid small { font-size: 0.54rem; }
  .manage-grid { grid-template-columns: 1fr; }
  .manage-list { max-height: 190px; }
  .mini-form-row { flex-wrap: wrap; }
  .mini-form input { flex: 1 1 150px; }
  .modal .wide-modal { padding-left: 15px; padding-right: 15px; }
  .drive-hero { padding: 12px; gap: 11px; }
  .drive-cloud { width: 48px; height: 48px; border-radius: 14px; }
  .drive-cloud > .icon { width: 21px; height: 21px; }
  .drive-hero h4 { font-size: 0.8rem; }
  .drive-actions .btn { min-height: 37px; font-size: 0.68rem; }
  .drive-file-actions { grid-template-columns: 1fr; }
  .pin-fields { gap: 7px; }
  .pin-fields input { font-size: 1.05rem; }
  .confirm-modal .modal-foot .btn { flex: 1; }
  .about-card { padding: 22px; }
  .lock-inner { padding-top: 10px; }
  .lock-brand { margin-bottom: 8px; }
  .lock-time { font-size: 3rem; }
  .lock-time-wrap { margin-bottom: 10px; }
  .lock-identity .avatar { width: 50px; height: 50px; border-radius: 15px; font-size: 1rem; }
  .lock-identity h2 { font-size: 0.95rem; }
  .lock-fingerprint { margin: 9px 0 5px; }
  .fingerprint-btn { width: 46px; height: 46px; }
  .fingerprint-btn .icon { width: 24px; height: 24px; }
  .pin-keypad { grid-template-columns: repeat(3, 48px); gap: 3px 18px; }
  .pin-keypad button { height: 39px; font-size: 1rem; }
  .lock-foot { margin-top: 8px; }
}
html[data-mode="light"] .bottom-nav { background: rgba(255, 255, 255, 0.94); }

@media (max-width: 370px) {
  .content { padding-left: 12px; padding-right: 12px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .page-title { font-size: 1.02rem; }
  .range-trigger { padding: 0 8px; font-size: 0.63rem; }
  .range-chip { font-size: 0.62rem; padding: 0 6px; }
  .mini-stat { padding-left: 9px; }
  .mini-stat-head span:not(.mini-icon) { font-size: 0.55rem; }
  .preset-grid { grid-template-columns: 1fr; }
  .entries-toolbar select { padding: 0 22px 0 8px; font-size: 0.63rem; }
  .entries-toolbar .search-box input { font-size: 0.66rem; }
}

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



/* =========================================================
   CASHLY v2 — company ledgers, settlements, accounts, unlock
   ========================================================= */

/* ---------- entry rows: main button + actions on the right ---------- */
.txn-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-height: 58px;
  padding: 0 2px 0 0;
  border-bottom: 1px solid var(--line);
  border-radius: 10px;
  width: 100%;
  text-align: left;
  color: var(--text);
  transition: background 0.16s ease;
}
.txn-row:last-child { border-bottom: 0; }
.txn-row:hover { background: rgba(255, 255, 255, 0.027); }
.txn-main {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 8px 4px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.txn-main:hover .txn-body strong { color: var(--accent); }
.txn-row.credit .txn-main { grid-template-columns: auto minmax(0, 1fr); }
.txn-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 4px 0;
}
.txn-action {
  width: 30px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted-2);
  opacity: 0.62;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.txn-row:hover .txn-action, .txn-action:focus-visible { opacity: 1; }
.txn-action:hover { background: var(--surface-2); color: var(--text); }
.txn-action .icon { width: 15px; height: 15px; }
.txn-action.settle { color: var(--accent); opacity: 0.9; }
.txn-action.settle:hover { background: rgba(var(--accent-rgb), 0.12); }
.txn-action.danger:hover { background: rgba(var(--expense-rgb), 0.11); color: var(--expense); }
.party-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.party-badge.receivable { color: var(--income); background: rgba(var(--income-rgb), 0.11); border: 1px solid rgba(var(--income-rgb), 0.18); }
.party-badge.payable { color: var(--expense); background: rgba(var(--expense-rgb), 0.1); border: 1px solid rgba(var(--expense-rgb), 0.18); }
.txn-progress { display: flex; align-items: center; gap: 7px; margin-top: 4px; min-width: 0; }
.txn-progress-track { width: 52px; height: 4px; flex: 0 0 auto; overflow: hidden; border-radius: 4px; background: var(--surface-3); }
.txn-progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.txn-progress em { min-width: 0; font-style: normal; color: var(--muted-2); font-size: 0.54rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-progress-amount { margin-left: auto; flex: 0 0 auto; padding-left: 4px; font-family: var(--font-display); font-size: 0.7rem; font-weight: 650; letter-spacing: -0.02em; white-space: nowrap; }
.txn-progress-amount.receivable { color: var(--income); }
.txn-progress-amount.payable { color: var(--expense); }
.txn-progress-amount.settled { color: var(--muted); }
.txn-amount.receivable { color: var(--income); }
.txn-amount.payable { color: var(--expense); }
.txn-amount.settled { color: var(--muted); }

/* ---------- company graph card ---------- */
.company-card { margin-top: 16px; padding: 20px; }
.company-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.company-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}
.company-summary-icon { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: var(--surface-2); color: var(--muted); }
.company-summary-icon .icon { width: 15px; height: 15px; }
.company-summary-item.receive .company-summary-icon { color: var(--income); background: rgba(var(--income-rgb), 0.1); }
.company-summary-item.pay .company-summary-icon { color: var(--expense); background: rgba(var(--expense-rgb), 0.1); }
.company-summary-item.net .company-summary-icon { color: var(--violet); background: rgba(var(--violet-rgb), 0.1); }
.company-summary-item div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.company-summary-item small { color: var(--muted-2); font-size: 0.56rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.company-summary-item strong { font-family: var(--font-display); font-size: 0.94rem; letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-summary-item.receive strong { color: var(--income); }
.company-summary-item.pay strong { color: var(--expense); }
.company-graph { display: flex; flex-direction: column; gap: 7px; }
.company-donut-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; margin: 4px 0 10px; }
.company-donut-wrap { display: none !important; }
.entry-currency-field { margin: 0 0 12px; }
.company-donut { width: 118px; }
.company-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.012);
  text-align: left;
  color: var(--text);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}
.company-row:hover { border-color: var(--line-strong); background: var(--surface-soft); transform: translateY(-1px); }
.company-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  color: var(--company-color, var(--accent));
  background: color-mix(in srgb, var(--company-color, var(--accent)) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--company-color, var(--accent)) 20%, transparent);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 750;
}
.company-avatar.xl { width: 64px; height: 64px; border-radius: 19px; font-size: 1.08rem; }
.company-row-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.company-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.company-row-head strong { font-size: 0.73rem; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-row-head em { font-style: normal; font-family: var(--font-display); font-size: 0.76rem; font-weight: 650; white-space: nowrap; }
.company-bars { display: flex; flex-direction: column; gap: 3px; }
.company-bars i { display: block; height: 5px; border-radius: 4px; min-width: 0; }
.company-bars .rec { background: linear-gradient(90deg, rgba(var(--income-rgb), 0.55), var(--income)); }
.company-bars .pay { background: linear-gradient(90deg, rgba(var(--expense-rgb), 0.5), var(--expense)); }
.company-row-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.55rem; color: var(--muted-2); }
.company-row-foot .in { color: var(--income); }
.company-row-foot .out { color: var(--expense); }
.company-row-chev { color: var(--muted-2); }
.company-row-chev .icon { width: 14px; height: 14px; }
.company-empty { padding: 20px 12px; text-align: center; color: var(--muted); }
.company-empty .empty-icon { width: 44px; height: 44px; margin: 0 auto 9px; display: grid; place-items: center; border-radius: 13px; background: var(--surface-2); color: var(--muted-2); }
.company-empty .empty-icon .icon { width: 20px; height: 20px; }
.company-empty strong { display: block; color: var(--text-soft); font-family: var(--font-display); font-size: 0.86rem; }
.company-empty p { max-width: 360px; margin: 4px auto 12px; font-size: 0.66rem; line-height: 1.5; }
.company-empty-actions { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.company-foot { margin-top: 12px; }
.company-foot > span { max-width: 58%; }
.credit-report-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.credit-report-stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }
.credit-report-stat small { color: var(--muted-2); font-size: .58rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.credit-report-stat strong { font-family: var(--font-display); font-size: clamp(1.05rem, 2vw, 1.45rem); letter-spacing: -.035em; }
.credit-report-stat span { color: var(--muted-2); font-size: .62rem; }
.credit-report-stat.receive strong, .credit-report-table .receive-value { color: var(--income); }
.credit-report-stat.pay strong, .credit-report-table .pay-value { color: var(--expense); }
.credit-report-stat.net strong { color: var(--violet); }
.credit-report-card { margin-top: 12px; padding: 18px; }
.credit-report-table-wrap { overflow-x: auto; }
.credit-report-table { width: 100%; border-collapse: collapse; text-align: left; }
.credit-report-table th { padding: 9px 10px; color: var(--muted-2); font-size: .57rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.credit-report-table td { padding: 10px; font-size: .68rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.credit-report-table tbody tr[data-company-id] { cursor: pointer; transition: background .15s ease; }
.credit-report-table tbody tr[data-company-id]:hover { background: var(--surface-soft); }
.credit-report-table tbody tr:last-child td { border-bottom: 0; }
.credit-report-company { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; }
.credit-report-company .company-avatar { width: 29px; height: 29px; border-radius: 9px; font-size: .58rem; }
.credit-report-empty { padding: 24px 10px !important; text-align: center; color: var(--muted-2); }
.credit-report-items { display: flex; flex-direction: column; gap: 7px; }

/* ---------- company detail ---------- */
.company-page-intro .back-link { margin: 0 0 8px; color: var(--muted); }
.back-link .icon { width: 13px; height: 13px; }
.company-hero-card { padding: 20px; }
.company-hero-main { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.company-hero-main > div { min-width: 0; }
.company-hero-main h3 { margin: 1px 0 3px; font-family: var(--font-display); font-size: 1.25rem; letter-spacing: -0.03em; }
.company-hero-main p { margin: 0; color: var(--muted); font-size: 0.67rem; line-height: 1.45; }
.company-hero-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding-top: 16px; }
.company-hero-stat { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.company-hero-stat small { display: block; color: var(--muted-2); font-size: 0.54rem; font-weight: 700; line-height: 1.35; text-transform: uppercase; letter-spacing: 0.04em; }
.company-hero-stat strong { display: block; margin-top: 3px; font-family: var(--font-display); font-size: 0.86rem; letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-hero-stat.receive strong { color: var(--income); }
.company-hero-stat.pay strong { color: var(--expense); }
.company-hero-stat.net strong { color: var(--violet); }
.company-detail-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 16px; margin-top: 16px; }
.company-detail-bars { display: flex; flex-direction: column; gap: 10px; }
.company-detail-bar { padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.company-detail-bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.company-detail-bar-head strong { min-width: 0; font-size: 0.65rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-detail-bar-head em { font-style: normal; color: var(--muted); font-family: var(--font-display); font-size: 0.63rem; white-space: nowrap; }
.company-detail-track { display: block; height: 5px; margin: 6px 0 5px; overflow: hidden; border-radius: 5px; background: var(--surface-3); }
.company-detail-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.company-detail-bar.receivable .company-detail-track i { background: var(--income); }
.company-detail-bar.payable .company-detail-track i { background: var(--expense); }
.company-detail-bar small { color: var(--muted-2); font-size: 0.54rem; }
.company-entry-list { max-height: 620px; overflow-y: auto; }

/* ---------- accounts ---------- */
.card-head-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.account-list { display: flex; flex-direction: column; }
.account-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.account-row:last-child { border-bottom: 0; }
.account-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--accent); background: rgba(var(--accent-rgb), 0.09); border: 1px solid rgba(var(--accent-rgb), 0.14); }
.account-icon .icon { width: 17px; height: 17px; }
.account-row-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-row-body strong { font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-row-body em { color: var(--muted); font-style: normal; font-family: var(--font-body); font-size: 0.6rem; }
.account-row-body small { color: var(--muted-2); font-size: 0.56rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-row .txn-action { opacity: 0.8; }
.account-modal, .settle-modal { width: min(570px, 100%); }

/* ---------- receivable / payable entry ---------- */
.entry-party-toggle { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: -7px 0 14px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.entry-party-toggle button { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 34px; padding: 0 6px; border-radius: 8px; color: var(--muted); font-size: 0.64rem; font-weight: 750; transition: background 0.16s ease, color 0.16s ease; }
.entry-party-toggle button .icon { width: 13px; height: 13px; }
.entry-party-toggle button.active { color: var(--text); background: var(--surface-3); box-shadow: var(--inset-highlight); }
.entry-party-toggle button[data-entry-party="receivable"].active { color: var(--income); background: rgba(var(--income-rgb), 0.11); }
.entry-party-toggle button[data-entry-party="payable"].active { color: var(--expense); background: rgba(var(--expense-rgb), 0.1); }
.entry-party-toggle button:disabled { opacity: 0.35; cursor: not-allowed; }
.entry-settlement { margin-top: 16px; padding: 14px; border: 1px solid rgba(var(--accent-rgb), 0.17); border-radius: 14px; background: linear-gradient(140deg, rgba(var(--accent-rgb), 0.045), var(--surface-soft)); }
.settlement-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.settlement-head p { margin: 2px 0 0; color: var(--muted); font-size: 0.6rem; line-height: 1.4; }
.settlement-badge { flex: 0 0 auto; padding: 3px 7px; border-radius: 6px; color: var(--accent); background: rgba(var(--accent-rgb), 0.1); font-size: 0.52rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.settlement-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 10px 0 8px; }
.settlement-summary > div { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, 0.018); }
.settlement-summary small { display: block; color: var(--muted-2); font-size: 0.53rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.settlement-summary strong { display: block; margin-top: 2px; font-family: var(--font-display); font-size: 0.84rem; }
.settlement-summary > div:last-child strong { color: var(--accent); }
.settlement-track { display: block; height: 5px; margin-bottom: 9px; overflow: hidden; border-radius: 5px; background: var(--surface-3); }
.settlement-track i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width 0.25s ease; }
.settlement-list { display: flex; flex-direction: column; margin-bottom: 9px; }
.settlement-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.settlement-row:last-child { border-bottom: 0; }
.settlement-row-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: var(--income); background: rgba(var(--income-rgb), 0.09); }
.settlement-row-icon .icon { width: 12px; height: 12px; }
.settlement-row > div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.settlement-row strong { font-family: var(--font-display); font-size: 0.7rem; }
.settlement-row small { color: var(--muted-2); font-size: 0.55rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settlement-del { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--muted-2); }
.settlement-del:hover { color: var(--expense); background: rgba(var(--expense-rgb), 0.1); }
.settlement-del .icon { width: 12px; height: 12px; }
.settlement-empty { margin: 0 0 8px; color: var(--muted-2); font-size: 0.6rem; }
.settle-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.settle-summary-card { padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.settle-summary-card small { display: block; color: var(--muted-2); font-size: 0.54rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.settle-summary-card strong { display: block; margin-top: 2px; font-family: var(--font-display); font-size: 1rem; }
.settle-summary-card.outstanding strong { color: var(--accent); }

/* ---------- Drive setup ---------- */
.drive-setup { margin-top: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.drive-setup-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.drive-setup-head strong { font-size: 0.72rem; }
.drive-setup > p { margin: 0 0 10px; color: var(--muted); font-size: 0.61rem; line-height: 1.5; }
.drive-setup code, .notice-box code, .drive-help code, .settings-tip code { padding: 1px 4px; border-radius: 4px; background: var(--surface-3); color: var(--text-soft); font-size: 0.94em; }
.drive-auth-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 7px; margin-top: 9px; }
.drive-auth-row .btn { min-height: 38px; }
.drive-auto { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 0.61rem; cursor: pointer; }
.drive-auto input { width: 15px; height: 15px; accent-color: var(--accent); }
.drive-help { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 9px; }
.drive-help summary { color: var(--accent); font-size: 0.61rem; font-weight: 700; cursor: pointer; }
.drive-help ol { margin: 8px 0 0; padding-left: 16px; color: var(--muted); font-size: 0.59rem; line-height: 1.55; }
.drive-help li { margin-bottom: 4px; }
.device-code-box { margin-top: 12px; padding: 13px; border: 1px dashed rgba(var(--accent-rgb), 0.3); border-radius: 12px; background: rgba(var(--accent-rgb), 0.04); text-align: center; }
.device-code-box p { margin: 0; color: var(--muted); font-size: 0.62rem; }
.device-code-box strong { display: block; margin: 7px 0; color: var(--accent); font-family: var(--font-display); font-size: 1.55rem; letter-spacing: 0.18em; }
.device-code-box a { color: var(--accent); text-decoration: underline; }
.device-code-box .btn { margin-top: 5px; }

/* ---------- offline badge ---------- */
.offline-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 31px; padding: 0 9px; border: 1px solid rgba(251, 191, 36, 0.25); border-radius: 9px; color: var(--amber); background: rgba(251, 191, 36, 0.07); font-size: 0.58rem; font-weight: 750; }
.offline-chip[hidden] { display: none; }
.offline-chip .icon { width: 12px; height: 12px; }

/* ---------- larger lock screen ---------- */
.lock-screen { padding: 0; }
.lock-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  max-height: none;
  padding: clamp(24px, 6vh, 56px) 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
html[data-theme="navy"] .lock-inner,
html[data-theme="plum"] .lock-inner { background: transparent; }
.lock-brand { margin-bottom: 18px; font-size: 1.08rem; }
.lock-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.lock-brand .brand-mark svg { width: 22px; height: 22px; }
.lock-time-wrap { margin-bottom: 20px; }
.lock-time { font-size: clamp(3.5rem, 10.5vh, 5rem); letter-spacing: -0.075em; }
.lock-date { margin-top: 7px; font-size: 0.78rem; }
.lock-identity .avatar { width: 76px; height: 76px; margin-bottom: 12px; border-radius: 23px; font-size: 1.35rem; }
.lock-identity h2 { margin-bottom: 4px; font-size: 1.5rem; letter-spacing: -0.03em; }
.lock-identity p { font-size: 0.78rem; }
.lock-biometrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 330px; margin: 18px auto 9px; }
.biometric-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 13px 9px 11px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 17px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.055);
  font-size: 0.62rem;
  font-weight: 750;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.biometric-btn:hover { transform: translateY(-2px); background: rgba(var(--accent-rgb), 0.1); border-color: rgba(var(--accent-rgb), 0.32); }
.biometric-btn:active { transform: translateY(0) scale(0.985); }
.biometric-btn.busy { pointer-events: none; opacity: 0.65; }
.biometric-btn.unavailable { color: var(--muted-2); border-color: var(--line); background: var(--surface-soft); }
.biometric-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; background: rgba(var(--accent-rgb), 0.1); }
.biometric-btn.unavailable .biometric-icon { background: var(--surface-2); }
.biometric-icon .icon { width: 25px; height: 25px; stroke-width: 1.55; }
.biometric-btn > span:last-child { line-height: 1; }
.lock-biometric-label { margin: 0 0 8px; color: var(--muted-2); font-size: 0.62rem; }
.pin-dots { gap: 11px; height: 12px; margin-top: 4px; }
.pin-dots i { width: 10px; height: 10px; }
.lock-error { height: 18px; margin: 6px 0 0; font-size: 0.66rem; }
.pin-keypad { grid-template-columns: repeat(3, 66px); gap: 9px 32px; margin-top: 8px; }
.pin-keypad button { height: 58px; font-size: 1.4rem; }
.pin-keypad .key-sub .icon { width: 22px; height: 22px; }
.lock-hint { margin-top: 8px; font-size: 0.61rem; }
.lock-foot { margin-top: 16px; font-size: 0.59rem; }
.lock-foot .icon { width: 12px; height: 12px; }

/* ---------- responsive additions ---------- */
@media (max-width: 1120px) {
  .company-hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .company-detail-grid { grid-template-columns: 1fr; }
  .company-entry-list { max-height: none; }
}
@media (max-width: 880px) {
  .company-summary { grid-template-columns: 1fr 1fr; }
  .company-summary-item.net { grid-column: span 2; }
  .company-hero-stats { grid-template-columns: 1fr 1fr; }
  .company-hero-stat.net { grid-column: span 2; }
}
@media (max-width: 640px) {
  .txn-row { gap: 2px; min-height: 54px; padding-right: 0; }
  .txn-main { gap: 8px; padding: 7px 2px; }
  .txn-action { width: 28px; height: 32px; opacity: 0.72; }
  .txn-progress-track { width: 42px; }
  .txn-progress em { font-size: 0.5rem; }
  .party-badge { font-size: 0.46rem; padding: 2px 5px; }
  .company-card { padding: 16px; }
  .company-summary { gap: 6px; margin-bottom: 12px; }
  .company-summary-item { padding: 9px; gap: 7px; }
  .company-summary-icon { width: 27px; height: 27px; }
  .company-summary-item small { font-size: 0.5rem; }
  .company-summary-item strong { font-size: 0.8rem; }
  .company-row { padding: 9px; gap: 8px; }
  .company-avatar { width: 34px; height: 34px; border-radius: 10px; }
  .company-row-foot { font-size: 0.5rem; }
  .company-foot { align-items: flex-start; flex-direction: column; gap: 8px; }
  .company-foot > span { max-width: 100%; }
  .company-hero-card { padding: 15px; }
  .company-avatar.xl { width: 54px; height: 54px; border-radius: 16px; }
  .company-hero-main h3 { font-size: 1.1rem; }
  .company-hero-main p { font-size: 0.61rem; }
  .company-hero-stats { gap: 6px; padding-top: 12px; }
  .company-hero-stat { padding: 9px; }
  .company-hero-stat small { font-size: 0.49rem; }
  .company-hero-stat strong { font-size: 0.76rem; }
  .company-detail-grid { gap: 12px; margin-top: 12px; }
  .entry-party-toggle { grid-template-columns: 1fr; gap: 3px; }
  .entry-party-toggle button { justify-content: flex-start; padding: 0 10px; min-height: 33px; }
  .entry-settlement { padding: 12px; }
  .settlement-head { flex-direction: column; gap: 5px; }
  .settle-summary { grid-template-columns: 1fr 1fr; }
  .drive-auth-row { grid-template-columns: 1fr; }
  .drive-auth-row .btn { width: 100%; }
  .offline-chip { min-height: 27px; padding: 0 7px; font-size: 0.53rem; }
  .lock-screen { padding: 0; }
  .lock-inner { width: 100%; min-height: 100vh; min-height: 100dvh; max-height: none; padding: 24px 20px; border-radius: 0; }
  .lock-brand { margin-bottom: 10px; }
  .lock-time-wrap { margin-bottom: 12px; }
  .lock-time { font-size: clamp(3rem, 10vh, 3.7rem); }
  .lock-date { font-size: 0.7rem; }
  .lock-identity .avatar { width: 64px; height: 64px; border-radius: 19px; font-size: 1.15rem; }
  .lock-identity h2 { font-size: 1.22rem; }
  .pin-keypad { grid-template-columns: repeat(3, 58px); gap: 7px 25px; }
  .pin-keypad button { height: 51px; font-size: 1.25rem; }
  .lock-foot { margin-top: 10px; }
  .settings-card .card-head-actions { justify-content: flex-start; }
  .account-row { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 5px; }
  .account-row .txn-action { width: 27px; height: 31px; }
  .entries-toolbar select { flex: 1 1 calc(50% - 4px); width: calc(50% - 4px); min-width: 0; }
  .entries-toolbar .icon-btn {
    flex: 1 1 100%;
    width: auto;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-color: var(--line);
    background: var(--surface-soft);
  }
  .entries-toolbar .icon-btn::after { content: "Clear search and filters"; font-size: 0.61rem; font-weight: 700; }
}
@media (max-width: 370px) {
  .txn-row { flex-direction: column; gap: 0; }
  .txn-main { width: 100%; }
  .txn-actions { align-self: flex-end; padding: 0 4px 4px; }
  .recent-list .txn-row { flex-direction: row; gap: 2px; }
  .recent-list .txn-main { width: auto; }
  .recent-list .txn-actions { align-self: center; padding: 4px 0; }
  .recent-list .txn-action.settle { display: none; }
}
@media (max-height: 720px) {
  .lock-inner { padding-top: 16px; padding-bottom: 12px; }
  .lock-brand { margin-bottom: 8px; }
  .lock-time-wrap { margin-bottom: 8px; }
  .lock-time { font-size: clamp(2.7rem, 9vh, 3.5rem); }
  .lock-identity .avatar { width: 48px; height: 48px; border-radius: 15px; font-size: 0.95rem; }
  .lock-identity h2 { font-size: 1rem; }
  .pin-keypad { gap: 3px 20px; }
  .pin-keypad button { height: 40px; }
  .lock-foot { margin-top: 6px; }
}
@media (max-width: 640px) {
  .cloudflare-sync-form { grid-template-columns: 1fr; }
  .screen[data-screen="credit-report"] .page-intro .intro-actions { display: flex; }
  .screen[data-screen="credit-report"] .page-intro .intro-actions .btn { min-height: 34px; padding: 0 9px; font-size: .63rem; }
  .credit-report-summary { gap: 7px; margin: 10px 0; }
  .credit-report-stat { min-width: 0; padding: 11px 9px; }
  .credit-report-stat small { font-size: .49rem; }
  .credit-report-stat strong { font-size: .88rem; }
  .credit-report-stat span { font-size: .52rem; }
  .credit-report-card { padding: 13px; }
  .credit-report-table th, .credit-report-table td { padding: 8px 6px; font-size: .57rem; }
}
