
:root {
    color-scheme: light;
    --ink: #202430; --muted: #555f71; --navy: #00344f; --charcoal: #252530;
    --gold: #ffc600; --canvas: #f5f7fa; --line: #d7dce4; --paper: #fff;
    --focus: #086ba2; --danger: #9c2418;
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--canvas); color: var(--ink); font: 16px/1.55 system-ui, sans-serif; }
a { color: #005a8b; }
a:hover { color: var(--navy); }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: .16rem solid var(--focus); outline-offset: .16rem; }
[hidden] { display: none !important; }
h1,h2,h3,p { margin: 0 0 .65rem; }
h1 { font-size: clamp(1.85rem, 4vw, 2.7rem); line-height: 1.13; letter-spacing: -.05em; }
h2 { font-size: 1.27rem; line-height: 1.2; }
h3 { font-size: 1.02rem; line-height: 1.35; }
.frame { width: min(100% - 2rem, 74rem); margin-inline: auto; }
.content { flex: 1; padding-block: 1.65rem 3.2rem; }
.topbar { background: var(--charcoal); border-bottom: 3px solid var(--gold); color: var(--paper); }
.header-inner { min-height: 4.6rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.25rem; padding-block: .65rem; }
.brand { display: flex; gap: .62rem; align-items: center; color: white; text-decoration: none; line-height: 1.22; }
.brand:hover,.topbar nav a:hover { color: var(--gold); }
.brand img { width: 43px; height: 36px; object-fit: contain; padding: .18rem; border-radius: .28rem; background: white; }
.brand strong,.brand small { display: block; }
.brand small { font-size: .75rem; color: #dfe2eb; }
.nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav a { color: #fff; text-decoration: none; font-size: .89rem; font-weight: 650; }
.nav form { margin: 0; }
.topbar :focus-visible { outline-color: var(--gold); }
.skip,.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip:focus { top: 0; left: .5rem; width: auto; height: auto; margin: .2rem; padding: .6rem; clip: auto; background: white; z-index: 10000; }
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.footer > div { display: flex; justify-content: space-between; gap: .5rem; padding-block: .9rem; flex-wrap: wrap; }
.eyebrow { color: var(--navy); font-size: .72rem; font-weight: 800; letter-spacing: .105em; }
.eyebrow::before { content: ''; display: inline-block; width: .62rem; height: .62rem; border-radius: 50%; background: var(--gold); margin-right: .45rem; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: .7rem 1.2rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.intro p:last-child { margin-bottom: 0; color: var(--muted); }
.panel,.metric { border: 1px solid var(--line); border-radius: .8rem; background: var(--paper); padding: clamp(.9rem, 2vw, 1.4rem); box-shadow: 0 .38rem 1rem #18273a0b; min-width: 0; }
.panel > :last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.empty { padding: 1.1rem; background: var(--canvas); border-radius: .45rem; color: var(--muted); }
.button { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; gap: .25rem; color: var(--navy); background: var(--paper); border: 1px solid #99a6b4; border-radius: .46rem; padding: .53rem .78rem; font-size: .88rem; font-weight: 700; text-align: center; }
.button:hover { background: #eef1f6; }
.button-primary { color: #222; background: var(--gold); border-color: #e0a900; }
.button-primary:hover { background: #f3b900; color: #222; }
.button-danger { background: var(--danger); border-color: var(--danger); color: white; }
.button-danger:hover { background: #7b1b11; color: white; }
.button-quiet { color: white; background: transparent; border-color: #75798a; }
.button-quiet:hover { color: #252530; background: var(--gold); border-color: var(--gold); }
.button:disabled { opacity: .55; cursor: not-allowed; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .7rem; margin-bottom: 1.15rem; }
.metric { display: flex; flex-direction: column; gap: .3rem; color: var(--ink); text-decoration: none; padding: .82rem .95rem; }
.metric span { color: var(--muted); font-size: .85rem; }
.metric strong { font-size: 1.75rem; line-height: 1.25; }
a.metric:hover { border-color: var(--focus); color: var(--navy); }
.metric-total { border-top: 3px solid var(--gold); }
.dashboard-grid,.details-grid { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.chart,.recent { list-style: none; margin: 0; padding: 0; }
.chart li { display: grid; grid-template-columns: 4rem minmax(0, 1fr) 2.5rem; gap: .6rem; align-items: center; font-size: .83rem; padding: .2rem 0; }
.chart meter { width: 100%; min-height: 1.15rem; accent-color: #0c5272; }
.chart meter::-webkit-meter-optimum-value { background: #0c5272; border-radius: .25rem; }
.chart meter::-moz-meter-bar { background: #0c5272; }
.recent li { display: flex; justify-content: space-between; align-items: center; gap: .35rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.recent li:last-child { border: 0; }
.badge { display: inline-flex; align-items: center; padding: .28rem .62rem; border-radius: 100px; color: #174460; background: #e2f0f9; font-size: .79rem; font-weight: 750; white-space: nowrap; }
.badge[data-stage=PendingApproval],.badge[data-stage=Returned] { color: #694600; background: #fff2cb; }
.badge[data-stage=Published] { color: #12613d; background: #dbf2e5; }
.badge[data-stage=Rejected] { color: #8b251c; background: #ffe8e3; }
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.filter select { width: min(100%, 15rem); }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; min-width: 45rem; }
thead th { background: var(--canvas); font-size: .8rem; color: var(--muted); }
th,td { padding: .65rem .75rem; border-bottom: 1px solid var(--line); }
th[scope=row] { white-space: nowrap; }
.pagination { display: flex; gap: 1rem; align-items: center; margin-top: .9rem; flex-wrap: wrap; }
.column { display: grid; gap: 1rem; min-width: 0; }
.back-link { display: inline-block; margin-bottom: .75rem; }
.details-intro { align-items: center; }
.facts { margin: .85rem 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .65rem; }
.facts div { border: 1px solid var(--line); border-radius: .45rem; padding: .5rem .67rem; min-width: 0; }
.facts dt { font-size: .78rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.leg + .leg { margin-top: 1rem; }
.leg { border: 1px solid var(--line); padding: .85rem; border-radius: .55rem; }
.location-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .58rem; }
.location { border-left: .24rem solid #004560; border-radius: .4rem; min-width: 0; padding: .55rem .67rem; background: var(--canvas); overflow-wrap: anywhere; }
.location[data-pin=dropoff] { border-left-color: #965800; }
.location p { margin-bottom: .24rem; }
.location small { font-variant-numeric: tabular-nums; color: var(--muted); }
.line-list { list-style: none; padding: 0; margin: .65rem 0 0; display: flex; flex-wrap: wrap; gap: .35rem .65rem; }
.line-list li { padding: .25rem .5rem; background: var(--canvas); border-radius: .4rem; font-size: .83rem; }
.map-section { margin-top: .85rem; }
.map-section summary { color: #005278; font-weight: 700; cursor: pointer; }
.map-section[open] summary { margin-bottom: .55rem; }
.map { height: 16.5rem; background: #e9edf0; border: 1px solid var(--line); border-radius: .5rem; isolation: isolate; position: relative; }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.offer-price { font-size: 1.25rem; font-weight: 800; color: var(--navy); }
.form-stack { display: grid; gap: .46rem; }
.form-stack p { margin: 0; }
.form-stack label,.filter label { font-weight: 700; font-size: .9rem; }
.form-stack .button { margin-top: .35rem; justify-self: start; }
input:not([type=hidden]),select,textarea { width: 100%; border: 1px solid #9fa9b9; border-radius: .42rem; color: var(--ink); padding: .52rem .62rem; background: white; }
textarea { resize: vertical; }
.separated { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.timeline { padding: .1rem 0 .1rem 1.2rem; list-style: none; margin: .8rem 0 0; }
.timeline li { position: relative; border-left: 2px solid #d7dce4; padding: 0 0 1rem .9rem; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; top: .37rem; left: -.43rem; border: 2px solid #725900; background: var(--gold); width: .76rem; height: .76rem; border-radius: 50%; }
.timeline time,.timeline small { display: block; font-size: .81rem; color: var(--muted); }
.timeline p { margin: .2rem 0 0; }
.login-shell { display: grid; grid-template-columns: 1.05fr 1fr; max-width: 51rem; margin: clamp(1rem, 6vh, 4.5rem) auto; border-radius: .9rem; box-shadow: 0 .65rem 2rem #2932471c; overflow: hidden; }
.login-intro,.login-panel { padding: clamp(1.3rem,4.6vw,3rem); }
.login-intro { background: var(--navy); color: white; }
.login-intro .eyebrow { color: #fff; }
.login-intro p:last-child { color: #e1edf5; }
.login-panel { border: 0; border-radius: 0; }
.validation { color: var(--danger); font-size: .88rem; }
.validation:empty,.validation-summary-valid { display: none; }
.flash { padding: .7rem .9rem; border-radius: .45rem; margin-bottom: 1rem; border: 1px solid; }
.flash-error { color: #79190f; border-color: #e1a299; background: #ffe8e3; }
.flash-success { color: #144f35; border-color: #95c3ae; background: #dff4e9; }
@media (max-width: 840px) {
    .details-grid,.dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .login-shell,.location-grid { grid-template-columns: 1fr; }
    .frame { width: min(100% - 1.25rem, 74rem); }
    .nav { width: 100%; justify-content: space-between; }
}

.audit-filters { display:flex; flex-wrap:wrap; gap:.85rem; align-items:end; margin-bottom:1rem; }
.audit-filters label { display:grid; gap:.25rem; }
.audit-table-wrap { overflow-x:auto; }
.audit-table { width:100%; text-align:left; border-collapse:collapse; }
.audit-table th,.audit-table td { padding:.7rem .55rem; vertical-align:top; border-bottom:1px solid #dfe2e8; }
.audit-table time,.audit-table code { white-space:nowrap; }
.audit-pages { display:flex; gap:1rem; align-items:center; margin-top:1rem; }
.spc-quote-meta{display:flex;gap:.85rem 1.6rem;flex-wrap:wrap;margin:.8rem 0}.spc-quote-meta strong{display:block}.spc-quote-expired{color:#9a2c28;font-weight:700}.spc-quote-table-wrap{overflow-x:auto}.spc-quote-table{border-collapse:collapse;width:100%;text-align:left}.spc-quote-table th,.spc-quote-table td{padding:.58rem;border-bottom:1px solid #dfe3ed}.spc-quote-table th:first-child{white-space:nowrap}.spc-quote-table td:last-child{white-space:nowrap}.spc-quote-table tfoot td{font-variant-numeric:tabular-nums}.quote-net{font-weight:750;color:#002f4b}
.quote-editor{margin-bottom:1rem}.quote-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem}.quote-controls label{display:grid;gap:.25rem}.quote-entry-table{min-width:580px}.quote-entry-table td:nth-child(2){width:38%}.quote-entry-table td input{width:100%;min-width:4rem}.quote-entry-table td:nth-child(2) input{min-width:10rem}.quote-totals{display:grid;grid-template-columns:minmax(6rem,1fr) minmax(8rem,12rem);gap:.65rem;align-items:center;margin-left:auto;text-align:right}.quote-totals output{font-variant-numeric:tabular-nums}.quote-totals input{text-align:right}@media(max-width:600px){.quote-controls{grid-template-columns:1fr}.quote-totals{width:100%}}

/* Back-office notifications */
.notification-settings-grid { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:1rem; align-items:start; }
.notification-recipients { list-style:none; padding:0; margin:.6rem 0 0; }
.notification-recipients li { display:flex; flex-wrap:wrap; gap:.45rem .8rem; align-items:center; justify-content:space-between; padding:.7rem 0; border-bottom:1px solid var(--line); }
.notification-recipients li:last-child { border:0; padding-bottom:0; }
.recipient-identity { display:grid; min-width:0; overflow-wrap:anywhere; }
.recipient-identity span { font-size:.89rem; }
.notice-help { margin-top:1rem; }
.office-toasts { position:fixed; bottom:1rem; right:1rem; width:min(22rem,calc(100vw - 2rem)); z-index:1100; pointer-events:none; }
.office-toasts-list { display:grid; gap:.55rem; list-style:none; margin:0; padding:.18rem; max-height:min(44vh,24rem); overflow-y:auto; overscroll-behavior:contain; pointer-events:auto; }
.office-toast { display:flex; justify-content:space-between; align-items:flex-start; gap:.6rem; padding:.8rem .9rem; border:1px solid var(--line); border-left:4px solid var(--gold); border-radius:.58rem; background:var(--paper); color:var(--ink); box-shadow:0 .35rem .9rem #18273a28; overflow-wrap:anywhere; }
.office-toast strong,.office-toast a,.office-toast time { display:block; }
.office-toast strong { font-size:.93rem; }
.office-toast a { font-size:.85rem; font-weight:700; margin-top:.18rem; }
.office-toast time { color:var(--muted); font-size:.78rem; margin-top:.2rem; }
.office-toast-close { appearance:none; background:var(--canvas); color:var(--navy); border:1px solid var(--line); border-radius:.4rem; width:2rem; height:2rem; padding:0; line-height:1; font-size:1.3rem; cursor:pointer; flex:none; }
.office-toast-close:hover { background:#e2eaf2; }
@media(max-width:650px) { .notification-settings-grid { grid-template-columns:1fr; } }
