/* Inter Variable covers weights 100-900 in one file, which matters here:
   the app uses 450, 550, 650, 750 and 850 alongside the standard steps. */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/InterVariable.woff2") format("woff2");
}

:root {
    color-scheme: light dark;
    font-family: var(--font-body);
    color: light-dark(#1f2a37, var(--theme-ink));
    background: var(--canvas);
    font-synthesis: none;
    --ink: light-dark(#1f2a37, var(--theme-ink));
    --muted: light-dark(#64748b, var(--theme-muted));
    --line: light-dark(#dfe4ea, var(--theme-line));
    --panel: light-dark(#fff, var(--theme-surface));
    --canvas: light-dark(#f4f6f8, var(--theme-canvas));
    --brand: #1e3a5f;
    --brand-soft: light-dark(#e2edf8, var(--theme-info-soft));
    --accent: light-dark(#2265ad, var(--theme-accent));
    --accent-soft: light-dark(#e2edf8, var(--theme-info-soft));
    --red: light-dark(#a43e38, var(--theme-danger));
    --red-soft: light-dark(#fff1ef, var(--theme-danger-soft));

    /* Height of the sticky two-tier app bar: .appbar-primary 3.6rem + .appbar-context 2.35rem. */
    --appbar-height: 5.95rem;

    --font-body: Inter, "Segoe UI", Arial, sans-serif;
    --font-display: var(--font-body);

    --focus-ring: light-dark(#2265ad, #fff);
}

.delivery-table-scroll { overflow-x: auto; }
.delivery-table { width: 100%; border-collapse: collapse; text-align: left; }
.delivery-table th { color: var(--muted); font-size: .8rem; font-weight: 600; }
.delivery-table th, .delivery-table td { padding: 1rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.delivery-table td:first-child { overflow-wrap: anywhere; }
.delivery-table td:last-child { min-width: 10rem; }

.supporting-document-actions, .document-name-editor { display: flex; align-items: center; gap: .5rem; }
.supporting-document-actions { justify-content: flex-end; white-space: nowrap; }
.document-name-editor { flex-wrap: wrap; }
.document-name-editor input { flex: 1 1 16rem; min-width: 0; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.supporting-file-list { list-style: none; margin: 0; padding: 0; }
.supporting-file-list li { display: flex; gap: 1rem; justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.supporting-file-list a { overflow-wrap: anywhere; }
.sign-out-form { display: flex; align-items: center; margin: 0; flex-shrink: 0; }
.sign-out-button { color: white; border: 1px solid #ffffff50; background: transparent; border-radius: 6px; padding: .5rem .7rem; font: inherit; font-size: .8rem; cursor: pointer; white-space: nowrap; }
.sign-out-button:hover { background: #ffffff18; }
.supporting-file-list span { color: var(--muted); white-space: nowrap; }
#supporting-upload { display: block; margin: 0; max-width: 100%; }

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--canvas);
    background-image: radial-gradient(light-dark(#dde4ec, var(--theme-raised)) 1px, transparent 1px);
    background-size: 26px 26px;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2 {
    color: light-dark(#16222f, var(--theme-ink));
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    margin-bottom: 0.65rem;
    font-size: clamp(1.8rem, 2.6vw, 2.5rem);
    line-height: 1.12;
}

h2 {
    margin-bottom: 0;
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    line-height: 1.2;
}

h3 {
    color: light-dark(#223041, var(--theme-ink));
    font-size: 1rem;
}

h1:focus {
    outline: none;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    align-items: end;
    margin: 0.5rem 0 2rem;
}

.page-heading > div {
    max-width: 50rem;
}

.dashboard-heading {
    margin-bottom: 2.25rem;
}

.eyebrow {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.55rem;
    color: var(--accent);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow::before {
    width: 1.1rem;
    height: 2px;
    background: currentColor;
    content: "";
}

.page-summary {
    max-width: 48rem;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

.button {
    display: inline-flex;
    justify-content: center;
    gap: 0.45rem;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.55rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
    /* Not "all": an animated outline makes the focus ring fade in. */
    transition: background-color 130ms ease, border-color 130ms ease, color 130ms ease, box-shadow 130ms ease;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.button-primary {
    color: #fff;
    background: var(--brand);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

.button-primary:hover:not(:disabled) {
    background: #254a79;
}

.button-secondary {
    color: light-dark(var(--brand), var(--theme-accent));
    background: light-dark(#fff, var(--theme-surface));
    border-color: light-dark(#c3cdd9, var(--theme-line));
    box-shadow: inset 0 -2px 0 rgba(24, 44, 70, 0.06);
}

.button-secondary:hover:not(:disabled) {
    border-color: light-dark(#9fb2c6, var(--theme-line));
}

.inline-action {
    padding: 0.15rem 0.2rem;
    color: light-dark(#2265ad, var(--theme-accent));
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 0.64rem;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 0.15rem;
}

.inline-action:hover:not(:disabled) {
    color: light-dark(#1e3a5f, var(--theme-ink));
}

.inline-action:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.inline-action-danger {
    color: var(--red);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-card {
    position: relative;
    display: flex;
    gap: 1rem;
    align-items: center;
    min-height: 6.6rem;
    padding: 1.15rem 1.25rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(16, 32, 54, 0.05);
    overflow: hidden;
}

.metric-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #2265ad 0 2.6rem, light-dark(#dfe4ea, var(--theme-raised)) 2.6rem);
    content: "";
}

.metric-icon {
    display: grid;
    width: 2.7rem;
    height: 2.7rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 0.45rem;
    font-size: 0.73rem;
    font-weight: 850;
}

.metric-icon-green {
    color: light-dark(#23714c, var(--theme-positive));
    background: light-dark(#e3f0e8, var(--theme-positive-soft));
}

.metric-icon-gold {
    color: light-dark(#2265ad, var(--theme-accent));
    background: light-dark(#e2edf8, var(--theme-raised));
}

.metric-icon-slate {
    color: light-dark(#4c5f76, var(--theme-muted));
    background: light-dark(#eaeef2, var(--theme-raised));
}

.metric-label,
.metric-card strong,
.metric-card small {
    display: block;
}

.metric-label {
    margin-bottom: 0.2rem;
    color: light-dark(#78889a, var(--theme-muted));
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.metric-card strong {
    color: light-dark(#223041, var(--theme-ink));
    font-size: 1.25rem;
}

.metric-card small {
    margin-top: 0.25rem;
    color: light-dark(#71808f, var(--theme-muted));
    font-size: 0.72rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(17rem, 0.8fr);
    gap: 1rem;
}

.panel,
.data-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(16, 32, 54, 0.05);
}

.panel {
    padding: clamp(1.25rem, 2vw, 1.7rem);
}

.access-denied-panel {
    max-width: 48rem;
}

.access-denied-panel p {
    max-width: 42rem;
    color: var(--muted);
    line-height: 1.65;
}

.access-denied-panel .button {
    margin-top: 0.5rem;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid light-dark(#e6eaef, var(--theme-line));
}

.panel-heading.compact {
    padding-bottom: 1rem;
    border-bottom: 0;
}

.panel-heading.compact > div {
    display: flex;
    gap: 0.65rem;
    align-items: center;
}

.panel-heading h3,
.panel-heading p {
    margin-bottom: 0;
}

.status-pill {
    display: inline-flex;
    gap: 0.42rem;
    align-items: center;
    width: fit-content;
    padding: 0.32rem 0.6rem;
    color: light-dark(#51637a, var(--theme-muted));
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid light-dark(#d5dde6, var(--theme-line));
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-pill::before {
    width: 0.45rem;
    height: 0.45rem;
    background: #97a6b8;
    border-radius: 50%;
    content: "";
}

.status-pill-active {
    color: light-dark(#1f6b47, var(--theme-positive));
    border-color: light-dark(#bcdccb, var(--theme-line));
}

.status-pill-active::before {
    background: #2f9e63;
}

.status-pill-review { color: light-dark(#8a5a1e, var(--theme-warning)); border-color: light-dark(#e3d0aa, var(--theme-line)); }
.status-pill-review::before { background: #c98a2b; }
.status-pill-complete { color: light-dark(#35608c, var(--theme-accent)); border-color: light-dark(#c2d5e6, var(--theme-line)); }
.status-pill-complete::before { background: #3f7fb5; }

.inventory-index-grid { display: grid; grid-template-columns: minmax(18rem, .65fr) minmax(28rem, 1.35fr); gap: 1rem; align-items: start; }
.inventory-create-card h2 { margin-bottom: .8rem; font-size: 1.4rem; }
.inventory-list-card { min-width: 0; }
.inventory-row { display: grid; grid-template-columns: 4rem minmax(0, 1fr) auto; gap: 1rem; align-items: center; min-height: 6.2rem; padding: 1rem 1.25rem; color: inherit; border-bottom: 1px solid light-dark(#e8ecf0, var(--theme-line)); text-decoration: none; transition: 130ms ease; }
.inventory-row:last-child, .setup-row:last-child { border-bottom: 0; }
.inventory-row:hover { background: light-dark(#f8fafc, var(--theme-raised)); }
.inventory-date-tile { display: grid; min-height: 3.6rem; place-content: center; text-align: center; background: var(--accent-soft); border-radius: .45rem; }
.inventory-date-tile strong, .inventory-date-tile small, .inventory-row-copy strong, .inventory-row-copy small, .inventory-row-value small { display: block; }
.inventory-date-tile strong { color: light-dark(#1d4e7f, var(--theme-accent)); font-size: 1.25rem; line-height: 1; }
.inventory-date-tile small { margin-top: .25rem; color: light-dark(#6684a5, var(--theme-muted)); font-size: .58rem; font-weight: 800; text-transform: uppercase; }
.inventory-row-copy { min-width: 0; }
.inventory-row-copy strong { overflow: hidden; color: light-dark(#1f2d3d, var(--theme-ink)); font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
.inventory-row-copy small, .inventory-row-value small { margin-top: .35rem; color: light-dark(#77879a, var(--theme-muted)); font-size: .68rem; }
.inventory-row-value { text-align: right; }
.inventory-row-value .status-pill { margin-left: auto; }

.inventory-workspace-heading { display: flex; justify-content: space-between; gap: 2rem; align-items: end; margin: .5rem 0 1.5rem; }
.back-link { display: inline-block; margin-bottom: 1.35rem; color: light-dark(#3e6491, var(--theme-accent)); font-size: .72rem; font-weight: 750; text-decoration: none; }
.workspace-status-actions { display: flex; justify-content: flex-end; gap: .55rem; align-items: center; flex-wrap: wrap; }
.workspace-section-nav { display: flex; gap: .3rem; margin-bottom: 2rem; padding: .3rem; overflow-x: auto; background: light-dark(#fff, var(--theme-surface)); border: 1px solid light-dark(#d7dde5, var(--theme-line)); border-radius: .5rem; box-shadow: 0 1px 2px rgba(16, 32, 54, .05); }
.workspace-section-nav a, .workspace-section-nav span { display: inline-flex; gap: .45rem; align-items: center; flex: 0 0 auto; min-height: 2.25rem; padding: .45rem .65rem; color: light-dark(#7c8a99, var(--theme-muted)); border-radius: .35rem; font-size: .67rem; font-weight: 750; text-decoration: none; }
.workspace-section-nav a { color: light-dark(#45596f, var(--theme-muted)); }
.workspace-section-nav a:hover { background: light-dark(#f0f4f9, var(--theme-raised)); }
.workspace-section-nav a.is-active { color: #fff; background: var(--brand); }
.workspace-section-nav a.is-active small { color: #a9c4dd; }
.workspace-section-nav small { color: light-dark(#8b9bb0, var(--theme-muted)); font-size: .55rem; letter-spacing: .05em; text-transform: uppercase; }
.inventory-section { scroll-margin-top: calc(var(--appbar-height) + 1rem); margin-bottom: 4rem; }
.readiness-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.readiness-card { min-height: 8.5rem; padding: 1rem; background: light-dark(#fff, var(--theme-surface)); border: 1px solid var(--line); border-radius: .5rem; }
.readiness-card > span { display: grid; width: 1.7rem; height: 1.7rem; margin-bottom: 1.35rem; place-items: center; color: light-dark(#2265ad, var(--theme-accent)); background: var(--accent-soft); border-radius: 50%; font-size: .68rem; font-weight: 850; }
.readiness-card strong, .readiness-card small { display: block; }
.readiness-card strong { font-size: .78rem; }
.readiness-card small { margin-top: .3rem; color: light-dark(#7e8c9d, var(--theme-muted)); font-size: .67rem; }
.readiness-card.is-ready { border-color: light-dark(#bad6c6, var(--theme-line)); background: light-dark(#fbfefc, var(--theme-surface)); }
.readiness-card.is-ready > span { color: light-dark(#256945, var(--theme-positive)); background: light-dark(#dff0e6, var(--theme-positive-soft)); }
.valuation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.valuation-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.setup-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(7rem, .55fr) minmax(8rem, .75fr); gap: 1rem; align-items: center; min-height: 4rem; padding: .8rem 1.25rem; border-bottom: 1px solid light-dark(#e8ecf0, var(--theme-line)); }
.setup-row strong { font-size: .76rem; }
.setup-row span, .setup-row small { color: light-dark(#737f8f, var(--theme-muted)); font-size: .67rem; }
.setup-row .effect-add { color: light-dark(#28734f, var(--theme-positive)); font-weight: 800; }
.setup-row .effect-subtract { color: light-dark(#9b4b45, var(--theme-danger)); font-weight: 800; }
.setup-control-total { margin: .8rem 0 .45rem; color: light-dark(var(--brand), var(--theme-accent)); font-family: var(--font-display); font-size: 2rem; font-weight: 800; }
.setup-row-with-actions { grid-template-columns: minmax(0, 1fr) auto; }
.setup-row-with-actions > div:first-child { display: grid; grid-template-columns: minmax(0, 1fr) minmax(7rem, .55fr) minmax(6rem, .5fr); gap: 1rem; align-items: center; }
.setup-row-actions { display: flex; gap: .4rem; justify-content: flex-end; }
.setup-row-actions .button { min-height: 2rem; padding: .35rem .65rem; font-size: .63rem; }
.button-danger { color: #fff; background: #a43f38; border-color: light-dark(#a43f38, var(--theme-line)); }
.button-danger:hover { background: #87322d; border-color: #87322d; }

.analysis-worksheet-stack {
    display: grid;
    gap: 1rem;
}

.analysis-section-card {
    padding: 0;
    overflow: hidden;
}

.analysis-position-empty {
    border-top: 1px solid light-dark(#e8ecf0, var(--theme-line));
}

.analysis-position-add-line {
    grid-template-columns: minmax(11rem, .7fr) minmax(14rem, 1fr) auto;
}

.analysis-position-add-line .analysis-store-default-choice {
    grid-column: 2;
}

.analysis-table-scroll {
    position: relative;
    overflow-x: auto;
}

.analysis-worksheet-table {
    width: 100%;
    border-collapse: collapse;
}

.analysis-worksheet-table th,
.analysis-worksheet-table td {
    padding: .65rem .75rem;
    border-top: 1px solid light-dark(#e8ecf0, var(--theme-line));
    text-align: left;
    vertical-align: middle;
}

.analysis-worksheet-table thead th {
    color: light-dark(#718093, var(--theme-muted));
    background: light-dark(#f8fafb, var(--theme-raised));
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.analysis-worksheet-table tbody th,
.analysis-worksheet-table tbody td {
    vertical-align: top;
}

.analysis-worksheet-table th:first-child {
    min-width: 16rem;
}

.analysis-worksheet-table td:not(:last-child) {
    min-width: 9rem;
}

.analysis-line-label {
    width: 100%;
    min-height: 2.35rem;
    padding: .45rem .6rem;
    color: light-dark(#25384c, var(--theme-ink));
    background: transparent;
    border: 1px solid transparent;
    border-radius: .4rem;
    font-size: .74rem;
    font-weight: 750;
}

.analysis-line-label:hover:not(:disabled),
.analysis-line-label:focus {
    background: light-dark(#fff, var(--theme-surface));
    border-color: light-dark(#cfd7e0, var(--theme-line));
    outline: 0;
}

.analysis-line-heading {
    display: grid;
    gap: .15rem;
}

.analysis-line-heading small {
    width: fit-content;
    padding: .15rem .35rem;
    color: light-dark(#406451, var(--theme-positive));
    background: light-dark(#e7f2eb, var(--theme-positive-soft));
    border-radius: 999px;
    font-size: .52rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.analysis-empty-cell {
    display: block;
    color: light-dark(#a2acb8, var(--theme-muted));
    text-align: center;
    padding-top: .6rem;
}

.analysis-row-actions {
    display: flex;
    gap: .3rem;
    justify-content: flex-end;
    min-width: 9rem;
    align-items: center;
    min-height: 2.35rem;
}

.analysis-row-actions button {
    min-width: 2rem;
    min-height: 2rem;
    padding: .3rem .45rem;
    color: light-dark(#526377, var(--theme-muted));
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid light-dark(#d9e0e7, var(--theme-line));
    border-radius: .35rem;
    cursor: pointer;
    font-size: .62rem;
    font-weight: 750;
}

.analysis-row-actions button:hover:not(:disabled) {
    color: light-dark(var(--brand), var(--theme-accent));
    border-color: light-dark(#9aabbc, var(--theme-line));
}

.analysis-row-actions button.is-danger {
    color: #fff;
    background: #a43f38;
    border-color: light-dark(#a43f38, var(--theme-line));
}

.analysis-row-actions button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.analysis-add-line {
    display: grid;
    grid-template-columns: minmax(10rem, .65fr) minmax(12rem, 1fr) minmax(12rem, 1fr) auto;
    gap: .65rem;
    align-items: center;
    padding: .8rem 1rem;
    background: light-dark(#fbfcfd, var(--theme-surface));
    border-top: 1px solid light-dark(#e8ecf0, var(--theme-line));
}

.analysis-add-line label,
.analysis-add-line-heading label {
    color: light-dark(#526377, var(--theme-muted));
    font-size: .68rem;
    font-weight: 800;
}

.analysis-add-line > input[type="text"] {
    min-height: 2.35rem;
    padding: .45rem .6rem;
    border: 1px solid light-dark(#cfd7e0, var(--theme-line));
    border-radius: .4rem;
}

.analysis-add-line-heading {
    display: grid;
    gap: .15rem;
}

.analysis-add-line-heading small {
    color: light-dark(#8491a0, var(--theme-muted));
    font-size: .58rem;
}

.analysis-column-choices {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .75rem;
}

.analysis-counter-pad-choice {
    flex-basis: 100%;
}

.analysis-column-choices label,
.analysis-store-default-choice {
    display: flex;
    gap: .35rem;
    align-items: center;
}

.analysis-column-choices input,
.analysis-store-default-choice input {
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.analysis-store-default-choice {
    grid-column: 2 / 4;
    color: light-dark(#406451, var(--theme-positive)) !important;
}

.analysis-boundary-note {
    margin-bottom: 1.25rem;
}

.analysis-value-input {
    width: 100%;
    min-height: 2.35rem;
    padding: .45rem .6rem;
    text-align: right;
    border: 1px solid light-dark(#cfd7e0, var(--theme-line));
    border-radius: .4rem;
}

.analysis-value-input:focus {
    border-color: light-dark(#4a82b6, var(--theme-line));
    outline: 0;
    box-shadow: 0 0 0 3px rgba(74, 130, 182, .13);
}

.analysis-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid var(--line);
    border-radius: .5rem;
}

.analysis-actions p {
    margin: 0;
    color: light-dark(#718093, var(--theme-muted));
    font-size: .68rem;
}

.dealertrack-import {
    margin-top: 3rem;
}

.compact-section-title h3 {
    font-family: var(--font-display);
    font-size: 1.55rem;
}

.dealertrack-import-grid {
    display: grid;
    grid-template-columns: minmax(18rem, .7fr) minmax(26rem, 1.3fr);
    gap: 1rem;
    align-items: start;
}

.dealertrack-summary-card {
    padding: 0;
    overflow: hidden;
}

.import-file-name,
.import-timestamp {
    margin: 0;
    padding: .8rem 1.1rem;
    color: light-dark(#607185, var(--theme-muted));
    font-size: .68rem;
    border-top: 1px solid light-dark(#e8ecf0, var(--theme-line));
}

.variance-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid light-dark(#e8ecf0, var(--theme-line));
}

.variance-summary-grid > div {
    min-height: 7.5rem;
    padding: 1rem 1.1rem;
    border-right: 1px solid light-dark(#e8ecf0, var(--theme-line));
}

.variance-summary-grid > div:last-child {
    border-right: 0;
}

.variance-summary-grid span,
.variance-summary-grid strong,
.variance-summary-grid small {
    display: block;
}

.variance-summary-grid span {
    color: light-dark(#78889a, var(--theme-muted));
    font-size: .62rem;
    font-weight: 750;
    text-transform: uppercase;
}

.variance-summary-grid strong {
    margin-top: .9rem;
    color: light-dark(var(--brand), var(--theme-accent));
    font-size: 1.45rem;
}

.variance-summary-grid small {
    margin-top: .2rem;
    color: light-dark(#607185, var(--theme-muted));
    font-size: .7rem;
}

.dealertrack-variance-workspace {
    margin-top: 0;
}

.dealertrack-source-bar {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem 1.1rem;
    color: #fff;
    background: linear-gradient(145deg, #142c49, #214c78);
    border-radius: .5rem;
    box-shadow: 0 .5rem 1.8rem rgba(19, 44, 73, .15);
}

.dealertrack-source-bar > div:first-child,
.dealertrack-source-bar span,
.dealertrack-source-bar strong,
.dealertrack-source-bar small {
    display: block;
}

.dealertrack-source-bar > div:first-child {
    min-width: 0;
}

.dealertrack-source-bar > div:first-child > span {
    color: light-dark(#9fb7d0, var(--theme-muted));
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.dealertrack-source-bar > div:first-child > strong {
    margin-top: .25rem;
    overflow: hidden;
    font-family: var(--font-display);
    font-size: 1.2rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dealertrack-source-bar > div:first-child > small {
    margin-top: .2rem;
    color: #b7c8da;
    font-size: .63rem;
}

.dealertrack-source-upload {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    gap: .65rem;
    align-items: center;
}

.dealertrack-source-upload input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.dealertrack-source-upload > span {
    max-width: 12rem;
    overflow: hidden;
    color: #d5e0eb;
    font-size: .63rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dealertrack-source-bar .button-secondary {
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .28);
}

.dealertrack-source-bar .button-primary {
    color: light-dark(#173552, var(--theme-ink));
    background: light-dark(#fff, var(--theme-surface));
}

.variance-template-empty {
    margin-top: 1rem;
    border: 1px solid var(--line);
    border-radius: .5rem;
}

.variance-filter-bar {
    display: grid;
    grid-template-columns: minmax(10rem, .7fr) minmax(11rem, .65fr) minmax(16rem, 1.35fr) auto;
    gap: 1rem;
    align-items: start;
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid var(--line);
    border-radius: .5rem;
    box-shadow: 0 1px 2px rgba(17, 38, 62, .04);
}

.variance-filter-bar .field {
    margin: 0;
}

.variance-filter-actions {
    display: flex;
    gap: .55rem;
    padding-top: 1.42rem;
}

.variance-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 1rem;
    overflow: hidden;
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid var(--line);
    border-radius: .5rem;
}

.variance-kpi-grid article {
    min-height: 6.5rem;
    padding: 1rem 1.1rem;
    border-right: 1px solid var(--line);
}

.variance-kpi-grid article:last-child {
    border-right: 0;
}

.variance-kpi-grid article.is-yellow-pad {
    background: light-dark(#fffaf0, var(--theme-warning-soft));
}

.variance-kpi-grid span,
.variance-kpi-grid strong {
    display: block;
}

.variance-kpi-grid span {
    color: light-dark(#738399, var(--theme-muted));
    font-size: .59rem;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.variance-kpi-grid strong {
    margin-top: .85rem;
    color: light-dark(var(--brand), var(--theme-accent));
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
}

.dealertrack-variance-print {
    margin-top: 1.25rem;
}

.variance-print-repeat-header {
    display: none;
}

.variance-result-section {
    overflow: hidden;
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid var(--line);
    border-radius: .5rem;
}

.variance-yellow-pad-section {
    margin-top: 1.25rem;
}

.variance-result-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.1rem;
}

.variance-result-heading .eyebrow {
    margin: 0 0 .15rem;
    font-size: .55rem;
}

.variance-result-heading h3 {
    margin: 0;
    color: light-dark(var(--brand), var(--theme-accent));
    font-family: var(--font-display);
    font-size: 1.45rem;
}

.variance-result-heading > div:last-child {
    display: grid;
    grid-template-columns: auto auto;
    gap: .75rem;
    align-items: baseline;
    color: light-dark(#66778b, var(--theme-muted));
    font-size: .68rem;
    font-variant-numeric: tabular-nums;
}

.variance-result-heading > div:last-child strong {
    color: light-dark(var(--brand), var(--theme-accent));
    font-size: 1rem;
}

.variance-table-scroll {
    overflow-x: auto;
    border-top: 1px solid var(--line);
}

.variance-table {
    width: 100%;
    min-width: 62rem;
    border-collapse: collapse;
}

.variance-yellow-pad-table {
    min-width: 79rem;
}

.variance-table th,
.variance-table td {
    padding: .62rem .7rem;
    border-bottom: 1px solid light-dark(#e6ebf0, var(--theme-line));
    text-align: left;
    vertical-align: middle;
}

.variance-table thead th {
    color: light-dark(#687b92, var(--theme-muted));
    background: light-dark(#f4f7fa, var(--theme-raised));
    font-size: .57rem;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.variance-table tbody tr:nth-child(even) {
    background: light-dark(#fafbfd, var(--theme-raised));
}

.variance-table tbody tr:last-child td {
    border-bottom: 0;
}

.variance-table td {
    color: light-dark(#33465b, var(--theme-ink));
    font-size: .66rem;
}

.variance-table td > strong,
.variance-table td > span {
    display: block;
}

.variance-table td > strong {
    color: light-dark(#23384f, var(--theme-ink));
}

.variance-table td > span {
    margin-top: .12rem;
    color: light-dark(#738398, var(--theme-muted));
    font-size: .59rem;
}

.variance-table .numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.variance-table .operator {
    width: 2rem;
    padding-right: .25rem;
    padding-left: .25rem;
    color: light-dark(#8290a0, var(--theme-muted));
    text-align: center;
}

.rapid-context {
    display: grid;
    grid-template-columns: minmax(14rem, 1fr) minmax(14rem, 1fr) minmax(16rem, .75fr);
    margin-bottom: 1rem;
    background: linear-gradient(150deg, #132a45, #1e4168);
    border-radius: .5rem;
    overflow: hidden;
}

.context-control,
.rapid-total {
    min-width: 0;
    padding: 1rem 1.15rem;
    border-right: 1px solid rgba(255, 255, 255, .1);
}

.context-control label,
.rapid-total span,
.rapid-total small {
    display: block;
    color: light-dark(#9db1c7, var(--theme-muted));
    font-size: .65rem;
}

.context-control label,
.rapid-total span {
    margin-bottom: .4rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.context-control select {
    width: 100%;
    min-height: 2.6rem;
    padding: .55rem .65rem;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: .5rem;
    outline: none;
}

.context-control select:focus {
    border-color: light-dark(#5ba3d9, var(--theme-line));
    box-shadow: 0 0 0 3px rgba(91, 163, 217, .16);
}

.context-control option {
    color: var(--ink);
    background: light-dark(#fff, var(--theme-surface));
}

.rapid-total {
    border-right: 0;
    background: rgba(0, 0, 0, .08);
}

.rapid-total strong {
    display: block;
    color: #fff;
    font-size: 1.45rem;
}

.rapid-total small {
    margin-top: .25rem;
}

.rapid-notice {
    display: grid;
    grid-template-columns: 1.65rem minmax(0, 1fr) auto;
    gap: .65rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: .7rem .9rem;
    color: light-dark(#285f43, var(--theme-positive));
    background: light-dark(#edf8f1, var(--theme-positive-soft));
    border: 1px solid light-dark(#bfdec9, var(--theme-line));
    border-radius: .45rem;
}

.rapid-notice > span {
    display: grid;
    width: 1.45rem;
    height: 1.45rem;
    place-items: center;
    color: #fff;
    background: #3f8861;
    border-radius: 50%;
    font-size: .65rem;
    font-weight: 850;
}

.rapid-notice strong,
.rapid-notice small {
    font-size: .7rem;
}

.rapid-notice small {
    color: light-dark(#648071, var(--theme-positive));
}

.rapid-notice.is-error {
    color: light-dark(#783632, var(--theme-danger));
    background: var(--red-soft);
    border-color: light-dark(#e6b8b4, var(--theme-line));
}

.rapid-notice.is-error > span {
    background: var(--red);
}

.rapid-entry-panel {
    margin-bottom: 1rem;
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid var(--line);
    border-radius: .55rem;
    box-shadow: 0 .3rem 1.4rem rgba(23, 40, 61, .05);
    overflow: hidden;
}

.rapid-entry-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: .9rem 1rem;
    background: light-dark(#f8fafc, var(--theme-raised));
    border-bottom: 1px solid light-dark(#e4e8ed, var(--theme-line));
}

.rapid-entry-heading span,
.rapid-entry-heading strong {
    display: block;
}

.rapid-entry-heading span {
    margin-bottom: .2rem;
    color: var(--accent);
    font-size: .58rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.rapid-entry-heading strong {
    color: light-dark(#3b4d63, var(--theme-ink));
    font-size: .73rem;
}

.rapid-actions {
    display: flex;
    gap: .45rem;
}

.rapid-actions .button {
    min-height: 2.2rem;
    padding: .45rem .65rem;
    font-size: .66rem;
}

kbd {
    padding: .12rem .28rem;
    color: light-dark(#4a5d74, var(--theme-muted));
    background: light-dark(#eff1f4, var(--theme-raised));
    border: 1px solid light-dark(#d1d7de, var(--theme-line));
    border-bottom-width: 2px;
    border-radius: .25rem;
    font-family: ui-monospace, monospace;
    font-size: .58rem;
}

.part-entry-grid,
.document-entry-grid {
    display: grid;
    grid-template-columns: minmax(9rem, 1.2fr) minmax(12rem, 1.5fr) minmax(6rem, .65fr) minmax(6rem, .55fr) minmax(7rem, .7fr) minmax(8rem, .75fr);
    gap: .65rem;
    align-items: start;
    padding: 1rem;
}

.document-entry-grid {
    grid-template-columns: minmax(9rem, 1.05fr) minmax(10rem, 1.15fr) minmax(8rem, .8fr) minmax(7rem, .7fr) minmax(12rem, 1.4fr) minmax(8rem, .75fr);
}

.rapid-field label {
    display: flex;
    gap: .35rem;
    align-items: center;
    margin-bottom: .35rem;
    color: light-dark(#42556c, var(--theme-muted));
    font-size: .67rem;
    font-weight: 750;
}

.rapid-field label span {
    display: grid;
    width: 1.05rem;
    height: 1.05rem;
    place-items: center;
    color: light-dark(#1d4e7f, var(--theme-accent));
    background: var(--accent-soft);
    border-radius: 50%;
    font-size: .52rem;
}

.rapid-field input {
    width: 100%;
    min-height: 2.85rem;
    padding: .58rem .65rem;
    color: light-dark(#212f3f, var(--theme-ink));
    background: light-dark(#fafbfd, var(--theme-raised));
    border: 1px solid light-dark(#c4cedb, var(--theme-line));
    border-radius: .5rem;
    outline: none;
}

.rapid-field input:focus {
    background: light-dark(#fff, var(--theme-surface));
    border-color: light-dark(#5c8ec4, var(--theme-line));
    box-shadow: 0 0 0 3px rgba(34, 101, 173, .12);
}

.rapid-field.has-error input {
    border-color: light-dark(#c96c66, var(--theme-line));
    box-shadow: 0 0 0 3px rgba(164, 62, 56, .08);
}

.rapid-field > small {
    display: block;
    margin-top: .25rem;
    color: var(--red);
    font-size: .6rem;
}

.rapid-field > small.age-warning {
    color: light-dark(#9a6a1c, var(--theme-warning));
    font-weight: 750;
}

.rapid-save {
    /* Match the input row, independent of messages beneath any field. */
    align-self: start;
    margin-top: calc(1.05rem + .35rem);
    min-height: 2.85rem;
    padding: .45rem .7rem;
    color: #fff;
    background: var(--brand);
    border: 0;
    border-radius: .5rem;
    cursor: pointer;
}

.rapid-save strong,
.rapid-save small {
    display: block;
}

.rapid-save strong { font-size: .7rem; }
.rapid-save small { margin-top: .15rem; color: #b5c8dd; font-size: .56rem; }
.rapid-save:disabled { cursor: not-allowed; opacity: .55; }

.rapid-editing {
    display: flex;
    gap: .75rem;
    align-items: center;
    padding: 0 1rem 1rem;
    color: light-dark(#33567c, var(--theme-muted));
    font-size: .68rem;
    font-weight: 750;
}

.rapid-records {
    overflow-x: auto;
}

.part-record {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) minmax(10rem, 1.3fr) minmax(5rem, .55fr) minmax(3rem, .35fr) minmax(6rem, .55fr) minmax(7rem, .65fr) minmax(7rem, auto);
    gap: .7rem;
    align-items: center;
    min-width: 58rem;
    min-height: 3.6rem;
    padding: .65rem 1rem;
    border-bottom: 1px solid light-dark(#e8ecf0, var(--theme-line));
}

.part-record:last-child { border-bottom: 0; }
.part-record strong { color: light-dark(#2a3a4d, var(--theme-ink)); font-size: .7rem; }
.part-record span, .part-record small { color: light-dark(#71808f, var(--theme-muted)); font-size: .65rem; }
.part-record .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.part-record > small { color: light-dark(#28734f, var(--theme-positive)); font-weight: 800; }
.part-record-header { min-height: 2.3rem; color: light-dark(#7e8c9d, var(--theme-muted)); background: light-dark(#f8fafc, var(--theme-raised)); }
.part-record-header span { font-size: .58rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.part-record.is-pending { background: light-dark(#fff8e9, var(--theme-warning-soft)); }
.part-record.is-pending > small { color: light-dark(#8b6027, var(--theme-warning)); }

.document-record {
    display: grid;
    grid-template-columns: minmax(8rem, .9fr) minmax(9rem, 1fr) minmax(7rem, .7fr) minmax(7rem, .65fr) minmax(12rem, 1.4fr) minmax(7rem, auto);
    gap: .7rem;
    align-items: center;
    min-width: 62rem;
    min-height: 3.6rem;
    padding: .65rem 1rem;
    border-bottom: 1px solid light-dark(#e8ecf0, var(--theme-line));
}

.document-record:last-child { border-bottom: 0; }
.document-record strong { color: light-dark(#2a3a4d, var(--theme-ink)); font-size: .7rem; }
.document-record span,
.document-record small { color: light-dark(#71808f, var(--theme-muted)); font-size: .65rem; }
.document-record .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.document-record > small { color: light-dark(#28734f, var(--theme-positive)); font-weight: 800; }
.document-record > small.age-status { color: light-dark(#9a6a1c, var(--theme-warning)); }
.document-record-header { min-height: 2.3rem; color: light-dark(#7e8c9d, var(--theme-muted)); background: light-dark(#f8fafc, var(--theme-raised)); }
.document-record-header span { font-size: .58rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.document-record.is-pending { background: light-dark(#fff8e9, var(--theme-warning-soft)); }
.document-record.is-pending > small { color: light-dark(#8b6027, var(--theme-warning)); }
.record-actions { display: flex; gap: .45rem; align-items: center; justify-content: flex-end; }

.work-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.work-list li {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    min-height: 6rem;
    padding: 1rem 0.25rem;
    border-bottom: 1px solid light-dark(#e8ebef, var(--theme-line));
}

.work-list li:last-child {
    border-bottom: 0;
}

.work-number {
    display: grid;
    width: 1.85rem;
    height: 1.85rem;
    place-items: center;
    color: light-dark(#64748b, var(--theme-muted));
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid light-dark(#cdd8e3, var(--theme-line));
    border-radius: 50%;
    font-family: ui-monospace, monospace;
    font-size: 0.68rem;
    font-weight: 700;
}

.work-list li.is-current .work-number {
    color: #fff;
    background: light-dark(var(--accent), var(--brand));
    border-color: var(--accent);
}

.work-list strong,
.work-list p {
    display: block;
    margin-bottom: 0;
}

.work-list strong {
    font-size: 0.88rem;
}

.work-list p {
    margin-top: 0.3rem;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.5;
}

.work-list a {
    color: light-dark(var(--brand), var(--theme-accent));
    font-size: 0.75rem;
    font-weight: 800;
}

.muted-label {
    color: light-dark(#919dab, var(--theme-muted));
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.guardrail-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem;
    color: #d0deee;
    background: linear-gradient(150deg, #132a45, #1e4168);
    border-color: #132a45;
}

.guardrail-panel .eyebrow {
    color: light-dark(#5ba3d9, var(--theme-accent));
}

.guardrail-panel h2 {
    color: #fff;
    font-size: 1.5rem;
}

.guardrail-panel p:not(.eyebrow) {
    color: #b6c8dc;
    font-size: 0.84rem;
    line-height: 1.65;
}

.guardrail-panel .status-pill {
    margin-top: auto;
    color: #cfdfee;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
}

.guardrail-panel .status-pill::before {
    background: #5ba3d9;
}

.shield-mark {
    display: grid;
    width: 2.7rem;
    height: 2.7rem;
    margin-bottom: 3.5rem;
    place-items: center;
    color: light-dark(#5ba3d9, var(--theme-accent));
    border: 1px solid rgba(91, 163, 217, 0.5);
    border-radius: 50%;
    font-size: 1.5rem;
}

.admin-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 1rem;
    background: linear-gradient(150deg, #132a45, #1e4168);
    border-radius: 0.5rem;
    overflow: hidden;
}

.admin-summary > div {
    padding: 1.25rem 1.4rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-summary > div:last-child {
    border-right: 0;
}

.admin-summary strong,
.admin-summary span {
    display: block;
}

.admin-summary strong {
    color: #fff;
    font-size: 1.8rem;
}

.admin-summary span {
    margin-top: 0.25rem;
    color: #aabccf;
    font-size: 0.7rem;
}

.section-jump {
    position: sticky;
    top: calc(var(--appbar-height) + 0.65rem);
    z-index: 10;
    display: flex;
    gap: 0.35rem;
    width: fit-content;
    margin: 1.5rem 0 0;
    padding: 0.3rem;
    background: light-dark(rgba(255, 255, 255, 0.92), #182638eb);
    border: 1px solid light-dark(#d7dde5, var(--theme-line));
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
}

.section-jump a {
    padding: 0.5rem 0.75rem;
    color: light-dark(#50647c, var(--theme-muted));
    border-radius: 0.48rem;
    font-size: 0.72rem;
    font-weight: 750;
    text-decoration: none;
}

.section-jump a:hover {
    color: light-dark(var(--brand), var(--theme-accent));
    background: light-dark(#eef3f9, var(--theme-raised));
}

.admin-section {
    scroll-margin-top: 9rem;
    padding-top: 4rem;
}

.section-title {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    align-items: end;
    margin-bottom: 1.25rem;
}

.section-title > p {
    max-width: 33rem;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.55;
    text-align: right;
}

.admin-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-columns-wide-list {
    grid-template-columns: minmax(20rem, 0.85fr) minmax(0, 1.15fr);
}

.admin-form-card h3 {
    margin-bottom: 1.25rem;
}

.step-chip {
    display: grid;
    width: 1.7rem;
    height: 1.7rem;
    place-items: center;
    color: light-dark(#1d4e7f, var(--theme-accent));
    background: var(--accent-soft);
    border-radius: 0.45rem;
    font-size: 0.67rem;
    font-weight: 850;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    margin-bottom: 0.38rem;
    color: light-dark(#42556c, var(--theme-muted));
    font-size: 0.71rem;
    font-weight: 750;
}

.field label span {
    color: light-dark(#8a97a7, var(--theme-muted));
    font-weight: 500;
}

.field input,
.field select,
.field textarea,
.admin-form-card select {
    width: 100%;
    min-height: 2.7rem;
    padding: 0.6rem 0.72rem;
    color: light-dark(#212f3f, var(--theme-ink));
    background: light-dark(#fafbfd, var(--theme-raised));
    border: 1px solid light-dark(#c7d0dc, var(--theme-line));
    border-radius: 0.5rem;
    outline: none;
    transition: 120ms ease;
}

.field input::placeholder {
    color: light-dark(#9ea8b4, var(--theme-muted));
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.admin-form-card select:focus {
    background: light-dark(#fff, var(--theme-surface));
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 1px var(--focus-ring);
}

.field textarea { display: block; resize: vertical; line-height: 1.5; }
#sticker-color { max-width: 24rem; }
.inventory-section + .inventory-section,
.admin-form-card + .inventory-section { margin-top: 2rem; }

.form-help {
    margin: -0.25rem 0 1rem;
    color: light-dark(#727f8e, var(--theme-muted));
    font-size: 0.7rem;
    line-height: 1.5;
}

.checkbox-field {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    margin: 0 0 1rem;
    color: light-dark(#42556c, var(--theme-muted));
    font-size: 0.74rem;
    font-weight: 750;
}

.checkbox-field input {
    width: 1rem;
    height: 1rem;
}

.admin-include-inactive { margin: 0; white-space: nowrap; }
.count-sheet-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(15rem, .65fr); gap: 1rem; align-items: start; }
.count-sheet-form { margin: 0; }
.count-sheet-form .field, .count-sheet-form .form-actions { margin: 0; }
.count-sheet-summary { min-height: 100%; }
@media(max-width:760px) { .count-sheet-layout { grid-template-columns: 1fr; } }

.form-actions,
.entity-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.form-actions {
    flex-wrap: wrap;
}

.entity-actions {
    justify-content: flex-end;
}

.admin-editors,
.admin-editor-single {
    margin-top: 1rem;
}

.admin-editor-single {
    max-width: 48rem;
}

.validation-message {
    display: block;
    margin-top: 0.28rem;
    color: var(--red);
    font-size: 0.68rem;
}

.valid.modified:not([type="checkbox"]) {
    border-color: light-dark(#6a9a7f, var(--theme-line));
}

.invalid {
    border-color: light-dark(#c96c66, var(--theme-line)) !important;
}

.data-card {
    overflow: hidden;
}

.data-card-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.25rem;
    background: light-dark(#f8fafc, var(--theme-raised));
    border-bottom: 1px solid light-dark(#e4e8ed, var(--theme-line));
}

.data-card-heading h3 {
    margin-bottom: 0;
}

.data-card-heading span {
    color: light-dark(#808f9f, var(--theme-muted));
    font-size: 0.7rem;
}

.organization-row,
.user-row {
    display: grid;
    grid-template-columns: minmax(13rem, 0.8fr) minmax(14rem, 1.4fr) auto;
    gap: 1.25rem;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid light-dark(#e8ecf0, var(--theme-line));
}

.organization-row:last-child,
.user-row:last-child {
    border-bottom: 0;
}

.organization-name {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    min-width: 0;
}

.organization-name strong,
.organization-name small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.organization-name strong {
    font-size: 0.78rem;
}

.organization-name small {
    margin-top: 0.18rem;
    color: light-dark(#808f9f, var(--theme-muted));
    font-size: 0.68rem;
}

.entity-avatar {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    place-items: center;
    color: light-dark(#2265ad, var(--theme-accent));
    background: light-dark(#e2edf8, var(--theme-raised));
    border-radius: 0.45rem;
    font-size: 0.68rem;
    font-weight: 850;
}

.entity-avatar-user {
    color: light-dark(#1d4e7f, var(--theme-accent));
    background: light-dark(#e2edf8, var(--theme-raised));
    border-radius: 50%;
}

.organization-stores,
.grant-list {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.organization-stores > span,
.grant-list > span {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    padding: 0.4rem 0.55rem;
    color: light-dark(#4a5d74, var(--theme-muted));
    background: light-dark(#eff2f6, var(--theme-raised));
    border-radius: 0.4rem;
    font-size: 0.69rem;
}

.organization-stores small,
.grant-list small {
    color: light-dark(#7e8c9d, var(--theme-muted));
    font-size: 0.62rem;
}

.grant-list strong {
    font-size: 0.68rem;
}

.organization-stores em,
.grant-list em {
    color: light-dark(#929daa, var(--theme-muted));
    font-size: 0.7rem;
}

.dms-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.dms-card {
    min-height: 8rem;
    padding: 1rem;
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid var(--line);
    border-radius: 0.5rem;
}

.dms-card strong,
.dms-card small {
    display: block;
}

.dms-card strong {
    font-size: 0.78rem;
}

.dms-card small {
    margin-top: 0.25rem;
    color: light-dark(#7f8e9f, var(--theme-muted));
    font-size: 0.67rem;
}

.identity-provider-grid {
    display: grid;
    gap: 0.75rem;
}

.identity-provider-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid var(--line);
    border-radius: 0.5rem;
}

.identity-provider-card strong,
.identity-provider-card small {
    display: block;
}

.identity-provider-card strong {
    margin-top: 0.6rem;
    font-size: 0.82rem;
}

.identity-provider-card small {
    margin-top: 0.25rem;
    color: light-dark(#74828f, var(--theme-muted));
    font-size: 0.68rem;
}

.identity-provider-card code {
    max-width: 48%;
    overflow-wrap: anywhere;
    color: light-dark(#66788c, var(--theme-muted));
    font-size: 0.65rem;
    text-align: right;
}

.admin-page-heading {
    align-items: flex-start;
}

.dealer-create-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.dealer-create-strip h2 {
    margin: 0;
    font-size: 1rem;
}

.dealer-admin-layout {
    display: grid;
    grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.dealer-directory {
    position: sticky;
    top: calc(var(--appbar-height) + 1rem);
    overflow: hidden;
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid var(--line);
    border-radius: 0.55rem;
    box-shadow: 0 0.8rem 2.5rem rgba(23, 40, 61, 0.05);
}

.dealer-directory-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1.1rem 1.15rem 0.9rem;
    border-bottom: 1px solid light-dark(#e7eaef, var(--theme-line));
}

.dealer-directory-heading h2 {
    margin: 0;
    font-size: 1.15rem;
}

.dealer-directory-heading .eyebrow {
    margin-bottom: 0.25rem;
}

.dealer-directory-heading > span {
    display: grid;
    min-width: 2rem;
    height: 2rem;
    place-items: center;
    color: light-dark(#35608c, var(--theme-accent));
    background: light-dark(#e7eef7, var(--theme-raised));
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
}

.dealer-selector {
    max-height: 27rem;
    padding: 0.45rem;
    overflow-y: auto;
}

.dealer-tree {
    max-height: 38rem;
    padding: 0.45rem;
    overflow-y: auto;
}

.dealer-tree-label {
    margin: 0;
    padding: 0.8rem 0.7rem 0.35rem;
    color: light-dark(#7d8c9d, var(--theme-muted));
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.dealer-tree-group {
    margin-bottom: 0.25rem;
}

.group-avatar {
    color: light-dark(#1d4e7f, var(--theme-accent));
    background: light-dark(#dce9f6, var(--theme-raised));
}

.dealer-selector-item.child-item {
    padding-left: 1.35rem;
}

.tree-branch {
    display: grid;
    width: 2.25rem;
    place-items: center;
    color: light-dark(#919eae, var(--theme-muted));
    font-size: 0.9rem;
}

.dealer-selector-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: center;
    width: 100%;
    padding: 0.72rem;
    color: light-dark(#2c3d51, var(--theme-ink));
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.45rem;
    cursor: pointer;
    text-align: left;
}

.dealer-selector-item:hover {
    background: light-dark(#f3f5f8, var(--theme-raised));
}

.dealer-selector-item.is-selected {
    background: light-dark(#eaf2fa, var(--theme-raised));
    border-color: light-dark(#c3d8ec, var(--theme-line));
    box-shadow: inset 3px 0 var(--brand);
}

.dealer-selector-item strong,
.dealer-selector-item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dealer-selector-item strong {
    font-size: 0.76rem;
}

.dealer-selector-item small {
    margin-top: 0.18rem;
    color: light-dark(#7a8a9c, var(--theme-muted));
    font-size: 0.65rem;
}

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: light-dark(#aeb9c6, var(--theme-raised));
    border-radius: 50%;
}

.status-dot.is-active {
    background: #54a778;
    box-shadow: 0 0 0 0.22rem rgba(84, 167, 120, 0.13);
}

.dealer-create-panel {
    padding: 0.9rem 1.15rem 1.1rem;
    background: light-dark(#f8fafc, var(--theme-raised));
    border-top: 1px solid light-dark(#e6eaef, var(--theme-line));
}

.dealer-create-panel summary {
    color: light-dark(var(--brand), var(--theme-accent));
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 800;
}

.dealer-create-panel[open] summary {
    margin-bottom: 1rem;
}

.dealer-settings {
    min-width: 0;
}

.dealer-settings-header {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: center;
    min-height: 8rem;
    padding: 1.4rem 1.5rem;
    color: #fff;
    background: linear-gradient(150deg, #132a45, #1e4168);
    border-radius: 0.55rem;
}

.dealer-settings-header h2 {
    margin-bottom: 0.3rem;
    color: #fff;
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
}

.dealer-settings-header p:not(.eyebrow) {
    margin: 0;
    color: #b3c5da;
    font-size: 0.76rem;
}

.dealer-settings-header .eyebrow {
    color: light-dark(#5ba3d9, var(--theme-accent));
}

.dealer-header-actions {
    display: flex;
    gap: 0.65rem;
    align-items: center;
}

.dealer-settings-header .button-secondary {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.dealer-settings-header .status-pill {
    color: #d2e3f2;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
}

.dealer-settings-header .status-pill::before {
    background: #5ba3d9;
}

.dealer-setting-section {
    padding-top: 2.4rem;
}

.section-title.compact {
    align-items: center;
}

.dealer-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
    margin-top: 1rem;
}

.location-list {
    display: grid;
    gap: 0.55rem;
}

.location-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 0.8rem;
    align-items: center;
    padding: 0.85rem 1rem;
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid var(--line);
    border-radius: 0.5rem;
}

.location-card strong,
.location-card small {
    display: block;
}

.location-card strong {
    font-size: 0.78rem;
}

.location-card small {
    margin-top: 0.18rem;
    color: light-dark(#7a8a9c, var(--theme-muted));
    font-size: 0.67rem;
}

.dealer-inline-editor {
    margin-top: 1rem;
}

.dealer-edit-grid {
    align-items: center;
}

.dealer-edit-grid .checkbox-field {
    margin-top: 0.75rem;
}

.dealer-provider-list {
    align-content: start;
}

.membership-note {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    color: light-dark(#52667e, var(--theme-muted));
    background: light-dark(#f0f3f7, var(--theme-raised));
    border: 1px solid light-dark(#d8dee6, var(--theme-line));
    border-radius: 0.45rem;
    font-size: 0.72rem;
}

.group-member-form {
    max-width: 34rem;
    margin-top: 1rem;
}

.dealer-empty-panel {
    display: grid;
    min-height: 22rem;
    place-items: center;
    align-content: center;
    text-align: center;
}

.dealer-empty-panel h2 {
    margin: 1rem 0 0.35rem;
}

.dealer-empty-panel p {
    color: var(--muted);
}

.entity-avatar-large {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.2rem;
}

.empty-state.compact {
    padding: 1rem;
    background: light-dark(#f7f9fb, var(--theme-raised));
    border: 1px dashed light-dark(#d0d7e0, var(--theme-line));
    border-radius: 0.45rem;
    color: light-dark(#788798, var(--theme-muted));
    font-size: 0.7rem;
}

.user-admin-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.user-admin-section:first-of-type {
    padding-top: 2rem;
}

.notice {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    margin: 1rem 0;
    padding: 0.85rem 1rem;
    border: 1px solid;
    border-radius: 0.45rem;
    font-size: 0.76rem;
}

.notice strong {
    white-space: nowrap;
}

.notice .button {
    min-height: 2.1rem;
    margin-left: auto;
}

.notice-success {
    color: light-dark(#235b40, var(--theme-positive));
    background: light-dark(#edf8f1, var(--theme-positive-soft));
    border-color: light-dark(#bfdec9, var(--theme-line));
}

.notice-info {
    color: light-dark(#2f5272, var(--theme-ink));
    background: light-dark(#eef5fb, var(--theme-raised));
    border-color: light-dark(#c4d9ec, var(--theme-line));
}

.notice-warning {
    color: light-dark(#72501f, var(--theme-warning));
    background: light-dark(#fff8e9, var(--theme-warning-soft));
    border-color: light-dark(#e5cf9f, var(--theme-line));
}

.notice-error {
    color: light-dark(#783632, var(--theme-danger));
    background: var(--red-soft);
    border-color: light-dark(#e6b8b4, var(--theme-line));
}

.loading-panel,
.empty-state {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    align-items: center;
    min-height: 10rem;
    color: light-dark(#6a7a8e, var(--theme-muted));
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid var(--line);
    border-radius: 0.55rem;
    font-size: 0.8rem;
}

.empty-state {
    border: 0;
    border-radius: 0;
}

.spinner {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid light-dark(#d2dae3, var(--theme-line));
    border-top-color: light-dark(var(--brand), var(--theme-accent));
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1050px) {
    .admin-columns,
    .admin-columns-wide-list,
    .dealer-admin-layout,
    .dealer-form-grid,
    .dealer-create-strip,
    .dashboard-grid,
    .inventory-index-grid,
    .valuation-grid,
    .valuation-lists {
        grid-template-columns: 1fr;
    }

    .dealer-directory {
        position: static;
    }

    .dealer-selector {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: none;
    }

    .dealer-tree {
        max-height: none;
    }

    .readiness-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rapid-context { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rapid-total { grid-column: 1 / -1; }
    .part-entry-grid,
    .document-entry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .guardrail-panel .status-pill {
        margin-top: 1rem;
    }

    .shield-mark {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 760px) {
    .page-heading,
    .section-title,
    .inventory-workspace-heading {
        display: block;
    }

    .workspace-status-actions { justify-content: flex-start; margin-top: 1rem; }

    .page-heading .button {
        margin-top: 1rem;
    }

    .section-title > p {
        margin-top: 0.75rem;
        text-align: left;
    }

    .metric-grid,
    .admin-summary,
    .field-grid,
    .dms-grid,
    .readiness-grid {
        grid-template-columns: 1fr;
    }

    .inventory-row { grid-template-columns: 3.5rem minmax(0, 1fr); }
    .inventory-row-value { grid-column: 2; text-align: left; }
    .inventory-row-value .status-pill { margin-left: 0; }
    .setup-row { grid-template-columns: 1fr; gap: .3rem; }
    .setup-row-with-actions > div:first-child { grid-template-columns: 1fr; gap: .3rem; }
    .setup-row-actions { justify-content: flex-start; flex-wrap: wrap; margin-top: .5rem; }
    .rapid-context,
    .part-entry-grid,
    .document-entry-grid { grid-template-columns: 1fr; }
    .rapid-save { margin-top: 0; }
    .rapid-total { grid-column: auto; }
    .context-control, .rapid-total { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .1); }
    .rapid-entry-heading, .rapid-notice { display: flex; align-items: flex-start; flex-direction: column; }
    .rapid-actions { width: 100%; flex-wrap: wrap; }

    .admin-summary > div {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .organization-row,
    .user-row {
        grid-template-columns: 1fr;
    }

    .dealer-selector,
    .user-admin-summary {
        grid-template-columns: 1fr;
    }

    .dealer-settings-header,
    .dealer-header-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .membership-note {
        align-items: flex-start;
        flex-direction: column;
    }

    .location-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .location-card .status-pill,
    .location-card .inline-action {
        grid-column: 2;
        justify-self: start;
    }

    .identity-provider-card {
        flex-direction: column;
    }

    .identity-provider-card code {
        max-width: 100%;
        text-align: left;
    }

    .entity-actions {
        justify-content: flex-start;
    }

    .section-jump {
        position: static;
        width: 100%;
        overflow-x: auto;
    }

    .section-jump a {
        flex: 0 0 auto;
    }

    .notice {
        align-items: flex-start;
        flex-direction: column;
    }

    .notice .button {
        margin-left: 0;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.admin-page-heading {
    align-items: center;
    margin-bottom: 1.25rem;
}

.admin-switcher {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.admin-switcher a,
.admin-switcher button,
.detail-tabs button {
    position: relative;
    padding: 0.7rem 0.1rem 0.8rem;
    color: var(--muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
}

.admin-switcher a.is-active,
.admin-switcher button.is-active,
.detail-tabs button.is-active {
    color: light-dark(var(--brand), var(--theme-accent));
}

.admin-switcher a.is-active::after,
.admin-switcher button.is-active::after,
.detail-tabs button.is-active::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: light-dark(var(--accent), var(--brand));
    content: "";
}

.admin-toolbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.admin-search {
    display: flex;
    flex: 1;
    gap: 0.65rem;
    align-items: center;
    max-width: 32rem;
    min-height: 2.75rem;
    padding: 0 0.8rem;
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid light-dark(#d0d7e0, var(--theme-line));
    border-radius: 0.45rem;
}

.admin-search:focus-within {
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 1px var(--focus-ring);
}

.admin-search svg {
    width: 1.05rem;
    fill: var(--muted);
}

.admin-search input {
    width: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--ink);
}

.store-group-filter {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 650;
}

.store-group-filter select {
    min-height: 2.75rem;
    max-width: 100%;
    padding: 0.55rem 2rem 0.55rem 0.8rem;
    color: var(--ink);
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid light-dark(#d0d7e0, var(--theme-line));
    border-radius: 0.45rem;
    font: inherit;
}

.store-group-filter select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.admin-filter {
    display: flex;
    padding: 0.2rem;
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid light-dark(#d5dde6, var(--theme-line));
    border-radius: 0.45rem;
}

.admin-filter button {
    padding: 0.45rem 0.7rem;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 0.45rem;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 750;
}

.admin-filter button.is-active {
    color: #fff;
    background: var(--brand);
}

.toolbar-count {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.75rem;
}

.admin-table-shell,
.settings-card,
.summary-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 0.55rem;
    box-shadow: 0 0.55rem 1.6rem rgba(23, 40, 61, 0.05);
}

.admin-table-shell {
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    padding: 0.8rem 1rem;
    color: light-dark(#71808f, var(--theme-muted));
    background: light-dark(#f8fafc, var(--theme-raised));
    border-bottom: 1px solid var(--line);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
}

.admin-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid light-dark(#eceff3, var(--theme-line));
    color: light-dark(#4a5d74, var(--theme-muted));
    font-size: 0.8rem;
}

.admin-table tbody tr {
    cursor: pointer;
    transition: background 120ms ease;
}

.admin-table tbody tr:hover {
    background: light-dark(#f5f8fb, var(--theme-raised));
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-table td:first-child {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    color: var(--ink);
}

.admin-table .entity-avatar {
    width: 2.15rem;
    height: 2.15rem;
    font-size: 0.65rem;
}

.table-meta {
    color: light-dark(#617185, var(--theme-muted));
    font-size: 0.75rem;
}

.row-chevron {
    width: 2rem;
    color: light-dark(#8a97a7, var(--theme-muted)) !important;
    font-size: 1.2rem !important;
    text-align: right;
}

.admin-table-shell > .empty-state {
    border: 0;
    border-radius: 0;
}

/* Shared ModalDialog (native <dialog>, opened with showModal). */
.modal-dialog {
    width: min(36rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: 1.5rem;
    overflow-y: auto;
    color: inherit;
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid var(--line);
    border-radius: 0.55rem;
    box-shadow: 0 1.5rem 4rem rgba(10, 22, 38, 0.28);
}

.modal-dialog::backdrop {
    background: rgba(11, 23, 40, 0.55);
}

.modal-dialog fieldset.field-fieldset { min-width: 0; margin: 0 0 1rem; padding: 0; border: 0; }
.modal-dialog fieldset.field-fieldset > legend { margin-bottom: 0.38rem; padding: 0; color: light-dark(#42556c, var(--theme-muted)); font-size: 0.71rem; font-weight: 750; }

.modal-dialog-small {
    width: min(30rem, 100%);
}

.contractor-dialog {
    width: min(58rem, calc(100vw - 2rem));
    margin: auto;
    border: 1px solid var(--line);
}

.contractor-dialog::backdrop {
    background: rgba(11, 23, 40, 0.55);
}

.contractor-dialog .field-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}

.contractor-dialog .contractor-name-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(5.5rem, .45fr);
}

.contractor-dialog .field { margin-bottom: .75rem; }
.internal-user-dialog { width: min(640px, calc(100vw - 2rem)); }
.internal-user-dialog .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 760px) {
    .contractor-dialog .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
    .contractor-dialog .field-grid { grid-template-columns: 1fr; }
}

.modal-heading,
.section-toolbar,
.detail-header,
.detail-identity,
.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.modal-heading {
    align-items: flex-start;
    margin-bottom: 1.35rem;
}

.modal-heading h2 {
    font-size: 1.35rem;
}

.icon-button {
    width: 2.2rem;
    height: 2.2rem;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
}

.modal-actions {
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.breadcrumbs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0.25rem 0 1.35rem;
    color: var(--muted);
    font-size: 0.72rem;
}

.breadcrumbs a {
    color: light-dark(#2e6096, var(--theme-accent));
    text-decoration: none;
}

.detail-header {
    align-items: center;
    margin-bottom: 1.35rem;
}

.detail-identity {
    justify-content: flex-start;
}

.detail-identity h1 {
    margin-bottom: 0.25rem;
}

.detail-identity p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.entity-avatar-large {
    width: 3.6rem;
    height: 3.6rem;
    font-size: 0.95rem;
}

.detail-tabs {
    display: flex;
    gap: 1.7rem;
    margin-bottom: 1.35rem;
    border-bottom: 1px solid var(--line);
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(14rem, 0.8fr);
    gap: 1rem;
    align-items: start;
}

.detail-grid-wide {
    grid-template-columns: minmax(0, 2.2fr) minmax(14rem, 0.7fr);
}

.detail-main-stack,
.summary-stack,
.auth-layout {
    display: grid;
    gap: 1rem;
}

.settings-card,
.summary-card {
    padding: 1.35rem;
}

.settings-card h2,
.settings-card h3,
.summary-card h3 {
    margin-bottom: 0.35rem;
}

.settings-card h2 {
    font-size: 1.25rem;
}

.section-toolbar {
    align-items: flex-start;
    margin-bottom: 1.2rem;
}

.section-toolbar p,
.summary-card p,
.effective-auth p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.5;
}

.summary-card h3 {
    font-size: 1.1rem;
}

.summary-card .inline-link {
    display: inline-block;
    margin-top: 0.75rem;
}

.inline-link,
.button-link {
    padding: 0;
    color: light-dark(#2265ad, var(--theme-accent));
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

.policy-options {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.policy-option {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 0.45rem;
    cursor: pointer;
}

.policy-option.is-selected {
    background: light-dark(#eef4fb, var(--theme-raised));
    border-color: light-dark(#6f96c0, var(--theme-line));
    box-shadow: inset 3px 0 var(--brand);
}

.policy-option input {
    margin-top: 0.2rem;
    accent-color: light-dark(var(--brand), var(--theme-accent));
}

.policy-option span {
    display: grid;
    gap: 0.25rem;
}

.policy-option small {
    color: var(--muted);
    line-height: 1.4;
}

.effective-auth,
.connection-row,
.member-row {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.protocol-mark {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    color: light-dark(var(--brand), var(--theme-accent));
    background: var(--brand-soft);
    border-radius: 0.55rem;
    font-weight: 700;
}

.connection-list,
.member-list {
    display: grid;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
}

.connection-row,
.member-row {
    padding: 0.85rem;
    border-bottom: 1px solid var(--line);
}

.connection-row:last-child,
.member-row:last-child {
    border-bottom: 0;
}

.connection-row > div,
.member-row .organization-name {
    display: grid;
    flex: 1;
    gap: 0.18rem;
    min-width: 0;
}

.connection-row small,
.member-row small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.69rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-row .organization-name {
    display: flex;
    align-items: center;
    color: var(--ink);
    text-decoration: none;
}

.member-row .organization-name > span:last-child {
    display: grid;
}

.auth-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--line);
    border-radius: 0.5rem;
}

.auth-metrics > div {
    display: grid;
    gap: 0.2rem;
    padding: 1rem;
    border-right: 1px solid var(--line);
}

.auth-metrics > div:last-child {
    border-right: 0;
}

.auth-metrics strong {
    color: light-dark(var(--brand), var(--theme-accent));
    font-size: 1.5rem;
}

.auth-metrics span {
    color: var(--muted);
    font-size: 0.68rem;
}

.scope-guidance {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    color: light-dark(#2c4a6e, var(--theme-ink));
    background: light-dark(#eef4fb, var(--theme-raised));
    border: 1px solid light-dark(#c9dcef, var(--theme-line));
    border-radius: 0.45rem;
}

.scope-guidance p {
    margin: 0.2rem 0 0;
    color: light-dark(#55708c, var(--theme-muted));
    font-size: 0.72rem;
}

.scope-user-list {
    display: grid;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    overflow: hidden;
}

.scope-user-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    gap: 0.8rem;
    align-items: center;
    padding: 0.85rem;
    border-bottom: 1px solid var(--line);
}

.scope-user-row:last-child {
    border-bottom: 0;
}

.scope-user-row > div {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.scope-user-row small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scope-user-row.is-inherited {
    grid-template-columns: auto minmax(0, 1fr) auto;
    background: light-dark(#f8fafc, var(--theme-raised));
}

.inherited-user-section {
    margin-top: 1.4rem;
}

.status-pill-muted {
    color: light-dark(#5e6d80, var(--theme-muted));
}

.role-badge {
    padding: 0.35rem 0.55rem;
    color: light-dark(#2c4a6e, var(--theme-ink));
    background: var(--accent-soft);
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 750;
}

.internal-grants,
.internal-grants > span {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.internal-grants {
    flex-wrap: wrap;
}

.modal-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    padding: 0.25rem;
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid light-dark(#d5dde6, var(--theme-line));
    border-radius: 0.45rem;
}

.modal-mode button {
    padding: 0.55rem;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 0.45rem;
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 750;
}

.modal-mode button.is-active {
    color: #fff;
    background: var(--brand);
}

/* GL reconciliation */
.reconciliation-title {
    align-items: end;
}

.reconciliation-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 1rem;
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid light-dark(#d7dde5, var(--theme-line));
    border-radius: .55rem;
    box-shadow: 0 .3rem 1.4rem rgba(23, 40, 61, .045);
    overflow: hidden;
}

.reconciliation-summary article {
    min-width: 0;
    padding: 1rem;
    border-right: 1px solid light-dark(#e5e9ee, var(--theme-line));
}

.reconciliation-summary article:last-child {
    border-right: 0;
}

.reconciliation-summary article.is-emphasis {
    background: light-dark(#f2f6fb, var(--theme-raised));
}

.reconciliation-summary article.is-result {
    background: linear-gradient(145deg, #132a45, #1e4168);
}

.reconciliation-summary span,
.reconciliation-summary small,
.reconciliation-summary strong {
    display: block;
}

.reconciliation-summary span {
    min-height: 2rem;
    color: light-dark(#718096, var(--theme-muted));
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .055em;
    line-height: 1.35;
    text-transform: uppercase;
}

.reconciliation-summary strong {
    overflow: hidden;
    color: light-dark(#1e2d3d, var(--theme-ink));
    font-size: 1.05rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reconciliation-summary small {
    margin-top: .3rem;
    color: light-dark(#8794a4, var(--theme-muted));
    font-size: .61rem;
    line-height: 1.35;
}

.reconciliation-summary .is-result span,
.reconciliation-summary .is-result small {
    color: #a9bed2;
}

.reconciliation-summary .is-result strong {
    color: #fff;
}

.is-positive { color: light-dark(#26724d, var(--theme-positive)) !important; }
.is-negative { color: light-dark(#a43e38, var(--theme-danger)) !important; }
.reconciliation-summary .is-result .is-positive { color: light-dark(#78d5a5, var(--theme-positive)) !important; }
.reconciliation-summary .is-result .is-negative { color: #ffaaa4 !important; }

.reconciliation-allocation {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .8rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    color: light-dark(#285f43, var(--theme-positive));
    background: light-dark(#edf8f1, var(--theme-positive-soft));
    border: 1px solid light-dark(#bfdec9, var(--theme-line));
    border-radius: .5rem;
}

.reconciliation-allocation.needs-attention {
    color: light-dark(#7b5723, var(--theme-warning));
    background: light-dark(#fff8e9, var(--theme-warning-soft));
    border-color: light-dark(#ead7ae, var(--theme-line));
}

.allocation-icon {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    color: #fff;
    background: #3f8861;
    border-radius: 50%;
    font-size: .72rem;
    font-weight: 850;
}

.needs-attention .allocation-icon {
    background: #bf842b;
}

.reconciliation-allocation strong {
    display: block;
    font-size: .74rem;
}

.reconciliation-allocation p {
    margin: .18rem 0 0;
    color: inherit;
    font-size: .67rem;
    line-height: 1.45;
    opacity: .8;
}

.reconciliation-account-list {
    display: grid;
    gap: 1rem;
}

.reconciliation-account-card {
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid var(--line);
    border-radius: .55rem;
    box-shadow: 0 .3rem 1.4rem rgba(23, 40, 61, .045);
    overflow: hidden;
}

.reconciliation-account-card > header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: .9rem 1.1rem;
    background: light-dark(#f7f9fb, var(--theme-raised));
    border-bottom: 1px solid light-dark(#e1e6ec, var(--theme-line));
}

.reconciliation-account-card header > div > span {
    display: block;
    margin-bottom: .2rem;
    color: light-dark(#7a899a, var(--theme-muted));
    font-size: .57rem;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.reconciliation-account-card h3 {
    margin: 0;
    font-size: .9rem;
}

.reconciliation-account-card header p {
    margin: .22rem 0 0;
    color: light-dark(#778598, var(--theme-muted));
    font-size: .66rem;
}

.rollup-badge {
    padding: .35rem .55rem;
    color: light-dark(#315f8d, var(--theme-accent));
    background: light-dark(#e6f0fa, var(--theme-raised));
    border-radius: 999px;
    font-size: .6rem;
    font-weight: 800;
    white-space: nowrap;
}

.reconciliation-inputs {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(14rem, .65fr);
    gap: 1rem;
    padding: 1rem 1.1rem;
}

.physical-input-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: .7rem;
}

.input-group-heading {
    grid-column: 1 / -1;
}

.input-group-heading strong,
.input-group-heading span {
    display: block;
}

.input-group-heading strong {
    color: light-dark(#334256, var(--theme-ink));
    font-size: .7rem;
}

.input-group-heading span {
    margin-top: .16rem;
    color: light-dark(#8895a5, var(--theme-muted));
    font-size: .62rem;
}

.gl-input-group {
    padding-left: 1rem;
    border-left: 1px solid light-dark(#e2e7ed, var(--theme-line));
}

.gl-input-group .reconciliation-field {
    margin-top: .7rem;
}

.reconciliation-placement {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin-top: .75rem;
    color: light-dark(#526377, var(--theme-muted));
    font-size: .64rem;
    font-weight: 700;
    line-height: 1.35;
}

.reconciliation-placement input {
    margin-top: .08rem;
}

.reconciliation-field label,
.reconciliation-field > small {
    display: block;
}

.reconciliation-field label {
    margin-bottom: .35rem;
    color: light-dark(#4a5b6f, var(--theme-muted));
    font-size: .64rem;
    font-weight: 750;
}

.reconciliation-field label span {
    margin-left: .25rem;
    color: light-dark(#8895a5, var(--theme-muted));
    font-size: .58rem;
    font-weight: 600;
}

.money-input {
    display: flex;
    align-items: center;
    min-height: 2.55rem;
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid light-dark(#cbd4de, var(--theme-line));
    border-radius: .42rem;
    overflow: hidden;
}

.money-input:focus-within {
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 1px var(--focus-ring);
}

.money-input > span {
    align-self: stretch;
    display: grid;
    width: 2.2rem;
    place-items: center;
    color: light-dark(#6b7d91, var(--theme-muted));
    background: light-dark(#f2f5f8, var(--theme-raised));
    border-right: 1px solid light-dark(#dce2e9, var(--theme-line));
    font-size: .72rem;
    font-weight: 750;
}

.money-input input {
    width: 100%;
    min-width: 0;
    padding: .55rem .65rem;
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
}

.money-input input::placeholder {
    color: light-dark(#a2adba, var(--theme-muted));
}

.money-input input:disabled {
    color: light-dark(#758292, var(--theme-muted));
    background: light-dark(#f8fafc, var(--theme-raised));
}

.reconciliation-field.has-error .money-input {
    border-color: light-dark(#c8625b, var(--theme-line));
    box-shadow: 0 0 0 3px rgba(164, 62, 56, .1);
}

.reconciliation-field > small {
    margin-top: .3rem;
    color: var(--red);
    font-size: .6rem;
}

.reconciliation-field > small.reconciliation-help {
    color: light-dark(#7b8898, var(--theme-muted));
}

.reconciliation-account-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 0;
    border-top: 1px solid light-dark(#e6eaef, var(--theme-line));
}

.reconciliation-account-metrics > div {
    padding: .75rem 1rem;
    border-right: 1px solid light-dark(#e6eaef, var(--theme-line));
}

.reconciliation-account-metrics > div:last-child {
    border-right: 0;
}

.reconciliation-account-metrics .account-result {
    background: light-dark(#f2f6fb, var(--theme-raised));
}

.reconciliation-account-metrics dt {
    margin-bottom: .2rem;
    color: light-dark(#8693a3, var(--theme-muted));
    font-size: .56rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.reconciliation-account-metrics dd {
    margin: 0;
    color: light-dark(#2c3b4d, var(--theme-ink));
    font-size: .74rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.reconciliation-save-bar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
    padding: .85rem 1rem;
    background: light-dark(#fff, var(--theme-surface));
    border: 1px solid light-dark(#ccd5df, var(--theme-line));
    border-radius: .5rem;
    box-shadow: 0 .55rem 2rem rgba(20, 38, 60, .13);
}

.reconciliation-save-bar strong,
.reconciliation-save-bar span {
    display: block;
}

.reconciliation-save-bar strong {
    color: light-dark(#27374a, var(--theme-ink));
    font-size: .73rem;
}

.reconciliation-save-bar span {
    margin-top: .17rem;
    color: light-dark(#7d8a9a, var(--theme-muted));
    font-size: .63rem;
}

@media (max-width: 1120px) {
    .dealertrack-import-grid {
        grid-template-columns: 1fr;
    }

    .analysis-add-line {
        grid-template-columns: minmax(10rem, .65fr) minmax(12rem, 1fr);
    }

    .analysis-store-default-choice {
        grid-column: 1 / -1;
    }

    .reconciliation-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .reconciliation-summary article:nth-child(3) {
        border-right: 0;
    }

    .reconciliation-summary article:nth-child(-n+3) {
        border-bottom: 1px solid light-dark(#e5e9ee, var(--theme-line));
    }
}

@media (max-width: 760px) {
    .variance-summary-grid {
        grid-template-columns: 1fr;
    }

    .analysis-add-line {
        grid-template-columns: 1fr;
    }

    .analysis-store-default-choice {
        grid-column: auto;
    }

    .analysis-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .analysis-actions .button {
        width: 100%;
    }

    .variance-summary-grid > div {
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid light-dark(#e8ecf0, var(--theme-line));
    }

    .variance-summary-grid > div:last-child {
        border-bottom: 0;
    }

    .reconciliation-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reconciliation-summary article:nth-child(3) {
        border-right: 1px solid light-dark(#e5e9ee, var(--theme-line));
    }

    .reconciliation-summary article:nth-child(2n) {
        border-right: 0;
    }

    .reconciliation-summary article:nth-child(-n+4) {
        border-bottom: 1px solid light-dark(#e5e9ee, var(--theme-line));
    }

    .reconciliation-allocation,
    .reconciliation-inputs {
        grid-template-columns: 1fr;
    }

    .allocation-icon {
        display: none;
    }

    .reconciliation-allocation .button,
    .reconciliation-save-bar .button {
        width: 100%;
    }

    .reconciliation-account-card > header,
    .reconciliation-save-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .rollup-badge {
        white-space: normal;
    }

    .gl-input-group {
        padding: 1rem 0 0;
        border-top: 1px solid light-dark(#e2e7ed, var(--theme-line));
        border-left: 0;
    }

    .reconciliation-account-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reconciliation-account-metrics > div:nth-child(2n) {
        border-right: 0;
    }

    .reconciliation-account-metrics > div:nth-child(-n+4) {
        border-bottom: 1px solid light-dark(#e6eaef, var(--theme-line));
    }
}

@media (max-width: 860px) {
    .detail-grid,
    .detail-grid-wide {
        grid-template-columns: 1fr;
    }

    .admin-toolbar {
        flex-wrap: wrap;
    }

    .admin-search {
        max-width: none;
        flex-basis: 100%;
    }

    .toolbar-count {
        margin-left: auto;
    }
}

@media (max-width: 680px) {
    .admin-page-heading,
    .detail-header,
    .section-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-page-heading .button,
    .section-toolbar .button {
        width: 100%;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table tr {
        position: relative;
        padding: 0.85rem;
        border-bottom: 1px solid var(--line);
    }

    .admin-table td,
    .admin-table td:first-child {
        display: flex;
        justify-content: space-between;
        padding: 0.25rem 1.5rem 0.25rem 0;
        border: 0;
    }

    .admin-table td:first-child {
        justify-content: flex-start;
        margin-bottom: 0.35rem;
    }

    .admin-table td:not(:first-child):not(.row-chevron)::before {
        color: light-dark(#7c8a99, var(--theme-muted));
        content: attr(data-label);
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
    }

    .admin-table .row-chevron {
        position: absolute;
        top: 1rem;
        right: 0;
        width: auto;
    }

    .member-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .member-row .organization-name {
        flex-basis: calc(100% - 1rem);
    }

    .auth-metrics {
        grid-template-columns: 1fr;
    }

    .auth-metrics > div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .auth-metrics > div:last-child {
        border-bottom: 0;
    }

    .connection-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .scope-guidance,
    .scope-user-row {
        align-items: flex-start;
    }

    .scope-guidance {
        flex-direction: column;
    }

    .scope-user-row,
    .scope-user-row.is-inherited {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .scope-user-row .status-pill,
    .scope-user-row .internal-grants,
    .scope-user-row .role-badge,
    .scope-user-row > .button,
    .scope-user-row .inline-action {
        grid-column: 2;
        justify-self: start;
    }
}

.report-review { display: grid; gap: var(--settings-gap); }

.report-review-hero { display: flex; align-items: center; justify-content: space-between; gap: var(--settings-gap); }

.report-review-hero h3 { margin: .25rem 0; font-size: 1.25rem; }

.report-review-hero p { margin: 0; color: var(--muted); }

.report-publication-action {
    display: grid;
    justify-items: end;
    gap: 0.65rem;
    max-width: 25rem;
    text-align: right;
}

.report-publication-action small {
    color: var(--muted);
    line-height: 1.45;
}

.report-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    background: var(--panel);
}

.report-metric-grid article {
    display: grid;
    gap: 0.4rem;
    padding: 1.2rem 1.35rem;
    border-right: 1px solid var(--line);
}

.report-metric-grid article:last-child {
    border-right: 0;
}

.report-metric-grid span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.report-metric-grid strong {
    color: var(--ink);
    font-size: 1.2rem;
}

.report-metric-grid .is-total {
    background: var(--brand-soft);
}

.report-review-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.report-preview-card {
    display: grid;
    align-content: start;
    gap: 1rem;
    min-height: 15rem;
    padding: var(--settings-padding);
}

.report-preview-card > p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.report-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.report-card-heading h3 {
    margin: 0.15rem 0 0;
    color: var(--ink);
    font-size: 1.3rem;
}

.button-compact {
    min-height: auto;
    padding: 0.55rem 0.8rem;
    font-size: 0.78rem;
}

.report-summary-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.report-summary-list div,
.report-section-order li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-top: 1px solid var(--line);
}

.report-summary-list dt {
    color: var(--ink);
    font-weight: 700;
}

.report-summary-list dd,
.report-section-order small {
    margin: 0;
    color: var(--muted);
}

.report-inline-total,
.report-combined-download {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.report-inline-total {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.report-inline-total span {
    color: var(--muted);
}

.report-inline-total strong {
    color: light-dark(var(--brand), var(--theme-accent));
    font-size: 1.25rem;
}

.report-section-order {
    margin: 0;
    padding: 0;
    list-style: none;
}

.report-section-order span {
    color: var(--ink);
    font-weight: 700;
}

.report-detail-counts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.report-detail-counts div {
    display: grid;
    gap: 0.15rem;
    padding: 0.9rem 1rem;
    border-radius: 0.7rem;
    background: light-dark(#f6f8fa, var(--theme-raised));
}

.report-detail-counts strong {
    color: light-dark(var(--brand), var(--theme-accent));
    font-size: 1.35rem;
}

.report-detail-counts span {
    color: var(--muted);
    font-size: 0.78rem;
}

.report-combined-download {
    padding: 1.2rem 1.35rem;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    background: var(--panel);
}

.report-combined-download > div {
    display: grid;
    gap: 0.25rem;
}

.report-combined-download strong {
    color: var(--ink);
}

.report-combined-download span {
    color: var(--muted);
    font-size: 0.84rem;
}

@media (max-width: 920px) {
    .variance-filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .variance-filter-actions {
        justify-content: flex-end;
    }

    .report-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-metric-grid article:nth-child(2) {
        border-right: 0;
    }

    .report-metric-grid article:nth-child(-n+2) {
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 720px) {
    .dealertrack-source-bar,
    .dealertrack-source-upload {
        align-items: stretch;
        flex-direction: column;
    }

    .dealertrack-source-upload .button {
        width: 100%;
    }

    .variance-filter-bar,
    .variance-kpi-grid {
        grid-template-columns: 1fr;
    }

    .variance-filter-actions {
        justify-content: stretch;
    }

    .variance-filter-actions .button {
        flex: 1;
    }

    .variance-kpi-grid article {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .variance-kpi-grid article:last-child {
        border-bottom: 0;
    }

    .report-review-hero,
    .report-combined-download {
        align-items: flex-start;
        flex-direction: column;
    }

    .report-publication-action {
        justify-items: start;
        max-width: none;
        text-align: left;
    }

    .report-review-grid,
    .report-metric-grid {
        grid-template-columns: 1fr;
    }

    .report-metric-grid article,
    .report-metric-grid article:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .report-metric-grid article:last-child {
        border-bottom: 0;
    }

    .report-combined-download .button {
        width: 100%;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    body {
        background: light-dark(#fff, var(--theme-surface)) !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    body * {
        visibility: hidden !important;
    }

    .dealertrack-variance-print,
    .dealertrack-variance-print * {
        visibility: visible !important;
    }

    .dealertrack-variance-print {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        margin: 0;
        color: light-dark(#1f2a37, var(--theme-ink));
    }

    .variance-no-print {
        display: none !important;
    }

    .variance-screen-section-heading {
        display: none;
    }

    .variance-print-repeat-header {
        display: table-row;
    }

    .variance-print-repeat-header > th {
        padding: 0 0 3mm !important;
        color: light-dark(#1f2a37, var(--theme-ink)) !important;
        background: light-dark(#fff, var(--theme-surface)) !important;
        border-bottom: 0;
        letter-spacing: normal;
        text-align: left;
        text-transform: none;
    }

    .variance-print-identity {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        align-items: start;
        padding-bottom: 3mm;
        border-bottom: 2px solid #2265ad;
    }

    .variance-print-identity strong,
    .variance-print-identity span {
        display: block;
    }

    .variance-print-identity strong {
        color: light-dark(#1e3a5f, var(--theme-ink));
        font-size: 13pt;
    }

    .variance-print-identity span {
        margin-top: 1mm;
        color: light-dark(#64748b, var(--theme-muted));
        font-size: 8pt;
    }

    .variance-print-section-title {
        padding-top: 3mm;
        color: light-dark(#1e3a5f, var(--theme-ink));
        font-family: var(--font-display);
        font-size: 15pt;
        font-weight: 700;
    }

    .variance-result-section {
        overflow: visible;
        border: 0;
        border-radius: 0;
    }

    .variance-yellow-pad-section {
        margin-top: 0;
        break-before: page;
        page-break-before: always;
    }

    .variance-table-scroll {
        overflow: visible;
    }

    .variance-table,
    .variance-yellow-pad-table {
        min-width: 0;
        table-layout: fixed;
        font-size: 6.2pt;
    }

    .variance-table th,
    .variance-table td {
        padding: 1.8mm 1mm;
    }

    .variance-table thead th.numeric {
        white-space: normal;
    }

    .variance-table:not(.variance-yellow-pad-table) thead tr:not(.variance-print-repeat-header) th:nth-child(1) {
        width: 11%;
    }

    .variance-table:not(.variance-yellow-pad-table) thead tr:not(.variance-print-repeat-header) th:nth-child(2) {
        width: 27%;
    }

    .variance-table:not(.variance-yellow-pad-table) thead tr:not(.variance-print-repeat-header) th:nth-child(3) {
        width: 14%;
    }

    .variance-table:not(.variance-yellow-pad-table) thead tr:not(.variance-print-repeat-header) th:nth-child(4) {
        width: 12%;
    }

    .variance-table:not(.variance-yellow-pad-table) thead tr:not(.variance-print-repeat-header) th:nth-child(5) {
        width: 11%;
    }

    .variance-table:not(.variance-yellow-pad-table) thead tr:not(.variance-print-repeat-header) th:nth-child(6) {
        width: 9%;
    }

    .variance-table:not(.variance-yellow-pad-table) thead tr:not(.variance-print-repeat-header) th:nth-child(7) {
        width: 16%;
    }

    .variance-yellow-pad-table {
        font-size: 5.4pt;
    }

    .variance-yellow-pad-table th,
    .variance-yellow-pad-table td {
        padding: 1.5mm .65mm;
    }

    .variance-yellow-pad-table thead tr:not(.variance-print-repeat-header) th:nth-child(1) {
        width: 20%;
    }

    .variance-yellow-pad-table thead tr:not(.variance-print-repeat-header) th:nth-child(2),
    .variance-yellow-pad-table thead tr:not(.variance-print-repeat-header) th:nth-child(4) {
        width: 13%;
    }

    .variance-yellow-pad-table thead tr:not(.variance-print-repeat-header) th:nth-child(3),
    .variance-yellow-pad-table thead tr:not(.variance-print-repeat-header) th:nth-child(5) {
        width: 3%;
    }

    .variance-yellow-pad-table thead tr:not(.variance-print-repeat-header) th:nth-child(6) {
        width: 11%;
    }

    .variance-yellow-pad-table thead tr:not(.variance-print-repeat-header) th:nth-child(7) {
        width: 9%;
    }

    .variance-yellow-pad-table thead tr:not(.variance-print-repeat-header) th:nth-child(8),
    .variance-yellow-pad-table thead tr:not(.variance-print-repeat-header) th:nth-child(9) {
        width: 8%;
    }

    .variance-yellow-pad-table thead tr:not(.variance-print-repeat-header) th:nth-child(10) {
        width: 12%;
    }

    .variance-table thead {
        display: table-header-group;
    }

    .variance-table thead th {
        background: light-dark(#fff, var(--theme-surface));
    }

    .variance-table tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .variance-table tbody tr,
    .variance-table tbody tr:nth-child(even),
    .variance-table tbody td {
        background: light-dark(#fff, var(--theme-surface));
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
.calendar-toolbar{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin:1.5rem 0}.calendar-toolbar h2{margin:0;min-width:12rem;text-align:center}.calendar-scroll{overflow-x:auto}.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));min-width:760px;border-top:1px solid var(--line);border-left:1px solid var(--line);background:light-dark(white, var(--theme-surface));border-radius:.5rem;overflow:hidden}.calendar-weekday{padding:.8rem;text-align:center;background:light-dark(#edf2f7, var(--theme-raised));font-size:.8rem;font-weight:700}.calendar-day{min-height:135px;padding:.5rem;border-bottom:1px solid var(--line);border-right:1px solid var(--line);min-width:0}.calendar-day.outside-month{background:light-dark(#f5f7fa, var(--theme-raised))}.calendar-day.today{box-shadow:inset 0 3px light-dark(#3984be, var(--theme-line))}.calendar-date{border:0;background:transparent;padding:.3rem .5rem;color:var(--ink);font-weight:700;cursor:pointer}.calendar-event{display:block;width:100%;text-align:left;border:0;border-left:3px solid #296ba1;background:light-dark(#e6f0f8, var(--theme-raised));border-radius:4px;padding:.5rem;margin:.3rem 0;color:light-dark(#183750, var(--theme-ink));cursor:pointer;font:inherit;font-size:.72rem;overflow-wrap:anywhere}.calendar-event strong,.calendar-event span,.calendar-event small{display:block}.calendar-event.other-event{background:light-dark(#eef0e8, var(--theme-warning-soft));border-color:#718244}.cancelled{opacity:.65;text-decoration:line-through}.calendar-editor{margin:1rem 0;padding:1.5rem}.calendar-tags{display:flex;gap:1rem;border:0;padding:0;margin:1rem 0}.calendar-tags legend{font-size:.8rem;font-weight:700;margin-bottom:.5rem}.calendar-tags label{display:flex;align-items:center;gap:.5rem;border:1px solid var(--line);border-radius:.45rem;padding:.7rem 1.2rem;cursor:pointer}.calendar-tags label:has(input:checked){background:light-dark(#dcecf8, var(--theme-raised));border-color:light-dark(#3779ad, var(--theme-line))}.schedule-row{display:grid;grid-template-columns:130px 1fr auto;gap:1.5rem;padding:1.5rem;border-bottom:1px solid var(--line);align-items:start}.schedule-row h3,.schedule-row p{margin:0 0 .5rem}.schedule-row small{display:block;margin-top:.5rem}.schedule-row a{margin-right:1rem}.schedule-notes{white-space:pre-wrap}.inventory-map{height:420px;border:1px solid var(--line);border-radius:.5rem;margin:1rem 0;z-index:0}.settings-card+.settings-card{margin-top:1.5rem}.calendar-toolbar .checkbox-field{margin:0}@media(max-width:700px){.schedule-row{grid-template-columns:1fr}.inventory-map{height:320px}.calendar-toolbar .form-actions{flex-wrap:wrap}}
.entry-import{margin:1rem 0}.entry-import>.settings-card{margin-top:1rem}.import-controls{border:0;padding:0;min-width:0}.import-mapping{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:1rem;margin:1rem 0}.import-mapping .field{display:flex;flex-direction:column;gap:.4rem}.entry-import select,.entry-import input:not([type=checkbox]):not([type=file]){border:1px solid light-dark(#bdcbd9, var(--theme-line));border-radius:7px;padding:.6rem;color:light-dark(#193b60, var(--theme-ink));background:light-dark(white, var(--theme-surface));max-width:100%}.import-table-scroll{overflow:auto;margin:1rem 0}.import-table{border-collapse:collapse;width:100%;text-align:left}.import-table th,.import-table td{padding:.6rem;border-bottom:1px solid light-dark(#dde5ee, var(--theme-line));vertical-align:top}.import-table th{background:light-dark(#edf2f7, var(--theme-raised));font-size:.8rem}.import-table td input{min-width:130px;width:100%}.import-table td input[type=checkbox]{min-width:0}.import-table .source-cell{white-space:pre-wrap;min-width:110px;max-width:280px;overflow-wrap:anywhere}.import-excluded{background:light-dark(#f4f5f7, var(--theme-raised));color:light-dark(#637184, var(--theme-muted))}.entry-import .checkbox-field{margin:.8rem 0}.entry-import details{margin-top:1rem}.entry-import button{margin-top:.4rem}

.inventory-create-fields{border:0;padding:0;margin:0;min-width:0}


/* Live inventory summaries share the report calculations. */
.inventory-summary { margin: 1.75rem 0 3rem; }
.summary-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1.1rem; background: light-dark(#fff, var(--theme-surface)); border: 1px solid light-dark(#dce3ea, var(--theme-line)); border-radius: .5rem; overflow: hidden; }
.summary-metrics > div { padding: 1.1rem 1.35rem; border-right: 1px solid light-dark(#e6ebf0, var(--theme-line)); }
.summary-metrics > div:last-child { border-right: 0; }
.summary-metrics span { display: block; margin-bottom: .45rem; color: light-dark(#64748b, var(--theme-muted)); font-size: .75rem; font-weight: 550; }
.summary-metrics strong { display: block; color: light-dark(#203b57, var(--theme-ink)); font-size: clamp(1.2rem, 1.7vw, 1.8rem); font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.summary-metrics .summary-metric-total { background: light-dark(#eef3f7, var(--theme-raised)); }
.summary-metric-total strong { color: light-dark(#234c39, var(--theme-positive)); }
.summary-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; align-items: start; }
.summary-page-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.summary-page-heading h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.02em; }
.summary-page-heading p { margin: 0; color: var(--muted); font-size: .8rem; }
.summary-jump-links { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.25rem; }
.summary-jump-links a { padding: .45rem .75rem; border: 1px solid light-dark(#d9e2eb, var(--theme-line)); border-radius: 2rem; color: light-dark(#38516c, var(--theme-ink)); background: light-dark(#fff, var(--theme-surface)); font-size: .75rem; font-weight: 600; text-decoration: none; }
.summary-jump-links a:hover { border-color: light-dark(#6085a9, var(--theme-line)); background: light-dark(#eaf1f7, var(--theme-raised)); }
.summary-jump-links a:focus-visible, .summary-back-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.inventory-summary-card { overflow: hidden; margin-bottom: 0; background: light-dark(#fff, var(--theme-surface)); border: 1px solid light-dark(#dce3ea, var(--theme-line)); border-radius: .5rem; box-shadow: 0 2px 5px #142b4310; scroll-margin-top: 1rem; }
.summary-card-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.4rem; border-bottom: 1px solid light-dark(#dce3ea, var(--theme-line)); }
.summary-combined .summary-card-heading { background: light-dark(#f2f6fb, var(--theme-raised)); }
.summary-card-heading h3 { margin: 0; font-size: 1.08rem; font-weight: 700; letter-spacing: -.015em; color: light-dark(#203b57, var(--theme-ink)); }
.summary-card-heading > span { color: light-dark(#778594, var(--theme-muted)); font-size: .72rem; }
.inventory-summary-card table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.inventory-summary-card .summary-count-column { width: 5rem; }
.inventory-summary-card .summary-amount-column { width: 10rem; }
.inventory-summary-card th, .inventory-summary-card td { padding: .6rem 1.4rem; border-bottom: 1px solid light-dark(#edf0f3, var(--theme-line)); text-align: left; overflow-wrap: anywhere; font-size: .82rem; line-height: 1.35; }
.inventory-summary-card tbody th { font-weight: 450; }
.inventory-summary-card thead th { padding-block: .55rem; color: light-dark(#788593, var(--theme-muted)); background: light-dark(#fff, var(--theme-surface)); font-size: .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .075em; }
.inventory-summary-card .numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inventory-summary-card .summary-section-heading { background: light-dark(#f3f6f9, var(--theme-raised)); color: light-dark(#536a80, var(--theme-muted)); }
.inventory-summary-card .summary-section-heading th { padding-block: .5rem; font-size: .65rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; border-top: 1px solid light-dark(#e5ebf1, var(--theme-line)); }
.inventory-summary-card .summary-counter-pad th, .inventory-summary-card .summary-counter-pad td { padding-block: .75rem; font-weight: 600; }
.inventory-summary-card .summary-subtotal th, .inventory-summary-card .summary-subtotal td { border-top: 1px solid light-dark(#c9d3de, var(--theme-line)); font-weight: 650; color: light-dark(#354b60, var(--theme-ink)); background: light-dark(#fafbfc, var(--theme-raised)); }
.inventory-summary-card .summary-negative { color: light-dark(#96524c, var(--theme-danger)); }
.inventory-summary-card tfoot { background: light-dark(#eef3f7, var(--theme-raised)); color: light-dark(#16324b, var(--theme-ink)); font-weight: 750; border-top: 2px solid light-dark(#c9d6e1, var(--theme-line)); }
.inventory-summary-card tfoot th, .inventory-summary-card tfoot td { padding-block: .95rem; border-top: 1px solid light-dark(#b8d3c2, var(--theme-line)); border-bottom: 0; }
.inventory-summary-card tfoot td:last-child { font-size: 1rem; }
.summary-empty { color: light-dark(#8793a0, var(--theme-muted)); font-size: .78rem !important; font-style: italic; }
.summary-missing { color: var(--muted); font-size: .8rem; padding: .75rem 1.4rem; margin: 0; }
.inventory-summary-card .summary-comparison { display: block; margin-top: .25rem; color: var(--muted); font-size: .65rem; font-weight: 400; line-height: 1.3; white-space: normal; }
.summary-footnote { color: var(--muted); font-size: .75rem; margin: .75rem 0; }
.summary-back-link { display: block; padding: .6rem 1.4rem; border-top: 1px solid light-dark(#e5ebf1, var(--theme-line)); text-align: right; color: light-dark(#5d7186, var(--theme-muted)); text-decoration: none; font-size: .7rem; }
.summary-back-link:hover { color: light-dark(#203b57, var(--theme-ink)); text-decoration: underline; }
.inventory-summary-card caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 600px) {
    .summary-card-grid { grid-template-columns: 1fr; }
    .summary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-metrics > div { padding: .8rem; }
    .summary-metrics > div:nth-child(-n+2) { border-bottom: 1px solid light-dark(#e6ebf0, var(--theme-line)); }
    .summary-metrics > div:nth-child(2) { border-right: 0; }
    .summary-page-heading { display: block; }
    .summary-page-heading p { margin-top: .35rem; }
    .summary-card-heading { padding: 1rem .75rem; }
    .summary-card-heading > span { display: none; }
    .inventory-summary-card th, .inventory-summary-card td { padding-inline: .75rem; font-size: .75rem; }
    .inventory-summary-card .summary-count-column { width: 3.5rem; }
    .inventory-summary-card .summary-amount-column { width: 8rem; }
    .inventory-summary-card tfoot td:last-child { font-size: .85rem; }
}

@media (min-width: 601px) and (max-width: 1000px) {
    .summary-card-grid { grid-template-columns: 1fr; }
}

.import-file-field { display: grid; gap: .5rem; color: light-dark(#29445f, var(--theme-ink)); font-size: .85rem; font-weight: 650; }
.import-file-input { width: 100%; padding: .65rem; border: 1px solid light-dark(#c9d5e0, var(--theme-line)); border-radius: .5rem; background: light-dark(#f8fafc, var(--theme-raised)); color: light-dark(#42576d, var(--theme-muted)); font: inherit; }
.import-file-input::file-selector-button { margin-right: .8rem; padding: .6rem 1rem; border: 1px solid light-dark(#bacbdb, var(--theme-line)); border-radius: .35rem; background: light-dark(#fff, var(--theme-surface)); color: light-dark(#203e60, var(--theme-ink)); font: inherit; font-weight: 650; cursor: pointer; }
.import-file-input::file-selector-button:hover { background: light-dark(#eaf1f8, var(--theme-raised)); }
.import-file-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.document-search { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.document-search label { font-size: .8rem; font-weight: 650; }
.document-search input[type="search"] { flex: 1; min-width: 12rem; padding: .65rem .8rem; border: 1px solid light-dark(#bdcbd9, var(--theme-line)); border-radius: .4rem; color: light-dark(#193b60, var(--theme-ink)); background: light-dark(#fff, var(--theme-surface)); font: inherit; }

.document-search-field { display: flex; flex: 1; min-width: 18rem; align-items: center; gap: .8rem; }
.document-search-toggle { display: flex; align-items: center; gap: .5rem; white-space: nowrap; cursor: pointer; }
.document-search-toggle input { accent-color: #215b92; width: 1rem; height: 1rem; }
.document-record.is-search-match, .part-record.is-search-match { background: light-dark(#fffdf3, var(--theme-warning-soft)); box-shadow: inset 3px 0 light-dark(#d5a72d, var(--theme-line)); }
.document-record mark, .part-record mark { background: light-dark(#ffe49a, var(--theme-warning-soft)); color: light-dark(#24364b, var(--theme-ink)); border-radius: .15rem; padding: .08rem .04rem; }
.document-pagination { display: flex; justify-content: flex-end; align-items: center; gap: .7rem; padding: .8rem 1rem; border-top: 1px solid var(--line); }
.document-pagination span { margin-right: auto; font-size: .85rem; }
@media(max-width: 640px) { .document-search-field { min-width: 100%; flex-wrap: wrap; gap: .4rem; } .document-search-field input { width: 100%; } }

/* Contractor and payroll workspaces */
.payroll-table-scroll { position: relative; overflow-x: auto; margin: 1rem 0; }
.payroll-table-scroll .data-table { width: 100%; border-collapse: collapse; text-align: left; }
.payroll-table-scroll th { background: light-dark(#edf2f7, var(--theme-raised)); color: light-dark(#294357, var(--theme-ink)); font-size: .78rem; white-space: nowrap; }
.payroll-table-scroll th, .payroll-table-scroll td { padding: .8rem; border-bottom: 1px solid light-dark(#dde5ee, var(--theme-line)); vertical-align: top; }
.payroll-table-scroll td .button { margin: 0 .4rem .3rem 0; }
.payroll-inventory-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: .6rem; max-height: 260px; overflow: auto; margin: 1rem 0; }
.payroll-inventory-list label { display: flex; gap: .6rem; align-items: center; padding: .65rem; border: 1px solid var(--line); border-radius: 6px; }
.payroll-inventory-list label:has(input:checked) { background: light-dark(#e6f0f8, var(--theme-raised)); border-color: light-dark(#3779ad, var(--theme-line)); }
.payroll-inventory-list span { margin-left: auto; font-size: .8rem; white-space: nowrap; }

/* Inventory payroll entry and separate export workspace */
.payroll-export-tabs { display:flex; gap:.25rem; border-bottom:1px solid var(--line); margin:-.2rem 0 1.5rem; }
.payroll-export-tabs button { background:transparent; color:var(--muted); border:0; border-bottom:3px solid transparent; padding:.9rem 1.1rem; font:inherit; font-weight:700; cursor:pointer; }
.payroll-export-tabs button.is-active { color:light-dark(#20466b, var(--theme-ink)); border-bottom-color:#20466b; }
.payroll-export-columns { display:grid; grid-template-columns:1fr 1fr; gap:1.5rem; margin-bottom:1.25rem; }
.payroll-store-picker { display:block; }
.payroll-selection-heading { display:flex; justify-content:space-between; gap:1rem; align-items:center; min-height:3.7rem; margin-bottom:.7rem; }
.payroll-selection-heading h2 { font-size:1rem; margin:0; }
.payroll-selection-heading p { font-size:.78rem; color:var(--muted); margin:.3rem 0 0; }
.payroll-export-list { min-height:210px; max-height:370px; overflow:auto; border:1px solid var(--line); border-radius:8px; background:light-dark(#fafbfd, var(--theme-raised)); }
.payroll-export-basket { background:light-dark(#f4f8fc, var(--theme-raised)); }
.payroll-export-inventory { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:1rem; border-bottom:1px solid var(--line); }
.payroll-export-inventory:last-child { border-bottom:0; }
.payroll-export-inventory strong,.payroll-export-inventory span,.payroll-export-inventory a { display:block; }
.payroll-export-inventory strong { font-size:.88rem; }
.payroll-export-inventory span,.payroll-export-inventory a { font-size:.78rem; margin-top:.3rem; }
.payroll-text-action { color:light-dark(#315d85, var(--theme-accent)); border:0; padding:.3rem; background:transparent; font:inherit; font-size:.78rem; cursor:pointer; white-space:nowrap; }
.payroll-text-action:hover { text-decoration:underline; }
.payroll-export-list .empty-state { padding:1.5rem; line-height:1.7; font-size:.85rem; }
.payroll-export-dates { display:grid; grid-template-columns:repeat(2,minmax(150px,250px)); gap:1rem; }
.payroll-help { color:var(--muted); font-size:.82rem; margin-bottom:1.5rem; }
.payroll-entry-fields { display:grid; grid-template-columns:minmax(170px,2fr) minmax(140px,1.2fr) repeat(2,minmax(110px,1fr)) minmax(90px,.8fr) minmax(100px,.8fr); gap:.65rem; border:0; padding:0; margin:.9rem 0 .2rem; min-width:0; }
.payroll-entry-fields .field { min-width:0; margin-bottom:.4rem; }
.payroll-entry-fields .field input,.payroll-entry-fields .field select { font-size:.86rem; padding:.55rem; }
.payroll-entry-actions { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-top:.4rem; }
.payroll-entry-actions .checkbox-field { margin:0; font-size:.78rem; }
.payroll-fixed-value { min-height:2.7rem; display:flex; align-items:center; font-size:.9rem; font-weight:700; }
.payroll-register { margin-top:1.2rem; }
.payroll-entry-table td { font-size:.83rem; }
.payroll-entry-table th,.payroll-entry-table td { padding:.7rem .6rem; }
.payroll-row-actions { white-space:nowrap; }
.payroll-entry-table .payroll-row-actions .button { font-size:.75rem; padding:.45rem .6rem; }
.payroll-open { display:inline-block; color:light-dark(#8c601b, var(--theme-warning)); background:light-dark(#fff2d9, var(--theme-warning-soft)); border-radius:4px; padding:.2rem .5rem; font-size:.75rem; font-weight:700; }
.payroll-selected-row td { background:light-dark(#f0f6fc, var(--theme-raised)); }
.payroll-inline-editor td { background:light-dark(#f0f6fc, var(--theme-raised)); border-left:3px solid #315d85; padding:1rem; }
.payroll-inline-editor .payroll-entry-fields { grid-template-columns:repeat(3,minmax(140px,1fr)); }
.payroll-contractor-total td { background:light-dark(#f6f8fb, var(--theme-raised)); border-bottom:2px solid light-dark(#d9e2eb, var(--theme-line)); font-weight:700; }
.payroll-contractor-total small { display:block; font-size:.74rem; font-weight:400; color:var(--muted); margin-top:.3rem; }
.payroll-contractor-total small.payroll-four-hour { color:light-dark(#906522, var(--theme-warning)); }
.payroll-remove-confirm { display:flex; align-items:center; gap:1rem; padding:.6rem; background:light-dark(#fff7e9, var(--theme-warning-soft)); }
.payroll-type-totals { display:grid; grid-template-columns:repeat(4,1fr); gap:1rem; margin-top:1rem; }
.payroll-type-totals>div { border-right:1px solid var(--line); padding-right:1rem; }
.payroll-type-totals>div:last-child { border:0; }
.payroll-type-totals span,.payroll-type-totals strong,.payroll-type-totals small { display:block; }
.payroll-type-totals span { font-size:.8rem; color:var(--muted); }
.payroll-type-totals strong { font-size:1.3rem; margin:.4rem 0; }
.payroll-type-totals small { font-size:.75rem; color:var(--muted); }
.payroll-export-preview tfoot { border-top:2px solid var(--line); background:light-dark(#f4f8fc, var(--theme-raised)); font-weight:700; }
@media(max-width:1250px) { .payroll-entry-fields { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:760px) { .payroll-export-columns { grid-template-columns:1fr; } .payroll-entry-fields,.payroll-inline-editor .payroll-entry-fields { grid-template-columns:repeat(2,minmax(0,1fr)); } .payroll-entry-actions { align-items:flex-start; flex-wrap:wrap; } .payroll-type-totals { grid-template-columns:repeat(2,1fr); } .payroll-register .section-toolbar { flex-wrap:wrap; } }

.payroll-page-title { margin-bottom: 1.1rem; }
.payroll-page-title h2 { margin: 0; }
.payroll-page-title p { margin: .4rem 0 0; color: var(--muted); font-size: .85rem; }
.payroll-add-panel { padding: 1.15rem 1.25rem; }
.payroll-add-panel h3 { font-size: .92rem; }
.payroll-entry-actions { justify-content: flex-end; }
.payroll-entry-actions .form-actions { margin: 0; }
.payroll-register-toolbar { margin: 1.6rem 0 .7rem; }
.payroll-register-toolbar h3 { font-size: 1rem; }
.payroll-register-toolbar .field { margin: 0; width: min(16rem, 100%); }
.payroll-register-toolbar input { padding: .55rem .75rem; font-size: .8rem; }
.payroll-contractor-card { margin-bottom: 1.2rem; border: 1px solid light-dark(#d6e0ea, var(--theme-line)); border-radius: .6rem; background: light-dark(white, var(--theme-surface)); overflow: hidden; }
.payroll-contractor-card > header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.2rem; }
.payroll-contractor-card h4 { font-size: 1rem; margin: 0; }
.payroll-contractor-card > header > div { display: flex; gap: 1.25rem; align-items: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.payroll-contractor-card > header span { color: var(--muted); font-size: .85rem; }
.payroll-contractor-card > header strong { font-size: 1.12rem; }
.payroll-contractor-card .payroll-table-scroll { margin: 0; }
.payroll-contractor-card .payroll-entry-table th { background: light-dark(#f6f8fb, var(--theme-raised)); color: light-dark(#728194, var(--theme-muted)); font-weight: 600; font-size: .7rem; }
.payroll-contractor-card .payroll-entry-table td { vertical-align: middle; font-variant-numeric: tabular-nums; }
.payroll-contractor-card .payroll-entry-table th:first-child,.payroll-contractor-card .payroll-entry-table td:first-child { padding-left: 1.2rem; }
.payroll-type-badge { display: inline-block; font-size: .72rem; background: light-dark(#eef3f8, var(--theme-raised)); border-radius: .25rem; padding: .18rem .45rem; color: light-dark(#3d5d7e, var(--theme-muted)); }
.payroll-entry-note { display: block; font-size: .65rem; color: var(--muted); margin-top: .2rem; }
.payroll-row-actions { text-align: right; padding-right: 1rem !important; }
.payroll-remove-action { color: var(--red); margin-left: .5rem; }
.payroll-minimum { display: flex; justify-content: space-between; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .85rem 1.2rem; background: light-dark(#fcfdff, var(--theme-surface)); }
.payroll-minimum strong,.payroll-minimum small { display: block; }
.payroll-minimum strong { font-size: .8rem; color: light-dark(#775c2c, var(--theme-warning)); }
.payroll-minimum small { font-size: .72rem; color: var(--muted); margin-top: .2rem; }
.payroll-minimum .notice { width: 100%; margin: 0; }
.payroll-minimum-button { font-size: .8rem; padding: .6rem .85rem; border-color: light-dark(#9ab5cc, var(--theme-line)); color: light-dark(#214f77, var(--theme-accent)); background: light-dark(#f1f7fc, var(--theme-raised)); }
.payroll-minimum-met { font-size: .76rem; color: light-dark(#3e7658, var(--theme-positive)); }
.inventory-row-with-actions { display: flex; align-items: center; gap: .75rem; padding-right: 1rem; border-bottom: 1px solid var(--line); }
.inventory-row-with-actions > .inventory-row { flex: 1; min-width: 0; border-bottom: 0; }
.lifecycle-actions { display: inline-flex; align-items: center; gap: .5rem; position: relative; }
.data-card:has(.lifecycle-actions), .admin-table-shell:has(.lifecycle-actions) { overflow: visible; }
.lifecycle-menu { position: absolute; right: 0; top: 100%; z-index: 30; min-width: 10rem; padding: .35rem; border: 1px solid var(--line); border-radius: .4rem; background: light-dark(white, var(--theme-surface)); box-shadow: 0 6px 18px #16324b22; }
.lifecycle-menu button { display: block; width: 100%; padding: .6rem .7rem; border: 0; background: light-dark(white, var(--theme-surface)); color: light-dark(var(--brand), var(--theme-accent)); font: inherit; font-size: .8rem; text-align: left; cursor: pointer; }
.lifecycle-menu button:hover { background: light-dark(#edf4fa, var(--theme-raised)); }
.lifecycle-dialog { margin: auto; border: 0; text-align: left; white-space: normal; }
.lifecycle-dialog h2 { font-size: 1.3rem; }
.lifecycle-dialog p { margin-top: 1rem; }
.lifecycle-dialog::backdrop { background: #112f4c70; }
.dealer-address-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.address-search-status { color: var(--muted); font-size: .8rem; }
.address-autocomplete { position: relative; }
.address-autocomplete > input { width: 100%; }
.address-suggestions { position: absolute; inset: 100% 0 auto; z-index: 40; max-height: 20rem; overflow-y: auto; background: light-dark(white, var(--theme-surface)); border: 1px solid var(--line); border-radius: .4rem; box-shadow: 0 6px 18px #16324b22; min-width: min(26rem, 75vw); }
.address-suggestions > button { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; border: 0; border-bottom: 1px solid var(--line); background: light-dark(white, var(--theme-surface)); padding: .7rem .8rem; color: light-dark(var(--brand), var(--theme-accent)); font: inherit; font-size: .85rem; text-align: left; cursor: pointer; }
.address-suggestions > button:is(:hover, .is-active) { background: light-dark(#edf4fa, var(--theme-raised)); }
.address-suggestions > button span, .address-suggestions > button small { font-size: .75rem; color: var(--muted); }
.payroll-pending-note { font-size: .76rem; color: light-dark(#8b713b, var(--theme-warning)); }
@media(min-width:1100px) { .payroll-entry-fields { grid-template-columns: minmax(165px,1.6fr) minmax(130px,1.1fr) repeat(2,minmax(115px,1fr)) minmax(85px,.7fr) minmax(95px,.8fr); } }
@media(max-width:600px) { .payroll-contractor-card > header { align-items: flex-start; } .payroll-contractor-card > header > div { gap: .35rem; flex-direction: column; align-items: flex-end; } .payroll-minimum-button { width: 100%; } }

.contractor-autocomplete { position: relative; min-width: 0; }
.contractor-autocomplete > input { width: 100%; }
.contractor-suggestions { position: absolute; inset: calc(100% + .25rem) auto auto 0; z-index: 45; width: max(100%, 22rem); max-width: min(34rem, calc(100vw - 4rem)); max-height: 22rem; overflow-y: auto; background: light-dark(#fff, var(--theme-surface)); border: 1px solid var(--line); border-radius: .5rem; box-shadow: 0 8px 24px #16324b22; }
.contractor-suggestions [role=option] { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; width: 100%; padding: .7rem .85rem; border: 0; border-bottom: 1px solid var(--line); background: light-dark(#fff, var(--theme-surface)); color: light-dark(var(--brand), var(--theme-accent)); text-align: left; cursor: pointer; font: inherit; font-size: .85rem; }
.contractor-suggestions [role=option]:is(:hover, .is-active) { background: light-dark(#edf4fa, var(--theme-raised)); box-shadow: inset 3px 0 var(--brand); }
.contractor-suggestions [role=option] span, .contractor-suggestions [role=option] small { color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.contractor-suggestions [role=option] span:empty { display: none; }
.contractor-search-status { padding: .65rem .85rem; font-size: .78rem; color: var(--muted); }
.contractor-directory-search { flex: 1 1 34rem; max-width: 46rem; margin-bottom: 0; }
.contractor-state-filter { flex: 0 0 8.5rem; margin-bottom: 0; }
.contractor-directory-toolbar { align-items: flex-end; justify-content: flex-start; margin-bottom: 1rem; }
.contractor-directory-actions { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; margin-left: auto; }
.contractor-directory-actions .button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; margin: 0; white-space: nowrap; }
.contractor-inactive-toggle { min-height: 2.9rem; margin: 0; white-space: nowrap; }
.contractor-directory-shell { margin: 0; overflow: auto; border: 1px solid light-dark(#d5e0ea, var(--theme-line)); border-radius: .7rem; background: light-dark(#fff, var(--theme-surface)); box-shadow: 0 4px 16px #17344f0a; }
.contractor-directory-table { table-layout: fixed; }
.contractor-directory-table th { padding: .72rem 1rem; background: light-dark(#f4f7fa, var(--theme-raised)); border-bottom: 1px solid light-dark(#d5e0ea, var(--theme-line)); color: light-dark(#607388, var(--theme-muted)); font-size: .69rem; font-weight: 750; letter-spacing: .055em; text-transform: uppercase; }
.contractor-sort-button { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; letter-spacing: inherit; text-align: left; text-transform: inherit; cursor: pointer; }
.contractor-sort-button span { color: light-dark(#8292a3, var(--theme-muted)); font-size: .8rem; line-height: 1; }
.contractor-sort-button:hover,.contractor-sort-button:focus-visible { color: light-dark(#214f79, var(--theme-accent)); }
.contractor-directory-table th:nth-child(1) { width: 30%; }
.contractor-directory-table th:nth-child(2) { width: 30%; }
.contractor-directory-table th:nth-child(3) { width: 7rem; }
.contractor-directory-table th:nth-child(4) { width: 12rem; }
.contractor-directory-table th:last-child { width: 7.5rem; }
.contractor-directory-table td { padding: .9rem 1rem; vertical-align: middle; border-bottom-color: light-dark(#e3e9ef, var(--theme-line)); }
.contractor-directory-table tbody tr:last-child td { border-bottom: 0; }
.contractor-directory-table tbody tr:hover td { background: light-dark(#f9fbfd, var(--theme-raised)); }
.contractor-name-cell strong,.contractor-name-cell span { display: block; }
.contractor-name-cell strong { color: light-dark(#193b5d, var(--theme-ink)); font-size: .9rem; line-height: 1.35; }
.contractor-name-cell span { margin-top: .22rem; color: light-dark(#738295, var(--theme-muted)); font-size: .73rem; }
.contractor-contact-stack { display: grid; justify-items: start; gap: .28rem; min-width: 0; }
.contractor-contact-stack a { max-width: 100%; color: light-dark(#315f87, var(--theme-accent)); font-size: .78rem; overflow-wrap: anywhere; text-decoration: none; }
.contractor-contact-stack a:hover { text-decoration: underline; }
.contractor-contact-stack .contractor-phone { color: light-dark(#2a4259, var(--theme-ink)); font-variant-numeric: tabular-nums; font-weight: 700; }
.contractor-contact-empty { color: light-dark(#8794a2, var(--theme-muted)); font-size: .75rem; font-style: italic; }
.contractor-status-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.contractor-status-tag { display: inline-flex; align-items: center; min-height: 1.55rem; padding: .22rem .55rem; border: 1px solid transparent; border-radius: 999px; font-size: .67rem; font-weight: 750; line-height: 1; white-space: nowrap; }
.contractor-status-tag.is-active { border-color: light-dark(#b9ddca, var(--theme-line)); background: light-dark(#edf8f2, var(--theme-positive-soft)); color: light-dark(#286247, var(--theme-positive)); }
.contractor-status-tag.is-inactive { border-color: light-dark(#d5dde5, var(--theme-line)); background: light-dark(#f3f5f7, var(--theme-raised)); color: light-dark(#657382, var(--theme-muted)); }
.contractor-status-tag.is-deceased { border-color: light-dark(#cbd2db, var(--theme-line)); background: light-dark(#e9edf1, var(--theme-raised)); color: light-dark(#3f4b57, var(--theme-ink)); }
.contractor-status-tag.needs-update { border-color: light-dark(#efd8a7, var(--theme-line)); background: light-dark(#fff7e6, var(--theme-warning-soft)); color: light-dark(#805d19, var(--theme-warning)); }
.contractor-status-tag.is-merged { border-color: light-dark(#c9c0dc, var(--theme-line)); background: light-dark(#f3effa, var(--theme-raised)); color: light-dark(#5e497c, var(--theme-muted)); }
.contractor-status-tag.duplicate-possible { border-color: light-dark(#bfc8ea, var(--theme-line)); background: light-dark(#f1f3ff, var(--theme-raised)); color: light-dark(#48558c, var(--theme-muted)); }
.contractor-status-tag.duplicate-strong { border-color: light-dark(#e2ae9d, var(--theme-line)); background: light-dark(#fff0eb, var(--theme-danger-soft)); color: light-dark(#853b28, var(--theme-danger)); }
.contractor-last-worked { color: light-dark(#42566b, var(--theme-ink)); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.contractor-row-action { text-align: right; }
.contractor-row-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: .4rem; }
.contractor-row-action .button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; margin: 0 !important; min-width: 3.25rem; min-height: 2.25rem; padding: .48rem .7rem; font-size: .74rem; white-space: nowrap; }
.contractor-directory-shell + .empty-state { margin-top: 1rem; }
.contractor-directory-shell ~ .document-pagination { margin-top: 0; border: 1px solid light-dark(#d5e0ea, var(--theme-line)); border-top: 0; border-radius: 0 0 .7rem .7rem; background: light-dark(#f8fafc, var(--theme-raised)); }
@media(max-width:900px) { .contractor-directory-toolbar { align-items: stretch; flex-direction: column; } .contractor-directory-search,.contractor-state-filter { flex: 0 0 auto; max-width: none; width: 100%; } .contractor-directory-actions { width: 100%; margin-left: 0; justify-content: flex-start; flex-wrap: wrap; } }
@media(max-width:560px) { .contractor-directory-actions { align-items: stretch; flex-direction: column; } .contractor-inactive-toggle { min-height: 2.25rem; } .contractor-directory-actions .button { width: 100%; } }
.contractor-duplicate-toggle { display: inline-flex; align-items: center; gap: .45rem; }
.contractor-duplicate-toggle span { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .3rem; border-radius: 999px; background: light-dark(#e8f0f7, var(--theme-raised)); color: light-dark(#244f75, var(--theme-accent)); font-size: .68rem; font-weight: 800; }
.contractor-duplicates { margin: 0 0 1.25rem; padding: 1.1rem; border: 1px solid light-dark(#d5e0ea, var(--theme-line)); border-radius: .7rem; background: light-dark(#f8fafc, var(--theme-raised)); }
.contractor-duplicates-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.contractor-duplicates-heading h2 { margin: .1rem 0 0; font-size: 1.12rem; }
.contractor-duplicate-list { display: grid; gap: .85rem; }
.contractor-duplicate-card { padding: 1rem; border: 1px solid light-dark(#d9e2ea, var(--theme-line)); border-radius: .6rem; background: light-dark(#fff, var(--theme-surface)); box-shadow: 0 3px 12px #17344f0a; }
.contractor-duplicate-reasons { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .8rem; }
.contractor-duplicate-reasons > span:not(.contractor-status-tag) { padding: .18rem .45rem; border-radius: 999px; background: light-dark(#eef3f7, var(--theme-raised)); color: light-dark(#5d7083, var(--theme-muted)); font-size: .67rem; font-weight: 700; }
.contractor-duplicate-cautions { display: flex; flex-wrap: wrap; gap: .45rem; margin: -.2rem 0 .8rem; padding: .65rem .75rem; border: 1px solid light-dark(#efc27b, var(--theme-line)); border-radius: .45rem; background: light-dark(#fff8e8, var(--theme-warning-soft)); color: light-dark(#754c12, var(--theme-warning)); font-size: .74rem; font-weight: 750; }
.contractor-duplicate-cautions span { display: inline-flex; align-items: center; gap: .35rem; }
.contractor-duplicate-cautions span::before { content: "!"; display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 999px; background: #a8650a; color: #fff; font-size: .66rem; }
.contractor-duplicate-records { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.contractor-duplicate-records > div { min-width: 0; padding: .85rem; border: 1px solid light-dark(#e2e8ee, var(--theme-line)); border-radius: .5rem; }
.contractor-duplicate-records h3 { margin: 0 0 .25rem; color: light-dark(#193b5d, var(--theme-ink)); font-size: .95rem; }
.contractor-duplicate-records p { margin: .18rem 0; color: light-dark(#687b8e, var(--theme-muted)); font-size: .74rem; overflow-wrap: anywhere; }
.contractor-duplicate-address { margin: .65rem 0; padding: .55rem .65rem; border-left: 3px solid light-dark(#8eb5d5, var(--theme-line)); background: light-dark(#f7fafc, var(--theme-raised)); color: light-dark(#304a62, var(--theme-ink)); }
.contractor-duplicate-address > strong { display: block; margin-bottom: .2rem; color: light-dark(#718295, var(--theme-muted)); font-size: .6rem; letter-spacing: .04em; text-transform: uppercase; }
.contractor-duplicate-address address { display: grid; gap: .08rem; margin: 0; font-size: .76rem; font-style: normal; line-height: 1.35; overflow-wrap: anywhere; }
.contractor-duplicate-records .button { margin-top: .7rem; }
.contractor-duplicate-dismiss { display: flex; align-items: center; gap: .65rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid light-dark(#e2e8ee, var(--theme-line)); color: light-dark(#718295, var(--theme-muted)); font-size: .7rem; }
.contractor-duplicate-dismiss .button { min-height: 2rem; padding: .36rem .65rem; }
.contractor-name-parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin: .65rem 0; padding: .6rem; border-radius: .4rem; background: light-dark(#f5f8fa, var(--theme-raised)); }
.contractor-name-parts div { min-width: 0; }
.contractor-name-parts dt { color: light-dark(#718295, var(--theme-muted)); font-size: .6rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.contractor-name-parts dd { margin: .12rem 0 0; color: light-dark(#213c56, var(--theme-ink)); font-size: .75rem; font-weight: 750; overflow-wrap: anywhere; }
.contractor-work-history { display: grid; gap: .18rem; margin-top: .7rem; padding-top: .65rem; border-top: 1px solid light-dark(#e4eaf0, var(--theme-line)); color: light-dark(#5f7286, var(--theme-muted)); font-size: .72rem; }
.contractor-work-history strong { color: light-dark(#294b6b, var(--theme-ink)); font-size: .76rem; }
.contractor-work-history ul { display: grid; gap: .2rem; margin: .35rem 0 0; padding: 0; list-style: none; }
.contractor-work-history li { display: flex; justify-content: space-between; gap: .6rem; }
.contractor-work-history li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contractor-work-history time { flex: 0 0 auto; }
.contractor-work-history small { margin-top: .25rem; color: light-dark(#8090a0, var(--theme-muted)); font-size: .68rem; }
.contractor-merge-warning { margin-bottom: .9rem; }
.contractor-merge-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.contractor-merge-summary > div { display: grid; gap: .2rem; padding: .75rem; border: 1px solid light-dark(#dce5ed, var(--theme-line)); border-radius: .5rem; }
.contractor-merge-summary span { color: light-dark(#697d90, var(--theme-muted)); font-size: .65rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.contractor-merge-summary strong { color: light-dark(#193b5d, var(--theme-ink)); }
.contractor-merge-summary small { color: light-dark(#667a8d, var(--theme-muted)); }
.contractor-merge-confirm { display: flex; align-items: flex-start; gap: .55rem; margin: 1rem 0; padding: .7rem .8rem; border-radius: .45rem; background: light-dark(#eef4f8, var(--theme-raised)); color: light-dark(#29455f, var(--theme-ink)); font-size: .78rem; font-weight: 700; line-height: 1.45; }
.contractor-merge-confirm input { flex: 0 0 auto; margin-top: .15rem; }
.contractor-status-tag.no-callback { border-color: light-dark(#d9a656, var(--theme-line)); background: light-dark(#fff4dd, var(--theme-warning-soft)); color: light-dark(#7d4f08, var(--theme-warning)); }
.contractor-merge-dialog { width: min(34rem, calc(100vw - 2rem)); }
.contractor-merge-dialog p { color: light-dark(#4d6277, var(--theme-muted)); line-height: 1.55; }
.contractor-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; margin: 0 0 1rem; padding: 0; border: 0; }
.contractor-options legend { margin-bottom: .45rem; color: light-dark(#42556c, var(--theme-muted)); font-size: .71rem; font-weight: 750; }
.contractor-options label,.contractor-choice { position: relative; display: flex; align-items: center; min-height: 2.65rem; padding: .6rem .7rem; border: 1px solid light-dark(#d3dce5, var(--theme-line)); border-radius: .5rem; background: light-dark(#f8fafc, var(--theme-raised)); color: light-dark(#4b6075, var(--theme-muted)); font-size: .75rem; font-weight: 750; cursor: pointer; transition: 120ms ease; }
.contractor-options input,.contractor-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.contractor-options span,.contractor-choice span { display: flex; align-items: center; gap: .5rem; }
.contractor-options span::before,.contractor-choice span::before { content: ""; display: inline-grid; flex: 0 0 auto; width: 1.05rem; height: 1.05rem; place-items: center; border: 1px solid light-dark(#9baaba, var(--theme-line)); border-radius: .28rem; background: light-dark(#fff, var(--theme-surface)); color: #fff; font-size: .72rem; line-height: 1; }
.contractor-options label:has(input:checked),.contractor-choice:has(input:checked) { border-color: light-dark(#8ab2d4, var(--theme-line)); background: light-dark(#edf5fb, var(--theme-raised)); color: light-dark(#214f78, var(--theme-accent)); }
.contractor-options input:checked + span::before,.contractor-choice input:checked + span::before { content: "✓"; border-color: #2f6f9f; background: #2f6f9f; }
.contractor-options label:has(input:focus-visible),.contractor-choice:has(input:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.contractor-inactive-dialog { width: min(36rem, calc(100vw - 2rem)); }
.contractor-inactive-age { margin-top: .25rem; }
.contractor-inactive-age > div { display: flex; align-items: center; gap: .65rem; }
.contractor-inactive-age input { width: 7rem; }
.contractor-inactive-age span { color: light-dark(#53687d, var(--theme-muted)); font-size: .82rem; font-weight: 700; }
.contractor-inactive-dialog .contractor-choice { margin: .2rem 0 1rem; }
.contractor-inactive-preview { margin: 0 0 1rem; padding: .85rem; border: 1px solid light-dark(#d7e1ea, var(--theme-line)); border-radius: .55rem; background: light-dark(#f7f9fb, var(--theme-raised)); }
.contractor-inactive-preview > strong,.contractor-inactive-preview > span { display: block; }
.contractor-inactive-preview > strong { color: light-dark(#213f5c, var(--theme-ink)); font-size: .88rem; }
.contractor-inactive-preview > span,.contractor-inactive-preview small { margin-top: .2rem; color: light-dark(#718295, var(--theme-muted)); font-size: .72rem; }
.contractor-inactive-preview ul { display: grid; gap: .35rem; max-height: 14rem; margin: .75rem 0 0; padding: .65rem 0 0; overflow-y: auto; border-top: 1px solid light-dark(#dfe6ed, var(--theme-line)); list-style: none; }
.contractor-inactive-preview li { display: flex; justify-content: space-between; gap: 1rem; color: light-dark(#40586f, var(--theme-muted)); font-size: .76rem; }
.contractor-inactive-preview time { flex: 0 0 auto; color: light-dark(#6f8192, var(--theme-muted)); font-variant-numeric: tabular-nums; }
@media(max-width:650px) { .contractor-duplicate-records, .contractor-merge-summary { grid-template-columns: 1fr; } }
@media(max-width:650px) { .contractor-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.authenticator-downloads { margin-bottom: 20px; padding: 16px; background: light-dark(#f4f8fb, var(--theme-raised)); border: 1px solid light-dark(#d8e4ee, var(--theme-line)); border-radius: 10px; }
.authenticator-downloads h2 { margin: 0 0 6px; font-size: 1rem; }
.authenticator-downloads p { margin: 0; color: light-dark(#5f7183, var(--theme-muted)); font-size: .78rem; line-height: 1.5; }
.authenticator-downloads > div { display: grid; gap: 8px; margin-top: 12px; }
.authenticator-downloads a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; color: light-dark(#244f79, var(--theme-accent)); background: light-dark(#fff, var(--theme-surface)); border: 1px solid light-dark(#cbd9e5, var(--theme-line)); border-radius: 7px; font-size: .76rem; font-weight: 750; text-decoration: none; }
.authenticator-downloads a:hover { border-color: light-dark(#8eabc5, var(--theme-line)); background: light-dark(#fafdff, var(--theme-surface)); }
.authenticator-steps { margin: 0 0 20px; padding-left: 22px; color: light-dark(#536579, var(--theme-muted)); font-size: .8rem; line-height: 1.55; }
.authenticator-steps li + li { margin-top: 8px; }
.authenticator-qr { display: grid; width: fit-content; margin: 0 auto 18px; padding: 12px; background: light-dark(#fff, var(--theme-surface)); border: 1px solid light-dark(#d8e1ea, var(--theme-line)); border-radius: 12px; box-shadow: 0 5px 18px #14253d12; }
.authenticator-qr img { display: block; width: 224px; max-width: 100%; height: auto; image-rendering: pixelated; }
.authenticator-manual { margin-bottom: 18px; }
.authenticator-manual summary { width: fit-content; color: light-dark(#315f8d, var(--theme-accent)); cursor: pointer; font-size: .78rem; font-weight: 700; }
.authenticator-manual .field { margin-top: 14px; }
.authenticator-manual input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.sign-in-options { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* Inventory workspace: keep every section visible without a long tab strip. */
.inventory-workspace-layout { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.inventory-workspace-layout > .workspace-section-nav { flex-direction: column; position: sticky; top: calc(var(--appbar-height) + 1rem); overflow: visible; margin: 0; }
.inventory-workspace-layout > .workspace-section-nav a { font-size: .75rem; white-space: normal; }
.inventory-workspace-content { min-width: 0; }
.scanner-qr { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; margin: 1rem 0; }
.scanner-qr > div { flex: 1 1 240px; }.scanner-qr button { display: block; margin-top: 1rem; }
.scanner-device-row { display: flex; gap: 1rem; justify-content: space-between; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.scanner-device-row small { display: block; color: var(--muted); }
.scanner-review-filters { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; }.scanner-review-filters .field:first-child { flex: 1 1 240px; }
.inventory-context-navigation { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.inventory-breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1.25rem; color: var(--muted); font-size: .78rem; line-height: 1.6; }
.inventory-context-navigation .inventory-breadcrumbs { margin: 0; }
.inventory-breadcrumbs a { color: var(--accent); text-decoration: none; font-weight: 600; }
.inventory-breadcrumbs a:hover { text-decoration: underline; text-underline-offset: .2em; }
.inventory-date-switcher { display: grid; gap: .35rem; flex: 0 0 15rem; }
.inventory-date-switcher label { color: var(--muted); font-size: .7rem; font-weight: 700; }
.inventory-date-switcher select { width: 100%; min-height: 2.5rem; padding: .5rem .7rem; border: 1px solid light-dark(#bdcbd9, var(--theme-line)); border-radius: .4rem; background: light-dark(#fff, var(--theme-surface)); color: light-dark(var(--brand), var(--theme-accent)); font: inherit; font-size: .8rem; }
.inventory-date-switcher small { color: var(--muted); font-size: .75rem; }
.inventory-overview-grid { display: grid; gap: 1.5rem; }
.inventory-overview-card { padding: 1.5rem; margin: 0; min-width: 0; }
.inventory-overview-card .section-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin: 0 0 1rem; }
.inventory-overview-card h2 { margin: 0; font-size: 1.15rem; }
.inventory-overview-card form { display: grid; gap: 1rem; }
.inventory-overview-card form > button { justify-self: start; }
.inventory-overview-card .field { margin: 0; }
.inventory-overview-card .field textarea { width: 100%; min-height: 7rem; }
.inventory-setup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inventory-workspace-content .inline-link { font-size: .8rem; line-height: 1.5; }
.inline-link:hover { color: light-dark(var(--brand), var(--theme-accent)); text-decoration-thickness: 2px; }

.payroll-hours-comparison { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; }
.payroll-hours-comparison th, .payroll-hours-comparison td { padding: .5rem .5rem; text-align: right; border-bottom: 1px solid var(--line); }
.payroll-hours-comparison th:first-child { text-align: left; width: 26%; padding-left: 0; }
.payroll-hours-comparison td { white-space: nowrap; }
.payroll-hours-comparison tbody th { font-weight: 500; }
.payroll-hours-comparison .payroll-comparison-total { background: light-dark(#f5f8fc, var(--theme-raised)); font-weight: 700; }
.payroll-hours-comparison .payroll-comparison-total th { font-weight: 700; }
.payroll-hours-comparison thead { color: var(--muted); font-size: .72rem; }
.payroll-comparison-note { color: var(--muted); font-size: .8rem; margin: 1rem 0 0; }
.inventory-overview-grid .summary-card-heading { flex-wrap: wrap; gap: .5rem; }
.inventory-overview-grid > .inventory-summary { margin: 0; }
@media (min-width: 1200px) {
    .inventory-overview-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: min-content 1fr; align-items: start; }
    .inventory-overview-grid > .inventory-summary { grid-column: 1; grid-row: 1 / span 2; }
    .inventory-overview-grid > .panel { grid-column: 2; }
}
@media (max-width: 760px) {
    .inventory-context-navigation { align-items: stretch; flex-direction: column; gap: 1rem; }
    .inventory-date-switcher { flex-basis: auto; }
    .inventory-overview-card { padding: 1rem; }
    .inventory-overview-card .section-toolbar { flex-direction: row; align-items: baseline; }
    .inventory-setup-grid { grid-template-columns: 1fr; }
    .payroll-hours-comparison { font-size: .72rem; }
    .payroll-hours-comparison thead { font-size: .65rem; }
    .payroll-hours-comparison th, .payroll-hours-comparison td { padding-right: .2rem; padding-left: .2rem; }
}
.inventory-store-group > summary { padding: 1rem; cursor: pointer; font-weight: 700; background: light-dark(#f5f7fa, var(--theme-raised)); border-bottom: 1px solid light-dark(#dde4ed, var(--theme-line)); }
.inventory-store-group > summary span { float: right; color: light-dark(#68788a, var(--theme-muted)); font-weight: 400; }
.supporting-upload-panel { display: flex; gap: var(--settings-gap); align-items: center; justify-content: space-between; }
.supporting-upload-panel h3 { margin: 0 0 .4rem; }
.supporting-upload-panel p { margin: 0; color: light-dark(#607087, var(--theme-muted)); }
.supporting-upload-panel .field { margin: 0; min-width: 0; }
.supporting-upload-panel input[type=file] { max-width: 100%; }
.supporting-upload-panel input::file-selector-button { border: 0; border-radius: .35rem; padding: .65rem .9rem; margin-right: .75rem; background: #173d64; color: white; cursor: pointer; }
.payroll-lunch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .75rem 0; }
/* The entry form's lunch choice is labeled like the other fields. */
.payroll-lunch-actions > span:first-child { color: light-dark(#42556c, var(--theme-muted)); font-size: .71rem; font-weight: 750; }
.payroll-lunch-actions [aria-pressed=true] { background: #173d64; color: white; }
.payroll-saved-lunch { margin: 0; gap: .35rem; min-width: 125px; }
.payroll-saved-lunch .button { min-height: 2.25rem; padding: .35rem .6rem; font-size: .75rem; white-space: nowrap; }
.payroll-saved-lunch .payroll-text-action, .payroll-row-actions .payroll-text-action { min-height: 2.25rem; }
.payroll-lunch-status { display: block; margin-top: .3rem; color: light-dark(#4d6277, var(--theme-muted)); font-size: .74rem; }
.payroll-lunch-status::before { content: "✓ "; color: light-dark(#2c6e4b, var(--theme-positive)); }
.payroll-lunch-status.is-error { color: var(--red); }
.payroll-lunch-status.is-error::before { content: none; }
@media (max-width: 700px) { .payroll-saved-lunch .button, .payroll-saved-lunch .payroll-text-action, .payroll-row-actions .payroll-text-action { min-height: 2.75rem; } }
.payroll-saved-lunch [aria-pressed=true]:disabled { opacity: 1; }
.payroll-minimum:empty { display: none; }
@media (max-width: 850px) {
    .inventory-workspace-layout { grid-template-columns: minmax(0, 1fr); }
    .inventory-workspace-layout > .workspace-section-nav { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .supporting-upload-panel { flex-direction: column; align-items: stretch; gap: 1rem; }
}

/* ============ global keyboard focus ============ */
/* :where() keeps specificity at zero, so the component-specific
   :focus-visible rules above continue to win where they exist. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Dark surfaces carrying interactive controls need a light ring. */
.rapid-context {
    --focus-ring: #fff;
}

.template-editor { border: 0; padding: 0; min-width: 0; }
.template-toolbar { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.template-section { margin: 1rem 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: light-dark(#fff, var(--theme-surface)); overflow: hidden; }
.template-row { border-top: 1px solid var(--line); padding: 1rem 0; }
.template-cells { display: flex; flex-wrap: wrap; gap: 1rem; margin: .75rem 0; }
.template-cell { display: grid; gap: .5rem; padding: .75rem; border: 1px solid var(--line); border-radius: .5rem; min-width: 10rem; }
@media(max-width: 700px) { .template-toolbar { grid-template-columns: 1fr; } .template-row .section-toolbar { flex-wrap: wrap; } }

/* Disabled means unavailable; only explicitly busy controls show a wait cursor. */
html body :is(button, input, select, textarea):disabled, html body [aria-disabled="true"] { cursor: not-allowed; }
html body :is(button, input, select, textarea):disabled[aria-busy="true"] { cursor: wait; }
.template-overview { display:flex; justify-content:space-between; gap:1rem; color:light-dark(#62758a, var(--theme-muted)); font-size:13px; margin:18px 0; }
.template-section { padding:20px 24px; margin:18px 0; background:light-dark(white, var(--theme-surface)); border:1px solid light-dark(#d8e1e9, var(--theme-line)); border-radius:8px; }
.template-section-heading { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.template-title { flex:1; min-width:0; padding:6px 0; font-weight:700; font-size:18px; color:light-dark(#172f49, var(--theme-ink)); border:1px solid transparent; border-radius:4px; background:transparent; }
.template-title:focus { background:light-dark(#fff, var(--theme-surface)); border-color:light-dark(#9fb9c6, var(--theme-line)); }
.template-count { color:light-dark(#62758a, var(--theme-muted)); font-size:13px; white-space:nowrap; }
.template-order { display:flex; align-items:center; gap:6px; margin-left:auto; }
.template-icon,.template-edit { background:light-dark(white, var(--theme-surface)); border:1px solid light-dark(#cbd5df, var(--theme-line)); border-radius:4px; padding:7px 12px; color:light-dark(#27435e, var(--theme-ink)); cursor:pointer; font:inherit; font-size:13px; }
.template-icon { min-width:32px; min-height:32px; padding:7px 9px; }
.template-icon:hover:not(:disabled),.template-edit:hover:not(:disabled) { border-color:#367f9a; background:light-dark(#eef4f9, var(--theme-raised)); }
.template-rule { background:light-dark(#f6f8fa, var(--theme-raised)); border:1px solid light-dark(#d8e1e9, var(--theme-line)); border-radius:7px; padding:14px 18px; margin:10px 0; }
.template-rule.is-open { background:light-dark(white, var(--theme-surface)); border-color:light-dark(#9fb9c6, var(--theme-line)); box-shadow:0 3px 14px #17365010; padding-bottom:18px; }
.template-rule-heading { display:flex; gap:14px; align-items:center; flex-wrap:wrap; }
.template-row-number { display:grid; place-items:center; min-width:32px; height:32px; padding:0 8px; border-radius:16px; background:#173650; color:white; font-size:13px; }
.template-summary-text { flex:1; min-width:180px; display:flex; flex-direction:column; gap:3px; }
.template-row-name { font-weight:700; color:light-dark(#172f49, var(--theme-ink)); font-size:15px; }
.template-summary-text > input { min-width:0; width:100%; border:1px solid light-dark(#cbd5df, var(--theme-line)); border-radius:4px; padding:8px 10px; color:light-dark(#172f49, var(--theme-ink)); background:light-dark(white, var(--theme-surface)); font:inherit; font-size:15px; font-weight:650; }
.template-row-summary { color:light-dark(#62758a, var(--theme-muted)); font-size:13px; line-height:1.4; }
.template-fields { margin:16px 0 0; }
.template-field-toggles { display:flex; align-items:center; flex-wrap:wrap; gap:18px; margin-bottom:16px; }
.template-field-toggles label,.template-required { display:flex; align-items:center; gap:7px; font-size:13px; color:light-dark(#314d65, var(--theme-ink)); }
.template-field { padding:14px 0; border-top:1px solid light-dark(#e3eaf0, var(--theme-line)); }
.template-field-settings { display:grid; grid-template-columns:7rem minmax(10rem,24rem) auto; align-items:center; gap:16px; }
.template-field-settings > strong { font-size:13px; color:light-dark(#172f49, var(--theme-ink)); }
.template-source,.template-percentage-operand > label:not(.template-absolute) { display:grid; gap:6px; font-size:13px; color:light-dark(#314d65, var(--theme-ink)); }
.template-fields select { min-width:0; width:100%; min-height:38px; padding:8px 30px 8px 10px; border:1px solid light-dark(#cbd5df, var(--theme-line)); border-radius:4px; color:light-dark(#172f49, var(--theme-ink)); background-color:light-dark(white, var(--theme-surface)); font:inherit; font-size:13px; }
.template-calculation { margin:14px 0 0 8rem; display:grid; gap:10px; }
.template-calculation-term { display:grid; grid-template-columns:8.5rem minmax(0,1fr) auto 2rem; gap:10px; align-items:center; }
.template-absolute { display:flex; align-items:center; gap:7px; white-space:nowrap; font-size:12px; color:light-dark(#314d65, var(--theme-ink)); }
.template-calculation-start { color:light-dark(#314d65, var(--theme-ink)); font-size:13px; padding:8px 10px; }
.template-calculation > button { justify-self:start; }
.template-percentage-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:14px 0 0 8rem; }
.template-formula { margin:12px 0 0 8rem; padding:12px 14px; background:light-dark(#f3f7f9, var(--theme-raised)); border-left:3px solid #367f9a; border-radius:4px; color:light-dark(#314d65, var(--theme-ink)); font-size:13px; line-height:1.55; overflow-wrap:anywhere; }
.template-calculation > .template-formula { margin:0; }
.template-add-row { margin:14px 0 0; }
.template-row-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:10px; padding:12px; background:light-dark(#f4f7fa, var(--theme-raised)); border:1px solid light-dark(#dce5ee, var(--theme-line)); border-radius:8px; }
.template-row-choices button { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:14px; background:light-dark(white, var(--theme-surface)); border:1px solid light-dark(#cbd8e5, var(--theme-line)); border-radius:6px; color:light-dark(#23466d, var(--theme-ink)); font:inherit; font-size:13px; cursor:pointer; text-align:left; }
.template-row-choices button:hover { border-color:#23466d; background:light-dark(#eef4f9, var(--theme-raised)); }
.template-footer { display:flex; align-items:center; flex-wrap:wrap; justify-content:space-between; gap:16px; padding:16px 0; }
.template-footer > small { flex-basis:100%; color:light-dark(#62758a, var(--theme-muted)); font-size:13px; }
.template-dialog { width:min(28rem,100%); background:light-dark(white, var(--theme-surface)); border-radius:12px; padding:24px; box-shadow:0 16px 60px #10203044; }
.template-dialog h2 { margin-top:0; font-size:1.2rem; }
.template-dialog .form-actions { justify-content:flex-end; }
@media(max-width:700px) {
    .template-section { padding:14px; }
    .template-count { display:none; }
    .template-section-heading { flex-wrap:wrap; }
    .template-section-heading .template-order { margin-left:auto; }
    .template-rule { padding:12px; }
    .template-summary-text { min-width:0; flex-basis:calc(100% - 50px); }
    .template-field-settings { grid-template-columns:1fr auto; gap:10px; }
    .template-source { grid-column:1 / -1; grid-row:2; }
    .template-calculation,.template-formula,.template-percentage-fields { margin-left:0; }
    .template-percentage-fields,.template-row-choices { grid-template-columns:1fr; }
    .template-calculation-term { grid-template-columns:minmax(0,1fr) 2rem; gap:6px; }
    .template-calculation-term > select:first-child { width:8.5rem; }
    .template-calculation-term > select:nth-child(2) { grid-row:2; grid-column:1 / -1; }
    .template-calculation-term > button { grid-row:1; grid-column:2; }
    .template-calculation-term > .template-absolute { grid-row:3; grid-column:1 / -1; margin-bottom:6px; }
    .template-footer .form-actions { flex-wrap:wrap; }
}
@media(max-width:900px) { :root { --appbar-height:8.6rem; } }

.analysis-piece-count { max-width:320px; margin:0 0 1.25rem; padding:1rem; border:1px solid var(--line); border-radius:.65rem; background:var(--panel); }

.template-percentage-operand { display:grid; align-content:start; gap:10px; min-width:0; }

.analysis-row-composer { min-width:0; margin:0; padding:0; border:0; border-top:1px solid var(--line); }
.analysis-row-save { justify-content:flex-end; margin:0; padding:0 1.2rem 1rem; }
.analysis-row-composer > .notice { margin:0 1.2rem 1rem; }

.analysis-copy { margin:1rem 0; padding:1.2rem; }
.analysis-copy h3 { margin:0 0 1rem; }
.analysis-copy-controls { display:flex; align-items:end; gap:.8rem; flex-wrap:wrap; }
.analysis-copy-controls .field { flex:1 1 20rem; min-width:0; margin:0; }
.analysis-copy-controls select { width:100%; }
.analysis-copy > .form-help { margin:.7rem 0 0; }
.analysis-save-status { margin:0 0 1rem; color:light-dark(#47745a, var(--theme-positive)); font-size:.75rem; font-weight:650; }
.analysis-save-status.is-error { color:light-dark(#a43f38, var(--theme-danger)); }
.analysis-value-input[aria-invalid="true"],#analysis-piece-count[aria-invalid="true"] { border-color:light-dark(#a43f38, var(--theme-line)); }

.analysis-toolbar { display:flex; flex-wrap:wrap; gap:1rem; align-items:end; margin:1.2rem 0; }
.analysis-toolbar label,.analysis-notes { display:grid; gap:.4rem; font-size:.8rem; font-weight:600; color:light-dark(#344d68, var(--theme-ink)); }
.analysis-toolbar input,.analysis-toolbar select { min-height:42px; }
.analysis-toolbar form { display:flex; align-items:end; flex-wrap:wrap; gap:.7rem; }
.analysis-toolbar > a:last-child { margin-left:auto; }
.analysis-editor { width:100%; max-width:none; min-width:0; }
.analysis-save-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:1.4rem 0 .8rem; }
.analysis-save-heading h2 { margin:0; font-size:1.2rem; }
.analysis-save-heading > span { font-size:.78rem; color:light-dark(#4c6c5a, var(--theme-positive)); }
.analysis-table-scroll { overflow-x:auto; border:1px solid light-dark(#d9e2ed, var(--theme-line)); border-radius:10px; background:light-dark(#fff, var(--theme-surface)); }
.monthly-analysis-table { width:100%; border-collapse:collapse; table-layout:fixed; min-width:660px; font-size:.86rem; }
.monthly-analysis-table th,.monthly-analysis-table td { padding:.6rem .9rem; border-bottom:1px solid light-dark(#e5ebf2, var(--theme-line)); text-align:right; vertical-align:middle; font-variant-numeric:tabular-nums; }
.monthly-analysis-table th:first-child { width:34%; text-align:left; }
.monthly-analysis-table thead th { background:light-dark(#f3f7fb, var(--theme-raised)); font-size:.77rem; color:light-dark(#526b87, var(--theme-muted)); padding:.95rem .9rem; }
.monthly-analysis-table tbody th { font-weight:550; }
.monthly-analysis-table td small { display:block; margin-top:.25rem; color:light-dark(#738398, var(--theme-muted)); font-size:.73rem; }
.monthly-analysis-table .analysis-number { width:100%; min-width:0; height:35px; text-align:right; padding:.4rem .6rem; border:1px solid light-dark(#ccd9e7, var(--theme-line)); border-radius:6px; background:light-dark(white, var(--theme-surface)); color:light-dark(#1c3655, var(--theme-ink)); }
.monthly-analysis-table .analysis-number[aria-invalid="true"] { border-color:light-dark(#ae3e35, var(--theme-line)); background:light-dark(#fff6f5, var(--theme-danger-soft)); }
.monthly-analysis-table .analysis-section-row th { background:light-dark(#eef4f9, var(--theme-raised)); font-weight:700; color:light-dark(#274b6e, var(--theme-ink)); font-size:.78rem; padding:.55rem .9rem; }
.monthly-analysis-table .analysis-total-row { background:light-dark(#f9fbfd, var(--theme-raised)); }
.monthly-analysis-table .analysis-difference { color:light-dark(#445b73, var(--theme-muted)); }
.analysis-notes { margin-top:1.2rem; }
.analysis-notes textarea { width:100%; }
@media(max-width:700px) { .analysis-toolbar { gap:.7rem; } .analysis-toolbar > a:last-child { margin-left:0; } .analysis-save-heading { flex-wrap:wrap; } }

.analysis-toolbar .field { margin:0; min-width:220px; }
.analysis-create-month { flex-basis:100%; padding:1rem; background:light-dark(#f3f7fb, var(--theme-raised)); border:1px solid light-dark(#dce4ed, var(--theme-line)); border-radius:8px; }

.analysis-template-source { display:flex; flex-wrap:wrap; align-items:center; gap: .75rem; padding: .75rem 0 1rem; color: var(--muted, light-dark(#64748b, var(--theme-muted))); font-size: .875rem; }
.analysis-settings { margin-top:1.25rem; border-top:1px solid var(--line); padding-top:.8rem; }
.analysis-settings>summary { width:fit-content; padding:.4rem 0; color:light-dark(#526b87, var(--theme-muted)); font-size:.85rem; font-weight:600; cursor:pointer; }
.analysis-settings>summary:hover { color:light-dark(#234c6a, var(--theme-ink)); }
.analysis-settings>summary:focus-visible { outline:2px solid var(--focus-ring); outline-offset:4px; border-radius:.2rem; }

.selected-dealer{display:flex;align-items:center;gap:.55rem;margin-left:auto;color:light-dark(#234c6a, var(--theme-ink));text-decoration:none;min-width:0}.selected-dealer span{font-size:.65rem;text-transform:uppercase;letter-spacing:.06em;color:light-dark(#6d8095, var(--theme-muted));white-space:nowrap}.selected-dealer strong{font-size:.85rem;line-height:1.25;overflow-wrap:anywhere}.appbar-context.has-dealer{gap:1.25rem}.admin-tool-cards .group-card{gap:.7rem}.admin-tool-cards .group-card p{font-size:.9rem;color:light-dark(#60788e, var(--theme-muted));line-height:1.5}.admin-tool-cards .form-actions{flex-wrap:wrap}.admin-tool-cards a.group-card{color:inherit;text-decoration:none}@media(max-width:680px){.appbar-context.has-dealer,.fixed-assets-shell .appbar-context.has-dealer{display:flex;padding:.65rem 1rem;min-height:0}.appbar-context.has-dealer .context-crumb,.appbar-context.has-dealer .context-env{display:none}.selected-dealer{margin:0;flex:1;align-items:baseline}.selected-dealer strong{font-size:.85rem}.selected-dealer span{font-size:.62rem}.appbar-context.has-dealer{gap:.5rem}}

/* Shared dealer directories and administration cards. */
.group-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(285px, 100%), 1fr)); gap: 20px; }
.group-card { display: flex; flex-direction: column; gap: 10px; background: light-dark(white, var(--theme-surface)); border: 1px solid light-dark(#dce4ed, var(--theme-line)); border-top: 4px solid #23466d; border-radius: 10px; padding: 26px; color: inherit; text-align: left; font: inherit; min-height: 190px; box-shadow: 0 3px 12px #19324d08; }
.group-card:hover { border-color: light-dark(#6689aa, var(--theme-line)); }
.group-card:focus-visible, .store-card-link:focus-visible { outline:2px solid var(--focus-ring); outline-offset: 4px; }
.group-card strong { margin-top: auto; font-size: .9rem; }
.group-card h3 { font-size: 1.4rem; margin: 0 0 4px; }
.directory-store { border-top-color: light-dark(#94a9bb, var(--theme-line)); padding: 0; }
.directory-group { cursor: pointer; }
.directory-section { margin-bottom: 32px; }
.directory-heading { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: .95rem; color: light-dark(#3d5570, var(--theme-ink)); }
.directory-heading span { background: light-dark(#eaf0f5, var(--theme-raised)); border-radius: 20px; padding: 2px 9px; font-size: .78rem; color: light-dark(#62778b, var(--theme-muted)); font-weight: 600; }
.card-detail { color: light-dark(#3d5570, var(--theme-ink)); font-size: .9rem; line-height: 1.45; }
.card-meta { color: light-dark(#7d8ea1, var(--theme-muted)); font-size: .8rem; }
.store-card-link { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 26px 26px 16px; color: inherit; text-decoration: none; }
.store-card-actions { display: flex; justify-content: flex-end; padding: 0 20px 16px; }
.directory-back { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
/* Keep each monthly percentage alongside its source amount. */
.monthly-analysis-table.has-percentages { min-width:880px; }
.monthly-analysis-table.has-percentages th:first-child { width:30%; }
.monthly-analysis-table.has-percentages th:last-child { width:16%; }
.analysis-period { display:grid; align-items:center; min-width:0; }
.has-percentages .analysis-period { grid-template-columns:minmax(0,1fr) 4.5rem; gap:.6rem; }
.analysis-share { color:light-dark(#60758b, var(--theme-muted)); font-size:.8rem; font-variant-numeric:tabular-nums; }
.analysis-entry { position:relative; min-width:0; }
.analysis-entry.is-percentage .analysis-number { padding-right:1.5rem; }
.analysis-percent-suffix { position:absolute; right:.6rem; top:50%; transform:translateY(-50%); color:light-dark(#60758b, var(--theme-muted)); pointer-events:none; }
.monthly-analysis-table .analysis-share .analysis-number { font-size:.8rem; }
/* Shared dealer histories across operational modules. */
/* History list: one bordered list of DealerHistoryCard rows (title, details, value, status, open, actions). */
.dealer-history-grid { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) auto auto auto auto; column-gap:1.25rem; border:1px solid var(--line); border-radius:.5rem; background:light-dark(#fff, var(--theme-surface)); overflow:hidden; }
.dealer-history-grid>.empty-state { grid-column:1/-1; margin:0; border:0; border-radius:0; }
@media(max-width:680px) { .dealer-history-grid { display:block; } }
.dealer-history-heading { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin:1rem 0; }
.dealer-history-heading>div { display:flex; align-items:baseline; gap:.75rem; flex-wrap:wrap; }
.dealer-history-heading h2 { margin:0; font-size:1.15rem; color:light-dark(#23445f, var(--theme-ink)); }
.dealer-history-heading span { font-size:.8rem; color:light-dark(#71859a, var(--theme-muted)); }
.dealer-history-settings { display:flex; flex-wrap:wrap; gap:.75rem; font-size:.83rem; }
.dealer-history-settings:empty { display:none; }
@media(max-width:600px) { .dealer-history-heading { align-items:flex-start; flex-wrap:wrap; } }
.dealer-history-page .page-heading h1 { margin:.15rem 0 .6rem; }
.dealer-history-page .page-heading { align-items:center; margin-bottom:1.25rem; }
.dealer-page-actions { display:flex; flex-direction:row; align-items:center; flex-wrap:wrap; gap:.5rem; margin:0; }
.dealer-page-actions>.button { flex:0 0 auto; margin:0; white-space:nowrap; }
.payroll-job-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:1rem; margin:1rem 0; }
.payroll-daily-minimum { display:flex; align-items:center; flex-wrap:wrap; gap:.75rem; }
.inventory-breadcrumb-switch { position:relative; }
.inventory-breadcrumb-switch>summary { list-style:none; cursor:pointer; color:light-dark(#285f92, var(--theme-accent)); font-weight:600; }
.inventory-breadcrumb-switch>summary::-webkit-details-marker { display:none; }
.inventory-breadcrumb-switch>summary:focus-visible { outline:2px solid var(--focus-ring); outline-offset:4px; }
.inventory-breadcrumb-options { position:absolute; top:calc(100% + .6rem); left:0; z-index:40; display:grid; width:220px; max-width:calc(100vw - 2rem); max-height:300px; overflow:auto; padding:.45rem; border:1px solid light-dark(#c5d3df, var(--theme-line)); border-radius:.5rem; background:light-dark(#fff, var(--theme-surface)); box-shadow:0 8px 24px #19324d24; }
.inventory-breadcrumb-options>a { display:grid; gap:.25rem; padding:.65rem; border-radius:.3rem; text-decoration:none; }
.inventory-breadcrumb-options>a:hover,.inventory-breadcrumb-options>a[aria-current=true] { background:light-dark(#edf3f8, var(--theme-raised)); }
.inventory-breadcrumb-options small { color:light-dark(#71859a, var(--theme-muted)); font-size:.72rem; }
@media(max-width:680px) { .dealer-history-page .page-heading { align-items:flex-start; gap:.75rem; } .dealer-page-actions { width:100%; } }

/* Keep planning and dealer context comfortable on small screens. */
.dealer-notes-callout { margin: 1.25rem 0; border-left: 4px solid light-dark(#8fb6d2, var(--theme-line)); }
.dealer-notes-callout p { white-space: pre-wrap; overflow-wrap: anywhere; margin: .75rem 0; line-height: 1.6; }
.calendar-mobile-schedule { display: none; }
@media (max-width: 700px) {
    .calendar-scroll { display: none; }
    .calendar-mobile-schedule { display: block; }
    .calendar-toolbar { gap: 1rem; }
    .calendar-toolbar > .form-actions { width: 100%; gap: .5rem; }
    .calendar-toolbar h2 { min-width: 0; font-size: 1.1rem; flex: 1; }
    .calendar-toolbar .store-group-filter { flex: 1; min-width: 0; }
    .calendar-toolbar .checkbox-field { flex-basis: 100%; }
    .calendar-editor { padding: 1rem; }
    .calendar-editor .field-grid { grid-template-columns: minmax(0, 1fr); }
    .schedule-row { padding: 1rem; gap: .75rem; overflow-wrap: anywhere; }
    .schedule-row > div { min-width: 0; }
}

/* Settings layouts own spacing; legacy adjacent-card margins must not add to grid gaps. */
:root { --settings-gap: 1rem; --settings-padding: 1.35rem; }
.settings-stack, .detail-main-stack, .summary-stack, .auth-layout { display: grid; gap: var(--settings-gap); min-width: 0; }
.settings-stack[hidden] { display: none; }
.settings-stack > .settings-card + .settings-card,
.detail-main-stack > .settings-card + .settings-card,
.auth-layout > .settings-card + .settings-card { margin-top: 0; }
.settings-stack > .dealer-notes-callout { margin: 0; }
.settings-card, .summary-card { padding: var(--settings-padding); min-width: 0; }
.settings-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.settings-card .field-grid { margin-bottom: 1rem; }
.settings-card .field-grid > .field { margin-bottom: 0; }
.operation-status { min-height: 1.5rem; margin-top: .5rem; font-size: .8rem; line-height: 1.5; }
.operation-status > span { display: flex; align-items: center; gap: .5rem; }
.operation-success { color: light-dark(#24613e, var(--theme-positive)); }
.operation-error { color: light-dark(#783632, var(--theme-danger)); }
.inventory-map-frame { position: relative; isolation: isolate; margin: 1rem 0; }
.inventory-map-frame > .inventory-map { margin: 0; }
.inventory-map-status { position: absolute; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; gap: .75rem; padding: 1rem; background: light-dark(#f5f8fb, var(--theme-raised)); color: light-dark(#42556c, var(--theme-muted)); border: 1px solid var(--line); border-radius: .5rem; font-size: .8rem; text-align: center; }
@media (max-width: 680px) { :root { --settings-padding: 1rem; } }

.inventory-map-status { pointer-events: none; }

/* Wrapping field labels (<label class="field">Name<input /></label>) match the shared .field label style.
   In app.css so standalone pages (scanners, capture, enrollment) share it. :where keeps it at zero specificity. */
:where(label.field) { display: grid; gap: .38rem; color: light-dark(#42556c, var(--theme-muted)); font-size: .71rem; font-weight: 750; }
/* Controls inside the label must not inherit its small bold text; this outranks the base `input { font: inherit }`. */
label.field :is(input, select, textarea) { font-size: 1rem; font-weight: 400; color: light-dark(#212f3f, var(--theme-ink)); }

/* Device and standalone pages (asset capture, scanners) share the brand bar used by enrollment, the
   time clock and dealer setup: logo left, page purpose or status right. theme.css swaps the logo in dark mode. */
.device-brand { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.device-brand img { display: block; width: 200px; max-width: 55%; height: auto; }
.device-brand > span { text-align: right; }
@media (max-width: 600px) { .device-brand { padding-bottom: .75rem; margin-bottom: 1rem; } .device-brand img { width: 160px; } }
