/* Clar Financiar — local design system. No external fonts or UI dependencies. */
:root {
  --canvas: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f8f9fb;
  --ink: #19212f;
  --muted: #687180;
  --line: #e6e9ef;
  --navy: #141c2b;
  --navy-soft: #1c2739;
  --teal: #087f75;
  --teal-dark: #06665f;
  --teal-soft: #e6f5f1;
  --mint: #9ae6ce;
  --violet: #6553b9;
  --violet-soft: #f0ecfb;
  --ok: #19764b;
  --warn: #936006;
  --bad: #b43846;
  --red: #087f75;
  --gray: #687180;
  --bg: #f5f6f8;
  --card: #fff;
  --text: #19212f;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(23, 34, 52, .035);
  --sidebar-width: 252px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
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: .58; }
button, select { touch-action: manipulation; }
img, svg { vertical-align: middle; }
.icon { width: 20px; height: 20px; flex-shrink: 0; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 4px; }
[hidden], .hide { 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; }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; transform: translateY(-180%); padding: 12px 18px; background: #fff; color: var(--navy); border-radius: 9px; box-shadow: var(--shadow); }
.skip-link:focus { transform: none; }
.app-layout { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.app-sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; color: #cad3e0; background: var(--navy); padding: 26px 16px 16px; z-index: 40; }
.sidebar-heading { display: flex; align-items: center; gap: 6px; padding: 0 6px 30px; }
.app-brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; font-size: 18px; line-height: 1.25; letter-spacing: -.5px; font-weight: 750; }
.app-brand small { display: block; margin-top: 5px; color: #a9b6ca; font-size: 9px; font-weight: 500; letter-spacing: .15px; }
.brand-symbol { display: inline-flex; width: 38px; height: 38px; justify-content: center; align-items: center; flex-shrink: 0; color: var(--navy); background: var(--mint); border-radius: 11px; }
.brand-symbol .icon { width: 23px; height: 23px; stroke-width: 2; }
.sidebar-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3a4658 transparent; flex: 1; }
.sidebar-section-label { margin: 0 14px 12px; color: #8998ae; font-size: 9px; letter-spacing: 1.6px; font-weight: 750; }
.sidebar-nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 45px; padding: 10px 14px; color: #bac7d8; border: 1px solid transparent; border-radius: 10px; text-decoration: none; font-weight: 550; font-size: 12px; transition: color .15s, background .15s; }
.nav-link .icon { width: 18px; height: 18px; color: #9aaac1; }
.nav-link:hover { background: #202c3d; color: #fff; }
.nav-link.is-active { background: #273a3e; border-color: #334c4d; color: #b4f0db; }
.nav-link.is-active .icon { color: #9fe7d0; }
.nav-active-dot { width: 5px; height: 5px; margin-left: auto; border-radius: 100%; background: #a0e7cf; }
.company-section-label { margin-top: 31px; }
.sidebar-company { display: flex; align-items: flex-start; gap: 10px; margin: 0 14px 16px; color: #f5f7fa; font-size: 12px; font-weight: 650; }
.sidebar-company > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.sidebar-company small { display: block; margin-top: 4px; color: #95a5bd; font-weight: 450; font-size: 10px; }
.company-dot { width: 7px; height: 7px; background: var(--mint); margin-top: 6px; border-radius: 50%; flex-shrink: 0; }
.sidebar-note { position: relative; overflow: hidden; margin: 35px 6px 22px; border: 1px solid #344057; background: #202c40; border-radius: 14px; padding: 17px; }
.sidebar-note::after { content: ""; position: absolute; pointer-events: none; width: 100px; height: 100px; right: -50px; bottom: -50px; border: 15px solid #344260; border-radius: 50%; opacity: .6; }
.sidebar-note-icon { display: flex; color: #b7a7ef; margin-bottom: 10px; }
.sidebar-note strong { font-weight: 650; font-size: 14px; color: #f6f7fc; line-height: 1.5; }
.sidebar-note p { color: #a9b7cd; font-size: 11px; line-height: 1.6; margin: 9px 0 0; }
.sidebar-bottom { border-top: 1px solid #2c3648; padding-top: 16px; margin-top: 10px; }
.sidebar-profile { display: flex; align-items: center; gap: 10px; padding: 0 7px; text-decoration: none; color: #eaf0f8; }
.sidebar-profile > .icon { width: 15px; height: 15px; color: #8f9bb0; }
.user-avatar, .topbar-avatar { width: 37px; height: 37px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: #eee9fc; color: #5a4899; border-radius: 12px; font-size: 11px; font-weight: 750; text-decoration: none; }
.profile-copy { flex: 1; min-width: 0; }
.profile-copy strong { display: block; font-size: 11px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { display: block; margin-top: 2px; font-size: 10px; color: #94a4bc; }
.logout-form { margin-top: 12px; }
.sidebar-logout { display: flex; align-items: center; justify-content: flex-start; gap: 11px; padding: 9px 11px; width: 100%; background: none; border: 0; color: #aab7ca; border-radius: 8px; font-size: 11px; }
.sidebar-logout:hover { color: #fff; background: #222d40; }
.sidebar-logout .icon { width: 17px; height: 17px; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-topbar { min-height: 83px; display: flex; justify-content: space-between; align-items: center; gap: 20px; background: #fff; border-bottom: 1px solid var(--line); padding: 18px 34px; }
.topbar-leading, .topbar-context { display: flex; gap: 16px; align-items: center; min-width: 0; }
.topbar-location { display: flex; gap: 11px; align-items: center; min-width: 0; }
.topbar-symbol { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; color: #667183; }
.topbar-location > span:last-child { min-width: 0; }
.topbar-location small { display: block; color: #7c8593; font-size: 8px; font-weight: 750; letter-spacing: 1.2px; }
.topbar-location strong { display: block; color: #293143; font-size: 12px; font-weight: 650; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.period-badge { display: inline-flex; align-items: center; gap: 8px; color: #566071; font-size: 11px; white-space: nowrap; }
.period-badge .icon { width: 16px; height: 16px; }
.company-switcher { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding-right: 4px; }
.company-switcher select { max-width: 215px; border: 0; box-shadow: none; padding: 9px 8px 9px 12px; color: #374153; font-size: 11px; background-color: transparent; }
.company-switcher select:focus { box-shadow: none; }
.company-switcher .icon-button { width: 29px; height: 29px; background: var(--surface-soft); }
.topbar-avatar { width: 33px; height: 33px; border-radius: 50%; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 7px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); }
.icon-button:hover { background: #f0f3f6; color: var(--ink); }
.sidebar-toggle, .sidebar-close, .sidebar-scrim { display: none; }
.page-content { width: 100%; max-width: 1640px; margin: 0 auto; padding: 31px 34px 34px; flex: 1; min-width: 0; }
.page-content:focus { outline: none; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 0 0 25px; }
.page-header h1, .page-title h1 { margin: 3px 0 7px; font-size: clamp(25px, 2.5vw, 35px); line-height: 1.2; letter-spacing: -1.1px; font-weight: 760; }
.page-header p, .page-title p { margin: 6px 0 0; max-width: 650px; color: var(--muted); font-size: 12px; }
.page-header > .toolbar { justify-content: flex-end; flex-shrink: 0; margin-top: 4px; }
.eyebrow { color: var(--teal); font-size: 9px; font-weight: 750; letter-spacing: 1.6px; text-transform: uppercase; }
h2 { margin: 0 0 12px; font-size: 17px; line-height: 1.4; letter-spacing: -.35px; font-weight: 700; }
h3 { margin: 0 0 10px; font-size: 14px; font-weight: 650; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small, small { font-size: 11px; }
.amount, .number, .numeric { font-variant-numeric: tabular-nums; }
.amount { letter-spacing: -.5px; font-weight: 700; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.ok, .positive { color: var(--ok); }
.warn { color: var(--warn); }
.bad, .negative { color: var(--bad); }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: grid; gap: 20px; }
.stack > :last-child { margin-bottom: 0; }
.card { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.grid > .card, .stack > .card { margin-top: 0; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.card-header h2, .card-header h3 { margin-bottom: 4px; }
.card-header p { margin: 0; color: var(--muted); font-size: 11px; }
.card-header .icon { width: 17px; height: 17px; }
.card-link { color: var(--teal); font-weight: 650; text-decoration: none; font-size: 11px; white-space: nowrap; }
.card-link:hover { text-decoration: underline; }
.card.inset { background: var(--surface-soft); box-shadow: none; }
.card.accent { background: var(--teal-soft); border-color: #cce4dc; }
.card.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.card.dark .muted { color: #acb7c9; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr)); gap: 17px; margin-bottom: 25px; }
.stat-card { position: relative; min-width: 0; overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.stat-card .stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; background: var(--surface-soft); color: var(--teal); border: 1px solid var(--line); border-radius: 10px; }
.stat-card .stat-icon .icon { width: 17px; height: 17px; }
.stat-card > span, .stat-label { display: block; font-size: 11px; color: var(--muted); font-weight: 550; }
.stat-card strong, .stat-value { display: block; font-size: clamp(25px, 2.7vw, 37px); line-height: 1.2; letter-spacing: -1.4px; font-weight: 750; margin: 13px 0 7px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-card small, .stat-meta { color: var(--muted); font-size: 10px; }
.stat-card.highlight { background: #e9f4ef; border-color: #d5e8df; }
.stat-card.violet { background: #f1eef9; border-color: #e6e0f2; }
.stat-card.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.stat-card.dark > span, .stat-card.dark small, .stat-card.dark .stat-label { color: #b8c6d7; }
.stat-trend { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: var(--ok); font-weight: 600; }
.welcome-banner, .dashboard-hero { position: relative; overflow: hidden; padding: 28px; background: #e8f3ef; border: 1px solid #d6e7df; border-radius: 18px; margin-bottom: 24px; }
.welcome-banner h2, .dashboard-hero h2 { font-size: 25px; letter-spacing: -.8px; margin: 5px 0 9px; }
.welcome-banner p, .dashboard-hero p { max-width: 610px; color: #50685f; font-size: 12px; }
.welcome-banner::after, .dashboard-hero::after { content: ""; pointer-events: none; position: absolute; right: -35px; bottom: -80px; width: 240px; height: 240px; border: 45px solid rgba(8, 127, 117, .06); border-radius: 50%; }
.button, .btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 39px; padding: 10px 15px; border: 1px solid #dce1e8; border-radius: 9px; background: #fff; color: #374153; text-decoration: none; font-size: 11px; line-height: 1.4; font-weight: 650; cursor: pointer; box-shadow: 0 1px 2px rgba(20, 30, 45, .02); transition: background .15s, border-color .15s, box-shadow .15s; }
.button:hover, .btn:hover { background: #f7f9fa; border-color: #cbd3dd; }
.button.primary, .btn:not(.ghost):not(.secondary) { background: var(--teal); border-color: var(--teal); color: #fff; }
.button.primary:hover, .btn:not(.ghost):not(.secondary):hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.button.secondary, .btn.secondary { background: var(--violet-soft); border-color: #e3dcf5; color: #59439c; }
.button.secondary:hover, .btn.secondary:hover { background: #e7dff8; border-color: #d4c9ec; }
.button.danger { color: #a62b3a; border-color: #efc9ce; background: #fff6f6; }
.button.danger:hover { background: #fde8ec; border-color: #e7aeb6; }
.button.small, .btn.small { padding: 6px 10px; min-height: 30px; font-size: 10px; border-radius: 7px; gap: 6px; }
.button.small .icon, .btn.small .icon { width: 14px; height: 14px; }
.button .icon, .btn .icon { width: 16px; height: 16px; }
.button.block { width: 100%; }
.button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.toolbar, .actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.inline-form { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; }
.inline-form input:not([type="hidden"]), .inline-form select { width: auto; }
form { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, label.field > span:first-child, .field-label { display: block; font-weight: 600; color: #414b5c; font-size: 11px; }
.form-grid > label { display: flex; flex-direction: column; gap: 7px; font-size: 11px; color: #414b5c; font-weight: 600; }
.field > small, .field-help, .form-help { font-size: 10px; font-weight: 400; color: var(--muted); line-height: 1.5; margin: 0; }
.field-error { color: var(--bad); font-size: 11px; }
.span-all, .form-grid .full { grid-column: 1 / -1; }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), select, textarea { width: 100%; min-width: 0; min-height: 42px; padding: 10px 12px; border: 1px solid #dce1e8; border-radius: 9px; background: #fff; color: #273346; font-size: 12px; line-height: 1.55; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #8a94a2; opacity: 1; }
input:not([type="hidden"]):focus, select:focus, textarea:focus { border-color: #3c958d; box-shadow: 0 0 0 3px #d5eee7; outline: none; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
input[readonly], input:disabled, select:disabled { background: #f4f5f7; color: #697385; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--teal); flex-shrink: 0; }
input[type="file"] { font-size: 11px !important; padding: 7px !important; }
input[type="file"]::file-selector-button { padding: 7px 10px; color: #3c4758; background: #f0f3f6; border: 0; border-radius: 5px; margin-right: 9px; cursor: pointer; font: inherit; }
textarea { min-height: 108px; resize: vertical; }
select[multiple] { min-height: 150px; }
select option { padding: 7px; }
.choice, .checkbox-row { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; color: #4f5b6b; }
.checkbox-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.checkbox-list label { display: flex; align-items: center; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; font-size: 12px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 4px; }
.table-scroll { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 12px; overscroll-behavior-x: contain; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 12px 16px; text-align: left; font-weight: 600; font-size: 10px; color: #788291; white-space: nowrap; background: #f8f9fb; border-bottom: 1px solid var(--line); }
.data-table td { padding: 17px 16px; border-bottom: 1px solid #edf0f3; vertical-align: middle; color: #455163; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfd; }
.data-table td strong { color: #263044; font-weight: 650; }
.data-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.data-table td.num, .data-table th.num, .data-table .numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; font-size: 9px; line-height: 1.35; font-weight: 650; color: #687180; background: #f0f2f5; border: 1px solid #e4e7ed; border-radius: 6px; white-space: nowrap; }
.badge.success { color: #1b704b; background: #edf8f0; border-color: #d8ecde; }
.badge.warning { color: #8d5c07; background: #fff7e8; border-color: #f4e6c5; }
.badge.danger { color: #a43342; background: #fdf0f2; border-color: #f3d5db; }
.badge.violet { color: #6549a7; background: #f2edfc; border-color: #e8dff8; }
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border: 1px solid #d5e5ed; border-radius: 11px; margin-bottom: 20px; background: #f0f7fa; color: #3a6279; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.alert .icon { width: 17px; height: 17px; margin-top: 2px; }
.alert.error { background: #fff2f3; border-color: #f2d4d9; color: #a53243; }
.alert.success { background: #eef8f2; border-color: #d1eada; color: #26754d; }
.alert.warning { background: #fff8ea; border-color: #f0e0bb; color: #89610f; }
.alert p:last-child { margin-bottom: 0; }
.empty-state { padding: 45px 24px; text-align: center; border: 1px dashed #dce2e9; border-radius: 13px; background: #fbfcfd; color: var(--muted); }
.empty-state > .icon { width: 33px; height: 33px; color: #9aabb9; margin-bottom: 14px; }
.empty-state h2, .empty-state h3, .empty-state strong { color: #39465a; }
.empty-state p { max-width: 450px; margin: 9px auto 18px; font-size: 12px; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: #7a8493; font-size: 11px; }
.breadcrumbs a { text-decoration: none; color: #687687; }
.breadcrumbs .icon { width: 13px; height: 13px; }
.steps { display: flex; align-items: flex-start; gap: 22px; margin-bottom: 24px; counter-reset: step; }
.step { display: flex; align-items: center; gap: 8px; color: #7e8896; font-size: 11px; }
.step::before { counter-increment: step; content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; background: #eef0f5; border: 1px solid #e0e5eb; border-radius: 50%; font-size: 10px; font-weight: 650; }
.step.active { color: var(--teal); font-weight: 650; }
.step.active::before { background: var(--teal-soft); border-color: #c2ded5; }
.chart-box { min-height: 290px; position: relative; }
.chart-box canvas { max-height: 360px; }
.comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.comparison-diff.pos { color: var(--ok); }
.comparison-diff.neg { color: var(--bad); }
.app-footer { display: flex; justify-content: space-between; gap: 20px; padding: 0 34px 24px; max-width: 1640px; width: 100%; margin: 0 auto; color: #929aa5; font-size: 9px; }
.app-footer > span:first-child { color: #7e8896; font-weight: 600; }
/* Authentication keeps the same product identity without remote illustrations. */
.auth-layout { display: grid; grid-template-columns: 49% 51%; min-height: 100vh; min-height: 100dvh; }
.auth-story { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; color: #fff; padding: 40px 48px 25px; background: var(--navy); }
.auth-story::after { content: ""; pointer-events: none; position: absolute; width: 500px; height: 500px; border: 90px solid #1a2b35; border-radius: 50%; bottom: -270px; right: -270px; opacity: .6; }
.auth-story-content { padding: 72px 0 30px; max-width: 520px; margin: auto; position: relative; z-index: 1; }
.auth-story .eyebrow { color: #9cdbc7; font-size: 9px; letter-spacing: 1.8px; }
.auth-story h1 { font-size: clamp(32px, 3.6vw, 55px); line-height: 1.13; letter-spacing: -2px; margin: 17px 0 20px; font-weight: 700; }
.auth-story h1 em { font-style: normal; color: #a5e5cd; }
.auth-story-content > p { color: #aebdd0; font-size: 13px; max-width: 365px; line-height: 1.85; }
.auth-story-footer { margin: auto 0 0; color: #8595ad; font-size: 10px; position: relative; z-index: 1; }
.auth-panel { display: flex; justify-content: center; align-items: center; padding: 50px; background: #fafbfc; }
.auth-panel-inner { width: 100%; max-width: 385px; }
.auth-panel h1, .auth-panel h2 { font-size: 29px; line-height: 1.25; letter-spacing: -.9px; margin: 7px 0 11px; }
.auth-panel h1 + p, .auth-panel h2 + p { color: var(--muted); font-size: 12px; margin-bottom: 30px; }
.auth-panel .card { padding: 0; border: 0; background: none; box-shadow: none; }
.auth-panel .form-grid { grid-template-columns: 1fr; gap: 17px; }
.auth-panel .button.primary { min-height: 44px; }
.auth-panel .toolbar { margin-top: 20px; }
.auth-panel .auth-links { display: flex; justify-content: space-between; gap: 12px; margin: 15px 0; font-size: 11px; }
.auth-panel form > .field { margin-bottom: 18px; }
.auth-panel form > .button { margin-top: 5px; }
.auth-footnote { text-align: center; font-size: 10px; color: #8b95a3; margin: 35px 0 0; }
.auth-mobile-brand { display: none; }
.auth-illustration { position: relative; max-width: 345px; margin-top: 38px; padding: 0 16px 28px 0; }
.illustration-card { padding: 20px 23px; background: #fff; border-radius: 17px; box-shadow: 0 12px 28px #0b142e25; transform: rotate(-2deg); }
.illustration-card > span { color: #81909b; font-size: 10px; }
.illustration-card > strong { display: block; color: #243044; font-size: 22px; letter-spacing: -.6px; margin: 4px 0 17px; }
.illustration-bars { height: 69px; display: flex; gap: 10px; align-items: flex-end; }
.illustration-bars i { display: block; flex: 1; background: #b4e4d4; border-radius: 5px 5px 0 0; height: 30%; }
.illustration-bars i:nth-child(2) { height: 50%; background: #cecae9; }
.illustration-bars i:nth-child(3) { height: 40%; }
.illustration-bars i:nth-child(4) { height: 65%; background: #b4aedc; }
.illustration-bars i:nth-child(5) { height: 52%; }
.illustration-bars i:nth-child(6) { height: 81%; background: #9d94d2; }
.illustration-bars i:nth-child(7) { height: 100%; background: #168a78; }
.illustration-line { display: flex; justify-content: space-between; gap: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.illustration-line span { display: block; width: 50px; height: 4px; border-radius: 10px; background: #e6ebee; }
.illustration-tag { position: absolute; right: 0; bottom: 3px; display: flex; align-items: center; gap: 7px; background: #d9f6e9; color: #25614c; border: 4px solid var(--navy); border-radius: 10px; padding: 9px 12px; font-size: 9px; font-weight: 600; }
.illustration-tag .icon { width: 14px; height: 14px; }
/* Compatibility is scoped to the original report template; calculations are untouched. */
.report-root { --red: #087f75; --gray: #687180; --line: #e6e9ef; --muted: #687180; min-width: 0; }
.report-root #report { margin-top: 22px; }
.report-root .card { margin-bottom: 19px; padding: 22px; overflow: auto; }
.report-root .card + .card { margin-top: 0; }
.report-root .card h2 { font-size: 16px; margin: 0 0 17px; }
.report-root .card h3 { color: #59697c; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; margin: 20px 0 12px; text-align: left; }
.report-root .small, .report-root .partner-note { color: var(--muted); font-size: 10px; line-height: 1.7; }
.report-root #period { display: block; margin-top: 5px; }
.report-root .grid.kpis { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 15px; margin-bottom: 19px; }
.report-root .kpi { min-width: 0; padding: 21px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.report-root .kpi:nth-child(1), .report-root .kpi:nth-child(3) { background: #e9f4ef; border-color: #d4e7dd; }
.report-root .kpi:nth-child(4) { background: #f0ecfa; border-color: #e4dcf2; }
.report-root .kpi .label { font-size: 10px; color: #657381; font-weight: 550; min-height: 30px; }
.report-root .kpi .value { font-size: 29px; line-height: 1.15; font-weight: 750; letter-spacing: -1.1px; margin-top: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.report-root .kpi .sub { font-size: 9px; color: #7b8794; margin-top: 6px; }
.report-root .three { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 19px; }
.report-root .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.report-root table { border-collapse: collapse; width: 100%; font-size: 11px; }
.report-root th { background: #f7f9fb; padding: 10px 11px; border-bottom: 1px solid var(--line); color: #798391; font-size: 9px; text-align: left; font-weight: 650; }
.report-root td { padding: 11px; border-bottom: 1px solid #edf0f3; color: #4c5869; text-align: left; vertical-align: middle; }
.report-root td.num, .report-root .anaf-table td:nth-child(n+2), .report-root .pandl td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.report-root .total-row { background: #f2f6f5; font-weight: 700; }
.report-root .total-row td { color: #273e37; }
.report-root .pill { display: inline-flex; border-radius: 5px; padding: 3px 7px; font-size: 9px; font-weight: 650; line-height: 1.5; }
.report-root .pill.ok { background: #e9f7ee; color: #216f49; }
.report-root .pill.bad { background: #fbeef0; color: #a63242; }
.report-root .pill.warn { background: #fff4db; color: #885a07; }
.report-root .alerts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.report-root .alert { margin: 0; padding: 12px; background: #fff8e8; border-color: #f1e5c7; font-size: 11px; display: block; }
.report-root .alert.bad { background: #fcf1f2; border-color: #eed6da; color: #a53544; }
.report-root canvas { max-height: 320px; max-width: 100%; margin-top: 12px; }
.report-root .tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 5px; border: 1px solid var(--line); border-radius: 11px; background: #eef1f5; margin-bottom: 19px; }
.report-root .tab-btn { flex: 1 1 auto; background: transparent; color: #697487; border: 1px solid transparent; border-radius: 7px; padding: 10px 13px; font-weight: 600; font-size: 10px; white-space: nowrap; }
.report-root .tab-btn:hover { background: #f8fafb; }
.report-root .tab-btn.active { background: #fff; color: var(--teal); border-color: #e1e8e5; box-shadow: 0 1px 3px #13253908; }
.report-root .bvreport h2 { font-size: 22px; letter-spacing: -.5px; }
.report-root .bvreport h3 { color: var(--teal); font-size: 12px; margin: 28px 0 12px; }
.report-root .bvreport p { margin: 10px 0; text-align: left; font-size: 12px; line-height: 1.8; }
.report-root .bvreport .bv-status { padding: 15px; border: 1px solid var(--line); border-radius: 11px; margin: 13px 0; background: #f8f9fb; font-size: 11px; line-height: 1.8; }
.report-root .bvreport .bv-status.ok { background: #eff8f2; border-color: #d2e8db; }
.report-root .bvreport .bv-status.bad { background: #fff2f4; border-color: #f0d4d9; }
.report-root .bvreport .bv-list { padding-left: 20px; font-size: 12px; line-height: 1.8; }
.report-root .bvreport .metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 18px 0; }
.report-root .bvreport .metric { border: 1px solid var(--line); border-radius: 11px; padding: 15px; min-width: 0; }
.report-root .bvreport .metric span { color: #748091; font-size: 10px; display: block; }
.report-root .bvreport .metric strong { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.5px; margin-top: 7px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.report-root .bvreport .note { background: #fffaed; border: 1px solid #f0e6ce; padding: 13px; border-radius: 10px; font-size: 11px; line-height: 1.8; }
.report-root .bvreport .danger { background: #fff2f4; border-color: #f0d4da; color: #a23444; }
.report-root .bvreport .z-table td { vertical-align: top; text-align: left; line-height: 1.8; min-width: 160px; }
.report-root hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.report-root .calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.report-root .calc-card { border: 1px solid var(--line); border-radius: 13px; padding: 20px; min-width: 0; }
.report-root .calc-card h3 { margin-top: 0; color: var(--ink); }
.report-root .calc-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin: 20px 0; }
.report-root .calc-form label { display: block; color: #657183; font-size: 10px; margin-bottom: 6px; }
.report-root .calc-result { margin-top: 15px; }
.report-root .calc-help { padding: 12px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 10px; line-height: 1.75; margin-top: 15px; }
.report-root .toolbar { margin: 18px 0 0; }
.report-root .formula { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; color: #6e7889; }
.report-root .upload { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
.report-root .footer { text-align: center; font-size: 10px; color: var(--muted); margin-top: 25px; }
.report-root .table-scroll { border: 0; border-radius: 0; }
@media (min-width: 1700px) { :root { --sidebar-width: 270px; } .page-content { padding-top: 40px; } }
@media (max-width: 1200px) {
  :root { --sidebar-width: 224px; }
  .app-sidebar { padding-left: 12px; padding-right: 12px; }
  .app-brand { font-size: 16px; }
  .app-brand small { font-size: 8px; }
  .app-topbar { padding: 17px 24px; }
  .page-content { padding: 27px 24px; }
  .app-footer { padding-left: 24px; padding-right: 24px; }
  .topbar-context { gap: 10px; }
  .period-badge { display: none; }
  .page-header { gap: 16px; }
  .page-header > .toolbar { flex-shrink: 1; }
  .report-root .three { grid-template-columns: 1fr; }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .app-layout { display: block; }
  .app-sidebar { position: relative; height: auto; width: 100%; padding: 22px; }
  .sidebar-scroll { overflow: visible; }
  .sidebar-heading { padding-bottom: 20px; }
  .sidebar-bottom { max-width: 360px; }
  .sidebar-note { display: none; }
  .js .app-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 270px; height: 100vh; height: 100dvh; padding: 25px 16px 18px; transform: translateX(-100%); transition: transform .2s ease; visibility: hidden; }
  .js .sidebar-scroll { overflow-y: auto; }
  .js.sidebar-open .app-sidebar { transform: translateX(0); visibility: visible; }
  .js .sidebar-toggle { display: inline-flex; flex-shrink: 0; }
  .js .sidebar-close { display: inline-flex; margin-left: auto; width: 28px; height: 28px; color: #c4cedd; }
  .js .sidebar-close:hover { background: #29364a; }
  .js .sidebar-scrim:not([hidden]) { display: block; position: fixed; inset: 0; background: #101a2b80; z-index: 35; border: 0; padding: 0; backdrop-filter: blur(2px); }
  .js.sidebar-open body { overflow: hidden; }
  .app-topbar { min-height: 75px; }
  .topbar-leading { gap: 9px; }
  .auth-story { padding: 32px; }
  .auth-story-content { padding-top: 55px; }
  .auth-panel { padding: 35px; }
}
@media (max-width: 700px) {
  .app-topbar { padding: 14px 17px; gap: 8px; flex-wrap: wrap; }
  .topbar-symbol { display: none; }
  .topbar-location strong { max-width: 190px; }
  .topbar-location small { font-size: 7px; }
  .topbar-context { gap: 9px; margin-left: auto; }
  .company-switcher select { max-width: 140px; min-height: 35px; font-size: 10px; }
  .topbar-avatar { display: none; }
  .page-content { padding: 24px 17px; }
  .page-header { display: block; margin-bottom: 21px; }
  .page-header h1 { font-size: 28px; }
  .page-header > .toolbar { justify-content: flex-start; margin-top: 17px; }
  .page-header p { font-size: 11px; }
  .grid.two, .grid.three, .comparison-grid { grid-template-columns: 1fr; }
  .card { padding: 19px; }
  .card-header { gap: 14px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .stat-card { padding: 17px 15px; }
  .stat-card strong, .stat-value { font-size: 27px; letter-spacing: -.8px; }
  .stat-card > span, .stat-label { font-size: 10px; }
  .stat-card .stat-top { margin-bottom: 12px; }
  .form-grid { grid-template-columns: 1fr; gap: 17px; }
  .form-actions { justify-content: flex-start; }
  .data-table th { padding: 11px 13px; }
  .data-table td { padding: 14px 13px; }
  .data-table { min-width: 520px; }
  .empty-state { padding: 32px 18px; }
  .app-footer { padding: 0 17px 22px; font-size: 8px; }
  .welcome-banner, .dashboard-hero { padding: 22px; }
  .welcome-banner h2, .dashboard-hero h2 { font-size: 22px; }
  .steps { flex-wrap: wrap; gap: 12px; }
  .report-root .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .report-root .kpi { padding: 16px; }
  .report-root .kpi .value { font-size: 23px; }
  .report-root .cols, .report-root .calc-grid, .report-root .calc-form, .report-root .upload { grid-template-columns: 1fr; }
  .report-root .alerts { grid-template-columns: 1fr; }
  .report-root .card { padding: 18px; }
  .report-root .bvreport .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .report-root .bvreport .metric { padding: 12px; }
  .report-root .bvreport .metric strong { font-size: 17px; }
  .report-root .tabs { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding: 5px; }
  .report-root .tab-btn { flex: 0 0 auto; padding: 10px 12px; }
  .report-root table { min-width: 360px; }
  .report-root .card h2 { font-size: 15px; }
  .report-root .bvreport h2 { font-size: 20px; }
  .auth-layout { display: block; }
  .auth-story { display: none; }
  .auth-panel { min-height: 100vh; min-height: 100dvh; padding: 35px 25px; }
  .auth-panel h1, .auth-panel h2 { font-size: 28px; }
  .auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 52px; color: var(--navy); font-size: 19px; font-weight: 750; letter-spacing: -.5px; }
  .auth-mobile-brand .brand-symbol { width: 35px; height: 35px; }
}
@media (max-width: 400px) {
  .topbar-location strong { max-width: 140px; }
  .company-switcher { max-width: 145px; }
  .company-switcher select { max-width: 110px; padding-left: 7px; }
  .topbar-context { width: 100%; margin-left: 47px; }
  .stats-grid { grid-template-columns: 1fr; }
  .report-root .kpi .value { font-size: 21px; }
  .app-footer > span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media print {
  @page { margin: 15mm 12mm; }
  html, body { background: #fff !important; color: #18212b; font-size: 10pt; }
  .app-layout { display: block; }
  .app-sidebar, .app-topbar, .app-footer, .sidebar-scrim, .skip-link, .no-print, .toolbar, .form-actions, .row-actions, .report-root .tabs, .report-root .upload { display: none !important; }
  .app-main { display: block; }
  .page-content { display: block; width: 100%; max-width: none; padding: 0; margin: 0; }
  .page-header { display: block; margin: 0 0 22px; }
  .page-header h1 { font-size: 22pt; }
  .page-header p { color: #4b5563; }
  .card, .stat-card, .report-root .card, .report-root .kpi, .report-root .metric { box-shadow: none; border-color: #d5dbe0; break-inside: avoid; overflow: visible; }
  .card { padding: 15px; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .table-scroll { overflow: visible; border: 0; }
  .data-table { min-width: 0; width: 100%; font-size: 9pt; }
  .data-table th, .data-table td { padding: 8px; }
  .report-root .three, .report-root .cols, .report-root .calc-grid { display: block; }
  .report-root table { min-width: 0; font-size: 8pt; }
  .report-root th, .report-root td { padding: 7px; }
  .report-root .grid.kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-root .kpi .value { font-size: 19pt; }
  .report-root .card { padding: 13px; }
  .report-root .bvreport { break-inside: auto; }
  .report-root .bvreport .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-root .alert { break-inside: avoid; }
  .report-root canvas { max-height: 220px; }
  tr, img, canvas { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
  a { color: inherit; text-decoration: none; }
  .badge, .pill { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
/* Shared module helpers. */
.compare-chart { position: relative; height: 360px; min-height: 300px; margin-top: 18px; }
.compare-chart canvas { max-width: 100%; max-height: 360px; }
.check-label { display: flex; gap: 8px; align-items: center; font-size: 12px; color: #536071; }
.check-label input { margin: 0; }
@media (max-width: 700px) { .compare-chart { height: 300px; min-height: 260px; } }
@media print { .compare-chart { height: 260px; min-height: 0; } }
.field { font-size: 11px; font-weight: 600; color: #414b5c; }
.auth-panel form.stack { gap: 18px; }
.auth-panel form.stack > .field { margin-bottom: 0; }
.auth-panel form.stack > a { font-size: 11px; text-align: center; }
fieldset { border: 1px solid var(--line); border-radius: 11px; padding: 18px; margin: 0; min-width: 0; }
legend { padding: 0 7px; font-size: 11px; color: #536071; font-weight: 600; }
/* Saved report: keep the selected period and figures close to the page heading. */
.report-filters.form-grid {
  grid-template-columns: minmax(180px, 1.5fr) minmax(95px, .7fr) minmax(120px, .9fr) minmax(165px, 1fr);
  align-items: end;
  gap: 14px;
  padding: 16px 20px;
  margin-bottom: 14px;
}
.report-filters .field { gap: 5px; }
.report-filters .field > span, .report-filters .field > label { font-size: 10px; }
.report-filters .button { min-height: 42px; }
.report-meta-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px 18px;
  padding: 15px 20px;
  margin-bottom: 16px;
}
.report-filters + .report-meta-card { margin-top: 0; }
.report-meta-card .card-header { margin-bottom: 0; min-width: 0; }
.report-meta-card .card-header h2 { font-size: 15px; margin: 0 0 4px; }
.report-meta-card .card-header p { font-size: 10px; overflow-wrap: anywhere; }
.report-meta-card .toolbar { gap: 6px; justify-content: flex-end; }
.report-meta-card .toolbar .button { min-height: 32px; padding: 7px 10px; font-size: 10px; }
.report-meta-card #status { grid-column: 1 / -1; margin: 0; font-size: 10px; color: var(--muted); }
.report-mode-saved #report { margin-top: 0; }
.report-mode-saved .tabs { margin-bottom: 16px; }
@media screen {
  .report-mode-saved #report > .card:first-child { display: none; }
}
@media (max-width: 1100px) {
  .report-filters.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-meta-card { grid-template-columns: 1fr; }
  .report-meta-card .toolbar { justify-content: flex-start; }
}
@media (max-width: 700px) {
  .report-filters.form-grid { grid-template-columns: 1fr; padding: 17px; gap: 12px; }
  .report-meta-card { padding: 17px; gap: 12px; }
  .report-meta-card .toolbar { gap: 7px; }
  .report-meta-card .toolbar .button { min-height: 35px; }
}
