/* ==========================================================================
   Arta — warm utilitarian ledger
   Visual language: eztrx-id.pages.dev (warm neutrals, orange accent, LCD digits)
   ========================================================================== */

@font-face {
  font-family: "DSEG7";
  src: url("/fonts/DSEG7Classic-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DSEG7";
  src: url("/fonts/DSEG7Classic-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #efefea;
  --bg-lo: #e7e7e1;
  --panel: #fbfbf9;
  --panel-2: #f7f7f3;
  --key: #edede8;
  --key-2: #e4e4de;
  --ink: #3b3b38;
  --ink-strong: #242422;
  --muted: #8d8d88;
  --faint: #b4b4ae;
  --line: #e3e3dd;
  --line-2: #d5d5ce;
  --accent: #e8773c;
  --accent-strong: #d5682f;
  --accent-soft: #fbe9dd;
  --lcd: #d9d5b6;
  --lcd-2: #cfcaa7;
  --lcd-ink: #3e3c2c;
  --ok: #3f8f5f;
  --ok-soft: #e1f0e6;
  --danger: #cc5344;
  --danger-soft: #f8e3df;
  --gold: #9a7b31;
  --gold-soft: #f1ead3;
  --blue: #4e6b80;
  --blue-soft: #e4edf2;
  --white: #ffffff;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "OCR A Std", "OCR A Extended", Silom, Monaco, Menlo, "Courier New", "PingFang SC", monospace;
  --digits: "DSEG7", "OCR A Std", "OCR A Extended", Silom, Monaco, Menlo, "Courier New", monospace;
  --display: var(--sans);
  --paper: var(--bg);
  --paper-deep: var(--bg-lo);
  --paper-warm: var(--panel-2);
  --card: var(--panel);
  --ink-2: #5f5f5a;
  --ink-3: var(--muted);
  --line-strong: var(--line-2);
  --pine: var(--ink-strong);
  --pine-2: #4a4a46;
  --pine-3: var(--accent);
  --mint: #edefe9;
  --mint-2: #dfe3dc;
  --clay: var(--danger);
  --clay-deep: #b94739;
  --clay-soft: var(--danger-soft);
  --radius: 14px;
  --radius-lg: 16px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px #2828230f;
  --shadow-md: 0 1px 2px #2828230f, 0 12px 28px -22px #282823b3;
  --shadow-lg: 0 24px 70px -26px #2828238c;
  --shadow-card: 0 1px 2px #2828230f, 0 16px 32px -26px #2828238c;
  --shadow-key: inset 0 1px 0 #ffffffbf, 0 1px 2px #2828231f, 0 3px 7px -4px #2828234d;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 0%, #f8f8f4 0, #f0f0eb 38%, var(--bg) 72%, #eaeae4 100%);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.18), transparent 24%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img, svg { display: block; }
::selection { background: var(--accent-soft); color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app-root { position: relative; z-index: 1; min-height: 100dvh; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.num, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.neg { color: var(--danger); }
.pos { color: var(--ok); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* Boot ------------------------------------------------------------------ */
.boot {
  min-height: 100dvh;
  display: grid; place-content: center; justify-items: center;
  gap: 18px; color: var(--muted); font-size: 12px; letter-spacing: .08em;
}
.boot-mark {
  width: 48px; height: 48px; border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(#f18a4e, var(--accent));
  color: #fff; font-size: 26px; font-weight: 800;
  box-shadow: 0 12px 24px -16px rgba(232,119,60,.8);
  animation: breathe 2.2s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: translateY(0); opacity: .84; }
  50% { transform: translateY(-3px); opacity: 1; }
}

/* Login ----------------------------------------------------------------- */
.login-page {
  width: min(100% - 32px, 1050px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(44px + var(--safe-top)) 0 calc(44px + var(--safe-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, .8fr);
  align-items: center;
  gap: 16px;
}
.login-art {
  position: relative;
  min-height: 540px;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 34px 36px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(255,255,255,.72), transparent 48%),
    linear-gradient(180deg, #fbfbf9, #f3f3ee);
  box-shadow: var(--shadow-card);
}
.login-art::before {
  content: "";
  position: absolute; right: -160px; bottom: -190px;
  width: 470px; height: 470px; border-radius: 50%;
  border: 1px solid rgba(232,119,60,.13);
  box-shadow: 0 0 0 58px rgba(232,119,60,.035), 0 0 0 116px rgba(232,119,60,.018);
}
.login-art::after {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(59,59,56,.035) 1px, transparent 1px);
  background-size: 100% 52px;
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  pointer-events: none;
}
.login-art > * { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 13px; }
.login-brand .mark {
  width: 7px; height: 34px; border-radius: 4px;
  display: block; overflow: hidden; text-indent: -99px;
  background: linear-gradient(180deg, #f18a4e, var(--accent));
  box-shadow: 0 2px 7px rgba(232,119,60,.25);
}
.login-brand strong {
  display: block; font-family: var(--sans); font-size: 24px; line-height: 1;
  font-weight: 850; letter-spacing: -.04em; text-transform: uppercase; color: var(--ink-strong);
}
.login-brand span { display: block; font-size: 9px; letter-spacing: .22em; color: var(--muted); margin-top: 5px; }
.login-quote { max-width: 520px; margin: 38px 0; }
.login-quote .eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 750; letter-spacing: .17em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 16px;
}
.login-quote .eyebrow::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--accent); }
.login-quote h1 {
  margin: 0 0 20px; font-family: var(--sans);
  font-size: clamp(36px, 4.2vw, 56px); line-height: 1.06;
  font-weight: 800; letter-spacing: -.045em; color: var(--ink-strong);
}
.login-quote h1 em { font-style: normal; color: var(--accent); }
.login-quote p { margin: 0; max-width: 390px; font-size: 13px; line-height: 1.85; color: var(--ink-2); }
.login-foot {
  display: flex; gap: 22px; padding-top: 18px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--muted);
}
.login-panel { display: flex; align-items: center; justify-content: center; }
.login-card {
  width: min(100%, 420px); padding: 30px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow-card);
}
.login-card .mobile-brand { display: none; }
.login-card .kicker {
  display: flex; align-items: center; gap: 7px;
  font-size: 9.5px; font-weight: 750; letter-spacing: .17em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 9px;
}
.login-card .kicker::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--accent); }
.login-card h2 { margin: 0 0 9px; font-family: var(--sans); font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.login-card > p { margin: 0 0 26px; color: var(--ink-2); font-size: 12.5px; line-height: 1.7; }
.login-card .field { margin-bottom: 16px; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 50px; }
.reveal-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; border-radius: 8px;
}
.reveal-btn:hover { color: var(--ink); background: var(--bg-lo); }
.login-submit { width: 100%; margin-top: 5px; height: 50px; }
.login-note {
  margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line);
  font-size: 10.5px; line-height: 1.65; color: var(--muted);
  display: flex; gap: 9px; align-items: flex-start;
}
.login-note svg { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 1px; color: var(--ok); }
.login-error {
  display: none; margin: 0 0 15px; padding: 10px 12px;
  border: 1px solid #ebc2ba; border-radius: 8px;
  background: var(--danger-soft); color: var(--clay-deep); font-size: 12px;
}
.login-error.show { display: block; animation: shake .32s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Shell ----------------------------------------------------------------- */
.app-shell { min-height: 100dvh; }
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid rgba(213,213,206,.85);
  background: rgba(239,239,234,.9);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
}
.site-header-inner {
  width: min(100%, 1320px); height: 72px; margin: 0 auto; padding: 0 30px;
  display: flex; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; flex: 0 0 auto; }
.brand .mark {
  width: 6px; height: 30px; border-radius: 3px;
  display: block; overflow: hidden; text-indent: -99px;
  background: linear-gradient(180deg, #f18a4e, var(--accent));
  box-shadow: 0 2px 7px rgba(232,119,60,.26);
}
.brand .word {
  font-family: var(--sans); font-size: 21px; line-height: .95;
  font-weight: 900; letter-spacing: -.045em; text-transform: uppercase; color: var(--ink-strong);
}
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; font-weight: 600; letter-spacing: .2em; }
.top-nav { display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: rgba(237,237,232,.72); }
.nav-item {
  border: 0; background: transparent; color: var(--ink-2);
  display: flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 0 13px; border-radius: 8px;
  font-size: 12px; font-weight: 650; text-decoration: none;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.nav-item svg { width: 16px; height: 16px; opacity: .72; flex: 0 0 auto; }
.nav-item:hover { background: rgba(251,251,249,.8); color: var(--ink-strong); }
.top-nav .nav-item.active {
  color: #fff; background: linear-gradient(#f18a4e, var(--accent));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 3px 8px -4px rgba(213,104,47,.7);
}
.top-nav .nav-item.active svg { opacity: 1; }
.nav-item .nav-badge {
  min-width: 17px; padding: 1px 5px; margin-left: 1px; border-radius: 999px;
  background: rgba(59,59,56,.08); color: var(--muted);
  font-family: var(--mono); font-size: 9px; text-align: center;
}
.top-nav .nav-item.active .nav-badge { background: rgba(255,255,255,.2); color: #fff; }
.header-side { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.header-total {
  min-width: 150px; padding: 7px 11px 8px; border: 1px solid var(--line); border-radius: 9px;
  background: linear-gradient(#f8f8f5, #ecece7); box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.header-total > span { display: block; font-size: 8px; font-weight: 750; letter-spacing: .15em; color: var(--muted); line-height: 1; margin-bottom: 4px; }
.header-total b { display: block; font-family: var(--digits); font-weight: 400; font-size: 17px; line-height: 1; color: var(--ink-strong); white-space: nowrap; }
.cur-code { font-family: var(--sans); font-size: .58em; font-weight: 800; letter-spacing: .055em; vertical-align: .12em; }
.main { min-height: 100dvh; }
.topbar {
  width: min(100%, 1320px); margin: 0 auto; padding: 28px 30px 0;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
}
.topbar .kicker {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 6px; color: var(--muted);
  font-size: 9.5px; font-weight: 750; letter-spacing: .18em; text-transform: uppercase;
}
.topbar .kicker::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--accent); }
.topbar h1 { margin: 0; font-family: var(--sans); font-size: 27px; line-height: 1.1; font-weight: 800; letter-spacing: -.035em; color: var(--ink-strong); }
.topbar-actions { display: flex; align-items: center; gap: 7px; }
.date-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: linear-gradient(#f8f8f5, #ededE8); box-shadow: var(--shadow-key);
  color: var(--ink-2); font-size: 11px; white-space: nowrap;
}
.date-chip svg { width: 14px; height: 14px; color: var(--muted); }
.content { width: min(100%, 1320px); margin: 0 auto; padding: 22px 30px 80px; }

.icon-btn {
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2); display: inline-grid; place-items: center;
  transition: background .16s ease, color .16s ease, transform .12s ease;
}
.icon-btn:hover { background: var(--bg-lo); color: var(--ink-strong); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn.ring { border: 1px solid var(--line-2); background: linear-gradient(#f8f8f5, #eaeae4); box-shadow: var(--shadow-key); }
.icon-btn svg { width: 18px; height: 18px; }

.mobile-nav {
  display: none; position: fixed; z-index: 58;
  left: 10px; right: 10px; bottom: calc(9px + var(--safe-bottom));
  height: 64px; padding: 5px; border-radius: 14px;
  border: 1px solid var(--line-2); background: rgba(251,251,249,.94);
  box-shadow: 0 18px 40px -20px rgba(40,40,35,.55), inset 0 1px 0 rgba(255,255,255,.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.mobile-nav .nav-item {
  flex-direction: column; justify-content: center; gap: 3px;
  min-height: 52px; padding: 4px 2px; border-radius: 10px;
  color: var(--muted); font-size: 9.5px; font-weight: 650;
}
.mobile-nav .nav-item svg { width: 19px; height: 19px; }
.mobile-nav .nav-item.active {
  background: linear-gradient(#f18a4e, var(--accent)); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 10px -6px rgba(213,104,47,.9);
}
.fab { display: none; }

/* Shared headings and cards --------------------------------------------- */
.section { margin-top: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.section-head h2, .card-title {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-family: var(--sans); font-size: 13px; line-height: 1.25; font-weight: 800;
  letter-spacing: .075em; text-transform: uppercase; color: var(--ink-strong);
}
.section-head h2::before, .card-title::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--accent); flex: 0 0 auto;
}
.section-head .sub, .card-sub { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.section-head .link-btn {
  border: 0; background: transparent; padding: 5px 1px;
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--accent-strong); font-size: 11px; font-weight: 700;
}
.section-head .link-btn svg { width: 13px; height: 13px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.card-pad { padding: 20px; }
.card-title { margin-bottom: 5px; font-size: 11.5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px; padding: 0 16px; border-radius: 9px;
  border: 1px solid var(--line-2);
  background: linear-gradient(#f6f6f2, #e8e8e2);
  box-shadow: var(--shadow-key);
  color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: .035em;
  white-space: nowrap; transition: transform .12s ease, filter .16s ease, background .16s ease;
}
.btn:hover { filter: brightness(1.02); background: linear-gradient(#fbfbf8, #ecece6); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(40,40,35,.09); }
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  border-color: var(--accent-strong); color: #fff;
  background: linear-gradient(#f18a4e, var(--accent));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 4px 10px -6px rgba(213,104,47,.75);
}
.btn-primary:hover { background: linear-gradient(#f39760, #e4783b); color: #fff; }
.btn-export { color: var(--accent-strong); border-color: #efc4aa; background: linear-gradient(#fffaf6, #f9e9de); }
.btn-export:hover { color: var(--accent-strong); background: linear-gradient(#fffdfb, #fbe4d5); }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--bg-lo); }
.btn-danger { color: var(--danger); border-color: #e6bdb5; background: linear-gradient(#fdf7f5, #f8e3df); }
.btn-danger:hover { background: #f6d9d4; color: #a93e32; }
.btn-sm { height: 34px; padding: 0 11px; border-radius: 8px; font-size: 10.5px; }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; filter: grayscale(.2); }
.link-btn { border: 0; background: transparent; padding: 0; color: var(--accent-strong); font-size: 11px; font-weight: 700; }

.avatar {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--key); color: var(--ink-strong);
  font-size: 12px; font-weight: 750; letter-spacing: .01em;
}
.avatar.sm { width: 27px; height: 27px; font-size: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: 14px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--key); color: var(--ink-2);
  font-size: 9.5px; font-weight: 750; letter-spacing: .045em; white-space: nowrap;
}
.badge.green { background: var(--ok-soft); border-color: #cfe4d7; color: var(--ok); }
.badge.clay { background: var(--danger-soft); border-color: #efcbc4; color: var(--clay-deep); }
.badge.gold { background: var(--gold-soft); border-color: #e7ddb7; color: #735b20; }
.badge.blue { background: var(--blue-soft); border-color: #cddde7; color: var(--blue); }

/* Dashboard ------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  padding: 25px 27px 20px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, #fdfdfb 0%, #f8f8f4 100%);
  box-shadow: var(--shadow-card); color: var(--ink);
}
.hero::before {
  content: ""; position: absolute; right: -100px; top: -160px;
  width: 380px; height: 380px; border-radius: 50%;
  border: 1px solid rgba(232,119,60,.10);
  box-shadow: 0 0 0 55px rgba(232,119,60,.025), 0 0 0 110px rgba(232,119,60,.012);
  pointer-events: none;
}
.hero::after { display: none; }
.hero > * { position: relative; z-index: 1; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.hero .label {
  display: flex; align-items: center; gap: 8px;
  font-size: 9.5px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.hero .label::before { content: ""; width: 4px; height: 15px; border-radius: 2px; background: var(--accent); }
.hero .total {
  display: inline-flex; align-items: baseline; gap: 9px;
  margin-top: 13px; padding: 5px 15px 6px;
  border: 1px solid #c8c39d; border-radius: 10px;
  background: linear-gradient(180deg, var(--lcd), var(--lcd-2));
  box-shadow: inset 0 2px 4px rgba(62,60,44,.14), inset 0 -1px 0 rgba(255,255,255,.36);
  color: var(--lcd-ink);
  font-family: var(--digits); font-size: clamp(35px, 4.5vw, 52px); line-height: 1.1;
  letter-spacing: .015em; font-weight: 400; font-variant-numeric: tabular-nums;
  max-width: 100%;
}
.hero .total .currency { font-family: var(--sans); font-size: 13px; font-weight: 750; color: #6d6a4d; letter-spacing: .02em; }
.hero .meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 11px; color: var(--muted); font-size: 10.5px; }
.hero .meta .dot { width: 2.5px; height: 2.5px; border-radius: 50%; background: var(--faint); }
.hero-stamp { display: none; }
.hero-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line);
}
.hero-stat { padding: 0 16px; border-left: 1px solid var(--line); min-width: 0; }
.hero-stat:first-child { padding-left: 0; border-left: 0; }
.hero-stat .k { font-size: 8.5px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.hero-stat .v { margin-top: 6px; color: var(--ink-strong); font-family: var(--digits); font-size: 18px; font-weight: 400; letter-spacing: .015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-stat .v.small { font-size: 15px; }
.hero-stat .v .unit { font-family: var(--sans); font-size: 9px; font-weight: 650; color: var(--muted); margin-left: 3px; }

.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.quick-btn {
  min-height: 56px; padding: 10px 12px; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: linear-gradient(180deg, #fbfbf9, #f4f4ef);
  box-shadow: var(--shadow-sm); color: var(--ink); text-align: left;
  transition: transform .12s ease, border-color .16s ease, background .16s ease;
}
.quick-btn:hover { border-color: var(--line-2); background: var(--panel); }
.quick-btn:active { transform: translateY(1px); }
.quick-btn .qi {
  width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--key); color: var(--accent-strong);
}
.quick-btn .qi.clay { background: var(--danger-soft); color: var(--danger); border-color: #efd2cc; }
.quick-btn .qi.gold { background: var(--gold-soft); color: var(--gold); border-color: #e7ddb7; }
.quick-btn .qi.blue { background: var(--blue-soft); color: var(--blue); border-color: #d2e0e8; }
.quick-btn .qi svg { width: 16px; height: 16px; }
.quick-btn strong { display: block; font-size: 11.5px; font-weight: 700; line-height: 1.2; }
.quick-btn small { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .85fr); gap: 14px; align-items: start; margin-top: 13px; }
.people-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.person-card {
  position: relative; overflow: hidden; padding: 15px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); box-shadow: var(--shadow-sm);
}
.person-card::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--person-tint, var(--key)); opacity: .25;
}
.person-card > * { position: relative; z-index: 1; }
.person-top { display: flex; align-items: center; gap: 9px; }
.person-top .name { font-size: 12.5px; font-weight: 700; }
.person-top .count { margin-top: 1px; color: var(--muted); font-size: 9.5px; }
.person-card .total {
  margin-top: 14px; color: var(--ink-strong);
  font-family: var(--digits); font-size: 21px; letter-spacing: .01em; white-space: nowrap;
}
.person-card .total .cur { margin-right: 4px; color: var(--muted); font-family: var(--sans); font-size: 9px; font-weight: 650; }
.person-accounts { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line); }
.person-account { display: flex; justify-content: space-between; gap: 9px; color: var(--ink-2); font-size: 10px; }
.person-account .bank { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-account .amt { color: var(--ink-2); font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.person-accounts .more { color: var(--muted); font-size: 9.5px; }
.person-actions { display: flex; gap: 2px; margin-left: auto; }
.person-actions .icon-btn { width: 27px; height: 27px; }
.person-actions .icon-btn svg { width: 14px; height: 14px; }

.bank-bars { display: flex; flex-direction: column; gap: 13px; }
.bank-bar .top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: 10.5px; }
.bank-bar .name { display: flex; align-items: center; gap: 6px; font-weight: 650; }
.bank-bar .amt { color: var(--ink-2); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.bank-bar .track { height: 6px; overflow: hidden; border-radius: 99px; background: var(--bg-lo); box-shadow: inset 0 1px 2px rgba(40,40,35,.05); }
.bank-bar .fill { height: 100%; border-radius: 99px; background: var(--bar-color, var(--accent)); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bank-bar .pct { margin-top: 4px; color: var(--muted); font-size: 9px; }

.flow-card { padding: 18px 20px 13px; }
.flow-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.legend { display: flex; gap: 10px; color: var(--muted); font-size: 9.5px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.legend i.clay { background: var(--ink-strong); }
.flow-chart { display: flex; align-items: flex-end; gap: 8px; height: 134px; margin-top: 18px; padding-top: 7px; border-bottom: 1px solid var(--line); }
.flow-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; position: relative; }
.flow-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; height: 100%; }
.flow-bar { width: min(11px, 34%); min-height: 2px; border-radius: 4px 4px 1px 1px; background: var(--accent); transition: height .5s ease; }
.flow-bar.clay { background: var(--ink-strong); }
.flow-label { margin-top: 5px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.flow-col.current .flow-label { color: var(--ink-strong); font-weight: 700; }
.flow-empty { display: grid; place-items: center; height: 134px; margin-top: 18px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }

.recent-list { display: flex; flex-direction: column; }
.recent-row {
  width: 100%; padding: 11px 2px; display: flex; align-items: center; gap: 10px;
  border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left;
}
.recent-row:first-child { border-top: 0; }
.recent-row:hover { background: rgba(232,119,60,.035); }
.recent-icon { width: 33px; height: 33px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; }
.recent-icon svg { width: 15px; height: 15px; }
.recent-icon.income { background: var(--ok-soft); color: var(--ok); }
.recent-icon.expense { background: var(--danger-soft); color: var(--danger); }
.recent-icon.daily { background: var(--gold-soft); color: var(--gold); }
.recent-main { flex: 1; min-width: 0; }
.recent-main strong { display: block; overflow: hidden; color: var(--ink); font-size: 11.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.recent-main small { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.recent-amount { flex: 0 0 auto; text-align: right; }
.recent-amount strong { display: block; font-family: var(--mono); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.recent-amount small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }

/* Accounts -------------------------------------------------------------- */
.page-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.page-tools .right, .daily-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.total-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; margin-bottom: 15px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, #fdfdfb, #f7f7f2);
  box-shadow: var(--shadow-card);
}
.total-strip .label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.total-strip .label::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--accent); }
.total-strip .value { margin-top: 8px; color: var(--ink-strong); font-family: var(--digits); font-size: 27px; line-height: 1.1; letter-spacing: .01em; }
.total-strip .right { color: var(--muted); font-size: 10px; line-height: 1.6; text-align: right; }
.person-block { margin-top: 21px; }
.person-block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.person-block-head .pname { font-size: 12.5px; font-weight: 700; }
.person-block-head .ptotal { margin-left: auto; color: var(--ink-strong); font-family: var(--digits); font-size: 14px; font-variant-numeric: tabular-nums; }
.person-block-head .icon-btn { border: 1px solid transparent; }
.person-block-head .icon-btn:hover { border-color: var(--line); background: var(--panel); }
.account-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-card); }
.account-row {
  width: 100%; padding: 13px 14px; display: flex; align-items: center; gap: 12px;
  border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left;
}
.account-row:first-child { border-top: 0; }
.account-row:hover { background: rgba(232,119,60,.035); }
.bank-mark {
  width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center;
  border: 1px solid rgba(59,59,56,.055); border-radius: 9px;
  background: var(--bank-tint, var(--key)); color: var(--bank-ink, var(--ink-strong));
  font-size: 9.5px; font-weight: 800; letter-spacing: .02em;
}
.account-main { flex: 1; min-width: 0; }
.account-main strong { display: block; overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.account-main small { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.account-balance { flex: 0 0 auto; text-align: right; }
.account-balance strong { display: block; color: var(--ink-strong); font-family: var(--digits); font-size: 13px; font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
.account-balance small { display: block; margin-top: 2px; color: var(--muted); font-size: 8.5px; }
.add-account-row {
  width: 100%; height: 43px; padding: 0 12px; display: flex; align-items: center; justify-content: center; gap: 5px;
  border: 0; border-top: 1px dashed var(--line-2); background: transparent; color: var(--muted); font-size: 10.5px;
}
.add-account-row svg { width: 13px; height: 13px; flex: 0 0 auto; }
.add-account-row:hover { background: var(--key); color: var(--accent-strong); }
.bank-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.bank-summary-item { padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow-sm); }
.bank-summary-item .n { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.bank-summary-item .v { margin-top: 7px; color: var(--ink-strong); font-family: var(--digits); font-size: 18px; font-variant-numeric: tabular-nums; }
.bank-summary-item .c { margin-top: 2px; color: var(--muted); font-size: 8.5px; }

/* Business and daily ---------------------------------------------------- */
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--key); box-shadow: inset 0 1px 2px rgba(40,40,35,.06); }
.segmented button {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 14px; border-radius: 7px;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
}
.segmented button svg { width: 13px; height: 13px; }
.segmented button.active { background: var(--panel); color: var(--ink-strong); box-shadow: 0 1px 3px rgba(40,40,35,.12); }
.segmented button.active.income { color: var(--ok); }
.segmented button.active.expense { color: var(--accent-strong); }
.month-switcher {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--key); box-shadow: inset 0 1px 2px rgba(40,40,35,.06);
}
.month-switcher button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; color: var(--ink-2); }
.month-switcher button:hover { background: rgba(251,251,249,.8); }
.month-switcher button svg { width: 14px; height: 14px; }
.month-switcher .m { width: auto; padding: 0 9px; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.month-switcher .m.all { color: var(--accent-strong); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 15px; }
.stat-card { min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(180deg, #fcfcfa, #f7f7f2); box-shadow: var(--shadow-sm); }
.stat-card .k { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; white-space: nowrap; }
.stat-card .k i { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); }
.stat-card .k i.clay { background: var(--danger); }
.stat-card .k i.gold { background: var(--gold); }
.stat-card .v { overflow: hidden; margin-top: 7px; color: var(--ink-strong); font-family: var(--digits); font-size: 20px; line-height: 1.15; letter-spacing: .01em; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.stat-card .v.sm { font-size: 16px; }
.stat-card .s { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }

.txn-groups { display: flex; flex-direction: column; gap: 16px; }
.date-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; padding-left: 2px; }
.date-head .d { color: var(--ink-2); font-size: 10.5px; font-weight: 700; }
.date-head .w { color: var(--muted); font-size: 9px; }
.date-head .rule { flex: 1; height: 1px; background: var(--line); }
.txn-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-card); }
.txn-row {
  width: 100%; padding: 12px 14px; display: flex; align-items: center; gap: 11px;
  border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left;
}
.txn-row:first-child { border-top: 0; }
.txn-row:hover { background: rgba(232,119,60,.035); }
.txn-main { flex: 1; min-width: 0; }
.txn-main .t { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; }
.txn-main .t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txn-main .s { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.txn-main .s .dot { width: 2.5px; height: 2.5px; border-radius: 50%; background: var(--faint); }
.txn-amount { flex: 0 0 auto; text-align: right; }
.txn-amount strong { display: block; font-family: var(--digits); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
.txn-amount strong.in { color: var(--ok); }
.txn-amount strong.out { color: var(--accent-strong); }
.txn-amount small { display: block; margin-top: 3px; color: var(--muted); font-family: var(--mono); font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.txn-amount .rate { margin-top: 2px; color: var(--muted); font-size: 8.5px; }
.chev { flex: 0 0 auto; color: var(--faint); }
.chev svg { width: 14px; height: 14px; }

.empty {
  padding: 38px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius);
  background: rgba(251,251,249,.56); text-align: center;
}
.empty .ec { width: 46px; height: 46px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 13px; background: var(--key); color: var(--accent-strong); }
.empty .ec svg { width: 21px; height: 21px; }
.empty h3 { margin: 0 0 5px; font-size: 15px; font-weight: 750; letter-spacing: -.015em; }
.empty p { max-width: 330px; margin: 0 auto 16px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.empty .btn { margin: 0 auto; }
.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.setup-step { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-sm); }
.setup-step .n { color: var(--accent); font-family: var(--mono); font-size: 24px; }
.setup-step h3 { margin: 7px 0 4px; font-size: 12px; font-weight: 700; }
.setup-step p { margin: 0 0 13px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }

/* Search and forms ------------------------------------------------------ */
.search-field { position: relative; }
.search-field > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--muted); pointer-events: none; }
.search-field input { height: 36px; padding-left: 33px; border-radius: 8px; font-size: 11.5px; }
.toolbar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.toolbar .search-field { flex: 1; min-width: 170px; max-width: 300px; }

.field { display: block; margin-bottom: 14px; }
.field-label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 6px; color: var(--ink-2); font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
}
.field-label em { font-style: normal; color: var(--muted); font-family: var(--mono); font-size: 8.5px; font-weight: 600; letter-spacing: .07em; }
.field-label .hint { color: var(--muted); font-size: 9px; font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 9px;
  background: linear-gradient(#f8f8f5, #eaeae4);
  box-shadow: inset 0 1px 2px rgba(40,40,35,.09), inset 0 -1px 0 rgba(255,255,255,.55);
  color: var(--ink-strong); font-size: 16px; outline: none; appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea.input { height: auto; min-height: 74px; padding: 11px 12px; line-height: 1.55; resize: vertical; }
.input:focus { border-color: var(--accent); background: #fbfbf7; box-shadow: 0 0 0 3px var(--accent-soft), inset 0 1px 2px rgba(40,40,35,.06); }
.input::placeholder { color: var(--faint); }
select.input {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238d8d88' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input[type="date"].input { min-height: 44px; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input[data-calc], #account-balance, #login-passcode { font-variant-numeric: tabular-nums; }
input[data-calc="#"] { font-family: var(--digits); }
input[data-calc="income"], input[data-calc="expense"], input[data-calc="daily"], #account-balance {
  font-family: var(--digits); font-size: 17px; letter-spacing: .02em;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row.three { grid-template-columns: 1.2fr 1fr 1fr; }
.input-wrap { position: relative; display: block; }
.input-wrap .prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 10px; font-weight: 750; pointer-events: none;
}
.input-wrap.has-prefix .input { padding-left: 37px; }
.input-wrap.has-calc .input { padding-right: 47px; }
.calc-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: linear-gradient(#fbfbf9, #efefe9); color: var(--accent-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 1px 2px rgba(40,40,35,.08);
}
.calc-btn:hover { border-color: #edc5ab; background: var(--accent-soft); }
.calc-btn:active { transform: translateY(calc(-50% + 1px)); }
.calc-btn svg { width: 15px; height: 15px; }
.input-wrap .suffix { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 9px; }
.input-help { margin-top: 4px; color: var(--muted); font-size: 9.5px; line-height: 1.5; }
.input-help strong { color: var(--ink-2); font-weight: 650; }
.amount-preview { display: block; margin-top: 4px; color: var(--muted); font-family: var(--mono); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.amount-preview b { color: var(--ink-2); font-weight: 600; }
.form-error { display: none; margin: 0 0 13px; padding: 9px 11px; border: 1px solid #ecc6be; border-radius: 8px; background: var(--danger-soft); color: var(--clay-deep); font-size: 11px; }
.form-error.show { display: block; }
.form-note {
  display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; padding: 10px 11px;
  border: 1px solid #d8e5dc; border-radius: 9px; background: #f0f6f2; color: #386f4e;
  font-size: 10px; line-height: 1.55;
}
.form-note.clay { background: var(--danger-soft); border-color: #ecc6be; color: var(--clay-deep); }
.form-note svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; }
.contact-pick { display: flex; align-items: stretch; gap: 7px; }
.contact-pick select { flex: 1; min-width: 0; }
.contact-pick .btn { width: 44px; height: 44px; padding: 0; flex: 0 0 auto; border-radius: 9px; }
.contact-pick .btn svg { width: 16px; height: 16px; }
.contact-quick { display: none; gap: 7px; margin-top: 7px; }
.contact-quick.show { display: flex; }
.contact-quick input { flex: 1; height: 39px; font-size: 15px; }
.contact-quick .btn { height: 39px; }
.person-account-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.person-account-pick .field { margin-bottom: 0; }
.account-preview { display: flex; align-items: center; gap: 7px; margin-top: 7px; padding-left: 1px; color: var(--muted); font-size: 10px; }
.account-preview .av { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.unit-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--key); }
.unit-toggle button { border: 0; background: transparent; padding: 5px 13px; border-radius: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.unit-toggle button.active { background: var(--panel); color: var(--ink-strong); box-shadow: 0 1px 3px rgba(40,40,35,.13); }
.calc-note { display: flex; align-items: center; gap: 5px; margin: -3px 0 13px; color: var(--muted); font-size: 9.5px; }
.calc-note svg { width: 12px; height: 12px; }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.form-actions .grow { flex: 1; }
.form-actions .btn-primary { min-width: 122px; }
.form-actions .btn-danger { margin-right: auto; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch { position: relative; width: 29px; height: 29px; padding: 0; border: 2px solid transparent; border-radius: 50%; }
.swatch::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--sw); }
.swatch.active { border-color: var(--ink-strong); }
.bank-suggest { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.bank-suggest button { padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--key); color: var(--ink-2); font-size: 9.5px; }
.bank-suggest button:hover { border-color: #edc4aa; color: var(--accent-strong); }

/* Calculator ------------------------------------------------------------ */
.calc-layer {
  position: fixed; inset: 0; z-index: 110;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(40,40,35,.28); backdrop-filter: blur(2px);
  animation: fadeIn .16s ease;
}
.calc-layer.closing { animation: fadeOut .14s ease forwards; }
.calc-sheet {
  width: min(100%, 430px); padding: 10px 14px calc(14px + var(--safe-bottom));
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: var(--panel); box-shadow: var(--shadow-lg);
  animation: sheetUp .2s cubic-bezier(.22,.8,.28,1);
}
.calc-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 8px; }
.calc-kicker { color: var(--muted); font-family: var(--mono); font-size: 8.5px; font-weight: 700; letter-spacing: .17em; }
.calc-head .icon-btn { width: 30px; height: 30px; margin-right: -4px; }
.calc-screen {
  padding: 10px 13px 9px; overflow: hidden;
  border: 1px solid #c8c39d; border-radius: 10px;
  background: linear-gradient(180deg, var(--lcd), var(--lcd-2));
  box-shadow: inset 0 2px 4px rgba(62,60,44,.14), inset 0 -1px 0 rgba(255,255,255,.36);
  color: var(--lcd-ink); text-align: right;
}
.calc-expr {
  min-height: 19px; overflow: hidden; color: #777252;
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  white-space: nowrap; text-overflow: ellipsis;
}
.calc-result {
  overflow: hidden; margin-top: 3px;
  font-family: var(--digits); font-size: 30px; line-height: 1.15;
  letter-spacing: .01em; white-space: nowrap; text-overflow: ellipsis;
}
.calc-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 10px; }
.calc-key {
  height: 50px; border: 1px solid var(--line); border-radius: 9px;
  background: linear-gradient(#fbfbf9, #efefe9); color: var(--ink-strong);
  box-shadow: var(--shadow-key); font-family: var(--mono); font-size: 17px; font-weight: 600;
  transition: transform .08s ease, background .12s ease;
}
.calc-key:active { transform: translateY(1px); background: var(--key-2); }
.calc-key.fn { color: var(--muted); font-size: 13px; }
.calc-key.op { color: var(--accent-strong); background: linear-gradient(#fff8f1, #fbe9dd); border-color: #f0cdb7; }
.calc-key.eq { grid-column: 4; grid-row: 4 / span 2; height: auto; color: #fff; background: linear-gradient(#f18a4e, var(--accent)); border-color: var(--accent-strong); font-size: 22px; }
.calc-key.eq:active { background: var(--accent-strong); }
.calc-key.z { grid-column: 1; grid-row: 5; }
.calc-key.dot { grid-column: 3; grid-row: 5; }
.calc-key:disabled { opacity: .3; box-shadow: none; }
.calc-actions { display: flex; gap: 8px; margin-top: 10px; }
.calc-actions .btn { height: 43px; }
.calc-actions .btn-primary { flex: 1; }
.calc-actions .btn:not(.btn-primary) { min-width: 92px; }

/* Modal ----------------------------------------------------------------- */
.sheet-layer, .confirm-layer {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0; background: rgba(36,36,34,.42);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fadeIn .2s ease;
}
.sheet-layer.closing, .confirm-layer.closing { animation: fadeOut .18s ease forwards; }
.sheet {
  width: min(100%, 560px); max-height: min(92dvh, 900px);
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: 16px 16px 0 0;
  background: var(--panel); box-shadow: var(--shadow-lg);
  animation: sheetUp .28s cubic-bezier(.22,.9,.3,1);
}
.sheet.wide { width: min(100%, 720px); }
.sheet-grip { width: 36px; height: 4px; flex: 0 0 auto; margin: 8px auto 0; border-radius: 99px; background: var(--line-2); }
.sheet-head { flex: 0 0 auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; padding: 14px 20px 11px; }
.sheet-head h2 {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-family: var(--sans); font-size: 17px; font-weight: 800; letter-spacing: -.015em;
}
.sheet-head h2::before { content: ""; width: 4px; height: 19px; border-radius: 2px; background: var(--accent); }
.sheet-head .sub { margin-top: 3px; color: var(--muted); font-size: 10px; }
.sheet-head .icon-btn { margin-top: -3px; margin-right: -7px; }
.sheet-body { overflow-y: auto; padding: 3px 20px calc(22px + var(--safe-bottom)); overscroll-behavior: contain; }
.sheet-body::-webkit-scrollbar { width: 5px; }
.sheet-body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }
@keyframes sheetUp { from { transform: translateY(25px); opacity: .72; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
.confirm-layer { z-index: 120; align-items: center; padding: 20px; }
.confirm-card { width: min(100%, 370px); padding: 21px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow-lg); animation: popIn .2s cubic-bezier(.22,.9,.3,1); }
.confirm-card .ci { width: 40px; height: 40px; margin-bottom: 12px; display: grid; place-items: center; border-radius: 10px; background: var(--danger-soft); color: var(--danger); }
.confirm-card .ci svg { width: 19px; height: 19px; }
.confirm-card h3 { margin: 0 0 6px; font-family: var(--sans); font-size: 17px; font-weight: 800; letter-spacing: -.015em; }
.confirm-card p { margin: 0 0 18px; color: var(--ink-2); font-size: 11px; line-height: 1.65; }
.confirm-card .actions { display: flex; gap: 7px; }
.confirm-card .actions .btn { flex: 1; }
@keyframes popIn { from { transform: scale(.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Toast and offline ----------------------------------------------------- */
.toast-root {
  position: fixed; z-index: 200; left: 50%; bottom: calc(88px + var(--safe-bottom));
  width: max-content; max-width: calc(100vw - 28px);
  transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 7px;
  pointer-events: none;
}
.toast { max-width: 100%; padding: 9px 14px; border-radius: 999px; background: var(--ink-strong); color: #fff; box-shadow: var(--shadow-lg); font-size: 11px; animation: toastIn .24s ease; }
.toast.error { background: #ad4035; }
.toast.success { background: #35794f; }
@keyframes toastIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  padding: calc(6px + var(--safe-top)) 14px 6px; background: var(--accent-strong); color: #fff;
  font-size: 10px; text-align: center;
}
.has-offline .site-header { top: 28px; }

/* Settings, contacts and help ------------------------------------------- */
.desktop-only { display: inline-flex; }
.settings-list { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.settings-row { width: 100%; padding: 12px 13px; display: flex; align-items: center; gap: 10px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.settings-row:first-child { border-top: 0; }
.settings-row:hover { background: rgba(232,119,60,.045); }
.settings-row > svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--faint); }
.settings-main { flex: 1; min-width: 0; }
.settings-main strong { display: block; font-size: 11.5px; font-weight: 700; }
.settings-main small { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; }
.settings-row .recent-icon { width: 32px; height: 32px; }
.settings-about { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.settings-about .brand { padding: 0 0 9px; }
.settings-about .brand .mark { width: 5px; height: 26px; }
.settings-about .brand .word { font-size: 17px; }
.settings-about p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.contact-add { display: flex; gap: 7px; margin-bottom: 12px; }
.contact-add .input { flex: 1; }
.contact-add .btn { height: 44px; flex: 0 0 auto; }
.contact-manage { display: flex; flex-direction: column; gap: 7px; }
.contact-manage-row { display: flex; align-items: center; gap: 7px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.contact-manage-row .input { flex: 1; min-width: 0; height: 38px; font-size: 15px; }
.contact-manage-row .btn { height: 32px; }
.contact-manage-row .icon-btn { width: 32px; height: 32px; color: var(--muted); }
.contact-manage-row .icon-btn:hover { color: var(--danger); background: var(--danger-soft); }
.help-list { display: flex; flex-direction: column; gap: 9px; margin: 0 0 16px; padding: 0; list-style: none; }
.help-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-2); font-size: 11px; line-height: 1.6; }
.help-list li span { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-size: 9px; font-weight: 750; }

/* Responsive ------------------------------------------------------------ */
@media (max-width: 1120px) {
  .site-header-inner { gap: 15px; }
  .top-nav .nav-item { padding: 0 10px; }
  .header-total { min-width: 125px; }
  .header-total b { font-size: 14px; }
  .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-row.three { grid-template-columns: 1fr 1fr; }
  .field-row.three .field:first-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; width: min(100% - 26px, 440px); padding: calc(28px + var(--safe-top)) 0 calc(28px + var(--safe-bottom)); }
  .login-art { display: none; }
  .login-card { padding: 24px 20px; }
  .login-card .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
  .login-card .mobile-brand .mark { width: 6px; height: 28px; border-radius: 3px; display: block; overflow: hidden; text-indent: -99px; background: linear-gradient(180deg, #f18a4e, var(--accent)); }
  .login-card .mobile-brand strong { display: block; font-size: 19px; font-weight: 900; line-height: 1; letter-spacing: -.04em; text-transform: uppercase; }
  .login-card .mobile-brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; letter-spacing: .18em; }
  .site-header-inner { height: 62px; padding: 0 15px; gap: 10px; }
  .top-nav { display: none; }
  .brand .word { font-size: 18px; }
  .brand small { font-size: 7px; }
  .header-total { min-width: 118px; padding: 6px 9px 7px; }
  .header-total > span { font-size: 7px; }
  .header-total b { font-size: 13px; }
  .topbar { padding: 18px 16px 0; align-items: center; }
  .topbar .kicker { display: none; }
  .topbar h1 { font-size: 23px; }
  .topbar-actions .icon-btn.ring, .date-chip { display: none; }
  .content { padding: 16px 14px calc(108px + var(--safe-bottom)); }
  .mobile-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fab {
    position: fixed; z-index: 61; right: 18px; bottom: calc(84px + var(--safe-bottom));
    width: 52px; height: 52px; display: grid; place-items: center;
    border: 1px solid var(--accent-strong); border-radius: 50%;
    background: linear-gradient(#f18a4e, var(--accent)); color: #fff;
    box-shadow: 0 14px 28px -12px rgba(213,104,47,.9), inset 0 1px 0 rgba(255,255,255,.25);
  }
  .fab svg { width: 22px; height: 22px; }
  .fab:active { transform: scale(.96); }
  .hero { padding: 20px 18px 17px; }
  .hero .total { font-size: clamp(29px, 8.4vw, 38px); padding: 4px 10px 5px; }
  .hero-stats { margin-top: 18px; padding-top: 14px; }
  .hero-stat { padding: 0 9px; }
  .hero-stat .v { font-size: 14px; }
  .hero-stat .k { font-size: 7.5px; }
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .quick-btn { min-height: 52px; padding: 9px 11px; }
  .dash-grid { grid-template-columns: 1fr; }
  .people-grid { grid-template-columns: 1fr; }
  .section { margin-top: 21px; }
  .section-head h2 { font-size: 11.5px; }
  .stat-grid { gap: 7px; }
  .stat-card { padding: 11px 12px; }
  .stat-card .v { font-size: 17px; }
  .stat-card .v.sm { font-size: 14px; }
  .total-strip { padding: 15px 16px; }
  .total-strip .value { font-size: 23px; }
  .total-strip .right { display: none; }
  .page-tools { margin-bottom: 12px; }
  .setup-grid { grid-template-columns: 1fr; }
  .txn-row { padding: 11px 12px; gap: 9px; }
  .txn-amount strong { font-size: 11px; }
  .account-row { padding: 12px; gap: 10px; }
  .sheet-layer { align-items: flex-end; }
  .sheet { width: 100%; max-height: 94dvh; border-radius: 15px 15px 0 0; }
  .sheet-head { padding: 12px 16px 9px; }
  .sheet-body { padding: 3px 16px calc(20px + var(--safe-bottom)); }
  .toast-root { bottom: calc(155px + var(--safe-bottom)); }
  .flow-card { padding: 16px 15px 12px; }
  .flow-chart { height: 116px; gap: 5px; }
}

@media (max-width: 600px) {
  .header-total { display: none; }
  .site-header-inner { justify-content: space-between; }
  .header-side { margin-left: 0; }
  .hero-top { gap: 10px; }
  .hero .total { max-width: 100%; }
  .hero-stats { grid-template-columns: 1fr; gap: 0; }
  .hero-stat { padding: 9px 0; border-left: 0; border-top: 1px solid var(--line); }
  .hero-stat:first-child { border-top: 0; padding-top: 0; }
  .hero-stat .v { font-size: 16px; }
  .business-page-tools .segmented { width: 100%; }
  .page-tools { align-items: stretch; }
  .page-tools > .segmented { width: 100%; }
  .page-tools > .segmented button { flex: 1; justify-content: center; }
  .page-tools > .toolbar { width: 100%; }
  .page-tools > .toolbar .month-switcher { flex: 1; justify-content: space-between; }
  .page-tools > .daily-actions { width: 100%; }
  .page-tools > .daily-actions .btn { flex: 1; }
  .daily-actions .btn, .toolbar .btn { justify-content: center; }
  .toolbar .search-field { max-width: none; width: 100%; flex-basis: 100%; }
  .toolbar > .btn { flex: 1; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-tools .right { width: 100%; }
  .page-tools .right .btn { flex: 1; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .field-row.three { grid-template-columns: 1fr; }
  .field-row.three .field:first-child { grid-column: auto; }
  .person-account-pick { grid-template-columns: 1fr; gap: 13px; }
  .hero .meta { gap: 5px; }
  .login-card h2 { font-size: 23px; }
}

@media (max-width: 390px) {
  .brand small { display: none; }
  .hero .total { font-size: 26px; }
  .hero .total .currency { font-size: 11px; }
  .quick-btn small { display: none; }
  .stat-card .v { font-size: 15px; }
  .stat-card .v.sm { font-size: 13px; }
  .account-balance strong { font-size: 11px; }
  .txn-amount strong { font-size: 10px; }
  .txn-main .s { font-size: 8.5px; }
  .btn-sm { padding: 0 9px; font-size: 10px; }
}

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