@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
    color-scheme: light;
    --vw-primary: #1f7a8c;
    --vw-primary-strong: #155b66;
    --vw-primary-rgb: 31, 122, 140;
    --vw-accent: #2bb3c7;
    --vw-accent-strong: #1a92a8;
    --vw-accent-rgb: 43, 179, 199;
    --vw-success: #1f9d6a;
    --vw-success-rgb: 31, 157, 106;
    --vw-danger: #c62828;
    --vw-danger-rgb: 198, 40, 40;
    --vw-warning: #d4901f;
    --vw-warning-rgb: 212, 144, 31;
    --vw-surface: #ffffff;
    --vw-surface-muted: #f4f7f9;
    --vw-border: #dbe3ea;
    --vw-text: #16232c;
    --vw-text-muted: #5b6b78;
    --vw-sidebar-start: #0f3a4a;
    --vw-sidebar-end: #0b2534;
    --vw-sidebar-top: rgba(9, 33, 46, 0.7);
    --vw-sidebar-text: #dfe8ee;
    --vw-sidebar-hover: rgba(255, 255, 255, 0.12);
    --vw-sidebar-active: rgba(255, 255, 255, 0.22);
    --vw-radius-sm: 0.5rem;
    --vw-radius: 0.75rem;
    --vw-radius-lg: 1rem;
    --vw-shadow-sm: 0 1px 3px rgba(15, 45, 60, 0.06), 0 1px 2px rgba(15, 45, 60, 0.04);
    --vw-shadow: 0 2px 8px rgba(15, 45, 60, 0.08), 0 1px 3px rgba(15, 45, 60, 0.04);
    --vw-shadow-lg: 0 4px 16px rgba(15, 45, 60, 0.1), 0 2px 4px rgba(15, 45, 60, 0.04);
    --bs-body-bg: var(--vw-surface-muted);
    --bs-body-color: var(--vw-text);
    --bs-link-color: var(--vw-primary);
    --bs-link-hover-color: var(--vw-primary-strong);
    --bs-primary: var(--vw-primary);
    --bs-primary-rgb: var(--vw-primary-rgb);
    --bs-border-color: var(--vw-border);
    --bs-secondary-color: var(--vw-text-muted);
    --bs-body-font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

html, body {
    font-family: var(--bs-body-font-family);
    background-color: var(--vw-surface-muted);
    color: var(--vw-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a, .btn-link {
    color: var(--vw-primary);
}

    a:hover, .btn-link:hover {
        color: var(--vw-primary-strong);
    }

/* ──────────────────────────────────────────
   Buttons
   ────────────────────────────────────────── */

.btn {
    border-radius: var(--vw-radius-sm);
    font-weight: 500;
    transition: all 150ms ease;
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--vw-primary);
    --bs-btn-border-color: var(--vw-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--vw-primary-strong);
    --bs-btn-hover-border-color: var(--vw-primary-strong);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--vw-primary-strong);
    --bs-btn-active-border-color: var(--vw-primary-strong);
    --bs-btn-focus-shadow-rgb: var(--vw-accent-rgb);
}

.btn-outline-secondary {
    --bs-btn-color: var(--vw-text);
    --bs-btn-border-color: var(--vw-border);
    --bs-btn-hover-bg: var(--vw-surface-muted);
    --bs-btn-hover-border-color: #c5cfd8;
    --bs-btn-hover-color: var(--vw-text);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(var(--vw-accent-rgb), 0.35);
}

/* ──────────────────────────────────────────
   Cards — unified
   ────────────────────────────────────────── */

.card {
    border: 1px solid var(--vw-border);
    border-radius: var(--vw-radius);
    box-shadow: var(--vw-shadow-sm);
}

.card-body {
    padding: 1rem;
}

/* ──────────────────────────────────────────
   Page Header — consistent across all pages
   ────────────────────────────────────────── */

.vw-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.vw-page-header__title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: var(--vw-text);
}

.vw-page-header__subtitle {
    color: var(--vw-text-muted);
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.vw-page-header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ──────────────────────────────────────────
   Filter Bar — consistent search + filters
   ────────────────────────────────────────── */

.vw-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.vw-filter-bar__search {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    position: relative;
}

.vw-filter-bar__search .form-control {
    padding-left: 2.5rem;
    border-radius: var(--vw-radius-sm);
    background: var(--vw-surface);
    border-color: var(--vw-border);
}

.vw-filter-bar__search .form-control:focus {
    border-color: var(--vw-accent);
    background: var(--vw-surface);
}

.vw-filter-bar__search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--vw-text-muted);
    pointer-events: none;
    width: 16px;
    height: 16px;
}

.vw-filter-bar__toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    color: var(--vw-text);
    font-size: 0.92rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--vw-border);
    border-radius: var(--vw-radius-sm);
    background: var(--vw-surface);
}

.vw-filter-bar__toggle .form-check-input {
    width: 1.15em;
    height: 1.15em;
}

.vw-filter-bar__count {
    color: var(--vw-text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
    margin-left: auto;
}

/* ──────────────────────────────────────────
   Stat Cards — dashboard + summary rows
   ────────────────────────────────────────── */

.vw-stat-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
}

.vw-stat-card__icon {
    flex-shrink: 0;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: var(--vw-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vw-stat-card__icon svg {
    width: 18px;
    height: 18px;
}

.vw-stat-card__icon--primary {
    background: rgba(var(--vw-primary-rgb), 0.1);
    color: var(--vw-primary);
}

.vw-stat-card__icon--success {
    background: rgba(var(--vw-success-rgb), 0.1);
    color: var(--vw-success);
}

.vw-stat-card__icon--danger {
    background: rgba(var(--vw-danger-rgb), 0.1);
    color: var(--vw-danger);
}

.vw-stat-card__icon--warning {
    background: rgba(var(--vw-warning-rgb), 0.1);
    color: var(--vw-warning);
}

.vw-stat-card__label {
    font-size: 0.8rem;
    color: var(--vw-text-muted);
    font-weight: 500;
    margin-bottom: 0.15rem;
}

.vw-stat-card__value {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--vw-text);
}

.vw-stat-card__detail {
    font-size: 0.78rem;
    color: var(--vw-text-muted);
    margin-top: 0.15rem;
}

/* ──────────────────────────────────────────
   Empty States — consistent across all pages
   ────────────────────────────────────────── */

.vw-empty {
    text-align: center;
    padding: 2rem 1.25rem;
}

.vw-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    background: var(--vw-surface-muted);
    margin-bottom: 0.75rem;
    color: var(--vw-text-muted);
}

.vw-empty__icon svg {
    width: 20px;
    height: 20px;
}

.vw-empty__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--vw-text);
    margin-bottom: 0.3rem;
}

.vw-empty__text {
    color: var(--vw-text-muted);
    font-size: 0.82rem;
    max-width: 380px;
    margin: 0 auto 1rem;
    line-height: 1.5;
}

.vw-empty__actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ──────────────────────────────────────────
   Tables — unified styling
   ────────────────────────────────────────── */

.vw-table {
    margin-bottom: 0;
}

.vw-table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--vw-text-muted);
    border-bottom-width: 1px;
    padding: 0.65rem 0.85rem;
    white-space: nowrap;
}

.vw-table tbody td {
    padding: 0.75rem 0.85rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--vw-surface-muted);
}

.vw-table tbody tr:last-child td {
    border-bottom: 0;
}

/* Payments (Invoicing) — reconciliation table: fixed customer width, keep action buttons on one line */
.vw-payments-recon-table {
    table-layout: fixed;
    width: 100%;
    max-width: 100%;
}

.vw-payments-recon-table col.vw-payments-recon-customer-col {
    width: 200px;
}

.vw-payments-recon-table th.vw-payments-recon-customer,
.vw-payments-recon-table td.vw-payments-recon-customer {
    width: 200px;
    max-width: 200px;
    min-width: 0;
    overflow: hidden;
    vertical-align: middle;
}

.vw-payments-recon-table .vw-payments-recon-actions {
    width: 132px;
    min-width: 132px;
    white-space: nowrap;
}

/* Account → Service Frequencies: keep Edit/Delete on one row (fixed 100px col was wrapping buttons) */
.vw-freq-actions-col {
    width: 1%;
    min-width: 148px;
    white-space: nowrap;
}

.vw-freq-actions-cell {
    white-space: nowrap;
    vertical-align: middle;
    min-width: 148px;
}

.vw-customers-table {
    table-layout: fixed;
    width: 100%;
}

.vw-customers-name-cell {
    max-width: 220px;
}

.vw-customers-name-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.vw-customers-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vw-row-clickable {
    cursor: pointer;
    transition: background-color 100ms ease;
}

    .vw-row-clickable:hover {
        background-color: rgba(var(--vw-accent-rgb), 0.05);
    }

    .vw-row-clickable:focus-visible {
        outline: 2px solid rgba(var(--vw-accent-rgb), 0.85);
        outline-offset: -2px;
        background-color: rgba(var(--vw-accent-rgb), 0.05);
    }

/* ──────────────────────────────────────────
   Badges — status indicators
   ────────────────────────────────────────── */

.vw-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.vw-badge--success {
    background: rgba(var(--vw-success-rgb), 0.1);
    color: var(--vw-success);
}

.vw-badge--danger {
    background: rgba(var(--vw-danger-rgb), 0.08);
    color: var(--vw-danger);
}

.vw-badge--warning {
    background: rgba(var(--vw-warning-rgb), 0.12);
    color: var(--vw-warning);
}

.vw-badge--primary {
    background: rgba(var(--vw-primary-rgb), 0.1);
    color: var(--vw-primary);
}

.vw-badge--muted {
    background: var(--vw-surface-muted);
    color: var(--vw-text-muted);
}

.vw-badge--service {
    font-size: 0.82rem;
    padding: 0.22rem 0.65rem;
}

/* ──────────────────────────────────────────
   Segmented Control (Day/Week toggle etc.)
   ────────────────────────────────────────── */

.vw-segmented-control {
    display: inline-flex;
    background: var(--vw-surface-muted);
    border: 1px solid var(--vw-border);
    border-radius: 0.5rem;
    padding: 2px;
    gap: 2px;
}

.vw-segmented-control__btn {
    border: none;
    background: transparent;
    color: var(--vw-text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.3rem 0.85rem;
    border-radius: 0.38rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    line-height: 1.4;
}

.vw-segmented-control__btn:hover:not(.active) {
    color: var(--vw-text);
}

.vw-segmented-control__btn.active {
    background: var(--vw-surface);
    color: var(--vw-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ──────────────────────────────────────────
   Due indicator dots
   ────────────────────────────────────────── */

.vw-due-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.vw-due-dot--overdue { background: var(--vw-danger); }
.vw-due-dot--soon { background: var(--vw-warning); }
.vw-due-dot--ok { background: var(--vw-success); }
.vw-due-dot--new { background: var(--vw-primary); }
.vw-due-dot--paused { background: #adb5bd; }

/* ──────────────────────────────────────────
   Progress Bars — use theme colors
   ────────────────────────────────────────── */

.progress {
    border-radius: 999px;
    background: var(--vw-surface-muted);
    height: 6px;
}

.progress-bar {
    background-color: var(--vw-primary);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.progress-bar-success { background-color: var(--vw-success); }
.progress-bar-warning { background-color: var(--vw-warning); }
.progress-bar-danger { background-color: var(--vw-danger); }

/* ──────────────────────────────────────────
   Section Headers — inside cards
   ────────────────────────────────────────── */

.vw-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vw-text-muted);
    margin-bottom: 0.75rem;
}

/* ──────────────────────────────────────────
   Who's Due — category cards
   ────────────────────────────────────────── */

.vw-category-card {
    cursor: pointer;
    border: 1px solid var(--vw-border);
    border-radius: var(--vw-radius);
    padding: 0.65rem 0.85rem;
    text-align: center;
    transition: all 150ms ease;
    background: var(--vw-surface);
}

.vw-category-card:hover {
    box-shadow: var(--vw-shadow);
    transform: translateY(-1px);
}

.vw-category-card--active {
    border-color: var(--vw-primary);
    box-shadow: 0 0 0 1px var(--vw-primary);
    background: rgba(var(--vw-primary-rgb), 0.03);
}

.vw-category-card__label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--vw-text-muted);
    margin-bottom: 0.25rem;
}

.vw-category-card__value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

/* ──────────────────────────────────────────
   Alert/Warning/Info icons
   ────────────────────────────────────────── */

.vw-alert-icon {
    display: inline-block;
    vertical-align: text-bottom;
}

.vw-alert-icon__triangle {
    fill: rgba(212, 144, 31, 0.25);
    stroke: #d4901f;
    stroke-width: 1.1;
    stroke-linejoin: round;
}

.vw-alert-icon__mark {
    fill: #d4901f;
}

/* ──────────────────────────────────────────
   Payments banner
   ────────────────────────────────────────── */

.vw-payments-banner {
    border-left: 4px solid transparent;
}

.vw-payments-banner--danger {
    border-left-color: var(--vw-danger);
    background: rgba(var(--vw-danger-rgb), 0.04);
}

.vw-payments-banner--clear {
    border-left-color: var(--vw-success);
    background: rgba(var(--vw-success-rgb), 0.04);
}

.vw-payments-banner__icon {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vw-payments-banner--danger .vw-payments-banner__icon {
    background: rgba(var(--vw-danger-rgb), 0.1);
    color: var(--vw-danger);
}

.vw-payments-banner--clear .vw-payments-banner__icon {
    background: rgba(var(--vw-success-rgb), 0.1);
    color: var(--vw-success);
}

.vw-payments-banner__headline {
    font-size: 1rem;
    font-weight: 700;
    color: var(--vw-danger);
    line-height: 1.3;
}

.vw-payments-banner__headline--clear {
    color: var(--vw-success);
}

.vw-payments-banner__detail {
    font-size: 0.82rem;
    color: var(--vw-text-muted);
    margin-top: 0.1rem;
}

.vw-payments-banner__arrow {
    flex-shrink: 0;
    color: var(--vw-text-muted);
    opacity: 0.5;
    transition: opacity 120ms ease, transform 120ms ease;
}

a:hover .vw-payments-banner .vw-payments-banner__arrow {
    opacity: 1;
    transform: translateX(2px);
}

/* ──────────────────────────────────────────
   Card hover/link effects
   ────────────────────────────────────────── */

.vw-card-link {
    transition: transform 70ms ease, box-shadow 160ms ease;
}

a:hover .vw-card-link {
    transform: translateY(-1px);
    box-shadow: var(--vw-shadow-lg);
}

.vw-plan-card {
    cursor: pointer;
    border: 1px solid var(--vw-border);
    transition: border-color 120ms ease, box-shadow 160ms ease;
}

.vw-plan-card--selected {
    border-color: var(--vw-accent);
    box-shadow: 0 0 0 0.15rem rgba(var(--vw-accent-rgb), 0.25);
}

.vw-plan-card .form-check {
    margin-bottom: 0;
}

/* ──────────────────────────────────────────
   Forms — consistent
   ────────────────────────────────────────── */

.form-control, .form-select {
    border-radius: var(--vw-radius-sm);
    border-color: var(--vw-border);
}

.form-control:focus, .form-select:focus {
    border-color: var(--vw-accent);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ──────────────────────────────────────────
   Modal — polish + 1080p viewport fit
   ────────────────────────────────────────── */

.modal-dialog {
    max-height: calc(100vh - 3rem);
    display: flex;
    flex-direction: column;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.modal-content {
    border-radius: var(--vw-radius-lg);
    border: none;
    box-shadow: var(--vw-shadow-lg);
    max-height: calc(100vh - 3rem);
    display: flex;
    flex-direction: column;
}

.modal-header {
    border-bottom-color: var(--vw-surface-muted);
    padding: 0.85rem 1.25rem;
    flex-shrink: 0;
}

.modal-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-footer {
    border-top-color: var(--vw-surface-muted);
    padding: 0.65rem 1.25rem;
    flex-shrink: 0;
}

/* ──────────────────────────────────────────
   Content area
   ────────────────────────────────────────── */

.content {
    padding-top: 1rem;
    animation: vw-page-in 0.18s ease-out;
}

@keyframes vw-page-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

h1:focus {
    outline: none;
}

/* ──────────────────────────────────────────
   Validation
   ────────────────────────────────────────── */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--vw-success);
}

.invalid {
    outline: 1px solid var(--vw-danger);
}

.validation-message {
    color: var(--vw-danger);
}

/* ──────────────────────────────────────────
   Blazor loading + errors
   ────────────────────────────────────────── */

#blazor-error-ui {
    background: #fff4d6;
    border-top: 1px solid #f0d9a6;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(15, 45, 60, 0.16);
    color: #5a3f00;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

    .loading-progress circle:last-child {
        stroke: var(--vw-primary, #1f7a8c);
        stroke-dasharray: calc(3.14 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
        transition: stroke-dasharray 0.05s ease-in-out;
    }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--vw-text-muted, #5b6b78);
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, var(--vw-danger);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

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

/* ──────────────────────────────────────────
   Alerts — polish
   ────────────────────────────────────────── */

.alert {
    border-radius: var(--vw-radius-sm);
}


/* ──────────────────────────────────────────
   Planner day cards
   ────────────────────────────────────────── */

.vw-planner-day {
    border-left: 3px solid var(--vw-primary);
}

.vw-planner-day--rain {
    border-left-color: var(--vw-warning);
}

/* ──────────────────────────────────────────
   Modal — summary strip & sections
   ────────────────────────────────────────── */

.vw-modal-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.5rem 1.25rem;
    background: var(--vw-surface-muted);
    border-bottom: 1px solid var(--vw-border);
    font-size: 0.78rem;
}

.vw-modal-summary__item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--vw-text-muted);
    white-space: nowrap;
}

.vw-modal-summary__value {
    font-weight: 600;
    color: var(--vw-text);
}

.vw-status-pill {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    border-radius: 999px;
    padding: 0.25rem 0.85rem 0.25rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    margin-left: auto;
    margin-right: 0.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.6rem;
}

.vw-status-pill--active {
    background-color: rgba(25, 135, 84, 0.12);
    color: #0f6b3a;
}

.vw-status-pill--inactive {
    background-color: rgba(var(--vw-danger-rgb), 0.12);
    color: var(--vw-danger);
}

.vw-status-pill:focus {
    outline: 2px solid var(--vw-accent);
    outline-offset: 1px;
}

.vw-modal-section {
    padding: 0.75rem 0;
}

.vw-modal-section + .vw-modal-section {
    border-top: 1px solid var(--vw-surface-muted);
}

.vw-modal-section__title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vw-text);
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--vw-primary);
    display: inline-block;
}

.vw-modal-section__hint {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    color: var(--vw-primary);
    background: rgba(var(--vw-primary-rgb), 0.08);
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ──────────────────────────────────────────
   Contact quick-action links
   ────────────────────────────────────────── */

.vw-contact-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--vw-radius-sm);
    color: var(--vw-primary);
    background: rgba(var(--vw-primary-rgb), 0.08);
    transition: background 120ms ease, color 120ms ease;
    text-decoration: none;
    flex-shrink: 0;
}

.vw-contact-action:hover {
    background: rgba(var(--vw-primary-rgb), 0.16);
    color: var(--vw-primary-strong);
}

.vw-contact-action svg {
    width: 14px;
    height: 14px;
}

/* ──────────────────────────────────────────
   Customer pick cards (route modal)
   ────────────────────────────────────────── */

.vw-customer-pick {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.5rem 0.65rem;
    border-radius: var(--vw-radius-sm);
    border: 1px solid transparent;
    transition: background 100ms ease, border-color 100ms ease;
}

.vw-customer-pick:hover {
    background: rgba(var(--vw-accent-rgb), 0.04);
}

.vw-customer-pick--selected {
    background: rgba(var(--vw-primary-rgb), 0.04);
    border-color: rgba(var(--vw-primary-rgb), 0.15);
}

.vw-customer-pick__info {
    flex: 1;
    min-width: 0;
}

.vw-customer-pick__earnings {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--vw-text);
    white-space: nowrap;
    padding-top: 0.1rem;
}

/* ──────────────────────────────────────────
   Stop order — step indicators & reorder
   ────────────────────────────────────────── */

.vw-stop-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--vw-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}

@keyframes vw-stop-pop {
    from { transform: scale(0.4); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.vw-stop-number.vw-stop-cascade {
    animation: vw-stop-pop 0.15s ease-out backwards;
}

/* ──────────────────────────────────────────
   Stop list — draggable reorderable items
   ────────────────────────────────────────── */

.vw-stop-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 2px 0;
}

.vw-stop-item {
    border-radius: var(--vw-radius-sm);
    border: 2px solid transparent;
    transition: opacity 180ms ease, border-color 150ms ease;
    position: relative;
}

.vw-stop-item--dragging {
    opacity: 0.35;
}

.vw-stop-item--drop-before::before {
    content: "";
    display: block;
    height: 0;
    border-top: 2.5px solid var(--vw-accent);
    border-radius: 2px;
    margin: -1px 0.5rem 2px;
    box-shadow: 0 0 6px rgba(var(--vw-accent-rgb), 0.35);
}

.vw-stop-item__row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.5rem;
    border-radius: var(--vw-radius-sm);
    background: var(--vw-surface-muted);
    transition: background 120ms ease;
}

.vw-stop-item:hover .vw-stop-item__row {
    background: rgba(var(--vw-accent-rgb), 0.04);
}

.vw-stop-item__handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.75rem;
    flex-shrink: 0;
    cursor: grab;
    color: var(--vw-text-muted);
    opacity: 0.4;
    transition: opacity 150ms ease, color 150ms ease, background 150ms ease;
    border-radius: 4px;
}

.vw-stop-item:hover .vw-stop-item__handle {
    opacity: 0.7;
}

.vw-stop-item__handle:hover {
    opacity: 1 !important;
    color: var(--vw-text);
    background: rgba(0, 0, 0, 0.05);
}

.vw-stop-item__handle:active {
    cursor: grabbing;
}

.vw-stop-item__body {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.vw-stop-item__end {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.vw-stop-item__buttons {
    display: flex;
    gap: 2px;
    opacity: 0.55;
    transition: opacity 150ms ease;
}

.vw-stop-item:hover .vw-stop-item__buttons {
    opacity: 1;
}

.vw-move-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 6px;
    border: 1px solid var(--vw-border);
    background: var(--vw-surface);
    color: var(--vw-text-muted);
    cursor: pointer;
    transition: background 100ms ease, color 100ms ease, border-color 100ms ease, transform 80ms ease;
    padding: 0;
}

.vw-move-btn:hover:not(:disabled) {
    background: var(--vw-surface-muted);
    color: var(--vw-text);
    border-color: #c5cfd8;
}

.vw-move-btn:active:not(:disabled) {
    transform: scale(0.92);
    background: rgba(var(--vw-primary-rgb), 0.08);
    border-color: var(--vw-primary);
    color: var(--vw-primary);
}

.vw-move-btn:disabled {
    opacity: 0.25;
    cursor: default;
}

.vw-move-btn--danger {
    color: var(--vw-danger);
    border-color: rgba(var(--vw-danger-rgb), 0.3);
    background: rgba(var(--vw-danger-rgb), 0.04);
}

.vw-move-btn--danger:hover:not(:disabled) {
    background: rgba(var(--vw-danger-rgb), 0.1);
    color: var(--vw-danger);
    border-color: rgba(var(--vw-danger-rgb), 0.4);
}

.vw-move-btn--danger:active:not(:disabled) {
    background: rgba(var(--vw-danger-rgb), 0.16);
    border-color: var(--vw-danger);
    color: var(--vw-danger);
}

.vw-move-btn svg {
    width: 12px;
    height: 12px;
}

/* ──────────────────────────────────────────
   Route summary cards (inside modal)
   ────────────────────────────────────────── */

.vw-route-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--vw-radius-sm);
    background: var(--vw-surface-muted);
    border: 1px solid var(--vw-border);
}

.vw-route-summary__icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--vw-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vw-route-summary__icon svg {
    width: 16px;
    height: 16px;
}

/* Stop number inline input */
.vw-stop-number-input {
    width: 48px;
    min-width: 48px;
    padding: 0.15rem 0.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--vw-radius-sm);
    flex-shrink: 0;
    -moz-appearance: textfield;
}

.vw-stop-number-input::-webkit-inner-spin-button,
.vw-stop-number-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Route stops card — fills remaining viewport */
.vw-route-stops-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 24rem);
    min-height: 280px;
}

.vw-route-stops-card > .card-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 0;
}

.vw-route-stops-scroll {
    flex: 1 1 0;
    overflow-y: auto;
    min-height: 0;
}

/* Service sub-list nesting */
.vw-service-nest {
    margin-left: 1.5rem;
    margin-top: 0.35rem;
    margin-bottom: 0.25rem;
    padding: 0.4rem 0.65rem;
    background: var(--vw-surface-muted);
    border-left: 2px solid var(--vw-border);
    border-radius: 0 var(--vw-radius-sm) var(--vw-radius-sm) 0;
}

/* History container */
.vw-history-container {
    background: var(--vw-surface-muted);
    border-radius: var(--vw-radius-sm);
    padding: 0.75rem;
    border: 1px solid var(--vw-border);
}

/* ──────────────────────────────────────────
   Customer Detail page layout
   ────────────────────────────────────────── */

.vw-cd-context {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.65rem 1rem;
    margin-bottom: 1rem;
    background: var(--vw-surface);
    border: 1px solid var(--vw-border);
    border-radius: var(--vw-radius-lg);
    box-shadow: var(--vw-shadow-sm);
    font-size: 0.92rem;
}

.vw-cd-context__item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.vw-cd-context__value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--vw-text);
}

.vw-cd-context__label {
    font-weight: 600;
    color: var(--vw-text);
}

.vw-cd-context__sep {
    color: var(--vw-border);
    font-weight: 300;
    user-select: none;
}

.vw-cd-panel {
    background: var(--vw-surface);
    border: 1px solid var(--vw-border);
    border-radius: var(--vw-radius-lg);
    box-shadow: var(--vw-shadow-sm);
    overflow: hidden;
}

.vw-cd-panel__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--vw-border);
    background: var(--vw-surface-muted);
}

.vw-cd-panel__title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--vw-text);
    margin: 0;
}

.vw-cd-panel__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    padding: 0 0.35rem;
    height: 1.2rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    background: rgba(var(--vw-primary-rgb), 0.1);
    color: var(--vw-primary);
    margin-left: 0.4rem;
    vertical-align: middle;
}

.vw-cd-data {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: visible;
}

.vw-cd-history-panel {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    max-height: min(34vh, 320px);
    min-height: 0;
    overflow: hidden;
}

.vw-cd-history-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    padding: 0.55rem 1rem 0.75rem;
}

.vw-cd-history-empty {
    margin: 0;
    padding: 0.25rem 0;
    font-size: 0.84rem;
    color: var(--vw-text-muted);
}

.vw-cd-add-service-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem 0.75rem;
    border-top: 1px solid var(--vw-border);
    background: rgba(var(--vw-primary-rgb), 0.03);
}

.vw-cd-add-service-row .form-select {
    max-width: 340px;
}

@media (max-width: 991.98px) {
    .vw-cd-data {
        height: auto;
        overflow: visible;
    }

    .vw-cd-history-panel {
        max-height: 50vh;
    }

    .vw-cd-history-scroll {
        max-height: none;
    }
}

/* Inline ref-number edit (double-click to activate) */
.ref-inline-edit {
    background: transparent;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.25rem;
    color: inherit;
    font-size: inherit;
    width: 5.5em;
    padding: 0 0.25em;
    outline: none;
    -moz-appearance: textfield;
}
.ref-inline-edit::-webkit-outer-spin-button,
.ref-inline-edit::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ──────────────────────────────────────────
   Toast notifications
   ────────────────────────────────────────── */

.vw-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1060;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    max-width: 380px;
    pointer-events: none;
}

.vw-toast {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border-radius: var(--vw-radius-sm);
    box-shadow: var(--vw-shadow-lg);
    font-size: 0.875rem;
    font-weight: 500;
    pointer-events: auto;
    animation: vw-toast-in 0.3s ease-out;
}

.vw-toast--exit {
    animation: vw-toast-out 0.3s ease-in forwards;
}

.vw-toast--success {
    background: var(--vw-surface);
    border-left: 4px solid var(--vw-success);
    color: var(--vw-text);
}

.vw-toast--danger {
    background: var(--vw-surface);
    border-left: 4px solid var(--vw-danger);
    color: var(--vw-text);
}

.vw-toast--warning {
    background: var(--vw-surface);
    border-left: 4px solid var(--vw-warning);
    color: var(--vw-text);
}

.vw-toast__message {
    flex: 1;
    line-height: 1.4;
}

.vw-toast__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    border-radius: var(--vw-radius-sm);
    background: transparent;
    color: var(--vw-text-muted);
    cursor: pointer;
    transition: background 100ms ease, color 100ms ease;
    padding: 0;
}

.vw-toast__close:hover {
    background: var(--vw-surface-muted);
    color: var(--vw-text);
}

@keyframes vw-toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes vw-toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(20px); }
}

@media (max-width: 640.98px) {
    .vw-toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
    }
}

/* ──────────────────────────────────────────
   Who's Due — time rail & operator surface
   ────────────────────────────────────────── */

.vw-whos-due {
    position: relative;
}

.operator-avatar {
    flex-shrink: 0;
}

.operator-avatar__svg {
    display: block;
    width: 100%;
    height: auto;
}

.operator-avatar--sm { width: 40px; height: 40px; }
.operator-avatar--md { width: 72px; height: 72px; }
.operator-avatar--lg { width: 104px; height: 104px; }

.vw-due-strip-wrap {
    width: 100%;
    margin-bottom: 1rem;
}

.vw-due-strip-hint {
    font-size: 0.75rem;
    color: var(--vw-text-muted);
    margin-bottom: 0.4rem;
}

.vw-due-strip {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.vw-due-strip::-webkit-scrollbar {
    height: 6px;
}

.vw-due-strip::-webkit-scrollbar-thumb {
    background: var(--vw-border);
    border-radius: 3px;
}

.vw-due-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    min-width: 4.5rem;
    padding: 0.45rem 0.55rem;
    border: 1.5px solid var(--vw-border);
    border-radius: var(--vw-radius-sm);
    background: var(--vw-surface);
    color: var(--vw-text);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
    .vw-due-chip {
        transition: none;
    }
}

.vw-due-chip:hover {
    border-color: rgba(var(--vw-primary-rgb), 0.45);
    background: rgba(var(--vw-primary-rgb), 0.04);
}

.vw-due-chip:focus-visible {
    outline: 2px solid rgba(var(--vw-primary-rgb), 0.45);
    outline-offset: 2px;
}

.vw-due-chip--active {
    border-color: var(--vw-primary);
    background: rgba(var(--vw-primary-rgb), 0.1);
    box-shadow: 0 0 0 2px rgba(var(--vw-primary-rgb), 0.12);
}

.vw-due-chip--today:not(.vw-due-chip--active) {
    border-color: rgba(var(--vw-accent-rgb), 0.55);
}

.vw-due-chip__dow {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--vw-text-muted);
}

.vw-due-chip__date {
    font-size: 0.8rem;
    font-weight: 700;
}

.vw-due-chip__meta {
    font-size: 0.62rem;
    color: var(--vw-text-muted);
    font-weight: 500;
}

/* Who's Due: strip fills content width; backlog chip keeps a clear red treatment */
.vw-due-strip--week {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: stretch;
}

.vw-due-strip--week .vw-due-chip {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.55rem 0.4rem 0.5rem;
    font-size: 0.85rem;
    border-radius: var(--vw-radius-md, 10px);
    gap: 0.1rem;
}

.vw-due-strip--week .vw-due-chip--backlog {
    background: linear-gradient(180deg, rgba(var(--vw-danger-rgb), 0.1) 0%, rgba(var(--vw-danger-rgb), 0.02) 100%);
    border-color: rgba(var(--vw-danger-rgb), 0.32);
}

.vw-due-strip--week .vw-due-chip--backlog .vw-due-chip__dow {
    color: var(--vw-danger);
    font-weight: 700;
}

.vw-due-strip--week .vw-due-chip--backlog:hover {
    border-color: rgba(var(--vw-danger-rgb), 0.48);
    background: rgba(var(--vw-danger-rgb), 0.08);
}

.vw-due-strip--week .vw-due-chip--backlog.vw-due-chip--active {
    border-color: var(--vw-danger);
    background: rgba(var(--vw-danger-rgb), 0.14);
    box-shadow: 0 0 0 2px rgba(var(--vw-danger-rgb), 0.18);
}

.vw-due-strip--week .vw-due-chip__dow {
    font-size: 0.72rem;
}

.vw-due-strip--week .vw-due-chip__date {
    font-size: 0.98rem;
}

.vw-due-strip--week .vw-due-chip__meta {
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

@media (max-width: 991.98px) {
    .vw-due-strip--week {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .vw-due-strip--week .vw-due-chip {
        flex: 0 0 auto;
        min-width: 6.25rem;
    }
}

/* Who's Due v2 — page chrome, rail panel, context, refine, list */
.vw-whos-due-v2 .vw-due-strip-wrap {
    margin-bottom: 0;
}

.vw-whos-due-pagebar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.vw-whos-due-pagebar__title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--vw-text);
    margin: 0 0 0.15rem 0;
}

.vw-whos-due-pagebar__lede {
    font-size: 0.82rem;
    color: var(--vw-text-muted);
    margin: 0;
    line-height: 1.4;
    max-width: 42rem;
}

/* Rail + context as one elevated surface */
.vw-whos-due-scope {
    margin-bottom: 1rem;
    background: var(--vw-surface);
    border: 1px solid var(--vw-border);
    border-radius: var(--vw-radius-lg);
    box-shadow: var(--vw-shadow-sm);
    overflow: hidden;
}

.vw-whos-due-scope__rail {
    padding: 0.6rem 0.75rem 0.45rem;
}

.vw-whos-due-scope__divider {
    height: 1px;
    margin: 0 0.75rem;
    background: var(--vw-border);
    opacity: 0.85;
}

.vw-whos-due-rail__label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--vw-text-muted);
    margin-bottom: 0.45rem;
}

.vw-whos-due-scope .vw-whos-due-context {
    margin-bottom: 0;
    padding: 0.65rem 0.75rem 0.75rem;
    border-bottom: none;
}

.vw-whos-due-context {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--vw-border);
}

.vw-whos-due-context__text {
    min-width: 0;
}

.vw-whos-due-context__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.2rem;
}

.vw-whos-due-context__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--vw-text);
    margin: 0;
    letter-spacing: -0.015em;
    line-height: 1.25;
}

.vw-whos-due-context__badge {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.25rem;
    padding: 0.15rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 999px;
    background: rgba(var(--vw-warning-rgb), 0.12);
    color: var(--vw-warning);
    border: 1px solid rgba(var(--vw-warning-rgb), 0.25);
}

.vw-whos-due-context__meta {
    font-size: 0.85rem;
    color: var(--vw-text-muted);
    margin: 0;
}

.vw-whos-due-context__sep {
    margin: 0 0.35rem;
}

.vw-whos-due-context__clock {
    font-size: 0.8125rem;
}

.vw-whos-due-context__clock::before {
    content: " · ";
}

.vw-whos-due-context__cta {
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .vw-whos-due-context__cta {
        width: 100%;
    }
}

.vw-whos-due-flash {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.4rem 0.65rem;
    font-size: 0.8125rem;
    color: var(--vw-success);
    background: rgba(var(--vw-success-rgb), 0.08);
    border: 1px solid rgba(var(--vw-success-rgb), 0.22);
    border-radius: var(--vw-radius-sm);
}

.vw-whos-due-flash__text {
    flex: 1;
    min-width: 0;
}

.vw-whos-due-flash__dismiss {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--vw-success);
    text-decoration: none;
}

.vw-whos-due-flash__dismiss:hover {
    color: var(--vw-success);
    text-decoration: underline;
}

.vw-whos-due-refine {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

@media (min-width: 992px) {
    .vw-whos-due-refine {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 0.65rem;
    }
}

.vw-whos-due-refine__primary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    flex: 1 1 auto;
    min-width: 0;
}

@media (min-width: 992px) {
    .vw-whos-due-refine__primary {
        flex: 1 1 20rem;
    }
}

.vw-whos-due-refine__search {
    flex: 1 1 12rem;
    min-width: 0;
}

.vw-whos-due-refine__route {
    width: auto;
    min-width: 9rem;
    flex: 0 0 auto;
}

.vw-whos-due-refine__clear {
    flex-shrink: 0;
}

.vw-whos-due-refine__status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.5rem;
    width: 100%;
    padding: 0.45rem 0.55rem;
    border-radius: var(--vw-radius-sm);
    background: rgba(var(--vw-primary-rgb), 0.03);
    border: 1px solid var(--vw-border);
}

@media (min-width: 992px) {
    .vw-whos-due-refine__status {
        width: auto;
        flex: 0 1 auto;
        max-width: 100%;
        margin-left: auto;
    }
}

.vw-whos-due-refine__caption {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vw-text-muted);
    margin-right: 0.15rem;
}

.vw-whos-due-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.vw-whos-due-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 999px;
    border: 1.5px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
    .vw-whos-due-filter {
        transition: none;
    }
}

.vw-whos-due-filter--success {
    color: var(--vw-success);
    border-color: rgba(var(--vw-success-rgb), 0.28);
}

.vw-whos-due-filter--success.vw-whos-due-filter--on {
    background: rgba(var(--vw-success-rgb), 0.1);
    border-color: var(--vw-success);
    box-shadow: 0 0 0 2px rgba(var(--vw-success-rgb), 0.12);
}

.vw-whos-due-filter--warning {
    color: var(--vw-warning);
    border-color: rgba(var(--vw-warning-rgb), 0.28);
}

.vw-whos-due-filter--warning.vw-whos-due-filter--on {
    background: rgba(var(--vw-warning-rgb), 0.1);
    border-color: var(--vw-warning);
    box-shadow: 0 0 0 2px rgba(var(--vw-warning-rgb), 0.12);
}

.vw-whos-due-filter--danger {
    color: var(--vw-danger);
    border-color: rgba(var(--vw-danger-rgb), 0.28);
}

.vw-whos-due-filter--danger.vw-whos-due-filter--on {
    background: rgba(var(--vw-danger-rgb), 0.1);
    border-color: var(--vw-danger);
    box-shadow: 0 0 0 2px rgba(var(--vw-danger-rgb), 0.12);
}

.vw-whos-due-filter:focus-visible {
    outline: 2px solid rgba(var(--vw-primary-rgb), 0.45);
    outline-offset: 2px;
}

.vw-whos-due-filter__n {
    font-weight: 800;
}

.vw-whos-due-stops-card .table {
    margin-bottom: 0;
}

.vw-whos-due-table {
    table-layout: fixed;
    width: 100%;
}

.vw-whos-due-table__col-status {
    width: 2rem;
    padding-left: 0.5rem !important;
    padding-right: 0.35rem !important;
}

.vw-whos-due-table__customer {
    width: clamp(7.5rem, 22vw, 14rem);
    max-width: 14rem;
    min-width: 0;
}

.vw-whos-due-table__customer-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vw-whos-due-table-wrap {
    max-height: min(70vh, 52rem);
    overflow: auto;
}

.vw-whos-due-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    background: var(--vw-surface);
    box-shadow: 0 1px 0 var(--vw-border);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--vw-text-muted);
}

.vw-whos-due-table tbody td {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--vw-border);
}

.vw-whos-due-table tbody tr:last-child td {
    border-bottom: none;
}

.vw-whos-due-table tbody tr {
    transition: background 0.12s ease;
}

.vw-whos-due-table tbody tr:hover {
    background: rgba(var(--vw-primary-rgb), 0.04);
}

.vw-whos-due-modal-preview {
    margin-top: 0.25rem;
    padding: 0.5rem 0.65rem;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--vw-border);
    border-radius: var(--vw-radius-sm);
    background: var(--vw-surface);
}

.vw-whos-due-modal-preview__table {
    font-size: 0.8rem;
}

/* ──────────────────────────────────────────
   Planner — calendar-first layout
   ────────────────────────────────────────── */

.vw-planner-calendar__pagebar {
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.vw-planner-calendar__pagebar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.vw-planner-calendar__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.vw-planner-calendar__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.vw-planner-calendar__nav-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--vw-text);
    margin-left: 0.25rem;
}

.vw-planner-calendar__template-select {
    min-width: 10rem;
    max-width: 16rem;
}

.vw-planner-calendar__template-date {
    width: auto;
    min-width: 9.5rem;
}

.vw-planner-calendar__flash {
    background: rgba(var(--vw-success-rgb), 0.08);
    border-color: rgba(var(--vw-success-rgb), 0.2);
    color: var(--vw-success);
}

.vw-planner-calendar__main {
    align-items: flex-start;
}

.vw-planner-calendar__footer {
    margin-top: 0.3rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
    color: var(--vw-text);
}

.vw-planner-day-modal-root .modal-dialog.vw-planner-day-modal {
    max-width: min(100%, 42rem);
}

.vw-planner-day-modal__shell {
    border: 1px solid var(--vw-border);
    border-radius: var(--vw-radius-lg);
    overflow: hidden;
    box-shadow: var(--vw-shadow-sm);
}

.vw-planner-day-modal__header {
    padding: 0.85rem 1rem 0.5rem;
    background: linear-gradient(180deg, rgba(var(--vw-primary-rgb), 0.06) 0%, transparent 100%);
}

.vw-planner-day-modal__kicker {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--vw-text-muted);
    margin: 0;
}

.vw-planner-day-modal__statstrip {
    gap: 0.5rem !important;
}

.vw-planner-day-modal__chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: var(--vw-surface-muted);
    border: 1px solid var(--vw-border);
    font-size: 0.8rem;
}

.vw-planner-day-modal__chip--accent {
    background: rgba(var(--vw-primary-rgb), 0.08);
    border-color: rgba(var(--vw-primary-rgb), 0.25);
}

.vw-planner-day-modal__chip-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--vw-text-muted);
}

.vw-planner-day-modal__chip-value {
    font-weight: 800;
    color: var(--vw-text);
}

.vw-planner-day-modal__composer-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--vw-text-muted);
    margin-bottom: 0.75rem;
}

.vw-planner-day-modal__composer .card-body {
    background: rgba(var(--vw-primary-rgb), 0.04);
}

.vw-planner-day-modal__list-label {
    letter-spacing: 0.04em;
}

.vw-planner-day-modal__van {
    border: 1px solid var(--vw-border) !important;
}

.vw-planner-day-modal__van .card-body {
    background: var(--vw-surface);
}

.vw-planner-day-modal__route-list .list-group-item:first-child {
    border-top: none !important;
    padding-top: 0 !important;
}

.vw-planner-day-modal__footer {
    padding: 0.5rem 1rem 0.75rem;
    background: var(--vw-surface-muted);
    border-top: 1px solid var(--vw-border) !important;
}

/* Month grid */
.vw-planner-calendar__month {
    background: var(--vw-surface);
    border: 1px solid var(--vw-border);
    border-radius: var(--vw-radius-lg);
    box-shadow: var(--vw-shadow-sm);
    padding: 0.35rem 0.5rem 0.25rem;
}

.vw-planner-calendar__weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.25rem;
    margin-bottom: 0.2rem;
}

.vw-planner-calendar__weekday {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vw-text-muted);
    text-align: center;
    padding: 0.25rem 0;
}

.vw-planner-calendar__cells {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.25rem;
}

.vw-planner-calendar__cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
    min-height: 5.1rem;
    padding: 0.25rem 0.25rem 0.3rem;
    border: 1.5px solid var(--vw-border);
    border-radius: var(--vw-radius-sm);
    background: var(--vw-surface);
    color: var(--vw-text);
    font-size: 0.72rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

@media (prefers-reduced-motion: reduce) {
    .vw-planner-calendar__cell {
        transition: none;
    }
}

.vw-planner-calendar__cell:hover {
    border-color: rgba(var(--vw-primary-rgb), 0.45);
    background: rgba(var(--vw-primary-rgb), 0.04);
}

.vw-planner-calendar__cell:focus-visible {
    outline: 2px solid rgba(var(--vw-primary-rgb), 0.5);
    outline-offset: 2px;
    z-index: 1;
}

.vw-planner-calendar__cell--pad {
    min-height: 5.1rem;
    border: none;
    background: transparent;
    pointer-events: none;
}

.vw-planner-calendar__cell--past {
    opacity: 0.45;
}

.vw-planner-calendar__cell--today:not(.vw-planner-calendar__cell--selected) {
    border-color: rgba(var(--vw-accent-rgb), 0.55);
}

.vw-planner-calendar__cell--selected {
    border-color: var(--vw-primary);
    background: rgba(var(--vw-primary-rgb), 0.1);
    box-shadow: 0 0 0 2px rgba(var(--vw-primary-rgb), 0.12);
}


.vw-planner-calendar__cell-dow {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--vw-text-muted);
}

.vw-planner-calendar__cell-num {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.1;
}

.vw-planner-calendar__cell-primary {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--vw-text);
    line-height: 1.25;
    margin-top: 0.1rem;
}

.vw-planner-calendar__cell-preview {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--vw-text-muted);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.05rem;
}

.vw-planner-calendar__cell-add {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1;
    color: rgba(var(--vw-primary-rgb), 0.25);
    transition: color 0.12s ease;
}

.vw-planner-calendar__cell:hover .vw-planner-calendar__cell-add {
    color: var(--vw-primary);
}


/* Week strip */
.vw-planner-calendar__week {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.vw-planner-calendar__week-col {
    flex: 1 1 0;
    min-width: 7.5rem;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.65rem 0.55rem;
    border: 1.5px solid var(--vw-border);
    border-radius: var(--vw-radius-md);
    background: var(--vw-surface);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.vw-planner-calendar__week-col:hover {
    border-color: rgba(var(--vw-primary-rgb), 0.4);
}

.vw-planner-calendar__week-col:focus-visible {
    outline: 2px solid rgba(var(--vw-primary-rgb), 0.5);
    outline-offset: 2px;
}

.vw-planner-calendar__week-col--today:not(.vw-planner-calendar__week-col--selected) {
    border-color: rgba(var(--vw-accent-rgb), 0.55);
}

.vw-planner-calendar__week-col--selected {
    border-color: var(--vw-primary);
    background: rgba(var(--vw-primary-rgb), 0.08);
    box-shadow: 0 0 0 2px rgba(var(--vw-primary-rgb), 0.1);
}

.vw-planner-calendar__week-col-dow {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--vw-text-muted);
}

.vw-planner-calendar__week-col-date {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--vw-text);
}

.vw-planner-calendar__week-col-meta {
    font-size: 0.72rem;
    color: var(--vw-text-muted);
    line-height: 1.25;
}

.vw-planner-calendar__week-col-primary {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--vw-text);
    line-height: 1.3;
}

.vw-planner-calendar__week-col-preview {
    font-size: 0.65rem;
    color: var(--vw-text-muted);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.15rem;
}

/* Day detail */
.vw-planner-calendar__detail {
    border: 1px solid var(--vw-border);
}

.vw-planner-calendar__van-block {
    border: 1px solid var(--vw-border);
    border-radius: var(--vw-radius-sm);
    padding: 0.5rem 0.65rem;
    background: rgba(var(--vw-primary-rgb), 0.02);
}

.vw-planner-calendar__van-head {
    margin-bottom: 0.35rem;
}

.vw-planner-calendar__route-list {
    border-radius: var(--vw-radius-sm);
    overflow: hidden;
}

.vw-planner-calendar__route-item {
    background: var(--vw-surface);
    border-color: var(--vw-border) !important;
}

.vw-planner-calendar__view-toggle .btn:focus-visible {
    outline: 2px solid rgba(var(--vw-primary-rgb), 0.45);
    outline-offset: 2px;
}
