:root {
  --bg: oklch(1 0 0);
  --surface: oklch(0.968 0.004 10);
  --surface-strong: oklch(0.925 0.008 10);
  --ink: oklch(0.22 0.025 20);
  --ink-soft: oklch(0.32 0.025 20);
  --muted: oklch(0.47 0.025 20);
  --faint: oklch(0.68 0.012 20);
  --line: oklch(0.895 0.008 10);
  --primary: oklch(0.57 0.2 8);
  --primary-dark: oklch(0.47 0.18 8);
  --primary-soft: oklch(0.95 0.035 8);
  --accent: oklch(0.56 0.13 195);
  --accent-soft: oklch(0.94 0.035 195);
  --success: oklch(0.54 0.14 150);
  --success-dark: oklch(0.39 0.11 150);
  --success-soft: oklch(0.94 0.035 150);
  --warning: oklch(0.72 0.14 75);
  --warning-dark: oklch(0.42 0.1 65);
  --warning-soft: oklch(0.95 0.035 75);
  --danger: oklch(0.5 0.18 25);
  --danger-soft: oklch(0.95 0.035 25);
  --sidebar: oklch(0.17 0.018 20);
  --sidebar-hover: oklch(0.23 0.02 20);
  --sidebar-text: oklch(0.92 0.006 20);
  --sidebar-muted: oklch(0.68 0.012 20);
  --focus: oklch(0.63 0.16 195);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --z-sidebar: 20;
  --z-mobile-nav: 30;
  --z-dialog: 50;
  --z-toast: 60;
}

* { box-sizing: border-box; }

html { background: var(--bg); color: var(--ink); font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.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; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }

.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary); color: var(--bg); font-weight: 820; font-size: 20px; letter-spacing: -.04em; flex: 0 0 auto; }
.brand-mark span { transform: translateY(-1px); }
.brand-mark--large { width: 48px; height: 48px; border-radius: 12px; font-size: 26px; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(400px, .85fr) minmax(480px, 1.15fr); }
.login-brand { background: var(--sidebar); color: var(--sidebar-text); padding: clamp(40px, 7vw, 112px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.login-brand > p:first-of-type { margin-top: 20px; color: var(--sidebar-muted); font-size: 14px; font-weight: 650; }
.login-brand h1 { margin-top: 84px; font-size: clamp(38px, 5vw, 72px); line-height: .98; letter-spacing: -.035em; max-width: 11ch; }
.login-brand__copy { max-width: 42ch; margin-top: 28px; color: var(--sidebar-muted); line-height: 1.7; }
.login-panel { align-self: center; width: min(420px, calc(100% - 48px)); justify-self: center; display: grid; gap: 20px; }
.login-panel h2 { font-size: 28px; letter-spacing: -.025em; }
.login-panel > div p { margin-top: 8px; color: var(--muted); }
.login-panel > label { display: grid; gap: 8px; font-size: 13px; font-weight: 700; }
.login-panel label small { color: var(--muted); font-size: 10px; font-weight: 500; }
.auth-switch { color: var(--muted); text-align: center; font-size: 12px; }
.auth-switch button { border: 0; padding: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 720; cursor: pointer; }
.auth-switch button:hover { text-decoration: underline; text-underline-offset: 3px; }

.onboarding-screen { min-height: 100vh; background: var(--surface); }
.onboarding-header { height: 76px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--bg); display: flex; align-items: center; justify-content: space-between; }
.onboarding-header .sidebar__brand { color: var(--ink); padding: 0; }
.onboarding-header .sidebar__brand small { color: var(--muted); }
.logout-button--light { width: auto; color: var(--muted); padding-inline: 12px; }
.logout-button--light:hover { color: var(--ink); background: var(--surface-strong); }
.onboarding-main { width: min(620px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 80px; }
.onboarding-progress { margin: 0 auto 28px; padding: 0; list-style: none; display: flex; align-items: flex-start; }
.onboarding-progress li { position: relative; flex: 1; display: grid; justify-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 680; }
.onboarding-progress li:not(:last-child)::after { content: ""; position: absolute; top: 14px; left: calc(50% + 19px); right: calc(-50% + 19px); height: 1px; background: var(--line); }
.onboarding-progress li.is-complete:not(:last-child)::after { background: var(--success); }
.onboarding-progress span { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 750; }
.onboarding-progress span svg { width: 14px; height: 14px; }
.onboarding-progress li.is-complete span { background: var(--success); border-color: var(--success); color: var(--bg); }
.onboarding-progress li.is-current { color: var(--ink); }
.onboarding-progress li.is-current span { border: 2px solid var(--ink); color: var(--ink); }
.onboarding-panel { padding: 38px; border-radius: var(--radius-lg); background: var(--bg); box-shadow: 0 5px 8px oklch(0.18 0.02 20 / .08); display: grid; gap: 20px; }
.onboarding-panel h1 { font-size: 26px; letter-spacing: -.025em; text-wrap: balance; }
.onboarding-panel > p { color: var(--muted); line-height: 1.65; }
.onboarding-panel > label { display: grid; gap: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 720; }
.onboarding-panel input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; outline: 0; background: var(--bg); color: var(--ink); font-size: 13px; }
.onboarding-panel input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px oklch(0.63 0.16 195 / .18); }
.onboarding-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.onboarding-icon svg { width: 22px; }
.onboarding-icon--download { background: var(--accent-soft); color: var(--accent); }
.connection-result { text-align: left; }
.connection-result > .status-badge { justify-self: start; }
.connection-code { padding: 18px; border-radius: 12px; background: var(--surface); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 14px; align-items: center; }
.connection-code span { grid-column: 1 / -1; color: var(--muted); font-size: 10px; font-weight: 700; }
.connection-code strong { font-size: 18px; letter-spacing: .04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.installer-step > div:nth-child(2) > p { margin-top: 8px; color: var(--muted); line-height: 1.6; }
.installer-step > .button { text-decoration: none; }
.installer-instructions { margin: 0; padding: 0; list-style: none; display: grid; }
.installer-instructions li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.installer-instructions li > span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-strong); color: var(--ink-soft); font-size: 10px; font-weight: 780; }
.installer-instructions strong, .installer-instructions small { display: block; }
.installer-instructions strong { font-size: 12px; }
.installer-instructions small { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.installer-instructions--compact li:first-child { border-top: 0; }
.wizard-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.connection-check { min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); color: oklch(0.34 0.08 195); }
.connection-check.is-connected { background: var(--success-soft); color: var(--success-dark); }
.connection-check__pulse { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px oklch(0.56 0.13 195 / .14); animation: connection-pulse 1.8s ease-out infinite; }
.connection-check.is-connected .connection-check__pulse { background: var(--success); box-shadow: none; animation: none; }
.connection-check strong, .connection-check small { display: block; }
.connection-check strong { font-size: 12px; }
.connection-check small { margin-top: 4px; font-size: 10px; }
@keyframes connection-pulse { 50% { box-shadow: 0 0 0 9px oklch(0.56 0.13 195 / 0); } }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; z-index: var(--z-sidebar); display: flex; flex-direction: column; padding: 22px 14px 14px; background: var(--sidebar); color: var(--sidebar-text); }
.sidebar__brand { height: 48px; display: flex; gap: 12px; align-items: center; padding-inline: 10px; }
.sidebar__brand strong { display: block; font-size: 19px; line-height: 1; letter-spacing: -.02em; }
.sidebar__brand small { display: block; margin-top: 5px; font-size: 11px; color: var(--sidebar-muted); }
.primary-nav { margin-top: 32px; display: flex; flex-direction: column; gap: 4px; }
.nav-label { padding: 0 12px 8px; color: var(--sidebar-muted); font-size: 11px; font-weight: 720; }
.nav-label--second { margin-top: 18px; }
.nav-item { width: 100%; min-height: 42px; border: 0; border-radius: 9px; background: transparent; color: var(--sidebar-muted); display: flex; align-items: center; gap: 12px; padding: 0 12px; text-align: left; font-size: 14px; transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out); }
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text); }
.nav-item.is-current { background: var(--sidebar-text); color: var(--sidebar); font-weight: 680; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; border-radius: 999px; background: var(--primary); color: var(--bg); display: grid; place-items: center; font-size: 11px; font-weight: 750; }
.sidebar__footer { margin-top: auto; }
.sync-state { display: flex; align-items: center; gap: 11px; min-height: 58px; padding: 9px 10px 12px; border-bottom: 1px solid var(--sidebar-hover); }
.sync-state__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px oklch(0.54 0.14 150 / .14); }
.sync-state strong, .sync-state small { display: block; }
.sync-state strong { font-size: 12px; }
.sync-state small { margin-top: 4px; color: var(--sidebar-muted); font-size: 11px; }
.user-switcher { width: 100%; border: 0; background: transparent; display: grid; grid-template-columns: 34px minmax(0, 1fr) 18px; align-items: center; gap: 10px; color: var(--sidebar-text); padding: 14px 8px 8px; text-align: left; }
.user-switcher:hover { color: var(--bg); }
.user-switcher > span:nth-child(2) { min-width: 0; }
.user-switcher strong, .user-switcher small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-switcher strong { font-size: 12px; }
.user-switcher small { margin-top: 3px; color: var(--sidebar-muted); font-size: 11px; }
.user-switcher svg { width: 17px; }
.avatar, .top-avatar { display: grid; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 800; }
.avatar { width: 34px; height: 34px; background: var(--primary-soft); color: var(--primary-dark); }
.logout-button { width: 100%; margin-top: 4px; padding: 8px; border: 0; background: transparent; color: var(--sidebar-muted); font-size: 11px; text-align: left; border-radius: var(--radius-sm); }
.logout-button:hover { color: var(--sidebar-text); background: var(--sidebar-hover); }

.main { grid-column: 2; min-width: 0; background: var(--bg); }
.topbar { min-height: 68px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; padding: 0 32px; background: var(--bg); position: sticky; top: 0; z-index: 10; }
.topbar__tools { display: flex; align-items: center; gap: 10px; }
.branch-picker { position: relative; height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 31px 0 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: var(--bg); }
.branch-picker > svg:first-child { width: 16px; }
.branch-picker select { appearance: none; border: 0; outline: 0; background: transparent; color: var(--ink-soft); font-size: 12px; font-weight: 650; max-width: 170px; }
.branch-picker .chevron { position: absolute; right: 10px; width: 14px; pointer-events: none; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out); }
.icon-button:hover { background: var(--surface); color: var(--ink); }
.top-avatar { width: 36px; height: 36px; margin-left: 4px; border: 0; background: var(--ink); color: var(--bg); }
.menu-button, .mobile-brand { display: none; }

.content { width: min(1600px, 100%); margin-inline: auto; padding: 34px 32px 56px; }
.view { display: none; }
.view.is-active { display: block; animation: view-in 200ms var(--ease-out); }
@keyframes view-in { from { opacity: .65; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.page-header h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.03em; }
.page-header p { margin-top: 7px; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.date-range { height: 40px; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; padding: 0 10px; color: var(--faint); background: var(--bg); }
.date-range input { width: 112px; border: 0; outline: 0; background: transparent; color: var(--ink-soft); font-size: 11px; font-weight: 630; }
.date-range span { padding-inline: 3px; }
.button { min-height: 40px; border: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; font-size: 12px; font-weight: 720; white-space: nowrap; transition: transform 160ms var(--ease-out), background-color 180ms var(--ease-out), color 180ms var(--ease-out); }
.button svg { width: 16px; height: 16px; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button--dark { background: var(--ink); color: var(--bg); }
.button--dark:hover { background: oklch(0.28 0.025 20); }
.button--outline { background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); }
.button--outline:hover { background: var(--surface); }
.button--quiet { background: var(--surface); color: var(--ink-soft); }
.button--quiet:hover { background: var(--surface-strong); }
.button--full { width: 100%; }
.text-button { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 680; }
.text-button:hover { color: var(--ink); }
.text-button svg { width: 14px; }

.demo-notice { margin: -12px 0 20px; min-height: 38px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); color: oklch(0.35 0.08 195); display: flex; align-items: center; gap: 8px; font-size: 12px; }
.demo-notice strong::after { content: "·"; margin-left: 8px; }

.summary-band { min-height: 164px; display: grid; grid-template-columns: minmax(260px, .8fr) minmax(580px, 2.2fr); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.net-summary { padding: 27px 30px; background: var(--ink); color: var(--bg); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.metric-label { display: flex; align-items: center; gap: 8px; color: oklch(0.77 0.012 20); font-size: 12px; font-weight: 650; }
.metric-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.metric-dot--ink { background: var(--primary); }
.metric-dot--revenue { background: var(--accent); }
.metric-dot--expense { background: var(--primary); }
.metric-main { margin-top: 10px; font-size: clamp(29px, 3vw, 40px); line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.trend-chip { display: inline-flex; align-items: center; gap: 5px; margin-top: 15px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.trend-chip svg { width: 12px; height: 12px; }
.trend-chip--positive { background: oklch(0.34 0.08 150); color: oklch(0.92 0.05 150); }
.trend-chip--negative { background: oklch(0.34 0.08 25); color: oklch(0.92 0.05 25); }
.summary-metrics { display: grid; grid-template-columns: repeat(3, 1fr); align-items: stretch; }
.summary-metric { min-width: 0; padding: 29px 27px; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid var(--line); }
.summary-metric > span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.summary-metric > strong { margin-top: 13px; font-size: clamp(21px, 2vw, 29px); letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.summary-metric > small { margin-top: 8px; color: var(--success-dark); font-size: 10px; font-weight: 680; }

.dashboard-grid { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .72fr); gap: 20px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg); }
.panel-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 20px; }
.panel-header h2 { font-size: 14px; letter-spacing: -.01em; }
.panel-header p { margin-top: 5px; color: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend-line { width: 18px; height: 2px; display: inline-block; }
.legend-line--revenue { background: var(--accent); }
.legend-line--expense { height: 0; border-top: 2px dashed var(--primary); }
.chart-wrap { position: relative; height: 240px; padding: 0 16px 0 8px; }
.chart-wrap svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid-line { stroke: var(--line); stroke-width: 1; }
.chart-axis-label { fill: var(--muted); stroke: none; font-size: 9px; }
.chart-area { fill: oklch(0.92 0.045 195 / .42); stroke: none; }
.chart-revenue { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.chart-expense { fill: none; stroke: var(--primary); stroke-width: 2; stroke-dasharray: 5 5; }
.chart-point { fill: var(--bg); stroke-width: 2; }
.chart-point--revenue { stroke: var(--accent); }
.chart-point--expense { stroke: var(--primary); }
.chart-summary { min-height: 44px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 28px; padding: 0 20px; color: var(--muted); font-size: 10px; }
.chart-summary strong { margin-left: 4px; color: var(--ink); font-variant-numeric: tabular-nums; }
.agenda-panel { min-width: 0; }
.agenda-list { padding: 0 20px 12px; }
.agenda-item { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.agenda-date { height: 42px; border-radius: 9px; background: var(--surface); display: grid; place-items: center; align-content: center; }
.agenda-date strong, .agenda-date span { display: block; }
.agenda-date strong { font-size: 14px; line-height: 1; }
.agenda-date span { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 750; }
.agenda-item__content { min-width: 0; align-self: center; }
.agenda-item__content strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.agenda-item__content span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.attention-strip { margin-top: 20px; min-height: 90px; border-radius: var(--radius-md); background: var(--warning-soft); display: flex; align-items: stretch; }
.attention-title { min-width: 250px; display: flex; align-items: center; gap: 13px; padding: 19px 22px; }
.attention-title h2 { font-size: 13px; }
.attention-title p { margin-top: 5px; color: var(--warning-dark); font-size: 11px; }
.attention-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 9px; background: var(--warning); color: oklch(0.25 0.08 65); }
.attention-icon svg { width: 17px; }
.attention-items { flex: 1; display: flex; align-items: stretch; }
.attention-item { flex: 1; min-width: 230px; padding: 18px 20px; border-left: 1px solid oklch(0.84 0.07 75); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.attention-item strong, .attention-item span { display: block; }
.attention-item strong { font-size: 11px; }
.attention-item span { margin-top: 4px; color: var(--warning-dark); font-size: 10px; }
.attention-item button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: oklch(0.87 0.09 75); color: var(--warning-dark); display: grid; place-items: center; }
.attention-item button svg { width: 14px; }

.detail-grid { margin-top: 20px; display: grid; grid-template-columns: minmax(320px, .85fr) minmax(420px, 1.15fr); gap: 20px; }
.payment-layout { min-height: 224px; display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: center; gap: 20px; padding: 4px 24px 24px; }
.donut { width: 138px; height: 138px; position: relative; border-radius: 50%; display: grid; place-items: center; }
.donut > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-track, .donut-segment { fill: none; stroke-width: 12; }
.donut-track { stroke: var(--surface); }
.donut-segment { stroke-linecap: butt; }
.donut div { position: relative; z-index: 1; text-align: center; }
.donut strong, .donut span { display: block; }
.donut strong { font-size: 15px; letter-spacing: -.02em; }
.donut span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.payment-list { display: grid; gap: 13px; }
.payment-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.payment-row i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.payment-row span { color: var(--muted); font-size: 10px; }
.payment-row strong { color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.payment-color-0 { color: var(--accent); stroke: var(--accent); }
.payment-color-1 { color: var(--ink-soft); stroke: var(--ink-soft); }
.payment-color-2 { color: var(--warning); stroke: var(--warning); }
.payment-color-3 { color: var(--surface-strong); stroke: var(--surface-strong); }
.payment-color-4 { color: var(--primary); stroke: var(--primary); }
.payment-color-5 { color: var(--success); stroke: var(--success); }
.product-list { padding: 0 20px 14px; }
.product-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 90px 58px; gap: 11px; align-items: center; min-height: 42px; border-top: 1px solid var(--line); }
.product-rank { color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.product-name { min-width: 0; }
.product-name strong, .product-name small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.product-name strong { font-size: 11px; }
.product-name small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.product-revenue { text-align: right; font-size: 11px; font-weight: 720; font-variant-numeric: tabular-nums; }
.product-change { text-align: right; font-size: 10px; font-weight: 680; }
.positive { color: var(--success-dark); }
.negative, .danger-text { color: var(--danger); }

.transactions-panel { margin-top: 20px; overflow: hidden; }
.table-scroll { overflow-x: auto; }
th, td { padding: 12px 20px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 750; }
td { font-size: 12px; }
td strong, td small { display: block; }
td strong { font-size: 12px; }
td small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.type-label { display: inline-flex; align-items: center; gap: 6px; }
.type-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.type-label--expense::before { background: var(--primary); }
.status-badge { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0 8px; border-radius: 999px; font-size: 10px; font-weight: 720; }
.status-badge svg { width: 10px; height: 10px; }
.status-badge--paid { background: var(--success-soft); color: var(--success-dark); }
.status-badge--planned { background: var(--warning-soft); color: var(--warning-dark); }
.status-badge--overdue { background: var(--danger-soft); color: var(--danger); }
.status-badge--invited { background: var(--accent-soft); color: oklch(0.35 0.09 195); }
.table-action { min-height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: var(--surface); color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.table-action:hover { background: var(--surface-strong); }

.coming-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .6fr); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; min-height: 530px; }
.coming-chart { padding: 28px; min-width: 0; }
.coming-chart .chart-wrap { height: 410px; }
.finance-notes { border-left: 1px solid var(--line); padding: 28px; background: var(--surface); }
.finance-notes h2 { font-size: 15px; }
.finance-note-row { padding: 20px 0; border-bottom: 1px solid var(--line); }
.finance-note-row span, .finance-note-row strong { display: block; }
.finance-note-row span { color: var(--muted); font-size: 10px; }
.finance-note-row strong { margin-top: 6px; font-size: 22px; font-variant-numeric: tabular-nums; }

.subnav-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface); }
.segmented button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 680; }
.segmented button.is-active { background: var(--bg); color: var(--ink); box-shadow: 0 1px 5px oklch(0.2 0.02 20 / .12); }
.search-field { width: min(260px, 100%); height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: center; gap: 8px; }
.search-field svg { width: 15px; color: var(--muted); }
.search-field input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.search-field input::placeholder { color: var(--muted); opacity: 1; }
.expense-total { min-height: 106px; display: grid; grid-template-columns: 1.2fr 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: 18px; }
.expense-total div { padding: 23px 25px; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid var(--line); }
.expense-total div:first-child { border-left: 0; }
.expense-total span { color: var(--muted); font-size: 10px; }
.expense-total strong { margin-top: 8px; font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.data-panel { overflow: hidden; }
.data-panel table { min-width: 880px; }

.invoice-page-header { margin-bottom: 18px; }
.invoice-sync-strip { min-height: 38px; margin-bottom: 14px; padding: 9px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); font-size: 10px; line-height: 1.45; }
.invoice-sync-strip .sync-state__dot { flex: 0 0 auto; }
.invoice-sync-strip.is-syncing .sync-state__dot { background: var(--accent); animation: sync-pulse 1.1s ease-in-out infinite alternate; }
.invoice-sync-strip.has-error { border-color: oklch(0.84 0.08 25); background: var(--danger-soft); color: var(--danger); }
.invoice-sync-strip.has-error .sync-state__dot { background: var(--danger); box-shadow: 0 0 0 4px oklch(0.5 0.18 25 / .12); }
@keyframes sync-pulse { from { opacity: .42; } to { opacity: 1; } }
.invoice-summary { min-height: 102px; margin-bottom: 18px; display: grid; grid-template-columns: .7fr 1fr 1fr 1.25fr; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.invoice-summary > div { padding: 20px 22px; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid var(--line); }
.invoice-summary > div:first-child { border-left: 0; }
.invoice-summary span, .invoice-summary small { color: var(--muted); font-size: 10px; }
.invoice-summary strong { margin-top: 8px; font-size: clamp(18px, 1.7vw, 24px); letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.invoice-summary small { margin-top: 6px; }
.invoice-summary__accent { background: var(--primary-soft); }
.invoice-summary__accent strong { color: var(--primary-dark); }
.invoice-workspace { height: min(680px, calc(100vh - 250px)); min-height: 560px; display: grid; grid-template-columns: minmax(300px, .72fr) minmax(520px, 1.28fr); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.invoice-master { min-width: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; border-right: 1px solid var(--line); background: var(--bg); }
.invoice-master > header { min-height: 66px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; }
.invoice-master > header h2 { font-size: 14px; }
.invoice-master > header p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.invoice-filters { padding: 0 14px 14px; display: grid; grid-template-columns: minmax(0, 1fr) 116px; gap: 8px; border-bottom: 1px solid var(--line); }
.invoice-filters .search-field { width: 100%; height: 36px; }
.compact-select { width: 100%; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--bg); color: var(--ink-soft); font-size: 10px; font-weight: 680; }
.compact-select:focus { border-color: var(--focus); box-shadow: 0 0 0 3px oklch(0.63 0.16 195 / .18); }
.invoice-list { min-height: 0; overflow-y: auto; }
.invoice-list-row { width: 100%; min-height: 112px; padding: 13px 16px; border: 0; border-bottom: 1px solid var(--line); background: var(--bg); display: grid; gap: 6px; color: var(--ink); text-align: left; transition: background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
.invoice-list-row:hover { background: var(--surface); }
.invoice-list-row.is-selected { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.invoice-list-row__top, .invoice-list-row__bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.invoice-list-row__top time, .invoice-list-row__bottom small { color: var(--muted); font-size: 9px; }
.invoice-list-row > strong { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invoice-list-row__description { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invoice-list-row__bottom b { color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.invoice-category { width: max-content; min-height: 20px; padding: 0 7px; border-radius: 999px; display: inline-flex; align-items: center; background: var(--surface-strong); color: var(--ink-soft); font-size: 9px; font-weight: 760; }
.invoice-category--service { background: var(--accent-soft); color: oklch(0.35 0.09 195); }
.invoice-category--commission { background: var(--warning-soft); color: var(--warning-dark); }
.invoice-category--refund { background: var(--danger-soft); color: var(--danger); }
.invoice-pagination { min-height: 48px; padding: 6px 12px; display: flex; align-items: center; justify-content: center; gap: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.invoice-pagination .icon-button { width: 32px; height: 32px; }
.invoice-inspector { min-width: 0; overflow-y: auto; background: var(--bg); }
.invoice-inspector > .empty-state { min-height: 100%; }
.invoice-inspector > .empty-state svg, .invoice-list > .empty-state svg { width: 22px; height: 22px; color: var(--faint); }
.invoice-detail-skeleton { width: 170px; height: 8px; }
.invoice-inspector__header { min-height: 112px; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 22px; border-bottom: 1px solid var(--line); }
.invoice-inspector__header h2 { margin-top: 8px; font-size: 17px; letter-spacing: -.015em; }
.invoice-inspector__header p { max-width: 54ch; margin-top: 5px; color: var(--muted); font-size: 10px; }
.invoice-inspector__amount { flex: 0 0 auto; text-align: right; }
.invoice-inspector__amount span, .invoice-inspector__amount strong { display: block; }
.invoice-inspector__amount span { color: var(--muted); font-size: 9px; }
.invoice-inspector__amount strong { margin-top: 7px; color: var(--primary-dark); font-size: 22px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.invoice-meta { min-height: 72px; padding: 14px 24px; display: grid; grid-template-columns: .8fr .8fr 1.4fr; gap: 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.invoice-meta small, .invoice-meta strong { display: block; }
.invoice-meta small { color: var(--muted); font-size: 9px; }
.invoice-meta strong { margin-top: 5px; font-size: 10px; }
.invoice-breakdown { padding: 17px 24px; display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line); }
.invoice-breakdown div { padding: 2px 12px; border-left: 1px solid var(--line); }
.invoice-breakdown div:first-child { padding-left: 0; border-left: 0; }
.invoice-breakdown span, .invoice-breakdown strong { display: block; }
.invoice-breakdown span { color: var(--muted); font-size: 9px; }
.invoice-breakdown strong { margin-top: 6px; font-size: 11px; font-variant-numeric: tabular-nums; }
.invoice-lines > header { min-height: 62px; padding: 15px 24px; display: flex; align-items: center; }
.invoice-lines h3 { font-size: 12px; }
.invoice-lines header p { margin-top: 4px; color: var(--muted); font-size: 9px; }
.invoice-lines table { min-width: 650px; }
.invoice-lines th, .invoice-lines td { padding: 11px 16px; }
.invoice-lines th:first-child, .invoice-lines td:first-child { padding-left: 24px; }
.invoice-lines td { font-size: 10px; }
.invoice-lines td strong { font-size: 10px; }
.muted-copy { color: var(--muted); }
.invoice-rate-note { margin: 14px 24px 22px; padding: 11px 13px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: oklch(0.35 0.07 195); font-size: 9px; line-height: 1.5; }

.calendar-layout { display: grid; grid-template-columns: minmax(520px, 1.25fr) minmax(300px, .65fr); gap: 20px; }
.calendar-month { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.calendar-month > header { min-height: 64px; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.calendar-month h2 { font-size: 14px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-weekday { min-height: 34px; padding: 11px 10px; background: var(--surface); color: var(--muted); font-size: 10px; font-weight: 750; }
.calendar-day { min-height: 98px; padding: 10px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); position: relative; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.is-muted { color: var(--faint); background: var(--surface); }
.calendar-day.is-today .calendar-day__number { background: var(--ink); color: var(--bg); }
.calendar-day__number { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 680; }
.calendar-event { display: block; width: 100%; margin-top: 5px; padding: 4px 5px; border: 0; border-radius: 5px; background: var(--accent-soft); color: oklch(0.35 0.09 195); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-size: 9px; font-weight: 680; }
.calendar-event--payment { background: var(--primary-soft); color: var(--primary-dark); }
.calendar-event--meeting { background: var(--warning-soft); color: var(--warning-dark); }
.calendar-agenda { overflow: hidden; }
.calendar-agenda-list { padding: 0 20px 14px; }
.calendar-agenda-row { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.calendar-agenda-row time { color: var(--muted); font-size: 10px; font-weight: 680; }
.calendar-agenda-row strong, .calendar-agenda-row span { display: block; }
.calendar-agenda-row strong { font-size: 11px; }
.calendar-agenda-row span { margin-top: 4px; color: var(--muted); font-size: 10px; }

.report-list, .settings-list { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.report-list article, .settings-list article { min-height: 90px; display: grid; align-items: center; gap: 18px; padding: 18px 22px; border-top: 1px solid var(--line); }
.report-list article:first-child, .settings-list article:first-child { border-top: 0; }
.report-list article { grid-template-columns: 40px minmax(0, 1fr) auto; }
.settings-list article { grid-template-columns: minmax(0, 1fr) auto; }
.settings-list__actions { display: flex; align-items: center; gap: 10px; }
.settings-list__meta { font-variant-numeric: tabular-nums; }
.report-icon { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--ink-soft); }
.report-icon svg { width: 17px; }
.report-list h2, .settings-list h2 { font-size: 12px; }
.report-list p, .settings-list p { margin-top: 5px; color: var(--muted); font-size: 11px; }
.settings-section + .settings-section { margin-top: 28px; }
.settings-section__header { min-height: 64px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.settings-section__header > div { display: flex; align-items: center; gap: 12px; }
.settings-section__header h2 { font-size: 14px; }
.settings-section__header p { max-width: 75ch; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.settings-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; background: var(--surface); color: var(--ink-soft); }
.settings-icon svg { width: 17px; }
.settings-list article.branch-card { display: block; padding: 0; }
.branch-card__header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 18px 22px; }
.may-setting { border-top: 1px solid var(--line); }
.may-setting:first-child { border-top: 0; }
.may-setting__header { min-height: 68px; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.may-setting__header h3 { font-size: 13px; }
.may-setting__header p { margin-top: 5px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.may-setting__error { margin: 14px 20px 0; padding: 9px 11px; display: flex; align-items: center; gap: 8px; background: var(--danger-soft); color: var(--danger); font-size: 10px; line-height: 1.45; }
.branch-hours-form { display: flex; align-items: flex-end; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--line); }
.branch-hours-form .field { flex: 0 0 260px; }
.payroll-period + .payroll-period { margin-top: 16px; }
.payroll-period__total { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.payroll-period__total strong { font-size: 15px; white-space: nowrap; }
#payroll-periods-list { display: flex; flex-direction: column; }
.may-setting__error svg { width: 14px; flex: 0 0 auto; }
.may-setting__body { padding: 20px; display: grid; grid-template-columns: minmax(260px, .72fr) minmax(420px, 1.28fr); gap: 24px; }
.may-setting__body.may-setting__loading { display: block; color: var(--muted); font-size: 11px; }
.may-credentials { display: grid; gap: 13px; align-content: start; }
.may-credentials .check-field { margin-top: 2px; }
.may-rate-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.may-rate-fieldset legend { margin-bottom: 11px; color: var(--ink-soft); font-size: 11px; font-weight: 720; }
.may-rate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.may-rate-grid > label { min-width: 0; display: grid; gap: 6px; color: var(--muted); font-size: 9px; }
.percent-input { height: 38px; display: grid; grid-template-columns: minmax(0, 1fr) 25px; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--bg); }
.percent-input:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px oklch(0.63 0.16 195 / .18); }
.percent-input input { min-width: 0; width: 100%; height: 100%; padding: 0 0 0 10px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; font-variant-numeric: tabular-nums; }
.percent-input b { color: var(--muted); font-size: 10px; }
.may-setting > .form-error { margin-bottom: 4px; }
.may-setting > footer { min-height: 64px; padding: 12px 20px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.permission-note { min-height: 76px; display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 15px 18px; border-radius: var(--radius-md); background: var(--accent-soft); color: oklch(0.32 0.08 195); }
.permission-note > svg { width: 21px; flex: 0 0 auto; }
.permission-note strong { font-size: 11px; }
.permission-note p { margin-top: 5px; max-width: 80ch; font-size: 11px; line-height: 1.45; }

.dialog { width: min(610px, calc(100% - 28px)); max-height: min(88vh, 760px); padding: 0; border: 0; border-radius: var(--radius-lg); color: var(--ink); background: var(--bg); box-shadow: 0 8px 32px oklch(0.15 0.02 20 / .26); overflow: auto; }
.dialog--wide { width: min(720px, calc(100% - 28px)); }
.dialog::backdrop { background: oklch(0.12 0.015 20 / .58); }
.dialog__shell > header { min-height: 80px; padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.dialog__shell > header h2 { font-size: 18px; }
.dialog__shell > header p { margin-top: 5px; color: var(--muted); font-size: 11px; }
.dialog__shell > footer { min-height: 72px; padding: 15px 24px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.dialog-progress { margin: 0; padding: 13px 24px; list-style: none; display: flex; gap: 8px; border-bottom: 1px solid var(--line); }
.dialog-progress li { flex: 1; padding: 7px 9px; border-radius: 8px; background: var(--surface); color: var(--muted); text-align: center; font-size: 10px; font-weight: 700; }
.dialog-progress li.is-current { background: var(--ink); color: var(--bg); }
.dialog-progress li.is-complete { background: var(--success-soft); color: var(--success-dark); }
.branch-download-step { margin: 24px; }
.branch-download-step > .button { text-decoration: none; }
.branch-download-step .installer-instructions { margin-top: 12px; }
.branch-code-result { margin: 24px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.branch-code-result strong { display: block; margin: 10px 0 8px; font: 700 20px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; overflow-wrap: anywhere; }
.branch-code-result p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.branch-code-result .button { margin: 16px 8px 0 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; padding: 24px; }
.field { display: grid; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 720; }
.field--wide, .choice-group { grid-column: 1 / -1; }
.field input, .field select, .field textarea, .login-panel input { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; outline: 0; background: var(--bg); color: var(--ink); font-size: 12px; font-weight: 500; transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
.field textarea { min-height: 82px; padding-block: 10px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder, .login-panel input::placeholder { color: var(--muted); opacity: 1; }
.field input:focus, .field select:focus, .field textarea:focus, .login-panel input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px oklch(0.63 0.16 195 / .18); }
.check-field { min-height: 54px; display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 9px; background: var(--surface); cursor: pointer; }
.check-field input, .choice-group input { width: 17px; height: 17px; accent-color: var(--ink); }
.check-field strong, .check-field small { display: block; }
.check-field strong { font-size: 11px; }
.check-field small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.choice-group { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.choice-group legend { padding: 0 7px; font-size: 11px; font-weight: 720; }
.choice-group > div, .permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.choice-group label { display: flex; align-items: center; gap: 8px; min-height: 30px; color: var(--ink-soft); font-size: 11px; }
.form-error { min-height: 18px; margin: 0 24px; color: var(--danger); font-size: 11px; }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast); display: grid; gap: 8px; width: min(350px, calc(100% - 40px)); }
.toast { min-height: 52px; padding: 12px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); box-shadow: 0 5px 8px oklch(0.15 0.02 20 / .2); display: flex; align-items: center; gap: 10px; font-size: 11px; animation: toast-in 220ms var(--ease-out); }
.toast svg { width: 16px; color: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.empty-state { min-height: 160px; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--muted); text-align: center; padding: 24px; }
.empty-state strong { color: var(--ink); font-size: 12px; }
.empty-state span { font-size: 10px; }
.skeleton { border-radius: 5px; background: var(--surface-strong); animation: skeleton 1.2s ease-in-out infinite alternate; }
@keyframes skeleton { from { opacity: .55; } to { opacity: 1; } }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 84px minmax(0, 1fr); }
  .sidebar { width: 84px; padding-inline: 10px; }
  .sidebar__brand { padding-inline: 14px; }
  .sidebar__brand > div:last-child, .nav-item span:not(.nav-count), .nav-label, .sync-state div, .user-switcher > span:nth-child(2), .user-switcher > svg, .logout-button { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item svg { width: 19px; height: 19px; }
  .nav-count { position: absolute; transform: translate(12px, -11px); }
  .primary-nav { margin-top: 28px; }
  .sync-state { justify-content: center; padding-inline: 0; }
  .user-switcher { display: flex; justify-content: center; padding-inline: 0; }
  .main { grid-column: 2; }
  .summary-band { grid-template-columns: minmax(250px, .8fr) minmax(460px, 2fr); }
  .summary-metric { padding-inline: 18px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.5fr) minmax(260px, .75fr); }
  .attention-strip { overflow-x: auto; }
  .attention-title { min-width: 220px; }
}

@media (max-width: 860px) {
  .content { padding: 26px 22px 104px; }
  .topbar { padding-inline: 22px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .summary-band { grid-template-columns: 1fr; }
  .net-summary { min-height: 140px; }
  .summary-metrics { min-height: 130px; }
  .summary-metric:first-child { border-left: 0; }
  .dashboard-grid, .detail-grid, .calendar-layout, .coming-layout { grid-template-columns: 1fr; }
  .agenda-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
  .finance-notes { border-left: 0; border-top: 1px solid var(--line); }
  .calendar-month { overflow-x: auto; }
  .calendar-grid { min-width: 620px; }
  .invoice-summary { grid-template-columns: 1fr 1fr; }
  .invoice-summary > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .invoice-summary > div:nth-child(4) { border-top: 1px solid var(--line); }
  .invoice-workspace { height: auto; min-height: 0; grid-template-columns: 1fr; }
  .invoice-master { max-height: 520px; border-right: 0; border-bottom: 1px solid var(--line); }
  .invoice-inspector { max-height: none; overflow: visible; }
  .may-setting__body { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .app-shell { display: block; }
  .sidebar { width: min(280px, 82vw); transform: translateX(-102%); transition: transform 220ms var(--ease-out); box-shadow: 5px 0 8px oklch(0.15 0.02 20 / .2); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar__brand > div:last-child, .nav-item span:not(.nav-count), .nav-label, .sync-state div, .user-switcher > span:nth-child(2), .user-switcher > svg, .logout-button { display: block; }
  .nav-item { justify-content: flex-start; padding: 0 12px; }
  .nav-count { position: static; transform: none; display: grid; }
  .sync-state { justify-content: flex-start; padding-inline: 10px; }
  .user-switcher { display: grid; justify-content: initial; padding-inline: 8px; }
  .main { width: 100%; }
  .topbar { min-height: 60px; justify-content: space-between; padding-inline: 16px; }
  .menu-button, .mobile-brand { display: flex; }
  .mobile-brand { align-items: center; gap: 8px; }
  .mobile-brand .brand-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 16px; }
  .mobile-brand strong { font-size: 15px; }
  .branch-picker { max-width: 145px; }
  .branch-picker > svg:first-child { display: none; }
  .branch-picker select { max-width: 100px; }
  .search-button, .top-avatar { display: none; }
  .content { padding: 22px 16px 96px; }
  .page-header { margin-bottom: 22px; gap: 18px; }
  .page-header h1 { font-size: 24px; }
  .page-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .date-range { grid-column: 1 / -1; justify-content: center; }
  .page-actions .button { width: 100%; }
  .demo-notice { align-items: flex-start; flex-direction: column; }
  .demo-notice strong::after { content: none; }
  .summary-metrics { grid-template-columns: 1fr 1fr; }
  .summary-metric { min-height: 112px; }
  .summary-metric:nth-child(3) { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .dashboard-grid, .detail-grid { gap: 14px; margin-top: 14px; }
  .agenda-list { display: block; }
  .attention-strip { margin-top: 14px; flex-direction: column; overflow: hidden; }
  .attention-title { min-width: 0; }
  .attention-items { display: block; }
  .attention-item { border-left: 0; border-top: 1px solid oklch(0.84 0.07 75); }
  .payment-layout { grid-template-columns: 130px minmax(0, 1fr); padding-inline: 18px; }
  .donut { width: 116px; height: 116px; }
  .product-row { grid-template-columns: 24px minmax(0, 1fr) 80px; }
  .product-change { display: none; }
  .chart-wrap { height: 220px; }
  .chart-summary { flex-wrap: wrap; gap: 5px 18px; padding-block: 8px; }
  .subnav-row { align-items: stretch; flex-direction: column; }
  .segmented { overflow-x: auto; }
  .search-field { width: 100%; }
  .expense-total { grid-template-columns: 1fr 1fr; }
  .expense-total div { padding: 18px; }
  .expense-total div:nth-child(3) { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .report-list article { grid-template-columns: 40px minmax(0, 1fr); }
  .report-list article .button { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr; padding: 20px; }
  .field--wide, .choice-group { grid-column: auto; }
  .choice-group > div, .permission-grid { grid-template-columns: 1fr; }
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { min-height: 260px; padding: 36px 28px; justify-content: flex-start; }
  .login-brand h1 { margin-top: 34px; font-size: 36px; }
  .login-brand__copy { display: none; }
  .login-panel { padding: 48px 0; }
  .onboarding-header { height: 68px; padding-inline: 20px; }
  .onboarding-main { padding-top: 36px; }
  .onboarding-panel { padding: 26px 22px; }
  .onboarding-progress small { font-size: 9px; }
  .wizard-actions { align-items: stretch; flex-direction: column-reverse; }
  .wizard-actions .button { width: 100%; }
  .connection-code { grid-template-columns: 1fr; }
  .connection-code span { grid-column: auto; }
  .invoice-summary > div { padding: 16px; }
  .invoice-summary strong { font-size: 18px; }
  .invoice-filters { grid-template-columns: 1fr; }
  .invoice-master { max-height: 470px; }
  .invoice-inspector__header { align-items: flex-start; flex-direction: column; padding: 19px 17px; }
  .invoice-inspector__amount { text-align: left; }
  .invoice-meta { grid-template-columns: 1fr 1fr; padding-inline: 17px; }
  .invoice-meta span:last-child { grid-column: 1 / -1; }
  .invoice-breakdown { grid-template-columns: repeat(2, 1fr); padding-inline: 17px; }
  .invoice-breakdown div { min-height: 54px; padding: 8px; border-top: 1px solid var(--line); }
  .invoice-breakdown div:nth-child(odd) { border-left: 0; }
  .invoice-breakdown div:first-child, .invoice-breakdown div:nth-child(2) { border-top: 0; }
  .invoice-lines > header { padding-inline: 17px; }
  .invoice-rate-note { margin-inline: 17px; }
  .may-setting__header { align-items: flex-start; }
  .may-setting__body { padding: 17px; }
  .may-rate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .may-setting > footer { align-items: stretch; flex-direction: column; }
  .may-setting > footer .button { width: 100%; }
  .settings-list article { align-items: flex-start; grid-template-columns: 1fr; }
  .branch-card__header { align-items: flex-start; grid-template-columns: 1fr; }
  .settings-list__actions { justify-content: space-between; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: var(--z-mobile-nav); height: 70px; display: grid !important; grid-template-columns: repeat(5, 1fr); background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 4px; font-size: 9px; }
  .mobile-nav button svg { width: 19px; height: 19px; }
  .mobile-nav button.is-current { color: var(--ink); font-weight: 720; }
}

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