:root {
  --ink: #152323;
  --ink-2: #344544;
  --muted: #74827f;
  --line: #dfe6e2;
  --line-strong: #cbd5d0;
  --paper: #f7f8f5;
  --card: #ffffff;
  --navy: #102e31;
  --navy-2: #173d3f;
  --mint: #b9f1d5;
  --mint-strong: #40a87d;
  --blue: #386bd8;
  --blue-soft: #eaf0ff;
  --amber: #d99b2b;
  --amber-soft: #fff5d9;
  --red: #cb5c54;
  --red-soft: #ffedeb;
  --shadow: 0 12px 35px rgba(27, 48, 45, 0.07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1180px; background: var(--paper); }
button, input, select { font: inherit; }
button { color: inherit; }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 40px; background: radial-gradient(circle at 50% 15%, #244d4a 0, var(--navy) 44%, #0a2224 100%); }
.auth-card { width: min(460px, calc(100vw - 50px)); padding: 42px; border: 1px solid rgba(255,255,255,.12); border-radius: 22px; color: #f4fbf8; background: rgba(255,255,255,.97); box-shadow: 0 28px 90px rgba(0,0,0,.3); text-align: center; }
.auth-card .eyebrow { color: #66807a; }
.auth-card h1 { color: var(--navy); font-size: 34px; }
.auth-card > p:not(.eyebrow):not(.auth-error) { margin: 12px auto 24px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.auth-brand-mark { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 21px; border-radius: 16px; color: var(--navy); background: var(--mint); }
.auth-brand-mark svg { width: 32px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.google-signin-button { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 11px; padding: 0 17px; border: 1px solid #cbd5d0; border-radius: 10px; color: var(--ink); background: #fff; box-shadow: 0 4px 15px rgba(16,46,49,.08); font-size: 13px; font-weight: 750; text-decoration: none; transition: .15s ease; }
.google-signin-button:hover { border-color: #9aaba5; transform: translateY(-1px); }
.google-g { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #4285f4; background: #eef4ff; font-weight: 850; }
.auth-card small { display: block; margin-top: 17px; color: #7d8b88; font-size: 9px; }
.auth-error { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; color: #8b3f39; background: var(--red-soft); font-size: 10px; line-height: 1.5; }
.cloud-mode .local-only { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 27px 18px 20px; color: #e9f5f1; background: var(--navy); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 29px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--mint); background: rgba(185,241,213,.1); }
.brand-mark svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand strong, .company-card strong { display: block; font-size: 14px; letter-spacing: -.01em; }
.brand span, .company-card span { display: block; margin-top: 3px; color: #91aaa5; font-size: 11px; }

.main-nav { display: grid; gap: 5px; margin-top: 24px; }
.nav-item { position: relative; width: 100%; display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 0; border-radius: 9px; color: #a9bdb8; background: transparent; text-align: left; font-size: 13px; cursor: pointer; transition: .16s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: var(--navy-2); box-shadow: inset 2px 0 var(--mint); }
.nav-icon { width: 18px; color: var(--mint); font-size: 18px; text-align: center; }
.nav-count { margin-left: auto; min-width: 19px; padding: 2px 6px; border-radius: 12px; color: var(--navy); background: var(--mint); font-size: 10px; font-weight: 750; text-align: center; }
.nav-count.warning { color: #5b3d00; background: #f3cb75; }
.sidebar-bottom { margin-top: auto; }
.company-card { display: flex; align-items: center; gap: 9px; padding: 13px 10px; border-top: 1px solid rgba(255,255,255,.1); }
.company-avatar { width: 31px; height: 31px; display: grid !important; place-items: center; flex: 0 0 auto; border-radius: 9px; color: var(--navy) !important; background: var(--mint); font-size: 11px !important; font-weight: 800; }
.company-card div { min-width: 0; flex: 1; }
.icon-button { border: 0; color: #91aaa5; background: transparent; cursor: pointer; }
.local-note { display: flex; align-items: center; gap: 7px; margin: 5px 10px 0; color: #78938e; font-size: 10px; }
.local-note span { width: 6px; height: 6px; border-radius: 50%; background: var(--mint-strong); box-shadow: 0 0 0 3px rgba(64,168,125,.15); }

.main-content { min-width: 0; padding: 0 38px 56px; }
.topbar { height: 107px; display: flex; align-items: center; justify-content: space-between; }
.eyebrow { margin: 0 0 6px; color: #70817d; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 500; letter-spacing: -.025em; }
h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-weight: 500; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 13px; }
.top-actions, .modal-actions { display: flex; align-items: center; gap: 10px; }
.cloud-account { min-height: 43px; display: grid; grid-template-columns: 30px minmax(90px, auto) auto; align-items: center; gap: 8px; padding: 5px 8px 5px 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.cloud-account img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
.cloud-account strong, .cloud-account small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cloud-account strong { font-size: 9px; }
.cloud-account small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.warning-dot { background: var(--amber) !important; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; transition: .15s ease; }
.button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.button.primary { color: #fff; background: var(--navy); box-shadow: 0 5px 12px rgba(16,46,49,.13); }
.button.primary:hover { background: #1d4749; transform: translateY(-1px); }
.button.secondary { border-color: var(--line-strong); background: #fff; }
.button.secondary:hover { border-color: #9daba7; }
.button.small { min-height: 31px; padding: 0 11px; font-size: 11px; }
.button.danger { color: var(--red); border-color: #f1c6c2; background: var(--red-soft); }

.filter-bar { min-height: 68px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.72); box-shadow: 0 2px 10px rgba(27,48,45,.025); }
.segmented { display: flex; padding: 3px; border-radius: 8px; background: #edf1ee; }
.segmented button { height: 31px; padding: 0 13px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.segmented button.active { color: var(--ink); background: #fff; box-shadow: 0 1px 5px rgba(30,45,42,.1); }
.field { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.field span { letter-spacing: .02em; }
.field input, .field select { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; outline: none; color: var(--ink); background: #fff; font-size: 12px; font-weight: 500; }
.field input:focus, .field select:focus { border-color: var(--mint-strong); box-shadow: 0 0 0 3px rgba(64,168,125,.1); }
.compact-field { display: flex; align-items: center; gap: 8px; padding-left: 3px; }
.compact-field span { white-space: nowrap; }
.compact-field input, .compact-field select { width: auto; min-width: 130px; height: 37px; }
.compact-field:nth-of-type(3) select { min-width: 165px; }
.filter-reset { margin-left: auto; border: 0; color: #6d7e7a; background: transparent; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.hidden { display: none !important; }

.view { padding-top: 25px; }
.view-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 17px; }
.view-header h2 { font-size: 21px; }
.view-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.status-line { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.status-line i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint-strong); }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 13px; }
.kpi-card { position: relative; min-height: 130px; padding: 17px 17px 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 7px 20px rgba(27,48,45,.035); }
.kpi-card.accent { color: #fff; border-color: var(--navy); background: var(--navy); }
.kpi-card::after { content: ""; position: absolute; right: -25px; bottom: -45px; width: 100px; height: 100px; border-radius: 50%; background: rgba(185,241,213,.06); }
.kpi-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 700; }
.accent .kpi-label { color: #a7c4bd; }
.kpi-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; color: var(--mint-strong); background: #edf8f3; font-size: 13px; }
.accent .kpi-icon { color: var(--mint); background: rgba(185,241,213,.11); }
.kpi-value { margin-top: 14px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(20px, 1.8vw, 28px); letter-spacing: -.035em; white-space: nowrap; }
.kpi-meta { display: flex; align-items: center; gap: 5px; margin-top: 9px; color: var(--muted); font-size: 9px; }
.accent .kpi-meta { color: #a7c4bd; }
.trend-up { color: var(--mint-strong); font-weight: 800; }
.accent .trend-up { color: var(--mint); }
.trend-down { color: var(--red); font-weight: 800; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 14px; margin-top: 14px; }
.content-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 7px 20px rgba(27,48,45,.03); }
.card-header { min-height: 55px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 1px solid #edf0ee; }
.card-header div > span, .card-subtitle { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.card-actions { display: flex; align-items: center; gap: 9px; }
.text-button { border: 0; color: #58706c; background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }

.forecast-card { padding: 18px; }
.forecast-top { display: flex; align-items: flex-start; justify-content: space-between; }
.forecast-value { margin-top: 6px; font-family: Georgia, "Times New Roman", serif; font-size: 29px; }
.forecast-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 20px; color: #267a59; background: #eaf8f1; font-size: 9px; font-weight: 800; }
.forecast-badge.medium { color: #856014; background: var(--amber-soft); }
.progress-rail { height: 7px; margin: 19px 0 10px; overflow: hidden; border-radius: 10px; background: #e9eeeb; }
.progress-rail span { display: block; height: 100%; border-radius: inherit; background: var(--mint-strong); }
.progress-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.scenario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.scenario { padding: 10px 11px; border-radius: 8px; background: #f5f7f5; }
.scenario span { display: block; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.scenario strong { display: block; margin-top: 4px; font-family: Georgia, "Times New Roman", serif; font-size: 15px; font-weight: 500; }

.chart-wrap { height: 253px; padding: 13px 16px 8px; }
.chart-svg { width: 100%; height: 100%; overflow: visible; }
.chart-svg text { fill: #82908d; font-family: Inter, sans-serif; font-size: 8px; }
.chart-svg .grid { stroke: #e7ece9; stroke-width: 1; }
.chart-svg .axis { stroke: #cfd8d4; stroke-width: 1; }
.chart-svg .revenue-line { fill: none; stroke: var(--mint-strong); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart-svg .expense-line { fill: none; stroke: #e3a341; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-svg .revenue-area { fill: url(#revenueFade); }
.chart-svg .forecast-line { fill: none; stroke: var(--mint-strong); stroke-width: 2; stroke-dasharray: 4 4; }
.chart-hit-area { fill: transparent; cursor: crosshair; }
.chart-hover-line { opacity: 0; stroke: #70817d; stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; transition: opacity 120ms ease; }
.chart-hover-dot { opacity: 0; fill: #fff; stroke-width: 2; pointer-events: none; transition: opacity 120ms ease; }
.chart-hover-dot.revenue { stroke: var(--mint-strong); }
.chart-hover-dot.expense { stroke: #d88c1f; }
.chart-tooltip { opacity: 0; pointer-events: none; transition: opacity 120ms ease; }
.chart-tooltip rect { fill: var(--navy); stroke: rgba(255, 255, 255, .14); stroke-width: 1; filter: drop-shadow(0 7px 14px rgba(6, 31, 31, .18)); }
.chart-svg .chart-tooltip text { fill: #dceae6; font-size: 9px; }
.chart-svg .chart-tooltip-title { fill: #fff; font-size: 10px; font-weight: 750; }
.chart-svg .chart-tooltip-status { fill: #9ec1b9; font-size: 8px; }
.chart-svg .chart-tooltip-value { fill: #fff; font-weight: 750; font-variant-numeric: tabular-nums; }
.chart-tooltip-key.revenue { fill: #78d4a9; }
.chart-tooltip-key.expense { fill: #e3a341; }
.chart-period:hover .chart-hover-line,
.chart-period:hover .chart-hover-dot,
.chart-period:hover .chart-tooltip,
.chart-period:focus .chart-hover-line,
.chart-period:focus .chart-hover-dot,
.chart-period:focus .chart-tooltip { opacity: 1; }
.chart-period:focus { outline: none; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 9px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint-strong); }
.legend i.expense { background: #e3a341; }

.deadline-list { padding: 4px 16px 12px; }
.deadline-item { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 11px; min-height: 58px; border-bottom: 1px solid #edf0ee; }
.deadline-item:last-child { border-bottom: 0; }
.date-tile { display: grid; place-items: center; padding: 5px 0; border-radius: 7px; color: var(--navy); background: #edf3f0; line-height: 1; }
.date-tile strong { font-family: Georgia, "Times New Roman", serif; font-size: 15px; font-weight: 500; }
.date-tile small { margin-top: 4px; font-size: 7px; font-weight: 800; text-transform: uppercase; }
.deadline-item p { margin: 0; font-size: 10px; font-weight: 700; }
.deadline-item p span { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; font-weight: 500; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; padding: 0 8px; border-radius: 20px; color: #277d5b; background: #e9f8f0; font-size: 8px; font-weight: 800; white-space: nowrap; }
.pill.amber { color: #825c11; background: var(--amber-soft); }
.pill.red { color: #98433d; background: var(--red-soft); }
.pill.gray { color: #64716f; background: #edf0ef; }
.pill.blue { color: #3159ae; background: var(--blue-soft); }

.action-list { padding: 4px 16px 12px; }
.action-item { display: grid; grid-template-columns: 29px 1fr auto; align-items: center; gap: 10px; min-height: 54px; border-bottom: 1px solid #edf0ee; }
.action-item:last-child { border-bottom: 0; }
.action-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; color: #875f12; background: var(--amber-soft); font-size: 11px; }
.action-item strong { display: block; font-size: 9px; }
.action-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }

.table-card { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 13px; color: var(--muted); background: #fafbfa; font-size: 8px; font-weight: 800; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 12px 13px; border-top: 1px solid #edf0ee; font-size: 10px; vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfcfb; }
.data-table .amount { font-weight: 750; white-space: nowrap; }
.amount.revenue { color: #25805b; }
.amount.expense { color: var(--ink); }
.cell-title { display: flex; align-items: center; gap: 9px; }
.cell-title > span:first-child { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; color: #fff; background: var(--navy); font-size: 9px; font-weight: 800; }
.cell-title strong { display: block; font-size: 10px; }
.cell-title small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.empty-state { padding: 52px 20px; color: var(--muted); text-align: center; }
.empty-state span { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 14px; color: var(--mint-strong); background: #edf8f3; font-size: 24px; }
.empty-state strong { display: block; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 17px; font-weight: 500; }
.empty-state p { max-width: 390px; margin: 7px auto 16px; font-size: 10px; line-height: 1.55; }

.document-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.document-card { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 6px 18px rgba(27,48,45,.025); }
.document-top { display: flex; align-items: flex-start; justify-content: space-between; }
.file-icon { width: 39px; height: 43px; display: grid; place-items: center; border: 1px solid #dce5e1; border-radius: 8px; color: #5e716d; background: #f5f7f5; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.document-card h3 { margin-top: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-card p { margin: 5px 0 12px; color: var(--muted); font-size: 9px; }
.document-actions { display: flex; justify-content: space-between; align-items: center; padding-top: 11px; border-top: 1px solid #edf0ee; }
.document-action-buttons { display: flex; align-items: center; gap: 8px; }

.subscription-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.subscription-stat { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.subscription-stat > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: var(--mint-strong); background: #edf8f3; font-size: 15px; }
.subscription-stat small { display: block; color: var(--muted); font-size: 8px; }
.subscription-stat strong { display: block; margin-top: 4px; font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 500; }
.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; border-bottom: 1px solid #edf0ee; }
.search-box { position: relative; width: min(390px, 45%); }
.search-box span { position: absolute; left: 12px; top: 50%; color: var(--muted); transform: translateY(-50%); }
.search-box input { width: 100%; height: 39px; padding: 0 12px 0 35px; border: 1px solid var(--line-strong); border-radius: 8px; outline: none; background: #fff; font-size: 11px; }
.search-box input:focus { border-color: var(--mint-strong); box-shadow: 0 0 0 3px rgba(64,168,125,.1); }
.catalog-filters { display: flex; gap: 6px; }
.catalog-filters button { min-height: 29px; padding: 0 9px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); background: #fff; font-size: 8px; font-weight: 800; cursor: pointer; }
.catalog-filters button.active { color: #216a4d; border-color: #bce5d0; background: #edf8f3; }
.vendor-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; padding: 15px; }
.vendor-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: .15s ease; }
.vendor-card:hover { border-color: #b7c7c1; box-shadow: 0 8px 20px rgba(27,48,45,.06); transform: translateY(-1px); }
.vendor-card-top { display: flex; align-items: center; gap: 10px; }
.vendor-logo { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border: 1px solid #e0e7e4; border-radius: 9px; background: #fff; }
.vendor-logo img { width: 23px; height: 23px; object-fit: contain; }
.vendor-logo span { color: var(--navy); font-size: 10px; font-weight: 850; }
.vendor-card h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vendor-card small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.vendor-plans { min-height: 31px; margin: 12px 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.vendor-card .button { width: 100%; }
.subscription-logo-cell { display: flex; align-items: center; gap: 9px; }
.subscription-logo-cell .vendor-logo { width: 31px; height: 31px; border-radius: 8px; }
.subscription-logo-cell .vendor-logo img { width: 20px; height: 20px; }
.subscription-logo-cell strong, .subscription-logo-cell small { display: block; }
.subscription-logo-cell small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.apple-ads-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 20px; margin-bottom: 14px; padding: 17px 19px; border: 1px solid #cddbd6; border-radius: 12px; background: linear-gradient(100deg, #f8fbfa, #fff); box-shadow: 0 8px 24px rgba(27,48,45,.04); }
.live-connections { display: grid; gap: 10px; margin-bottom: 14px; }
.live-connections .apple-ads-card { margin-bottom: 0; }
.apple-ads-brand { min-width: 0; display: flex; align-items: center; gap: 12px; }
.apple-ads-brand h3 { margin: 0; font-size: 15px; }
.apple-ads-brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.apple-ads-logo { width: 42px; height: 42px; border-radius: 11px; }
.apple-ads-logo img { width: 26px; height: 26px; }
.apple-ads-status { display: grid; justify-items: end; gap: 5px; }
.apple-ads-status small { color: var(--muted); font-size: 8px; }
.apple-ads-actions { display: flex; align-items: center; gap: 10px; }
.redirect-uri-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin: 10px 0 18px 38px; }
.redirect-uri-row input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #f6f8f7; color: var(--ink); font: 10px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; }
.danger-text { color: var(--red); }
.connection-error { grid-column: 1 / -1; margin: 0; color: var(--red); font-size: 9px; line-height: 1.5; }
.apple-setup-steps { display: grid; grid-template-columns: 24px 1fr; align-items: start; gap: 8px 10px; margin: 17px 0 4px; padding: 14px; border-radius: 10px; background: #f3f7f5; }
.apple-setup-steps span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--navy); font-size: 9px; font-weight: 800; }
.apple-setup-steps p { margin: 3px 0 0; color: var(--ink-2); font-size: 9px; line-height: 1.5; }
.apple-key-generator { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; margin-top: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; }
.apple-key-generator strong, .apple-key-generator small { display: block; }
.apple-key-generator small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.generated-key-panel { grid-column: 1 / -1; padding-top: 11px; border-top: 1px solid var(--line); }
.generated-key-panel textarea { min-height: 100px; resize: vertical; font-family: Consolas, monospace; font-size: 8px; line-height: 1.4; }
.generated-key-panel .top-actions { justify-content: flex-end; margin-top: 9px; }
.selected-vendor { display: flex; align-items: center; gap: 11px; margin-top: 17px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf8; }
.selected-vendor strong, .selected-vendor small { display: block; }
.selected-vendor small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.frequency-label { text-transform: capitalize; }

.app-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 14px; }
.app-summary-card { position: relative; overflow: hidden; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.app-summary-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--app-color); }
.app-header { display: flex; align-items: center; gap: 10px; }
.app-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--app-color); font-size: 10px; font-weight: 800; }
.app-header small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.app-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 18px; }
.app-metrics span { display: block; color: var(--muted); font-size: 8px; }
.app-metrics strong { display: block; margin-top: 4px; font-family: Georgia, "Times New Roman", serif; font-size: 14px; font-weight: 500; }

.reconcile-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.mini-stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.mini-stat span { color: var(--muted); font-size: 9px; }
.mini-stat strong { display: block; margin-top: 5px; font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 500; }
.match-cell { display: flex; align-items: center; gap: 7px; }
.match-score { min-width: 32px; color: var(--muted); font-size: 8px; }

.salary-controls { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(290px, 1fr) minmax(340px, 1.2fr); align-items: end; gap: 18px; padding: 17px 18px; }
.salary-gross-field input { height: 46px; font-family: Georgia, "Times New Roman", serif; font-size: 20px; }
.salary-credit-toggle { min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: #f8faf8; cursor: pointer; }
.salary-credit-toggle input { width: 17px; height: 17px; accent-color: var(--mint-strong); }
.salary-credit-toggle strong, .salary-credit-toggle small { display: block; }
.salary-credit-toggle strong { font-size: 10px; }
.salary-credit-toggle small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.salary-rate-summary { min-height: 46px; display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.salary-rate-summary span { display: grid; place-items: center; gap: 3px; padding: 7px; border-right: 1px solid var(--line); color: var(--muted); font-size: 8px; text-align: center; }
.salary-rate-summary span:last-child { border-right: 0; }
.salary-rate-summary strong { color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 15px; font-weight: 500; }
.salary-hero { display: grid; grid-template-columns: 1.1fr 1fr 1.1fr; gap: 13px; margin: 14px 0; }
.salary-result-card { min-height: 133px; padding: 19px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 7px 20px rgba(27,48,45,.035); }
.salary-result-card.pocket { color: #fff; border-color: var(--navy); background: var(--navy); }
.salary-result-card.company { border-color: #b9dccc; background: #eff9f4; }
.salary-result-card span, .salary-result-card small { display: block; color: var(--muted); font-size: 9px; }
.salary-result-card.pocket span, .salary-result-card.pocket small { color: #a7c4bd; }
.salary-result-card strong { display: block; margin: 13px 0 9px; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 500; letter-spacing: -.03em; }
.salary-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.salary-breakdown-list { padding: 5px 17px 12px; }
.salary-breakdown-row { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid #edf0ee; }
.salary-breakdown-row:last-child { border-bottom: 0; }
.salary-breakdown-row strong, .salary-breakdown-row small { display: block; }
.salary-breakdown-row strong { font-size: 10px; }
.salary-breakdown-row small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.salary-breakdown-row > span { font-size: 11px; font-weight: 800; white-space: nowrap; }
.salary-breakdown-row > span.salary-negative { color: #9a5149; }
.salary-breakdown-row > span.salary-credit { color: #25805b; }
.salary-breakdown-row > span.salary-total { color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 500; }
.salary-tax-card { margin-top: 14px; }
.salary-tax-bands { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.salary-tax-bands > div { min-height: 94px; padding: 15px 17px; border-right: 1px solid var(--line); }
.salary-tax-bands > div:last-child { border-right: 0; }
.salary-tax-bands span, .salary-tax-bands strong, .salary-tax-bands small { display: block; }
.salary-tax-bands span { color: var(--muted); font-size: 8px; font-weight: 750; }
.salary-tax-bands strong { margin: 9px 0 5px; font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-weight: 500; }
.salary-tax-bands small { color: var(--muted); font-size: 8px; }
.salary-tax-bands .tax-credit-band { background: #f1faf5; }
.salary-tax-bands .tax-credit-band strong { color: #25805b; }
.salary-notice { margin-top: 14px; }

.tax-hero { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 13px; margin-bottom: 14px; }
.tax-card { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tax-card.primary-tax { color: #fff; border-color: var(--navy); background: var(--navy); }
.tax-card span { color: var(--muted); font-size: 9px; font-weight: 700; }
.primary-tax span { color: #9db8b2; }
.tax-card strong { display: block; margin-top: 9px; font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 500; }
.tax-card p { margin: 7px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.primary-tax p { color: #9db8b2; }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border: 1px solid #edd89e; border-radius: 9px; color: #604a1c; background: #fff9e9; font-size: 9px; line-height: 1.5; }
.notice strong { display: block; margin-bottom: 2px; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 25px; background: rgba(7,26,27,.62); backdrop-filter: blur(4px); }
.modal { position: relative; width: min(560px, 95vw); max-height: calc(100vh - 50px); overflow: auto; padding: 28px; border-radius: 15px; background: #fff; box-shadow: 0 25px 80px rgba(0,0,0,.25); }
.transaction-modal { width: min(690px, 95vw); }
.document-detail-modal { width: min(920px, 95vw); }
.provider-detail-modal { width: min(980px, 95vw); }
.provider-detail-intro { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 14px 0 18px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(100deg, #f6faf8, #fff); }
.provider-detail-intro strong, .provider-detail-intro small { display: block; }
.provider-detail-intro small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.provider-detail-note { margin-top: 15px; }
.provider-detail-note strong, .provider-detail-note small { display: block; }
.provider-detail-note strong { margin-bottom: 4px; }
.provider-detail-note small { margin-top: 6px; color: var(--muted); }
.provider-detail-actions > .form-hint { max-width: 520px; margin: 0; }
.modal-close { position: absolute; top: 16px; right: 17px; width: 31px; height: 31px; border: 0; border-radius: 50%; color: var(--muted); background: #f0f3f1; font-size: 20px; cursor: pointer; }
.modal-lead { margin: 7px 0 20px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.drop-zone { min-height: 205px; display: grid; place-items: center; align-content: center; gap: 7px; border: 1.5px dashed #b6c6c0; border-radius: 12px; background: #f8faf8; cursor: pointer; transition: .15s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--mint-strong); background: #f1faf5; }
.drop-zone input { display: none; }
.drop-zone strong { font-size: 12px; }
.drop-zone small { color: var(--muted); font-size: 9px; }
.upload-glyph { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 12px; color: var(--navy); background: var(--mint); font-size: 23px; }
.modal-tip { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 12px 13px; border-radius: 9px; color: #335d4e; background: #edf8f3; font-size: 9px; line-height: 1.55; }
.modal-tip > span { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: var(--mint-strong); font-size: 10px; }
.modal-tip p { margin: 0; }
.modal-tip.amber { color: #604a1c; background: var(--amber-soft); }
.modal-tip.amber > span { background: var(--amber); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; margin-top: 20px; }
.span-2 { grid-column: span 2; }
.form-hint { margin: 12px 0 19px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.modal-actions { justify-content: flex-end; margin-top: 20px; }
.checkbox-field { display: flex; align-items: center; align-self: end; min-height: 40px; padding: 0 3px; }
.checkbox-field input { width: 16px; height: 16px; accent-color: var(--mint-strong); }
.checkbox-field span { color: var(--ink-2); font-size: 10px; }
.company-modal-actions { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 20px; }
.company-modal-actions .modal-actions { margin-top: 0; }
.backup-tools { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf8; }
.backup-tools strong, .backup-tools small { display: block; }
.backup-tools small { max-width: 310px; margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.document-detail-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.document-detail-actions .modal-actions { margin-top: 0; }
.document-detail-actions .button:disabled { opacity: .55; cursor: wait; }
.bank-options { display: grid; gap: 8px; }
.bank-options button { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 11px; width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; text-align: left; }
.bank-options button:disabled { opacity: .65; }
.bank-logo { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--navy); font-family: Georgia, serif; font-size: 17px; }
.bank-options strong, .bank-options small { display: block; }
.bank-options small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.bank-options em { color: #9a711f; font-size: 8px; font-style: normal; font-weight: 800; }

.detail-loading { min-height: 230px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); font-size: 10px; }
.detail-file-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin: 18px 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf8; }
.detail-file-bar strong, .detail-file-bar small { display: block; }
.detail-file-bar small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.detail-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 20px 0 11px; }
.detail-section-heading h3, .detail-section-heading p { margin: 0; }
.detail-section-heading p { margin-top: 4px; color: var(--muted); font-size: 9px; }
.detail-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.detail-metric { min-height: 88px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.detail-metric span, .detail-metric small { display: block; color: var(--muted); font-size: 8px; }
.detail-metric strong { display: block; margin: 8px 0 5px; overflow-wrap: anywhere; font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 500; }
.secondary-metrics { margin-top: 10px; }
.secondary-metrics .detail-metric { min-height: 75px; background: #f8faf8; }
.detail-warning { margin: 14px 0; color: #604a1c; background: var(--amber-soft); }
.detail-warning > span { background: var(--amber); }
.detail-table { margin-top: 15px; overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
.detail-table .card-header { padding: 13px 15px; }
.detail-table .data-table { min-width: 650px; }

.toast-stack { position: fixed; z-index: 150; right: 22px; bottom: 22px; display: grid; gap: 9px; }
.toast { min-width: 290px; max-width: 390px; padding: 13px 15px; border: 1px solid #cfe0d8; border-radius: 10px; color: #244d3f; background: #f0faf5; box-shadow: var(--shadow); font-size: 10px; animation: toast-in .22s ease-out; }
.toast.error { color: #733c37; border-color: #ebc6c3; background: #fff2f0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.scan-backdrop { z-index: 145; }
.scan-modal { width: min(440px, calc(100vw - 36px)); text-align: center; }
.scan-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 14px; color: var(--navy); background: var(--mint); font-size: 27px; animation: scan-pulse 1.4s ease-in-out infinite; }
.scan-file { margin: 8px 0 18px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.scan-track { height: 7px; overflow: hidden; border-radius: 8px; background: #e6ece9; }
.scan-track span { display: block; width: 5%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint-strong), #6eb89e); transition: width .25s ease; }
.scan-message { min-height: 18px; margin: 10px 0 0; color: var(--ink-2); font-size: 9px; }
@keyframes scan-pulse { 50% { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(49, 127, 108, .18); } }

@media (max-width: 1280px) {
  .main-content { padding-inline: 27px; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi-card:nth-child(4), .kpi-card:nth-child(5) { grid-column: span 1; }
  .document-grid { grid-template-columns: repeat(3, 1fr); }
  .vendor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apple-ads-card { grid-template-columns: minmax(0, 1fr) auto; }
  .apple-ads-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .salary-controls { grid-template-columns: 1fr 1fr; }
  .salary-rate-summary { grid-column: 1 / -1; }
}

@media print {
  body { min-width: 0; background: #fff; }
  .sidebar, .top-actions, .filter-bar, .text-button, .button { display: none !important; }
  .app-shell { display: block; }
  .main-content { padding: 0; }
  .topbar { height: 75px; }
  .card, .kpi-card { break-inside: avoid; box-shadow: none; }
}

/* 2026 visual refresh — based on the make-it-look-good minimalist dashboard system. */
:root {
  --ink: #122624;
  --ink-2: #3b514d;
  --muted: #5f706c;
  --line: #dce4df;
  --line-strong: #c4d0ca;
  --paper: #f4f6f3;
  --card: #ffffff;
  --navy: #0b3032;
  --navy-2: #164548;
  --mint: #c3f3da;
  --mint-strong: #187453;
  --blue: #315fc4;
  --blue-soft: #edf2ff;
  --amber: #c68118;
  --amber-soft: #fff4d9;
  --red: #b94d46;
  --red-soft: #fff0ee;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shadow: 0 18px 50px rgba(16, 45, 42, .11);
  font-family: "Segoe UI Variable Text", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
}

html { background: var(--paper); }
body { min-width: 1080px; color: var(--ink); background: var(--paper); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { line-height: 1.35; }
button:disabled { cursor: not-allowed; opacity: .55; }
button, a, input, select, textarea { transition-duration: 160ms; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(31, 145, 102, .32);
  outline-offset: 2px;
}
.skip-link { position: fixed; z-index: 999; top: 12px; left: -10000px; padding: 10px 14px; border-radius: var(--radius-sm); color: #fff; background: var(--navy); font-size: 13px; font-weight: 700; text-decoration: none; }
.skip-link:focus { left: 12px; }

.app-shell { grid-template-columns: 264px minmax(0, 1fr); }
.sidebar { padding: 24px 16px 20px; border-right: 1px solid rgba(255, 255, 255, .07); background: linear-gradient(180deg, #0b3032 0%, #0a2b2d 100%); }
.brand { gap: 12px; padding: 0 8px 24px; border-bottom-color: rgba(255, 255, 255, .09); }
.brand-mark { width: 40px; height: 40px; border-radius: var(--radius-md); background: rgba(195, 243, 218, .1); }
.brand-mark svg { width: 24px; }
.brand strong, .company-card strong { font-size: 14px; font-weight: 700; letter-spacing: -.015em; }
.brand span, .company-card span { margin-top: 2px; color: #a1b7b2; font-size: 11px; }
.main-nav { gap: 4px; margin-top: 20px; }
.nav-item { min-height: 44px; gap: 12px; padding: 9px 12px; border-radius: var(--radius-md); color: #b6cac5; font-size: 13px; font-weight: 500; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .055); }
.nav-item.active { color: #fff; background: rgba(195, 243, 218, .105); box-shadow: inset 3px 0 #9ce8c5; }
.nav-icon { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; color: #9ce8c5; font-size: 14px; }
.nav-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.nav-icon-text { font-family: Georgia, serif; font-size: 15px; letter-spacing: -.03em; }
.nav-count { min-width: 20px; padding: 2px 6px; font-size: 10px; }
.company-card { min-height: 64px; gap: 10px; padding: 12px 8px; }
.company-avatar { width: 36px; height: 36px; border-radius: var(--radius-md); }
.icon-button { min-width: 32px; min-height: 32px; border-radius: var(--radius-sm); }
.icon-button:hover { color: #fff; background: rgba(255,255,255,.06); }
.local-note { margin-top: 8px; font-size: 10px; }

.main-content { width: 100%; max-width: 1600px; padding: 0 40px 64px; }
.topbar { position: sticky; z-index: 20; top: 0; height: 112px; border-bottom: 1px solid rgba(220, 228, 223, .72); background: rgba(244, 246, 243, .94); backdrop-filter: blur(12px); }
.eyebrow { margin-bottom: 7px; color: #58706b; font-size: 10px; font-weight: 800; letter-spacing: .15em; }
h1, h2 { font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif; color: var(--ink); font-weight: 600; }
h1 { font-size: 30px; letter-spacing: -.035em; }
h2 { font-size: 24px; letter-spacing: -.025em; }
h3 { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.top-actions, .modal-actions { gap: 12px; }
.button { min-height: 44px; padding: 0 16px; border-radius: var(--radius-md); font-size: 12px; font-weight: 700; }
.button.primary { background: var(--navy); box-shadow: 0 6px 16px rgba(11, 48, 50, .14); }
.button.primary:hover { background: #154648; box-shadow: 0 9px 20px rgba(11, 48, 50, .18); }
.button.secondary { border-color: var(--line-strong); background: rgba(255, 255, 255, .82); }
.button.secondary:hover { border-color: #8fa39c; background: #fff; }
.button.small { min-height: 38px; padding: 0 13px; font-size: 11px; }
.cloud-account { min-height: 48px; grid-template-columns: 34px minmax(96px, auto) auto; padding: 6px 8px 6px 6px; border-radius: var(--radius-md); }
.cloud-account img { width: 34px; height: 34px; border-radius: 8px; }
.cloud-account strong { font-size: 11px; }
.cloud-account small { font-size: 9px; }

.filter-bar { min-height: 76px; gap: 16px; padding: 14px 16px; border-color: var(--line); border-radius: var(--radius-lg); background: rgba(255, 255, 255, .8); box-shadow: none; }
.segmented { padding: 4px; border-radius: 9px; background: #e8eeea; }
.segmented button { min-width: 62px; height: 36px; padding: 0 14px; border-radius: 7px; font-size: 11px; }
.segmented button.active { box-shadow: 0 2px 7px rgba(25, 52, 48, .1); }
.field { gap: 7px; font-size: 11px; }
.field input, .field select { height: 44px; padding: 0 12px; border-radius: 8px; font-size: 13px; }
.field input:focus, .field select:focus { border-color: #5cae8b; box-shadow: 0 0 0 3px rgba(31, 145, 102, .12); }
.compact-field { gap: 10px; }
.compact-field input, .compact-field select { min-width: 132px; height: 40px; }
.compact-field:nth-of-type(3) select { min-width: 180px; }
.filter-reset { min-height: 36px; padding: 0 6px; color: var(--muted); font-size: 11px; }

.view { padding-top: 32px; }
.view-header { min-height: 52px; margin-bottom: 24px; }
.view-header h2 { font-size: 24px; }
.view-header p { max-width: 74ch; margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.status-line { gap: 8px; font-size: 11px; }
.status-line i { width: 8px; height: 8px; box-shadow: 0 0 0 4px rgba(24, 116, 83, .1); }

.kpi-grid { grid-template-columns: minmax(220px, 1.35fr) repeat(4, minmax(150px, 1fr)); gap: 16px; }
.kpi-card { min-height: 148px; padding: 20px; border-radius: var(--radius-lg); box-shadow: none; }
.kpi-card:hover { border-color: #c5d2cc; transform: translateY(-1px); }
.kpi-card.accent { border-color: #0b3032; background: linear-gradient(145deg, #0b3032 0%, #124043 100%); }
.kpi-card::after { right: -20px; bottom: -52px; width: 128px; height: 128px; background: rgba(195, 243, 218, .065); }
.kpi-label { font-size: 11px; }
.kpi-icon { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; }
.kpi-value { margin-top: 20px; font-size: clamp(24px, 2vw, 32px); font-variant-numeric: tabular-nums; }
.kpi-card.accent .kpi-value { font-size: clamp(28px, 2.35vw, 36px); }
.kpi-meta { margin-top: 10px; font-size: 10px; }
.trend-up, .amount.revenue { color: #136a49; }
.accent .trend-up { color: #9ce8c5; }

.content-grid { grid-template-columns: minmax(0, 1.7fr) minmax(300px, .83fr); gap: 16px; margin-top: 16px; }
.content-grid.equal { gap: 16px; }
.card, .document-card, .subscription-stat, .app-summary-card, .mini-stat, .tax-card, .salary-result-card { border-color: var(--line); border-radius: var(--radius-lg); box-shadow: none; }
.card-header { min-height: 64px; padding: 0 20px; border-bottom-color: #e8eeea; }
.card-header div > span, .card-subtitle { margin-top: 4px; font-size: 10px; }
.card-actions { gap: 10px; }
.text-button { min-height: 32px; padding: 0 4px; color: #355f58; font-size: 11px; font-weight: 700; text-underline-offset: 3px; }
.text-button:hover { color: var(--navy); text-decoration: underline; }
.forecast-card { padding: 24px; }
.forecast-value { margin-top: 10px; font-size: 32px; font-variant-numeric: tabular-nums; }
.forecast-badge { padding: 7px 10px; font-size: 10px; }
.progress-rail { height: 8px; margin: 24px 0 12px; }
.progress-labels { font-size: 10px; }
.scenario-grid { gap: 12px; margin-top: 20px; }
.scenario { padding: 12px; border: 1px solid #e7ece9; border-radius: 8px; background: #f7f9f7; }
.scenario span { font-size: 9px; }
.scenario strong { margin-top: 6px; font-size: 17px; }
.chart-wrap { height: 292px; padding: 18px 20px 12px; }
.chart-svg text { font-family: "Segoe UI", sans-serif; font-size: 9px; }
.legend { gap: 16px; font-size: 10px; }

.deadline-list, .action-list { padding: 4px 20px 12px; }
.deadline-item { grid-template-columns: 40px 1fr auto; gap: 12px; min-height: 66px; }
.date-tile { padding: 6px 0; border-radius: 8px; }
.date-tile strong { font-size: 16px; }
.date-tile small { font-size: 8px; }
.deadline-item p { font-size: 11px; }
.deadline-item p span { font-size: 9px; }
.action-item { grid-template-columns: 32px 1fr auto; gap: 12px; min-height: 62px; }
.action-icon { width: 30px; height: 30px; border-radius: 8px; }
.action-item strong { font-size: 11px; }
.action-item small { font-size: 9px; }
.pill { min-height: 24px; padding: 0 9px; font-size: 9px; }

.table-card { overflow-x: auto; }
.data-table { min-width: 760px; font-variant-numeric: tabular-nums; }
.data-table th { padding: 12px 16px; color: #526662; background: #f7f9f7; font-size: 10px; letter-spacing: .075em; }
.data-table td { min-height: 52px; padding: 14px 16px; font-size: 12px; }
.data-table tbody tr { transition: background-color 140ms ease; }
.data-table tbody tr:hover { background: #f7faf8; }
.data-table .amount { text-align: right; font-weight: 750; }
.cell-title { gap: 10px; }
.cell-title > span:first-child { width: 32px; height: 32px; border-radius: 8px; }
.cell-title strong { font-size: 12px; }
.cell-title small { font-size: 10px; }
.empty-state { padding: 64px 24px; }
.empty-state span { width: 52px; height: 52px; border-radius: 14px; }
.empty-state strong { font-size: 19px; }
.empty-state p { margin-top: 9px; font-size: 12px; }

.document-grid, .vendor-grid, .app-summary-grid { gap: 16px; }
.document-card { padding: 18px; }
.document-card p { font-size: 10px; }
.file-icon { width: 42px; height: 46px; border-radius: 9px; }
.document-actions { margin-top: 4px; padding-top: 14px; }
.subscription-summary { gap: 16px; margin-bottom: 16px; }
.subscription-stat { gap: 14px; padding: 18px; }
.subscription-stat > span { width: 38px; height: 38px; }
.subscription-stat small { font-size: 10px; }
.subscription-stat strong { font-size: 20px; }
.catalog-toolbar { gap: 16px; padding: 16px 20px; }
.search-box input { height: 44px; font-size: 13px; }
.catalog-filters { gap: 8px; }
.catalog-filters button { min-height: 34px; padding: 0 11px; font-size: 9px; }
.vendor-grid { padding: 20px; }
.vendor-card { padding: 16px; border-radius: var(--radius-md); }
.vendor-card:hover { border-color: #aebfb7; box-shadow: 0 10px 24px rgba(19, 53, 48, .07); }
.vendor-logo { width: 40px; height: 40px; }
.vendor-logo img { width: 25px; height: 25px; }
.vendor-card small, .vendor-plans, .subscription-logo-cell small { font-size: 9px; }
.vendor-plans { min-height: 34px; margin: 14px 0; }

.apple-ads-card { gap: 24px; margin-bottom: 16px; padding: 20px 22px; border-color: var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: none; }
.apple-ads-brand h3 { font-size: 15px; }
.apple-ads-brand small { font-size: 10px; }
.apple-ads-status small { font-size: 9px; }
.apple-setup-steps { gap: 10px 12px; padding: 16px; }
.apple-setup-steps p { font-size: 10px; }
.redirect-uri-row input { font-size: 11px; }
.connection-error { font-size: 10px; }

.app-summary-card { padding: 20px; }
.app-metrics { gap: 12px; margin-top: 20px; }
.app-metrics span { font-size: 9px; }
.app-metrics strong { margin-top: 6px; font-size: 16px; font-variant-numeric: tabular-nums; }
.reconcile-summary { gap: 16px; margin-bottom: 16px; }
.mini-stat { padding: 18px 20px; }
.mini-stat span { font-size: 10px; }
.mini-stat strong { margin-top: 7px; font-size: 23px; }

.salary-controls { gap: 20px; padding: 20px; }
.salary-gross-field input { height: 48px; font-size: 22px; }
.salary-credit-toggle { min-height: 48px; padding: 10px 12px; }
.salary-credit-toggle strong { font-size: 11px; }
.salary-credit-toggle small { font-size: 9px; }
.salary-rate-summary { min-height: 48px; }
.salary-rate-summary span { font-size: 9px; }
.salary-rate-summary strong { font-size: 16px; }
.salary-hero { gap: 16px; margin: 16px 0; }
.salary-result-card { min-height: 144px; padding: 22px; }
.salary-result-card strong { font-size: 31px; font-variant-numeric: tabular-nums; }
.salary-result-card span, .salary-result-card small { font-size: 10px; }
.salary-detail-grid { gap: 16px; }
.salary-breakdown-list { padding-inline: 20px; }
.salary-breakdown-row { min-height: 64px; }
.salary-breakdown-row strong { font-size: 11px; }
.salary-breakdown-row small { font-size: 9px; }
.salary-breakdown-row > span { font-size: 12px; font-variant-numeric: tabular-nums; }
.salary-tax-bands > div { min-height: 104px; padding: 18px 20px; }
.salary-tax-bands span, .salary-tax-bands small { font-size: 9px; }
.salary-tax-bands strong { font-size: 20px; font-variant-numeric: tabular-nums; }

.tax-hero { gap: 16px; margin-bottom: 16px; }
.tax-card { padding: 22px; }
.tax-card span { font-size: 10px; }
.tax-card strong { font-size: 30px; font-variant-numeric: tabular-nums; }
.tax-card p { margin-top: 9px; font-size: 10px; }
.notice { gap: 12px; padding: 15px 16px; font-size: 10px; }

.modal-backdrop { background: rgba(5, 27, 28, .68); backdrop-filter: blur(8px); }
.modal { padding: 32px; border: 1px solid rgba(255,255,255,.7); border-radius: 16px; box-shadow: 0 32px 90px rgba(3, 25, 25, .3); }
.modal-close { top: 18px; right: 18px; width: 38px; height: 38px; }
.modal-lead { max-width: 70ch; margin-top: 9px; font-size: 12px; }
.drop-zone { min-height: 220px; border-radius: var(--radius-lg); }
.drop-zone strong { font-size: 13px; }
.drop-zone small { font-size: 10px; }
.modal-tip { padding: 14px 15px; font-size: 10px; }
.form-grid { gap: 16px; margin-top: 24px; }
.form-hint { margin: 14px 0 20px; font-size: 10px; }
.detail-file-bar { padding: 16px; }
.detail-file-bar small, .detail-metric span, .detail-metric small, .provider-detail-intro small { font-size: 9px; }
.detail-metrics { gap: 12px; }
.detail-metric { min-height: 96px; padding: 16px; }
.detail-metric strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.toast { padding: 15px 17px; border-radius: var(--radius-md); font-size: 11px; }

.auth-screen { background: radial-gradient(circle at 50% 8%, #285d58 0%, #103a3c 38%, #082628 100%); }
.auth-card { padding: 48px; border-radius: 20px; }
.auth-card h1 { font-size: 34px; }
.auth-card > p:not(.eyebrow):not(.auth-error) { font-size: 13px; }
.google-signin-button { min-height: 50px; font-size: 13px; }
.auth-card small { font-size: 10px; }

@media (max-width: 1320px) {
  .main-content { padding-inline: 28px; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .document-grid, .vendor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .salary-controls { grid-template-columns: 1fr 1fr; }
  .salary-rate-summary { grid-column: 1 / -1; }
}

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