/*
 * StrataCare clean theme
 * Presentation-only override. No application element is removed or hidden,
 * and no route, workflow, state transition, action, or JavaScript is changed.
 */

:root {
    --color-bg: #ffffff;
    --color-surface: #ffffff;
    --color-surface-alt: #f6f7f9;
    --color-surface-hover: #f1f4f7;

    --color-text: #172033;
    --color-text-secondary: #526073;
    /* MUTED, NOT UNREADABLE. #8792a1 measures 3.15:1 on white and this token
       is only ever used for `color:` — eleven rules, all of them text, no
       borders, icons or fills — so its contrast is the whole of its effect.
       The accessibility sweep over all 62 screens found it under every
       caption on the product: "Your buildings at a glance", the committee's
       approvals subtitle, the financial-year line. WCAG AA asks 4.5:1 of body
       text; it was failing that everywhere at once.

       This is the same hue at the lightness where it clears 4.5:1 against
       EVERY ground this theme defines — derived from the stylesheet rather
       than from a list someone remembered, which is how the first attempt
       (#647080) came to miss the chip by eleven thousandths at 4.489:1:
           #f0f2f5 4.54   #f1f4f7 4.62   #f6f7f9 4.75   #f8fafc 4.87
           #ffffff 5.09
       It is within a shade of the two tones already chosen for .nav-logout
       and .nav-role-badge by the same measurement, so this is that decision
       applied at the token rather than a new one. Muted still reads as muted
       — it is the second tone in the hierarchy, not the primary. */
    --color-text-muted: #646f7f;

    --color-brand: #0871bd;
    --color-brand-hover: #0067b4;
    --color-brand-light: #edf7ff;

    --color-accent: #1e7c56;
    --color-accent-light: #edf8f3;

    --color-danger: #c73945;
    --color-danger-light: #fff1f2;
    --color-warning: #9b6011;
    --color-warning-light: #fff7e9;
    --color-success: #1e7c56;
    --color-success-light: #edf8f3;
    --color-info: #0871bd;
    --color-info-light: #edf7ff;

    --color-border: rgba(23, 32, 51, 0.11);
    --color-border-light: rgba(23, 32, 51, 0.065);
    --color-nav-bg: rgba(255, 255, 255, 0.86);
    --color-nav-border: rgba(23, 32, 51, 0.09);


    /* Five roles this file used to spell as repeated literals. Measured
       2026-09-05/09-06 across the 97 literal colour values outside :root: 57
       are distinct and 78 of the 97 match NO token at all — they are one-off
       values, not a bypassed token layer, and inventing a token for each
       would be a rename, not a de-duplication. The five below are the ones
       that REPEAT (17 occurrences between them), i.e. the ones that can drift
       apart. Each token is the byte-identical string it replaced, and every
       substitution was made by exact string match and verified by expanding
       the tokens back out and diffing against the previous file. #ffffff
       (x19) is deliberately NOT tokenised: it equals BOTH --color-bg and
       --color-surface, so which one each site means is a judgement about that
       site, not a mechanical swap. */
    --color-chip-bg: #f0f2f5;
    --color-row-hover: #f8fafc;
    --color-field-border: #d9dee5;
    --color-focus-ring: rgba(8, 120, 201, 0.12);
    --color-scrollbar-thumb: rgba(82, 96, 115, 0.42);

    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SFMono-Regular", "SF Mono", Menlo, Monaco, Consolas, monospace;

    /* The radius scale is the PUBLIC token layer this theme publishes for the
       rest of the app (portal.css, app_kit.css and inline template styles all
       read var(--radius-sm)/var(--radius)); it is deliberately not what this
       file's own rules use. Measured 2026-09-05: of the 31 border-radius
       declarations below, only 0.5rem (x2) and 1rem (x5) equal a token; the
       other 24 are 0.55/0.6/0.65/0.7/0.75/0.8/0.85/1.05/1.2/1.35rem and 999px,
       and 0.625rem appears nowhere. Rewriting them as var(--radius) would
       reround every one of those corners, so DO NOT "collapse them onto the
       tokens": that is a visual change, not a de-duplication. */
    --radius-sm: 0.5rem;
    --radius: 0.625rem;
    --radius-lg: 1rem;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.035), 0 8px 24px rgba(15, 23, 42, 0.025);
    --shadow-md: 0 2px 5px rgba(15, 23, 42, 0.045), 0 16px 40px rgba(15, 23, 42, 0.055);
    --shadow-lg: 0 12px 44px rgba(15, 23, 42, 0.11);
}

html {
    color-scheme: light;
    background-color: #ffffff;
}

body {
    min-height: 100vh;
    background-color: #ffffff;
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    line-height: 1.55;
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    background: rgba(8, 120, 201, 0.16);
}

button,
input,
textarea,
select {
    font-family: var(--font-sans);
}

:focus-visible {
    outline: 3px solid var(--color-brand) !important;
    outline-offset: 2px;
}

/* Text-entry controls carry their own soft focus treatment (brand border +
   low-alpha glow, the macOS/iOS convention). The heavy ring above is for
   keyboard navigation of buttons/links/tabs; stacked on a text field it
   reads as a hard blue box inside the field's own rounded glow. */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[contenteditable]:focus-visible {
    outline: none !important;
}

/* App bar */
.nav {
    background: var(--color-nav-bg);
    border-bottom-color: var(--color-nav-border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: saturate(160%) blur(20px);
    backdrop-filter: saturate(160%) blur(20px);
}

.nav-inner {
    max-width: 1320px;
    height: 4rem;
    padding-inline: 2rem;
}

.nav-left {
    gap: 2.25rem;
}

.nav-logo {
    gap: 0.6rem;
}

.nav-logo-img {
    width: 1.75rem;
    height: 1.75rem;
    object-fit: contain;
}

.nav-logo-text {
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 650;
    letter-spacing: -0.015em;
    text-transform: none;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-item {
    min-height: 2.15rem;
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    color: var(--color-text-secondary);
    font-size: 0.79rem;
    font-weight: 500;
    transition: color 140ms ease, background 140ms ease;
}

.nav-item:hover {
    color: var(--color-text);
    background: rgba(23, 32, 51, 0.045);
}

.nav-item.active {
    color: var(--color-brand-hover);
    background: var(--color-brand-light);
    font-weight: 600;
}

.nav-right {
    gap: 0.65rem;
}

.nav-user {
    font-size: 0.78rem;
    font-weight: 550;
}

.nav-role-badge {
    padding: 0.2rem 0.55rem;
    border: 0;
    background: var(--color-chip-bg);
    /* The chip's own ground is --color-chip-bg, the darkest surface the
       muted token is measured against; it clears 4.5:1 there too, so this
       follows the token rather than carrying a second tone of its own.
       (Named, not spelled: a tokenised colour written out a second time —
       in a comment as much as a rule — is a copy that can drift, which is
       what test_clean_theme_tokens_render_the_same_colours refuses.) */
    color: var(--color-text-muted);
    font-size: 0.59rem;
    font-weight: 650;
}

.nav-logout {
    /* A CONTROL, NOT A CAPTION — "Log out" is the one control on every page
       that ends a session, and at the old #8792a1 it was the hardest thing on
       the page to read (3.15:1). It was patched here first; the token itself
       has since moved to a tone that clears 4.5:1 on every surface, so this
       follows it and the product carries one muted tone, not three. */
    color: var(--color-text-muted);
}

/* Page frame and hierarchy */
.main-content {
    max-width: 1320px;
    padding: 2.75rem 2rem 5rem;
    min-height: calc(100vh - 7rem);
    background-color: #ffffff;
}

.page-header {
    margin-bottom: 1.85rem;
}

.page-header h1 {
    color: var(--color-text);
    font-size: clamp(1.75rem, 2.5vw, 2.1rem);
    line-height: 1.18;
    font-weight: 650;
    letter-spacing: -0.035em;
}

.page-header p {
    max-width: 720px;
    margin-top: 0.38rem;
    color: var(--color-text-muted);
    font-size: 0.86rem;
}

.page-actions {
    gap: 0.55rem;
}

.section-heading,
.dash-sechead {
    color: var(--color-text);
    font-size: 0.95rem !important;
    font-weight: 620 !important;
    letter-spacing: -0.015em !important;
}

h2,
h3,
h4 {
    color: var(--color-text);
    letter-spacing: -0.015em;
}

.breadcrumb {
    margin-bottom: 1.05rem;
    color: var(--color-text-muted);
    font-size: 0.74rem;
}

.breadcrumb a {
    color: var(--color-text-muted)  /* was #6b7788 — below 4.5:1 on its own ground; the muted token is measured against every ground the theme defines */

}

.breadcrumb a:hover {
    color: var(--color-brand-hover);
}

.breadcrumb-sep::before {
    color: #616f83;
}

/* Surfaces */
.card,
.stat-card,
.candidate-card,
.rv-card,
.flags-box,
.info-banner {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
}

.card-body {
    padding: 1.35rem;
}

/* Prose links inside cards: brand blue in every state. Without this they
   fall back to browser defaults, and a VISITED link renders purple — one
   un-themed color in an otherwise Apple-clean surface (seen on the
   My Apps empty state). */
.card-body a:not(.btn) {
    color: var(--color-brand);
}

.card-body a:not(.btn):visited {
    color: var(--color-brand);
}

.card-body a:not(.btn):hover {
    text-decoration: underline;
}

.card-header {
    padding: 0.95rem 1.3rem;
    border-bottom-color: var(--color-border-light);
    font-size: 0.82rem;
    font-weight: 620;
}

.card-footer {
    padding: 0.8rem 1.3rem;
    border-top-color: var(--color-border-light);
    border-radius: 0 0 1rem 1rem;
    background: #fafbfc;
}

a.card,
a.stat-card,
.candidate-card {
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

a.card:hover,
a.stat-card:hover,
.candidate-card:hover {
    border-color: rgba(8, 120, 201, 0.22) !important;
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-1px);
}

.grid-2,
.grid-3,
.grid-4,
.grid-5,
.sidebar-layout {
    gap: 1.15rem;
}

/* Portfolio figures */
.stat-card {
    padding: 1.3rem 1.4rem;
}

.stat-card-label {
    margin-bottom: 0.4rem;
    color: var(--color-text-muted);
    font-size: 0.67rem;
    font-weight: 620;
    letter-spacing: 0.045em;
}

.stat-card-value {
    color: var(--color-text);
    font-size: 1.65rem;
    line-height: 1.2;
    font-weight: 650;
    letter-spacing: -0.035em;
}

.stat-card-value.positive,
.dash .stat-card-value.ok {
    color: var(--color-success);
}

.stat-card-value.warning {
    color: var(--color-warning);
}

/* Buttons */
.btn,
.askai-action-buttons button,
.askai-action-buttons a {
    min-height: 2.35rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(23, 32, 51, 0.13);
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.94);
    color: #304056;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.025);
    font-size: 0.79rem;
    font-weight: 560;
    letter-spacing: -0.005em;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 100ms ease;
}

.btn:hover,
.askai-action-buttons button:hover,
.askai-action-buttons a:hover {
    border-color: rgba(23, 32, 51, 0.2);
    background: #f8f9fa;
    color: var(--color-text);
}

.btn:active,
.askai-action-buttons button:active,
.askai-action-buttons a:active {
    transform: scale(0.985);
}

.btn-primary,
.btn-brand,
.askai-action-buttons button.primary,
.askai-action-buttons a.primary,
.askai-send {
    border-color: var(--color-brand) !important;
    background: var(--color-brand) !important;
    color: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0, 103, 180, 0.15);
}

.btn-primary:hover,
.btn-brand:hover,
.askai-action-buttons button.primary:hover,
.askai-action-buttons a.primary:hover,
.askai-send:hover {
    border-color: var(--color-brand-hover) !important;
    background: var(--color-brand-hover) !important;
}

.btn-danger {
    border-color: rgba(201, 63, 74, 0.2);
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.btn-ghost {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    border-color: transparent;
    background: rgba(23, 32, 51, 0.05);
}

.btn-sm {
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.55rem;
    font-size: 0.74rem;
}

/* Status labels */
.badge,
.dash-statuspill,
.score-pill,
.owner-primary-tag,
.acct-code-pill {
    min-height: 1.35rem;
    padding: 0.2rem 0.55rem;
    border: 0;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: 0.015em;
    box-shadow: none;
}

.badge-muted {
    background: var(--color-chip-bg);
    color: var(--color-text-muted)  /* was #647184 — below 4.5:1 on its own ground; the muted token is measured against every ground the theme defines */

}

.badge-info {
    background: var(--color-info-light);
    color: var(--color-brand-hover);
}

.badge-success {
    background: var(--color-success-light);
    color: var(--color-success);
}

.badge-warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.badge-danger {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

/* Segmented navigation preserves every existing tab in one calm row */
.tab-bar {
    width: fit-content;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    margin-bottom: 1.35rem;
    padding: 0.25rem;
    overflow-x: auto;
    border: 0;
    border-radius: 0.8rem;
    background: var(--color-chip-bg);
    scrollbar-width: thin;
    scrollbar-color: var(--color-scrollbar-thumb) transparent;
}

.tab-bar::-webkit-scrollbar {
    height: 6px;
}

.tab-bar::-webkit-scrollbar-track {
    background: transparent;
}

.tab-bar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background-color: var(--color-scrollbar-thumb);
}

.tab-item {
    min-height: 2.15rem;
    display: inline-flex;
    align-items: center;
    flex: none;
    padding: 0.42rem 0.78rem;
    border: 0;
    border-radius: 0.6rem;
    color: var(--color-text-muted)  /* was #667386 — below 4.5:1 on its own ground; the muted token is measured against every ground the theme defines */

    font-size: 0.77rem;
    font-weight: 540;
    white-space: nowrap;
    cursor: pointer;
}

.tab-item:focus-visible {
    outline-offset: -2px;
}

.tab-item:hover {
    background: rgba(255, 255, 255, 0.55);
    color: var(--color-text);
}

.tab-item.active {
    border: 0;
    background: #ffffff;
    color: var(--color-text);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.11), 0 0 0 0.5px rgba(15, 23, 42, 0.04);
    font-weight: 620;
}

/* Financial tables */
.table,
.owner-roll-table,
.owner-subtable {
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.table th,
.owner-roll-table thead th,
.owner-subtable thead th {
    padding: 0.68rem 0.9rem;
    border-bottom-color: var(--color-border);
    background: rgba(246, 247, 249, 0.68);
    color: var(--color-text-muted)  /* was #7e8998 — below 4.5:1 on its own ground; the muted token is measured against every ground the theme defines */

    font-size: 0.66rem;
    font-weight: 650;
    letter-spacing: 0.035em;
}

.table td,
.owner-roll-table tbody td,
.owner-subtable tbody td {
    padding: 0.78rem 0.9rem;
    border-bottom-color: var(--color-border-light);
}

.table tbody tr,
.owner-roll-table tbody tr,
.owner-subtable tbody tr {
    transition: background 120ms ease;
}

.table tbody tr:hover,
.owner-roll-table tbody tr:hover,
.owner-subtable tbody tr:hover {
    background: var(--color-row-hover);
}

.table .text-mono,
.text-mono,
.budget-amount,
.opening-balance-input,
.opening-balance-amount {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.table td.budget-amount:not(.cell-edited) {
    background: #f7fbff !important;
}

.table td.budget-amount:hover,
.table td.budget-amount:focus,
.table td.cell-edited {
    background: #eef7ff !important;
}

.table td.budget-amount:focus {
    box-shadow: inset 0 0 0 2px rgba(8, 120, 201, 0.35);
}

/* Forms and controls */
.form-group {
    margin-bottom: 1.15rem;
}

.form-label,
.lot-field label {
    margin-bottom: 0.42rem;
    color: #536175;
    font-size: 0.73rem;
    font-weight: 590;
    letter-spacing: 0.005em;
}

.form-input,
.lot-field input,
.owner-roll-table input[type="text"],
.owner-roll-table input[type="email"],
.owner-roll-table textarea,
.owner-subtable input[type="text"],
.owner-subtable input[type="email"],
.owner-subtable textarea,
.added-account-picker,
.added-description-input,
.added-input,
.opening-balance-input input,
.askai-building-select {
    min-height: 2.65rem;
    padding: 0.62rem 0.78rem;
    border: 1px solid var(--color-field-border);
    border-radius: 0.65rem;
    background-color: rgba(255, 255, 255, 0.96);
    color: var(--color-text);
    font-size: 0.84rem;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.018);
    transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.form-input:hover,
.lot-field input:hover,
.owner-roll-table input:hover,
.owner-roll-table textarea:hover,
.owner-subtable input:hover,
.owner-subtable textarea:hover {
    border-color: #c6cdd7;
}

.form-input:focus,
.lot-field input:focus,
.owner-roll-table input:focus,
.owner-roll-table textarea:focus,
.owner-subtable input:focus,
.owner-subtable textarea:focus,
.added-account-picker:focus,
.added-description-input:focus,
.added-input:focus,
.opening-balance-input input:focus,
.askai-building-select:focus {
    border-color: var(--color-brand);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px var(--color-focus-ring);
    outline: none;
}

.custom-select-trigger {
    min-height: 2.65rem;
    padding: 0.62rem 2.3rem 0.62rem 0.78rem;
    border-color: var(--color-field-border);
    border-radius: 0.65rem;
    background-color: #ffffff;
    background-repeat: no-repeat !important;
    background-position: right 0.78rem center !important;
    background-size: 12px 8px !important;
    color: var(--color-text);
    font-size: 0.84rem;
}

.custom-select-trigger:focus {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px var(--color-focus-ring);
}

/* Keep the vocabulary chevron singular. General field styling must not tile it. */
input.form-input[data-vocab],
input.form-input[data-vocab]:hover,
input.form-input[data-vocab]:focus {
    padding-right: 2.3rem !important;
    background-repeat: no-repeat !important;
    background-position: right 0.78rem center !important;
    background-size: 12px 12px !important;
}

input.row-input[data-vocab],
input.row-input[data-vocab]:hover,
input.row-input[data-vocab]:focus {
    padding-right: 1.75rem !important;
    background-repeat: no-repeat !important;
    background-position: right 0.5rem center !important;
    background-size: 11px 11px !important;
}

/* Polish the native picker while preserving its native upload behaviour. */
input[type="file"] {
    min-height: 2.65rem;
    padding: 0.32rem 0.55rem 0.32rem 0.38rem;
    border: 1px solid var(--color-field-border);
    border-radius: 0.65rem;
    background-color: #ffffff;
    color: var(--color-text-secondary);
    font-family: var(--font-sans);
    font-size: 0.82rem !important;
    line-height: 1.35;
    cursor: pointer;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.018);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

input[type="file"]::file-selector-button {
    min-height: 2rem;
    margin-right: 0.7rem;
    padding: 0.42rem 0.82rem;
    border: 0;
    border-radius: 0.5rem;
    background-color: #f0f3f6;
    color: #304056;
    font: 600 0.78rem/1 var(--font-sans);
    letter-spacing: -0.005em;
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease;
}

input[type="file"]:hover {
    border-color: #c6cdd7;
}

input[type="file"]:hover::file-selector-button {
    background-color: #e7edf2;
    color: var(--color-text);
}

input[type="file"]:focus,
input[type="file"]:focus-visible {
    border-color: var(--color-brand);
    outline: none;
    box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.vocab-dropdown {
    margin-top: 0.35rem;
    padding: 0.3rem;
    border-color: var(--color-border);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-lg);
}

.vocab-dropdown-item {
    padding: 0.55rem 0.65rem;
    border-radius: 0.5rem;
}

.vocab-dropdown-item:hover,
.vocab-dropdown-item-highlighted {
    background: var(--color-brand-light);
}

/* Alerts and notices */
.flash-container {
    max-width: 1320px;
    padding-inline: 2rem;
}

.alert {
    padding: 0.8rem 1rem;
    border-width: 1px;
    border-radius: 0.8rem;
    box-shadow: none;
    font-size: 0.8rem;
}

.alert-info {
    border-color: rgba(8, 120, 201, 0.15);
    background: var(--color-info-light);
    color: #135e91;
}

.alert-success {
    border-color: rgba(33, 135, 93, 0.15);
    background: var(--color-success-light);
}

.alert-warning {
    border-color: rgba(169, 105, 19, 0.15);
    background: var(--color-warning-light);
}

.alert-error {
    border-color: rgba(201, 63, 74, 0.15);
    background: var(--color-danger-light);
}

/* Dashboard — same actions and content, calmer hierarchy */
.dash-row,
.ov-row,
.rv-row {
    padding: 0.95rem 1.2rem;
    border-bottom-color: var(--color-border-light);
}

.dash-row:hover,
.ov-row:hover,
.rv-row:hover {
    background: var(--color-row-hover);
}

.dash-rtitle,
.ov-name,
.rv-desc {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.dash-rmeta,
.dash-bcts,
.dash-bnote,
.ov-cts,
.rv-note {
    color: var(--color-text-muted);
}

.dash-go,
.ov-go {
    color: var(--color-brand-hover);
    font-weight: 580;
}

.dash-sechead {
    margin-top: 1.9rem;
    margin-bottom: 0.85rem;
}

.dash-sechead .sub {
    color: var(--color-text-muted);
}

.dash-funds {
    gap: 1rem;
    margin-top: 1.05rem;
    padding-top: 1.05rem;
    border-top-color: var(--color-border-light);
}

.dash-flabel {
    color: var(--color-text-muted);
    font-size: 0.64rem;
    font-weight: 620;
}

.dash-fval {
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 650;
}

.dash-bnotes {
    border-top-color: var(--color-border-light);
}

.dash-statuspill {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

/* Building records and expandable requirements */
.mx-req {
    border: 1px solid var(--color-border);
    border-radius: 0.8rem;
    background: #ffffff;
    background-clip: padding-box;
}

.mx-req > summary {
    padding: 0.85rem 1rem;
    background: transparent;
    font-weight: 580;
}

.mx-req > summary:hover {
    background: var(--color-row-hover);
}

.mx-req.mx-active > summary {
    box-shadow: inset 3px 0 0 var(--color-brand);
}

.agm-dot {
    width: 1.65rem;
    height: 1.65rem;
    border-color: var(--color-border);
    background: #ffffff;
}

.agm-step__label {
    font-size: 0.84rem;
    font-weight: 600;
}

.agm-step__sub {
    color: var(--color-text-muted);
    font-size: 0.76rem;
}

/* Budget and onboarding keep every original field and step */
.wizard-progress {
    padding: 0.45rem 0;
    border: 0;
    background: transparent;
}

.wizard-step-circle {
    width: 2rem;
    height: 2rem;
    border-color: #d7dde5;
    background: #ffffff;
    color: var(--color-text-muted)  /* was #7f8a99 — below 4.5:1 on its own ground; the muted token is measured against every ground the theme defines */

    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.wizard-step.current .wizard-step-circle {
    border-color: var(--color-brand);
    background: var(--color-brand);
    color: #ffffff;
}

.wizard-step.complete .wizard-step-circle {
    border-color: var(--color-success);
    background: var(--color-success-light);
    color: var(--color-success);
}

.wizard-step-line {
    background: #e5e8ed;
}

.wizard-step-line.complete {
    background: var(--color-success);
}

.wizard-step-label {
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 540;
}

.wizard-step.current .wizard-step-label,
.wizard-step.complete .wizard-step-label {
    color: var(--color-text);
    font-weight: 620;
}

.wizard-header {
    margin-bottom: 1.4rem;
}

.wizard-subtitle {
    color: var(--color-text-muted);
}

.wizard-actions {
    margin-top: 1.4rem;
    padding-top: 1.1rem;
    border-top-color: var(--color-border-light);
}

.candidate-card.selected {
    border-color: var(--color-brand);
    background: var(--color-brand-light);
    box-shadow: 0 0 0 3px rgba(8, 120, 201, 0.08);
}

.row-editor,
.opening-balance-row,
.lot-block {
    border-color: var(--color-border);
    border-radius: 0.75rem;
    background: #ffffff;
}

.row-editor.row-header,
.lot-block-head {
    background: #f7f8fa;
}

.opening-balance-reconciliation,
.owner-roll-info {
    border-color: rgba(8, 120, 201, 0.15);
    border-radius: 0.8rem;
    background: var(--color-brand-light);
}

.owner-roll-table-wrap,
.nested-table-wrap {
    overflow: auto;
    border: 1px solid var(--color-border);
    border-radius: 0.85rem;
    background: #ffffff;
}

.owner-roll-table-v2 tbody tr:nth-child(even) > td:not(.opening-balance-col) {
    background: #fbfcfd;
}

.owner-roll-table-v2 thead .opening-balance-col,
.owner-roll-table-v2 tbody .opening-balance-col {
    background: #f4f9fd;
}

/* StrataCare AI — same conversation, actions and approvals */
.askai-wrap {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.15rem;
}

.askai-chat {
    border-color: var(--color-border);
    border-radius: 1.2rem;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.askai-chat-header {
    padding: 1rem 1.2rem;
    border-bottom-color: var(--color-border-light);
    background: rgba(255, 255, 255, 0.9);
}

.askai-chat-header h2 {
    font-weight: 620;
}

.askai-messages {
    padding: 1.4rem 1.25rem;
    gap: 0.85rem;
}

.askai-bubble {
    padding: 0.72rem 0.95rem;
    border-radius: 1.05rem;
    font-size: 0.88rem;
    line-height: 1.55;
}

.askai-msg.user .askai-bubble {
    border: 0;
    border-bottom-right-radius: 0.35rem;
    background: var(--color-brand);
    color: #ffffff;
}

.askai-msg.assistant .askai-bubble {
    border-color: transparent;
    border-bottom-left-radius: 0.35rem;
    background: #f1f3f6;
}

.askai-action {
    border-color: var(--color-border);
    border-radius: 1rem;
    box-shadow: none;
}

.askai-action-title {
    color: var(--color-brand-hover);
    font-weight: 650;
}

.askai-action-preview,
.askai-action-delivery {
    border-radius: 0.7rem;
}

.askai-input-row {
    margin: 0.85rem 1.15rem 1.15rem;
    padding: 0.45rem 0.45rem 0.45rem 0.8rem;
    border-color: #d7dde5;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
}

.askai-input-row:focus-within {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px rgba(8, 120, 201, 0.11);
}

.askai-send {
    min-width: 4.4rem;
    height: 2.4rem;
    border-radius: 0.7rem;
    font-weight: 600;
}

.askai-chip {
    border-color: var(--color-border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--color-text-secondary);
}

.askai-chip:hover {
    border-color: rgba(8, 120, 201, 0.28);
    background: var(--color-brand-light);
    color: var(--color-brand-hover);
}

.askai-activity,
.activity-item {
    border-color: var(--color-border);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
}

/* Review queue and portfolio drill-down */
.rv-card {
    background-clip: padding-box;
}

.rv-head,
.ov-sechead {
    border-bottom-color: var(--color-border-light);
    background: #fafbfc;
}

.rv-conf,
.ov-count {
    border: 0;
    border-radius: 999px;
    background: var(--color-chip-bg);
}

/* Login and error surfaces */
.login-body {
    background-color: #ffffff;
}

.login-card {
    width: min(420px, calc(100% - 2rem));
    padding: 2rem;
    border: 1px solid var(--color-border);
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.11);
}

.login-logo {
    width: 2.8rem;
    height: 2.8rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 650;
    letter-spacing: -0.03em;
}

.login-subtitle {
    color: var(--color-text-muted);
}

.error-code {
    color: #5d7088;
    font-weight: 700;
}

/* Footer */
.footer {
    min-height: 3.5rem;
    border-top-color: var(--color-border-light);
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.7rem;
}

/* Reduced motion keeps the theme calm and accessible */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (max-width: 900px) {
    .nav-inner {
        padding-inline: 1.1rem;
    }

    .nav-left {
        gap: 1rem;
    }

    .main-content,
    .flash-container {
        padding-inline: 1.1rem;
    }

    .askai-wrap,
    .sidebar-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .nav-inner {
        min-height: 4rem;
        height: auto;
        padding-block: 0.65rem;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .nav-left {
        min-width: 0;
        flex-wrap: wrap;
    }

    .nav-links {
        display: flex;
        width: 100%;
        order: 3;
        overflow-x: auto;
        padding-bottom: 0.1rem;
        scrollbar-width: thin;
        scrollbar-color: var(--color-scrollbar-thumb) transparent;
    }

    .nav-links::-webkit-scrollbar {
        height: 6px;
    }

    .nav-links::-webkit-scrollbar-track {
        background: transparent;
    }

    .nav-links::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background-color: var(--color-scrollbar-thumb);
    }

    .nav-right {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .nav-links .nav-item:focus-visible {
        outline-offset: -2px;
    }

    .main-content {
        padding-top: 2rem;
        padding-bottom: 3rem;
    }

    .page-header.flex {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .grid-5 {
        grid-template-columns: 1fr;
    }

    .card-body,
    .stat-card {
        padding: 1.1rem;
    }

    .tab-bar {
        width: 100%;
    }

    .table th,
    .table td {
        padding-inline: 0.7rem;
    }
}
