/* MEIVisu — a clear view of your business. */
:root {
  color-scheme: light;
  --primary: #678fff;
  --primary-hover: #527cf0;
  --primary-button: #476ccd;
  --primary-button-hover: #365abc;
  --primary-button-text: #ffffff;
  --primary-soft: #edf2ff;
  --primary-ink: #4c72d6;
  --page: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #f9fafc;
  --surface-hover: #f3f5fa;
  --ink: #202b40;
  --ink-secondary: #5d697f;
  --muted: #6b778c;
  --line: #e9edf4;
  --line-strong: #dce2ec;
  --green: #21785d;
  --green-soft: #eaf8f2;
  --red: #b64751;
  --red-soft: #fff0f0;
  --orange: #876428;
  --orange-soft: #fff7e7;
  --purple: #9b7ad9;
  --purple-soft: #f2edfb;
  --shadow: 0 4px 22px rgba(39, 53, 85, .035);
  --shadow-pop: 0 18px 55px rgba(33, 46, 75, .14);
  --radius: 14px;
  --sidebar: 238px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-theme="dark"] {
  color-scheme: dark;
  --primary: #83a2ff;
  --primary-hover: #97b1ff;
  --primary-button: #83a2ff;
  --primary-button-hover: #97b1ff;
  --primary-button-text: #14213c;
  --primary-soft: #222f50;
  --primary-ink: #9cb5ff;
  --page: #141b28;
  --surface: #1c2535;
  --surface-soft: #1a2332;
  --surface-hover: #263146;
  --ink: #eef2fa;
  --ink-secondary: #aeb9cc;
  --muted: #8190a8;
  --line: #2b3548;
  --line-strong: #3a465e;
  --green: #65c9a7;
  --green-soft: #213d39;
  --red: #ee9499;
  --red-soft: #422d36;
  --orange: #e9bd79;
  --orange-soft: #3c3429;
  --purple: #b598ed;
  --purple-soft: #332d49;
  --shadow: 0 4px 22px rgba(0, 0, 0, .08);
  --shadow-pop: 0 18px 55px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button, a { touch-action: manipulation; }
button, input, select, textarea { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid #678fff66; outline-offset: 3px; }
a { color: var(--primary-ink); text-decoration: none; }
a:hover { color: var(--primary); }
svg { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 650; letter-spacing: -.035em; }
h1 { font-size: 27px; line-height: 1.25; }
h2 { font-size: 19px; line-height: 1.4; }
h3 { font-size: 16px; line-height: 1.4; }
small { font-size: 12px; }
hr { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }
::selection { background: #678fff33; }
.hidden, [hidden] { display: none !important; }
.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; }
.muted { color: var(--muted); }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.row { display: flex; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.spacer { flex: 1; }
.wrap { flex-wrap: wrap; }
.section-gap { margin-top: 24px; }
.helper-text { color: var(--muted); font-size: 10px; line-height: 1.7; margin-top: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.income-text, .positive { color: var(--green); }
.expense-text, .negative { color: var(--red); }
.amount { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.page-transition { animation: page-in .24s ease-out both; }
@keyframes page-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

/* App frame */
.app-shell { min-height: 100vh; }
.sidebar { width: var(--sidebar); position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; flex-direction: column; padding: 33px 18px 20px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: thin; }
.sidebar > * { flex-shrink: 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 22px; font-weight: 750; letter-spacing: -.055em; padding: 0 15px; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand > span:last-child > span { color: var(--primary); }
.brand > span:last-child { line-height: 1.12; }
.brand small { display: block; color: var(--muted); font-size: 6.5px; line-height: 1; letter-spacing: .16em; font-weight: 550; margin-top: 7px; }
.logo-mark { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; color: white; background: var(--primary); box-shadow: 0 3px 8px #678fff22; }
.logo-mark svg { width: 23px; height: 23px; }
.brand .logo-mark { display: flex; align-items: center; justify-content: center; gap: 0; font-size: 22px; font-weight: 650; font-style: normal; letter-spacing: -.12em; padding-right: 3px; }
.brand .logo-mark > span { font-size: 20px; transform: translate(-1px, 3px); }
.sidebar nav { display: flex; flex-direction: column; gap: 5px; margin-top: 44px; }
.sidebar nav .eyebrow, .nav-label { margin: 0 15px 11px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; }
.nav-item { position: relative; width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 15px; min-height: 46px; border: none; background: transparent; border-radius: 9px; text-align: left; color: var(--ink-secondary); font-size: 13px; font-weight: 500; transition: background .15s, color .15s; }
.nav-item svg { width: 19px; height: 19px; opacity: .85; }
.nav-item:hover { background: var(--surface-hover); color: var(--ink); }
.nav-item.active { color: var(--primary-ink); background: var(--primary-soft); font-weight: 650; }
.nav-item.active svg { opacity: 1; }
.nav-item .badge { margin-left: auto; padding: 2px 6px; font-size: 9px; }
.sidebar > .nav-label { margin: 42px 15px 12px; font-size: 9px; }
.sidebar nav.main-nav { margin-top: 0; gap: 6px; }
.nav-chevron { width: 13px !important; height: 13px !important; margin-left: auto; opacity: .4 !important; }
.nav-item:not(.active) .nav-chevron { display: none; }
.assistant-nav { margin-top: 23px; }
.sidebar-promo { margin: 28px 7px 0; padding: 17px 15px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(135deg, var(--primary-soft), var(--surface)); }
.promo-spark { display: inline-grid; place-items: center; color: var(--primary); width: 29px; height: 29px; margin-bottom: 9px; }
.promo-spark svg { width: 24px; height: 24px; stroke-width: 1.5; }
.sidebar-promo strong { display: block; font-size: 11px; font-weight: 650; margin-bottom: 6px; }
.sidebar-promo p { font-size: 10px; color: var(--ink-secondary); line-height: 1.7; margin-bottom: 13px; }
.sidebar-promo .text-link { font-size: 9px; gap: 4px; }
.sidebar-promo .text-link svg { width: 12px; height: 12px; }
.sidebar-footer { margin-top: auto; padding-top: 32px; }
.sidebar-tip { margin: 0 6px 20px; border: 1px solid var(--line); background: var(--surface-soft); border-radius: 12px; padding: 17px 14px; }
.sidebar-tip svg { color: var(--primary); margin-bottom: 11px; }
.sidebar-tip h4 { font-size: 12px; margin-bottom: 5px; }
.sidebar-tip p { font-size: 11px; color: var(--ink-secondary); line-height: 1.65; }
.sidebar-user { display: flex; align-items: center; gap: 10px; width: 100%; color: var(--ink); background: transparent; text-align: left; padding: 17px 10px 0; margin-top: 18px; border: 0; border-top: 1px solid var(--line); }
.sidebar-user strong { display: block; font-size: 12px; }
.sidebar-user small { font-size: 10px; color: var(--muted); }
.sidebar-user > span:nth-child(2) { min-width: 0; flex: 1; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user > svg { width: 13px; height: 13px; color: var(--muted); }
.sidebar-version { display: block; text-align: center; color: var(--muted); font-size: 8px; margin-top: 20px; letter-spacing: .025em; }
.main-shell { margin-left: var(--sidebar); min-width: 0; }
.topbar { height: 83px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 35px; border-bottom: 1px solid var(--line); background: var(--surface); }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.breadcrumbs strong { color: var(--ink-secondary); font-weight: 500; }
.breadcrumbs svg { width: 14px; height: 14px; }
.topbar-title { color: var(--ink-secondary); font-size: 13px; font-weight: 550; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-actions > .divider { height: 24px; width: 1px; background: var(--line); margin: 0 4px; }
.topbar-company { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.topbar-company strong { display: block; font-weight: 550; }
.topbar-company small { display: block; font-size: 10px; color: var(--muted); }
.icon-btn { display: inline-grid; place-items: center; width: 35px; height: 35px; border: 1px solid transparent; border-radius: 9px; color: var(--ink-secondary); background: transparent; position: relative; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-hover); color: var(--ink); }
.notification-dot { position: absolute; top: 6px; right: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2px var(--surface); }
.avatar { width: 35px; height: 35px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 50%; font-size: 11px; font-weight: 650; color: #a07958; background: #f2e8dc; }
.top-avatar { border: 1px solid #eadbc8; margin-left: 12px; }
.page-content { max-width: 1510px; margin: 0 auto; padding: 31px 35px 48px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-header h1 { margin-bottom: 7px; }
.page-header p { color: var(--ink-secondary); font-size: 12px; }
.page-header .eyebrow { margin-bottom: 7px; }
.page-header > .row { flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.greeting-wave { display: inline-block; color: #d8ac65; font-size: .9em; margin-left: 2px; font-weight: 400; vertical-align: 1px; }
.month-control { display: flex; align-items: center; position: relative; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; min-height: 40px; padding-left: 12px; color: var(--ink-secondary); }
.month-control > svg { width: 15px; height: 15px; }
.month-control input { border: 0 !important; background: transparent !important; width: 144px !important; padding: 9px 7px 9px 9px !important; min-height: 38px !important; color: var(--ink-secondary) !important; font-size: 11px !important; box-shadow: none !important; }
.month-control:focus-within { outline: 3px solid #678fff33; outline-offset: 2px; }
.main-footer { max-width: 1510px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 35px 23px; color: var(--muted); font-size: 9px; }
.main-footer > span > span { padding: 0 6px; }
.main-footer a { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.main-footer a:hover { color: var(--primary); }
.main-footer svg { width: 13px; height: 13px; }
.skip-link { position: fixed; z-index: 300; top: -60px; left: 20px; padding: 11px 20px; border-radius: 8px; background: var(--primary); color: white; font-size: 12px; }
.skip-link:focus { top: 15px; color: white; }

/* Actions and shared panels */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 10px 17px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; line-height: 1.35; font-weight: 550; color: var(--ink-secondary); background: var(--surface); white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .15s; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { color: var(--ink); background: var(--surface-hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { color: var(--primary-button-text); background: var(--primary-button); border-color: var(--primary-button); box-shadow: 0 3px 6px #678fff14; }
.btn.primary:hover { color: var(--primary-button-text); background: var(--primary-button-hover); border-color: var(--primary-button-hover); }
.btn.secondary { background: var(--surface); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--surface-soft); border-color: var(--muted); }
.btn.ghost { background: transparent; color: var(--primary-ink); }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.danger { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn.danger:hover { border-color: var(--red); }
.btn.small { min-height: 32px; padding: 7px 12px; font-size: 11px; }
.btn.full-width { width: 100%; }
.btn.icon-only { width: 40px; padding: 0; flex: 0 0 auto; }
.full-width { width: 100%; }
.text-link, .text-btn { display: inline-flex; align-items: center; gap: 7px; color: var(--primary-ink); font-size: 11px; font-weight: 550; line-height: 1.5; }
.text-link svg, .text-btn svg { width: 14px; height: 14px; }
.text-btn { border: 0; background: transparent; padding: 0; font-size: inherit; }
.text-link:hover, .text-btn:hover { color: var(--primary); }
.card-bottom-link { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); width: 100%; justify-content: space-between; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 23px; box-shadow: var(--shadow); min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 21px; }
.card-header h2, .section-title { font-size: 14px; line-height: 1.4; font-weight: 650; letter-spacing: -.02em; }
.card-header p { font-size: 11px; color: var(--muted); margin-top: 5px; }
.card-header > a { font-size: 11px; }
.card-header .icon-btn { margin-right: -8px; }
.card > p.muted { font-size: 12px; line-height: 1.75; margin-bottom: 18px; }
.card-header > svg { color: var(--muted); width: 18px; height: 18px; }
.badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: 5px; padding: 4px 7px; font-size: 10px; font-weight: 550; line-height: 1.4; white-space: nowrap; }
.badge.success { background: var(--green-soft); color: var(--green); }
.badge.warning { background: var(--orange-soft); color: var(--orange); }
.badge.danger { background: var(--red-soft); color: var(--red); }
.badge.neutral { background: var(--surface-hover); color: var(--ink-secondary); }
.badge.blue { background: var(--primary-soft); color: var(--primary-ink); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge svg { width: 11px; height: 11px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--radius); padding: 20px; }
.stat-card > .row:first-child { justify-content: space-between; margin-bottom: 13px; }
.stat-icon { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--primary); background: var(--primary-soft); flex: 0 0 auto; }
.stat-icon svg { width: 17px; height: 17px; }
.stat-icon.income, .stat-icon.green { color: var(--green); background: var(--green-soft); }
.stat-icon.success { color: var(--green); background: var(--green-soft); }
.stat-icon.warning { color: var(--orange); background: var(--orange-soft); }
.stat-icon.expense, .stat-icon.red { color: var(--red); background: var(--red-soft); }
.stat-icon.purple { color: var(--purple); background: var(--purple-soft); }
.stat-icon.orange { color: var(--orange); background: var(--orange-soft); }
.stat-label { font-size: 11px; color: var(--ink-secondary); font-weight: 500; }
.stat-value { display: block; font-size: clamp(21px, 1.95vw, 29px); line-height: 1.4; letter-spacing: -.045em; font-weight: 650; font-variant-numeric: tabular-nums; margin: 4px 0 9px; white-space: nowrap; }
.stat-value small { font-size: .55em; color: var(--muted); font-weight: 500; letter-spacing: -.01em; }
.stat-note { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 10px; color: var(--muted); }
.stat-note svg { width: 12px; height: 12px; }
.metric-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; color: var(--green); font-weight: 550; }
.metric-trend.down { color: var(--red); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr); gap: 22px; }
.dashboard-bottom { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr); gap: 22px; margin-top: 22px; }
.dashboard-primary { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1fr); gap: 22px; }
.compact-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Cash flow */
.chart-summary { display: flex; gap: 28px; margin-bottom: 15px; }
.chart-summary span { display: block; font-size: 10px; color: var(--muted); }
.chart-summary strong { display: block; margin-top: 4px; font-size: 18px; font-weight: 600; letter-spacing: -.025em; }
.chart-bars { position: relative; height: 224px; display: flex; align-items: stretch; justify-content: space-around; gap: 10px; padding: 14px 10px 23px 35px; margin-top: 8px; border-bottom: 1px solid var(--line); background-image: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), var(--line) calc(25% - 1px), var(--line) 25%); }
.chart-column { position: relative; display: flex; align-items: flex-end; justify-content: center; flex: 1; min-width: 0; }
.bar-group { display: flex; align-items: flex-end; justify-content: center; gap: 7px; height: 100%; width: 100%; }
.bar { display: block; width: 18px; max-width: 25%; min-width: 7px; min-height: 0; border-radius: 4px 4px 0 0; background: var(--primary); transition: height .35s ease, filter .15s; }
.bar:hover { filter: brightness(.93); }
.bar.income { background: var(--primary); }
.bar.expense { background: #cfdbff; }
[data-theme="dark"] .bar.expense { background: #3d507c; }
.chart-label { position: absolute; left: 0; right: 0; bottom: -25px; text-align: center; font-size: 10px; color: var(--muted); }
.chart-y-labels { position: absolute; inset: 0 auto 20px 0; display: flex; flex-direction: column; justify-content: space-between; font-size: 9px; color: var(--muted); pointer-events: none; }
.chart-legend { display: flex; align-items: center; gap: 17px; font-size: 10px; color: var(--ink-secondary); }
.chart-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.dot { display: inline-block; width: 7px; height: 7px; background: var(--primary); border-radius: 50%; flex: 0 0 auto; }
.dot.expense { background: #cfdbff; }
.dot.success { background: var(--green); }
.dot.warning { background: var(--orange); }
.chart-placeholder { min-height: 225px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.chart-details { margin-top: 18px; color: var(--muted); font-size: 9px; }
.chart-details summary { width: fit-content; cursor: pointer; }
.chart-details summary:hover { color: var(--primary-ink); }
.chart-details[open] summary { margin-bottom: 12px; }
.limit-card { display: flex; flex-direction: column; }
.limit-card .card-header { margin-bottom: 23px; }
.limit-card .card-header .eyebrow { display: block; font-size: 8px; margin-bottom: 5px; }
.limit-value { font-size: 30px; line-height: 1.3; font-weight: 650; letter-spacing: -.055em; }
.limit-value + .muted { font-size: 10px; margin-top: 5px; }
.limit-meta { justify-content: space-between; gap: 5px; font-size: 10px; }
.limit-meta strong { font-weight: 550; color: var(--primary-ink); }
.limit-meta span { color: var(--muted); }
.limit-note { font-size: 10px; color: var(--muted); line-height: 1.75; margin-top: 17px; margin-bottom: 17px; }
.limit-card > .text-link { margin-top: auto; font-size: 10px; }
.limit-amount { display: flex; align-items: baseline; gap: 6px; margin: 13px 0 5px; }
.limit-amount strong { font-size: 29px; letter-spacing: -.045em; font-weight: 650; }
.limit-amount span { color: var(--muted); font-size: 11px; }
.limit-track { height: 8px; overflow: hidden; background: var(--primary-soft); border-radius: 99px; margin: 17px 0 11px; }
.limit-progress { height: 100%; border-radius: inherit; background: var(--primary); max-width: 100%; transition: width .4s ease; }
.limit-progress.warning { background: var(--orange); }
.limit-progress.danger { background: var(--red); }
.limit-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.limit-message { margin-top: 20px; padding: 12px; border-radius: 9px; background: var(--green-soft); color: var(--green); font-size: 11px; line-height: 1.6; }
.limit-message .row { gap: 8px; align-items: flex-start; }
.limit-message svg { width: 15px; height: 15px; margin-top: 2px; }
.limit-footer { margin-top: auto; padding-top: 19px; color: var(--muted); font-size: 10px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.quick-section { margin: 28px 0 26px; }
.quick-section > .section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.quick-section > .section-title h2 { font-size: 14px; font-weight: 650; }
.quick-section > .section-title > span { font-size: 10px; font-weight: 400; }
.quick-action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 104px; padding: 16px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink-secondary); font-size: 10px; font-weight: 500; transition: background .15s, border-color .15s, transform .15s; }
.quick-action:hover { background: var(--surface-soft); border-color: var(--primary); color: var(--primary-ink); transform: translateY(-2px); }
.quick-action svg { color: var(--primary); width: 21px; height: 21px; }
.quick-action .stat-icon { width: 33px; height: 33px; border-radius: 9px; }
.quick-section .quick-action { position: relative; align-items: flex-start; justify-content: flex-start; gap: 0; padding: 17px; min-height: 145px; text-align: left; }
.quick-icon { display: inline-flex; align-items: center; justify-content: center; width: 33px; height: 33px; background: var(--primary-soft); border-radius: 9px; color: var(--primary); margin-bottom: 13px; flex: 0 0 auto; }
.quick-icon svg { width: 18px; height: 18px; }
.quick-action strong { color: var(--ink); font-size: 11px; font-weight: 550; line-height: 1.5; margin-bottom: 4px; }
.quick-action > span:not(.quick-icon) { color: var(--muted); font-size: 9px; font-weight: 400; line-height: 1.5; }
.quick-action .quick-arrow { position: absolute; top: 25px; right: 16px; width: 14px; height: 14px; color: var(--muted); }
.quick-action:nth-child(2) .quick-icon { color: var(--green); background: var(--green-soft); }
.quick-action:nth-child(2) .quick-icon svg { color: var(--green); }
.quick-action:nth-child(3) .quick-icon { color: var(--orange); background: var(--orange-soft); }
.quick-action:nth-child(3) .quick-icon svg { color: var(--orange); }
.quick-action:nth-child(4) .quick-icon { color: var(--purple); background: var(--purple-soft); }
.quick-action:nth-child(4) .quick-icon svg { color: var(--purple); }
.context-note { display: flex; align-items: flex-start; justify-content: center; gap: 7px; color: var(--muted); font-size: 9px; line-height: 1.6; margin-top: 25px; }
.context-note svg { width: 13px; height: 13px; margin-top: 1px; }
.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; align-items: center; gap: 11px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.activity-item:first-child { padding-top: 0; }
.activity-item:last-child { padding-bottom: 0; border-bottom: 0; }
.activity-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: 0 0 auto; }
.activity-icon svg { width: 16px; height: 16px; }
.activity-icon.success, .activity-icon.income { background: var(--green-soft); color: var(--green); }
.activity-icon.expense { background: var(--red-soft); color: var(--red); }
.activity-icon.warning { background: var(--orange-soft); color: var(--orange); }
.activity-icon.purple { background: var(--purple-soft); color: var(--purple); }
.activity-item strong { display: block; font-size: 11px; font-weight: 550; }
.activity-item p, .activity-item small { font-size: 10px; color: var(--muted); margin-top: 3px; }
.activity-item .amount { margin-left: auto; font-size: 11px; }
.activity-item > .muted { font-size: 9px; white-space: nowrap; }
.activity-icon.neutral { color: var(--ink-secondary); background: var(--surface-hover); }

/* Lists and data */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar .row { gap: 9px; }
.toolbar select { width: auto; min-width: 135px; }
.search-field { position: relative; display: flex; align-items: center; min-width: 240px; }
.search-field > svg { position: absolute; left: 13px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 38px; width: 100%; }
.tabs { display: flex; align-items: center; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); width: fit-content; }
.tab { padding: 8px 16px; border: 0; background: transparent; color: var(--ink-secondary); border-radius: 6px; font-size: 12px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--surface); color: var(--primary-ink); box-shadow: 0 1px 5px rgba(25, 40, 75, .06); font-weight: 550; }
.tab > span { margin-left: 5px; font-size: 9px; color: var(--muted); }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.data-table th { font-size: 10px; font-weight: 550; color: var(--muted); background: var(--surface-soft); padding: 13px 15px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table th:first-child { border-radius: 7px 0 0 7px; }
.data-table th:last-child { border-radius: 0 7px 7px 0; }
.data-table td { padding: 16px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-secondary); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-soft); }
.data-table td strong { color: var(--ink); font-weight: 550; }
.data-table td small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.data-table .amount { font-size: 12px; }
.data-table .income-text { color: var(--green); }
.data-table .expense-text { color: var(--red); }
.data-table .row { gap: 9px; }
.data-table .icon-btn { width: 28px; height: 28px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 17px; border-top: 1px solid var(--line); margin-top: 7px; font-size: 10px; color: var(--muted); }
.pagination { display: flex; gap: 5px; align-items: center; }
.pagination button { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink-secondary); font-size: 11px; }
.pagination button.active { background: var(--primary-soft); color: var(--primary-ink); border-color: var(--primary-soft); }
.item-list { display: flex; flex-direction: column; }
.item-row { display: flex; align-items: center; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.item-row:first-child { padding-top: 0; }
.item-row:last-child { border-bottom: 0; padding-bottom: 0; }
.item-main { flex: 1; min-width: 0; }
.item-main h3, .item-main strong { font-size: 13px; font-weight: 550; }
.item-main p { font-size: 11px; color: var(--muted); margin-top: 4px; }
.item-actions { display: flex; align-items: center; gap: 9px; }
.reminder-check { width: 22px; height: 22px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--green); display: grid; place-items: center; padding: 0; flex: 0 0 auto; }
.reminder-check svg { width: 14px; height: 14px; }
.reminder-check.checked { background: var(--green-soft); border-color: var(--green); }
.is-done .item-main strong { text-decoration: line-through; color: var(--muted); }
.search-empty { padding: 45px 20px; text-align: center; color: var(--muted); font-size: 12px; }
.empty-state { min-height: 240px; padding: 36px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.empty-state > svg { width: 43px; height: 43px; color: var(--primary); margin-bottom: 17px; stroke-width: 1.25; }
.empty-state .stat-icon { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 16px; }
.empty-state h3 { color: var(--ink); font-size: 15px; margin-bottom: 8px; }
.empty-state p { font-size: 12px; max-width: 340px; margin-bottom: 19px; }
.empty-state .btn { margin-top: 3px; }
.empty-icon { display: grid; place-items: center; width: 49px; height: 49px; background: var(--primary-soft); border-radius: 14px; margin-bottom: 17px; }
.empty-icon svg { width: 24px; height: 24px; color: var(--primary); stroke-width: 1.5; }
.alert { display: flex; align-items: flex-start; gap: 11px; border-radius: 10px; padding: 15px 17px; font-size: 12px; line-height: 1.6; border: 1px solid transparent; margin-bottom: 21px; }
.alert > svg { width: 18px; height: 18px; margin-top: 1px; }
.alert strong { display: block; font-size: 12px; font-weight: 650; margin-bottom: 2px; }
.alert.info { background: var(--primary-soft); color: var(--primary-ink); }
.alert.warning { background: var(--orange-soft); color: var(--orange); }
.alert.error { background: var(--red-soft); color: var(--red); }
.alert.success { background: var(--green-soft); color: var(--green); }
.alert .btn { margin-left: auto; }
.small-alert { padding: 12px 13px; font-size: 10px; line-height: 1.7; margin-top: 19px; margin-bottom: 17px; }
.small-alert > svg { width: 15px; height: 15px; }

/* Forms */
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) { display: block; width: 100%; min-height: 41px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; color: var(--ink); background: var(--surface); font-size: 12px; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input:hover, select:hover, textarea:hover { border-color: #b9c5da; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #678fff13; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-soft); color: var(--muted); cursor: not-allowed; }
textarea { min-height: 100px; resize: vertical; line-height: 1.65; }
select { padding-right: 30px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
input[type="file"] { padding: 7px; }
input[type="file"]::file-selector-button { border: 0; border-radius: 5px; padding: 6px 10px; margin-right: 10px; color: var(--primary-ink); background: var(--primary-soft); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 20px; }
.form-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field > label, .form-field > .label { font-size: 11px; color: var(--ink-secondary); font-weight: 550; }
.form-field > span:first-child { font-size: 11px; color: var(--ink-secondary); font-weight: 550; }
.form-field > label span { color: var(--red); }
.form-field > small { font-size: 10px; color: var(--muted); line-height: 1.5; }
.form-field .error { color: var(--red); }
.form-error { color: var(--red); background: var(--red-soft); padding: 11px 13px; border-radius: 8px; font-size: 11px; line-height: 1.6; }
.form-field input[aria-invalid="true"], .form-field select[aria-invalid="true"] { border-color: var(--red); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 21px; border-top: 1px solid var(--line); }
.check-field { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; color: var(--ink-secondary); line-height: 1.7; cursor: pointer; }
.check-field input { margin: 2px 0 0; flex: 0 0 auto; }
.switch { position: relative; display: inline-flex; flex-shrink: 0; width: 36px; height: 21px; border: 0; border-radius: 99px; background: var(--line-strong); padding: 0; vertical-align: middle; transition: background .2s; cursor: pointer; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #0002; transition: transform .2s; }
.switch[aria-checked="true"], .switch.active, .switch:has(input:checked) { background: var(--primary); }
.switch[aria-checked="true"]::after, .switch.active::after, .switch:has(input:checked)::after { transform: translateX(15px); }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; }
.switch:has(input:focus-visible) { outline: 3px solid #678fff66; outline-offset: 3px; }
.input-with-icon { position: relative; }
.input-with-icon > svg { position: absolute; top: 12px; left: 12px; width: 17px; height: 17px; color: var(--muted); }
.input-with-icon input { padding-left: 38px !important; }
.input-with-icon .icon-btn { position: absolute; top: 3px; right: 4px; }
.upload-zone { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; padding: 28px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface-soft); color: var(--ink-secondary); text-align: center; font-size: 12px; }
.upload-zone > svg { color: var(--primary); width: 27px; height: 27px; }
.upload-zone small { color: var(--muted); font-size: 10px; }

/* Dialogs and feedback */
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 28px; background: rgba(22, 32, 54, .38); backdrop-filter: blur(4px); animation: fade-in .15s ease-out; }
.modal { width: 100%; max-width: 540px; max-height: calc(100dvh - 56px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow-pop); animation: modal-in .18s ease-out; overflow: hidden; }
.modal.wide { max-width: 720px; }
.modal-open { overflow: hidden; }
.modal > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 24px 25px 19px; border-bottom: 1px solid var(--line); }
.modal-header, .modal-footer { flex: 0 0 auto; }
.modal-header h2 { font-size: 19px; }
.modal-header p { color: var(--muted); font-size: 12px; margin-top: 5px; }
.dialog-close { display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); width: 28px; height: 28px; border-radius: 7px; margin: -2px -4px 0 0; }
.dialog-close:hover { color: var(--ink); background: var(--surface-hover); }
.dialog-close svg { width: 19px; height: 19px; }
.modal-body { padding: 24px 25px; overflow-y: auto; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; }
.modal-body > p { font-size: 12px; line-height: 1.8; }
.modal-body > p + .form-field, .modal-body > p + .stack { margin-top: 20px; }
.modal-body > .form-error:not(.hidden) { margin-top: 17px; }
.modal-body .alert:last-child { margin-bottom: 0; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding: 17px 25px; background: var(--surface-soft); }
.modal .alert { margin-bottom: 18px; }
.fiscal-connection { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.fiscal-connection p { margin-top: 5px; }
.fiscal-connection > div { min-width: 0; }
.fiscal-connection .row { flex-wrap: wrap; }
.fiscal-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; color: var(--muted); font-size: 11px; }
.fiscal-steps span { padding: 5px 9px; border-radius: 6px; background: var(--surface-hover); }
.fiscal-steps .current { color: var(--primary-ink); background: var(--primary-soft); font-weight: 650; }
.fiscal-section { padding: 0; margin: 0 0 24px; border: 0; min-width: 0; }
.fiscal-section:last-child { margin-bottom: 0; }
.fiscal-section legend { display: block; width: 100%; padding: 0 0 12px; margin-bottom: 16px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 650; }
.fiscal-section > .muted { margin: 0 0 16px; font-size: 11px; }
.fiscal-section .check-field { grid-column: 1 / -1; }
.fiscal-status { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 18px; }
.fiscal-message { white-space: pre-line; overflow-wrap: anywhere; }
.fiscal-review .details-list dd { text-align: left; width: 60%; white-space: pre-line; }
.fiscal-review h3 { margin: 22px 0 14px; font-size: 13px; }
.fiscal-review h3:first-child { margin-top: 0; }
.fiscal-errors { padding-left: 18px; margin: 8px 0 0; }
.fiscal-errors li + li { margin-top: 5px; }
.fiscal-actions { flex-wrap: wrap; }
.fiscal-actions .btn { min-height: 37px; }
.fiscal-confirm { margin-top: 22px; padding: 15px; border-radius: 10px; background: var(--primary-soft); }
.toast-wrap { position: fixed; right: 26px; bottom: 25px; z-index: 200; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.toast { max-width: 380px; display: flex; align-items: center; gap: 11px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow-pop); font-size: 12px; pointer-events: auto; animation: page-in .2s ease-out; }
.toast svg { color: var(--green); width: 18px; height: 18px; }
.toast.error svg { color: var(--red); }
.toast.info svg { color: var(--primary); }
.button-spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: button-spin .65s linear infinite; flex: 0 0 auto; }
.receipt-summary { padding: 15px 17px; margin-bottom: 23px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.receipt-summary > strong { font-size: 13px; font-weight: 550; }
.receipt-summary > p { margin-top: 5px; font-size: 11px; }
.receipt-summary > p strong { font-weight: 550; color: var(--ink); }
@keyframes button-spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(9px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Authentication */
.auth-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(400px, 46%) 1fr; background: var(--surface); }
.auth-aside { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 45px 60px; color: white; background: #678fff; }
.auth-aside::before, .auth-aside::after { content: ""; position: absolute; width: 470px; height: 470px; border: 1px solid #ffffff18; border-radius: 50%; right: -180px; bottom: -180px; pointer-events: none; }
.auth-aside::after { width: 620px; height: 620px; right: -255px; bottom: -255px; }
.auth-aside .brand { padding: 0; color: white; position: relative; z-index: 1; }
.auth-aside .brand > span:last-child > span { color: white; }
.auth-aside .logo-mark { color: var(--primary); background: white; box-shadow: none; }
.auth-aside .brand small { color: #ffffffb2; }
.auth-aside-content { position: relative; z-index: 1; max-width: 400px; margin: 60px 0; }
.auth-aside h1 { max-width: 380px; font-size: clamp(32px, 3.2vw, 48px); font-weight: 650; line-height: 1.18; letter-spacing: -.05em; margin-bottom: 23px; }
.auth-aside p { color: #ffffffc7; font-size: 14px; line-height: 1.8; max-width: 360px; }
.auth-feature { display: flex; align-items: center; gap: 13px; margin-top: 23px; color: #ffffffe6; font-size: 13px; }
.auth-feature > svg { width: 19px; height: 19px; padding: 0; color: white; }
.auth-aside-footer { font-size: 11px; color: #ffffffa6; position: relative; z-index: 1; }
.auth-story { margin: 50px 0; position: relative; z-index: 1; }
.auth-story > .badge { color: white; background: #ffffff1f; font-size: 8px; font-weight: 550; letter-spacing: .09em; padding: 6px 9px; margin-bottom: 24px; }
.auth-features { margin-top: 32px; }
.auth-footer { color: #ffffffa6 !important; font-size: 10px !important; position: relative; z-index: 1; }
.auth-mobile-brand { display: none; }
.auth-heading { justify-content: space-between; margin-bottom: 14px; }
.auth-heading .eyebrow { font-size: 9px; }
.auth-card > h2 { font-size: 27px; line-height: 1.25; letter-spacing: -.045em; margin-bottom: 10px; }
.auth-card > p.muted { color: var(--ink-secondary); margin-bottom: 27px; }
.auth-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 23px; font-size: 9px !important; color: var(--muted) !important; }
.auth-note svg { width: 13px; height: 13px; }
.auth-version { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 9px; }
.auth-legal { display: flex; justify-content: center; align-items: center; gap: 11px; color: var(--muted); font-size: 9px; margin-top: 23px; }
.auth-legal .text-btn { color: var(--muted); font-weight: 400; }
.auth-legal .text-btn:hover { color: var(--primary); }
.auth-card .stack { gap: 18px; }
.auth-card .full-width { justify-content: space-between; padding-left: 17px; padding-right: 17px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 45px 36px; position: relative; }
.auth-main > .icon-btn { position: absolute; right: 28px; top: 25px; }
.auth-card { width: 100%; max-width: 370px; }
.auth-card > .brand { display: none; }
.auth-card h1 { font-size: 28px; margin-bottom: 10px; }
.auth-card > p { color: var(--ink-secondary); font-size: 12px; margin-bottom: 27px; }
.auth-card .form-grid { gap: 18px; }
.auth-card .form-field > label { font-size: 12px; }
.auth-card input:not([type="checkbox"]) { min-height: 44px; }
.auth-card .btn.primary { min-height: 43px; }
.auth-tabs { display: flex; gap: 5px; background: var(--surface-soft); padding: 5px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 25px; }
.auth-tabs button { width: 50%; border: 0; border-radius: 6px; padding: 9px; background: transparent; color: var(--ink-secondary); font-size: 12px; }
.auth-tabs button.active { background: var(--surface); color: var(--primary-ink); box-shadow: var(--shadow); }
.auth-links { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; margin: 17px 0 22px; }
.legal-text { text-align: left; font-size: 13px; color: var(--ink-secondary); line-height: 1.7; margin-top: 0; overflow-wrap: anywhere; }
.auth-divider { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: 10px; margin: 22px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Assistant */
.assistant-shell { max-width: 890px; margin: 0 auto; min-height: calc(100dvh - 255px); display: flex; flex-direction: column; }
.assistant-intro { text-align: center; max-width: 530px; margin: 24px auto 33px; }
.assistant-orb { display: inline-flex; align-items: center; justify-content: center; width: 68px; height: 68px; border-radius: 21px; color: var(--primary); background: var(--primary-soft); margin-bottom: 22px; position: relative; }
.assistant-orb::after { content: ""; position: absolute; inset: -6px; border: 1px solid var(--line); border-radius: 25px; }
.assistant-orb svg { width: 31px; height: 31px; stroke-width: 1.5; }
.assistant-intro h2 { font-size: 25px; margin-bottom: 11px; }
.assistant-intro h1 { font-size: 27px; margin-bottom: 12px; line-height: 1.3; }
.assistant-intro > .assistant-orb { display: flex; margin-left: auto; margin-right: auto; }
.assistant-intro > .badge { display: flex; width: fit-content; margin: 0 auto 17px; font-size: 8px; letter-spacing: .08em; padding: 5px 8px; }
.assistant-intro p { font-size: 12px; line-height: 1.8; color: var(--ink-secondary); }
.assistant-suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 670px; margin: 0 auto 30px; }
#assistant-suggestions { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 780px; }
#assistant-suggestions .suggestion { align-items: center; justify-content: space-between; font-size: 11px; padding: 17px; }
#assistant-suggestions .suggestion svg { width: 15px; height: 15px; }
.suggestion { display: flex; align-items: flex-start; gap: 11px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-secondary); font-size: 12px; line-height: 1.6; text-align: left; transition: border-color .15s, background .15s; }
.suggestion:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.suggestion svg { color: var(--primary); width: 18px; height: 18px; margin-top: 1px; }
.suggestion strong { display: block; color: var(--ink); font-size: 12px; font-weight: 550; }
.suggestion small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.assistant-thread { display: flex; flex-direction: column; gap: 20px; width: 100%; padding: 10px 0 28px; }
.assistant-thread:empty { display: none; }
.chat-message { position: relative; max-width: 85%; padding: 16px 19px; font-size: 13px; line-height: 1.8; border-radius: 14px; }
.chat-message.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 4px; color: var(--ink-secondary); }
.chat-message.assistant { display: flex; align-items: flex-start; gap: 12px; }
.chat-avatar { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); flex: 0 0 auto; }
.chat-avatar svg { width: 16px; height: 16px; }
.chat-message > div { min-width: 0; overflow-wrap: anywhere; }
.chat-message .btn { margin-top: 14px; }
.chat-message.user { align-self: flex-end; background: var(--primary-soft); color: var(--primary-ink); border-bottom-right-radius: 4px; }
.chat-message strong { color: var(--ink); }
.chat-message p + p { margin-top: 10px; }
.chat-message ul { padding-left: 20px; margin: 8px 0; }
.chat-message small { display: block; color: var(--muted); font-size: 9px; margin-top: 9px; }
.assistant-input { display: flex; align-items: flex-end; gap: 10px; border: 1px solid var(--line-strong); border-radius: 13px; padding: 9px 10px 9px 16px; background: var(--surface); box-shadow: var(--shadow); margin-top: auto; }
.assistant-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px #678fff13; }
.assistant-input textarea, .assistant-input input { flex: 1; min-height: 39px; max-height: 140px; padding: 9px 0; border: 0 !important; box-shadow: none !important; outline: none !important; resize: none; border-radius: 0; }
.assistant-input .btn { width: 38px; min-height: 38px; height: 38px; padding: 0; border-radius: 9px; }
.assistant-disclaimer { font-size: 10px; color: var(--muted); text-align: center; margin: 12px 0 0; }
.assistant-note { display: flex; align-items: flex-start; justify-content: center; gap: 6px; color: var(--muted); font-size: 9px; line-height: 1.65; text-align: center; margin: 13px 0 0; }
.assistant-note svg { width: 12px; height: 12px; margin-top: 1px; }

/* Settings and documents */
.settings-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 25px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 5px; }
.settings-nav button, .settings-nav a { display: flex; align-items: center; gap: 10px; background: transparent; border: 0; border-radius: 9px; color: var(--ink-secondary); font-size: 12px; padding: 12px 14px; text-align: left; }
.settings-nav svg { width: 17px; height: 17px; }
.settings-nav .active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 550; }
.settings-nav button:hover, .settings-nav a:hover { background: var(--surface-hover); }
.settings-content { min-width: 0; }
.settings-content > .card + .card { margin-top: 22px; }
.settings-content .card-header { padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 23px; }
.settings-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 0; background: transparent; border: 0; color: var(--ink-secondary); font-size: 12px; line-height: 1.5; text-align: left; }
.settings-link:hover { color: var(--primary-ink); }
.settings-link svg { width: 14px; height: 14px; color: var(--muted); }
.stack:has(> .settings-link) { gap: 6px; }
.settings-link + .settings-link { border-top: 1px solid var(--line); padding-top: 16px; }
.details-list { margin: 0; }
.details-list > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 11px; line-height: 1.6; }
.details-list > div:first-child { padding-top: 0; }
.details-list > div:last-child { border-bottom: 0; }
.details-list dt { color: var(--muted); flex: 1; min-width: 0; }
.details-list dd { margin: 0; color: var(--ink); width: 55%; text-align: right; overflow-wrap: anywhere; font-weight: 500; }
.modal-body > .details-list { margin-top: 20px; margin-bottom: 20px; }
.integration-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.integration-list .integration-card { margin: 0; }
.admin-tabs { margin-bottom: 24px; max-width: 100%; overflow-x: auto; }
.admin-section { scroll-margin-top: 24px; }
.admin-section > .grid-2 { align-items: start; }
.admin-section .section-title { margin-bottom: 17px; }
.admin-section .section-title h2, .admin-section .section-title h3 { font-size: 14px; }
.admin-section .section-title p { font-size: 11px; font-weight: 400; line-height: 1.75; margin-top: 6px; }
.admin-section .item-row .item-main strong { overflow-wrap: anywhere; }
.admin-section .integration-card { padding: 16px; }
.admin-section > .card > h3 { font-size: 14px; }
.business-banner { display: flex; align-items: center; gap: 19px; margin-bottom: 25px; padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.business-emblem { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 15px; background: var(--primary-soft); color: var(--primary); flex: 0 0 auto; }
.business-emblem svg { width: 28px; height: 28px; stroke-width: 1.5; }
.business-banner .eyebrow { display: block; font-size: 8px; margin-bottom: 6px; }
.business-banner h2 { font-size: 22px; margin-bottom: 5px; }
.business-banner p { font-size: 11px; color: var(--muted); }
.business-banner .btn { margin-left: auto; }
.business-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 19px; margin-bottom: 25px; }
.business-card { display: block; position: relative; min-height: 183px; padding: 25px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.business-card:hover { transform: translateY(-2px); border-color: var(--primary); color: var(--ink); }
.business-card .quick-icon { width: 37px; height: 37px; margin-bottom: 19px; }
.business-card h2 { font-size: 15px; margin-bottom: 7px; }
.business-card p { color: var(--muted); font-size: 11px; line-height: 1.65; }
.business-card-arrow { position: absolute; top: 33px; right: 24px; color: var(--muted); }
.business-card-arrow svg { width: 17px; height: 17px; }
.visucio-card { display: flex; align-items: center; gap: 25px; justify-content: space-between; background: linear-gradient(110deg, var(--primary-soft), var(--surface)); }
.visucio-card .eyebrow { display: block; font-size: 8px; margin-bottom: 8px; color: var(--primary-ink); }
.visucio-card h2 { font-size: 19px; margin-bottom: 7px; }
.visucio-card p { font-size: 11px; }
.integration-card { display: flex; align-items: center; gap: 16px; padding: 23px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.integration-card + .integration-card { margin-top: 13px; }
.integration-card > svg, .integration-logo { width: 43px; height: 43px; border-radius: 10px; color: var(--primary); background: var(--primary-soft); display: grid; place-items: center; padding: 10px; flex: 0 0 auto; }
.integration-card h3 { font-size: 13px; }
.integration-card p { font-size: 11px; color: var(--muted); margin-top: 5px; }
.integration-card .btn { margin-left: auto; }
.integration-card { display: grid; grid-template-columns: 33px minmax(0, 1fr); gap: 5px 13px; align-items: start; }
.integration-card > .quick-icon { grid-column: 1; grid-row: 1 / 3; margin-bottom: 0; }
.integration-card > .item-main { grid-column: 2; min-width: 0; }
.integration-card > .badge { grid-column: 2; justify-self: start; margin-top: 7px; }
.integration-card .item-main p { font-size: 10px; line-height: 1.7; }
.integration-card .item-main small { display: block; font-size: 9px; line-height: 1.6; color: var(--muted); margin-top: 5px; }
.document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.document-card { display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.document-card > .row:first-child { margin-bottom: 22px; }
.document-icon { display: grid; place-items: center; width: 41px; height: 45px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); }
.document-icon svg { width: 22px; height: 22px; }
.document-icon.pdf { background: var(--red-soft); color: var(--red); }
.document-icon.csv, .document-icon.xlsx { background: var(--green-soft); color: var(--green); }
.document-card h3 { font-size: 12px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-card p { color: var(--muted); font-size: 10px; margin-top: 7px; }
.document-card .document-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.document-card .document-meta .icon-btn { width: 27px; height: 27px; }
.document-card > .document-icon { margin-bottom: 18px; }
.document-card > strong { font-size: 12px; font-weight: 550; overflow-wrap: anywhere; }
.document-card > .row:last-child { justify-content: space-between; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.document-card > .row:last-child .btn { padding-left: 0; }
.skeleton { border-radius: 7px; background: linear-gradient(100deg, var(--surface-hover) 20%, var(--line) 45%, var(--surface-hover) 70%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; min-height: 18px; }
.skeleton-heading { width: 35%; height: 50px; margin-bottom: 30px; }
.skeleton-card { height: 142px; border-radius: 14px; }
.skeleton-panel { height: 325px; border-radius: 14px; }
.boot-screen { min-height: 100dvh; display: flex; flex-direction: column; gap: 17px; align-items: center; justify-content: center; padding: 35px; text-align: center; }
.boot-screen > svg { width: 39px; height: 39px; color: var(--primary); }
.boot-screen h1 { font-size: 24px; }
.boot-screen p { max-width: 400px; color: var(--muted); font-size: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.bottom-nav, .fab, .mobile-brand { display: none; }

/* Compact screens */
@media (min-width: 1600px) { .page-content { padding-top: 38px; } .stats-grid { gap: 23px; } .stat-card { padding: 25px; } }
@media (max-width: 1250px) {
  :root { --sidebar: 215px; }
  .sidebar { padding-left: 13px; padding-right: 13px; }
  .topbar { padding: 0 25px; }
  .page-content { padding-left: 25px; padding-right: 25px; }
  .stats-grid { gap: 13px; }
  .stat-card { padding: 17px; }
  .stat-value { font-size: 24px; }
  .dashboard-grid, .dashboard-bottom { grid-template-columns: minmax(0, 1.6fr) minmax(270px, 1fr); gap: 18px; }
  .dashboard-primary { grid-template-columns: minmax(0, 1.6fr) minmax(265px, 1fr); gap: 18px; }
  .card { padding: 20px; }
  .quick-grid { gap: 7px; }
  .quick-action { font-size: 9px; min-height: 96px; }
  .quick-section .quick-action { padding: 15px; min-height: 151px; }
  .quick-action strong { font-size: 10px; }
  .quick-action > span:not(.quick-icon) { font-size: 9px; }
  .quick-action .quick-arrow { right: 13px; }
  .grid-2, .grid-3 { gap: 18px; }
  .business-card { padding: 21px; }
  .business-card p { font-size: 10px; }
}
@media (max-width: 1080px) {
  :root { --sidebar: 198px; }
  .sidebar { padding-left: 11px; padding-right: 11px; }
  .brand { font-size: 21px; padding-left: 10px; gap: 8px; }
  .nav-item { gap: 10px; padding-left: 12px; font-size: 12px; }
  .sidebar-tip { padding: 14px 11px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
  .stat-card { padding: 19px 21px; }
  .stat-value { font-size: 27px; }
  .dashboard-grid, .dashboard-bottom { grid-template-columns: minmax(0, 1fr); }
  .dashboard-primary { grid-template-columns: minmax(0, 1fr); }
  .dashboard-primary .limit-card { display: grid; grid-template-columns: 1fr 1fr; column-gap: 30px; }
  .dashboard-primary .limit-card .card-header { grid-column: 1 / -1; margin-bottom: 15px; }
  .dashboard-primary .limit-card .limit-value { grid-column: 1; grid-row: 2; }
  .dashboard-primary .limit-card .limit-value + .muted { grid-column: 1; grid-row: 3; }
  .dashboard-primary .limit-card .limit-track { grid-column: 2; grid-row: 2; align-self: center; }
  .dashboard-primary .limit-card .limit-meta { grid-column: 2; grid-row: 3; }
  .dashboard-primary .limit-card .limit-note { grid-column: 1 / -1; margin: 15px 0 10px; }
  .dashboard-primary .limit-card > .text-link { grid-column: 1 / -1; }
  .dashboard-grid > .card:last-child { min-height: 220px; }
  .limit-footer { padding-top: 16px; }
  .quick-action { font-size: 11px; }
  .document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compact-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .compact-stats .stat-card { padding: 17px; }
  .compact-stats .stat-value { font-size: 23px; }
  .business-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 155px minmax(0, 1fr); gap: 17px; }
  .settings-nav button, .settings-nav a { padding: 11px; font-size: 11px; }
  .auth-aside { padding: 40px; }
  .auth-shell { grid-template-columns: 43% 1fr; }
  .auth-aside h1 { font-size: 35px; }
  .auth-card > h2 { font-size: 25px; }
  .page-header { flex-wrap: wrap; }
}
@media (max-width: 780px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  .main-shell { margin-left: 0; }
  .topbar { height: 69px; padding: 0 22px; }
  .mobile-brand { display: inline-flex; padding: 0; font-size: 20px; }
  .mobile-brand .logo-mark { width: 30px; height: 30px; border-radius: 8px; }
  .mobile-brand > span { color: var(--primary); }
  .topbar-title > .breadcrumbs { display: none; }
  .breadcrumbs { font-size: 11px; }
  .topbar-actions { gap: 7px; }
  .topbar-company > div:not(.avatar), .topbar-actions > .divider { display: none; }
  .page-content { padding: 26px 22px 104px; }
  .page-header { margin-bottom: 24px; }
  .page-header h1 { font-size: 25px; }
  .page-header p { font-size: 11px; }
  .page-header > .row { gap: 8px; }
  .page-header .btn { padding: 10px 12px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .stats-grid { margin-bottom: 20px; }
  .stat-label { font-size: 11px; }
  .stat-note { font-size: 10px; }
  .stat-value { font-size: 27px; }
  .dashboard-grid, .dashboard-bottom { gap: 20px; }
  .dashboard-primary { gap: 20px; }
  .dashboard-bottom { margin-top: 20px; }
  .main-footer { display: none; }
  .quick-section .quick-action { min-height: 143px; }
  .bottom-nav { display: flex; align-items: center; justify-content: space-around; position: fixed; z-index: 50; inset: auto 0 0; min-height: 71px; padding: 8px 9px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 6px 8px; min-width: 55px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 9px; }
  .bottom-nav svg { width: 20px; height: 20px; }
  .bottom-nav .active { color: var(--primary-ink); background: var(--primary-soft); }
  .fab { position: fixed; right: 20px; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 45; display: grid; place-items: center; width: 47px; height: 47px; border: 0; border-radius: 15px; color: white; background: var(--primary); box-shadow: 0 5px 16px #678fff4d; }
  .fab svg { width: 23px; height: 23px; }
  .toast-wrap { left: 18px; right: 18px; bottom: 88px; align-items: center; }
  .toast { max-width: 100%; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); gap: 21px; }
  .integration-list { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .settings-nav button, .settings-nav a { white-space: nowrap; padding: 10px 13px; }
  .assistant-shell { min-height: calc(100dvh - 270px); }
  .assistant-intro { margin-top: 13px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main { min-height: 100dvh; padding: 45px 25px; }
  .auth-card > .brand { display: inline-flex; padding: 0; margin-bottom: 40px; font-size: 23px; }
  .auth-card { max-width: 400px; }
  .auth-mobile-brand { display: block; margin-bottom: 36px; }
  .auth-mobile-brand .brand { padding: 0; }
  .auth-version { bottom: 15px; }
  .auth-card > h2 { font-size: 27px; }
}
@media (max-width: 520px) {
  .topbar { height: 65px; padding: 0 17px; }
  .breadcrumbs { gap: 7px; }
  .breadcrumbs > span:first-child { display: none; }
  .topbar-actions { gap: 3px; }
  .topbar-actions .avatar { width: 31px; height: 31px; margin-left: 5px; }
  .page-content { padding: 24px 16px 105px; }
  .page-header { align-items: flex-start; gap: 14px; flex-wrap: wrap; }
  .page-header h1 { font-size: 25px; }
  .page-header > .row { width: 100%; }
  .page-header > .row .btn { flex: 1; }
  .page-header > .row .month-control { flex: 1 1 100%; }
  .month-control input { width: 100% !important; }
  .page-header > .btn { margin-top: 2px; min-height: 35px; font-size: 10px; padding: 9px 12px; }
  .stats-grid { gap: 10px; }
  .compact-stats { grid-template-columns: minmax(0, 1fr); }
  .compact-stats .stat-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; padding: 17px; }
  .compact-stats .stat-card > .row { grid-column: 1; grid-row: 1; flex-direction: row-reverse; justify-content: flex-end; gap: 10px; margin: 0; }
  .compact-stats .stat-value { grid-column: 2; grid-row: 1; font-size: 23px; margin: 0; align-self: center; }
  .compact-stats .stat-note { grid-column: 1 / -1; margin-top: 10px; font-size: 9px; }
  .stat-card { padding: 15px; border-radius: 12px; }
  .stat-card > .row:first-child { margin-bottom: 11px; gap: 5px; }
  .stat-icon { width: 28px; height: 28px; border-radius: 8px; }
  .stat-icon svg { width: 15px; height: 15px; }
  .stat-label { font-size: 10px; }
  .stat-value { font-size: 23px; letter-spacing: -.055em; margin-bottom: 6px; }
  .stat-note { font-size: 9px; gap: 4px; }
  .stat-note .badge { font-size: 8px; padding: 3px 5px; }
  .card { padding: 18px; border-radius: 12px; }
  .card-header { gap: 10px; margin-bottom: 20px; }
  .card-header h2, .section-title { font-size: 13px; }
  .card-header p { font-size: 10px; }
  .card-header .btn { font-size: 10px; padding: 7px 9px; }
  .chart-bars { height: 205px; padding-left: 18px; gap: 5px; }
  .bar-group { gap: 4px; }
  .bar { width: 13px; max-width: 28%; }
  .chart-label { font-size: 9px; }
  .chart-summary { gap: 22px; }
  .chart-summary strong { font-size: 17px; }
  .chart-legend { gap: 10px; font-size: 9px; }
  .cashflow-card .card-header { flex-wrap: wrap; }
  .cashflow-card .chart-legend { margin-top: 2px; }
  .dashboard-primary .limit-card { display: flex; }
  .dashboard-primary .limit-card .card-header { margin-bottom: 22px; }
  .dashboard-primary .limit-card .limit-track { align-self: auto; }
  .dashboard-primary .limit-card .limit-note { margin: 17px 0; }
  .quick-section { margin-top: 25px; }
  .quick-section > .section-title > span { font-size: 9px; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .quick-action { min-height: 90px; font-size: 11px; }
  .quick-section .quick-action { min-height: 140px; padding: 16px; }
  .quick-action strong { font-size: 11px; }
  .quick-action > span:not(.quick-icon) { font-size: 10px; }
  .activity-item > .muted { font-size: 8px; }
  .activity-item .item-main strong { font-size: 10px; overflow-wrap: anywhere; }
  .activity-item .item-main p { font-size: 9px; }
  .toolbar { gap: 12px; }
  .toolbar > .search-field { width: 100%; min-width: 0; }
  .toolbar > .row { width: 100%; flex-wrap: wrap; }
  .toolbar > .row > select, .toolbar > .row > .btn { flex: 1; min-width: 0; }
  .tabs { max-width: 100%; overflow-x: auto; }
  .tab { padding: 8px 11px; font-size: 11px; }
  .data-table { min-width: 570px; }
  .data-table th, .data-table td { padding-left: 10px; padding-right: 10px; }
  .table-footer { align-items: flex-start; font-size: 9px; gap: 9px; }
  .grid-3, .document-grid { grid-template-columns: minmax(0, 1fr); }
  .document-card { padding: 19px; }
  .document-card > .row:first-child { margin-bottom: 14px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .form-actions { margin-top: 22px; }
  .form-actions .btn { flex: 1; }
  .modal-overlay { padding: 13px; }
  .modal { max-height: calc(100dvh - 26px); border-radius: 14px; }
  .modal-header { padding: 20px 20px 17px; }
  .modal-header h2 { font-size: 18px; }
  .modal-body { padding: 20px; }
  .modal-footer { padding: 16px 20px; }
  .modal-footer > .btn { flex: 1; }
  .fiscal-modal .modal-footer { flex-wrap: wrap; }
  .fiscal-modal .modal-footer > .btn { flex: 1 1 100%; }
  .fiscal-connection { align-items: flex-start; flex-direction: column; gap: 15px; }
  .fiscal-connection > .btn { width: 100%; }
  .fiscal-review .details-list > div { flex-direction: column; gap: 3px; }
  .fiscal-review .details-list dd { width: 100%; }
  .fiscal-actions { gap: 8px; }
  .fiscal-actions .btn { flex: 1 1 auto; }
  .item-row { gap: 10px; flex-wrap: wrap; }
  .item-row > .item-main { min-width: calc(100% - 65px); }
  .item-actions { margin-left: auto; }
  .integration-card { padding: 19px; gap: 12px; flex-wrap: wrap; }
  .integration-card > div:not(.integration-logo) { flex: 1; min-width: 150px; }
  .integration-card .btn { margin-left: 55px; }
  .business-banner { padding: 20px; gap: 15px; flex-wrap: wrap; }
  .business-emblem { width: 47px; height: 47px; border-radius: 12px; }
  .business-emblem svg { width: 24px; height: 24px; }
  .business-banner h2 { font-size: 19px; }
  .business-banner > div:nth-child(2) { min-width: 0; flex: 1; }
  .business-banner p { font-size: 10px; overflow-wrap: anywhere; }
  .business-banner .btn { padding-left: 0; margin-left: 62px; }
  .business-grid { gap: 12px; }
  .business-card { padding: 17px; min-height: 185px; }
  .business-card h2 { font-size: 13px; }
  .business-card p { font-size: 10px; }
  .business-card-arrow { top: 27px; right: 17px; }
  .business-card-arrow svg { width: 14px; height: 14px; }
  .visucio-card { flex-direction: column; align-items: flex-start; gap: 17px; }
  .visucio-card h2 { font-size: 17px; }
  .alert { padding: 13px; gap: 9px; font-size: 11px; }
  .alert strong { font-size: 11px; }
  .alert .btn { margin-left: 0; }
  .assistant-intro { margin: 13px auto 27px; }
  .assistant-intro h2 { font-size: 23px; }
  .assistant-intro h1 { font-size: 23px; }
  .assistant-intro p { font-size: 11px; }
  .assistant-suggestions { gap: 10px; }
  #assistant-suggestions { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #assistant-suggestions .suggestion { flex-direction: row; font-size: 11px; padding: 13px 15px; }
  .suggestion { padding: 14px; gap: 8px; flex-direction: column; font-size: 11px; }
  .suggestion strong { font-size: 11px; }
  .suggestion small { font-size: 9px; }
  .chat-message { max-width: 92%; padding: 13px 15px; font-size: 12px; }
  .chat-message.assistant { gap: 9px; }
  .chat-avatar { width: 24px; height: 24px; border-radius: 7px; }
  .chat-avatar svg { width: 14px; height: 14px; }
  .assistant-input { padding-left: 13px; }
  .assistant-disclaimer { font-size: 9px; }
  .assistant-note { font-size: 8px; }
  .details-list > div { gap: 13px; font-size: 10px; }
  .details-list dd { width: 54%; }
  .integration-card > div.item-main { min-width: 0; }
  .auth-main { padding-top: 35px; padding-bottom: 35px; }
}
@media (max-width: 370px) {
  .stats-grid:not(.compact-stats) { grid-template-columns: minmax(0, 1fr); }
  .stats-grid:not(.compact-stats) .stat-card { padding: 17px 20px; }
  .stats-grid:not(.compact-stats) .stat-value { font-size: 27px; }
  .quick-section > .section-title > span { display: none; }
  .business-grid { grid-template-columns: minmax(0, 1fr); }
  .business-card { min-height: 168px; }
  .compact-stats .stat-value { font-size: 21px; }
  .assistant-suggestions { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .topbar, .bottom-nav, .fab, .toast-wrap, .toolbar, .page-header > .row, .item-actions { display: none !important; }
  .main-shell { margin-left: 0; }
  .page-content { padding: 0; max-width: none; }
  body { background: white; color: black; font-size: 11px; }
  .card, .stat-card { break-inside: avoid; box-shadow: none; }
  .data-table { min-width: 0; }
}

/* CRM, agenda e cobrança integrada — 1.2 */
.crm-workspace { min-width: 0; }
.crm-workspace > .toolbar { margin-bottom: 20px; }
.crm-board { display: grid; grid-template-columns: repeat(5,minmax(225px,1fr)); gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: start; }
.crm-column { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); min-height: 300px; }
.crm-column > header { display:flex; align-items:center; gap:8px; padding:16px 12px; border-bottom:1px solid var(--line); }
.crm-column > header h2 { flex:1; font-size:12px; margin:0; }
.crm-column > header > span:last-child { background:var(--surface); border:1px solid var(--line); border-radius:6px; padding:2px 6px; font-size:11px; }
.crm-stage-dot { height:8px; width:8px; border-radius:50%; background:var(--primary); }
.crm-stage-dot.contacted { background:var(--purple); }
.crm-stage-dot.proposal { background:var(--orange); }
.crm-stage-dot.won { background:var(--green); }
.crm-stage-dot.lost { background:var(--muted); }
.crm-column-body { display:grid; gap:10px; padding:10px; }
.crm-column-empty { margin:18px 12px; color:var(--muted); text-align:center; font-size:12px; line-height:1.7; }
.crm-contact { background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:12px; box-shadow:var(--shadow); }
.crm-contact-title { display:flex; align-items:center; gap:9px; border:0; padding:0; background:transparent; text-align:left; width:100%; color:var(--ink); }
.crm-contact-title .avatar { height:30px; width:30px; min-width:30px; font-size:10px; }
.crm-contact-title > span:nth-child(2) { min-width:0; flex:1; }
.crm-contact-title strong { display:block; font-size:12px; line-height:1.45; overflow-wrap:anywhere; }
.crm-contact-title small { display:block; color:var(--muted); font-size:10px; margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:150px; }
.crm-contact-title > svg { width:13px; flex-shrink:0; }
.crm-tags { display:flex; flex-wrap:wrap; gap:5px; margin-top:12px; }
.crm-tags .badge { font-size:9px; padding:3px 6px; }
.crm-contact-meta { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:15px; font-size:10px; }
.crm-contact-meta > span { display:flex; align-items:center; gap:4px; color:var(--muted); }
.crm-contact-meta svg { width:12px; height:12px; }
.crm-contact-meta .text-danger,.text-danger { color:var(--red); }
.crm-stage-select { display:block; margin-top:12px; }
.crm-stage-select select { padding:7px 9px; font-size:10px; color:var(--ink-secondary); background:var(--surface-soft); }
.crm-detail-heading { display:flex; gap:12px; flex-wrap:wrap; align-items:center; margin-bottom:24px; }
.crm-detail-heading .crm-tags { margin:0; }
.crm-detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:28px; }
.crm-detail-grid > * { min-width:0; }
.crm-detail-grid .details-list > div { grid-template-columns:100px 1fr; }
.crm-notes { white-space:pre-wrap; overflow-wrap:anywhere; padding:16px; border-radius:10px; background:var(--surface-soft); color:var(--ink-secondary); }
.crm-timeline { list-style:none; margin:0; padding:0; max-height:410px; overflow:auto; }
.crm-timeline li { display:flex; gap:12px; padding:0 0 21px; position:relative; }
.crm-timeline li > .activity-icon { flex:0 0 30px; height:30px; width:30px; z-index:1; }
.crm-timeline li:not(:last-child):before { content:''; position:absolute; height:100%; left:14px; top:10px; width:1px; background:var(--line-strong); }
.crm-timeline li > div { min-width:0; }
.crm-timeline p { font-size:12px; margin:5px 0; overflow-wrap:anywhere; color:var(--ink-secondary); }
.crm-timeline small { font-size:10px; color:var(--muted); }
.crm-timeline strong { font-size:12px; }
.crm-related-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); border-top:1px solid var(--line); margin-top:24px; padding-top:24px; gap:20px; }
.crm-related { min-width:0; }
.crm-related h3 { display:flex; align-items:center; gap:8px; }
.crm-related h3 > span { color:var(--muted); font-size:11px; }
.crm-related .item-row { flex-wrap:wrap; }
.crm-related .item-row strong { font-size:12px; }
.crm-related .item-row small { display:block; color:var(--muted); margin-top:5px; }
.crm-related .item-row .btn { white-space:nowrap; }
.agenda-share { display:flex; align-items:center; gap:18px; margin-bottom:24px; background:linear-gradient(115deg,var(--primary-soft),var(--surface) 75%); }
.agenda-share > .quick-icon { flex-shrink:0; }
.agenda-share .item-main { min-width:0; }
.agenda-share h2 { font-size:16px; }
.agenda-share p { font-size:12px; line-height:1.65; }
.booking-public-url { overflow-wrap:anywhere; font-size:11px; }
.agenda-date { width:144px; padding:8px; }
.chevron-back { transform:rotate(180deg); }
.agenda-list { display:grid; gap:0; }
.agenda-event { display:flex; align-items:center; gap:22px; padding:23px 2px; border-top:1px solid var(--line); }
.agenda-event-time { width:82px; flex-shrink:0; position:relative; padding-right:16px; border-right:3px solid var(--primary); }
.agenda-event-time strong { font-size:18px; display:block; letter-spacing:-.03em; }
.agenda-event-time small { display:block; font-size:10px; margin-top:3px; color:var(--muted); }
.agenda-event h3 { margin:0; font-size:14px; }
.agenda-event p { font-size:12px; margin:6px 0; }
.agenda-event small { color:var(--muted); }
.agenda-event .item-main { min-width:0; }
.agenda-block .agenda-event-time { border-color:var(--muted); }
.agenda-cancelled .agenda-event-time { border-color:var(--line-strong); }
.agenda-cancelled { opacity:.7; }
.booking-weekly { display:grid; gap:10px; }
.booking-weekday { display:grid; grid-template-columns:minmax(140px,1fr) 105px auto 105px; align-items:center; gap:12px; }
.booking-weekday input[type="time"] { padding:9px; min-width:0; }
.booking-weekday > span { color:var(--muted); font-size:11px; }
.booking-service-row { display:flex; justify-content:space-between; gap:20px; align-items:center; padding:12px 0; border-bottom:1px solid var(--line); }
.booking-service-row:last-child { border-bottom:0; }
.booking-service-row > .form-field { max-width:100px; flex-shrink:0; }
.booking-service-row .check-field small,.billing-option small,.stack > .check-field small { display:block; color:var(--muted); font-size:11px; margin-top:5px; line-height:1.65; }
.booking-status-actions { padding-top:20px; border-top:1px solid var(--line); }
.billing-option { padding:18px; border:1px solid var(--line-strong); border-radius:12px; background:var(--surface-soft); }
.billing-review-payment { padding:20px; border-radius:12px; background:var(--primary-soft); }
.billing-result-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.billing-result-card { padding:20px; border:1px solid var(--line); border-radius:14px; background:var(--surface-soft); }
.billing-result-card > .quick-icon { margin-bottom:14px; }
.billing-result-card h3 { margin:0 0 14px; }
.billing-result-card p { color:var(--ink-secondary); font-size:12px; line-height:1.7; }
.billing-result-card > small { color:var(--muted); }
.billing-amount { display:block; font-size:27px; margin-top:18px; letter-spacing:-.04em; }
.visupay-connection-state { margin-top:20px; padding-top:20px; border-top:1px solid var(--line); }
@media(min-width:1380px) { .crm-board { grid-template-columns:repeat(5,minmax(0,1fr)); } }
@media(max-width:1100px) { .crm-board { grid-template-columns:repeat(5,235px); } .agenda-share { flex-wrap:wrap; } }
@media(max-width:760px) { .crm-detail-grid,.crm-related-grid { grid-template-columns:1fr; } .crm-related-grid { gap:22px; } .crm-detail-grid { gap:26px; } .bottom-nav a { min-width:0; flex:1; padding:6px 3px; } .agenda-share > .row { width:100%; } .agenda-share > .quick-icon { display:none; } }
@media(max-width:520px) { .crm-workspace > .toolbar { gap:14px; align-items:stretch; } .crm-board { grid-template-columns:repeat(5,255px); } .crm-workspace .search-field { width:100%; } .crm-detail-grid .details-list > div { grid-template-columns:100px 1fr; } .agenda-event { flex-wrap:wrap; gap:14px; } .agenda-event > .btn { margin-left:96px; } .agenda-event > .item-main { flex-basis:calc(100% - 100px); } .agenda-event-time { width:80px; } .agenda-event .badge { font-size:9px; } .agenda-share { padding:18px; } .agenda-share .badge { margin-top:6px; } .booking-weekday { grid-template-columns:1fr 90px auto 90px; gap:7px; } .booking-weekday .check-field { font-size:10px; gap:6px; } .booking-weekday input[type="time"] { font-size:11px; padding:8px 4px; } .booking-weekday input[type="checkbox"] { width:15px; height:15px; } .booking-weekday > span { font-size:9px; } .billing-result-grid { grid-template-columns:1fr; } .billing-result-card { padding:18px; } .billing-review-payment { padding:15px; } }

@media(max-width:520px) { .agenda-controls { width:100%; flex-wrap:wrap; } .agenda-controls .agenda-date { flex:1; min-width:0; } .toolbar > .agenda-controls > [data-action="booking-block"] { flex:1 0 100%; } .agenda-event .item-main > .row,.agenda-share .item-main > .row,.modal-body .row { flex-wrap:wrap; } .modal-footer { flex-wrap:wrap; } .toolbar .tabs { max-width:100%; overflow-x:auto; } }
