:root {
    --brand-red: #d5001c;
    --brand-red-soft: #fff0f2;
    --critical: #c62828;
    --critical-soft: #fff1f1;
    --warning: #d17a00;
    --warning-soft: #fff7e8;
    --success: #237a4b;
    --success-soft: #edf9f1;
    --info: #1f6fb2;
    --info-soft: #eef6ff;
    --neutral: #64727a;
    --neutral-strong: #282525;
    --surface: #ffffff;
    --page-bg: #f7f7f7;
    --line: #e5e5e5;
    --ops-surface-soft: #f6f8f9;
    --ops-text: #283238;
    --ops-text-muted: #64727a;
    --ops-border: #dfe7eb;
    --panel-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    --bg-app: #f7f7f7;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-elevated: #f6f8f9;
    --bg-input: #ffffff;
    --border-soft: #dfe7eb;
    --border-strong: #c8d3db;
    --text-primary: #283238;
    --text-secondary: #64727a;
    --text-muted: #7a8892;
    --accent-primary: #1f6fb2;
    --accent-danger: #c62828;
    --accent-warning: #d17a00;
    --accent-success: #237a4b;
    --accent-info: #1f6fb2;
}

:root.ops-theme-night {
    --brand-red-soft: #f5d9dd;
    --critical-soft: #f0ced2;
    --warning-soft: #f3e4bd;
    --success-soft: #cfe8e4;
    --info-soft: #d1e2f1;
    --neutral: #6f7f8e;
    --neutral-strong: #263746;
    --surface: #e3e9ef;
    --page-bg: #cfd9e4;
    --line: #aebdca;
    --ops-surface-soft: #d7e0e9;
    --ops-text: #263746;
    --ops-text-muted: #627384;
    --ops-border: #aebdca;
    --panel-shadow: 0 14px 30px rgba(65, 82, 99, 0.14);
    --bg-app: #cfd9e4;
    --bg-sidebar: #bcc9d6;
    --bg-card: #e3e9ef;
    --bg-card-elevated: #d8e1ea;
    --bg-input: #eef3f7;
    --border-soft: #aebdca;
    --border-strong: #8fa1b2;
    --text-primary: #263746;
    --text-secondary: #526577;
    --text-muted: #728191;
    --accent-primary: #2f6f9f;
    --accent-danger: #b94a54;
    --accent-warning: #9b6d12;
    --accent-success: #287f73;
    --accent-info: #2f6f9f;
}

:root.ops-theme-dark,
:root.ops-theme-twilight {
    --brand-red-soft: #34171d;
    --critical-soft: #3a1418;
    --warning-soft: #3a2d0a;
    --success-soft: #0f3a37;
    --info-soft: #102a43;
    --neutral: #aab7c4;
    --neutral-strong: #eaf0f6;
    --surface: #17212b;
    --page-bg: #0f1419;
    --line: #2a3745;
    --ops-surface-soft: #1b2632;
    --ops-text: #dce5ee;
    --ops-text-muted: #97a6b4;
    --ops-border: #233040;
    --panel-shadow: 0 16px 34px rgba(2, 8, 16, 0.22);
    --bg-app: #0f1419;
    --bg-sidebar: #111922;
    --bg-card: #17212b;
    --bg-card-elevated: #1b2632;
    --bg-input: #101820;
    --border-soft: #233040;
    --border-strong: #2a3745;
    --text-primary: #dce5ee;
    --text-secondary: #a2b0bd;
    --text-muted: #80909d;
    --accent-primary: #60a5fa;
    --accent-danger: #f87171;
    --accent-warning: #fbbf24;
    --accent-success: #2dd4bf;
    --accent-info: #60a5fa;
}

html,
body {
    background: var(--page-bg);
    color: var(--ops-text);
}

body {
    transition: background-color 0.2s ease, color 0.2s ease;
}

#components-reconnect-modal {
    display: none !important;
}

.opsgrid-reconnect-modal[hidden] {
    display: none !important;
}

.opsgrid-reconnect-modal {
    bottom: 1rem;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
    position: fixed;
    right: 1rem;
    z-index: 5000;
}

.opsgrid-reconnect-card {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #dfe7eb;
    border-left: 5px solid var(--info);
    border-radius: 10px;
    box-shadow: 0 20px 45px rgba(18, 30, 38, 0.2);
    color: var(--neutral-strong);
    display: grid;
    gap: 0.2rem 0.85rem;
    grid-template-columns: minmax(170px, 1fr) auto;
    max-width: min(460px, calc(100vw - 2rem));
    padding: 0.8rem 0.95rem;
    pointer-events: auto;
}

.opsgrid-reconnect-card strong {
    font-size: 0.86rem;
    line-height: 1.2;
}

.opsgrid-reconnect-card span {
    color: var(--neutral);
    font-size: 0.76rem;
    grid-column: 1;
    line-height: 1.3;
}

.opsgrid-reconnect-card button {
    align-self: center;
    background: var(--neutral-strong);
    border: 0;
    border-radius: 8px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    grid-column: 2;
    grid-row: 1 / span 2;
    min-height: 2rem;
    padding: 0 0.75rem;
}

.opsgrid-reconnect-modal.waiting .opsgrid-reconnect-card {
    border-left-color: var(--warning);
}

.opsgrid-reconnect-modal.failed .opsgrid-reconnect-card {
    border-left-color: var(--critical);
}

/* OpsGrid streamlined shell and shared component layer */
.app-topbar {
    align-items: center;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(180px, 1fr) auto auto auto auto;
    width: 100%;
}

.global-search {
    align-items: center;
    background: var(--bg-card-elevated);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    color: var(--ops-text-muted);
    display: flex;
    gap: 0.5rem;
    max-width: 540px;
    padding: 0.5rem 0.8rem;
}

.global-search input,
.filter-search input {
    background: transparent;
    border: 0;
    color: var(--ops-text);
    font: inherit;
    min-width: 0;
    outline: 0;
    width: 100%;
}

.topbar-primary-action,
.attention-pill,
.theme-toggle,
.theme-mode-button {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 800;
    gap: 0.45rem;
    min-height: 2.45rem;
    padding: 0 0.95rem;
    text-decoration: none;
    white-space: nowrap;
}

.topbar-primary-action {
    background: #174f78;
    color: #fff;
    box-shadow: 0 10px 24px rgba(23, 79, 120, 0.18);
}

.attention-pill {
    background: #fff6e8;
    color: #9b5200;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    color: var(--ops-text);
}

.theme-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    background: var(--bg-card);
}

.theme-mode-button {
    background: transparent;
    border: 1px solid transparent;
    color: var(--ops-text-muted);
    min-height: 2.05rem;
    padding: 0 .75rem;
}

.theme-mode-button:hover {
    color: var(--ops-text);
    background: color-mix(in srgb, var(--bg-card-elevated) 72%, transparent 28%);
}

.theme-mode-button.selected {
    color: var(--text-primary);
    border-color: color-mix(in srgb, var(--accent-primary) 28%, var(--border-soft) 72%);
    background: color-mix(in srgb, var(--accent-primary) 12%, var(--bg-card-elevated) 88%);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-primary) 14%, transparent 86%);
}

input,
select,
textarea,
.modal-field input,
.modal-field select,
.modal-field textarea,
.currency-input,
.global-search,
.filter-search,
.filter-bar {
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}

input:focus,
select:focus,
textarea:focus,
.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus,
.global-search:focus-within,
.currency-input:focus-within {
    outline: none;
    border-color: color-mix(in srgb, var(--accent-primary) 70%, white 30%);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 20%, transparent 80%);
}

.ui-page-shell {
    display: grid;
    gap: 1rem;
}

.ui-workspace {
    min-width: 0;
}

.module-header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.module-header-copy h1 {
    margin: 0;
}

.module-header-actions,
.action-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
}

.kpi-strip {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.filter-bar {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr) auto;
    margin-bottom: 0.75rem;
    padding: 0.55rem;
}

.filter-search {
    align-items: center;
    background: var(--ops-surface-soft);
    border: 1px solid var(--ops-border);
    border-radius: 8px;
    color: var(--ops-text-muted);
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.filter-chips button,
.responsive-tabs button {
    align-items: center;
    background: #f7f9fa;
    border: 1px solid #dfe7eb;
    border-radius: 999px;
    color: #4f5f66;
    display: inline-flex;
    font-weight: 800;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
}

.filter-chips button.active,
.responsive-tabs button.active {
    background: #e8f3f9;
    border-color: #b9d7e7;
    color: #174f78;
}

.filter-chips strong,
.responsive-tabs span {
    background: #ffffff;
    border-radius: 999px;
    color: inherit;
    font-size: 0.72rem;
    padding: 0.05rem 0.4rem;
}

.ui-chip {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 900;
    gap: 0.3rem;
    line-height: 1;
    padding: 0.36rem 0.55rem;
    white-space: nowrap;
}

.tone-success,
.status-chip.tone-success {
    background: #eaf7ef;
    color: #237a4b;
}

.tone-warning,
.status-chip.tone-warning {
    background: #fff6e8;
    color: #9b5200;
}

.tone-danger,
.status-chip.tone-danger {
    background: #fff0f1;
    color: #c62828;
}

.tone-info,
.status-chip.tone-info {
    background: #e8f3f9;
    color: #174f78;
}

.tone-neutral,
.status-chip.tone-neutral {
    background: #eef2f4;
    color: #4f5f66;
}

.entity-card,
.detail-drawer,
.ui-data-table,
.empty-state,
.setup-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.entity-card {
    align-items: flex-start;
    cursor: pointer;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 0.9rem;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.entity-card:hover {
    border-color: #b9d7e7;
    box-shadow: var(--panel-shadow);
    transform: translateY(-1px);
}

.entity-icon {
    align-items: center;
    background: #e8f3f9;
    border-radius: 8px;
    color: #174f78;
    display: inline-flex;
    height: 2.2rem;
    justify-content: center;
    width: 2.2rem;
}

.entity-card-title {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.entity-card p {
    color: var(--ops-text-muted);
    margin: 0.25rem 0 0;
}

.detail-drawer {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    overflow: hidden;
}

.detail-drawer > header {
    align-items: flex-start;
    border-bottom: 1px solid #e1e8ec;
    display: flex;
    justify-content: space-between;
    padding: 0.85rem;
}

.detail-drawer > header h2 {
    margin: 0;
}

.detail-drawer > header span {
    color: var(--ops-text-muted);
}

.detail-drawer-body {
    overflow: auto;
    padding: 0.85rem;
}

.ui-data-table {
    overflow: hidden;
}

.ui-data-table-header {
    background: var(--ops-surface-soft);
    border-bottom: 1px solid #e1e8ec;
    color: var(--ops-text-muted);
    font-weight: 900;
    padding: 0.7rem 0.9rem;
}

.ui-data-table-body {
    display: grid;
}

.empty-state {
    align-items: center;
    color: #64727a;
    display: grid;
    gap: 0.4rem;
    justify-items: center;
    padding: 2rem;
    text-align: center;
}

.empty-state > span {
    align-items: center;
    background: #eef2f4;
    border-radius: 999px;
    color: #174f78;
    display: inline-flex;
    height: 3rem;
    justify-content: center;
    width: 3rem;
}

.empty-state p {
    margin: 0;
    max-width: 28rem;
}

.loading-skeleton {
    display: grid;
    gap: 0.7rem;
    padding: 1rem;
}

.loading-skeleton span {
    animation: skeleton-pulse 1.2s ease-in-out infinite;
    background: linear-gradient(90deg, #eef2f4, #f7f9fa, #eef2f4);
    border-radius: 8px;
    display: block;
    height: 1rem;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

.responsive-tabs {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
}

.setup-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.setup-card {
    color: #283238;
    display: grid;
    gap: 0.55rem;
    min-height: 130px;
    padding: 0.85rem;
    text-decoration: none;
}

.setup-card .ops-icon {
    color: #174f78;
}

.setup-card span {
    color: var(--ops-text-muted);
}

.streamlined-ops-layout {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.streamlined-list {
    display: grid;
    gap: 0.65rem;
}

.queue-card.selected,
.project-select-card.active {
    border-color: #174f78;
    box-shadow: 0 10px 24px rgba(23, 79, 120, 0.10);
}

.compact-kpis {
    margin-bottom: 0;
}

.chip-row.compact {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.drawer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1rem;
}

.compact-detail-hero {
    margin-bottom: 1rem;
}

.pager-row {
    align-items: center;
    color: #64727a;
    display: flex;
    font-size: 0.82rem;
    font-weight: 800;
    gap: 0.5rem;
    justify-content: space-between;
    margin-top: 0.8rem;
}

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

.wizard-footer-actions {
    align-items: center;
    border-top: 1px solid #e1e8ec;
    display: flex;
    gap: 0.7rem;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
}

.intake-step-button {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.intake-step-button.active strong {
    color: #174f78;
}

.intake-step-button.active .timeline-dot {
    background: #174f78;
}

.drawer-tabs {
    margin-bottom: 1rem;
}

.mobile-sticky-actions {
    display: none;
}

@media (max-width: 1100px) {
    .app-topbar {
        grid-template-columns: minmax(160px, 1fr) auto;
    }

    .attention-pill {
        display: none;
    }

    .theme-toggle span,
    .theme-mode-button span {
        display: none;
    }

    .filter-bar,
    .streamlined-ops-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .app-topbar {
        grid-template-columns: 1fr auto;
    }

    .global-search {
        max-width: none;
    }

    .topbar-primary-action span,
    .attention-pill,
    .theme-toggle span,
    .theme-mode-button span {
        display: none;
    }

    .module-header {
        display: grid;
    }

    .module-header-actions,
    .action-toolbar {
        justify-content: stretch;
    }

    .module-header-actions > *,
    .action-toolbar > * {
        flex: 1 1 auto;
    }

    .detail-drawer {
        max-height: none;
    }

    .mobile-sticky-actions {
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid #e1e8ec;
        bottom: 0;
        display: flex;
        gap: 0.5rem;
        left: 0;
        padding: 0.75rem;
        position: sticky;
        z-index: 70;
    }
}

html,
body {
    background: var(--page-bg);
    color: var(--ops-text);
    font-family: "Poppins", Arial, Helvetica, sans-serif;
}

@media (min-width: 641px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 1500px) {
    html {
        font-size: 13.5px;
    }
}

a,
.btn-link {
    color: var(--brand-red);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

.page-header {
    align-items: flex-end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.05rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.eyebrow {
    color: var(--brand-red);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.page-subtitle,
.panel-heading span,
.priority-list span,
.tech-row small,
.alert-row span,
.project-card p,
.ops-table small {
    color: #64727a;
}

.page-subtitle {
    max-width: 760px;
}

.header-chip,
.pill {
    background: var(--info-soft);
    border: 1px solid #cfe5fb;
    border-radius: 999px;
    color: var(--info);
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 0.35rem 0.7rem;
    white-space: nowrap;
}

.loading-panel,
.placeholder-panel,
.ops-panel,
.table-shell,
.project-card,
.kanban-column,
.work-card,
.chart-panel,
.dashboard-hero {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(40, 37, 37, 0.06);
}

.loading-panel,
.placeholder-panel {
    color: #64727a;
    padding: 1rem;
}

.dashboard-hero {
    align-items: center;
    background:
        radial-gradient(circle at 75% 22%, rgba(208, 224, 234, 0.78), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #f8fbfc 58%, #fff3f4 100%);
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) 240px;
    margin-bottom: 0.9rem;
    overflow: hidden;
    padding: 1rem;
}

.tenant-logo {
    display: block;
    height: 38px;
    margin-bottom: 0.75rem;
    object-fit: contain;
    width: fit-content;
}

.dashboard-hero h2 {
    font-size: 1.65rem;
    font-weight: 900;
    margin-bottom: 0.55rem;
}

.dashboard-hero p:not(.eyebrow) {
    color: #64727a;
    margin-bottom: 0;
    max-width: 760px;
}

.hero-score {
    background: linear-gradient(135deg, var(--brand-red), #a80016);
    border-radius: 8px;
    color: #ffffff;
    min-height: 140px;
    padding: 0.9rem;
}

.hero-score span,
.hero-score small,
.hero-score strong {
    display: block;
}

.hero-score strong {
    font-size: 2.45rem;
    line-height: 1.1;
    margin: 0.75rem 0;
}

.visual-grid {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.chart-panel {
    padding: 0.85rem;
}

.chart-panel.large {
    grid-column: span 2;
}

.panel-heading,
.section-title,
.work-card-top,
.project-card footer {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.panel-heading,
.section-title {
    margin-bottom: 0.8rem;
}

.panel-heading h2,
.ops-panel h2,
.section-title h2 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.chart-host {
    height: 250px;
    min-height: 0;
}

.chart-host.compact {
    height: 190px;
}

.metric-strip {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-pill {
    background: #f7f7f7;
    border-left: 4px solid #64727a;
    border-radius: 8px;
    padding: 0.8rem;
}

.metric-pill span,
.metric-pill strong {
    display: block;
}

.metric-pill span {
    color: #64727a;
    font-size: 0.78rem;
}

.metric-pill strong {
    font-size: 1.45rem;
}

.tone-success {
    border-color: var(--success);
}

.tone-warning {
    border-color: var(--warning);
}

.tone-danger {
    border-color: var(--critical);
}

.tone-neutral {
    border-color: var(--neutral-strong);
}

.tone-muted {
    border-color: #8b938d;
}

.ops-split,
.dispatch-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
}

.ops-panel {
    padding: 1rem;
}

.priority-list,
.tech-list,
.alert-list {
    display: grid;
    gap: 0.8rem;
}

.priority-list div,
.tech-row,
.alert-row {
    border-bottom: 1px solid #edf1ed;
    padding-bottom: 0.8rem;
}

.priority-list div:last-child,
.tech-row:last-child,
.alert-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.priority-list strong,
.priority-list span,
.tech-row strong,
.tech-row small,
.alert-row strong,
.alert-row span {
    display: block;
}

.live-map-panel {
    min-height: 360px;
}

.live-map-panel.compact {
    min-height: 320px;
}

.leaflet-map {
    border: 1px solid #d0e0ea;
    border-radius: 8px;
    height: 310px;
    overflow: hidden;
    position: relative;
    width: 100%;
    z-index: 0;
}

.leaflet-map.compact {
    height: 240px;
}

.leaflet-container {
    isolation: isolate;
    z-index: 0;
}

.leaflet-tech-marker span,
.leaflet-job-marker span {
    border: 3px solid #ffffff;
    border-radius: 50%;
    display: block;
    height: 22px;
    width: 22px;
}

.leaflet-tech-marker span {
    background: var(--info);
    box-shadow: 0 0 0 5px rgba(40, 37, 37, 0.16);
}

.leaflet-job-marker span {
    background: var(--warning);
    box-shadow: 0 0 0 5px rgba(209, 122, 0, 0.2);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 21px;
    text-align: center;
}

.leaflet-job-marker.risk-none span {
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(35, 122, 75, 0.18);
}

.leaflet-job-marker.risk-low span {
    background: var(--info);
    box-shadow: 0 0 0 5px rgba(31, 111, 178, 0.18);
}

.leaflet-job-marker.risk-high span,
.leaflet-job-marker.risk-critical span {
    background: var(--critical);
    box-shadow: 0 0 0 5px rgba(198, 40, 40, 0.18);
}

.service-orbit {
    align-items: center;
    display: grid;
    gap: 0.7rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.service-core {
    align-items: center;
    background: linear-gradient(135deg, var(--brand-red), #a80016);
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    font-size: 0.9rem;
    font-weight: 800;
    grid-row: span 3;
    height: 168px;
    justify-content: center;
    line-height: 1.25;
    text-align: center;
    width: 168px;
}

.service-orbit span {
    background: #d0e0ea;
    border-radius: 8px;
    color: var(--neutral-strong);
    font-size: 0.84rem;
    font-weight: 800;
    padding: 0.75rem;
}

.dispatch-main,
.dispatch-side {
    min-width: 0;
}

.dispatch-side {
    display: grid;
    gap: 1rem;
}

.section-title span {
    color: #64727a;
    font-size: 0.9rem;
}

.kanban-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(5, minmax(235px, 1fr));
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.kanban-column {
    min-height: 280px;
    padding: 0.75rem;
    transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.kanban-column.drag-over {
    background: #eef7fb;
    border-color: var(--info);
    box-shadow: inset 0 0 0 2px rgba(31, 111, 178, 0.18);
}

.kanban-column.drop-ready {
    border-color: rgba(31, 111, 178, 0.35);
}

.kanban-column h3 {
    align-items: center;
    color: #3d4a42;
    display: flex;
    font-size: 0.92rem;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.work-card {
    box-shadow: none;
    cursor: grab;
    margin-bottom: 0.75rem;
    padding: 0.85rem;
    touch-action: none;
    transition: opacity 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.work-card:active {
    cursor: grabbing;
}

.work-card.dragging {
    cursor: grabbing;
    opacity: 0.55;
    transform: rotate(1deg) scale(0.99);
}

body.dispatch-dragging {
    cursor: grabbing;
    user-select: none;
}

.dispatch-drag-ghost {
    box-shadow: 0 18px 44px rgba(31, 42, 46, 0.24);
    max-width: 280px;
    opacity: 0.94;
    pointer-events: none;
    position: fixed;
    transform: translate(-50%, -20px) rotate(1deg);
    width: min(280px, calc(100vw - 32px));
    z-index: 4000;
}

.lane-empty {
    align-items: center;
    border: 1px dashed #cfd8dc;
    border-radius: 8px;
    color: var(--neutral);
    display: flex;
    font-size: 0.85rem;
    min-height: 96px;
    padding: 0.8rem;
    text-align: center;
}

.work-card:last-child {
    margin-bottom: 0;
}

.work-card-top span {
    background: var(--info-soft);
    border-radius: 999px;
    color: var(--info);
    font-size: 0.76rem;
    font-weight: 800;
    padding: 0.25rem 0.55rem;
}

.work-card h4 {
    font-size: 1rem;
    margin: 0.7rem 0 0.2rem;
}

.work-card p,
.work-card small,
.work-meta {
    color: #64727a;
    font-size: 0.85rem;
}

.work-meta {
    display: grid;
    gap: 0.25rem;
    margin: 0.6rem 0;
}

.risk-high,
.risk-critical {
    border-left: 4px solid var(--critical);
}

.risk-medium {
    border-left: 4px solid var(--warning);
}

.risk-low {
    border-left: 4px solid var(--info);
}

.risk-none {
    border-left: 4px solid var(--success);
}

.tech-row {
    align-items: flex-start;
    display: flex;
    gap: 0.65rem;
}

.status-dot {
    background: #8b938d;
    border-radius: 50%;
    flex: 0 0 auto;
    height: 10px;
    margin-top: 0.35rem;
    width: 10px;
}

.status-dot.available {
    background: var(--success);
}

.status-dot.busy {
    background: var(--warning);
}

.table-shell {
    overflow-x: auto;
}

.ops-table {
    border-collapse: collapse;
    min-width: 900px;
    width: 100%;
}

.ops-table th,
.ops-table td {
    border-bottom: 1px solid #edf1ed;
    padding: 0.85rem 1rem;
    text-align: left;
    vertical-align: top;
}

.ops-table th {
    background: #f8faf8;
    color: #4d5558;
    font-size: 0.78rem;
    text-transform: uppercase;
}

.project-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card {
    padding: 1rem;
}

.progress-track {
    background: #edf1ed;
    border-radius: 999px;
    height: 10px;
    margin: 1rem 0;
    overflow: hidden;
}

.progress-track span {
    background: linear-gradient(90deg, var(--success), var(--info));
    display: block;
    height: 100%;
}

.project-stats {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.project-stats div {
    background: #f8faf8;
    border-radius: 6px;
    padding: 0.65rem;
}

.project-stats strong,
.project-stats span {
    display: block;
}

.project-stats span,
.project-card footer {
    color: #64727a;
    font-size: 0.82rem;
}

.command-metrics {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.command-metrics div,
.form-panel,
.queue-card,
.mobile-job-card,
.success-banner {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(40, 37, 37, 0.06);
}

.command-metrics div {
    border-top: 4px solid var(--info);
    padding: 0.9rem;
}

.command-metrics div:nth-child(2),
.command-metrics div:nth-child(5),
.command-metrics div:nth-child(6) {
    border-top-color: var(--warning);
}

.command-metrics div:nth-child(3),
.command-metrics div:nth-child(4),
.command-metrics div:nth-child(8) {
    border-top-color: var(--success);
}

.command-metrics div:nth-child(7) {
    border-top-color: var(--brand-red);
}

.command-metrics strong,
.command-metrics span {
    display: block;
}

.command-metrics strong {
    font-size: 1.65rem;
}

.command-metrics span {
    color: #64727a;
    font-size: 0.78rem;
}

.command-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
}

.command-main,
.command-side {
    min-width: 0;
}

.command-side,
.queue-list,
.compact-list,
.mobile-job-grid {
    display: grid;
    gap: 0.8rem;
}

.queue-card,
.mobile-job-card {
    padding: 0.85rem;
}

.queue-card h3,
.mobile-job-card h2 {
    font-size: 1rem;
    margin: 0.7rem 0 0.25rem;
}

.queue-meta {
    color: #64727a;
    display: grid;
    font-size: 0.84rem;
    gap: 0.25rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0.75rem 0;
}

.next-action {
    background: var(--warning-soft);
    border-radius: 8px;
    color: #8a4b00;
    font-weight: 800;
    margin: 0.75rem 0;
    padding: 0.7rem;
}

.queue-actions,
.mobile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.selector-pills,
.job-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.selector-pills {
    margin-bottom: 0.85rem;
}

.chip-button {
    background: #ffffff;
    border: 1px solid #d7dcde;
    border-radius: 999px;
    color: #42515a;
    font-weight: 700;
    padding: 0.45rem 0.9rem;
}

.chip-button.active {
    background: rgba(31, 111, 178, 0.10);
    border-color: rgba(31, 111, 178, 0.30);
    color: var(--info);
}

.technician-mobile-layout {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(280px, 0.35fr) minmax(0, 0.65fr);
}

.mobile-job-list,
.technician-workspace,
.completion-form {
    display: grid;
    gap: 0.85rem;
}

.mobile-job-card {
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mobile-job-card.selected {
    border-color: var(--info);
    box-shadow: 0 14px 32px rgba(31, 111, 178, 0.14);
    transform: translateY(-1px);
}

.mobile-actions.prominent .ops-button {
    min-height: 42px;
    min-width: 120px;
}

.location-readout {
    background: #f4f8fa;
    border: 1px solid #d9e7ed;
    border-radius: 6px;
    color: #405057;
    font-size: 0.86rem;
    font-weight: 800;
    margin-top: 0.7rem;
    padding: 0.65rem 0.75rem;
}

.detail-summary-grid,
.inline-form-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-note-callout {
    background: #f8faf8;
    border: 1px solid #d7dcde;
    border-radius: 8px;
    margin-top: 0.85rem;
    padding: 0.8rem 0.9rem;
}

.detail-note-callout p,
.detail-note-callout small {
    margin: 0.35rem 0 0;
}

.checkbox-row {
    align-items: center;
    display: flex;
    gap: 0.55rem;
    min-height: 44px;
}

.empty-state p {
    color: #64727a;
    margin: 0.35rem 0 0;
}

.photo-preview-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.photo-preview-grid img {
    aspect-ratio: 1;
    border: 1px solid #d7dcde;
    border-radius: 6px;
    object-fit: cover;
    width: 100%;
}

.signature-panel {
    background: #f8faf8;
    border: 1px solid #d7dcde;
    border-radius: 8px;
    padding: 0.75rem;
}

.signature-panel h3 {
    font-size: 0.95rem;
    margin: 0;
}

.signature-canvas {
    background: #ffffff;
    border: 1px dashed #9aa9ae;
    border-radius: 6px;
    display: block;
    height: 190px;
    touch-action: none;
    width: 100%;
}

.ops-button {
    align-items: center;
    background: var(--brand-red);
    border: 1px solid var(--brand-red);
    border-radius: 6px;
    color: #ffffff;
    display: inline-flex;
    gap: 0.4rem;
    font-weight: 800;
    justify-content: center;
    padding: 0.55rem 0.8rem;
    text-decoration: none;
}

.ops-button.secondary {
    background: #ffffff;
    color: var(--brand-red);
}

.disabled-link {
    opacity: 0.5;
    pointer-events: none;
}

.ops-icon {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
}

.executive-hero {
    align-items: stretch;
    background:
        radial-gradient(circle at 78% 20%, rgba(208, 224, 234, 0.7), transparent 26%),
        linear-gradient(135deg, #ffffff 0%, #f8fbfc 58%, #fff4f5 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(40, 37, 37, 0.06);
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    margin-bottom: 1rem;
    padding: 1rem;
}

.executive-hero-copy h2 {
    font-size: 1.65rem;
    font-weight: 900;
    margin-bottom: 0.55rem;
}

.executive-hero-copy p:not(.eyebrow) {
    color: var(--neutral);
    max-width: 780px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.health-score-card {
    border-left: 6px solid var(--info);
    border-radius: 8px;
    color: #ffffff;
    display: grid;
    min-height: 190px;
    padding: 1rem;
}

.health-score-card.tone-success {
    background: linear-gradient(135deg, var(--success), #155f37);
    border-left-color: #9be7b5;
}

.health-score-card.tone-warning {
    background: linear-gradient(135deg, var(--warning), #9b5200);
    border-left-color: #ffe0a8;
}

.health-score-card.tone-danger {
    background: linear-gradient(135deg, var(--critical), #8f1616);
    border-left-color: #ffb9b9;
}

.health-score-card span,
.health-score-card strong,
.health-score-card small {
    display: block;
}

.health-score-card strong {
    font-size: 2.8rem;
    line-height: 1;
}

.health-score-card small {
    align-self: end;
    opacity: 0.9;
}

.executive-metric-grid,
.executive-dashboard-grid,
.executive-section-grid {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.executive-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.executive-dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.executive-section-grid {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
}

.executive-metric-card,
.mini-metric-card,
.executive-alert-card {
    color: inherit;
    text-decoration: none;
}

.executive-metric-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-top: 5px solid var(--info);
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(40, 37, 37, 0.06);
    display: grid;
    gap: 0.35rem;
    padding: 0.85rem;
}

.executive-metric-card.tone-success,
.mini-metric-card.tone-success {
    border-top-color: var(--success);
}

.executive-metric-card.tone-warning,
.mini-metric-card.tone-warning {
    border-top-color: var(--warning);
}

.executive-metric-card.tone-danger,
.mini-metric-card.tone-danger {
    border-top-color: var(--critical);
}

.executive-metric-card.tone-muted,
.mini-metric-card.tone-muted {
    border-top-color: #8b938d;
}

.metric-icon,
.job-type-icon {
    align-items: center;
    background: var(--info-soft);
    border-radius: 8px;
    color: var(--info);
    display: inline-flex;
    justify-content: center;
}

.metric-icon {
    height: 2.45rem;
    width: 2.45rem;
}

.job-type-icon {
    height: 2rem;
    width: 2rem;
}

.job-type-icon.small {
    height: 1.7rem;
    width: 1.7rem;
}

.executive-metric-card strong {
    font-size: 1.45rem;
    line-height: 1;
}

.executive-metric-card span:not(.metric-icon),
.mini-metric-card span,
.executive-metric-card small,
.executive-alert-card span,
.executive-alert-card small {
    color: var(--neutral);
}

.executive-chart {
    min-width: 0;
}

.executive-alert-list {
    display: grid;
    gap: 0.75rem;
}

.executive-alert-card {
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid var(--line);
    border-left: 5px solid var(--info);
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 0.85rem;
}

.executive-alert-card strong,
.executive-alert-card span,
.executive-alert-card small {
    display: block;
}

.executive-alert-card small {
    font-weight: 800;
    margin-top: 0.35rem;
}

.mini-metric-grid {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-metric-card {
    align-items: center;
    background: #f8faf8;
    border: 1px solid #edf1ed;
    border-top: 4px solid var(--info);
    border-radius: 8px;
    display: grid;
    gap: 0.3rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0.75rem;
}

.mini-metric-card strong {
    font-size: 1.25rem;
}

.project-risk-strip {
    border-top: 1px solid #edf1ed;
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
}

.project-risk-strip a {
    align-items: center;
    color: var(--neutral-strong);
    display: flex;
    gap: 0.5rem;
    text-decoration: none;
}

.job-card-title {
    align-items: center;
    display: flex;
    gap: 0.55rem;
    min-width: 0;
}

.ops-button:disabled,
.icon-close:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.modal-backdrop-panel {
    align-items: center;
    background: rgba(16, 24, 28, 0.58);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 10000;
}

.automation-modal {
    background: #ffffff;
    border: 1px solid #dfe5e2;
    border-radius: 8px;
    box-shadow: 0 22px 70px rgba(16, 24, 28, 0.22);
    display: grid;
    gap: 1rem;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: calc(100dvh - 2rem);
    max-width: 920px;
    overflow: hidden;
    padding: 1rem;
    position: relative;
    width: min(920px, 100%);
    z-index: 10001;
}

.dispatch-action-modal {
    background: #ffffff;
    border: 1px solid #dfe5e2;
    border-radius: 8px;
    box-shadow: 0 22px 70px rgba(16, 24, 28, 0.22);
    display: grid;
    gap: 1rem;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: calc(100dvh - 2rem);
    max-width: 980px;
    overflow: hidden;
    padding: 1rem;
    position: relative;
    width: min(980px, 100%);
    z-index: 10001;
}

.dispatch-action-modal header,
.dispatch-action-modal footer {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.dispatch-action-modal header {
    border-bottom: 1px solid #edf1ed;
    padding-bottom: 0.85rem;
}

.dispatch-action-modal header span {
    color: var(--neutral);
    display: block;
    font-size: 0.85rem;
}

.dispatch-action-modal footer {
    border-top: 1px solid #edf1ed;
    padding-top: 0.85rem;
}

.dispatch-action-body {
    display: grid;
    gap: 1rem;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.action-step-panel {
    background: #f8faf8;
    border: 1px solid #edf1ed;
    border-radius: 8px;
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
}

.action-step-panel h3 {
    font-size: 1rem;
    margin: 0;
}

.slot-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.slot-card,
.technician-pick-card {
    background: #ffffff;
    border: 1px solid #dfe5e2;
    border-radius: 8px;
    color: inherit;
    padding: 0.8rem;
    text-align: left;
}

.slot-card.selected,
.technician-pick-card.selected {
    border-color: var(--info);
    box-shadow: 0 0 0 3px rgba(31, 111, 178, 0.12);
}

.slot-card strong,
.slot-card span,
.slot-card small {
    display: block;
}

.slot-card span,
.slot-card small {
    color: var(--neutral);
    font-size: 0.83rem;
}

.technician-pick-list {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.technician-pick-card {
    align-items: center;
    display: grid;
    gap: 0.7rem;
    grid-template-columns: auto minmax(0, 1fr);
}

.tech-avatar {
    align-items: center;
    background: var(--info-soft);
    border-radius: 50%;
    color: var(--info);
    display: inline-flex;
    font-weight: 900;
    height: 2.4rem;
    justify-content: center;
    width: 2.4rem;
}

.technician-pick-card strong,
.technician-pick-card span,
.technician-pick-card small {
    display: block;
}

.technician-pick-card span {
    color: var(--neutral);
    font-size: 0.84rem;
}

.tone-text-success {
    color: var(--success);
}

.tone-text-warning {
    color: var(--warning);
}

.tone-text-muted {
    color: var(--neutral);
}

.modal-field {
    color: #4d5558;
    display: grid;
    font-size: 0.82rem;
    font-weight: 800;
    gap: 0.35rem;
}

.modal-field input,
.modal-field select,
.modal-field textarea {
    border: 1px solid #d7dcde;
    border-radius: 6px;
    font: inherit;
    padding: 0.65rem 0.75rem;
}

.form-grid.two {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-field textarea {
    min-height: 110px;
}

.automation-modal header,
.automation-modal footer {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.automation-modal header {
    border-bottom: 1px solid #edf1ed;
    padding-bottom: 0.85rem;
}

.automation-modal footer {
    border-top: 1px solid #edf1ed;
    padding-top: 0.85rem;
}

.automation-modal h2 {
    margin: 0.15rem 0 0;
}

.icon-close {
    align-items: center;
    background: #f4f7f5;
    border: 1px solid #dfe5e2;
    border-radius: 999px;
    color: #1f2a2e;
    display: inline-flex;
    font-size: 1rem;
    font-weight: 900;
    height: 2rem;
    justify-content: center;
    line-height: 1;
    width: 2rem;
}

.modal-copy {
    color: #526067;
    margin: 0;
}

.automation-modal-body {
    display: grid;
    gap: 1rem;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.automation-action-list {
    display: grid;
    gap: 0.75rem;
    min-height: 0;
}

.automation-batch-list {
    display: grid;
    gap: 1rem;
}

.automation-batch-card {
    background: #ffffff;
    border: 1px solid #dfe5e2;
    border-radius: 8px;
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
}

.automation-batch-card.level-low {
    border-top: 4px solid var(--success);
}

.automation-batch-card.level-medium {
    border-top: 4px solid var(--warning);
}

.automation-batch-card.level-high {
    border-top: 4px solid var(--critical);
}

.automation-batch-card > header {
    border: 0;
    padding: 0;
}

.automation-batch-card > p {
    color: #526067;
    margin: 0;
}

.automation-batch-toggle,
.automation-action-toggle {
    align-items: start;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: auto minmax(0, 1fr);
    margin: 0;
}

.automation-batch-toggle input,
.automation-action-toggle input {
    accent-color: var(--info);
    height: 1.05rem;
    margin-top: 0.2rem;
    width: 1.05rem;
}

.automation-batch-toggle strong,
.automation-batch-toggle small,
.automation-action-toggle strong,
.automation-action-toggle small {
    display: block;
}

.automation-batch-toggle small,
.automation-action-toggle small {
    color: #64727a;
    font-size: 0.82rem;
}

.automation-level-pill {
    border: 1px solid #dfe5e2;
    border-radius: 999px;
    color: var(--neutral-strong);
    font-size: 0.78rem;
    font-weight: 900;
    padding: 0.25rem 0.6rem;
}

.automation-action-card {
    border: 1px solid #dfe5e2;
    border-left: 5px solid var(--info);
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    padding: 0.9rem;
}

.automation-action-card.selected {
    box-shadow: 0 0 0 3px rgba(31, 111, 178, 0.12);
}

.automation-action-card.risk-medium {
    background: var(--warning-soft);
    border-left-color: var(--warning);
}

.automation-action-card.risk-high,
.automation-action-card.risk-critical {
    background: var(--critical-soft);
    border-left-color: var(--critical);
}

.automation-action-card.risk-low {
    background: var(--info-soft);
    border-left-color: var(--info);
}

.automation-action-card.risk-none {
    background: var(--success-soft);
    border-left-color: var(--success);
}

.automation-action-card div:first-child {
    align-items: start;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.automation-action-card strong,
.automation-action-card span {
    display: block;
}

.automation-action-card p {
    color: #263238;
    margin: 0;
}

.automation-action-card div:first-child span,
.automation-impact span,
.empty-automation span {
    color: #64727a;
    font-size: 0.82rem;
}

.automation-impact {
    background: #f7faf8;
    border: 1px solid #edf1ed;
    border-radius: 8px;
    padding: 0.7rem;
}

.automation-impact strong {
    color: #1f2a2e;
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.automation-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.automation-badges span {
    background: #ffffff;
    border: 1px solid #dfe5e2;
    border-radius: 999px;
    color: var(--neutral-strong);
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.25rem 0.55rem;
}

.empty-automation {
    background: #f7faf8;
    border: 1px solid #dfe5e2;
    border-radius: 8px;
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
}

.empty-automation.compact {
    padding: 0.75rem;
}

.automation-result-panel {
    background: var(--success-soft);
    border: 1px solid rgba(35, 122, 75, 0.22);
    border-radius: 8px;
    display: grid;
    gap: 0.35rem;
    padding: 0.9rem;
}

.automation-result-panel span {
    color: #3d4a42;
    font-size: 0.86rem;
}

.compact-list div {
    border-bottom: 1px solid #edf1ed;
    padding-bottom: 0.75rem;
}

.compact-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.compact-list strong,
.compact-list span {
    display: block;
}

.compact-list span {
    color: #64727a;
    font-size: 0.82rem;
}

.needs-human {
    border-left: 4px solid var(--critical);
    padding-left: 0.7rem;
}

.success-banner {
    background: #f0fbf4;
    border-color: #bde5c8;
    color: #226b3b;
    font-weight: 800;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
}

.form-panel {
    display: grid;
    gap: 0.65rem;
    max-width: 820px;
    padding: 1rem;
}

.form-panel label {
    color: #4d5558;
    font-size: 0.82rem;
    font-weight: 800;
}

.form-panel input,
.form-panel select,
.form-panel textarea {
    border: 1px solid #d7dcde;
    border-radius: 6px;
    font: inherit;
    padding: 0.65rem 0.75rem;
}

.form-panel textarea {
    min-height: 130px;
}

.mobile-job-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mobile-job-card p,
.mobile-job-card small {
    color: #64727a;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #b32121;
    color: white;
    padding: 1rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.vip-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    border: 1px solid rgba(180, 83, 9, .28);
    border-radius: 999px;
    padding: .15rem .45rem;
    background: #fff7ed;
    color: #92400e;
    font-size: .72rem;
    font-weight: 800;
    vertical-align: middle;
}

.crm-layout,
.project-workspace {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.crm-list,
.stack-list,
.timeline-list {
    display: grid;
    gap: .75rem;
}

.crm-list-card,
.project-select-card {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 8px;
    background: #fff;
    padding: .9rem;
    text-align: left;
    color: inherit;
    display: grid;
    gap: .45rem;
    cursor: pointer;
}

.crm-list-card:hover,
.project-select-card:hover,
.crm-list-card.active,
.project-select-card.active {
    border-color: rgba(14, 116, 144, .4);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
}

.crm-card-main,
.crm-card-side,
.project-signal-row,
.record-actions,
.boq-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
}

.crm-card-main {
    align-items: flex-start;
    flex-direction: column;
}

.tag-row {
    color: #64748b;
    font-size: .8rem;
}

.ops-input {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 8px;
    padding: .75rem .85rem;
    margin-bottom: .8rem;
    background: #fff;
}

.health-chip,
.soft-chip,
.risk-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .22rem .55rem;
    font-size: .75rem;
    font-weight: 800;
    background: #f1f5f9;
    color: #334155;
}

.health-chip.healthy,
.success-text {
    color: #047857;
}

.health-chip.watch {
    color: #0369a1;
}

.health-chip.atrisk,
.health-chip.at-risk {
    color: #b45309;
}

.health-chip.critical,
.danger-text {
    color: #b91c1c;
}

.crm-hero,
.project-hero {
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.crm-hero h2,
.project-hero h2 {
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    margin: 0;
}

.crm-actions,
.chip-row,
.crm-segmented {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.crm-segmented {
    margin-bottom: .75rem;
}

.crm-segmented button {
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-weight: 800;
    padding: .45rem .75rem;
}

.crm-segmented button.active {
    background: #0e7490;
    border-color: #0e7490;
    color: #fff;
}

.crm-detail-grid,
.b2b-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.ops-panel.wide {
    grid-column: 1 / -1;
}

.mini-record,
.project-mini-card,
.bundle-card,
.proposal-card {
    border: 1px solid rgba(15, 23, 42, .09);
    border-radius: 8px;
    background: #fff;
    padding: .7rem;
    display: grid;
    gap: .4rem;
}

.mini-record {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.mini-record small,
.mini-record span,
.project-mini-card small,
.bundle-card small,
.proposal-card span {
    display: block;
    color: #64748b;
}

.review-record.overdue {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}

.review-catchup-shell {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.review-type-guide,
.review-card-grid {
    display: grid;
    gap: .75rem;
}

.review-type-card,
.review-catchup-card,
.review-success-box {
    border: 1px solid rgba(15, 23, 42, .09);
    border-radius: 8px;
    background: #fff;
    padding: .85rem;
}

.review-type-card {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
}

.review-type-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #0e7490;
    background: #ecfeff;
    flex: 0 0 auto;
}

.review-type-card strong,
.review-success-box strong,
.review-success-box span {
    display: block;
}

.review-type-card small,
.review-success-box span,
.review-question,
.review-card-meta,
.review-catchup-card small {
    color: #64748b;
}

.review-card-grid {
    grid-template-columns: 1fr;
}

.review-catchup-card {
    display: grid;
    gap: .65rem;
    border-left: 5px solid #0e7490;
    text-align: left;
}

.review-catchup-card.risk-none {
    border-left-color: #047857;
}

.review-catchup-card.risk-medium {
    border-left-color: #d17a00;
}

.review-catchup-card.risk-high,
.review-catchup-card.risk-critical {
    border-left-color: #c62828;
}

.review-question {
    border-radius: 8px;
    background: #f8fafc;
    padding: .65rem;
    font-weight: 700;
}

.review-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    font-size: .82rem;
    font-weight: 800;
}

.review-success-box {
    background: #f0fdf4;
    border-color: rgba(4, 120, 87, .18);
    margin: .75rem 0;
}

.empty-state-panel {
    min-height: 360px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: .75rem;
    text-align: center;
    color: #64748b;
}

.ui-error-panel {
    max-width: 760px;
    margin: 2rem auto;
    border-left: 6px solid #c62828;
}

.ui-error-panel details {
    margin-top: 1rem;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 8px;
    padding: .75rem;
    background: #f8fafc;
}

.ui-error-panel pre {
    white-space: pre-wrap;
    margin: .75rem 0 0;
    color: #334155;
}

.intake-shell,
.workorder-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 1rem;
    align-items: start;
}

.workorder-workspace {
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
}

@media (min-width: 1101px) {
    .content:has(.workorders-page-shell) {
        height: calc(100dvh - 3.15rem);
        overflow: hidden;
        padding-bottom: 1rem;
        padding-top: 1rem;
    }

    .workorders-page-shell {
        gap: 0.75rem;
        grid-template-rows: auto minmax(0, 1fr);
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .workorders-page-shell > .ui-workspace {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        min-height: 0;
        overflow: hidden;
    }

    .workorders-page-shell .module-header {
        margin-bottom: 0;
    }

    .workorders-page-shell .filter-bar {
        margin-bottom: 0;
    }

    .workorders-page-shell .workorder-workspace {
        align-items: stretch;
        height: auto;
        min-height: 0;
        overflow: hidden;
    }

    .workorders-page-shell .project-browser,
    .workorders-page-shell .project-detail {
        min-height: 0;
    }

    .workorders-page-shell .project-browser {
        align-content: start;
        display: grid;
        gap: 0.35rem;
        height: 100%;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0 0.55rem 1rem 0;
        scrollbar-gutter: stable;
    }

    .workorders-page-shell .project-browser .section-title {
        background: var(--page-bg);
        margin: 0;
        padding: 0.1rem 0 0.5rem;
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .workorders-page-shell .project-detail {
        height: 100%;
        overflow: hidden;
    }

    .workorders-page-shell .project-detail > .detail-drawer,
    .workorders-page-shell .project-detail > .loading-panel {
        height: 100%;
    }

    .workorders-page-shell .project-detail .detail-drawer-body {
        overscroll-behavior: contain;
    }

    .content:has(.projects-page-workspace),
    .content:has(.crm-page-workspace),
    .content:has(.command-center-page-shell) {
        display: grid;
        gap: 0.75rem;
        grid-template-rows: auto minmax(0, 1fr);
        height: calc(100dvh - 3.15rem);
        overflow: hidden;
        padding-bottom: 1rem;
        padding-top: 1rem;
    }

    .content:has(.project-reviews-page-workspace) {
        display: grid;
        gap: 0.75rem;
        grid-template-rows: auto auto minmax(0, 1fr);
        height: calc(100dvh - 3.15rem);
        overflow: hidden;
        padding-bottom: 1rem;
        padding-top: 1rem;
    }

    .content:has(.command-center-page-shell) {
        grid-template-rows: minmax(0, 1fr);
    }

    .projects-page-workspace,
    .crm-page-workspace,
    .project-reviews-page-workspace,
    .command-center-page-shell,
    .command-center-page-shell > .ui-workspace,
    .command-center-page-shell .streamlined-ops-layout {
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .projects-page-workspace,
    .crm-page-workspace,
    .project-reviews-page-workspace,
    .command-center-page-shell .streamlined-ops-layout {
        align-items: stretch;
    }

    .command-center-page-shell {
        grid-template-rows: auto auto minmax(0, 1fr);
    }

    .command-center-page-shell > .ui-workspace {
        display: flex;
        flex-direction: column;
    }

    .command-center-page-shell .filter-bar,
    .command-center-page-shell .success-banner {
        flex: 0 0 auto;
        margin-bottom: 0.75rem;
    }

    .command-center-page-shell .streamlined-ops-layout {
        flex: 1 1 auto;
    }

    .projects-page-workspace .project-browser,
    .projects-page-workspace .project-detail,
    .crm-page-workspace .crm-list-panel,
    .crm-page-workspace .crm-profile-panel,
    .project-reviews-page-workspace .review-board-panel,
    .project-reviews-page-workspace .review-capture-panel,
    .command-center-page-shell .command-main,
    .command-center-page-shell .detail-drawer {
        height: 100%;
        min-height: 0;
    }

    .projects-page-workspace .project-browser,
    .projects-page-workspace .project-detail,
    .crm-page-workspace .crm-profile-panel,
    .project-reviews-page-workspace .review-board-panel,
    .project-reviews-page-workspace .review-capture-panel {
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }

    .projects-page-workspace .project-browser {
        align-content: start;
        display: grid;
        gap: 0.75rem;
        padding: 0 0.55rem 1rem 0;
    }

    .projects-page-workspace .project-browser .section-title,
    .crm-page-workspace .crm-list-panel .section-title,
    .project-reviews-page-workspace .review-board-panel .panel-heading {
        background: var(--page-bg);
        margin: 0;
        padding: 0.1rem 0 0.5rem;
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .crm-page-workspace .crm-list-panel {
        display: grid;
        grid-template-rows: auto auto auto minmax(0, 1fr);
        overflow: hidden;
    }

    .crm-page-workspace .crm-list {
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0 0.55rem 1rem 0;
        scrollbar-gutter: stable;
    }

    .command-center-page-shell .command-main {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        overflow: hidden;
    }

    .command-center-page-shell .command-main .section-title {
        background: var(--page-bg);
        margin: 0;
        padding: 0.1rem 0 0.5rem;
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .command-center-page-shell .streamlined-list {
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0 0.55rem 1rem 0;
        scrollbar-gutter: stable;
    }

    .project-reviews-page-workspace .review-board-panel {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        overflow: hidden;
    }

    .project-reviews-page-workspace .review-card-grid {
        align-content: start;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0 0.55rem 1rem 0;
        scrollbar-gutter: stable;
    }

    .command-center-page-shell .detail-drawer-body,
    .projects-page-workspace .project-detail,
    .crm-page-workspace .crm-profile-panel,
    .project-reviews-page-workspace .review-capture-panel {
        padding-bottom: 1rem;
    }
}

.intake-form-panel,
.intake-summary-panel {
    min-width: 0;
}

.wide-field {
    grid-column: 1 / -1;
}

.toggle-line {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-height: 44px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--bg-card-elevated);
    padding: .65rem .75rem;
    font-weight: 800;
    color: var(--text-primary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.toggle-line input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.intake-fast-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
    gap: 1rem;
    align-items: start;
}

.ui-workspace.intake-mvp-shell {
    display: block;
}

.intake-mvp-grid {
    display: grid;
    gap: 1rem;
}

.intake-quick-form {
    display: block;
}

.intake-cockpit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(340px, 24vw, 430px);
    gap: .9rem;
    align-items: start;
}

.intake-main-column,
.intake-summary-panel {
    min-width: 0;
}

.intake-main-column {
    display: grid;
    gap: .85rem;
}

.intake-summary-panel {
    position: sticky;
    top: 5.5rem;
    display: grid;
    gap: .8rem;
    padding: .85rem;
    align-self: start;
    background: var(--bg-card-elevated);
}

.intake-section-card,
.intake-subsection-panel {
    display: grid;
    gap: .75rem;
    padding: .85rem;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: var(--bg-card);
    box-shadow: var(--panel-shadow);
}

.intake-subsection-panel {
    padding: .8rem;
}

.intake-section-head,
.intake-subsection-head {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: .65rem;
    padding-bottom: 0;
}

.intake-section-head h2,
.intake-subsection-head h3 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.15;
}

.intake-section-head .eyebrow,
.intake-subsection-head .eyebrow {
    margin: 0 0 .12rem;
}

.intake-customer-grid,
.intake-job-grid,
.intake-attachments-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .72rem;
    align-items: start;
}

.intake-country-field,
.intake-phone-field,
.intake-category-field {
    grid-column: span 2;
}

.intake-name-field,
.intake-status-field {
    grid-column: span 3;
}

.intake-full-span,
.intake-location-note-field {
    grid-column: 1 / -1;
}

.intake-phone-field {
    position: relative;
}

.intake-customer-suggestions {
    position: absolute;
    top: calc(100% + .35rem);
    left: 0;
    right: 0;
    z-index: 30;
    display: grid;
    gap: .35rem;
    padding: .45rem;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: color-mix(in srgb, var(--bg-card) 96%, white 4%);
    box-shadow: 0 20px 40px rgba(15, 23, 42, .12);
}

.intake-customer-suggestion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .75rem .85rem;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--bg-card-elevated);
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.intake-customer-suggestion:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent-primary) 35%, transparent 65%);
    background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-card-elevated) 92%);
}

.intake-customer-suggestion-name {
    font-weight: 800;
}

.intake-customer-suggestion-phone {
    color: var(--ops-text-muted);
    font-size: .88rem;
    font-variant-numeric: tabular-nums;
}

.intake-customer-status {
    display: grid;
    align-content: center;
    min-height: 60px;
    padding: .65rem .8rem;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: var(--bg-card-elevated);
}

.intake-customer-status.idle {
    border-color: var(--border-soft);
    background: var(--bg-card-elevated);
}

.intake-customer-status.searching {
    border-color: color-mix(in srgb, var(--border-strong) 80%, transparent 20%);
    background: color-mix(in srgb, var(--bg-card-elevated) 88%, var(--bg-input) 12%);
}

.intake-customer-status.found {
    border-color: color-mix(in srgb, var(--accent-info) 30%, transparent 70%);
    background: color-mix(in srgb, var(--info-soft) 28%, var(--bg-card-elevated) 72%);
}

.intake-customer-status.missing {
    border-color: color-mix(in srgb, var(--accent-warning) 34%, transparent 66%);
    background: color-mix(in srgb, var(--warning-soft) 28%, var(--bg-card-elevated) 72%);
}

.intake-customer-status-copy {
    display: grid;
    gap: .18rem;
}

.intake-customer-status-copy strong,
.intake-customer-status-copy p,
.intake-customer-status-copy small {
    margin: 0;
}

.intake-customer-status-copy strong {
    color: var(--text-primary);
}

.intake-customer-status-copy p {
    color: var(--text-primary);
    font-weight: 700;
}

.intake-customer-status-copy small {
    color: var(--text-secondary);
    line-height: 1.35;
}

.intake-inline-toggle {
    min-height: 44px;
    align-self: stretch;
    display: flex;
    align-items: center;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: .65rem .8rem;
    background: var(--bg-card-elevated);
}

.intake-inline-toggle:has(input:checked) {
    border-color: color-mix(in srgb, var(--accent-primary) 45%, transparent 55%);
    background: color-mix(in srgb, var(--accent-primary) 10%, var(--bg-card-elevated) 90%);
}

.intake-requirement-grid .intake-inline-toggle:first-child:has(input:checked) {
    border-color: color-mix(in srgb, var(--accent-danger) 46%, transparent 54%);
    background: color-mix(in srgb, var(--danger-soft, #fff1f1) 18%, var(--bg-card-elevated) 82%);
}

.intake-customer-hint {
    margin: 0;
}

.intake-customer-hint.existing {
    border-left: 4px solid var(--info);
}

.intake-customer-hint.new {
    border-left: 4px solid var(--warning);
}

.intake-customer-hint p,
.intake-customer-hint small {
    margin: 0;
}

.intake-priority-field,
.intake-price-field {
    align-self: stretch;
}

.intake-summary-head {
    padding-bottom: .05rem;
}

.intake-requirement-grid {
    display: grid;
    gap: .55rem;
}

.priority-picker {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.priority-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 44px;
    min-width: 0;
    padding: .65rem .9rem;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    background: var(--bg-card-elevated);
    color: var(--text-primary);
    font: inherit;
    font-size: .96rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.priority-choice:hover {
    transform: translateY(-1px);
}

.priority-choice.priority-low {
    color: #0f766e;
    border-color: rgba(45, 212, 191, .24);
    background: rgba(45, 212, 191, .10);
}

.priority-choice.priority-medium {
    color: #1d4ed8;
    border-color: rgba(96, 165, 250, .24);
    background: rgba(96, 165, 250, .10);
}

.priority-choice.priority-high {
    color: #b45309;
    border-color: rgba(251, 191, 36, .28);
    background: rgba(251, 191, 36, .12);
}

.priority-choice.priority-emergency {
    color: #b91c1c;
    border-color: rgba(248, 113, 113, .30);
    background: rgba(248, 113, 113, .11);
}

.priority-choice.selected {
    border-width: 2px;
    box-shadow: 0 0 0 2px rgba(29, 78, 216, .16);
    transform: translateY(-1px);
    font-weight: 800;
}

.priority-choice.selected.priority-low {
    background: #0f3a37;
    border-color: #2dd4bf;
    color: #eafdf8;
}

.priority-choice.selected.priority-medium {
    background: #102a43;
    border-color: #60a5fa;
    color: #eff6ff;
}

.priority-choice.selected.priority-high {
    background: #3a2d0a;
    border-color: #fbbf24;
    color: #fff7dd;
}

.priority-choice.selected.priority-emergency {
    background: #3a1418;
    border-color: #f87171;
    color: #fff1f2;
}

.priority-choice-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .22);
}

.currency-input {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-input);
}

.currency-input span {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding: 0 .85rem;
    background: color-mix(in srgb, var(--bg-card-elevated) 92%, white 8%);
    border-right: 1px solid var(--border-soft);
    color: var(--text-secondary);
    font-size: .82rem;
    font-weight: 800;
}

.currency-input input {
    border: 0;
    border-radius: 0;
    font-variant-numeric: tabular-nums;
}

.intake-photo-strip img {
    max-width: 92px;
    max-height: 92px;
    object-fit: cover;
    border-radius: 10px;
}

.intake-map-wrap {
    display: grid;
    gap: .35rem;
}

.intake-location-map {
    min-height: 340px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
}

.intake-location-map.compact {
    min-height: 210px;
    height: 210px;
}

.intake-location-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    margin: .75rem 0 0;
    color: var(--ops-text-muted);
    font-size: .92rem;
    font-weight: 700;
}

.intake-summary-chip-row {
    margin-bottom: 0;
}

.intake-summary-upload-grid {
    display: grid;
    gap: .65rem;
}

.intake-action-panel {
    gap: .65rem;
}

.intake-summary-actions {
    display: grid;
    gap: .55rem;
    margin-top: 0;
}

.intake-ready-chip-row {
    gap: .35rem;
}

.intake-ready-chip-row .status-chip {
    transform: scale(.96);
    transform-origin: left center;
}

.intake-issue-textarea {
    min-height: 112px;
    resize: vertical;
}

.intake-create-button,
.intake-clear-button {
    width: 100%;
    justify-content: center;
}

.intake-clear-button {
    opacity: .82;
}

.ops-toast-stack {
    position: fixed;
    top: 5.5rem;
    right: 1.5rem;
    z-index: 1600;
    width: min(30rem, calc(100vw - 2rem));
    pointer-events: none;
}

.ops-toast-card {
    pointer-events: auto;
    display: grid;
    gap: .85rem;
    padding: 1rem 1rem 1rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--panel-bg) 94%, white 6%);
    box-shadow: 0 1.2rem 2.8rem rgba(15, 23, 42, 0.16);
}

.ops-toast-card.success {
    border-left: 4px solid var(--success);
    border-color: #d9e4ea;
    background: color-mix(in srgb, #f4f7f9 92%, var(--success-soft) 8%);
}

.ops-toast-card.error {
    border-left: 4px solid var(--danger);
}

.ops-toast-copy {
    display: grid;
    gap: .35rem;
}

.ops-toast-copy strong {
    font-size: .95rem;
    color: var(--heading-color);
}

.ops-toast-copy span {
    color: var(--muted-text);
    line-height: 1.45;
}

.ops-toast-actions {
    margin-top: -.15rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .65rem;
    margin-top: .75rem;
}

.project-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
}

.project-health-score {
    width: 120px;
    height: 120px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    align-content: center;
    background: #ecfeff;
    border: 1px solid rgba(8, 145, 178, .25);
    color: #155e75;
}

.project-health-score strong {
    font-size: 2rem;
}

.boq-summary {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}

.boq-summary span {
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 999px;
    padding: .4rem .65rem;
    font-weight: 800;
}

.proposal-html {
    border-top: 1px solid rgba(15, 23, 42, .1);
    margin-top: .7rem;
    padding-top: .7rem;
    max-height: 220px;
    overflow: auto;
}

.proposal-html.tall {
    max-height: 720px;
}

.project-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: .5rem 0 1rem;
}

.project-tabs button {
    border: 1px solid rgba(15, 23, 42, .12);
    background: #fff;
    color: #334155;
    border-radius: 999px;
    padding: .55rem .85rem;
    font-weight: 800;
}

.project-tabs button.active {
    background: #0e7490;
    color: #fff;
    border-color: #0e7490;
}

.boq-edit-row {
    grid-template-columns: .8fr 1.4fr .55fr .55fr .55fr .55fr .75fr auto;
    align-items: center;
}

.boq-edit-row input,
.catalog-row-button {
    min-width: 0;
}

.boq-edit-row input {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 8px;
    padding: .55rem .6rem;
}

.catalog-row-button,
.acceptance-button {
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.catalog-row-button:hover,
.acceptance-button:hover,
.acceptance-button.active {
    border-color: rgba(14, 116, 144, .35);
    box-shadow: 0 0 0 3px rgba(14, 116, 144, .1);
}

.activity-work-row {
    grid-template-columns: 56px minmax(220px, 1fr) 160px 120px 150px auto;
}

.mini-toggle {
    justify-content: center;
    min-height: 34px;
    padding: .35rem;
}

.secondary-action.danger {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, .35);
    background: #fff5f5;
}

.secondary-action.success {
    color: #047857;
    border-color: rgba(4, 120, 87, .35);
    background: #f0fdf4;
}

.timeline-item {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: .65rem;
    align-items: start;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #0e7490;
    margin-top: .35rem;
    box-shadow: 0 0 0 4px rgba(14, 116, 144, .12);
}

.bundle-card ol {
    margin: .35rem 0 0;
    padding-left: 1rem;
}

.bundle-card li {
    margin: .25rem 0;
}

.bundle-card li span {
    color: #64748b;
}

.template-designer-shell {
    display: grid;
    grid-template-columns: minmax(230px, 280px) minmax(0, 1fr) minmax(300px, 360px);
    gap: 1rem;
    align-items: start;
}

.template-rail,
.template-settings {
    display: grid;
    gap: 1rem;
    position: sticky;
    top: 1rem;
}

.template-list-card,
.template-section-button {
    width: 100%;
    border: 1px solid #dbe5ed;
    background: #fff;
    border-radius: 8px;
    padding: .85rem;
    display: flex;
    gap: .75rem;
    text-align: left;
    align-items: center;
    color: #17212b;
}

.template-list-card.active,
.template-section-button.active {
    border-color: #0e7490;
    box-shadow: 0 0 0 3px rgba(14, 116, 144, .12);
}

.template-color-dot {
    width: 14px;
    height: 44px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.template-section-list {
    display: grid;
    gap: .55rem;
    max-height: 58vh;
    overflow: auto;
    padding-right: .25rem;
}

.template-section-button span:first-child {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #eef3f6;
    font-weight: 800;
    font-size: .72rem;
}

.template-preview-pane {
    min-width: 0;
    display: grid;
    gap: 1rem;
}

.designer-toolbar {
    border: 1px solid #dbe5ed;
    background: #fff;
    border-radius: 8px;
    padding: .85rem;
    display: flex;
    gap: .75rem;
    align-items: end;
    flex-wrap: wrap;
}

.compact-field {
    min-width: min(360px, 100%);
    margin: 0;
}

.proposal-browser-preview {
    border: 1px solid #dbe5ed;
    border-radius: 8px;
    background: #eef3f6;
    max-height: 82vh;
    overflow: auto;
}

.proposal-browser-preview .proposal-document {
    min-height: 900px;
}

.template-logo-preview {
    max-width: 180px;
    max-height: 80px;
    object-fit: contain;
    border: 1px solid #dbe5ed;
    border-radius: 8px;
    background: #fff;
    padding: .5rem;
}

.section-action-row,
.token-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .75rem;
}

.token-cloud button {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 999px;
    padding: .35rem .6rem;
    font-size: .78rem;
    color: #334155;
}

.success {
    background: #0f7a4f;
}

.page-actions {
    display: flex;
    gap: .75rem;
    align-items: center;
    flex-wrap: wrap;
}

.wizard-shell {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(280px, 340px);
    gap: 1rem;
    align-items: start;
}

.wizard-steps,
.wizard-main,
.wizard-summary {
    border: 1px solid #dbe5ed;
    border-radius: 8px;
    background: #fff;
}

.wizard-steps {
    display: grid;
    gap: .45rem;
    padding: .85rem;
    position: sticky;
    top: 1rem;
}

.wizard-step {
    border: 1px solid transparent;
    background: #f8fafc;
    border-radius: 8px;
    color: #17212b;
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: .55rem;
    padding: .75rem;
    text-align: left;
}

.wizard-step span {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #e2e8f0;
    color: #334155;
    font-weight: 800;
}

.wizard-step strong,
.wizard-step small {
    grid-column: 2;
}

.wizard-step small {
    color: #64748b;
}

.wizard-step.active {
    border-color: #0e7490;
    background: #ecfeff;
}

.wizard-step.complete {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.wizard-step.active span {
    background: #0e7490;
    color: #fff;
}

.wizard-step.complete span {
    background: #0f7a4f;
    color: #fff;
}

.wizard-main {
    min-width: 0;
    overflow: hidden;
}

.wizard-panel {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.wizard-panel h2,
.wizard-panel h3 {
    margin: 0;
}

.wizard-subhead {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: center;
    flex-wrap: wrap;
    padding-top: .5rem;
}

.segmented-control {
    display: inline-flex;
    width: fit-content;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: .18rem;
    background: #f8fafc;
}

.segmented-control button {
    border: 0;
    background: transparent;
    border-radius: 999px;
    color: #334155;
    font-weight: 800;
    padding: .55rem .9rem;
}

.segmented-control button.active {
    background: #0b5d45;
    color: #fff;
}

.vip-aware {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: center;
}

.editable-list {
    display: grid;
    gap: .55rem;
}

.editable-row,
.boq-edit-row,
.catalog-add-row {
    display: grid;
    gap: .55rem;
    align-items: center;
}

.editable-row {
    grid-template-columns: auto minmax(150px, 1fr) minmax(150px, 190px);
}

.editable-row.review {
    grid-template-columns: auto minmax(130px, 170px) minmax(140px, 160px) minmax(130px, 1fr) minmax(180px, 1.2fr);
}

.editable-row.activity {
    grid-template-columns: auto minmax(160px, 1fr) repeat(2, minmax(135px, 150px)) minmax(110px, 140px) 90px 120px;
}

.boq-edit-row {
    grid-template-columns: auto minmax(100px, .7fr) minmax(180px, 1.5fr) 90px 95px 105px 105px minmax(110px, .8fr);
    border: 1px solid #dbe5ed;
    border-radius: 8px;
    padding: .6rem;
    background: #f8fafc;
}

.boq-edit-row.margin-warning {
    border-color: #f59e0b;
    background: #fffbeb;
}

.catalog-add-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.editable-row input,
.editable-row select,
.boq-edit-row input,
.boq-edit-row select,
.catalog-add-row select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    min-height: 40px;
    padding: .55rem .65rem;
    background: #fff;
}

.switch-row {
    display: inline-flex;
    gap: .6rem;
    align-items: center;
    width: fit-content;
    font-weight: 800;
}

.bundle-picker,
.activity-preview,
.review-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.bundle-schedule-card {
    border: 1px solid #dbe5ed;
    border-radius: 8px;
    padding: .85rem;
    display: grid;
    gap: .65rem;
    background: #f8fafc;
}

.bundle-schedule-card > div {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
}

.bundle-schedule-card input[type="date"] {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    min-height: 40px;
    padding: .5rem .65rem;
}

.bundle-schedule-card ol {
    margin: 0;
    padding-left: 1.1rem;
    color: #334155;
}

.bundle-schedule-card li span {
    color: #64748b;
    font-size: .85rem;
}

.creation-checklist,
.summary-card,
.summary-section,
.warning-note {
    border: 1px solid #dbe5ed;
    border-radius: 8px;
    padding: .85rem;
    background: #f8fafc;
}

.creation-checklist {
    display: grid;
    gap: .5rem;
}

.creation-checklist span::before {
    content: "OK";
    color: #0f7a4f;
    font-weight: 900;
    margin-right: .55rem;
}

.wizard-footer {
    border-top: 1px solid #dbe5ed;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
    background: #f8fafc;
}

.wizard-summary {
    display: grid;
    gap: .85rem;
    padding: 1rem;
    position: sticky;
    top: 1rem;
}

.wizard-summary h2 {
    margin: 0;
}

.summary-customer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.summary-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

.summary-metrics article {
    border-radius: 8px;
    background: #ecfeff;
    padding: .8rem;
}

.summary-metrics span,
.summary-section span,
.summary-card small {
    display: block;
    color: #64748b;
    font-size: .85rem;
}

.summary-metrics strong,
.summary-card span {
    display: block;
    color: #17212b;
    font-size: 1.05rem;
}

.warning-note {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
    font-weight: 800;
}

.validation-banner {
    margin: 1rem 1.25rem 0;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    font-weight: 800;
    padding: .85rem;
}

.analytics-hero {
    border: 1px solid #dbe5ed;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f4f8fb 100%);
    padding: 1.25rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.analytics-hero h2 {
    margin: .35rem 0;
}

.analytics-hero p {
    max-width: 900px;
    color: #64748b;
    margin: 0;
}

.analytics-refresh {
    border: 1px solid #dbe5ed;
    border-radius: 8px;
    background: #fff;
    padding: 1rem;
    min-width: 190px;
}

.analytics-refresh span,
.analytics-refresh strong {
    display: block;
}

.analytics-refresh span {
    color: #64748b;
    font-size: .85rem;
}

.analytics-metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .85rem;
    margin-bottom: 1rem;
}

.analytics-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.analytics-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr);
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}

.analytics-table {
    display: grid;
    gap: .45rem;
}

.analytics-row {
    display: grid;
    grid-template-columns: minmax(160px, 1.4fr) minmax(110px, .8fr) 70px 70px 90px minmax(140px, 1fr);
    gap: .75rem;
    align-items: center;
    border: 1px solid #dbe5ed;
    border-radius: 8px;
    background: #fff;
    padding: .75rem;
}

.project-commercial-table .analytics-row {
    grid-template-columns: minmax(180px, 1.4fr) minmax(130px, 1fr) 110px 110px minmax(140px, 1fr) 90px;
}

.analytics-row.heading {
    background: #f8fafc;
    color: #64748b;
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.analytics-row strong,
.analytics-row small {
    display: block;
}

.analytics-row small {
    color: #64748b;
}

.mini-progress {
    background: #e2e8f0;
    border-radius: 999px;
    display: block;
    height: 7px;
    overflow: hidden;
    width: 100%;
    margin-bottom: .25rem;
}

.mini-progress i {
    background: #0f7a4f;
    display: block;
    height: 100%;
    border-radius: inherit;
}

.client-risk-list,
.breakdown-stack {
    display: grid;
    gap: .65rem;
}

.client-risk-card {
    border: 1px solid #dbe5ed;
    border-left: 5px solid #1f6fb2;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: center;
    padding: .8rem;
    background: #fff;
}

.client-risk-card.tone-success {
    border-left-color: #0f7a4f;
}

.client-risk-card.tone-warning {
    border-left-color: #d17a00;
}

.client-risk-card.tone-danger {
    border-left-color: #c62828;
}

.client-risk-card strong,
.client-risk-card small {
    display: block;
}

.client-risk-card small {
    color: #64748b;
}

.client-risk-card > span {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #f8fafc;
    color: #17212b;
    font-weight: 900;
}

.breakdown-stack h3 {
    margin: .25rem 0 .45rem;
    font-size: 1rem;
}

.breakdown-line {
    border: 1px solid #dbe5ed;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem .75rem;
    margin-bottom: .4rem;
    background: #fff;
}

.breakdown-line.tone-warning {
    background: #fffbeb;
    border-color: #f59e0b;
}

.tone-text-success {
    color: #0f7a4f;
    font-weight: 900;
}

.tone-text-warning {
    color: #b45309;
    font-weight: 900;
}

.tone-text-danger {
    color: #c62828;
    font-weight: 900;
}

.tone-text-info {
    color: #1f6fb2;
    font-weight: 900;
}

.notification-center {
    position: relative;
    margin-left: auto;
}

.notification-bell {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-soft, #dbe5ed);
    border-radius: 999px;
    background: var(--bg-card, #fff);
    color: var(--text-primary, #17212b);
    display: grid;
    place-items: center;
    position: relative;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.notification-bell:hover {
    transform: translateY(-1px);
}

.notification-bell span {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #c62828;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: .7rem;
    font-weight: 900;
}

.notification-panel {
    position: absolute;
    top: calc(100% + .55rem);
    right: 0;
    z-index: 4000;
    width: min(420px, calc(100vw - 2rem));
    border: 1px solid var(--border-soft, #dbe5ed);
    border-radius: 8px;
    background: var(--bg-card, #fff);
    box-shadow: 0 20px 60px rgba(15, 23, 42, .18);
    padding: .85rem;
}

.notification-panel header,
.notification-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
}

.notification-panel header {
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border-soft, #e2e8f0);
    margin-bottom: .75rem;
}

.notification-panel strong,
.notification-panel small,
.notification-item span {
    display: block;
}

.notification-panel small,
.notification-item span,
.notification-item small {
    color: var(--text-secondary, #64748b);
}

.notification-push-status {
    border: 1px solid var(--border-soft, #dbe5ed);
    border-radius: 8px;
    background: var(--bg-card-elevated, #f8fafc);
    color: var(--text-secondary, #475569);
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: .75rem;
    padding: .65rem .75rem;
}

.secondary-action.compact {
    min-height: 32px;
    padding: .35rem .6rem;
    font-size: .78rem;
}

.notification-list {
    display: grid;
    gap: .55rem;
    max-height: 420px;
    overflow: auto;
}

.notification-item {
    border: 1px solid var(--border-soft, #dbe5ed);
    border-left: 5px solid #1f6fb2;
    border-radius: 8px;
    background: var(--bg-card-elevated, #f8fafc);
    padding: .75rem;
}

.notification-item.severity-warning {
    border-left-color: #d17a00;
}

.notification-item.severity-critical {
    border-left-color: #c62828;
}

.notification-item.severity-success {
    border-left-color: #0f7a4f;
}

.notification-item.read {
    opacity: .72;
}

.notification-item button {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: var(--text-primary, #17212b);
    font-weight: 800;
    padding: .25rem .55rem;
}

.notification-toast-host {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 5000;
    display: grid;
    gap: .65rem;
    width: min(380px, calc(100vw - 2rem));
}

.notification-toast {
    border: 1px solid #dbe5ed;
    border-left: 5px solid #1f6fb2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
    padding: .8rem;
    text-decoration: none;
    color: #17212b;
}

.notification-toast.severity-warning {
    border-left-color: #d17a00;
}

.notification-toast.severity-critical {
    border-left-color: #c62828;
}

.notification-toast.severity-success {
    border-left-color: #0f7a4f;
}

.notification-toast strong,
.notification-toast span {
    display: block;
}

.notification-toast span {
    color: #64748b;
    margin-top: .2rem;
}

@media (max-width: 1100px) {
    .visual-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ops-split,
    .dispatch-layout,
    .intake-shell,
    .intake-fast-shell,
    .intake-mvp-grid,
    .workorder-workspace,
    .project-grid,
    .project-workspace,
    .review-catchup-shell,
    .template-designer-shell,
    .wizard-shell,
    .crm-layout,
    .crm-detail-grid,
    .b2b-grid,
    .command-layout,
    .analytics-layout,
    .technician-mobile-layout,
    .mobile-job-grid,
    .executive-hero,
    .executive-section-grid {
        grid-template-columns: 1fr;
    }

    .command-metrics,
    .executive-metric-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .executive-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kanban-grid {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
    }

    .wizard-steps,
    .wizard-summary {
        position: static;
    }

    .editable-row,
    .editable-row.review,
    .editable-row.activity,
    .boq-edit-row,
    .analytics-row,
    .project-commercial-table .analytics-row,
    .bundle-picker,
    .activity-preview,
    .review-grid {
        grid-template-columns: 1fr;
    }

    .chart-panel.large {
        grid-column: span 1;
    }

    .intake-phone-row {
        grid-template-columns: 1fr;
    }

    .intake-fast-hero {
        flex-direction: column;
    }

    .intake-quick-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .content {
        padding: 1rem !important;
    }

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

    .dashboard-hero,
    .visual-grid,
    .metric-strip,
    .project-stats,
    .service-orbit,
    .command-metrics,
    .queue-meta,
    .executive-metric-grid,
    .executive-dashboard-grid,
    .analytics-hero,
    .analytics-chart-grid,
    .mini-metric-grid,
    .slot-grid,
    .technician-pick-list,
    .kanban-grid {
        grid-template-columns: 1fr;
    }

    .photo-preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .catalog-add-row,
    .summary-metrics {
        grid-template-columns: 1fr;
    }

    .service-core {
        border-radius: 8px;
        height: auto;
        padding: 1rem;
        width: auto;
    }
}

.module-header-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    font-size: .85rem;
    color: var(--ops-text-muted, #667085);
}

.module-header-field input {
    min-width: 10rem;
}

.scheduling-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 360px;
    gap: 1rem;
    align-items: start;
}

.scheduling-queue,
.scheduling-detail {
    position: sticky;
    top: 1rem;
}

.queue-scroll {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    max-height: calc(100vh - 18rem);
    overflow: auto;
    padding-right: .25rem;
}

.schedule-work-card {
    width: 100%;
    text-align: left;
    border: 1px solid var(--ops-border, #d7dee8);
    border-radius: .9rem;
    background: #fff;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.schedule-work-card.selected,
.schedule-work-card:hover {
    border-color: var(--ops-primary, #c92026);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.crew-schedule-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.crew-schedule-card {
    border: 1px solid var(--ops-border, #d7dee8);
    border-radius: 1rem;
    background: #fff;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

.crew-schedule-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.crew-schedule-header h3 {
    margin: 0;
}

.crew-schedule-header p {
    margin: .2rem 0 0;
    color: var(--ops-text-muted, #667085);
}

.crew-member-list,
.crew-assignment-strip,
.card-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.crew-assignment-chip {
    min-width: 10rem;
    border-radius: .85rem;
    background: #f7f9fc;
    border: 1px solid var(--ops-border, #d7dee8);
    padding: .7rem .8rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.crew-assignment-chip.urgent {
    border-color: #f59e0b;
    background: #fff8eb;
}

.crew-assignment-chip.vip {
    border-color: #c92026;
    background: #fff4f4;
}

.dispatch-layout-clean .dispatch-main {
    min-width: 0;
}

.dispatch-lane-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.dispatch-lane-grid .kanban-column {
    min-width: 0;
}

.dispatch-lane-grid .kanban-column h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
}

.dispatch-lane-grid .work-card {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.card-action-row.compact {
    margin-top: .5rem;
}

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

.crew-row span,
.crew-row small {
    display: block;
}

.timeline-modal {
    max-width: 720px;
}

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.timeline-entry {
    border: 1px solid var(--ops-border, #d7dee8);
    border-radius: .9rem;
    padding: .9rem 1rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.timeline-entry span,
.timeline-entry small,
.timeline-entry p {
    margin: 0;
    color: var(--ops-text-muted, #667085);
}

@media (max-width: 1280px) {
    .scheduling-layout {
        grid-template-columns: 1fr;
    }

    .scheduling-queue,
    .scheduling-detail {
        position: static;
    }

    .queue-scroll {
        max-height: none;
    }

    .dispatch-lane-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .dispatch-lane-grid {
        grid-template-columns: 1fr;
    }
}

.form-actions.wrap,
.chip-row.wrap {
    flex-wrap: wrap;
}

.customer-portal-shell {
    min-height: 100vh;
    background: linear-gradient(180deg, #f7fafc 0%, #eef3f8 100%);
}

.customer-portal-header {
    padding: .85rem 1.25rem 0;
}

.customer-portal-brand {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(215, 222, 232, 0.9);
    border-radius: .9rem;
    padding: .6rem .85rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.customer-portal-brand img {
    height: 2rem;
    width: auto;
}

.customer-portal-brand div {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.customer-portal-brand span {
    color: var(--ops-text-muted, #667085);
    font-size: .92rem;
}

.customer-portal-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: .85rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.customer-portal-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(215, 222, 232, 0.95);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.customer-portal-hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.customer-portal-chip-stack {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
}

.customer-portal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.customer-portal-stat-list {
    display: grid;
    gap: .8rem;
}

.customer-portal-stat-list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .7rem;
    border-bottom: 1px solid rgba(215, 222, 232, 0.7);
}

.customer-portal-stat-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.customer-portal-stat-list span {
    color: var(--ops-text-muted, #667085);
}

.customer-portal-stat-list strong {
    text-align: right;
}

.customer-portal-map {
    min-height: 320px;
}

.customer-portal-compact-card {
    min-height: calc(100vh - 120px);
    display: grid;
    gap: .8rem;
    align-content: start;
}

.customer-portal-submitted-banner {
    margin-top: 1rem;
}

.customer-portal-compact-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.customer-portal-chip-stack.compact {
    justify-content: flex-end;
}

.customer-portal-inline-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem 1rem;
    color: var(--ops-text-muted, #667085);
    font-size: .92rem;
}

.customer-portal-compact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(250px, .95fr);
    gap: .9rem;
    align-items: start;
}

.customer-portal-compact-form {
    display: grid;
    gap: .7rem;
}

.customer-portal-locked-state {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: .85rem;
    margin-top: 1rem;
}

.customer-portal-locked-item {
    display: grid;
    gap: .35rem;
    padding: .95rem 1rem;
    border-radius: .9rem;
    border: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--panel-bg) 92%, white 8%);
}

.customer-portal-locked-item strong {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted-text);
}

.customer-portal-locked-item span {
    color: var(--heading-color);
    line-height: 1.45;
}

.customer-portal-location-button {
    width: 100%;
    min-height: 56px;
    justify-content: center;
    font-size: 1rem;
}

.customer-portal-compact-map-wrap {
    min-width: 0;
}

.customer-portal-map.compact {
    min-height: 180px;
    height: 180px;
    border-radius: 12px;
}

.modal-field.compact input,
.modal-field.compact textarea,
.modal-field.compact select {
    min-height: 40px;
    padding: .55rem .7rem;
}

.compact-grid {
    gap: .75rem;
}

.photo-preview-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(72px, 72px));
    gap: .45rem;
}

.photo-preview-grid.compact img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
}

.intake-location-meta.compact {
    margin-top: 0;
    font-size: .85rem;
}

.form-actions.compact-start {
    justify-content: flex-start;
    margin-top: 0;
}

@media (max-width: 780px) {
    .priority-choice {
        flex: 1 1 calc(50% - .5rem);
        justify-content: center;
    }

    .customer-portal-header {
        padding: 1rem 1rem 0;
    }

    .customer-portal-main {
        padding: 1rem 1rem 2rem;
    }

    .customer-portal-hero,
    .customer-portal-grid {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .customer-portal-chip-stack {
        justify-content: flex-start;
    }

    .customer-portal-stat-list div {
        flex-direction: column;
        gap: .25rem;
    }

    .customer-portal-stat-list strong {
        text-align: left;
    }

    .customer-portal-compact-head,
    .customer-portal-compact-layout {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .customer-portal-map.compact {
        min-height: 170px;
        height: 170px;
    }

    .customer-portal-compact-card {
        min-height: auto;
    }
}

@media (max-width: 1080px) {
    .intake-cockpit-grid {
        grid-template-columns: 1fr;
    }

    .intake-summary-panel {
        position: static;
        top: auto;
    }
}

@media (max-width: 820px) {
    .intake-customer-grid,
    .intake-job-grid,
    .intake-attachments-grid {
        grid-template-columns: 1fr;
    }

    .intake-country-field,
    .intake-phone-field,
    .intake-category-field,
    .intake-name-field,
    .intake-status-field {
        grid-column: 1 / -1;
    }

    .intake-section-head,
    .intake-subsection-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .intake-location-map.compact {
        min-height: 200px;
        height: 200px;
    }
}

@media (max-width: 640px) {
    .intake-section-card,
    .intake-summary-panel,
    .intake-subsection-panel {
        padding: .8rem;
        border-radius: 16px;
    }

    .intake-location-map.compact {
        min-height: 182px;
        height: 182px;
    }

    .intake-summary-actions {
        position: sticky;
        bottom: .75rem;
        background: inherit;
        padding-top: .35rem;
    }
}

.dashboard-filter-panel {
    margin-bottom: 1rem;
}

.dashboard-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .9rem;
    align-items: end;
}

.dashboard-filter-grid label {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    font-size: .92rem;
    color: var(--ops-text-muted, #667085);
}

.dashboard-filter-grid select,
.dashboard-filter-grid input {
    min-height: 2.8rem;
    border-radius: .85rem;
    border: 1px solid rgba(203, 213, 225, 0.95);
    background: #fff;
    padding: .65rem .85rem;
    color: var(--ops-text, #1f2937);
}

.dashboard-filter-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.executive-metric-grid-large {
    margin-top: 1rem;
}

.executive-metric-grid-large .executive-metric-card {
    min-height: 9.5rem;
}

.mini-metric-card small {
    color: var(--ops-text-muted, #667085);
    font-size: .78rem;
    line-height: 1.35;
}

.ops-theme-dark .page,
.ops-theme-dark main,
.ops-theme-dark article,
.ops-theme-dark .content,
.ops-theme-dark .ui-page-shell,
.ops-theme-dark .ui-workspace,
.ops-theme-dark .customer-portal-shell {
    background: var(--page-bg);
    color: var(--ops-text);
}

.ops-theme-dark .sidebar {
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, #0d141c 100%);
    border-right-color: rgba(42, 55, 69, .42);
}

.ops-theme-dark .top-row,
.ops-theme-dark .top-row.ps-3.navbar,
.ops-theme-dark .nav-scrollable,
.ops-theme-dark .customer-portal-brand {
    background: var(--bg-sidebar);
    border-color: rgba(42, 55, 69, .38);
    color: var(--ops-text);
}

.ops-theme-dark .navbar-brand,
.ops-theme-dark .section-title,
.ops-theme-dark h1,
.ops-theme-dark h2,
.ops-theme-dark h3,
.ops-theme-dark h4,
.ops-theme-dark strong,
.ops-theme-dark th,
.ops-theme-dark td,
.ops-theme-dark label {
    color: var(--text-primary);
}

.ops-theme-dark .nav-group-label,
.ops-theme-dark .nav-link,
.ops-theme-dark .entity-card p,
.ops-theme-dark .detail-drawer > header span,
.ops-theme-dark .module-header-copy p,
.ops-theme-dark .page-subtitle,
.ops-theme-dark .header-chip,
.ops-theme-dark .queue-meta,
.ops-theme-dark .work-card p,
.ops-theme-dark .work-card small,
.ops-theme-dark .project-card p,
.ops-theme-dark .ops-table small,
.ops-theme-dark .mobile-job-card p,
.ops-theme-dark .mobile-job-card small,
.ops-theme-dark .customer-portal-brand span,
.ops-theme-dark .customer-portal-stat-list span,
.ops-theme-dark .dashboard-filter-grid label,
.ops-theme-dark .crew-schedule-header p,
.ops-theme-dark .timeline-entry span,
.ops-theme-dark .timeline-entry small,
.ops-theme-dark .timeline-entry p {
    color: var(--text-secondary);
}

.ops-theme-dark .nav-icon,
.ops-theme-dark .entity-icon {
    background: rgba(31, 111, 178, 0.16);
    color: #8cc7ff;
}

.ops-theme-dark .nav-item a.active {
    background: #184d73;
    color: #eaf3fa;
}

.ops-theme-dark .nav-item .nav-link:hover {
    background: rgba(27, 38, 50, .92);
    color: #d4e6f5;
}

.ops-theme-night .sidebar {
    background: linear-gradient(180deg, #1b2530 0%, #1f2a35 100%);
    border-right-color: rgba(66, 81, 97, .38);
}

.ops-theme-night .top-row,
.ops-theme-night .top-row.ps-3.navbar,
.ops-theme-night .nav-scrollable,
.ops-theme-night .customer-portal-brand {
    background: #1b2530;
    border-color: rgba(66, 81, 97, .34);
}

.ops-theme-night .nav-icon,
.ops-theme-night .entity-icon {
    background: rgba(132, 185, 255, 0.14);
    color: #b4d5ff;
}

.ops-theme-night .nav-item a.active {
    background: #315373;
    color: #eef4f9;
}

.ops-theme-night .nav-item .nav-link:hover {
    background: rgba(49, 62, 76, .92);
    color: #d9e4ee;
}

.ops-theme-dark .global-search,
.ops-theme-dark .filter-bar,
.ops-theme-dark .filter-search,
.ops-theme-dark .entity-card,
.ops-theme-dark .detail-drawer,
.ops-theme-dark .ui-data-table,
.ops-theme-dark .empty-state,
.ops-theme-dark .setup-card,
.ops-theme-dark .loading-panel,
.ops-theme-dark .placeholder-panel,
.ops-theme-dark .ops-panel,
.ops-theme-dark .table-shell,
.ops-theme-dark .project-card,
.ops-theme-dark .kanban-column,
.ops-theme-dark .work-card,
.ops-theme-dark .chart-panel,
.ops-theme-dark .form-panel,
.ops-theme-dark .queue-card,
.ops-theme-dark .mobile-job-card,
.ops-theme-dark .crm-list-card,
.ops-theme-dark .project-select-card,
.ops-theme-dark .crm-hero,
.ops-theme-dark .project-hero,
.ops-theme-dark .project-mini-card,
.ops-theme-dark .bundle-card,
.ops-theme-dark .proposal-card,
.ops-theme-dark .review-type-card,
.ops-theme-dark .review-catchup-card,
.ops-theme-dark .customer-portal-card,
.ops-theme-dark .summary-card,
.ops-theme-dark .template-list-card,
.ops-theme-dark .wizard-panel,
.ops-theme-dark .editable-row,
.ops-theme-dark .notification-panel,
.ops-theme-dark .schedule-work-card,
.ops-theme-dark .crew-schedule-card,
.ops-theme-dark .automation-modal,
.ops-theme-dark .dispatch-action-modal,
.ops-theme-dark .action-step-panel,
.ops-theme-dark .slot-card,
.ops-theme-dark .technician-pick-card,
.ops-theme-dark .automation-batch-card,
.ops-theme-dark .automation-action-card,
.ops-theme-dark .automation-result-panel,
.ops-theme-dark .timeline-entry,
.ops-theme-dark .crew-assignment-chip,
.ops-theme-dark .health-score-card,
.ops-theme-dark .executive-metric-card,
.ops-theme-dark .mini-metric-card,
.ops-theme-dark .executive-alert-card,
.ops-theme-dark .client-risk-card {
    background: var(--bg-card);
    border-color: var(--line);
    box-shadow: var(--panel-shadow);
}

.ops-theme-dark .ui-data-table-header,
.ops-theme-dark .table-shell thead,
.ops-theme-dark .ops-table th,
.ops-theme-dark .project-commercial-table .analytics-row,
.ops-theme-dark .customer-portal-stat-list div,
.ops-theme-dark .dispatch-action-modal header,
.ops-theme-dark .dispatch-action-modal footer,
.ops-theme-dark .automation-modal header,
.ops-theme-dark .automation-modal footer {
    background: var(--ops-surface-soft);
    border-color: var(--line);
}

.ops-theme-dark .filter-chips button,
.ops-theme-dark .responsive-tabs button,
.ops-theme-dark .crm-segmented button,
.ops-theme-dark .project-tabs button,
.ops-theme-dark .intake-step-button {
    background: #172127;
    border-color: var(--line);
    color: var(--ops-text);
}

.ops-theme-dark .filter-chips button.active,
.ops-theme-dark .responsive-tabs button.active,
.ops-theme-dark .crm-segmented button.active,
.ops-theme-dark .project-tabs button.active,
.ops-theme-dark .intake-step-button.active {
    background: rgba(31, 111, 178, 0.16);
    border-color: #2e5674;
    color: #cfe9ff;
}

.ops-theme-dark .filter-chips strong,
.ops-theme-dark .responsive-tabs span {
    background: rgba(255, 255, 255, 0.06);
}

.ops-theme-dark input,
.ops-theme-dark select,
.ops-theme-dark textarea,
.ops-theme-dark .modal-field input,
.ops-theme-dark .modal-field select,
.ops-theme-dark .modal-field textarea,
.ops-theme-dark .currency-input,
.ops-theme-dark .form-panel input,
.ops-theme-dark .form-panel select,
.ops-theme-dark .form-panel textarea,
.ops-theme-dark .dashboard-filter-grid select,
.ops-theme-dark .dashboard-filter-grid input,
.ops-theme-dark .global-search input,
.ops-theme-dark .filter-search input {
    background: var(--bg-input);
    border-color: var(--border-soft);
    color: var(--ops-text);
}

.ops-theme-dark input:focus,
.ops-theme-dark select:focus,
.ops-theme-dark textarea:focus,
.ops-theme-dark .modal-field input:focus,
.ops-theme-dark .modal-field select:focus,
.ops-theme-dark .modal-field textarea:focus,
.ops-theme-dark .global-search:focus-within,
.ops-theme-dark .currency-input:focus-within {
    border-color: rgba(96, 165, 250, .65);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .16);
}

.ops-theme-dark .priority-choice {
    background: color-mix(in srgb, var(--bg-card-elevated) 80%, var(--bg-input) 20%);
    border-color: rgba(127, 140, 153, 0.24);
    color: var(--ops-text);
}

.ops-theme-dark .priority-choice.priority-low {
    background: rgba(45, 212, 191, .08);
    color: #8ce9db;
    border-color: rgba(45, 212, 191, .2);
}

.ops-theme-dark .priority-choice.priority-medium {
    background: rgba(96, 165, 250, .09);
    color: #a7cefb;
    border-color: rgba(96, 165, 250, .22);
}

.ops-theme-dark .priority-choice.priority-high {
    background: rgba(251, 191, 36, .10);
    color: #f7d77a;
    border-color: rgba(251, 191, 36, .22);
}

.ops-theme-dark .priority-choice.priority-emergency {
    background: rgba(248, 113, 113, .10);
    color: #ffb0b0;
    border-color: rgba(248, 113, 113, .22);
}

.ops-theme-night .priority-choice {
    background: rgba(49, 62, 76, .82);
}

.ops-theme-night .priority-choice.priority-low {
    background: rgba(88, 212, 193, .09);
    color: #9ae6dc;
    border-color: rgba(88, 212, 193, .22);
}

.ops-theme-night .priority-choice.priority-medium {
    background: rgba(132, 185, 255, .10);
    color: #bdd9ff;
    border-color: rgba(132, 185, 255, .24);
}

.ops-theme-night .priority-choice.priority-high {
    background: rgba(237, 198, 111, .11);
    color: #f1d596;
    border-color: rgba(237, 198, 111, .24);
}

.ops-theme-night .priority-choice.priority-emergency {
    background: rgba(238, 151, 151, .10);
    color: #f4b8b8;
    border-color: rgba(238, 151, 151, .22);
}

.ops-theme-dark .priority-choice.selected.priority-low {
    background: #0f3a37;
    border-color: #2dd4bf;
    color: #f0fdfa;
}

.ops-theme-dark .priority-choice.selected.priority-medium {
    background: #102a43;
    border-color: #60a5fa;
    color: #eff6ff;
}

.ops-theme-dark .priority-choice.selected.priority-high {
    background: #3a2d0a;
    border-color: #fbbf24;
    color: #fffbeb;
}

.ops-theme-dark .priority-choice.selected.priority-emergency {
    background: #3a1418;
    border-color: #f87171;
    color: #fef2f2;
}

.ops-theme-night .priority-choice.selected.priority-low {
    background: #28534d;
    border-color: #58d4c1;
    color: #f2fffd;
}

.ops-theme-night .priority-choice.selected.priority-medium {
    background: #35526c;
    border-color: #84b9ff;
    color: #f5f9ff;
}

.ops-theme-night .priority-choice.selected.priority-high {
    background: #5d4a1b;
    border-color: #edc66f;
    color: #fff9ed;
}

.ops-theme-night .priority-choice.selected.priority-emergency {
    background: #5a2930;
    border-color: #ee9797;
    color: #fff1f3;
}

.ops-theme-dark .intake-section-card,
.ops-theme-dark .intake-subsection-panel,
.ops-theme-dark .intake-summary-panel {
    background: var(--bg-card);
    border-color: var(--border-soft);
    box-shadow: 0 14px 34px rgba(2, 10, 18, .22);
}

.ops-theme-dark .intake-customer-status {
    background: var(--bg-card-elevated);
    border-color: var(--border-soft);
}

.ops-theme-dark .intake-customer-status.searching {
    background: rgba(36, 51, 67, .88);
    border-color: rgba(127, 140, 153, .22);
}

.ops-theme-dark .intake-customer-status.found {
    background: rgba(16, 42, 67, .92);
    border-color: rgba(96, 165, 250, .26);
}

.ops-theme-dark .intake-customer-status.missing {
    background: rgba(58, 45, 10, .88);
    border-color: rgba(251, 191, 36, .28);
}

.ops-theme-night .intake-section-card,
.ops-theme-night .intake-subsection-panel,
.ops-theme-night .intake-summary-panel {
    box-shadow: 0 12px 24px rgba(9, 16, 24, .12);
}

.ops-theme-night .intake-customer-status.searching {
    background: rgba(49, 62, 76, .88);
    border-color: rgba(132, 149, 161, .22);
}

.ops-theme-night .intake-customer-status.found {
    background: rgba(32, 67, 102, .70);
    border-color: rgba(132, 185, 255, .24);
}

.ops-theme-night .intake-customer-status.missing {
    background: rgba(82, 65, 22, .70);
    border-color: rgba(237, 198, 111, .24);
}

.ops-theme-dark .intake-customer-suggestions {
    border-color: var(--border-strong);
    background: rgba(23, 33, 43, .98);
    box-shadow: 0 24px 44px rgba(2, 8, 16, .34);
}

.ops-theme-dark .intake-customer-suggestion {
    border-color: rgba(127, 140, 153, .16);
    background: rgba(27, 38, 50, .94);
    color: var(--ops-text);
}

.ops-theme-dark .intake-customer-suggestion:hover {
    border-color: rgba(96, 165, 250, .30);
    background: rgba(16, 42, 67, .56);
}

.ops-theme-night .intake-customer-suggestions {
    background: rgba(40, 52, 64, .98);
    box-shadow: 0 20px 34px rgba(8, 15, 24, .18);
}

.ops-theme-night .intake-customer-suggestion {
    border-color: rgba(148, 162, 176, .14);
    background: rgba(49, 62, 76, .92);
}

.ops-theme-night .intake-customer-suggestion:hover {
    border-color: rgba(132, 185, 255, .24);
    background: rgba(58, 74, 90, .94);
}

.ops-theme-dark .currency-input span {
    background: rgba(27, 38, 50, 0.92);
    border-color: rgba(127, 140, 153, 0.22);
    color: var(--ops-text-muted);
}

.ops-theme-dark input::placeholder,
.ops-theme-dark textarea::placeholder {
    color: var(--text-muted);
}

.ops-theme-dark .topbar-primary-action {
    background: #174f78;
    box-shadow: 0 12px 26px rgba(23, 79, 120, .24);
}

.ops-theme-night .topbar-primary-action {
    background: #2b628d;
    box-shadow: 0 10px 22px rgba(43, 98, 141, .18);
}

.ops-theme-dark .attention-pill {
    background: #3a2d0a;
    color: #f6cf77;
    border: 1px solid rgba(251, 191, 36, .18);
}

.ops-theme-night .attention-pill {
    background: #4b3c15;
    color: #f2d892;
    border: 1px solid rgba(237, 198, 111, .18);
}

.ops-theme-dark .theme-toggle {
    background: var(--bg-card-elevated);
    border-color: var(--border-soft);
    color: var(--text-primary);
}

.ops-theme-dark .theme-mode-toggle {
    background: var(--bg-card-elevated);
    border-color: var(--border-soft);
}

.ops-theme-dark .theme-mode-button {
    color: var(--text-secondary);
}

.ops-theme-dark .theme-mode-button:hover {
    color: var(--text-primary);
    background: color-mix(in srgb, var(--bg-card) 68%, transparent 32%);
}

.ops-theme-dark .theme-mode-button.selected {
    color: var(--text-primary);
    border-color: color-mix(in srgb, var(--accent-primary) 36%, transparent 64%);
    background: color-mix(in srgb, var(--accent-primary) 16%, var(--bg-card) 84%);
}

.ops-theme-night .theme-mode-button {
    color: #b3bfca;
}

.ops-theme-night .theme-mode-button:hover {
    color: #dde6ef;
    background: rgba(58, 74, 90, .66);
}

.ops-theme-night .theme-mode-button.selected {
    color: #f2f6fa;
    border-color: rgba(132, 185, 255, .26);
    background: rgba(132, 185, 255, .14);
}

.ops-theme-dark .notification-bell {
    background: var(--bg-card-elevated);
    border-color: rgba(42, 55, 69, .56);
    color: var(--text-secondary);
}

.ops-theme-dark .notification-panel {
    background: var(--bg-card);
    border-color: var(--border-soft);
}

.ops-theme-dark .notification-item {
    background: var(--bg-card-elevated);
    border-color: rgba(42, 55, 69, .5);
}

.ops-theme-dark .notification-item button {
    background: var(--bg-input);
    border-color: rgba(42, 55, 69, .58);
    color: var(--text-primary);
}

.ops-theme-night .notification-bell {
    background: #313e4c;
    border-color: rgba(66, 81, 97, .56);
    color: #b9c6d2;
}

.ops-theme-night .notification-panel {
    background: #283440;
    border-color: #364554;
}

.ops-theme-night .notification-item {
    background: #313e4c;
    border-color: rgba(66, 81, 97, .48);
}

.ops-theme-night .notification-item button {
    background: #232f3a;
    border-color: rgba(66, 81, 97, .55);
    color: #d1dae3;
}

.ops-theme-dark .customer-portal-shell {
    background: linear-gradient(180deg, #0d1318 0%, #0a1015 100%);
}

.ops-theme-dark .command-metrics div,
.ops-theme-dark .project-stats div,
.ops-theme-dark .mini-metric-card,
.ops-theme-dark .success-banner,
.ops-theme-dark .ops-toast-card,
.ops-theme-dark .chip-button,
.ops-theme-dark .next-action,
.ops-theme-dark .service-orbit span,
.ops-theme-dark .project-health-score,
.ops-theme-dark .project-commercial-table .analytics-row,
.ops-theme-dark .crm-detail-grid > *,
.ops-theme-dark .project-risk-strip,
.ops-theme-dark .signature-panel,
.ops-theme-dark .progress-track,
.ops-theme-dark .customer-portal-locked-item,
.ops-theme-dark .mobile-sticky-actions {
    background: var(--ops-surface-soft);
    border-color: var(--line);
    color: var(--ops-text);
}

@media (max-width: 720px) {
    .ops-toast-stack {
        top: 4.8rem;
        left: 1rem;
        right: 1rem;
        width: auto;
    }
}

.ops-theme-dark .command-metrics span,
.ops-theme-dark .project-stats span,
.ops-theme-dark .project-card footer,
.ops-theme-dark .command-metrics .section-title span,
.ops-theme-dark .queue-meta,
.ops-theme-dark .tone-text-muted,
.ops-theme-dark .modal-field,
.ops-theme-dark .slot-card span,
.ops-theme-dark .slot-card small,
.ops-theme-dark .technician-pick-card span,
.ops-theme-dark .review-card-meta,
.ops-theme-dark .review-catchup-card small,
.ops-theme-dark .project-mini-card small,
.ops-theme-dark .bundle-card small,
.ops-theme-dark .proposal-card span,
.ops-theme-dark .empty-state,
.ops-theme-dark .empty-state p,
.ops-theme-dark .setup-card,
.ops-theme-dark .setup-card span {
    color: var(--ops-text-muted);
}

.ops-theme-dark .queue-card,
.ops-theme-dark .mobile-job-card,
.ops-theme-dark .work-card,
.ops-theme-dark .crm-list-card,
.ops-theme-dark .project-select-card,
.ops-theme-dark .review-type-card,
.ops-theme-dark .review-catchup-card,
.ops-theme-dark .schedule-work-card,
.ops-theme-dark .crew-schedule-card,
.ops-theme-dark .summary-card,
.ops-theme-dark .template-list-card,
.ops-theme-dark .wizard-panel,
.ops-theme-dark .editable-row,
.ops-theme-dark .notification-panel,
.ops-theme-dark .detail-drawer,
.ops-theme-dark .ops-panel,
.ops-theme-dark .table-shell,
.ops-theme-dark .project-card,
.ops-theme-dark .form-panel,
.ops-theme-dark .queue-card h2,
.ops-theme-dark .queue-card h3,
.ops-theme-dark .queue-card h4,
.ops-theme-dark .mobile-job-card h2,
.ops-theme-dark .mobile-job-card h3,
.ops-theme-dark .work-card h3,
.ops-theme-dark .work-card h4,
.ops-theme-dark .project-card h3,
.ops-theme-dark .project-card h4,
.ops-theme-dark .job-card-title,
.ops-theme-dark .priority-list strong,
.ops-theme-dark .priority-list span,
.ops-theme-dark .tech-row strong,
.ops-theme-dark .tech-row small,
.ops-theme-dark .alert-row strong,
.ops-theme-dark .alert-row span {
    color: var(--ops-text);
}

.ops-theme-dark .dispatch-action-modal,
.ops-theme-dark .automation-modal {
    background: #121a1f;
    border-color: var(--line);
}

.ops-theme-dark .dispatch-action-modal header,
.ops-theme-dark .dispatch-action-modal footer,
.ops-theme-dark .automation-modal header,
.ops-theme-dark .automation-modal footer,
.ops-theme-dark .detail-drawer > header,
.ops-theme-dark .ui-data-table-header {
    border-color: var(--line);
}

.ops-theme-dark .slot-card,
.ops-theme-dark .technician-pick-card,
.ops-theme-dark .action-step-panel {
    background: #162128;
    border-color: var(--line);
}

.ops-theme-dark .slot-card.selected,
.ops-theme-dark .technician-pick-card.selected,
.ops-theme-dark .queue-card.selected,
.ops-theme-dark .project-select-card.active {
    border-color: #4aa0d9;
    box-shadow: 0 0 0 3px rgba(74, 160, 217, 0.18);
}

.ops-theme-dark .chip-button {
    border-color: var(--line);
}

.ops-theme-dark .chip-button.active {
    background: rgba(31, 111, 178, 0.18);
    border-color: rgba(74, 160, 217, 0.45);
    color: #cfe9ff;
}

.ops-theme-dark .next-action {
    background: rgba(209, 122, 0, 0.16);
    color: #f5c26b;
}

.ops-theme-dark .progress-track {
    background: #1a252c;
}

.ops-theme-dark .mobile-sticky-actions {
    background: rgba(19, 27, 32, 0.96);
}

.ops-theme-dark .leaflet-map {
    border-color: var(--border-soft);
    background: #111922;
}

.ops-theme-dark .leaflet-container {
    background: #111922;
}

.ops-theme-dark .leaflet-tile {
    filter: brightness(.92) contrast(.94) saturate(.88);
}

.ops-theme-night .leaflet-tile {
    filter: brightness(.98) contrast(.96) saturate(.92);
}

.ops-theme-twilight .leaflet-tile,
.ops-theme-dark.ops-theme-twilight .leaflet-tile {
    filter: brightness(.92) contrast(.94) saturate(.88);
}

.ops-theme-dark .leaflet-control-zoom a,
.ops-theme-dark .leaflet-bar a,
.ops-theme-dark .leaflet-control-layers-toggle,
.ops-theme-dark .leaflet-popup-content-wrapper,
.ops-theme-dark .leaflet-popup-tip {
    background: var(--bg-card-elevated);
    color: var(--ops-text);
    border-color: var(--border-soft);
}

.ops-theme-dark .leaflet-control-attribution {
    background: rgba(17, 25, 34, 0.88);
    color: var(--ops-text-muted);
}

.ops-theme-dark .leaflet-control-attribution a {
    color: #8cc7ff;
}

.ops-theme-dark .leaflet-tech-marker span,
.ops-theme-dark .leaflet-job-marker span {
    border-color: #0f171c;
}

.ops-theme-night .leaflet-tech-marker span,
.ops-theme-night .leaflet-job-marker span {
    border-color: #202a34;
}

.ops-theme-dark .opsgrid-reconnect-card {
    background: rgba(19, 27, 32, 0.96);
    border-color: var(--line);
    color: var(--ops-text);
}

.ops-theme-dark .opsgrid-reconnect-card span {
    color: var(--ops-text-muted);
}

.ops-theme-dark .opsgrid-reconnect-card button {
    background: #1d5b87;
}

/* Dispatch supervisor command center */
.dispatch-mobile-tabs {
    display: none;
}

.dispatch-command-center {
    display: grid;
    grid-template-columns: clamp(300px, 22vw, 380px) minmax(0, 1fr) clamp(320px, 24vw, 420px);
    gap: 1rem;
    min-height: calc(100vh - 12.5rem);
    max-height: calc(100vh - 12.5rem);
    overflow: hidden;
}

.dispatch-command-pane {
    min-width: 0;
    min-height: 0;
    background: var(--bg-card, #fff);
    border: 1px solid var(--line, #e5e7eb);
    border-radius: 18px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .08);
}

.dispatch-queue-pane,
.dispatch-resource-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dispatch-workorder-pane {
    overflow: auto;
}

.dispatch-pane-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem .95rem .55rem;
}

.dispatch-pane-header h2,
.dispatch-selected-header h2,
.dispatch-section-title h3 {
    margin: 0;
    color: var(--ops-text, #1f2937);
}

.dispatch-live-dot {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: #047857;
    background: rgba(16, 185, 129, .12);
    border: 1px solid rgba(16, 185, 129, .22);
    border-radius: 999px;
    padding: .25rem .55rem;
    font-size: .78rem;
    font-weight: 800;
}

.dispatch-live-dot::before {
    content: "";
    width: .45rem;
    height: .45rem;
    border-radius: 999px;
    background: #10b981;
}

.dispatch-search {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .45rem;
    margin: 0 .9rem .65rem;
    padding: .52rem .65rem;
    border: 1px solid var(--line, #d7dee5);
    border-radius: 12px;
    background: var(--bg-input, #fff);
    color: var(--ops-text-muted, #64748b);
}

.dispatch-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ops-text, #1f2937);
    font: inherit;
}

.dispatch-filter-chip-row {
    display: flex;
    gap: .45rem;
    overflow-x: auto;
    padding: 0 .9rem .75rem;
    scrollbar-width: thin;
}

.dispatch-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    flex: 0 0 auto;
    border: 1px solid var(--line, #d7dee5);
    background: var(--bg-card-elevated, #f8fafc);
    color: var(--ops-text-muted, #64748b);
    border-radius: 999px;
    padding: .38rem .62rem;
    font-weight: 800;
}

.dispatch-filter-chip strong {
    display: inline-grid;
    place-items: center;
    min-width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-primary, #0f6fb2) 12%, white 88%);
    color: var(--accent-primary, #0f6fb2);
    font-size: .72rem;
}

.dispatch-filter-chip.active {
    color: var(--accent-primary, #0f6fb2);
    border-color: color-mix(in srgb, var(--accent-primary, #0f6fb2) 40%, var(--line, #d7dee5) 60%);
    background: color-mix(in srgb, var(--accent-primary, #0f6fb2) 10%, var(--bg-card-elevated, #f8fafc) 90%);
}

.dispatch-queue-list,
.resource-card-list {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    padding: 0 .9rem .9rem;
    overflow: auto;
    min-height: 0;
}

.dispatch-queue-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .48rem;
    width: 100%;
    padding: .78rem .82rem .78rem .95rem;
    border: 1px solid var(--line, #d7dee5);
    border-radius: 14px;
    background: var(--bg-card-elevated, #f8fafc);
    color: var(--ops-text, #1f2937);
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.dispatch-queue-card:hover,
.dispatch-queue-card.selected {
    border-color: color-mix(in srgb, var(--accent-primary, #0f6fb2) 48%, var(--line, #d7dee5) 52%);
    box-shadow: 0 14px 34px rgba(15, 111, 178, .12);
    transform: translateY(-1px);
}

.queue-card-ribbon {
    position: absolute;
    inset: .75rem auto .75rem .35rem;
    width: .24rem;
    border-radius: 999px;
    background: #16a34a;
}

.queue-card-ribbon.health-risk {
    background: #f59e0b;
}

.queue-card-ribbon.health-delayed,
.queue-card-ribbon.health-emergency {
    background: #dc001b;
}

.queue-card-top,
.queue-card-bottom,
.resource-card-top,
.dispatch-section-title,
.selected-status-stack {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
}

.queue-card-title {
    font-weight: 900;
    color: var(--ops-text, #1f2937);
}

.queue-card-subtitle,
.queue-card-grid small,
.queue-card-bottom,
.resource-card-top span,
.resource-meta dt,
.dispatch-definition-list dt,
.dispatch-facts-grid small,
.dispatch-facts-grid span {
    color: var(--ops-text-muted, #64748b);
}

.queue-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .45rem;
}

.queue-card-grid span {
    display: flex;
    flex-direction: column;
    gap: .05rem;
    min-width: 0;
}

.queue-card-grid b {
    overflow: hidden;
    color: var(--ops-text, #1f2937);
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-card-bottom {
    flex-wrap: wrap;
    font-size: .76rem;
}

.health-pill {
    display: inline-flex;
    border-radius: 999px;
    padding: .24rem .5rem;
    font-size: .76rem;
    font-weight: 900;
}

.health-pill.health-healthy {
    color: #047857;
    background: rgba(16, 185, 129, .12);
}

.health-pill.health-risk {
    color: #a16207;
    background: rgba(245, 158, 11, .14);
}

.health-pill.health-delayed,
.health-pill.health-emergency {
    color: #b91c1c;
    background: rgba(248, 113, 113, .16);
}

.dispatch-selected-shell {
    display: flex;
    flex-direction: column;
    gap: .9rem;
    min-height: 100%;
    padding: 1rem;
}

.dispatch-selected-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line, #d7dee5);
    border-radius: 16px;
    background: var(--bg-card-elevated, #f8fafc);
}

.dispatch-selected-header p {
    margin: .2rem 0 0;
    color: var(--ops-text-muted, #64748b);
}

.selected-status-stack {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.dispatch-facts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.dispatch-facts-grid > div,
.dispatch-detail-card {
    border: 1px solid var(--line, #d7dee5);
    border-radius: 16px;
    background: var(--bg-card-elevated, #f8fafc);
}

.dispatch-facts-grid > div {
    display: flex;
    flex-direction: column;
    gap: .18rem;
    padding: .82rem;
}

.dispatch-facts-grid strong {
    color: var(--ops-text, #1f2937);
}

.dispatch-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: .8rem;
}

.dispatch-detail-card {
    padding: .95rem;
}

.dispatch-definition-list {
    display: grid;
    gap: .6rem;
    margin: .75rem 0 0;
}

.dispatch-definition-list div {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: .75rem;
    padding: .55rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line, #d7dee5) 70%, transparent 30%);
}

.dispatch-definition-list div:last-child {
    border-bottom: 0;
}

.dispatch-definition-list dd,
.dispatch-definition-list dt {
    margin: 0;
}

.dispatch-definition-list dd {
    color: var(--ops-text, #1f2937);
    font-weight: 800;
}

.dispatch-acceptance-actions,
.decision-button-grid,
.resource-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .75rem;
}

.decision-button-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.decision-button {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: .5rem;
    min-height: 2.55rem;
    border: 1px solid var(--line, #d7dee5);
    border-radius: 12px;
    background: var(--bg-card, #fff);
    color: var(--ops-text, #1f2937);
    font-weight: 900;
    padding: .6rem .7rem;
}

.decision-button.primary {
    border-color: rgba(15, 111, 178, .32);
    background: color-mix(in srgb, var(--accent-primary, #0f6fb2) 12%, var(--bg-card, #fff) 88%);
    color: var(--accent-primary, #0f6fb2);
}

.decision-button.danger {
    border-color: rgba(220, 0, 27, .28);
    background: rgba(248, 113, 113, .1);
    color: #b91c1c;
}

.dispatch-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .7rem;
    margin-top: .75rem;
}

.dispatch-form-grid label,
.assignment-note {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    color: var(--ops-text-muted, #64748b);
    font-weight: 800;
}

.dispatch-form-grid input,
.dispatch-form-grid select,
.assignment-note textarea,
.material-line-row input,
.material-line-row select {
    width: 100%;
    border: 1px solid var(--line, #d7dee5);
    border-radius: 10px;
    background: var(--bg-input, #fff);
    color: var(--ops-text, #1f2937);
    padding: .62rem .7rem;
}

.assigned-chip-area {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: .75rem;
}

.assigned-resource-chip,
.add-resource-chip {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    border: 1px solid var(--line, #d7dee5);
    border-radius: 999px;
    background: var(--bg-card, #fff);
    color: var(--ops-text, #1f2937);
    padding: .45rem .65rem;
}

.assigned-resource-chip {
    position: relative;
    flex-wrap: wrap;
}

.assigned-resource-chip small,
.assigned-resource-chip em {
    color: var(--ops-text-muted, #64748b);
    font-size: .75rem;
}

.assigned-resource-chip.persisted {
    border-color: rgba(16, 185, 129, .26);
    background: rgba(16, 185, 129, .09);
}

.assigned-resource-chip.conflict {
    border-color: rgba(245, 158, 11, .35);
    background: rgba(245, 158, 11, .1);
}

.assigned-resource-chip button {
    display: inline-grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ops-text-muted, #64748b) 14%, transparent 86%);
    color: var(--ops-text, #1f2937);
}

.add-resource-chip {
    font-weight: 900;
}

.add-resource-chip.disabled {
    opacity: .55;
}

.assignment-note {
    margin-top: .75rem;
}

.materials-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.material-lines {
    display: grid;
    gap: .55rem;
    margin-top: .75rem;
}

.material-line-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 5rem 6rem minmax(8rem, .8fr);
    gap: .5rem;
}

.dispatch-timeline-list {
    display: grid;
    gap: .7rem;
    margin-top: .8rem;
}

.dispatch-timeline-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .7rem;
    align-items: start;
}

.dispatch-timeline-row > span {
    width: .7rem;
    height: .7rem;
    margin-top: .25rem;
    border-radius: 999px;
    background: var(--accent-primary, #0f6fb2);
}

.dispatch-timeline-row strong {
    display: block;
    color: var(--ops-text, #1f2937);
}

.dispatch-timeline-row small,
.dispatch-timeline-row time {
    color: var(--ops-text-muted, #64748b);
}

.dispatch-sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    padding: .8rem;
    border: 1px solid var(--line, #d7dee5);
    border-radius: 16px;
    background: color-mix(in srgb, var(--bg-card, #fff) 92%, transparent 8%);
    backdrop-filter: blur(12px);
}

.resource-availability-card {
    display: grid;
    gap: .65rem;
    padding: .85rem;
    border: 1px solid var(--line, #d7dee5);
    border-radius: 14px;
    background: var(--bg-card-elevated, #f8fafc);
}

.resource-availability-card.busy {
    border-color: rgba(245, 158, 11, .22);
}

.resource-card-top strong {
    display: block;
    color: var(--ops-text, #1f2937);
}

.resource-status {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: .26rem .5rem;
    font-size: .74rem;
    font-weight: 900;
}

.resource-status.available {
    color: #047857;
    background: rgba(16, 185, 129, .12);
}

.resource-status.busy {
    color: #a16207;
    background: rgba(245, 158, 11, .14);
}

.resource-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
    margin: 0;
}

.resource-meta div {
    min-width: 0;
}

.resource-meta dt,
.resource-meta dd {
    margin: 0;
}

.resource-meta dd {
    overflow: hidden;
    color: var(--ops-text, #1f2937);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-warning {
    margin: 0;
    border-radius: 10px;
    background: rgba(245, 158, 11, .12);
    color: #a16207;
    padding: .48rem .58rem;
    font-size: .78rem;
    font-weight: 800;
}

.ops-theme-dark .dispatch-command-pane,
.ops-theme-dark .dispatch-selected-header,
.ops-theme-dark .dispatch-facts-grid > div,
.ops-theme-dark .dispatch-detail-card,
.ops-theme-dark .dispatch-queue-card,
.ops-theme-dark .resource-availability-card,
.ops-theme-dark .decision-button,
.ops-theme-dark .assigned-resource-chip,
.ops-theme-dark .add-resource-chip,
.ops-theme-dark .dispatch-sticky-actions {
    border-color: var(--line);
    background: var(--bg-card);
    color: var(--ops-text);
    box-shadow: none;
}

.ops-theme-dark .dispatch-queue-card,
.ops-theme-dark .resource-availability-card,
.ops-theme-dark .dispatch-selected-header,
.ops-theme-dark .dispatch-detail-card,
.ops-theme-dark .dispatch-facts-grid > div {
    background: color-mix(in srgb, var(--bg-card-elevated) 78%, var(--bg-card) 22%);
}

.ops-theme-dark .dispatch-search,
.ops-theme-dark .dispatch-form-grid input,
.ops-theme-dark .dispatch-form-grid select,
.ops-theme-dark .assignment-note textarea,
.ops-theme-dark .material-line-row input,
.ops-theme-dark .material-line-row select {
    border-color: var(--line);
    background: var(--bg-input);
    color: var(--ops-text);
}

.ops-theme-dark .dispatch-filter-chip {
    border-color: var(--line);
    background: color-mix(in srgb, var(--bg-card-elevated) 86%, var(--bg-input) 14%);
    color: var(--ops-text-muted);
}

.ops-theme-dark .dispatch-filter-chip.active {
    color: #b8dcff;
    border-color: rgba(96, 165, 250, .42);
    background: rgba(96, 165, 250, .12);
}

.ops-theme-dark .dispatch-filter-chip strong {
    background: rgba(96, 165, 250, .14);
    color: #b8dcff;
}

.ops-theme-dark .health-pill.health-healthy,
.ops-theme-dark .resource-status.available {
    color: #7dd3c7;
    background: rgba(45, 212, 191, .12);
}

.ops-theme-dark .health-pill.health-risk,
.ops-theme-dark .resource-status.busy,
.ops-theme-dark .resource-warning {
    color: #f8d47b;
    background: rgba(251, 191, 36, .12);
}

.ops-theme-dark .health-pill.health-delayed,
.ops-theme-dark .health-pill.health-emergency {
    color: #ffb4b4;
    background: rgba(248, 113, 113, .14);
}

.ops-theme-dark .decision-button.primary {
    color: #9ed0ff;
    border-color: rgba(96, 165, 250, .35);
    background: rgba(96, 165, 250, .12);
}

.ops-theme-dark .decision-button.danger {
    color: #ffb4b4;
    border-color: rgba(248, 113, 113, .32);
    background: rgba(248, 113, 113, .12);
}

@media (max-width: 1280px) {
    .dispatch-command-center {
        grid-template-columns: minmax(280px, 340px) minmax(0, 1fr) minmax(300px, 360px);
    }

    .dispatch-facts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dispatch-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .dispatch-mobile-tabs {
        display: flex;
        gap: .5rem;
        margin-bottom: .75rem;
        overflow-x: auto;
    }

    .dispatch-mobile-tabs button {
        border: 1px solid var(--line, #d7dee5);
        border-radius: 999px;
        background: var(--bg-card-elevated, #f8fafc);
        color: var(--ops-text-muted, #64748b);
        padding: .5rem .8rem;
        font-weight: 900;
    }

    .dispatch-mobile-tabs button.active {
        color: var(--accent-primary, #0f6fb2);
        border-color: color-mix(in srgb, var(--accent-primary, #0f6fb2) 45%, var(--line, #d7dee5) 55%);
        background: color-mix(in srgb, var(--accent-primary, #0f6fb2) 10%, var(--bg-card-elevated, #f8fafc) 90%);
    }

    .dispatch-command-center {
        display: block;
        min-height: auto;
        max-height: none;
        overflow: visible;
    }

    .dispatch-command-pane {
        display: none;
        min-height: calc(100vh - 13rem);
    }

    .dispatch-command-pane.active {
        display: flex;
    }

    .dispatch-workorder-pane.active {
        display: block;
    }
}

@media (max-width: 720px) {
    .dispatch-selected-shell {
        padding: .7rem;
    }

    .dispatch-selected-header,
    .dispatch-section-title,
    .selected-status-stack {
        align-items: flex-start;
        flex-direction: column;
    }

    .dispatch-facts-grid,
    .dispatch-form-grid,
    .materials-grid,
    .resource-meta,
    .decision-button-grid {
        grid-template-columns: 1fr;
    }

    .material-line-row {
        grid-template-columns: 1fr;
    }

    .dispatch-definition-list div {
        grid-template-columns: 1fr;
        gap: .15rem;
    }

    .dispatch-sticky-actions {
        position: static;
    }
}

/* Night is the middle "evening" mode: softer than Light, much brighter than Twilight. */
.ops-theme-night .page,
.ops-theme-night main,
.ops-theme-night article,
.ops-theme-night .content,
.ops-theme-night .ui-page-shell,
.ops-theme-night .ui-workspace,
.ops-theme-night .customer-portal-shell {
    background: var(--page-bg);
    color: var(--ops-text);
}

.ops-theme-night .sidebar {
    background: linear-gradient(180deg, #bcc9d6 0%, #b4c1cf 100%);
    border-right-color: rgba(123, 140, 156, .42);
}

.ops-theme-night .top-row,
.ops-theme-night .top-row.ps-3.navbar,
.ops-theme-night .nav-scrollable,
.ops-theme-night .customer-portal-brand {
    background: #bcc9d6;
    border-color: rgba(123, 140, 156, .36);
    color: var(--ops-text);
}

.ops-theme-night .navbar-brand,
.ops-theme-night .section-title,
.ops-theme-night h1,
.ops-theme-night h2,
.ops-theme-night h3,
.ops-theme-night h4,
.ops-theme-night strong,
.ops-theme-night th,
.ops-theme-night td,
.ops-theme-night label {
    color: var(--text-primary);
}

.ops-theme-night .nav-group-label,
.ops-theme-night .nav-link,
.ops-theme-night .entity-card p,
.ops-theme-night .detail-drawer > header span,
.ops-theme-night .module-header-copy p,
.ops-theme-night .page-subtitle,
.ops-theme-night .header-chip,
.ops-theme-night .queue-meta,
.ops-theme-night .work-card p,
.ops-theme-night .work-card small,
.ops-theme-night .project-card p,
.ops-theme-night .ops-table small,
.ops-theme-night .mobile-job-card p,
.ops-theme-night .mobile-job-card small,
.ops-theme-night .customer-portal-brand span,
.ops-theme-night .customer-portal-stat-list span,
.ops-theme-night .dashboard-filter-grid label,
.ops-theme-night .crew-schedule-header p,
.ops-theme-night .timeline-entry span,
.ops-theme-night .timeline-entry small,
.ops-theme-night .timeline-entry p {
    color: var(--text-secondary);
}

.ops-theme-night .nav-icon,
.ops-theme-night .entity-icon {
    background: rgba(47, 111, 159, .13);
    color: #2f6f9f;
}

.ops-theme-night .nav-item a.active {
    background: #8ea9c0;
    color: #173247;
}

.ops-theme-night .nav-item .nav-link:hover {
    background: rgba(216, 225, 234, .86);
    color: #263746;
}

.ops-theme-night .global-search,
.ops-theme-night .filter-bar,
.ops-theme-night .filter-search,
.ops-theme-night .entity-card,
.ops-theme-night .detail-drawer,
.ops-theme-night .ui-data-table,
.ops-theme-night .empty-state,
.ops-theme-night .setup-card,
.ops-theme-night .loading-panel,
.ops-theme-night .placeholder-panel,
.ops-theme-night .ops-panel,
.ops-theme-night .table-shell,
.ops-theme-night .project-card,
.ops-theme-night .kanban-column,
.ops-theme-night .work-card,
.ops-theme-night .chart-panel,
.ops-theme-night .form-panel,
.ops-theme-night .queue-card,
.ops-theme-night .mobile-job-card,
.ops-theme-night .crm-list-card,
.ops-theme-night .project-select-card,
.ops-theme-night .crm-hero,
.ops-theme-night .project-hero,
.ops-theme-night .project-mini-card,
.ops-theme-night .bundle-card,
.ops-theme-night .proposal-card,
.ops-theme-night .review-type-card,
.ops-theme-night .review-catchup-card,
.ops-theme-night .customer-portal-card,
.ops-theme-night .summary-card,
.ops-theme-night .template-list-card,
.ops-theme-night .wizard-panel,
.ops-theme-night .editable-row,
.ops-theme-night .notification-panel,
.ops-theme-night .schedule-work-card,
.ops-theme-night .crew-schedule-card,
.ops-theme-night .automation-modal,
.ops-theme-night .dispatch-action-modal,
.ops-theme-night .action-step-panel,
.ops-theme-night .slot-card,
.ops-theme-night .technician-pick-card,
.ops-theme-night .automation-batch-card,
.ops-theme-night .automation-action-card,
.ops-theme-night .automation-result-panel,
.ops-theme-night .timeline-entry,
.ops-theme-night .crew-assignment-chip,
.ops-theme-night .health-score-card,
.ops-theme-night .executive-metric-card,
.ops-theme-night .mini-metric-card,
.ops-theme-night .executive-alert-card,
.ops-theme-night .client-risk-card,
.ops-theme-night .intake-section-card,
.ops-theme-night .intake-subsection-panel,
.ops-theme-night .intake-summary-panel,
.ops-theme-night .dispatch-command-pane,
.ops-theme-night .dispatch-selected-header,
.ops-theme-night .dispatch-facts-grid > div,
.ops-theme-night .dispatch-detail-card,
.ops-theme-night .dispatch-queue-card,
.ops-theme-night .resource-availability-card,
.ops-theme-night .decision-button,
.ops-theme-night .assigned-resource-chip,
.ops-theme-night .add-resource-chip,
.ops-theme-night .dispatch-sticky-actions {
    background: var(--bg-card);
    border-color: var(--line);
    box-shadow: var(--panel-shadow);
    color: var(--ops-text);
}

.ops-theme-night .intake-section-card,
.ops-theme-night .intake-subsection-panel,
.ops-theme-night .intake-summary-panel,
.ops-theme-night .dispatch-queue-card,
.ops-theme-night .resource-availability-card,
.ops-theme-night .dispatch-selected-header,
.ops-theme-night .dispatch-detail-card,
.ops-theme-night .dispatch-facts-grid > div {
    background: color-mix(in srgb, var(--bg-card) 72%, var(--bg-card-elevated) 28%);
}

.ops-theme-night .ui-data-table-header,
.ops-theme-night .table-shell thead,
.ops-theme-night .ops-table th,
.ops-theme-night .project-commercial-table .analytics-row,
.ops-theme-night .customer-portal-stat-list div,
.ops-theme-night .dispatch-action-modal header,
.ops-theme-night .dispatch-action-modal footer,
.ops-theme-night .automation-modal header,
.ops-theme-night .automation-modal footer {
    background: var(--bg-card-elevated);
    border-color: var(--line);
}

.ops-theme-night input,
.ops-theme-night select,
.ops-theme-night textarea,
.ops-theme-night .modal-field input,
.ops-theme-night .modal-field select,
.ops-theme-night .modal-field textarea,
.ops-theme-night .currency-input,
.ops-theme-night .form-panel input,
.ops-theme-night .form-panel select,
.ops-theme-night .form-panel textarea,
.ops-theme-night .dashboard-filter-grid select,
.ops-theme-night .dashboard-filter-grid input,
.ops-theme-night .global-search input,
.ops-theme-night .filter-search input,
.ops-theme-night .dispatch-search,
.ops-theme-night .dispatch-form-grid input,
.ops-theme-night .dispatch-form-grid select,
.ops-theme-night .assignment-note textarea,
.ops-theme-night .material-line-row input,
.ops-theme-night .material-line-row select {
    background: var(--bg-input);
    border-color: var(--border-soft);
    color: var(--ops-text);
}

.ops-theme-night input::placeholder,
.ops-theme-night textarea::placeholder {
    color: var(--text-muted);
}

.ops-theme-night input:focus,
.ops-theme-night select:focus,
.ops-theme-night textarea:focus,
.ops-theme-night .modal-field input:focus,
.ops-theme-night .modal-field select:focus,
.ops-theme-night .modal-field textarea:focus,
.ops-theme-night .global-search:focus-within,
.ops-theme-night .currency-input:focus-within {
    border-color: rgba(47, 111, 159, .58);
    box-shadow: 0 0 0 3px rgba(47, 111, 159, .15);
}

.ops-theme-night .filter-chips button,
.ops-theme-night .responsive-tabs button,
.ops-theme-night .crm-segmented button,
.ops-theme-night .project-tabs button,
.ops-theme-night .intake-step-button,
.ops-theme-night .dispatch-filter-chip {
    background: var(--bg-card-elevated);
    border-color: var(--line);
    color: var(--text-secondary);
}

.ops-theme-night .filter-chips button.active,
.ops-theme-night .responsive-tabs button.active,
.ops-theme-night .crm-segmented button.active,
.ops-theme-night .project-tabs button.active,
.ops-theme-night .intake-step-button.active,
.ops-theme-night .dispatch-filter-chip.active {
    background: rgba(47, 111, 159, .14);
    border-color: rgba(47, 111, 159, .34);
    color: #1f5279;
}

.ops-theme-night .priority-choice {
    background: #dbe4ed;
    border-color: #aebdca;
    color: var(--ops-text);
}

.ops-theme-night .priority-choice.priority-low {
    background: #d5ebe7;
    color: #176c61;
    border-color: #8fc8bf;
}

.ops-theme-night .priority-choice.priority-medium {
    background: #d8e7f5;
    color: #245d8a;
    border-color: #91b8d8;
}

.ops-theme-night .priority-choice.priority-high {
    background: #f2e6c7;
    color: #845b0d;
    border-color: #d4b66d;
}

.ops-theme-night .priority-choice.priority-emergency {
    background: #f0d6da;
    color: #9e3d47;
    border-color: #d99aa2;
}

.ops-theme-night .priority-choice.selected.priority-low {
    background: #9dd8cf;
    border-color: #287f73;
    color: #0f463f;
}

.ops-theme-night .priority-choice.selected.priority-medium {
    background: #9fc5e7;
    border-color: #2f6f9f;
    color: #183f60;
}

.ops-theme-night .priority-choice.selected.priority-high {
    background: #e1c577;
    border-color: #9b6d12;
    color: #553a07;
}

.ops-theme-night .priority-choice.selected.priority-emergency {
    background: #df9ca4;
    border-color: #b94a54;
    color: #68222a;
}

.ops-theme-night .intake-customer-status,
.ops-theme-night .intake-customer-status.searching {
    background: #dce5ee;
    border-color: #aebdca;
    color: var(--ops-text);
}

.ops-theme-night .intake-customer-status.found {
    background: #d3e5f3;
    border-color: #86b5dc;
    color: #1f5279;
}

.ops-theme-night .intake-customer-status.missing {
    background: #f0dfb7;
    border-color: #d4b66d;
    color: #75500b;
}

.ops-theme-night .intake-customer-suggestions {
    background: #e3e9ef;
    border-color: #aebdca;
    box-shadow: 0 18px 34px rgba(65, 82, 99, .18);
}

.ops-theme-night .intake-customer-suggestion {
    background: #eef3f7;
    border-color: #bac7d3;
    color: var(--ops-text);
}

.ops-theme-night .intake-customer-suggestion:hover {
    background: #d8e7f5;
    border-color: #91b8d8;
}

.ops-theme-night .topbar-primary-action {
    background: #2f6f9f;
    box-shadow: 0 10px 22px rgba(47, 111, 159, .18);
}

.ops-theme-night .attention-pill {
    background: #f1e2bb;
    color: #7b540b;
    border: 1px solid rgba(155, 109, 18, .2);
}

.ops-theme-night .theme-mode-toggle,
.ops-theme-night .theme-toggle {
    background: #d8e1ea;
    border-color: #aebdca;
    color: var(--ops-text);
}

.ops-theme-night .theme-mode-button {
    color: #526577;
}

.ops-theme-night .theme-mode-button:hover {
    color: #263746;
    background: #e3e9ef;
}

.ops-theme-night .theme-mode-button.selected {
    color: #1f5279;
    border-color: rgba(47, 111, 159, .32);
    background: rgba(47, 111, 159, .13);
}

.ops-theme-night .notification-bell {
    background: #d8e1ea;
    border-color: #aebdca;
    color: #526577;
}

.ops-theme-night .notification-panel {
    background: #e3e9ef;
    border-color: #aebdca;
}

.ops-theme-night .notification-item {
    background: #eef3f7;
    border-color: #bac7d3;
}

.ops-theme-night .notification-item button {
    background: #d8e1ea;
    border-color: #aebdca;
    color: var(--ops-text);
}

.ops-theme-night .leaflet-map,
.ops-theme-night .leaflet-container {
    background: #d8e1ea;
    border-color: #aebdca;
}

.ops-theme-night .leaflet-control-zoom a,
.ops-theme-night .leaflet-bar a,
.ops-theme-night .leaflet-control-layers-toggle,
.ops-theme-night .leaflet-popup-content-wrapper,
.ops-theme-night .leaflet-popup-tip {
    background: #eef3f7;
    color: var(--ops-text);
    border-color: #aebdca;
}

.ops-theme-night .leaflet-control-attribution {
    background: rgba(238, 243, 247, .88);
    color: var(--text-secondary);
}

/* Reference-style Dispatch Center */
.dispatch-ref-mobile-tabs {
    display: none;
}

@media (min-width: 901px) {
    .content:has(.dispatch-center-page-shell) {
        height: calc(100dvh - 3.15rem);
        overflow: hidden;
        padding-bottom: 1rem;
        padding-top: 1rem;
    }

    .dispatch-center-page-shell {
        gap: 0.75rem;
        grid-template-rows: auto minmax(0, 1fr);
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .dispatch-center-page-shell > .ui-workspace {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        min-height: 0;
        overflow: hidden;
    }

    .dispatch-center-page-shell .module-header {
        margin-bottom: 0;
    }

    .dispatch-center-page-shell .validation-banner,
    .dispatch-center-page-shell .success-banner {
        margin-bottom: 0;
    }

    .dispatch-center-page-shell .dispatch-ref-shell {
        height: 100%;
        min-height: 0;
    }

    .dispatch-center-page-shell .dispatch-ref-queue,
    .dispatch-center-page-shell .dispatch-ref-detail {
        height: 100%;
        min-height: 0;
    }
}

.dispatch-ref-shell {
    display: grid;
    grid-template-columns: clamp(330px, 24vw, 380px) minmax(0, 1fr);
    gap: 16px;
    min-height: calc(100vh - 190px);
    min-width: 0;
    overflow: hidden;
}

.dispatch-ref-queue,
.dispatch-ref-detail,
.dispatch-ref-panel,
.dispatch-ref-modal {
    min-width: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.dispatch-ref-queue {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.dispatch-ref-queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 12px;
}

.dispatch-ref-queue-header p,
.dispatch-ref-workorder-header p,
.dispatch-ref-modal header p {
    margin: 0 0 4px;
    color: var(--accent-danger);
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.dispatch-ref-queue-header h2,
.dispatch-ref-workorder-header h2,
.dispatch-ref-panel-title h3,
.dispatch-ref-actions-section h3,
.dispatch-ref-modal header h2 {
    margin: 0;
    color: var(--text-primary);
}

.dispatch-ref-queue-header span {
    display: inline-grid;
    min-width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 999px;
    color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 13%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent-primary) 28%, transparent);
    font-weight: 800;
}

.dispatch-ref-search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 18px 12px;
    padding: 0 12px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
}

.dispatch-ref-search input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--text-primary);
    background: transparent;
}

.dispatch-ref-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 18px 14px;
    overflow: visible;
}

.dispatch-ref-filters button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    color: var(--text-secondary);
    background: var(--bg-card-elevated);
    font-weight: 800;
    white-space: nowrap;
}

.dispatch-ref-filters button.active {
    color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 14%, var(--bg-card));
    border-color: color-mix(in srgb, var(--accent-primary) 42%, transparent);
}

.dispatch-ref-filters span {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-muted) 12%, transparent);
    font-size: .75rem;
}

.dispatch-ref-filter-icon {
    display: none;
    width: 36px;
    flex: 0 0 auto;
    justify-content: center;
    padding: 0 !important;
}

.dispatch-ref-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 0 18px 18px;
    scrollbar-gutter: stable;
}

.dispatch-ref-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    flex: 0 0 auto;
    min-height: 178px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: var(--bg-card-elevated);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.dispatch-ref-card.selected {
    border-color: color-mix(in srgb, var(--accent-primary) 62%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-primary) 32%, transparent), 0 18px 40px color-mix(in srgb, var(--accent-primary) 13%, transparent);
}

.dispatch-ref-card:hover {
    transform: translateY(-1px);
}

.dispatch-ref-card-select {
    position: relative;
    display: grid;
    align-content: start;
    gap: 7px;
    width: 100%;
    min-height: 176px;
    min-width: 0;
    padding: 14px 12px 14px 18px;
    border: 0;
    text-align: left;
    color: inherit;
    background: transparent;
    overflow: visible;
    cursor: pointer;
}

.dispatch-ref-card-select > span:not(.dispatch-ref-priority-rail) {
    position: relative;
    z-index: 1;
}

.dispatch-ref-priority-rail {
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--priority-color);
}

.dispatch-ref-priority-rail.emergency,
.dispatch-ref-priority-badge.emergency {
    --priority-color: #ef4444;
}

.dispatch-ref-priority-rail.high,
.dispatch-ref-priority-badge.high {
    --priority-color: #f59e0b;
}

.dispatch-ref-priority-rail.medium,
.dispatch-ref-priority-badge.medium {
    --priority-color: #3b82f6;
}

.dispatch-ref-priority-rail.low,
.dispatch-ref-priority-badge.low {
    --priority-color: #10b981;
}

.dispatch-ref-card-top,
.dispatch-ref-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dispatch-ref-card-top strong,
.dispatch-ref-customer,
.dispatch-ref-summary strong,
.dispatch-ref-facts dd {
    color: var(--text-primary);
}

.dispatch-ref-priority-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    color: var(--priority-color);
    border: 1px solid color-mix(in srgb, var(--priority-color) 45%, transparent);
    background: color-mix(in srgb, var(--priority-color) 14%, transparent);
    font-size: .76rem;
    font-weight: 900;
}

.dispatch-ref-customer {
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.25;
}

.dispatch-ref-phone,
.dispatch-ref-location,
.dispatch-ref-card-meta {
    color: var(--text-muted);
    font-size: .82rem;
    line-height: 1.25;
}

.dispatch-ref-issue {
    color: var(--text-secondary);
    font-weight: 800;
    line-height: 1.25;
}

.dispatch-ref-mini-tags,
.dispatch-ref-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dispatch-ref-mini-tags span,
.dispatch-ref-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--accent-primary) 9%, var(--bg-card));
    border: 1px solid var(--border-soft);
    font-size: .72rem;
    font-weight: 800;
}

.dispatch-ref-card-actions {
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 12px 12px 12px 0;
}

.dispatch-ref-card-actions a {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 12px;
    color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
    border: 1px solid var(--border-soft);
    text-decoration: none;
}

.dispatch-ref-detail {
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 18px;
    scrollbar-gutter: stable;
}

.dispatch-ref-workorder,
.dispatch-ref-actions-section,
.dispatch-ref-timeline {
    display: grid;
    gap: 16px;
}

.dispatch-ref-workorder-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 4px 2px 8px;
    border-bottom: 1px solid var(--border-soft);
}

.dispatch-ref-workorder-header h2 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1;
}

.dispatch-ref-workorder-header span,
.dispatch-ref-panel-title span {
    color: var(--text-secondary);
}

.dispatch-ref-workorder-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.dispatch-ref-workorder-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    max-width: min(560px, 42vw);
}

.dispatch-ref-workorder-tags > span:not(.dispatch-ref-priority-badge) {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 0 10px;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--bg-input) 76%, var(--accent-primary) 6%);
    font-size: .78rem;
    font-weight: 900;
    white-space: nowrap;
}

.dispatch-ref-workorder-meta button {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    color: var(--text-secondary);
    background: var(--bg-card-elevated);
}

.dispatch-ref-grid {
    display: grid;
    gap: 16px;
}

.dispatch-ref-grid.two {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
    align-items: stretch;
}

.dispatch-ref-panel {
    padding: 16px;
}

.dispatch-ref-grid.two > .dispatch-ref-panel {
    height: 100%;
}

.dispatch-ref-job-panel {
    display: grid;
    align-content: start;
    gap: 12px;
}

.dispatch-ref-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dispatch-ref-panel-title.compact {
    margin: 2px 0 0;
}

.dispatch-ref-facts,
.dispatch-ref-requirements {
    display: grid;
    gap: 12px;
    margin: 0;
}

.dispatch-ref-facts div,
.dispatch-ref-summary > div,
.dispatch-ref-requirements > div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--bg-input);
}

.dispatch-ref-facts dt,
.dispatch-ref-summary span,
.dispatch-ref-requirements span {
    color: var(--text-muted);
    font-size: .78rem;
    font-weight: 800;
}

.dispatch-ref-facts dd {
    margin: 0;
    font-weight: 900;
}

.dispatch-ref-location-preview {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.dispatch-ref-leaflet-map,
.dispatch-ref-no-map {
    min-height: 184px;
    height: 184px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: var(--bg-input);
}

.dispatch-ref-no-map {
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 16px;
    color: var(--text-muted);
    text-align: center;
    font-weight: 800;
}

.dispatch-ref-no-map svg {
    color: var(--accent-primary);
}

.dispatch-ref-mini-map {
    position: relative;
    min-height: 152px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background:
        radial-gradient(circle at 58% 46%, color-mix(in srgb, var(--accent-primary) 22%, transparent) 0 2px, transparent 3px),
        linear-gradient(135deg, transparent 0 48%, color-mix(in srgb, var(--accent-warning) 25%, transparent) 49% 51%, transparent 52%),
        linear-gradient(45deg, transparent 0 38%, color-mix(in srgb, var(--accent-primary) 18%, transparent) 39% 41%, transparent 42%),
        repeating-linear-gradient(18deg, color-mix(in srgb, var(--border-soft) 58%, transparent) 0 2px, transparent 2px 34px),
        repeating-linear-gradient(108deg, color-mix(in srgb, var(--border-soft) 46%, transparent) 0 2px, transparent 2px 42px),
        color-mix(in srgb, var(--bg-input) 82%, var(--accent-primary) 5%);
}

.dispatch-ref-mini-map.empty {
    background:
        repeating-linear-gradient(20deg, color-mix(in srgb, var(--border-soft) 58%, transparent) 0 2px, transparent 2px 38px),
        repeating-linear-gradient(110deg, color-mix(in srgb, var(--border-soft) 46%, transparent) 0 2px, transparent 2px 44px),
        var(--bg-input);
}

.dispatch-ref-map-pin {
    position: absolute;
    left: 50%;
    top: 48%;
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    transform: translate(-50%, -70%);
    border: 2px solid color-mix(in srgb, #fff 78%, var(--accent-primary) 22%);
    border-radius: 999px;
    color: #fff;
    background: var(--accent-danger);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .28);
}

.dispatch-ref-mini-map small {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    overflow: hidden;
    padding: 7px 10px;
    border: 1px solid color-mix(in srgb, var(--border-soft) 70%, transparent);
    border-radius: 999px;
    color: var(--text-primary);
    background: color-mix(in srgb, var(--bg-card-elevated) 88%, transparent);
    font-size: .78rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}

.dispatch-ref-map-link {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid color-mix(in srgb, var(--accent-primary) 34%, transparent);
    border-radius: 999px;
    color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
    font-size: .82rem;
    font-weight: 900;
    text-decoration: none;
}

.dispatch-ref-contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.dispatch-ref-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 900;
}

.dispatch-ref-contact.whatsapp {
    color: #047857;
    background: color-mix(in srgb, #10b981 14%, transparent);
    border: 1px solid color-mix(in srgb, #10b981 35%, transparent);
}

.dispatch-ref-contact.call {
    color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent-primary) 35%, transparent);
}

.dispatch-ref-requirements strong {
    display: inline-flex;
    width: fit-content;
    min-height: 28px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    font-size: .8rem;
}

.dispatch-ref-requirements strong.required {
    color: var(--accent-warning);
    background: color-mix(in srgb, var(--accent-warning) 13%, transparent);
}

.dispatch-ref-requirements strong.complete {
    color: var(--accent-success);
    background: color-mix(in srgb, var(--accent-success) 13%, transparent);
}

.dispatch-ref-requirements strong.scheduled {
    color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 13%, transparent);
}

.dispatch-ref-requirements strong.not-required {
    color: var(--text-muted);
    background: color-mix(in srgb, var(--text-muted) 10%, transparent);
}

.dispatch-ref-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dispatch-ref-summary .wide {
    grid-column: 1 / -1;
}

.dispatch-ref-issue-copy span {
    color: var(--accent-primary);
    font-size: .86rem;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.dispatch-ref-issue-copy strong {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.45;
}

.dispatch-ref-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.dispatch-ref-gallery.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dispatch-ref-photo,
.dispatch-ref-empty-gallery {
    min-height: 132px;
    border: 1px solid var(--border-soft);
    border-radius: 15px;
    color: var(--text-secondary);
    background: var(--bg-input);
}

.dispatch-ref-photo {
    position: relative;
    overflow: hidden;
    padding: 0;
}

.dispatch-ref-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dispatch-ref-photo span {
    position: absolute;
    inset: auto 8px 8px;
    padding: 5px 8px;
    border-radius: 999px;
    color: #fff;
    background: rgba(15, 23, 42, .72);
    font-size: .76rem;
    font-weight: 800;
}

.dispatch-ref-photo.more {
    display: grid;
    place-items: center;
    gap: 4px;
}

.dispatch-ref-photo.more strong {
    color: var(--text-primary);
    font-size: 1.8rem;
}

.dispatch-ref-empty-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 110px;
}

.dispatch-ref-gallery.compact .dispatch-ref-photo,
.dispatch-ref-empty-gallery.compact {
    min-height: 104px;
}

.dispatch-ref-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.dispatch-ref-action-card {
    display: grid;
    gap: 10px;
    min-height: 178px;
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    text-align: left;
    color: var(--text-secondary);
    background: var(--bg-card);
}

.dispatch-ref-action-card > span {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 14px;
    color: var(--action-color);
    background: color-mix(in srgb, var(--action-color) 12%, transparent);
}

.dispatch-ref-action-card strong {
    color: var(--text-primary);
    font-size: 1rem;
}

.dispatch-ref-action-card small {
    color: var(--text-muted);
    line-height: 1.45;
}

.dispatch-ref-action-card em {
    align-self: end;
    color: var(--action-color);
    font-style: normal;
    font-weight: 900;
}

.dispatch-ref-action-card.dispatch { --action-color: #2563eb; }
.dispatch-ref-action-card.schedule { --action-color: #0f766e; }
.dispatch-ref-action-card.quote { --action-color: #d97706; }
.dispatch-ref-action-card.cancel { --action-color: #dc2626; }

.dispatch-ref-timeline {
    gap: 12px;
}

.dispatch-ref-timeline > div {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 12px;
}

.dispatch-ref-timeline > div > span {
    width: 12px;
    height: 12px;
    margin-top: 5px;
    border-radius: 999px;
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

.dispatch-ref-timeline strong {
    color: var(--text-primary);
}

.dispatch-ref-timeline p,
.dispatch-ref-timeline small {
    margin: 2px 0 0;
    color: var(--text-muted);
}

.dispatch-ref-timeline small span {
    color: var(--accent-primary);
    font-weight: 900;
}

.dispatch-ref-modal-backdrop,
.dispatch-ref-lightbox {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(6, 12, 20, .68);
    backdrop-filter: blur(8px);
}

.dispatch-ref-modal {
    position: relative;
    width: min(880px, 96vw);
    max-height: min(86vh, 840px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.dispatch-ref-modal header {
    padding: 22px 24px 14px;
    border-bottom: 1px solid var(--border-soft);
}

.dispatch-ref-modal header span {
    color: var(--text-muted);
}

.dispatch-ref-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    color: var(--text-secondary);
    background: var(--bg-card-elevated);
}

.dispatch-ref-modal-body {
    display: grid;
    gap: 16px;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 24px;
}

.dispatch-ref-modal-body.compact {
    gap: 14px;
}

.dispatch-ref-technician-list {
    display: grid;
    gap: 10px;
}

.dispatch-ref-technician-list.mini {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dispatch-ref-technician-list button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    color: var(--text-secondary);
    background: var(--bg-input);
    text-align: left;
}

.dispatch-ref-technician-list button.selected {
    border-color: color-mix(in srgb, var(--accent-primary) 55%, transparent);
    background: color-mix(in srgb, var(--accent-primary) 13%, var(--bg-card));
}

.dispatch-ref-technician-list strong {
    display: block;
    color: var(--text-primary);
}

.dispatch-ref-technician-list small,
.dispatch-ref-technician-list em {
    color: var(--text-muted);
    font-style: normal;
}

.dispatch-ref-tech-status {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 900;
}

.dispatch-ref-tech-status.available {
    color: var(--accent-success);
    background: color-mix(in srgb, var(--accent-success) 13%, transparent);
}

.dispatch-ref-tech-status.on-job,
.dispatch-ref-tech-status.en-route {
    color: var(--accent-warning);
    background: color-mix(in srgb, var(--accent-warning) 13%, transparent);
}

.dispatch-ref-tech-status.off-shift {
    color: var(--text-muted);
    background: color-mix(in srgb, var(--text-muted) 10%, transparent);
}

.dispatch-ref-modal label {
    display: grid;
    gap: 7px;
    color: var(--text-secondary);
    font-weight: 800;
}

.dispatch-ref-modal input,
.dispatch-ref-modal select,
.dispatch-ref-modal textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    color: var(--text-primary);
    background: var(--bg-input);
    padding: 10px 12px;
}

.dispatch-ref-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.dispatch-ref-money-input {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
}

.dispatch-ref-money-input b {
    display: grid;
    place-items: center;
    border: 1px solid var(--border-soft);
    border-right: 0;
    border-radius: 12px 0 0 12px;
    color: var(--text-muted);
    background: var(--bg-card-elevated);
}

.dispatch-ref-money-input input {
    border-radius: 0 12px 12px 0;
}

.dispatch-ref-modal-warning {
    padding: 12px;
    border-radius: 14px;
    color: var(--accent-warning);
    background: color-mix(in srgb, var(--accent-warning) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent-warning) 35%, transparent);
    font-weight: 800;
}

.dispatch-ref-inline-title {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.dispatch-ref-confirm-row {
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--bg-input);
}

.dispatch-ref-confirm-row input {
    width: 18px;
    min-height: 18px;
}

.dispatch-ref-modal footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px 20px;
    border-top: 1px solid var(--border-soft);
}

.danger-action {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid color-mix(in srgb, var(--accent-danger) 55%, transparent);
    border-radius: 12px;
    color: #fff;
    background: var(--accent-danger);
    font-weight: 900;
}

.danger-action:disabled {
    opacity: .52;
}

.dispatch-ref-lightbox {
    grid-template-columns: auto minmax(0, 960px) auto;
    gap: 16px;
}

.dispatch-ref-lightbox img {
    max-width: 100%;
    max-height: 78vh;
    border-radius: 18px;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
}

.dispatch-ref-lightbox footer {
    grid-column: 2;
    display: flex;
    justify-content: space-between;
    color: #fff;
}

.dispatch-ref-lightbox-nav {
    display: inline-grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    color: #fff;
    background: rgba(15, 23, 42, .7);
}

@media (max-width: 1180px) {
    .dispatch-ref-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .dispatch-ref-mobile-tabs {
        display: flex;
        gap: 8px;
        margin-bottom: 12px;
    }

    .dispatch-ref-mobile-tabs button {
        flex: 1;
        min-height: 40px;
        border: 1px solid var(--border-soft);
        border-radius: 999px;
        color: var(--text-secondary);
        background: var(--bg-card);
        font-weight: 900;
    }

    .dispatch-ref-mobile-tabs button.active {
        color: var(--accent-primary);
        border-color: color-mix(in srgb, var(--accent-primary) 42%, transparent);
        background: color-mix(in srgb, var(--accent-primary) 13%, transparent);
    }

    .dispatch-ref-shell {
        display: block;
        min-height: auto;
    }

    .dispatch-ref-queue,
    .dispatch-ref-detail {
        display: none;
    }

    .dispatch-ref-queue.active,
    .dispatch-ref-detail.active {
        display: flex;
    }

    .dispatch-ref-detail.active {
        display: block;
    }

    .dispatch-ref-grid.two,
    .dispatch-ref-summary,
    .dispatch-ref-modal-grid,
    .dispatch-ref-technician-list.mini {
        grid-template-columns: 1fr;
    }

    .dispatch-ref-gallery,
    .dispatch-ref-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .dispatch-ref-card {
        grid-template-columns: 1fr;
    }

    .dispatch-ref-card-actions {
        display: flex;
        padding: 0 12px 12px 18px;
    }

    .dispatch-ref-workorder-header,
    .dispatch-ref-workorder-meta,
    .dispatch-ref-modal footer {
        align-items: stretch;
        flex-direction: column;
    }

    .dispatch-ref-gallery,
    .dispatch-ref-action-grid {
        grid-template-columns: 1fr;
    }

    .dispatch-ref-modal {
        width: 100%;
        max-height: 92vh;
    }

    .dispatch-ref-lightbox {
        grid-template-columns: 1fr;
    }

    .dispatch-ref-lightbox-nav {
        display: none;
    }

    .dispatch-ref-lightbox footer {
        grid-column: 1;
    }
}

.push-diagnostics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.whatsapp-intake-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 14px;
    align-items: start;
}

.whatsapp-intake-compose,
.whatsapp-diagnostics,
.whatsapp-review-panel {
    display: grid;
    gap: 12px;
}

.whatsapp-message-box {
    min-height: 220px;
    resize: vertical;
}

.whatsapp-review-panel {
    grid-column: 1 / -1;
}

.whatsapp-review-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.whatsapp-attachment-list,
.whatsapp-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.whatsapp-attachment-list span,
.whatsapp-chip-row span {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--accent-primary) 9%, var(--bg-card));
    font-size: .78rem;
    font-weight: 800;
}

.intake-chat-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
    gap: 14px;
    align-items: start;
}

.intake-chat-panel,
.intake-chat-draft {
    display: grid;
    gap: 12px;
}

.intake-chat-thread {
    min-height: 480px;
    max-height: calc(100vh - 310px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--accent-primary) 8%, transparent), transparent 34%),
        color-mix(in srgb, var(--bg-input) 76%, transparent);
}

.chat-bubble {
    width: min(76%, 720px);
    padding: 11px 13px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--bg-card-elevated);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
}

.chat-bubble.user {
    align-self: flex-end;
    border-color: color-mix(in srgb, var(--accent-primary) 34%, var(--border-soft));
    background: color-mix(in srgb, var(--accent-primary) 13%, var(--bg-card-elevated));
}

.chat-bubble.assistant {
    align-self: flex-start;
}

.chat-bubble span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.chat-bubble p {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.45;
}

.chat-suggestion-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.intake-chat-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.intake-chat-composer textarea {
    resize: vertical;
    min-height: 82px;
}

.draft-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.chat-requirement-grid {
    display: grid;
    gap: 8px;
}

.chat-requirement-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-input) 72%, transparent);
    color: var(--text-primary);
    font-weight: 800;
}

@media (max-width: 1100px) {
    .intake-chat-layout {
        grid-template-columns: 1fr;
    }

    .intake-chat-thread {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .intake-chat-composer,
    .draft-field-grid {
        grid-template-columns: 1fr;
    }

    .chat-bubble {
        width: 94%;
    }
}

@media (max-width: 1100px) {
    .whatsapp-intake-grid,
    .whatsapp-review-grid {
        grid-template-columns: 1fr;
    }

    .whatsapp-review-panel {
        grid-column: auto;
    }
}

.push-test-panel {
    grid-column: 1 / -1;
    display: grid;
    gap: 12px;
}

.push-status-list {
    display: grid;
    gap: 8px;
}

.push-status-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: color-mix(in srgb, var(--bg-input) 74%, transparent);
}

.push-status-list span {
    color: var(--text-secondary);
    font-weight: 700;
}

.push-status-list strong {
    color: var(--text-primary);
    text-align: right;
    overflow-wrap: anywhere;
}

.push-status-list .status-ok {
    color: var(--accent-success);
}

.push-status-list .status-warn {
    color: var(--accent-warning);
}

.push-warning-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.push-warning-list span {
    display: block;
    padding: 9px 11px;
    border: 1px solid color-mix(in srgb, var(--accent-warning) 42%, transparent);
    border-radius: 8px;
    color: var(--text-primary);
    background: color-mix(in srgb, var(--accent-warning) 12%, var(--bg-card));
}

.push-endpoint {
    display: block;
    margin-top: 10px;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.push-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.push-experiment-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.push-toggle-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.push-toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-input) 72%, transparent);
    color: var(--text-primary);
    font-weight: 800;
}

.push-toggle-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.push-capability-note {
    padding: 11px 12px;
    border: 1px solid color-mix(in srgb, var(--accent-info, #60a5fa) 32%, var(--border-soft));
    border-radius: 10px;
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--accent-info, #60a5fa) 9%, var(--bg-card));
    line-height: 1.45;
}

.push-result {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--bg-card-elevated);
}

.push-result span,
.push-result small {
    color: var(--text-secondary);
}

@media (max-width: 900px) {
    .push-diagnostics-grid {
        grid-template-columns: 1fr;
    }

    .push-test-panel {
        grid-column: auto;
    }

    .push-experiment-grid,
    .push-toggle-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .push-experiment-grid,
    .push-toggle-grid {
        grid-template-columns: 1fr;
    }
}

.push-current-subscription {
    display: grid;
    gap: 4px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent-info, #60A5FA) 10%, var(--bg-card));
}

.push-current-subscription > span,
.push-current-subscription small {
    color: var(--text-secondary);
    font-weight: 700;
}

.push-current-subscription strong {
    color: var(--text-primary);
    font-size: 1.02rem;
}

.dispatch-push-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0;
    padding: 8px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--bg-card);
}

.dispatch-push-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--bg-input) 82%, transparent);
    font-size: .84rem;
}

.dispatch-push-status strong {
    color: var(--text-primary);
}

.dispatch-push-status.sent {
    border-color: color-mix(in srgb, var(--accent-info, #60A5FA) 38%, transparent);
    background: color-mix(in srgb, var(--accent-info, #60A5FA) 12%, var(--bg-card));
}

.dispatch-push-status.received,
.dispatch-push-status.actioned {
    border-color: color-mix(in srgb, var(--accent-success) 44%, transparent);
    background: color-mix(in srgb, var(--accent-success) 13%, var(--bg-card));
}

.dispatch-push-status.skipped {
    border-color: color-mix(in srgb, var(--accent-warning) 42%, transparent);
    background: color-mix(in srgb, var(--accent-warning) 12%, var(--bg-card));
}

.dispatch-push-status.failed {
    border-color: color-mix(in srgb, var(--accent-danger) 42%, transparent);
    background: color-mix(in srgb, var(--accent-danger) 12%, var(--bg-card));
}
