:root {
    color-scheme: light;
    --ink: #243144;
    --ink-strong: #17212b;
    --muted: #5d6b78;
    --muted-soft: #7b8793;
    --line: #d7dce1;
    --line-soft: #e8ebed;
    --paper: #fff;
    --canvas: #f4f5f7;
    --nav: #163247;
    --nav-hover: #25465d;
    --nav-active: #345c73;
    --brand: #2ca01c;
    --brand-dark: #247d16;
    --brand-soft: #eaf6e8;
    --focus: #0875e1;
    --success: #108a00;
    --danger: #d52b1e;
    --warning: #b85c00;
    --purple: #6b4eff;
    --sidebar-width: 240px;
    --topbar-height: 58px;
    font-family: "Avenir Next", Avenir, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 14px; line-height: 1.42; }
a { color: #236c9c; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 14px; color: inherit; background: #fff; border: 1px solid #8d9aa3; border-radius: 3px; font-weight: 650; cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--focus) 24%, transparent);
    outline-offset: 1px;
}
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
kbd { font-family: inherit; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.icon { display: inline-flex; width: 18px; height: 18px; flex: 0 0 auto; align-items: center; justify-content: center; }
.icon svg { display: block; width: 100%; height: 100%; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* QBO-style application frame */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); transition: grid-template-columns .18s ease; }
.workspace { min-width: 0; min-height: 100vh; }
.sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 100vh;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 10px;
    padding: 12px 10px 10px;
    color: #fff;
    background: var(--nav);
    box-shadow: 1px 0 0 rgba(0, 0, 0, .12);
}
.sidebar-head { height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: #fff; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 31px; height: 31px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font-size: 16px; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.brand-dark { color: var(--ink-strong); }
.sidebar-collapse { width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0; color: #c8d7df; background: transparent; border: 0; border-radius: 4px; cursor: pointer; }
.sidebar-collapse:hover { color: #fff; background: var(--nav-hover); }
.sidebar-collapse .icon { width: 16px; height: 16px; transition: transform .18s ease; }
.company-switcher {
    width: 100%; min-width: 0; display: grid; grid-template-columns: 30px minmax(0, 1fr) 16px; align-items: center; gap: 9px;
    padding: 7px 8px; color: #fff; background: transparent; border: 0; border-radius: 4px; text-align: left;
}
.company-avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 3px; color: var(--nav); background: #cfe4ee; font-size: 12px; font-weight: 800; }
.company-copy { min-width: 0; display: grid; line-height: 1.2; }
.company-copy strong, .company-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-copy strong { font-size: 13px; font-weight: 650; }
.company-copy small { margin-top: 3px; color: #b8cad5; font-size: 10px; }
.company-switcher > .icon { width: 14px; height: 14px; color: #b8cad5; }
.create-menu { position: relative; }
.create-button {
    height: 38px; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 4px;
    color: #fff; background: var(--brand); border-radius: 3px; font-weight: 700; cursor: pointer; box-shadow: 0 1px 1px rgba(0, 0, 0, .14);
}
.create-button:hover { background: #35ad25; }
.create-button .icon { width: 17px; height: 17px; stroke-width: 2.4; }
.popover { position: relative; }
.popover-panel {
    position: absolute; z-index: 100; padding: 16px; color: var(--ink); background: #fff; border: 1px solid #c7cdd1; border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}
.create-panel { top: 44px; left: 4px; width: 420px; }
.popover-title { margin: 0 0 12px; color: var(--ink-strong); font-size: 15px; font-weight: 700; }
.create-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.create-grid a { display: flex; align-items: center; gap: 10px; min-height: 43px; padding: 8px 10px; color: var(--ink); border-radius: 3px; }
.create-grid a:hover { background: #f1f5f7; text-decoration: none; }
.create-grid .icon { color: #3d596a; }
.side-nav { min-height: 0; overflow: auto; padding: 2px 0 8px; scrollbar-width: thin; scrollbar-color: #587184 transparent; }
.side-nav a, .nav-group summary, .sidebar-foot button {
    min-height: 36px; display: flex; align-items: center; gap: 11px; padding: 7px 11px; color: #eaf2f6; border-radius: 3px; font-size: 13px; font-weight: 550; cursor: pointer;
}
.side-nav a:hover, .nav-group summary:hover, .sidebar-foot button:hover { color: #fff; background: var(--nav-hover); text-decoration: none; }
.side-nav a.active, .nav-group summary.active { color: #fff; background: var(--nav-active); box-shadow: inset 3px 0 0 #69c95b; }
.side-nav > a > .icon, .nav-primary a .icon, .nav-summary-label > .icon, .sidebar-foot .icon { width: 17px; height: 17px; color: #c5d4dc; }
.side-nav a.active > .icon, .nav-group summary.active .icon { color: #fff; }
.nav-primary { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.nav-label { margin: 13px 11px 5px; color: #9eb5c2; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.nav-group { margin: 2px 0; }
.nav-group summary { justify-content: space-between; }
.nav-summary-label { min-width: 0; display: flex; align-items: center; gap: 11px; }
.nav-group summary > .icon { width: 14px; height: 14px; color: #a8bdc9; transition: transform .16s ease; }
.nav-group[open] summary > .icon { transform: rotate(180deg); }
.nav-children { margin: 2px 0 6px 17px; padding-left: 15px; border-left: 1px solid #456276; }
.nav-children a { min-height: 31px; padding: 5px 10px; color: #cbdbe3; font-size: 12px; font-weight: 500; }
.nav-children a.active { margin-left: -16px; padding-left: 25px; }
.all-apps { margin-top: 8px; border-top: 1px solid rgba(255, 255, 255, .12); border-radius: 0 !important; }
.sidebar-foot { padding-top: 7px; border-top: 1px solid rgba(255, 255, 255, .12); }
.sidebar-foot button { width: 100%; border: 0; background: transparent; }

.topbar {
    position: sticky; top: 0; z-index: 40; height: var(--topbar-height); display: flex; align-items: center; gap: 18px;
    padding: 0 18px; background: #fff; border-bottom: 1px solid #ccd3d8; box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.nav-toggle { display: none; width: 34px; height: 34px; padding: 8px; background: transparent; border: 0; border-radius: 3px; cursor: pointer; }
.nav-toggle > span:not(.sr-only) { display: block; height: 2px; margin: 3px 0; background: var(--ink); }
.global-search { width: min(680px, 55vw); height: 36px; display: flex; align-items: center; gap: 9px; margin: 0 auto; padding: 0 10px; background: #f2f5f7; border: 1px solid #aab4bc; border-radius: 3px; }
.global-search:focus-within { background: #fff; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.global-search .icon { color: #455a68; }
.global-search input { width: 100%; min-width: 80px; padding: 0; color: var(--ink); background: transparent; border: 0; outline: 0; }
.global-search input::placeholder { color: #687782; }
.global-search kbd { padding: 1px 6px; color: #647480; background: #fff; border: 1px solid #cbd2d7; border-radius: 3px; font-size: 11px; box-shadow: 0 1px 0 #cbd2d7; }
.top-actions { display: flex; align-items: center; gap: 2px; }
.top-action { height: 34px; min-width: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 8px; color: #314c5c; background: transparent; border: 0; border-radius: 3px; cursor: pointer; }
.top-action:hover { background: #eef2f4; }
.top-action-wide { padding: 0 10px; border: 1px solid #96a7b1; font-size: 12px; font-weight: 650; }
.ai-mark { color: var(--purple); font-size: 17px; }
.profile-button { width: 32px; height: 32px; display: grid; place-items: center; margin-left: 5px; color: #fff; background: #385d70; border-radius: 50%; font-size: 12px; font-weight: 750; cursor: pointer; }
.top-menu-panel { top: 41px; right: 0; width: 280px; }
.top-menu-panel p:not(.popover-title) { margin: -4px 0 10px; color: var(--muted); font-size: 12px; }
.top-menu-panel > a { display: flex; align-items: center; gap: 8px; padding: 8px; color: var(--ink); border-radius: 3px; }
.top-menu-panel > a:hover { background: #eef2f4; text-decoration: none; }
.settings-links { display: grid; gap: 2px; }
.settings-links strong { margin: 7px 8px 3px; color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.settings-links strong:first-child { margin-top: 0; }
.settings-links a { padding: 7px 8px; color: var(--ink); border-radius: 3px; }
.settings-links a:hover { background: #eef2f4; text-decoration: none; }
.profile-panel { top: 41px; right: 0; width: 240px; display: grid; gap: 4px; }
.profile-panel > strong, .profile-panel > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-panel > small { color: var(--muted); }
.profile-panel hr { width: 100%; margin: 10px 0; border: 0; border-top: 1px solid var(--line-soft); }
.profile-panel a, .profile-panel button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px; color: var(--ink); background: transparent; border: 0; border-radius: 3px; text-align: left; cursor: pointer; }
.profile-panel a:hover, .profile-panel button:hover { background: #f0f3f5; text-decoration: none; }
.profile-panel form { margin: 0; }
.nav-scrim { display: none; }

.page-wrap { width: 100%; padding: 24px 28px 56px; }
.page-heading { min-height: 56px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 0 0 17px; }
.page-heading h1 { margin: 1px 0 0; color: var(--ink-strong); font-size: 26px; font-weight: 650; line-height: 1.2; letter-spacing: -.025em; }
.eyebrow { margin: 0; color: var(--muted); font-size: 11px; font-weight: 600; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.panel { min-width: 0; padding: 22px; background: var(--paper); border: 1px solid #d2d7da; border-radius: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }

/* Buttons, forms, notices */
button, .primary-button, a[data-kind] { min-height: 34px; border-radius: 3px; cursor: pointer; }
a[data-kind] {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 14px; background: #fff; border: 1px solid #8d9aa3; font-weight: 650;
}
.primary-button, button[type="submit"], a[data-kind="primary"] { color: #fff; background: var(--brand); border-color: var(--brand); }
.primary-button:hover, button[type="submit"]:hover, a[data-kind="primary"]:hover { color: #fff; background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; }
a[data-kind="secondary"] { color: #31576c; background: #fff; }
a[data-kind="secondary"]:hover { background: #edf2f5; text-decoration: none; }
input, select, textarea { max-width: 100%; min-height: 34px; padding: 7px 10px; color: var(--ink); background: #fff; border: 1px solid #9ca8b0; border-radius: 3px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--focus) 18%, transparent); border-color: var(--focus); }
input[type="checkbox"], input[type="radio"] { min-height: auto; accent-color: var(--brand); }
input[type="file"] { padding: 5px; }
label { color: var(--ink-strong); }
.notice { padding: 11px 14px; margin-bottom: 15px; border: 1px solid transparent; border-radius: 3px; }
.notice-success { color: #246300; background: #edfae8; border-color: #a6d99e; }
.notice-error { color: #a71910; background: #fff0ef; border-color: #eeaaa5; }

/* Dense accounting content */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
th { height: 38px; padding: 9px 10px; color: #405362; background: #f3f5f6; border-top: 1px solid var(--line); border-bottom: 1px solid #cbd2d7; text-align: left; font-size: 11px; font-weight: 750; letter-spacing: .015em; vertical-align: middle; }
th:first-child { border-left: 1px solid var(--line); }
th:last-child { border-right: 1px solid var(--line); }
td { min-height: 42px; padding: 10px; background: #fff; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:hover td { background: #f7fafb; }
tbody tr:last-child td { border-bottom-color: var(--line); }
.table-wrap, .overflow-x-auto { width: 100%; overflow-x: auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.card { padding: 18px; background: #fff; border: 1px solid #d4d9dc; border-radius: 4px; }
.card-title { min-height: 32px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; color: var(--ink-strong); font-size: 17px; font-weight: 650; }
.stat-card { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; padding: 14px; color: var(--ink); background: #f4f8f3; border: 1px solid #cbdcc7; border-left: 4px solid var(--brand); border-radius: 3px; }
.stat-card:hover { background: #edf7ea; text-decoration: none; }
.stat-label { font-weight: 650; }
.stat-value { grid-row: span 2; align-self: center; color: var(--ink-strong); font-size: 24px; font-weight: 700; }
.stat-sub { color: var(--muted); font-size: 12px; }
.quick-link { min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 9px 11px; color: var(--ink); border: 1px solid var(--line); border-radius: 3px; }
.quick-link:hover { color: var(--ink); background: #f3f6f7; border-color: #b5c0c7; text-decoration: none; }
.quick-link .icon { color: #2d697f; }
.badge { display: inline-flex; align-items: center; min-height: 21px; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-gray { color: #52616d; background: #e9edef; }
.badge-blue { color: #145b88; background: #dff2ff; }
.badge-green { color: #2b6500; background: #e4f5dc; }
.badge-red { color: #9e1d15; background: #ffe4e1; }
.empty-state { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; text-align: center; }
.empty-state > .icon { width: 38px; height: 38px; color: #6f7c84; }
.empty-state h3 { margin: 14px 0 4px; color: var(--ink-strong); font-size: 18px; }
.empty-state p { max-width: 480px; margin: 0; color: var(--muted); }
.empty-actions { display: flex; gap: 8px; margin-top: 18px; }
.report-header { margin-bottom: 20px; text-align: center; }
.report-company { color: var(--ink-strong); font-weight: 650; }
.report-title { margin-top: 4px; font-size: 22px; font-weight: 700; }
.report-period { margin-top: 2px; color: var(--muted); font-size: 12px; }

/* QBO-style dashboard composition */
.dashboard-launcher, .dashboard-glance, .dashboard-activity { margin-bottom: 30px; }
.dashboard-activity { margin-bottom: 0; }
.dashboard-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.dashboard-section-heading h2 { margin: 0; color: var(--ink-strong); font-size: 19px; font-weight: 650; letter-spacing: -.015em; }
.dashboard-section-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.action-chips { display: flex; gap: 9px; padding: 3px 1px 8px; overflow-x: auto; scrollbar-width: thin; }
.action-chips a { min-width: max-content; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: #284c60; background: #fff; border: 1px solid #aebbc3; border-radius: 999px; font-size: 12px; font-weight: 650; box-shadow: 0 1px 1px rgba(0, 0, 0, .04); }
.action-chips a:hover { color: #17394c; background: #eef5f7; border-color: #7793a3; text-decoration: none; }
.action-chips .icon { width: 16px; height: 16px; color: var(--brand-dark); }
.privacy-toggle { display: inline-flex; align-items: center; gap: 7px; min-width: max-content; padding: 6px 9px; color: #31576c; border-radius: 3px; font-size: 12px; font-weight: 600; }
.privacy-toggle:hover { background: #eef2f4; text-decoration: none; }
.dashboard-widgets > [id^="widget-"] { min-width: 0; margin: 0; padding: 18px; background: #fff; border: 1px solid #d4d9dc; border-radius: 4px; }
.dashboard-widgets > [id^="widget-"] > header { min-height: 32px; margin-bottom: 9px; }
.dashboard-widgets > [id^="widget-"] > header h2 { margin: 0; color: var(--ink-strong); font-size: 17px; font-weight: 650; }
.dashboard-widgets table th { background: transparent; border-top: 0; }
.dashboard-widgets table td { padding-right: 5px; padding-left: 5px; }
.dashboard-widgets .bg-purple { background: #315f74; }
.dashboard-activity .card { min-width: 0; }
.dashboard-bank-card .quick-link { background: #fafbfb; }

/* QBO-style list toolbar and row actions */
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.list-search { width: min(360px, 100%); height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 9px; background: #fff; border: 1px solid #9ca8b0; border-radius: 3px; }
.list-search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.list-search .icon { width: 16px; height: 16px; color: var(--muted); }
.list-search input { width: 100%; min-height: 30px; padding: 0; border: 0; outline: 0; }
.list-toolbar select { width: auto; min-width: 160px; }
.toolbar-button, .icon-button { color: #31576c; background: #fff; border-color: #8d9aa3; }
.toolbar-button:hover, .icon-button:hover { background: #edf2f5; }
.toolbar-button .icon, .icon-button .icon { width: 15px; height: 15px; }
.icon-button { width: 34px; padding: 0; }
.toolbar-link { padding: 7px 4px; font-weight: 600; }
.toolbar-count { margin-left: auto; color: var(--muted); font-size: 12px; }
.data-table th { white-space: nowrap; }
.account-code { color: #4b5f6d; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; font-weight: 650; }
.account-name { color: #166890; font-weight: 650; }
.row-actions { position: relative; display: inline-block; text-align: left; }
.row-actions summary { min-width: 70px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 5px 8px; color: #245d7b; background: #fff; border: 1px solid #8fa1ab; border-radius: 3px; font-size: 12px; font-weight: 650; cursor: pointer; }
.row-actions summary:hover { background: #eef3f5; }
.row-actions summary .icon { width: 12px; height: 12px; }
.row-actions > div { position: absolute; right: 0; z-index: 20; min-width: 155px; margin-top: 3px; padding: 4px; background: #fff; border: 1px solid #b7c0c5; border-radius: 3px; box-shadow: 0 5px 14px rgba(0, 0, 0, .17); }
.row-actions > div a { display: block; padding: 7px 9px; color: var(--ink); border-radius: 2px; white-space: nowrap; }
.row-actions > div a:hover { background: #eef2f4; text-decoration: none; }

/* Banking review centre */
.bank-moneybar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: -22px -22px 18px; background: #f5f7f8; border-bottom: 1px solid #cbd2d7; }
.bank-moneybar > a, .moneybar-summary { min-width: 0; display: grid; gap: 2px; padding: 13px 16px 11px; color: var(--ink); border-right: 1px solid #d7dcdf; border-bottom: 4px solid transparent; }
.bank-moneybar > a:hover { background: #edf2f4; text-decoration: none; }
.bank-moneybar > a.active { background: #fff; border-bottom-color: var(--brand); }
.bank-moneybar span, .moneybar-summary span { overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .035em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.bank-moneybar strong, .moneybar-summary strong { color: var(--ink-strong); font-size: 19px; font-weight: 650; }
.bank-moneybar small, .moneybar-summary small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.moneybar-summary { border-right: 0; background: #f1f5f7; }
.bank-review-toolbar { padding-bottom: 13px; border-bottom: 1px solid var(--line-soft); }
.bank-review-toolbar input[type="date"] { width: 142px; }
.bank-review-toolbar select { max-width: 230px; }
.bank-review-table th:nth-child(1) { width: 105px; }
.bank-review-table th:nth-child(3), .bank-review-table th:nth-child(4) { width: 100px; }
.bank-review-table th:nth-child(5) { width: 78px; }
.bank-review-table th:nth-child(7) { min-width: 285px; }
.amount-spent { color: var(--danger); }
.amount-received { color: var(--success); }
.suggestion-pill { display: inline-block; max-width: 100%; padding: 3px 7px; color: #285d72; background: #e6f4f8; border-radius: 999px; font-size: 10px; }
.attachment-link { display: inline-flex; padding: 4px; }
.attach-actions summary { min-width: 32px; width: 32px; height: 30px; padding: 0; }
.attach-actions > div { right: auto; left: 0; width: 310px; }
.attach-actions form { display: grid; gap: 8px; }
.attach-actions input[type="file"] { width: 100%; }
.bank-source { display: block; min-width: 150px; color: #405866; font-size: 12px; }
.review-action-cell { min-width: 285px; }
.review-form { display: grid; grid-template-columns: minmax(145px, 1fr) minmax(120px, .75fr); gap: 6px; }
.review-form input[type="password"] { grid-column: 1 / -1; }
.review-buttons { grid-column: 1 / -1; display: flex; gap: 6px; }
.exclude-form { display: inline-block; margin-top: 6px; }
.review-action-cell .toolbar-button { min-height: 31px; padding: 5px 10px; }

/* Authentication stays isolated from the app shell. */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, #e9f5e7, transparent 35%), #f4f5f7; }
.login-card { width: min(430px, 100%); padding: 34px; background: #fff; border: 1px solid #d5dade; border-radius: 5px; box-shadow: 0 14px 40px rgba(26, 50, 69, .12); }
.login-card > p { color: var(--muted); line-height: 1.55; }
.form-stack { display: grid; gap: 16px; margin-top: 24px; }
.form-stack label { display: grid; gap: 7px; font-weight: 650; }
.form-stack .check { display: flex; align-items: center; gap: 7px; font-weight: 400; }
.auth-links { margin-top: 18px; text-align: center; }

/* Existing utility vocabulary used by the clean Ledger views. */
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-red, .text-red-600, .text-red-700 { color: var(--danger); }
.text-green, .text-green-700, .text-green-800 { color: var(--success); }
.text-purple, .text-purple-700 { color: #236c9c; }
.text-light-gray, .text-gray-600, .text-gray-700 { color: var(--muted); }
.text-black { color: var(--ink-strong); }
.text-white { color: #fff; }
.text-orange-700 { color: #974b00; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 600; }
.font-bold, .font-semibold { font-weight: 700; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 15px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-5xl { font-size: 44px; }
.flex { display: flex; }
.inline { display: inline; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.self-center { align-self: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.ml-1 { margin-left: 4px; }
.ml-3 { margin-left: 12px; }
.ml-auto { margin-left: auto; }
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mb-10 { margin-bottom: 40px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mt-10 { margin-top: 40px; }
.my-8 { margin-top: 32px; margin-bottom: 32px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.px-1\.5 { padding-left: 6px; padding-right: 6px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-5 { padding-left: 20px; padding-right: 20px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.px-12 { padding-left: 48px; padding-right: 48px; }
.py-0\.5 { padding-top: 2px; padding-bottom: 2px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-1\.5 { padding-top: 6px; padding-bottom: 6px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-2\.5 { padding-top: 10px; padding-bottom: 10px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.py-16 { padding-top: 64px; padding-bottom: 64px; }
.pb-1 { padding-bottom: 4px; }
.pb-2 { padding-bottom: 8px; }
.pb-2\.5 { padding-bottom: 10px; }
.pt-4 { padding-top: 16px; }
.pr-2 { padding-right: 8px; }
.rounded { border-radius: 3px; }
.rounded-sm { border-radius: 2px; }
.rounded-lg { border-radius: 3px; }
.rounded-xl { border-radius: 5px; }
.rounded-full { border-radius: 999px; }
.border { border: 1px solid var(--line); }
.border-b { border-bottom: 1px solid var(--line); }
.border-red { border-color: var(--danger); }
.border-green { border-color: var(--brand); }
.border-purple { border-color: #4f7f9a; }
.border-light-gray, .border-gray-100 { border-color: var(--line); }
.divide-y > * + * { border-top: 1px solid var(--line-soft); }
.bg-white { background: #fff; }
.bg-gray-50, .bg-gray-100, .bg-gray-200 { background: #f0f3f5; }
.bg-green-50, .bg-green-100 { background: var(--brand-soft); }
.bg-purple-50, .bg-purple-light, .bg-lilac-100 { background: #eaf3f8; }
.bg-red-100 { background: #fff0ef; }
.bg-orange-100 { background: #fff0dc; }
.bg-purple, .hover\:bg-purple-700:hover { color: #fff; background: #236c9c; border-color: #236c9c; }
.bg-green, .hover\:bg-green-700:hover { color: #fff; background: var(--brand); border-color: var(--brand); }
.hover\:bg-green-50:hover { background: var(--brand-soft); }
.hover\:underline:hover { text-decoration: underline; }
.hover\:text-purple-700:hover { color: #195679; }
.hover\:text-red-700:hover { color: #a71910; }
.w-full { width: 100%; }
.w-1\/12 { width: 8.333333%; }
.w-2\/12 { width: 16.666667%; }
.w-3\/12 { width: 25%; }
.w-4\/12 { width: 33.333333%; }
.w-5\/12 { width: 41.666667%; }
.w-6\/12 { width: 50%; }
.w-7\/12 { width: 58.333333%; }
.w-8\/12 { width: 66.666667%; }
.w-32 { width: 128px; }
.w-36 { width: 144px; }
.w-40 { width: 160px; }
.w-48 { width: 192px; }
.w-64 { width: 256px; }
.max-w-xs { max-width: 320px; }
.max-w-2xl { max-width: 672px; }
.max-w-\[95vw\] { max-width: 95vw; }
.min-w-0 { min-width: 0; }
.min-w-\[160px\] { min-width: 160px; }
.min-w-\[200px\] { min-width: 200px; }
.flex-1 { flex: 1 1 0%; }
.overflow-x-auto { overflow-x: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }
.tracking-widest { letter-spacing: .18em; }
.opacity-50 { opacity: .5; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.relative { position: relative; }
.fixed { position: fixed; }
.inset-0 { inset: 0; }
.z-50 { z-index: 50; }
.disabled\:opacity-50:disabled { opacity: .5; }
.disabled\:bg-green-100:disabled { background: #abdca3; }
.focus\:outline-none:focus { outline: 0; }

/* Desktop compact mode */
.app-shell.nav-collapsed { --sidebar-width: 68px; }
.nav-collapsed .brand-name, .nav-collapsed .company-copy, .nav-collapsed .company-switcher > .icon, .nav-collapsed .create-button span,
.nav-collapsed .side-nav a span, .nav-collapsed .nav-label, .nav-collapsed .nav-summary-label span, .nav-collapsed .nav-group summary > .icon,
.nav-collapsed .nav-children, .nav-collapsed .sidebar-foot span { display: none; }
.nav-collapsed .sidebar-head { justify-content: center; }
.nav-collapsed .sidebar-collapse { position: absolute; top: 14px; left: 55px; color: var(--nav); background: #fff; border: 1px solid #bdc7cd; border-radius: 50%; box-shadow: 0 1px 4px rgba(0, 0, 0, .16); }
.nav-collapsed .sidebar-collapse .icon { transform: rotate(180deg); }
.nav-collapsed .company-switcher { display: flex; justify-content: center; padding: 7px 0; }
.nav-collapsed .create-button { margin: 0 5px; }
.nav-collapsed .side-nav a, .nav-collapsed .nav-group summary, .nav-collapsed .sidebar-foot button { justify-content: center; padding: 7px; }
.nav-collapsed .nav-group summary.active, .nav-collapsed .side-nav a.active { box-shadow: inset 2px 0 0 #69c95b; }
.nav-collapsed .create-panel { left: 50px; }

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sm\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .sm\:col-span-2 { grid-column: span 2 / span 2; }
    .sm\:col-span-3 { grid-column: span 3 / span 3; }
    .sm\:col-span-4 { grid-column: span 4 / span 4; }
    .sm\:w-1\/2 { width: 50%; }
    .sm\:w-1\/3 { width: 33.333333%; }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:w-1\/2 { width: 50%; }
}
@media (max-width: 1120px) {
    .top-action-wide span:last-child { display: none; }
    .top-action-wide { min-width: 34px; padding: 0 7px; }
    .global-search { width: min(540px, 50vw); }
}
@media (max-width: 820px) {
    .app-shell, .app-shell.nav-collapsed { display: block; --sidebar-width: 240px; }
    .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: min(300px, 86vw); transition: transform .2s ease; box-shadow: 5px 0 20px rgba(0, 0, 0, .3); }
    .nav-open .sidebar { transform: translateX(0); }
    .nav-open .nav-scrim { position: fixed; inset: 0; z-index: 45; display: block; width: 100%; height: 100%; padding: 0; background: rgba(13, 29, 40, .55); border: 0; border-radius: 0; }
    .nav-collapsed .brand-name, .nav-collapsed .company-copy, .nav-collapsed .company-switcher > .icon, .nav-collapsed .create-button span,
    .nav-collapsed .side-nav a span, .nav-collapsed .nav-label, .nav-collapsed .nav-summary-label span, .nav-collapsed .nav-group summary > .icon,
    .nav-collapsed .sidebar-foot span { display: initial; }
    .nav-collapsed .sidebar-head { justify-content: space-between; }
    .nav-collapsed .sidebar-collapse { position: static; color: #c8d7df; background: transparent; border: 0; box-shadow: none; }
    .nav-collapsed .sidebar-collapse .icon { transform: none; }
    .nav-collapsed .company-switcher { display: grid; justify-content: initial; padding: 7px 8px; }
    .nav-collapsed .create-button { margin: 0 4px; }
    .nav-collapsed .side-nav a, .nav-collapsed .nav-group summary, .nav-collapsed .sidebar-foot button { justify-content: initial; padding: 7px 11px; }
    .nav-collapsed .nav-children { display: block; }
    .nav-toggle { display: block; }
    .topbar { gap: 8px; padding: 0 10px; }
    .global-search { width: auto; flex: 1; margin: 0; }
    .global-search kbd, .top-actions > .top-action { display: none; }
    .profile-button { margin-left: 0; }
    .page-wrap { padding: 18px 14px 40px; }
    .page-heading { align-items: flex-start; }
    .page-heading h1 { font-size: 23px; }
    .panel { padding: 16px; }
    .create-panel { position: fixed; top: 104px; left: 14px; width: calc(100vw - 28px); max-width: 420px; }
    .bank-moneybar { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: -16px -16px 16px; }
    .bank-moneybar > a:nth-child(2), .moneybar-summary { border-right: 0; }
    .list-toolbar .list-search { width: 100%; }
    .toolbar-count { margin-left: 0; }
}
@media (max-width: 560px) {
    .page-heading { display: grid; }
    .page-actions { justify-content: flex-start; }
    .page-actions a { flex: 1; }
    .panel { margin: 0 -14px; border-right: 0; border-left: 0; border-radius: 0; }
    .create-grid { grid-template-columns: 1fr; }
    .login-card { padding: 25px; }
    .px-12 { padding-left: 12px; padding-right: 12px; }
}

@media print {
    .sidebar, .topbar, .page-heading, .page-actions, .notice { display: none !important; }
    .app-shell { display: block; }
    .page-wrap, .panel { padding: 0; background: #fff; border: 0; box-shadow: none; }
    body { background: #fff; }
}
