/* =========================================================
   VBS SRRU — UX & Accessibility stabilization layer v3
   Updated: 2026-07-29
   Loaded last to normalize the legacy multi-layer cascade.
   Scope: body.ui-modern.vbs-v2.vbs-v3
   ========================================================= */

:root {
    --v3-focus: #075fca;
    --v3-focus-soft: rgba(7, 95, 202, .2);
    --v3-text: #172033;
    --v3-muted: #526277;
    --v3-border: #c8d4e2;
    --v3-danger: #b42318;
    --v3-danger-soft: #fff4f2;
    --v3-success: #067647;
    --v3-success-soft: #ecfdf3;
    --v3-warning: #9a4d00;
    --v3-warning-soft: #fff8eb;
    --v3-info-soft: #eef6ff;
    --v3-target: 44px;
}

/* Architecture, async-state, and rendering performance layer v6 */
[data-async-state="loading"] [data-resource-status],
[data-async-state="submitting"] [data-resource-status],
[data-async-state="loading"] .map-summary {
    color: #1d4ed8;
    font-weight: 600;
}

[data-async-state="success"] [data-resource-status] {
    color: #166534;
}

[data-async-state="committed"] [role="status"] {
    color: #14532d;
}

[data-async-state="error"] [data-resource-status] {
    color: #b91c1c;
    font-weight: 700;
}

.vehicle-table-thumb,
.vehicle-editor-cover img,
.vehicle-gallery-item img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.profile-photo-preview img {
    aspect-ratio: 1;
    object-fit: cover;
}

@supports (content-visibility: auto) {
    .section-gap.card,
    .dashboard-main-grid > .card,
    .vehicle-gallery-item {
        content-visibility: auto;
        contain-intrinsic-size: auto 360px;
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-async-state] *,
    [data-async-state] *::before,
    [data-async-state] *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

body.ui-modern.vbs-v2.vbs-v3 {
    color: var(--v3-text);
    font-size: 16px;
    line-height: 1.6;
}

body.ui-modern.vbs-v2.vbs-v3 .small,
body.ui-modern.vbs-v2.vbs-v3 small {
    font-size: .875rem;
    line-height: 1.55;
}

body.ui-modern.vbs-v2.vbs-v3 .muted {
    color: var(--v3-muted) !important;
}

body.ui-modern.vbs-v2.vbs-v3 :where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--v3-focus) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px var(--v3-focus-soft) !important;
}

body.ui-modern.vbs-v2.vbs-v3 :where(.btn, button.btn, .nav-link, .topbar-quick-link, .mobile-tabbar-link, .sidebar-toggle, .alert-dismiss) {
    min-height: var(--v3-target);
}

body.ui-modern.vbs-v2.vbs-v3 :where(.btn, button.btn) {
    padding: 10px 16px;
    font-size: .9375rem;
    font-weight: 700;
    line-height: 1.35;
}

body.ui-modern.vbs-v2.vbs-v3 :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
    width: 100%;
    min-height: 46px;
    border-color: var(--v3-border);
    color: var(--v3-text);
    background: #fff;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.45;
}

body.ui-modern.vbs-v2.vbs-v3 textarea {
    min-height: 116px;
    resize: vertical;
}

body.ui-modern.vbs-v2.vbs-v3 :where(input, select, textarea)::placeholder {
    color: #748399;
    opacity: 1;
}

body.ui-modern.vbs-v2.vbs-v3 :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):hover:not(:disabled) {
    border-color: #9fb0c4;
}

body.ui-modern.vbs-v2.vbs-v3 :where(input, select, textarea):disabled {
    color: #667085;
    background: #eef2f6;
    cursor: not-allowed;
    opacity: 1;
}

body.ui-modern.vbs-v2.vbs-v3 :where(input[type="checkbox"], input[type="radio"]) {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    accent-color: #155cb6;
}

body.ui-modern.vbs-v2.vbs-v3 .form-grid > div,
body.ui-modern.vbs-v2.vbs-v3 .form-field {
    min-width: 0;
}

body.ui-modern.vbs-v2.vbs-v3 :where(.form-grid > div, .form-field, .filter-field) > label,
body.ui-modern.vbs-v2.vbs-v3 .form-fieldset > legend,
body.ui-modern.vbs-v2.vbs-v3 .field-label {
    display: block;
    margin: 0 0 7px;
    color: #253247;
    font-size: .9375rem;
    font-weight: 700;
    line-height: 1.45;
}

body.ui-modern.vbs-v2.vbs-v3 .required-mark {
    margin-inline-start: 2px;
    color: var(--v3-danger);
    font-weight: 800;
}

body.ui-modern.vbs-v2.vbs-v3 .field-help,
body.ui-modern.vbs-v2.vbs-v3 .helper-text {
    margin-top: 7px;
    color: var(--v3-muted);
    font-size: .875rem;
    line-height: 1.55;
}

body.ui-modern.vbs-v2.vbs-v3 .form-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

body.ui-modern.vbs-v2.vbs-v3 .notification-fieldset .choice-box {
    border: 1px solid var(--v3-border);
    border-radius: 14px;
    background: #fbfdff;
}

body.ui-modern.vbs-v2.vbs-v3 .choice-line {
    min-height: var(--v3-target);
    align-items: flex-start;
    gap: 11px;
    padding: 10px 11px;
    border-radius: 10px;
    cursor: pointer;
}

body.ui-modern.vbs-v2.vbs-v3 .choice-line:hover {
    background: #f0f6ff;
}

body.ui-modern.vbs-v2.vbs-v3 :where(input, select, textarea).is-invalid,
body.ui-modern.vbs-v2.vbs-v3 :where(input, select, textarea)[aria-invalid="true"] {
    border-color: var(--v3-danger) !important;
    background: var(--v3-danger-soft) !important;
    box-shadow: 0 0 0 3px rgba(180, 35, 24, .12) !important;
}

body.ui-modern.vbs-v2.vbs-v3 .field-error {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 7px;
    color: var(--v3-danger);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.45;
}

body.ui-modern.vbs-v2.vbs-v3 .field-error::before {
    content: "!";
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 1px;
    border-radius: 50%;
    color: #fff;
    background: var(--v3-danger);
    font-size: .75rem;
    font-weight: 800;
}

body.ui-modern.vbs-v2.vbs-v3 .form-error-summary {
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid #f0aaa3;
    border-left: 5px solid var(--v3-danger);
    border-radius: 12px;
    color: #7a271a;
    background: var(--v3-danger-soft);
}

body.ui-modern.vbs-v2.vbs-v3 .form-error-summary strong {
    display: block;
    color: #7a271a;
    font-size: 1rem;
}

body.ui-modern.vbs-v2.vbs-v3 .form-error-summary ul {
    margin: 7px 0 0;
    padding-inline-start: 1.25rem;
}

body.ui-modern.vbs-v2.vbs-v3 .form-error-summary a {
    color: #8a1c13;
    font-weight: 700;
}

body.ui-modern.vbs-v2.vbs-v3 .alert {
    position: relative;
    min-height: 48px;
    padding: 12px 48px 12px 44px;
    border-width: 1px 1px 1px 5px;
    line-height: 1.5;
}

body.ui-modern.vbs-v2.vbs-v3 .alert::before {
    position: absolute;
    top: 12px;
    left: 15px;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 800;
    line-height: 1;
}

body.ui-modern.vbs-v2.vbs-v3 .alert-success {
    border-color: #75c9a4;
    border-left-color: var(--v3-success);
    color: #075c3b;
    background: var(--v3-success-soft);
}

body.ui-modern.vbs-v2.vbs-v3 .alert-success::before {
    content: "✓";
}

body.ui-modern.vbs-v2.vbs-v3 .alert-danger {
    border-color: #f0aaa3;
    border-left-color: var(--v3-danger);
    color: #7a271a;
    background: var(--v3-danger-soft);
}

body.ui-modern.vbs-v2.vbs-v3 .alert-danger::before {
    content: "!";
}

body.ui-modern.vbs-v2.vbs-v3 .alert-warning {
    border-color: #efc780;
    border-left-color: var(--v3-warning);
    color: #713b00;
    background: var(--v3-warning-soft);
}

body.ui-modern.vbs-v2.vbs-v3 .alert-warning::before {
    content: "!";
}

body.ui-modern.vbs-v2.vbs-v3 .alert-dismiss {
    top: 2px;
    right: 3px;
    width: 42px;
    min-width: 42px;
    color: currentColor;
}

/* Avoid equal-height stretching that produced large empty dashboard areas. */
body.ui-modern.vbs-v2.vbs-v3 .dashboard-main-grid {
    grid-auto-rows: auto !important;
    align-items: start !important;
}

body.ui-modern.vbs-v2.vbs-v3 .dashboard-main-grid > .card {
    height: auto !important;
    min-height: 0 !important;
    align-self: start !important;
}

body.ui-modern.vbs-v2.vbs-v3 .dashboard-admin-panels {
    align-items: start;
}

/* Booking request: keep actions in normal flow so they never cover controls. */
body.ui-modern.vbs-v2.vbs-v3 .request-submit-bar {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px !important;
    padding: 14px !important;
    border: 1px solid var(--v3-border) !important;
    border-radius: 15px !important;
    background: #f8fbff !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

body.ui-modern.vbs-v2.vbs-v3 .destination-required-status {
    min-height: 44px;
    font-size: .9rem;
}

body.ui-modern.vbs-v2.vbs-v3 .request-form-card,
body.ui-modern.vbs-v2.vbs-v3 .form-section,
body.ui-modern.vbs-v2.vbs-v3 .map-panel {
    scroll-margin-top: 118px;
}

body.ui-modern.vbs-v2.vbs-v3 .request-step[aria-current="step"] {
    border-color: #99c2f4;
    background: #f3f8ff;
}

body.ui-modern.vbs-v2.vbs-v3 .map-actions-inline {
    align-items: stretch;
}

body.ui-modern.vbs-v2.vbs-v3 .map-actions-inline .btn {
    min-height: 44px;
}

body.ui-modern.vbs-v2.vbs-v3 .map-canvas {
    outline: 1px solid #c8d4e2;
    outline-offset: -1px;
}

/* Table semantics and compact card layout on narrow screens. */
body.ui-modern.vbs-v2.vbs-v3 .table-wrap table caption.sr-only {
    position: absolute !important;
}

body.ui-modern.vbs-v2.vbs-v3 .table-wrap th[scope="col"] {
    font-weight: 700;
}

body.ui-modern.vbs-v2.vbs-v3 .table-wrap.has-horizontal-overflow::after {
    pointer-events: none;
}

/* Login: show the primary task first on mobile and keep identity visible. */
body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-mobile-brand {
    display: none;
}

body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-oauth-note,
body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-help-note,
body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .footer-meta {
    font-size: .8125rem;
    line-height: 1.5;
}

body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-access-item small,
body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .google-signin-copy small {
    font-size: .8125rem;
    line-height: 1.45;
}

/* Loading state should not hide the action label from assistive technology. */
body.ui-modern.vbs-v2.vbs-v3 button.is-loading {
    cursor: progress;
}

body.ui-modern.vbs-v2.vbs-v3 form[aria-busy="true"] :where(input, select, textarea, button[type="submit"]) {
    cursor: progress;
}

@media (max-width: 900px) {
    body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-login-panel {
        order: 1;
    }

    body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-hero-login {
        order: 2;
    }

    body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-mobile-brand {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        margin: 0 0 22px;
        padding: 11px 12px;
        border: 1px solid #d4e1ef;
        border-radius: 14px;
        background: #f6faff;
    }

    body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-mobile-brand img {
        width: 38px;
        max-height: 48px;
        object-fit: contain;
        justify-self: center;
    }

    body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-mobile-brand strong,
    body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-mobile-brand span {
        display: block;
    }

    body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-mobile-brand strong {
        color: #123d70;
        font-size: .96rem;
        line-height: 1.35;
    }

    body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-mobile-brand span {
        margin-top: 2px;
        color: #526277;
        font-size: .8125rem;
        line-height: 1.4;
    }
}

@media (max-width: 820px) {
    body.ui-modern.vbs-v2.vbs-v3 .request-submit-bar {
        position: static !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        margin-bottom: 0;
        padding: 12px !important;
    }

    body.ui-modern.vbs-v2.vbs-v3 .request-submit-bar > * {
        width: 100%;
    }

    body.ui-modern.vbs-v2.vbs-v3 .request-submit-bar .btn {
        justify-content: center;
    }

    body.ui-modern.vbs-v2.vbs-v3 .form-section {
        padding: 14px;
    }

    body.ui-modern.vbs-v2.vbs-v3 .form-section-head {
        align-items: flex-start;
    }

    body.ui-modern.vbs-v2.vbs-v3 .table-wrap table:not(.keep-table-layout) tbody tr {
        gap: 0;
        padding: 10px 12px;
    }

    body.ui-modern.vbs-v2.vbs-v3 .table-wrap table:not(.keep-table-layout) td,
    body.ui-modern.vbs-v2.vbs-v3 .table-wrap table.table-card-early td {
        grid-template-columns: minmax(92px, 38%) minmax(0, 1fr) !important;
        gap: 10px !important;
        min-height: 0;
        padding: 8px 0 !important;
        align-items: start;
    }

    body.ui-modern.vbs-v2.vbs-v3 .table-wrap td[data-label]::before {
        color: #526277 !important;
        font-size: .78rem;
        line-height: 1.45;
    }

    body.ui-modern.vbs-v2.vbs-v3 .table-wrap td:last-child .actions,
    body.ui-modern.vbs-v2.vbs-v3 .table-wrap table.table-card-early td:last-child .actions {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-login-panel {
        padding: 24px 20px !important;
    }

    body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-hero-login {
        padding: 22px 20px !important;
    }

    body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-capabilities {
        display: none;
    }

    body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-hero-desc {
        margin-bottom: 0;
    }

    body.ui-modern.vbs-v2.vbs-v3[data-page="login.php"] .auth-hero-security {
        margin-top: 15px;
        font-size: .8125rem;
    }

    body.ui-modern.vbs-v2.vbs-v3 .request-stepper {
        grid-template-columns: 1fr;
    }

    body.ui-modern.vbs-v2.vbs-v3 .map-actions-inline {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    body.ui-modern.vbs-v2.vbs-v3 .map-actions-inline .btn {
        width: 100%;
    }
}

@media (max-width: 390px) {
    body.ui-modern.vbs-v2.vbs-v3 .table-wrap table:not(.keep-table-layout) td,
    body.ui-modern.vbs-v2.vbs-v3 .table-wrap table.table-card-early td {
        grid-template-columns: 1fr !important;
        gap: 3px !important;
    }

    body.ui-modern.vbs-v2.vbs-v3 .table-wrap td:last-child .actions,
    body.ui-modern.vbs-v2.vbs-v3 .table-wrap table.table-card-early td:last-child .actions,
    body.ui-modern.vbs-v2.vbs-v3 .map-actions-inline {
        grid-template-columns: 1fr !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ui-modern.vbs-v2.vbs-v3 *,
    body.ui-modern.vbs-v2.vbs-v3 *::before,
    body.ui-modern.vbs-v2.vbs-v3 *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

@media (forced-colors: active) {
    body.ui-modern.vbs-v2.vbs-v3 :where(.btn, input, select, textarea, .card, .alert) {
        border: 1px solid CanvasText;
    }

    body.ui-modern.vbs-v2.vbs-v3 :focus-visible {
        outline: 3px solid Highlight !important;
        box-shadow: none !important;
    }
}

/* The submit action remains focusable/clickable to provide an explanation;
   server and client validation still prevent an incomplete request. */
body.ui-modern.vbs-v2.vbs-v3 #booking-submit-button.is-conditionally-disabled {
    border-color: #c47a16 !important;
    background: #fff8eb !important;
    color: #7a3e00 !important;
    box-shadow: none !important;
}

body.ui-modern.vbs-v2.vbs-v3 #booking-submit-button.is-conditionally-disabled:hover {
    background: #ffefcf !important;
}

/* =========================================================
   VBS SRRU — UI/UX refinement v4
   Updated: 2026-08-14
   This section remains in the final stabilization stylesheet
   to avoid adding another cascade layer.
   ========================================================= */

:root {
    --v4-bg: #f5f7fb;
    --v4-surface: #ffffff;
    --v4-surface-soft: #f8fafc;
    --v4-text-strong: #111827;
    --v4-primary: #1456a0;
    --v4-primary-hover: #0d4380;
    --v4-border: #d5dfeb;
    --v4-radius: 16px;
    --v4-shadow: 0 8px 24px rgba(15, 23, 42, .07);
}

body.ui-modern.vbs-v4 {
    background:
        radial-gradient(circle at 86% -8%, rgba(20, 86, 160, .09), transparent 28rem),
        linear-gradient(180deg, #fbfdff 0, var(--v4-bg) 24rem) !important;
}

body.ui-modern.vbs-v4 .main-content {
    container-type: inline-size;
}

body.ui-modern.vbs-v4 .topbar {
    min-height: 78px;
    padding: 10px 13px;
    border-color: rgba(202, 214, 228, .92);
    border-radius: var(--v4-radius) !important;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .065);
}

body.ui-modern.vbs-v4.is-scrolled .topbar {
    min-height: 70px;
}

body.ui-modern.vbs-v4 .topbar-kicker {
    min-height: 22px;
    padding: 2px 8px;
    border-color: #ccddf1;
    background: #f0f6fd;
    color: #174f8d;
}

body.ui-modern.vbs-v4 .topbar h1,
body.ui-modern.vbs-v4 .section-title,
body.ui-modern.vbs-v4 .form-section-head h3 {
    color: var(--v4-text-strong);
    letter-spacing: -.012em;
}

body.ui-modern.vbs-v4 .card,
body.ui-modern.vbs-v4 .hero-card {
    border-color: var(--v4-border) !important;
    border-radius: var(--v4-radius) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .045) !important;
}

body.ui-modern.vbs-v4 .card:not(.stat-card-link):hover {
    border-color: var(--v4-border) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .045) !important;
}

body.ui-modern.vbs-v4 :where(.btn, button.btn) {
    border-radius: 11px;
}

body.ui-modern.vbs-v4 :where(.btn:not(.btn-outline):not(.btn-success):not(.btn-danger):not(.btn-warning)) {
    background: var(--v4-primary);
}

body.ui-modern.vbs-v4 :where(.btn:not(.btn-outline):not(.btn-success):not(.btn-danger):not(.btn-warning)):hover {
    background: var(--v4-primary-hover);
}

body.ui-modern.vbs-v4 .btn-outline {
    border-color: #b8c7d9;
    color: #23405f;
    background: #fff;
}

body.ui-modern.vbs-v4 .btn-outline:hover {
    border-color: #8ca3bd;
    color: #123b68;
    background: #f4f8fc;
}

/* Dashboard cards become clear, keyboard-accessible navigation. */
body.ui-modern.vbs-v4 .stat-card-link {
    grid-template-rows: auto auto auto 1fr auto;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

body.ui-modern.vbs-v4 .stat-card-link:hover {
    border-color: #9fb9d6 !important;
    box-shadow: var(--v4-shadow) !important;
    transform: translateY(-2px);
}

body.ui-modern.vbs-v4 .stat-card-link:focus-visible {
    border-color: var(--v4-primary) !important;
}

body.ui-modern.vbs-v4 .stat-card-action {
    position: relative;
    z-index: 2;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    width: max-content;
    margin-top: 8px;
    color: var(--v4-primary);
    font-size: .8125rem;
    font-weight: 700;
}

body.ui-modern.vbs-v4 .stat-card-link:hover .stat-card-action {
    color: var(--v4-primary-hover);
}

body.ui-modern.vbs-v4 .monthly-snapshot .mini-stat {
    min-height: 108px;
}

/* Filters read as one task and reflow without squeezed controls. */
body.ui-modern.vbs-v4 .page-toolbar {
    align-items: start;
}

body.ui-modern.vbs-v4 .bookings-searchbar {
    grid-template-columns: minmax(190px, 1.35fr) minmax(150px, .85fr) minmax(142px, .7fr) minmax(142px, .7fr) minmax(106px, .45fr);
    align-items: end;
}

body.ui-modern.vbs-v4 .bookings-searchbar .searchbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
}

body.ui-modern.vbs-v4 .filter-chips {
    align-items: center;
}

body.ui-modern.vbs-v4 .filter-chip {
    border: 1px solid #cbdcf0;
    color: #264c73;
    background: #f2f7fd;
}

body.ui-modern.vbs-v4 .empty-with-action {
    display: grid;
    justify-items: center;
    gap: 7px;
    padding-block: 30px;
    text-align: center;
}

body.ui-modern.vbs-v4 .empty-with-action strong {
    color: var(--v4-text-strong);
    font-size: 1rem;
}

body.ui-modern.vbs-v4 .empty-with-action .btn {
    margin-top: 7px;
}

/* Stable table shell: valid thead markup is required for these rules. */
body.ui-modern.vbs-v4 .table-wrap {
    border-color: var(--v4-border);
    border-radius: 14px !important;
}

body.ui-modern.vbs-v4 .table-wrap thead th {
    border-bottom: 1px solid #cdd9e6;
    color: #3e5066;
    background: #f5f8fc;
}

body.ui-modern.vbs-v4 .table-wrap tbody tr:focus-within td {
    background: #f0f6fd;
}

body.ui-modern.vbs-v4 .table-wrap td:last-child .actions {
    justify-content: flex-start;
}

body.ui-modern.vbs-v4 .pagination-link {
    min-width: 44px;
    min-height: 44px;
}

body.ui-modern.vbs-v4 .pagination-link.is-current {
    border-color: var(--v4-primary);
    color: #fff;
    background: var(--v4-primary);
}

/* Make system state and destructive actions distinguishable beyond color. */
body.ui-modern.vbs-v4 .btn-danger::before {
    content: "!";
    display: inline-grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: .68rem;
    font-weight: 800;
}

body.ui-modern.vbs-v4 .alert[role="alert"] {
    scroll-margin-top: 104px;
}

body.ui-modern.vbs-v4 .form-section {
    border-color: #d8e2ed;
    border-radius: 14px;
    background: #fff;
}

body.ui-modern.vbs-v4 .form-section-head {
    padding-bottom: 12px;
    border-bottom: 1px solid #e5ebf2;
}

body.ui-modern.vbs-v4 .map-panel {
    border-color: #cedbe8;
    border-radius: 15px;
    box-shadow: none;
}

body.ui-modern.vbs-v4 .destination-required-status {
    display: flex;
    align-items: center;
    min-width: min(100%, 290px);
    padding: 8px 11px;
    border: 1px solid #ecc47c;
    border-radius: 10px;
    color: #713b00;
    background: #fff9ec;
}

body.ui-modern.vbs-v4 .destination-required-status.is-ready {
    border-color: #8bc9ab;
    color: #075c3b;
    background: #effbf4;
}

body.ui-modern.vbs-v4 .mobile-tabbar {
    padding-bottom: max(5px, env(safe-area-inset-bottom));
}

/* Small reusable layout utilities replace scattered inline styles. */
body.ui-modern.vbs-v4 .mt-6 { margin-top: 6px !important; }
body.ui-modern.vbs-v4 .mt-10 { margin-top: 10px !important; }
body.ui-modern.vbs-v4 .mt-12 { margin-top: 12px !important; }
body.ui-modern.vbs-v4 .mt-16 { margin-top: 16px !important; }
body.ui-modern.vbs-v4 .mt-18 { margin-top: 18px !important; }
body.ui-modern.vbs-v4 .text-start { text-align: left !important; }

body.ui-modern.vbs-v4 .content-divider {
    margin: 16px 0;
    border: 0;
    border-top: 1px solid var(--v4-border);
}

body.ui-modern.vbs-v4 .attachment-list,
body.ui-modern.vbs-v4 .paper-approval-form {
    display: grid;
    gap: 16px;
}

body.ui-modern.vbs-v4 .attachment-list {
    gap: 10px;
}

body.ui-modern.vbs-v4 .attachment-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    text-align: left;
}

body.ui-modern.vbs-v4 .paper-decision-card {
    padding: 14px;
    border: 1px solid var(--v4-border);
    border-radius: 14px;
    background: var(--v4-surface-soft);
}

@media (max-width: 1180px) and (min-width: 821px) {
    body.ui-modern.vbs-v4 .bookings-searchbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.ui-modern.vbs-v4 .bookings-searchbar > input[type="search"],
    body.ui-modern.vbs-v4 .bookings-searchbar .searchbar-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    body.ui-modern.vbs-v4 .topbar {
        position: sticky;
        top: max(6px, env(safe-area-inset-top));
        min-height: 70px;
        margin-bottom: 14px !important;
    }

    body.ui-modern.vbs-v4 .topbar-left {
        gap: 9px;
    }

    body.ui-modern.vbs-v4 .dashboard-hero.card {
        gap: 14px;
    }

    body.ui-modern.vbs-v4 .dashboard-hero .quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.ui-modern.vbs-v4 .bookings-searchbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.ui-modern.vbs-v4 .bookings-searchbar > input[type="search"],
    body.ui-modern.vbs-v4 .bookings-searchbar .searchbar-actions {
        grid-column: 1 / -1;
    }

    body.ui-modern.vbs-v4 .table-wrap tbody {
        gap: 10px;
    }

    body.ui-modern.vbs-v4 .table-wrap tr {
        border-color: var(--v4-border);
        border-radius: 14px;
    }

    body.ui-modern.vbs-v4 .table-wrap td:last-child[data-label]::before {
        display: block;
        margin-bottom: 8px;
    }

    body.ui-modern.vbs-v4 .request-submit-bar {
        margin-bottom: 10px !important;
    }
}

@media (max-width: 640px) {
    body.ui-modern.vbs-v4 .dashboard-hero .quick-actions,
    body.ui-modern.vbs-v4 .bookings-searchbar {
        grid-template-columns: 1fr;
    }

    body.ui-modern.vbs-v4 .bookings-searchbar > input[type="search"],
    body.ui-modern.vbs-v4 .bookings-searchbar .searchbar-actions {
        grid-column: auto;
    }

    body.ui-modern.vbs-v4 .stat-card-link {
        grid-template-areas:
            "icon label"
            "icon value"
            "note note"
            "action action";
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto auto auto;
    }

    body.ui-modern.vbs-v4 .stat-card-link .stat-card-action {
        grid-area: action;
    }

    body.ui-modern.vbs-v4 .map-canvas {
        min-height: 330px;
    }

    body.ui-modern.vbs-v4 .footer {
        padding-bottom: 12px;
    }
}

@media (max-width: 420px) {
    body.ui-modern.vbs-v4 .topbar-university-logo {
        display: none;
    }

    body.ui-modern.vbs-v4 .topbar p {
        -webkit-line-clamp: 1;
    }
}

/* =========================================================
   VBS SRRU — task clarity & accessible interaction layer v5
   Updated: 2026-08-17
   Mobile-first overrides are kept in this final stabilization
   stylesheet so the legacy cascade does not gain another file.
   ========================================================= */

:root {
    --v5-primary: #0f559d;
    --v5-primary-strong: #0a3f78;
    --v5-danger: #a61b16;
    --v5-warning: #8a4600;
    --v5-surface: #ffffff;
    --v5-surface-soft: #f5f8fc;
    --v5-border: #cbd8e6;
    --v5-ink: #142033;
    --v5-muted: #516176;
    --v5-dialog-shadow: 0 28px 80px rgba(15, 23, 42, .24);
}

body.ui-modern.vbs-v5 .alert-heading,
body.ui-modern.vbs-v5 .alert-message {
    display: block;
}

body.ui-modern.vbs-v5 .alert-heading {
    margin: 0 0 2px;
    color: currentColor;
    font-size: .9375rem;
    font-weight: 800;
    line-height: 1.4;
}

body.ui-modern.vbs-v5 .alert-message {
    font-size: .9rem;
}

/* Real section navigation replaces the former static three-step decoration. */
body.ui-modern.vbs-v2.vbs-v3.vbs-v4.vbs-v5 .request-stepper {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 78vw);
    grid-template-columns: none;
    gap: 9px;
    margin-inline: -2px;
    padding: 2px 2px 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 2px;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
}

body.ui-modern.vbs-v5 .request-step {
    min-height: 68px;
    color: inherit;
    text-decoration: none;
    scroll-snap-align: start;
}

body.ui-modern.vbs-v5 .request-step:hover {
    border-color: #9eb9d6;
    background: #f7fbff;
}

body.ui-modern.vbs-v5 .request-step[aria-current="step"] {
    border-color: #78a9db;
    background: #eef6ff;
    box-shadow: 0 0 0 2px rgba(15, 85, 157, .10);
}

body.ui-modern.vbs-v5 :where([data-progress-section], .request-submit-bar) {
    scroll-margin-top: 112px;
}

/* Keep the primary login task first in the DOM flow visible on small screens. */
body.ui-modern.vbs-v5[data-page="login.php"] .auth-shell-login {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
}

body.ui-modern.vbs-v5[data-page="login.php"] .auth-login-panel {
    order: 1;
}

body.ui-modern.vbs-v5[data-page="login.php"] .auth-hero-login {
    order: 2;
}

body.ui-modern.vbs-v5[data-page="login.php"] .auth-capabilities {
    display: none;
}

/* Accessible replacement for inconsistent native confirm() prompts. */
body.ui-modern.vbs-v5 .vbs-confirm-dialog {
    width: min(calc(100% - 24px), 520px);
    max-width: 520px;
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--v5-border);
    border-radius: 18px;
    color: var(--v5-ink);
    background: var(--v5-surface);
    box-shadow: var(--v5-dialog-shadow);
}

body.ui-modern.vbs-v5 .vbs-confirm-dialog:not([open]) {
    display: none;
}

body.ui-modern.vbs-v5 .vbs-confirm-dialog::backdrop {
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(3px);
}

body.ui-modern.vbs-v5 .vbs-confirm-dialog-head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 20px 20px 16px;
}

body.ui-modern.vbs-v5 .vbs-confirm-dialog-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid #e7bd83;
    border-radius: 13px;
    color: var(--v5-warning);
    background: #fff7e9;
    font-size: 1.05rem;
    font-weight: 900;
}

body.ui-modern.vbs-v5 .vbs-confirm-dialog.is-danger .vbs-confirm-dialog-icon {
    border-color: #e5aaa5;
    color: var(--v5-danger);
    background: #fff1ef;
}

body.ui-modern.vbs-v5 .vbs-confirm-dialog h2 {
    margin: 0;
    color: var(--v5-ink);
    font-size: 1.15rem;
    line-height: 1.4;
}

body.ui-modern.vbs-v5 .vbs-confirm-dialog p {
    margin: 6px 0 0;
    color: var(--v5-muted);
    font-size: .9375rem;
    line-height: 1.65;
}

body.ui-modern.vbs-v5 .vbs-confirm-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    margin: 0;
    padding: 14px 20px 20px;
    border-top: 1px solid #e4ebf2;
    background: var(--v5-surface-soft);
}

body.ui-modern.vbs-v5 .vbs-confirm-dialog-actions .btn {
    width: 100%;
}

body.ui-modern.vbs-v5 form[aria-busy="true"] {
    cursor: progress;
}

body.ui-modern.vbs-v5 form[aria-busy="true"] button[aria-disabled="true"] {
    pointer-events: none;
}

@media (min-width: 540px) {
    body.ui-modern.vbs-v5 .vbs-confirm-dialog-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 641px) {
    body.ui-modern.vbs-v5[data-page="login.php"] .auth-capabilities {
        display: grid;
    }

    body.ui-modern.vbs-v2.vbs-v3.vbs-v4.vbs-v5 .request-stepper {
        grid-auto-columns: minmax(230px, 44vw);
    }
}

@media (min-width: 901px) {
    body.ui-modern.vbs-v5[data-page="login.php"] .auth-shell-login {
        grid-template-columns: minmax(0, 1.1fr) minmax(400px, .9fr);
    }

    body.ui-modern.vbs-v5[data-page="login.php"] .auth-hero-login {
        order: 1;
    }

    body.ui-modern.vbs-v5[data-page="login.php"] .auth-login-panel {
        order: 2;
    }

    body.ui-modern.vbs-v2.vbs-v3.vbs-v4.vbs-v5 .request-stepper {
        grid-auto-flow: initial;
        grid-auto-columns: auto;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        overflow: visible;
        padding-bottom: 2px;
    }
}

@media (prefers-contrast: more) {
    body.ui-modern.vbs-v5 :where(.card, .form-section, .table-wrap, input, select, textarea, .request-step) {
        border-color: #75869b !important;
    }

    body.ui-modern.vbs-v5 :where(.muted, .field-help, .helper-text) {
        color: #344256 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ui-modern.vbs-v5 .request-stepper {
        scroll-behavior: auto;
        scroll-snap-type: none;
    }

    body.ui-modern.vbs-v5 .vbs-confirm-dialog::backdrop {
        backdrop-filter: none;
    }
}

@media (forced-colors: active) {
    body.ui-modern.vbs-v5 .vbs-confirm-dialog,
    body.ui-modern.vbs-v5 .vbs-confirm-dialog-icon,
    body.ui-modern.vbs-v5 .request-step[aria-current="step"] {
        border: 2px solid CanvasText;
    }
}
