:root {
  color-scheme: light;
  --ink: #172521;
  --muted: #63716c;
  --subtle: #87938e;
  --canvas: #f5f6f2;
  --surface: #ffffff;
  --surface-2: #f0f3ef;
  --line: #dce3de;
  --line-strong: #c6d0ca;
  --brand-950: #102b26;
  --brand-900: #15352f;
  --brand-800: #1d493f;
  --brand-700: #276052;
  --brand-100: #dcebe4;
  --accent: #c8943d;
  --accent-soft: #f5ead7;
  --positive: #237353;
  --positive-soft: #e1f2e9;
  --warning: #a45f16;
  --warning-soft: #f9ecd9;
  --danger: #a63f43;
  --danger-soft: #f9e7e7;
  --info: #315f92;
  --info-soft: #e8eff8;
  --shadow-sm: 0 1px 2px rgba(16, 43, 38, 0.05), 0 4px 12px rgba(16, 43, 38, 0.04);
  --shadow-lg: 0 24px 64px rgba(16, 43, 38, 0.22);
  --radius-sm: 8px;
  --radius: 13px;
  --radius-lg: 20px;
  --sidebar: 250px;
  --topbar: 66px;
  font-family: Inter, Aptos, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgba(49, 95, 146, 0.35); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 10px 14px; background: white; color: var(--brand-900); border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.loading-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--brand-950); color: #dfeae5; }
.loading-screen .brand-mark { width: 54px; height: 54px; font-size: 17px; }
.loading-screen p { margin: 0; }
.app-shell { min-height: 100vh; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar); display: flex; flex-direction: column; padding: 22px 14px 14px; overflow-y: auto; background: var(--brand-950); color: #dce8e3; }
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand-lockup > div:last-child { min-width: 0; display: grid; }
.brand-lockup strong { color: #fff; font-size: 14px; letter-spacing: .01em; }
.brand-lockup span { color: #9ab2aa; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.brand-mark { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 11px; background: linear-gradient(145deg, var(--brand-700), var(--brand-950)); color: #fff; font-family: Georgia, serif; font-size: 12px; letter-spacing: .08em; box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.quick-add { width: calc(100% - 16px); margin: 24px 8px 12px; padding: 10px 13px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; background: #f3f0e8; color: var(--brand-950); font-weight: 700; box-shadow: var(--shadow-sm); }
.quick-add:hover { background: #fff; }
.nav-groups { padding: 4px 0 20px; }
.nav-group + .nav-group { margin-top: 16px; }
.nav-label { margin: 0 12px 5px; color: #729087; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.nav-group a { min-height: 38px; padding: 8px 10px; display: flex; align-items: center; gap: 10px; color: #b8cbc4; border-radius: 8px; text-decoration: none; font-size: 13px; }
.nav-group a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-group a.active { background: rgba(255,255,255,.11); color: #fff; font-weight: 650; }
.nav-group a.active::after { content: ""; width: 3px; height: 19px; margin-left: auto; border-radius: 99px; background: var(--accent); }
.nav-icon { width: 18px; color: #8ba69d; text-align: center; font-size: 17px; line-height: 1; }
.sidebar-footer { margin-top: auto; padding: 13px 8px 0; border-top: 1px solid rgba(255,255,255,.1); display: grid; grid-template-columns: 32px 1fr 30px; align-items: center; gap: 9px; }
.sidebar-footer > div:nth-child(2) { min-width: 0; display: grid; }
.sidebar-footer strong { color: #fff; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer span { color: #7f9b92; font-size: 10px; }
.user-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-700); color: #fff; font-size: 10px; font-weight: 800; }

.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar); padding: 0 26px; display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.company-switcher select, .period-control select { max-width: 190px; padding: 8px 27px 8px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); font-weight: 650; }
.company-switcher select:hover, .period-control select:hover { border-color: var(--line); background-color: var(--surface-2); }
.search-field { width: min(390px, 38vw); height: 38px; margin: 0 auto; padding: 0 9px 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--canvas); color: var(--subtle); }
.search-field:focus-within { border-color: #8ba69d; box-shadow: 0 0 0 3px rgba(39,96,82,.12); }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-field kbd { padding: 2px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--subtle); font-family: inherit; font-size: 10px; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-button, .help-button { position: relative; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 17px; }
.icon-button:hover, .help-button:hover { border-color: var(--line); background: var(--surface-2); color: var(--ink); }
.icon-button.inverse { color: #9bb2aa; }
.menu-toggle { display: none; }
.help-button { width: 28px; height: 28px; border-color: var(--line-strong); border-radius: 50%; font-size: 12px; font-weight: 800; }
.notification-dot { position: absolute; top: 7px; right: 8px; width: 6px; height: 6px; border: 1px solid white; border-radius: 50%; background: var(--accent); }
.demo-banner { min-height: 42px; padding: 8px 26px; display: flex; align-items: center; justify-content: center; gap: 16px; background: var(--accent-soft); color: #694b1c; border-bottom: 1px solid #e6d1ae; font-size: 12px; }
.demo-banner button { padding: 3px 8px; border: 1px solid #cfac72; border-radius: 6px; background: rgba(255,255,255,.5); color: #694b1c; font-weight: 700; }

main { max-width: 1500px; margin: 0 auto; padding: 28px 30px 56px; }
.page-header { margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.page-title h1 { margin: 2px 0 3px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(25px, 3vw, 34px); line-height: 1.15; font-weight: 500; letter-spacing: -.02em; }
.page-title p { margin: 0; color: var(--muted); }
.eyebrow { margin: 0 0 5px; color: var(--brand-700); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.page-actions { display: flex; align-items: center; gap: 8px; }
.button { min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; font-size: 13px; }
.button.primary { background: var(--brand-800); color: #fff; box-shadow: 0 2px 6px rgba(16,43,38,.15); }
.button.primary:hover { background: var(--brand-700); }
.button.secondary { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.button.secondary:hover { background: var(--surface-2); }
.button.danger { border-color: #e5babc; background: var(--danger-soft); color: var(--danger); }
.button.small { min-height: 31px; padding: 5px 10px; font-size: 11px; }
.button.full { width: 100%; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--brand-700); font-weight: 700; }
.text-button:hover { text-decoration: underline; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-card, .card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.kpi-card { min-height: 139px; padding: 17px 18px; position: relative; overflow: hidden; }
.kpi-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--brand-700); }
.kpi-card.warning::before { background: var(--accent); }
.kpi-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.kpi-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: var(--brand-100); color: var(--brand-700); font-size: 15px; }
.kpi-value { margin-top: 15px; display: block; font-family: Georgia, serif; font-size: 25px; line-height: 1; letter-spacing: -.02em; }
.kpi-meta { margin-top: 11px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.trend-up, .trend-down { padding: 2px 5px; border-radius: 99px; font-weight: 800; }
.trend-up { background: var(--positive-soft); color: var(--positive); }
.trend-down { background: var(--danger-soft); color: var(--danger); }
.dashboard-grid { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .85fr); gap: 14px; }
.dashboard-stack { display: grid; gap: 14px; align-content: start; }
.card { min-width: 0; }
.card-header { min-height: 62px; padding: 14px 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.card-header h2, .card-header h3 { margin: 0; font-size: 14px; line-height: 1.25; }
.card-header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 18px; }
.card-link { color: var(--brand-700); font-size: 11px; font-weight: 800; text-decoration: none; }
.card-link:hover { text-decoration: underline; }

.cash-summary { display: grid; grid-template-columns: 145px 1fr; align-items: center; gap: 28px; }
.donut { --percent: 70%; width: 130px; aspect-ratio: 1; margin: auto; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--brand-700) 0 var(--percent), var(--accent) var(--percent) 83%, #dfe5e1 83% 100%); position: relative; }
.donut::after { content: ""; position: absolute; width: 72%; height: 72%; border-radius: 50%; background: var(--surface); }
.donut-center { z-index: 1; display: grid; text-align: center; }
.donut-center strong { font-family: Georgia, serif; font-size: 17px; }
.donut-center span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.cash-bars { display: grid; gap: 13px; }
.cash-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; }
.cash-row span { color: var(--muted); font-size: 11px; }
.cash-row strong { font-size: 12px; }
.bar-track { grid-column: 1 / -1; height: 6px; overflow: hidden; border-radius: 99px; background: #e8ece9; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--brand-700); }
.bar-fill.gold { background: var(--accent); }
.bar-fill.slate { background: #8c9b95; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 14px; background: #fafbf9; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 14px; border-top: 1px solid var(--line); color: #293832; font-size: 12px; vertical-align: middle; }
tbody tr:hover { background: #fbfcfa; }
.align-right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }
.primary-cell { display: grid; gap: 1px; }
.primary-cell strong { font-size: 12px; }
.primary-cell span { color: var(--muted); font-size: 10px; }
.status { width: max-content; padding: 3px 7px; display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.good { background: var(--positive-soft); color: var(--positive); }
.status.warn { background: var(--warning-soft); color: var(--warning); }
.status.bad { background: var(--danger-soft); color: var(--danger); }
.status.info { background: var(--info-soft); color: var(--info); }
.status.neutral { background: var(--surface-2); color: var(--muted); }
.property-name { display: flex; align-items: center; gap: 9px; }
.property-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 7px; background: var(--brand-100); color: var(--brand-700); font-weight: 800; }
.property-icon.gold { background: var(--accent-soft); color: var(--warning); }
.property-icon.blue { background: var(--info-soft); color: var(--info); }
.progress { width: 76px; height: 5px; overflow: hidden; border-radius: 99px; background: var(--line); }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--brand-700); }

.queue-list { list-style: none; margin: 0; padding: 0; }
.queue-list li { padding: 13px 16px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.queue-list li:first-child { border-top: 0; }
.queue-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--warning-soft); color: var(--warning); font-weight: 800; }
.queue-list strong { display: block; font-size: 11px; }
.queue-list p { margin: 1px 0 0; color: var(--muted); font-size: 10px; }
.queue-list time { color: var(--muted); font-size: 10px; }
.mini-metrics { display: grid; grid-template-columns: 1fr 1fr; }
.mini-metric { padding: 16px; }
.mini-metric + .mini-metric { border-left: 1px solid var(--line); }
.mini-metric span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.mini-metric strong { margin-top: 3px; display: block; font-family: Georgia, serif; font-size: 20px; }

.toolbar { margin-bottom: 14px; padding: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.toolbar label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.toolbar select, .toolbar input { height: 34px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); }
.toolbar-search { min-width: 210px; flex: 1; }
.toolbar .button { margin-left: auto; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 14px; }
.stats-row { margin-bottom: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat-card { padding: 15px 16px; }
.stat-card span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.stat-card strong { margin-top: 7px; display: block; font-family: Georgia, serif; font-size: 22px; }
.stat-card small { color: var(--muted); }
.account-card { padding: 17px; }
.account-card + .account-card { margin-top: 10px; }
.account-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.account-card h3 { margin: 0; font-size: 13px; }
.account-card p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.account-card-balance { margin-top: 16px; display: flex; align-items: end; justify-content: space-between; }
.account-card-balance strong { font-family: Georgia, serif; font-size: 22px; }
.account-card-balance span { color: var(--muted); font-size: 10px; }
.reconcile-callout { padding: 16px; border: 1px solid #ead9bd; border-radius: var(--radius); background: linear-gradient(145deg, #fffaf2, var(--accent-soft)); }
.reconcile-callout h3 { margin: 0 0 5px; font-size: 13px; }
.reconcile-callout p { margin: 0 0 13px; color: #72552a; font-size: 11px; }

.property-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.property-card { overflow: hidden; }
.property-card-top { height: 80px; padding: 16px; position: relative; background: linear-gradient(135deg, var(--brand-800), #376e5f); color: #fff; }
.property-card:nth-child(2) .property-card-top { background: linear-gradient(135deg, #71552d, #ad8242); }
.property-card:nth-child(3) .property-card-top { background: linear-gradient(135deg, #3e5968, #6f8997); }
.property-card-top::after { content: ""; position: absolute; width: 100px; height: 100px; right: -22px; top: -30px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; }
.property-card-top span { font-size: 10px; opacity: .75; text-transform: uppercase; letter-spacing: .09em; }
.property-card-top h3 { margin: 6px 0 0; font-family: Georgia, serif; font-size: 17px; font-weight: 500; }
.property-card-body { padding: 15px; }
.property-card-body > p { margin: 0 0 14px; color: var(--muted); font-size: 11px; }
.property-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.property-metrics span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.property-metrics strong { display: block; margin-top: 2px; font-size: 12px; }

.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.report-card { min-height: 156px; padding: 18px; display: flex; flex-direction: column; }
.report-card-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--brand-100); color: var(--brand-700); font-size: 17px; }
.report-card h3 { margin: 13px 0 4px; font-size: 13px; }
.report-card p { margin: 0; color: var(--muted); font-size: 11px; }
.report-card .card-link { margin-top: auto; padding-top: 12px; }

.settings-layout { display: grid; grid-template-columns: 205px minmax(0,1fr); gap: 14px; }
.settings-menu { align-self: start; padding: 8px; }
.settings-menu button { width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); text-align: left; font-weight: 650; font-size: 12px; }
.settings-menu button.active { background: var(--brand-100); color: var(--brand-800); }
.settings-section { padding: 20px; }
.settings-section h2 { margin: 0 0 4px; font-size: 16px; }
.settings-section > p { margin: 0 0 22px; color: var(--muted); }
.settings-form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
label { color: #35443f; font-size: 11px; font-weight: 700; }
label input, label select, label textarea { width: 100%; margin-top: 5px; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }
label textarea { resize: vertical; }
label input:focus, label select:focus, label textarea:focus { border-color: var(--brand-700); outline: 3px solid rgba(39,96,82,.12); }
.check-label { display: flex; align-items: center; gap: 7px; font-weight: 500; }
.check-label input { width: 15px; margin: 0; }
.span-2 { grid-column: span 2; }
.positive { color: var(--positive) !important; }
.negative { color: var(--danger) !important; }
.warning-text { color: var(--warning); }
.dashboard-stack-main { min-width: 0; display: grid; gap: 14px; align-content: start; }
.reconcile-progress { margin-bottom: 14px; padding: 17px 18px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 13px 24px; }
.reconcile-progress h2 { margin: 0; font-size: 15px; }
.difference-target { grid-row: 1; grid-column: 2; display: grid; text-align: right; }
.difference-target span, .difference-target small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.difference-target strong { color: var(--warning); font-family: Georgia, serif; font-size: 20px; }
.progress.wide { grid-column: 1 / -1; width: 100%; }
.segmented.compact { width: 210px; margin: 0; grid-template-columns: 1fr 1fr; }
.segmented.compact label { padding: 5px 8px; font-size: 9px; }
.journal-tip, .accounting-note { margin-top: 14px; padding: 15px 17px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; }
.journal-tip h3, .accounting-note h3 { margin: 0 0 2px; font-size: 12px; }
.journal-tip p, .accounting-note p { margin: 0; color: var(--muted); font-size: 10px; }
.accounting-note { border: 1px solid #ead9bd; border-radius: var(--radius); background: var(--accent-soft); }
.property-open { margin-top: 15px; font-size: 11px; }
.report-controls { margin-bottom: 14px; padding: 14px; display: grid; grid-template-columns: repeat(4, minmax(120px,1fr)) auto; align-items: end; gap: 10px; }
.scheduled-card { margin-top: 14px; }
.scheduled-card .empty-state { min-height: 220px; }
.security-list { border-top: 1px solid var(--line); }
.security-list > div { padding: 14px 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); }
.security-list strong { font-size: 12px; }
.security-list p { margin: 1px 0 0; color: var(--muted); font-size: 10px; }
.security-control { grid-template-columns: 1fr auto !important; }
.audit-toolbar { padding: 0 0 14px; border-width: 0 0 1px; border-radius: 0; box-shadow: none; }
.queue-summary { padding: 22px 18px; display: grid; gap: 3px; }
.queue-summary strong { font-family: Georgia, serif; font-size: 30px; color: var(--brand-800); }
.queue-summary span { color: var(--ink); font-weight: 700; }
.queue-summary p { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.secondary-section { margin-top: 14px; }
.report-availability { width: max-content; margin-top: auto; padding-top: 13px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.report-availability.good { color: var(--positive); }
.report-availability.bad { color: var(--danger); }
.settings-readout { display: grid; border-top: 1px solid var(--line); }
.settings-readout > div { padding: 13px 0; display: grid; grid-template-columns: minmax(130px, .4fr) 1fr; gap: 18px; border-bottom: 1px solid var(--line); }
.settings-readout span { color: var(--muted); font-size: 11px; }
.settings-readout strong { font-size: 12px; }
.unavailable-state .state-icon { background: var(--warning-soft); color: var(--warning); }

.empty-state, .error-state { min-height: 260px; padding: 40px 24px; display: grid; place-content: center; justify-items: center; text-align: center; }
.state-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--brand-700); font-size: 22px; }
.empty-state h2, .error-state h2 { margin: 15px 0 5px; font-size: 16px; }
.empty-state p, .error-state p { max-width: 370px; margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.error-state .state-icon { background: var(--danger-soft); color: var(--danger); }
.skeleton { overflow: hidden; position: relative; border-radius: 6px; background: #e7ebe8; color: transparent !important; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); transform: translateX(-100%); animation: shimmer 1.5s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(350px, .9fr) minmax(520px, 1.1fr); }
.auth-brand { min-height: 100vh; padding: 38px clamp(36px, 6vw, 90px); display: flex; flex-direction: column; background: radial-gradient(circle at 75% 15%, rgba(200,148,61,.2), transparent 28%), linear-gradient(145deg, var(--brand-950), #1b433a); color: #d7e5df; }
.auth-brand .brand-lockup { padding: 0; }
.auth-message { margin: auto 0; max-width: 560px; }
.auth-message .eyebrow { color: #d8b878; }
.auth-message h1 { margin: 10px 0 18px; color: #fff; font-family: Georgia, serif; font-size: clamp(34px, 4vw, 52px); line-height: 1.08; font-weight: 400; letter-spacing: -.03em; }
.auth-message > p:not(.eyebrow) { max-width: 470px; color: #b9ccc5; font-size: 16px; }
.auth-message ul { margin: 28px 0 0; padding: 0; display: grid; gap: 11px; list-style: none; }
.auth-message li { display: flex; align-items: center; gap: 10px; }
.auth-message li span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.1); color: #ebcf97; font-size: 11px; }
.auth-footnote { margin: 0; color: #809c92; font-size: 11px; }
.auth-panel { min-height: 100vh; padding: 40px 24px; display: grid; place-items: center; background: var(--canvas); }
.auth-card { width: min(420px, 100%); padding: 36px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 16px 55px rgba(16,43,38,.09); }
.auth-card h2 { margin: 0; font-family: Georgia, serif; font-size: 29px; font-weight: 500; }
.auth-card > p:not(.eyebrow):not(.form-error):not(.security-note) { margin: 6px 0 24px; color: var(--muted); }
.auth-card > label { margin-top: 15px; display: block; }
.form-row { margin: 16px 0; display: flex; align-items: center; gap: 12px; }
.form-row.between { justify-content: space-between; }
.auth-card .button + .button { margin-top: 9px; }
.security-note { margin: 18px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.form-error { margin: 10px 0; padding: 8px 10px; border-radius: 7px; background: var(--danger-soft); color: var(--danger); font-size: 11px; }

.app-dialog { width: min(670px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 0; overflow: auto; border: 0; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.app-dialog::backdrop { background: rgba(12,30,26,.65); backdrop-filter: blur(3px); }
.dialog-header, .dialog-footer { padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-header { border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.dialog-footer { border-top: 1px solid var(--line); justify-content: flex-end; }
.dialog-body { padding: 20px; }
.segmented { margin-bottom: 18px; padding: 3px; display: grid; grid-template-columns: repeat(3,1fr); border-radius: 8px; background: var(--surface-2); }
.segmented input { position: absolute; opacity: 0; }
.segmented label { margin: 0; padding: 7px 10px; border-radius: 6px; text-align: center; cursor: pointer; }
.segmented input:checked + label { background: var(--surface); color: var(--brand-800); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + label { outline: 3px solid rgba(49,95,146,.35); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 360px; padding: 12px 14px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid #bed8ca; border-radius: 10px; background: #f5fcf8; color: #1e5b41; box-shadow: var(--shadow-lg); animation: toast-in .25s ease-out; }
.toast strong { display: block; font-size: 12px; }
.toast span { color: #4d6e60; font-size: 10px; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.mobile-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(12,30,26,.55); }
.noscript { padding: 20px; background: var(--danger-soft); color: var(--danger); text-align: center; }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-stack { grid-template-columns: 1fr 1fr; }
  .property-grid, .report-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .auth-screen { grid-template-columns: .8fr 1.2fr; }
  .auth-message h1 { font-size: 36px; }
  .report-controls { grid-template-columns: repeat(2, minmax(150px,1fr)); }
  .report-controls .button { align-self: end; }
}

@media (max-width: 820px) {
  :root { --sidebar: 270px; }
  .sidebar { transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .workspace { margin-left: 0; }
  .menu-toggle { display: grid; }
  .topbar { padding: 0 14px; gap: 8px; }
  .company-switcher { display: none; }
  .search-field { width: auto; flex: 1; margin: 0; }
  .search-field kbd { display: none; }
  .period-control { display: none; }
  main { padding: 22px 18px 45px; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-brand { min-height: auto; padding: 28px; }
  .auth-message { margin: 55px 0 35px; }
  .auth-message h1 { max-width: 620px; }
  .auth-message ul, .auth-footnote { display: none; }
  .auth-panel { min-height: auto; padding: 32px 18px; }
}

@media (max-width: 620px) {
  .demo-banner { padding: 8px 14px; align-items: flex-start; }
  .page-header { align-items: stretch; flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .kpi-grid, .stats-row, .dashboard-stack, .property-grid, .report-grid { grid-template-columns: 1fr; }
  .cash-summary { grid-template-columns: 1fr; }
  .cash-bars { width: 100%; }
  .property-grid { gap: 10px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-menu { display: flex; overflow-x: auto; }
  .settings-menu button { width: auto; white-space: nowrap; }
  .settings-form, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .auth-message { margin: 40px 0 5px; }
  .auth-message h1 { font-size: 30px; }
  .auth-message > p:not(.eyebrow) { display: none; }
  .auth-card { padding: 25px 20px; }
  .toast-region { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; }
  .reconcile-progress { grid-template-columns: 1fr; }
  .difference-target { grid-column: 1; grid-row: auto; text-align: left; }
  .journal-tip, .accounting-note { grid-template-columns: auto 1fr; }
  .journal-tip .button, .accounting-note .button { grid-column: 1 / -1; }
  .report-controls { grid-template-columns: 1fr; }
  .report-controls .button { width: 100%; }
}

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

@media print {
  .sidebar, .topbar, .demo-banner, .page-actions, .toolbar, .toast-region { display: none !important; }
  .workspace { margin: 0; }
  main { max-width: none; padding: 0; }
  .card, .kpi-card { break-inside: avoid; box-shadow: none; }
  body { background: white; }
}
