:root {
    color-scheme: light;
    --navy: #123b63;
    --blue: #1f4e79;
    --pale: #eef5fb;
    --ink: #172334;
    --muted: #64748b;
    --line: #dbe5ee;
    --danger: #b42318;
    --success: #087a55;
    --surface: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: #f5f8fb;
}

a { color: inherit; }

.page {
    width: min(1760px, calc(100% - 32px));
    max-width: none;
    margin: 0 auto;
    padding: 30px 0 56px;
}

.topbar {
    min-height: 68px;
    padding: 0 5vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: var(--navy);
    color: white;
}

.topbar nav {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.topbar a { text-decoration: none; }
.brand { font-size: 20px; font-weight: 800; white-space: nowrap; }

.hero,
.panel,
.card,
.metric {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(18, 59, 99, .05);
}

.hero,
.panel {
    padding: 26px;
}

.hero h1,
.panel h1 {
    margin: 4px 0 10px;
}

.panel h2 {
    margin: 0 0 16px;
}

.eyebrow {
    color: var(--blue);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 12px;
}

.cards,
.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 124px;
    padding: 20px;
    text-decoration: none;
}

.card strong { font-size: 18px; }
.card span,
.metric span,
small,
.muted { color: var(--muted); }
.card.disabled { opacity: .72; }

.metric {
    padding: 18px;
}

.metric strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.mode-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fbfd;
}

.mode-card input {
    width: auto;
}

.mode-card span {
    color: var(--muted);
    font-weight: 400;
}

.planning-subnav {
    display: flex;
    gap: 6px;
    margin: 0 0 20px;
    padding: 8px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    box-shadow: 0 8px 22px rgba(18, 59, 99, .04);
}

.planning-subnav a {
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px 7px;
    border-radius: 7px;
    color: var(--navy);
    font-weight: 750;
    font-size: 13px;
    text-decoration: none;
    text-align: center;
    white-space: normal;
}

.planning-subnav a:hover,
.planning-subnav a.active {
    color: white;
    background: var(--blue);
}

.planning-sections .card:hover {
    border-color: var(--blue);
    transform: translateY(-1px);
}

.checkbox-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.checkbox-row label {
    display: flex;
    width: auto;
    align-items: center;
    gap: 7px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fbfd;
}

.checkbox-row input {
    width: auto;
}

.panel.inset {
    margin-top: 4px;
    box-shadow: none;
    background: #f9fbfd;
}

.auth-shell {
    min-height: 80vh;
    display: grid;
    place-items: center;
}

.auth-panel { width: min(460px, 100%); }

form { display: grid; gap: 16px; }

label {
    display: grid;
    gap: 7px;
    font-weight: 650;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #bac9d6;
    border-radius: 8px;
    background: white;
    font: inherit;
}

textarea { resize: vertical; }

.button.disabled,
span.button.disabled {
    opacity: .48;
    cursor: not-allowed;
    pointer-events: none;
}

.quote-hero { margin-bottom: 20px; }
.quote-search-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    align-items: end;
    margin: 20px 0;
}
.quote-status {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    background: #e8eef4;
    color: var(--navy);
    font-size: 12px;
    font-weight: 800;
}
.quote-status.status-accepted { background: #daf5e9; color: #087a55; }
.quote-status.status-sent { background: #e7f1ff; color: #1f4e79; }
.quote-status.status-rejected,
.quote-status.status-cancelled { background: #fee9e7; color: #b42318; }
.actions-cell { white-space: nowrap; }
.actions-cell a { margin-right: 10px; font-weight: 750; }

.quote-editor { gap: 20px; }
.quote-section { display: grid; gap: 18px; }
.quote-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.quote-section-title > div { display: flex; align-items: center; gap: 12px; }
.quote-section-title span {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: var(--blue);
    font-weight: 850;
}
.quote-section-title h2 { margin: 0; }
.quote-client-note { margin: 0; }
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.lookup-results {
    display: grid;
    gap: 7px;
    max-height: 280px;
    overflow: auto;
}
.lookup-results:empty { display: none; }
.lookup-results button {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    color: var(--ink);
    background: #f9fbfd;
    text-align: left;
}
.lookup-results button:hover { border-color: var(--blue); background: #eef5fb; }
.lookup-results span { color: var(--muted); font-size: 12px; }
details { padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
details summary { cursor: pointer; color: var(--blue); font-weight: 800; }
details[open] summary { margin-bottom: 14px; }
.product-lookup {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
    gap: 12px;
    align-items: end;
}
.quote-items-scroll { overflow-x: auto; }
.quote-items-table { min-width: 1120px; }
.quote-items-table th:nth-child(1) { width: 145px; }
.quote-items-table th:nth-child(2) { width: 420px; }
.quote-items-table th:nth-child(3),
.quote-items-table th:nth-child(4),
.quote-items-table th:nth-child(5) { width: 105px; }
.quote-items-table th:nth-child(6) { width: 65px; }
.quote-items-table th:nth-child(7) { width: 120px; }
.quote-items-table input,
.quote-items-table textarea { padding: 8px 9px; font-size: 13px; }
.quote-items-table td { vertical-align: top; }
.quote-items-table td:first-child input + input { margin-top: 6px; }
.quote-items-table textarea { margin-top: 6px; }
.quote-items-table .item-total { font-weight: 850; white-space: nowrap; }
.quote-item-row.is-offered { background: #f0fbf6; }
.quote-remove-row {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    background: #fee9e7;
    color: var(--danger);
    font-size: 20px;
}
.quote-summary-section {
    grid-template-columns: minmax(0, 1fr) minmax(320px, .55fr);
    align-items: start;
}
.quote-totals { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #f9fbfd; }
.quote-totals dl { display: grid; grid-template-columns: 1fr auto; gap: 10px 18px; margin: 18px 0 0; }
.quote-totals dt,
.quote-totals dd { margin: 0; }
.quote-totals dd { text-align: right; font-variant-numeric: tabular-nums; }
.quote-totals .grand-total { padding-top: 12px; border-top: 2px solid var(--navy); color: var(--navy); font-size: 18px; font-weight: 900; }
.quote-save-bar {
    position: sticky;
    z-index: 12;
    bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border: 1px solid #b7cadb;
    border-radius: 10px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 12px 30px rgba(18, 59, 99, .18);
}
.quote-save-bar span { color: var(--muted); }
.quote-editor-fields { display: contents; margin: 0; padding: 0; border: 0; min-width: 0; }
.quote-editor-fields:disabled { opacity: 1; }
.quote-editor.is-readonly input,
.quote-editor.is-readonly select,
.quote-editor.is-readonly textarea,
.quote-editor.is-readonly button { cursor: not-allowed; }
.quote-editor.is-readonly input,
.quote-editor.is-readonly select,
.quote-editor.is-readonly textarea { color: var(--ink); background: #f3f6f9; opacity: 1; }

@media (max-width: 900px) {
    .grid-3,
    .quote-summary-section { grid-template-columns: 1fr; }
    .quote-search-bar,
    .product-lookup { grid-template-columns: 1fr; }
    .quote-save-bar { align-items: stretch; flex-direction: column; }
}

button,
.button {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: 12px 17px;
    background: var(--blue);
    color: white;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    text-decoration: none;
}

.button.secondary,
.secondary-action {
    background: #e8eef4;
    color: var(--ink);
}

.danger-action {
    background: var(--danger);
    color: white;
}

.compact {
    padding: 8px 11px;
    font-size: 14px;
}

.alert {
    margin-top: 18px;
    padding: 13px 15px;
    border-radius: 8px;
}

.alert.error { background: #fff0ef; color: var(--danger); }
.alert.success { background: #eaf9f2; color: var(--success); }

.code {
    padding: 18px;
    border-radius: 8px;
    background: #102f4d;
    color: white;
    font: 700 22px ui-monospace, Consolas, monospace;
    letter-spacing: .08em;
    text-align: center;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 20px;
}

.align-start { align-items: start; }

.actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.actions.stacked {
    align-items: stretch;
    flex-direction: column;
    margin-top: 20px;
}

.actions.stacked form {
    display: block;
}

.row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th { background: var(--pale); }
td small { display: block; margin-top: 4px; }
.table-panel { margin-top: 20px; overflow-x: auto; }
.archived { opacity: .55; }

.excel-like table {
    min-width: 2600px;
    font-size: 13px;
}

.excel-like th,
.excel-like td {
    white-space: nowrap;
    padding: 8px;
}

.excel-like tbody tr:hover {
    background: #f8fbff;
}

.recap-table table { min-width: 2200px; font-size: 13px; }
.recap-table th, .recap-table td { white-space: nowrap; padding: 8px; }
.recap-table .wrap-cell { min-width: 320px; white-space: normal; }
.wrap-cell { min-width: 280px; white-space: normal; }

dl {
    display: grid;
    grid-template-columns: 145px 1fr;
    gap: 12px;
}

dt {
    color: var(--muted);
    font-weight: 700;
}

dd { margin: 0; }

.stock-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-top: 22px;
}
.stock-kpi {
    display: grid;
    gap: 4px;
    padding: 20px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.stock-kpi strong { font-size: 22px; color: var(--blue); }
.stock-kpi span { color: var(--muted); }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; }
.qr-panel { display: grid; justify-items: center; text-align: center; }
#qrcode { padding: 12px; background: white; }
.scanner-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 20px; margin-top: 20px; align-items: start; }
.scanner-panel { display: grid; gap: 18px; }
#reader { width: 100%; min-height: 280px; overflow: hidden; border-radius: 10px; background: #111; }
#reader video { object-fit: cover; }
.scanner-manual { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.scanner-result { text-align: center; border-width: 4px; }
.scanner-result .result-icon { font-size: 48px; line-height: 1; }
.result-neutral { border-color: #6c757d; }
.result-success { border-color: var(--success); background: #eaf9f2; }
.result-error { border-color: var(--danger); background: #fff0ef; }
.result-warning { border-color: #d69e00; background: #fff8db; }
.scanner-history { margin-top: 20px; }
.scanner-history .actions { justify-content: space-between; }
.scan-success { color: var(--success); font-weight: 750; }
.scan-error { color: var(--danger); font-weight: 750; }
.product-label { max-width: 520px; margin: 0 auto; display: grid; justify-items: center; text-align: center; }
.product-label-heading { color: var(--navy); font-size: 22px; font-weight: 850; text-transform: uppercase; }
.import-status { display: inline-block; padding: 5px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.import-status.create { color: var(--success); background: #eaf9f2; }
.import-status.update { color: var(--blue); background: var(--pale); }
.import-confirm { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.checkbox-line { display: flex; grid-template-columns: none; align-items: center; gap: 10px; }
.checkbox-line input { width: auto; }

.schedule-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-end;
}

.schedule-toolbar {
    display: grid;
    grid-template-columns: 1fr minmax(240px, 340px);
    gap: 18px;
    margin-top: 20px;
    align-items: end;
}

.schedule-view-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.schedule-filter {
    display: block;
}

.schedule-own-filter {
    display: grid;
    gap: 3px;
    padding: 10px 13px;
    border: 1px solid #bad3e9;
    border-radius: 8px;
    background: #edf6ff;
}

.schedule-own-filter span,
.schedule-own-filter small {
    color: var(--muted);
    font-size: 12px;
}

.schedule-navigation {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.schedule-navigation > div {
    display: flex;
    gap: 12px;
    align-items: baseline;
    justify-content: center;
    text-align: center;
}

.schedule-navigation strong {
    color: var(--navy);
    font-size: 20px;
}

.schedule-shell {
    margin-top: 20px;
    padding: 0;
    overflow: hidden;
}

.schedule-live-row {
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    background: #f9fbfd;
}

.schedule-live-row #schedule-updated {
    margin-right: auto;
    color: var(--muted);
}

.schedule-live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #1aad72;
    box-shadow: 0 0 0 4px rgba(26, 173, 114, .14);
    animation: schedule-pulse 2s infinite;
}

@keyframes schedule-pulse {
    50% { box-shadow: 0 0 0 8px rgba(26, 173, 114, 0); }
}

.schedule-root {
    min-height: 420px;
    background: white;
}

.schedule-loading,
.schedule-empty {
    padding: 70px 20px;
    color: var(--muted);
    text-align: center;
}

.schedule-scroll {
    max-height: 72vh;
    overflow: auto;
    overscroll-behavior: contain;
}

.schedule-timeline-scroll {
    overflow-x: hidden;
}

.schedule-timeline {
    --schedule-columns: 7;
    display: grid;
    grid-template-columns: 64px repeat(var(--schedule-columns), minmax(0, 1fr));
    grid-template-rows: auto auto 832px;
    width: 100%;
    min-width: 0;
}

.schedule-corner,
.schedule-column-heading {
    position: sticky;
    top: 0;
    z-index: 8;
    min-height: 50px;
    padding: 14px 10px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--navy);
    background: #f6f9fc;
    font-weight: 850;
    text-align: center;
    text-transform: capitalize;
}

.schedule-corner {
    left: 0;
    z-index: 10;
}

.schedule-all-day-label,
.schedule-all-day-cell {
    position: sticky;
    top: 50px;
    z-index: 6;
    min-height: 54px;
    padding: 6px;
    border-right: 1px solid var(--line);
    border-bottom: 2px solid #cbd9e6;
    background: white;
}

.schedule-all-day-label {
    left: 0;
    z-index: 9;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.schedule-time-axis {
    position: sticky;
    left: 0;
    z-index: 5;
    height: 832px;
    border-right: 1px solid #cbd9e6;
    background: white;
}

.schedule-time-axis span {
    position: absolute;
    right: 9px;
    transform: translateY(-7px);
    color: #7b8998;
    font-size: 11px;
}

.schedule-time-track {
    position: relative;
    height: 832px;
    border-right: 1px solid var(--line);
    background-color: white;
    background-image:
        linear-gradient(to bottom, rgba(170, 188, 204, .48) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(219, 229, 238, .65) 1px, transparent 1px);
    background-size: 100% 64px, 100% 32px;
}

.schedule-positioned-event {
    position: absolute;
    z-index: 3;
    min-width: 72px;
    height: 88px;
    padding: 2px;
}

.schedule-event {
    --event-color: #4f7cff;
    --event-bg: #edf3ff;
    display: grid;
    gap: 2px;
    height: 100%;
    min-height: 30px;
    padding: 7px 8px;
    overflow: hidden;
    border: 1px solid var(--event-color);
    border-top: 6px solid var(--event-color);
    border-radius: 7px;
    color: var(--ink);
    background: var(--event-bg);
    box-shadow: 0 2px 7px rgba(18, 59, 99, .12);
    text-decoration: none;
}

.schedule-event:hover {
    z-index: 4;
    filter: saturate(1.15);
    box-shadow: 0 5px 14px rgba(18, 59, 99, .2);
}

.schedule-event strong,
.schedule-event span,
.schedule-event small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-event strong { font-size: 12px; }
.schedule-event span,
.schedule-event small { font-size: 10px; }
.schedule-event-time { color: var(--event-color); font-weight: 850; }
.schedule-event.is-completed { opacity: .62; filter: grayscale(.45); }
.schedule-event.is-provisional {
    background-color: var(--event-bg);
    background-image: repeating-linear-gradient(
        135deg,
        transparent 0 8px,
        rgba(255, 255, 255, .82) 8px 13px
    );
    border-style: dashed;
}
.schedule-event-state {
    justify-self: start;
    padding: 2px 5px;
    border-radius: 999px;
    color: var(--event-color);
    background: rgba(255, 255, 255, .86);
    font-size: 9px;
    font-style: normal;
    font-weight: 850;
    line-height: 1.2;
    text-transform: uppercase;
}
.schedule-event.is-compact { height: auto; min-height: 25px; margin-top: 4px; padding: 4px 6px; border-top-width: 4px; }
.schedule-event.is-compact span,
.schedule-event.is-compact small { display: none; }

.schedule-color-1 { --event-color: #4f7cff; --event-bg: #edf3ff; }
.schedule-color-2 { --event-color: #e24d8d; --event-bg: #fff0f6; }
.schedule-color-3 { --event-color: #18a985; --event-bg: #eafaf5; }
.schedule-color-4 { --event-color: #f09b21; --event-bg: #fff7e8; }
.schedule-color-5 { --event-color: #805ad5; --event-bg: #f5f0ff; }
.schedule-color-6 { --event-color: #1597c5; --event-bg: #eaf8fd; }
.schedule-color-7 { --event-color: #cf4b3f; --event-bg: #fff1ef; }
.schedule-color-8 { --event-color: #65a30d; --event-bg: #f3f9e8; }
.schedule-color-neutral { --event-color: #7b8794; --event-bg: #edf0f3; }

.schedule-now-line {
    position: absolute;
    z-index: 7;
    left: 0;
    right: 0;
    height: 2px;
    background: #e23d33;
    pointer-events: none;
}

.schedule-now-line::before {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e23d33;
    content: '';
}

.schedule-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(135px, 1fr));
    min-width: 980px;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.schedule-month-heading {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 11px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--navy);
    background: #f6f9fc;
    font-weight: 850;
    text-align: center;
}

.schedule-month-day {
    min-height: 150px;
    padding: 8px;
    overflow: hidden;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: white;
}

.schedule-month-day.is-outside { background: #f3f5f7; opacity: .62; }
.schedule-month-day.is-today { box-shadow: inset 0 0 0 3px #f2b94b; }
.schedule-day-number {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    color: var(--navy);
    font-weight: 850;
    text-decoration: none;
}
.schedule-day-number:hover { color: white; background: var(--blue); }
.schedule-more { display: block; margin-top: 5px; color: var(--muted); font-weight: 700; }

.schedule-year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    padding: 16px;
    background: #f5f8fb;
}

.schedule-mini-month {
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: white;
}

.schedule-mini-month h2 { margin: 0 0 10px; font-size: 17px; }
.schedule-mini-month h2 a { color: var(--navy); text-decoration: none; }
.schedule-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.schedule-mini-grid > b { padding: 4px; color: var(--muted); font-size: 10px; text-align: center; }
.schedule-mini-grid > i { min-height: 31px; }
.schedule-mini-day {
    position: relative;
    display: grid;
    min-height: 31px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--ink);
    font-size: 11px;
    text-decoration: none;
}
.schedule-mini-day.has-events { border-color: #9dbce0; color: var(--navy); background: #edf4fc; font-weight: 850; }
.schedule-mini-day.is-today { border-color: #e4a52c; box-shadow: inset 0 0 0 1px #e4a52c; }
.schedule-mini-day strong {
    position: absolute;
    right: 1px;
    bottom: 1px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 7px;
    color: white;
    background: var(--blue);
    font-size: 9px;
    line-height: 14px;
    text-align: center;
}

.technician-color-swatch {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid white;
    border-radius: 50%;
    background: var(--swatch, #4f7cff);
    box-shadow: 0 0 0 1px var(--line);
    vertical-align: middle;
}

.map-toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(145px, 1fr));
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}

.map-toolbar label { margin: 0; }
.map-technician-toggle { display: flex; gap: 8px; align-items: center; padding-bottom: 12px; }
.map-technician-toggle input { width: auto; }
.map-panel { padding: 0; overflow: hidden; }
#planning-map { width: 100%; height: min(72vh, 760px); min-height: 520px; background: #edf2f6; }
.map-legend { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); }
.map-legend span { display: inline-flex; gap: 6px; align-items: center; }
.map-legend small { flex: 1 1 100%; color: var(--muted); }
.map-legend-dot { width: 13px; height: 13px; border-radius: 50%; }
.map-legend-install { background: #18a985; }
.map-legend-maintenance { background: #f09b21; }
.map-legend-repair { background: #dc3545; }
.map-legend-completion { background: #805ad5; }
.map-legend-client { background: #fff; border: 3px solid #66788a; }
.map-legend-client-estimated { background: #fff5e5; border: 3px dashed #d98214; }
.map-legend-accepted-quote { background: #1e77d3; border: 3px solid #fff; box-shadow: 0 0 0 1px #1e77d3; }
.map-legend-legacy-recap { background: #eef3f8; border: 3px dashed #1b4c78; }
.planning-map-accepted-quote-marker {
    display: block;
    width: 26px;
    height: 26px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #1e77d3;
    box-shadow: 0 2px 8px rgba(15, 56, 95, .45), 0 0 0 0 rgba(30, 119, 211, .5);
    transform-origin: center;
    animation: map-accepted-quote-pulse 3.2s ease-in-out infinite;
}
@keyframes map-accepted-quote-pulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 2px 8px rgba(15, 56, 95, .45), 0 0 0 0 rgba(30, 119, 211, .5); }
    50% { opacity: .55; transform: scale(1.2); box-shadow: 0 2px 8px rgba(15, 56, 95, .35), 0 0 0 9px rgba(30, 119, 211, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .planning-map-accepted-quote-marker { animation: none; }
}
.planning-map-icon { background: transparent; border: 0; }
.planning-map-marker {
    display: flex;
    width: 24px;
    height: 24px;
    overflow: hidden;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 7px rgba(9, 32, 56, .5), 0 0 0 1px rgba(18, 59, 99, .5);
}
.planning-map-icon.is-provisional .planning-map-marker {
    border-style: dashed;
    box-shadow: 0 2px 7px rgba(9, 32, 56, .5), 0 0 0 2px #172b4d;
}
.planning-map-icon.is-legacy-attention .planning-map-marker {
    transform-origin: center;
    animation: map-legacy-recap-pulse 3.2s ease-in-out infinite;
}
@keyframes map-legacy-recap-pulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 2px 7px rgba(9, 32, 56, .5), 0 0 0 2px #172b4d; }
    50% { opacity: .5; transform: scale(1.2); box-shadow: 0 2px 7px rgba(9, 32, 56, .3), 0 0 0 9px rgba(23, 43, 77, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .planning-map-icon.is-legacy-attention .planning-map-marker { animation: none; }
}
.map-marker-full { width: 100%; height: 100%; }
.map-marker-half { width: 50%; height: 100%; }
.map-popup { display: grid; gap: 4px; min-width: 230px; }
.map-popup strong { color: var(--navy); font-size: 15px; }
.map-popup span { color: #425466; }
.planning-map-client-marker {
    display: block;
    width: 24px;
    height: 24px;
    border: 4px solid #66788a;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 7px rgba(9, 32, 56, .45);
}
.planning-map-client-marker::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    margin: 5px;
    border-radius: 50%;
    background: #66788a;
}
.planning-map-client-icon.is-estimated .planning-map-client-marker {
    border-color: #d98214;
    border-style: dashed;
    background: #fff5e5;
}
.planning-map-client-icon.is-estimated .planning-map-client-marker::after { background: #d98214; }
.map-location-warning { padding: 6px 8px; border-radius: 6px; background: #fff0d8; color: #7b4900 !important; font-weight: 700; }
.map-client-tools { display: grid; gap: 14px; margin-bottom: 16px; }
.map-client-tools h2 { margin: 0 0 4px; }
.map-client-search { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; gap: 10px; align-items: end; }
.map-client-search label { margin: 0; }
.map-client-results { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; }
.map-client-results article {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f8fbfd;
}
.map-client-results article > div { display: grid; gap: 3px; }
.map-client-results article span { color: var(--muted); font-size: 13px; }
.map-client-results .map-location-status { width: max-content; padding: 3px 7px; border-radius: 999px; font-weight: 750; }
.map-location-status.is-confirmed { color: #146b52; background: #ddf5ed; }
.map-location-status.is-unconfirmed { color: #8a5700; background: #fff0d2; }
.map-location-status.is-missing { color: #9a2f37; background: #ffe3e6; }
.map-client-candidates { display: grid; grid-column: 1 / -1; gap: 7px; }
.map-client-candidates:empty { display: none; }
.map-client-candidates > div { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px; border-top: 1px solid var(--line); }
.map-client-candidates > div span { display: grid; gap: 2px; }
.map-client-selection { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); }
.map-client-selection > div { display: grid; gap: 3px; }
.map-client-selection small { color: var(--muted); }
.map-client-selected { display: flex; flex-wrap: wrap; gap: 8px; }
.map-client-selected > span { display: inline-flex; gap: 6px; align-items: center; padding: 6px 8px 6px 11px; border-radius: 999px; background: #e7edf2; color: #24384b; }
.map-client-selected > span.is-estimated { background: #fff0d8; color: #7b4900; }
.map-client-selected small { color: #607487; }
.map-client-selected button { min-width: 0; padding: 0 5px; border: 0; background: transparent; color: #41576c; font-size: 19px; line-height: 1; }

.geocoding-toolbar { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.geocoding-list { display: grid; gap: 12px; margin-top: 14px; }
.geocoding-client { display: grid; grid-template-columns: minmax(230px, 1fr) auto; gap: 12px; align-items: start; }
.geocoding-client > div:first-child { display: grid; gap: 4px; }
.geocoding-client > div:first-child span { color: var(--muted); }
.geocoding-client.is-confirmed { border-color: #55b79b; }
.geocoding-result { grid-column: 1 / -1; }
.geocoding-candidate {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-top: 1px solid var(--line);
}
.geocoding-candidate span { display: grid; gap: 2px; }
.geocoding-candidate small { color: var(--muted); }
.quote-geocoding-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.manual-paste-panel textarea[name="paste_text"] { min-height: 260px; font-family: Consolas, "Courier New", monospace; font-size: 12px; white-space: pre; }
.manual-paste-columns { columns: 3 240px; padding-left: 26px; }
.manual-paste-confirm { margin-top: 18px; }
.paste-error { color: #a3212a !important; }
.paste-warning { color: #916000 !important; }
.stock-product-editor fieldset { margin: 0; padding: 0; border: 0; }
.stock-product-editor fieldset:disabled { opacity: .8; }
.stock-override-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.stock-override-list span { padding: 5px 9px; border-radius: 999px; color: #17426b; background: #e7f1fb; font-size: 12px; font-weight: 750; }

@media print {
    .topbar, .page > :not(.details-grid), .details-grid > :first-child, button { display: none !important; }
    .details-grid { display: block; }
    .qr-panel { border: 0; box-shadow: none; }
    .product-label { display: grid !important; border: 0; box-shadow: none; }
    .no-print { display: none !important; }
}

@media (max-width: 1100px) {
    .map-toolbar { grid-template-columns: repeat(3, minmax(145px, 1fr)); }
    .planning-subnav {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .schedule-timeline-scroll {
        overflow-x: auto;
    }

    .schedule-timeline {
        grid-template-columns: 60px repeat(var(--schedule-columns), minmax(150px, 1fr));
        width: auto;
        min-width: calc(60px + (var(--schedule-columns) * 150px));
    }
}

@media (max-width: 760px) {
    .map-toolbar { grid-template-columns: 1fr; }
    #planning-map { min-height: 65vh; }
    .map-client-search, .map-client-results article, .map-client-candidates > div { grid-template-columns: 1fr; }
    .map-client-selection { align-items: stretch; flex-direction: column; }
    .geocoding-client, .geocoding-candidate { grid-template-columns: 1fr; }
    .geocoding-result { grid-column: 1; }
    .grid-2, .details-grid, .scanner-layout { grid-template-columns: 1fr; }
    .planning-subnav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .schedule-hero { display: grid; align-items: start; }
    .schedule-toolbar { grid-template-columns: 1fr; }
    .schedule-view-tabs { flex-wrap: nowrap; overflow-x: auto; }
    .schedule-view-tabs .button { flex: 0 0 auto; }
    .schedule-navigation { grid-template-columns: 1fr 1fr; }
    .schedule-navigation > div { grid-column: 1 / -1; grid-row: 1; flex-direction: column; gap: 4px; }
    .schedule-navigation > :last-child { justify-self: end; }
    .schedule-live-row { align-items: flex-start; flex-wrap: wrap; }
    .schedule-live-row #schedule-updated { width: calc(100% - 26px); margin-right: 0; }
    .schedule-live-row button { margin-left: auto; }
    .schedule-scroll { max-height: 68vh; }
    .schedule-timeline { grid-template-columns: 60px repeat(var(--schedule-columns), minmax(220px, 1fr)); min-width: calc(60px + (var(--schedule-columns) * 220px)); }
    .topbar {
        align-items: flex-start;
        padding-block: 16px;
    }
    .topbar nav {
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }
}

@media (max-width: 430px) {
    .planning-subnav { grid-template-columns: 1fr; }
}
.preparation-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:1rem;margin-top:1.25rem}.preparation-card{position:relative;border:2px solid #dc2626;border-radius:14px;padding:1rem;background:#fff}.preparation-card.partial{border-color:#f59e0b}.preparation-card.ready{border-color:#16a34a}.preparation-select{position:absolute;right:1rem;top:1rem}.preparation-bin{display:inline-block;padding:.35rem .7rem;border-radius:999px;background:#172554;color:#fff;font-weight:800}.preparation-card h2{margin:.8rem 0 .2rem}.preparation-counts{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;margin:.8rem 0}.preparation-counts span{padding:.55rem;background:#f1f5f9;border-radius:8px}.preparation-counts strong{display:block;font-size:1.25rem}.scan-guidance-form{display:flex;align-items:end;gap:1rem;flex-wrap:wrap}.scan-guidance-form label{flex:1;min-width:260px}.guidance-bins{display:flex;gap:1rem;flex-wrap:wrap}.guidance-bins div{min-width:170px;padding:1rem;border-radius:12px;background:#dcfce7;border:2px solid #16a34a}.guidance-bins strong,.guidance-bins span{display:block}.guidance-bins strong{font-size:1.35rem}.bin-chip{display:inline-block;margin:.15rem;padding:.3rem .55rem;border-radius:999px;background:#dbeafe;white-space:nowrap}
