/* =========================================================
   VBS SRRU — Modern Responsive UI Layer
   Updated: 2026-07-09
   Purpose: final visual layer loaded after app.css.
   Keeps existing PHP workflows intact while unifying desktop,
   tablet and mobile presentation.
   ========================================================= */

:root {
    --vbs-bg: #f3f6fa;
    --vbs-surface: #ffffff;
    --vbs-surface-soft: #f8fafc;
    --vbs-surface-blue: #f3f7fd;
    --vbs-text: #162033;
    --vbs-text-strong: #0f172a;
    --vbs-muted: #667085;
    --vbs-primary: #175fb7;
    --vbs-primary-strong: #0e4b96;
    --vbs-primary-soft: #eaf3ff;
    --vbs-accent: #0f766e;
    --vbs-success: #16803d;
    --vbs-warning: #b76b08;
    --vbs-danger: #c43232;
    --vbs-border: #dbe4ef;
    --vbs-border-strong: #bdc9d8;
    --vbs-sidebar: #152238;
    --vbs-sidebar-2: #101b2e;
    --vbs-radius-xs: 8px;
    --vbs-radius-sm: 10px;
    --vbs-radius: 14px;
    --vbs-radius-lg: 18px;
    --vbs-shadow-xs: 0 2px 8px rgba(15, 23, 42, .04);
    --vbs-shadow-sm: 0 8px 24px rgba(15, 23, 42, .06);
    --vbs-shadow: 0 16px 42px rgba(15, 23, 42, .08);
    --vbs-content: 1680px;
    --vbs-sidebar-width: 276px;
    --vbs-sidebar-collapsed: 80px;
    --vbs-mobile-nav-height: 70px;
}

html {
    min-width: 320px;
    background: var(--vbs-bg);
    color-scheme: light;
}

body.ui-modern {
    min-width: 320px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.62) 0, rgba(255,255,255,0) 260px),
        var(--vbs-bg) !important;
    color: var(--vbs-text);
    line-height: 1.58;
    overflow-x: hidden;
}

body.ui-modern,
body.ui-modern input,
body.ui-modern select,
body.ui-modern textarea,
body.ui-modern button {
    font-family: 'Sarabun', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.ui-modern h1,
body.ui-modern h2,
body.ui-modern h3,
body.ui-modern h4,
body.ui-modern .section-title,
body.ui-modern .btn,
body.ui-modern .badge,
body.ui-modern .brand-title,
body.ui-modern .topbar-kicker,
body.ui-modern .sidebar-nav-title {
    font-family: 'Sarabun', sans-serif;
}

body.ui-modern *,
body.ui-modern *::before,
body.ui-modern *::after {
    font-family: 'Sarabun', sans-serif;
}

body.ui-modern * {
    scrollbar-width: thin;
    scrollbar-color: #b7c5d6 transparent;
}

body.ui-modern *::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body.ui-modern *::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #b7c5d6;
}

body.ui-modern :focus-visible {
    outline: 3px solid rgba(23,95,183,.22);
    outline-offset: 2px;
}

body.ui-modern .skip-link {
    z-index: 9999;
    border-radius: var(--vbs-radius-sm);
    background: var(--vbs-primary);
    color: #fff;
}

/* App shell */
body.ui-modern .app-shell {
    width: 100%;
    min-height: 100dvh;
    max-width: none;
    overflow: visible;
    background: transparent;
}

body.ui-modern.has-sidebar .main-content {
    flex: 1 1 auto;
    width: min(100%, var(--vbs-content));
    max-width: var(--vbs-content);
    min-width: 0;
    margin: 0 auto;
    padding: clamp(16px, 1.7vw, 28px);
}

body.ui-modern.no-sidebar .main-content {
    width: min(100%, 1440px);
    max-width: 1440px;
    min-width: 0;
    margin: 0 auto;
    padding: clamp(16px, 2vw, 30px);
}

/* Sidebar */
body.ui-modern .sidebar {
    width: var(--vbs-sidebar-width);
    flex: 0 0 var(--vbs-sidebar-width);
    padding: 14px 12px;
    background: linear-gradient(180deg, var(--vbs-sidebar) 0%, var(--vbs-sidebar-2) 100%);
    border-right: 1px solid rgba(255,255,255,.08);
    box-shadow: none;
}

body.ui-modern .sidebar-head {
    min-height: 66px;
    margin: 0 0 12px;
    padding: 8px;
    align-items: center;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    background: rgba(255,255,255,.045);
}

body.ui-modern .sidebar-brand-row {
    min-width: 0;
    gap: 10px;
}

body.ui-modern .sidebar-head-toggle,
body.ui-modern .sidebar-close {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 11px;
    background: rgba(255,255,255,.06);
    color: #fff;
    box-shadow: none;
}

body.ui-modern .sidebar-head-toggle:hover,
body.ui-modern .sidebar-close:hover {
    background: rgba(255,255,255,.12);
}

body.ui-modern .brand-app-logo {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 13px;
    background: linear-gradient(145deg, #ffffff 0%, #e8f2ff 100%);
    color: var(--vbs-primary);
    box-shadow: 0 7px 20px rgba(0,0,0,.12);
}

body.ui-modern .brand-app-logo-glyph {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

body.ui-modern .brand-meta {
    min-width: 0;
}

body.ui-modern .brand-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
}

body.ui-modern .brand-subtitle {
    margin-top: 2px;
    color: rgba(255,255,255,.62);
    font-size: .82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.ui-modern .sidebar-menu {
    display: grid;
    gap: 9px;
    padding-bottom: 10px;
}

body.ui-modern .nav-group {
    padding: 8px;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
}

body.ui-modern .nav-group-active {
    border-color: rgba(125,211,252,.18);
    background: rgba(255,255,255,.055);
}

body.ui-modern .sidebar-nav-title {
    margin: 0 7px 7px;
    color: rgba(255,255,255,.45);
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .06em !important;
}

body.ui-modern .nav-section {
    gap: 3px;
}

body.ui-modern .nav-link {
    min-height: 42px;
    gap: 9px;
    padding: 7px 9px;
    border-radius: 10px;
    color: rgba(255,255,255,.78);
    font-size: .94rem;
    font-weight: 500;
}

body.ui-modern .nav-link::before {
    display: none;
}

body.ui-modern .nav-link:hover {
    transform: none;
    color: #fff;
    background: rgba(255,255,255,.075);
}

body.ui-modern .nav-link-active,
body.ui-modern .nav-link[aria-current="page"] {
    color: #fff;
    background: linear-gradient(90deg, rgba(35,121,229,.38), rgba(35,121,229,.16));
    box-shadow: inset 3px 0 0 #7dd3fc;
}

body.ui-modern .nav-icon {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    border-radius: 9px;
    background: rgba(255,255,255,.075);
    color: rgba(255,255,255,.88);
}

body.ui-modern .nav-link-active .nav-icon,
body.ui-modern .nav-link[aria-current="page"] .nav-icon {
    background: rgba(255,255,255,.12);
    color: #fff;
}

body.ui-modern .nav-link-danger:hover {
    background: rgba(220,38,38,.18);
}

body.ui-modern .sidebar-footer {
    margin-top: 8px;
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 13px;
    background: rgba(255,255,255,.035);
}

body.ui-modern .sidebar-footer-user {
    font-size: .9rem;
}

body.ui-modern .sidebar-footer-role {
    margin-top: 1px;
    color: rgba(255,255,255,.55);
    font-size: .78rem;
}

/* Topbar */
body.ui-modern .topbar {
    position: sticky;
    top: 12px;
    z-index: 40;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 92px;
    margin: 0 0 18px;
    padding: 14px 16px;
    box-sizing: border-box;
    border: 1px solid rgba(201,213,227,.92);
    border-radius: 16px !important;
    background: rgba(255,255,255,.94);
    box-shadow: 0 8px 28px rgba(15,23,42,.07);
    backdrop-filter: blur(18px) saturate(145%);
}

/*
   2026-07-09 Card width alignment fix
   Keep the topbar, dashboard hero and every flash-card row on one content rail.
   This explicitly overrides the legacy --content-max: 1520px rule that made
   the topbar narrower than the full-width dashboard cards on wide screens.
*/
body.ui-modern .topbar,
body.ui-modern .dashboard-hero.card,
body.ui-modern .dashboard-stats,
body.ui-modern .monthly-snapshot,
body.ui-modern .dashboard-admin-panels,
body.ui-modern .dashboard-main-grid {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

body.ui-modern .dashboard-stats,
body.ui-modern .monthly-snapshot,
body.ui-modern .dashboard-admin-panels,
body.ui-modern .dashboard-main-grid {
    justify-content: stretch !important;
    justify-items: stretch !important;
}

body.ui-modern .dashboard-stats > .card,
body.ui-modern .monthly-snapshot > .card,
body.ui-modern .dashboard-admin-panels > .card,
body.ui-modern .dashboard-main-grid > .card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box;
}

body.ui-modern .dashboard-stats > .card,
body.ui-modern .monthly-snapshot > .card,
body.ui-modern .dashboard-admin-panels > .card {
    height: 100%;
}

body.ui-modern .topbar-left {
    align-items: center;
    gap: 12px;
    min-width: 0;
}

body.ui-modern .topbar-copy {
    min-width: 0;
}

body.ui-modern .topbar-university-logo {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border: 1px solid var(--vbs-border);
    border-radius: 13px;
    background: #fff;
    box-shadow: var(--vbs-shadow-xs);
}

body.ui-modern .topbar-kicker {
    display: inline-flex;
    max-width: 100%;
    min-height: 24px;
    margin: 0 0 3px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--vbs-primary-soft);
    color: var(--vbs-primary-strong);
    font-size: .72rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.ui-modern .topbar h1 {
    margin: 0;
    color: var(--vbs-text-strong);
    font-size: clamp(1.18rem, 1.5vw, 1.58rem);
    font-weight: 600;
    line-height: 1.28;
    letter-spacing: -.01em !important;
}

body.ui-modern .topbar p {
    max-width: 820px;
    margin: 2px 0 0;
    color: var(--vbs-muted);
    font-size: .91rem;
    line-height: 1.45;
}

body.ui-modern .topbar-actions {
    gap: 9px;
    min-width: 0;
    flex-wrap: nowrap;
}

body.ui-modern .topbar-quick-nav {
    display: flex;
    gap: 3px;
    padding: 4px;
    border: 1px solid var(--vbs-border);
    border-radius: 999px;
    background: #fff;
}

body.ui-modern .topbar-quick-link {
    min-height: 36px;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    color: #42526a;
    font-size: .87rem;
    font-weight: 600;
}

body.ui-modern .topbar-quick-link:hover {
    transform: none;
    background: #f2f6fb;
    color: var(--vbs-primary);
}

body.ui-modern .topbar-quick-link.is-active,
body.ui-modern .topbar-quick-link[aria-current="page"],
body.ui-modern .topbar-quick-primary {
    background: var(--vbs-primary);
    color: #fff;
    box-shadow: none;
}

body.ui-modern .topbar-user {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 9px;
    min-width: 0;
    max-width: min(32vw, 330px);
    padding: 7px 9px;
    border: 1px solid var(--vbs-border);
    border-radius: 999px;
    background: #fff;
    box-shadow: none;
    color: var(--vbs-text);
}

body.ui-modern .topbar-user:hover {
    border-color: #aebed1;
    background: #fbfdff;
}

body.ui-modern .avatar {
    width: 38px;
    height: 38px;
    background: #e9f2ff;
    color: var(--vbs-primary);
    font-weight: 700;
}

body.ui-modern .topbar-user-copy {
    min-width: 0;
}

body.ui-modern .topbar-user-copy strong,
body.ui-modern .topbar-user-copy .small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

body.ui-modern .topbar-user-copy strong {
    color: var(--vbs-text-strong);
    font-size: .9rem;
}

body.ui-modern .topbar-user-copy .small {
    font-size: .75rem;
}

body.ui-modern .topbar-user-chevron {
    color: #98a2b3;
    font-size: 1.3rem;
    line-height: 1;
}

/* Common surfaces */
body.ui-modern .card,
body.ui-modern .auth-form-card,
body.ui-modern .hero-card,
body.ui-modern .table-wrap,
body.ui-modern .map-panel,
body.ui-modern .request-form-head,
body.ui-modern .form-section,
body.ui-modern .dispatch-step,
body.ui-modern .health-item,
body.ui-modern .empty,
body.ui-modern .alert,
body.ui-modern .soft-panel,
body.ui-modern .mini-stat {
    border-radius: var(--vbs-radius) !important;
}

body.ui-modern .card {
    padding: clamp(16px, 1.35vw, 22px);
    border: 1px solid var(--vbs-border);
    background: var(--vbs-surface);
    box-shadow: var(--vbs-shadow-xs);
}

body.ui-modern .card:hover {
    transform: none;
    border-color: #c5d2e1;
    box-shadow: var(--vbs-shadow-sm);
}

body.ui-modern .grid {
    gap: clamp(12px, 1.2vw, 18px);
}

body.ui-modern .section-title {
    margin: 0 0 8px;
    color: var(--vbs-text-strong);
    font-size: 1.07rem;
    font-weight: 600;
    line-height: 1.4;
}

body.ui-modern .muted {
    color: var(--vbs-muted);
}

body.ui-modern .small {
    font-size: .88rem;
}

body.ui-modern .section-head,
body.ui-modern .results-head {
    gap: 14px;
    align-items: center;
}

body.ui-modern .results-head {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--vbs-border);
}

body.ui-modern .empty {
    padding: 18px;
    border: 1px dashed #c7d3e1;
    background: var(--vbs-surface-soft);
    color: var(--vbs-muted);
}

/* Dashboard */
body.ui-modern .dashboard-hero.card {
    position: relative;
    overflow: hidden;
    min-height: 142px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: clamp(18px, 1.7vw, 26px);
    border-color: #cddbeb;
    background:
        radial-gradient(circle at 88% 15%, rgba(23,95,183,.11), transparent 25%),
        linear-gradient(135deg, #ffffff 0%, #f7fbff 100%) !important;
}

body.ui-modern .dashboard-hero::after {
    content: '';
    position: absolute;
    width: 190px;
    height: 190px;
    right: -90px;
    bottom: -120px;
    border-radius: 50%;
    border: 34px solid rgba(23,95,183,.05);
    pointer-events: none;
}

body.ui-modern .dashboard-hero h2 {
    max-width: 820px;
    margin: 0 0 5px;
    font-size: clamp(1.28rem, 1.9vw, 1.8rem);
    font-weight: 600;
    line-height: 1.35;
}

body.ui-modern .dashboard-context {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

body.ui-modern .dashboard-context span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid #d9e5f2;
    border-radius: 999px;
    background: rgba(255,255,255,.8);
    color: #5f6f82;
    font-size: .78rem;
}

body.ui-modern .quick-actions {
    position: relative;
    z-index: 1;
    align-items: center;
}

body.ui-modern .dashboard-stats {
    margin-top: 0;
}

body.ui-modern .stat-card,
body.ui-modern .mini-stat,
body.ui-modern .soft-panel {
    position: relative;
    min-height: 132px;
    overflow: hidden;
    background: #fff !important;
}

body.ui-modern .stat-card::before,
body.ui-modern .stat-card::after {
    opacity: .55;
}

body.ui-modern .stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eef5ff;
    color: var(--vbs-primary);
}

body.ui-modern .stat-label {
    margin-bottom: 4px;
    color: var(--vbs-muted);
    font-size: .9rem;
}

body.ui-modern .stat-value {
    color: var(--vbs-text-strong);
    font-size: clamp(1.65rem, 2.5vw, 2.25rem);
    font-weight: 700;
}

body.ui-modern .stat-note {
    margin-top: 7px;
    color: var(--vbs-muted);
    font-size: .82rem;
}

body.ui-modern .metric-list div {
    min-height: 38px;
    border-color: #e5ebf2;
}

body.ui-modern .metric-list strong {
    color: var(--vbs-primary-strong);
}

body.ui-modern .timeline-card {
    border: 1px solid var(--vbs-border);
    border-radius: var(--vbs-radius-sm);
    background: #fff;
}

body.ui-modern .timeline-card:hover {
    border-color: #b7c7d9;
    background: #fbfdff;
}

/* Forms */
body.ui-modern label,
body.ui-modern .filter-field > span {
    color: #344054;
    font-weight: 600;
}

body.ui-modern input,
body.ui-modern select,
body.ui-modern textarea {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--vbs-border-strong);
    border-radius: var(--vbs-radius-sm) !important;
    background: #fff;
    color: var(--vbs-text);
    box-shadow: inset 0 1px 0 rgba(15,23,42,.015);
}

body.ui-modern input:hover,
body.ui-modern select:hover,
body.ui-modern textarea:hover {
    border-color: #aebccd;
}

body.ui-modern input:focus,
body.ui-modern select:focus,
body.ui-modern textarea:focus {
    outline: 0;
    border-color: var(--vbs-primary);
    box-shadow: 0 0 0 4px rgba(23,95,183,.11);
}

body.ui-modern input::placeholder,
body.ui-modern textarea::placeholder {
    color: #98a2b3;
}

body.ui-modern textarea {
    min-height: 112px;
}

body.ui-modern input[type="checkbox"],
body.ui-modern input[type="radio"] {
    min-height: auto;
    accent-color: var(--vbs-primary);
}

body.ui-modern input[type="file"] {
    min-height: 48px;
    padding: 6px;
    background: var(--vbs-surface-soft);
}

body.ui-modern input[type="file"]::file-selector-button {
    min-height: 34px;
    margin-right: 10px;
    padding: 6px 11px;
    border: 1px solid var(--vbs-border-strong);
    border-radius: 8px;
    background: #fff;
    color: #344054;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

body.ui-modern .file-input-summary {
    margin-top: 7px;
    padding: 8px 10px;
    border: 1px solid #cfe0f2;
    border-radius: 9px;
    background: #f2f7fd;
    color: #425b78;
    font-size: .82rem;
}

body.ui-modern .choice-box,
body.ui-modern .line-status-box,
body.ui-modern .cancel-summary,
body.ui-modern .evaluation-intro {
    border-radius: var(--vbs-radius) !important;
    border-color: var(--vbs-border) !important;
    background: var(--vbs-surface-soft) !important;
}

body.ui-modern .request-form-card {
    display: grid;
    gap: 16px;
}

body.ui-modern .request-form-head,
body.ui-modern .form-section {
    border: 1px solid var(--vbs-border) !important;
    background: #fff !important;
    box-shadow: none !important;
}

body.ui-modern .request-form-head {
    padding: clamp(16px, 1.5vw, 22px);
    background: linear-gradient(135deg, #ffffff 0%, #f6faff 100%) !important;
}

body.ui-modern .form-section {
    padding: clamp(16px, 1.5vw, 22px);
}

body.ui-modern .form-section-head {
    align-items: center;
    margin-bottom: 16px;
}

body.ui-modern .form-section-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--vbs-primary-soft);
    color: var(--vbs-primary);
}

body.ui-modern .request-stepper {
    gap: 10px;
}

body.ui-modern .request-step {
    min-height: 74px;
    padding: 10px 12px;
    border: 1px solid var(--vbs-border);
    border-radius: var(--vbs-radius) !important;
    background: #fff;
}

body.ui-modern .request-step.is-active {
    border-color: #b9d2ef;
    background: #f5f9ff;
}

body.ui-modern .request-step > span {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #e9f2ff;
    color: var(--vbs-primary);
}

body.ui-modern .map-panel {
    border: 1px solid var(--vbs-border);
    background: #fff;
    box-shadow: none;
}

body.ui-modern .map-canvas {
    min-height: clamp(320px, 42vw, 500px);
    border-radius: var(--vbs-radius) !important;
}

body.ui-modern .request-submit-bar {
    position: sticky;
    bottom: 12px;
    z-index: 18;
    margin-top: 0;
    padding: 10px;
    border: 1px solid rgba(205,218,233,.94);
    border-radius: 14px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 12px 32px rgba(15,23,42,.12);
    backdrop-filter: blur(16px);
}


body.ui-modern .destination-required-status {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    background: #fff7ed;
    color: #9a3412;
    font-size: .9rem;
    font-weight: 600;
}

body.ui-modern .destination-required-status.is-ready {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

body.ui-modern #booking-submit-button[disabled] {
    filter: grayscale(.12);
    box-shadow: none !important;
}

/* Password reveal */
body.ui-modern .password-field {
    position: relative;
}

body.ui-modern .password-field input {
    padding-right: 52px;
}

body.ui-modern .password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 38px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #667085;
    cursor: pointer;
}

body.ui-modern .password-toggle:hover {
    background: #eef3f8;
    color: var(--vbs-primary);
}

body.ui-modern .password-toggle::before {
    content: '◉';
    font-size: 1rem;
}

body.ui-modern .password-toggle[aria-pressed="true"]::before {
    content: '◎';
}

/* Buttons */
body.ui-modern .btn,
body.ui-modern a.btn,
body.ui-modern button.btn {
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: var(--vbs-radius-sm) !important;
    background: var(--vbs-primary);
    color: #fff !important;
    -webkit-text-fill-color: currentColor !important;
    text-shadow: none !important;
    box-shadow: none !important;
    font-weight: 600;
    line-height: 1.2;
}

body.ui-modern .btn:hover,
body.ui-modern a.btn:hover,
body.ui-modern button.btn:hover {
    transform: none;
    filter: none;
    background: var(--vbs-primary-strong);
    color: #fff !important;
}

body.ui-modern .btn:active {
    transform: translateY(1px);
}

body.ui-modern .btn-outline,
body.ui-modern a.btn-outline,
body.ui-modern button.btn-outline {
    border-color: var(--vbs-border-strong) !important;
    background: #fff !important;
    color: #344054 !important;
    -webkit-text-fill-color: #344054 !important;
}

body.ui-modern .btn-outline:hover,
body.ui-modern a.btn-outline:hover,
body.ui-modern button.btn-outline:hover {
    border-color: #9fb3c9 !important;
    background: #f6f9fc !important;
    color: var(--vbs-primary-strong) !important;
    -webkit-text-fill-color: var(--vbs-primary-strong) !important;
}

body.ui-modern .btn-success,
body.ui-modern a.btn-success,
body.ui-modern button.btn-success {
    background: var(--vbs-success) !important;
    color: #fff !important;
}

body.ui-modern .btn-success:hover {
    background: #116d34 !important;
}

body.ui-modern .btn-warning,
body.ui-modern a.btn-warning,
body.ui-modern button.btn-warning {
    background: #f3b33f !important;
    color: #3f2a04 !important;
    -webkit-text-fill-color: #3f2a04 !important;
}

body.ui-modern .btn-warning:hover {
    background: #e6a52e !important;
    color: #342100 !important;
}

body.ui-modern .btn-danger,
body.ui-modern a.btn-danger,
body.ui-modern button.btn-danger {
    background: var(--vbs-danger) !important;
    color: #fff !important;
}

body.ui-modern .btn-danger:hover {
    background: #aa2727 !important;
}

body.ui-modern .btn-muted,
body.ui-modern a.btn-muted,
body.ui-modern button.btn-muted {
    background: #59697c !important;
    color: #fff !important;
}

body.ui-modern .btn[disabled],
body.ui-modern .btn.disabled,
body.ui-modern .btn[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
}

body.ui-modern .btn.is-loading {
    position: relative;
    pointer-events: none;
    opacity: .82;
}

body.ui-modern .btn.is-loading::after {
    content: '';
    width: 15px;
    height: 15px;
    margin-left: 3px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: vbs-spin .7s linear infinite;
}

@keyframes vbs-spin {
    to { transform: rotate(360deg); }
}

/* Badges and alerts */
body.ui-modern .badge,
body.ui-modern .chip,
body.ui-modern .filter-chip {
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
}

body.ui-modern .filter-chip {
    border: 1px solid #cfe0f2;
    background: #eff6ff;
    color: #315d91;
}

body.ui-modern .alert {
    position: relative;
    padding: 13px 46px 13px 14px;
    border-width: 1px;
    border-style: solid;
    box-shadow: var(--vbs-shadow-xs);
    font-weight: 600;
}

body.ui-modern .alert-success {
    border-color: #b9dfc6;
    background: #effaf3;
    color: #176436;
}

body.ui-modern .alert-danger {
    border-color: #efc0c0;
    background: #fff1f1;
    color: #9a2929;
}

body.ui-modern .alert-warning {
    border-color: #ead4a4;
    background: #fff9eb;
    color: #7d5508;
}

body.ui-modern .alert-dismiss {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: currentColor;
    opacity: .7;
    cursor: pointer;
}

body.ui-modern .alert-dismiss:hover {
    background: rgba(15,23,42,.06);
    opacity: 1;
}

/* Tables */
body.ui-modern .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--vbs-border);
    background: #fff;
    box-shadow: none;
}

body.ui-modern table {
    width: 100%;
    min-width: 760px;
}

body.ui-modern th,
body.ui-modern td {
    padding: 11px 12px;
    border-color: #e6edf4;
}

body.ui-modern thead th {
    background: #f7f9fc;
    color: #475467;
    font-size: .84rem;
    font-weight: 600;
    white-space: nowrap;
}

body.ui-modern tbody tr:nth-child(even) td {
    background: #fcfdff;
}

body.ui-modern tbody tr:hover td {
    background: #f3f7fc;
}

body.ui-modern .table-link {
    color: var(--vbs-primary-strong);
    font-weight: 600;
}

body.ui-modern .table-wrap td:last-child .actions {
    gap: 6px;
    margin-top: 0;
}

body.ui-modern .table-wrap td:last-child .actions .btn,
body.ui-modern .table-wrap td:last-child .actions button.btn {
    min-height: 36px;
    padding: 7px 10px;
    font-size: .84rem;
}

/* Toolbars and filters */
body.ui-modern .page-toolbar,
body.ui-modern .bookings-toolbar {
    display: grid;
    gap: 14px;
    align-items: stretch;
}

body.ui-modern .searchbar,
body.ui-modern .bookings-searchbar {
    gap: 10px;
}

body.ui-modern .bookings-searchbar {
    grid-template-columns: minmax(220px, 1.4fr) minmax(150px, .7fr) repeat(2, minmax(145px, .65fr)) minmax(112px, .45fr) auto;
    align-items: end;
}

body.ui-modern .filter-field {
    gap: 5px;
}

body.ui-modern .filter-field > span {
    font-size: .78rem;
}

body.ui-modern .searchbar-actions {
    gap: 7px;
    align-items: end;
}

body.ui-modern .pagination {
    gap: 6px;
    border-color: var(--vbs-border);
}

body.ui-modern .pagination-link,
body.ui-modern .pagination-ellipsis {
    min-width: 40px;
    min-height: 40px;
    border-radius: 10px;
}

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

body.ui-modern .pagination-link:hover {
    transform: none;
    border-color: #afc1d5;
    background: #f3f7fc;
    color: var(--vbs-primary);
}

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

/* Key-value details */
body.ui-modern .kv div {
    padding: 9px 0;
    border-color: #dce5ef;
}

body.ui-modern .kv > div:nth-child(odd) {
    color: #5b6b7f;
    font-weight: 600;
}

/* Auth */
body.ui-modern .main-auth .topbar {
    display: none;
}

body.ui-modern .auth-shell-modern {
    min-height: calc(100dvh - 82px);
    grid-template-columns: minmax(0, 1.16fr) minmax(380px, .84fr);
    gap: clamp(16px, 2vw, 26px);
    align-items: stretch;
}

body.ui-modern .auth-hero-modern {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 650px;
    padding: clamp(28px, 4vw, 58px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 24px !important;
    background:
        radial-gradient(circle at 82% 18%, rgba(125,211,252,.24), transparent 24%),
        radial-gradient(circle at 13% 90%, rgba(45,212,191,.18), transparent 28%),
        linear-gradient(145deg, #13233a 0%, #174f91 100%);
    box-shadow: 0 22px 56px rgba(15,23,42,.15);
}

body.ui-modern .auth-hero-modern::before,
body.ui-modern .auth-hero-modern::after {
    opacity: .7;
}

body.ui-modern .auth-brand-lockup {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

body.ui-modern .auth-brand-logo {
    width: 64px;
    height: 64px;
    padding: 7px;
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 14px 34px rgba(0,0,0,.18);
}

body.ui-modern .auth-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.ui-modern .auth-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: #b9dcff;
    font-family: 'Sarabun', sans-serif;
    font-size: .77rem;
    font-weight: 500;
    letter-spacing: .09em;
}

body.ui-modern .auth-hero-modern h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(2rem, 3.8vw, 3.45rem);
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -.02em !important;
}

body.ui-modern .auth-hero-desc {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 24px 0 0;
    color: rgba(255,255,255,.82);
    font-size: clamp(1rem, 1.3vw, 1.16rem);
    line-height: 1.75;
}

body.ui-modern .auth-feature-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 28px;
}

body.ui-modern .auth-feature-grid > div {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    min-height: 118px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px;
    background: rgba(255,255,255,.075);
    backdrop-filter: blur(8px);
}

body.ui-modern .auth-feature-number {
    color: #9ad0ff;
    font-family: 'Sarabun', sans-serif;
    font-size: .78rem;
    font-weight: 600;
}

body.ui-modern .auth-feature-grid strong,
body.ui-modern .auth-feature-grid small {
    display: block;
}

body.ui-modern .auth-feature-grid strong {
    color: #fff;
    font-size: .95rem;
}

body.ui-modern .auth-feature-grid small {
    margin-top: 5px;
    color: rgba(255,255,255,.66);
    font-size: .8rem;
    line-height: 1.55;
}

body.ui-modern .auth-trust-note {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 24px;
    color: rgba(255,255,255,.72);
    font-size: .84rem;
}

body.ui-modern .auth-trust-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: #5eead4;
    box-shadow: 0 0 0 5px rgba(94,234,212,.12);
}

body.ui-modern .auth-form-card-modern {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: none;
    padding: clamp(24px, 3vw, 44px);
    border-radius: 24px !important;
    box-shadow: var(--vbs-shadow-sm);
}

body.ui-modern .auth-form-head-modern {
    margin-bottom: 22px;
}

body.ui-modern .auth-form-kicker {
    display: block;
    margin-bottom: 7px;
    color: var(--vbs-primary);
    font-family: 'Sarabun', sans-serif;
    font-size: .82rem;
    font-weight: 500;
}

body.ui-modern .auth-form-head-modern .section-title {
    margin-bottom: 6px;
    font-size: clamp(1.55rem, 2.6vw, 2.1rem);
}

body.ui-modern .auth-google-btn {
    width: 100%;
    min-height: 56px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 24px;
    gap: 10px;
    border: 1px solid #cbd7e5 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #233044 !important;
    -webkit-text-fill-color: #233044 !important;
    text-align: left;
}

body.ui-modern .auth-google-btn:hover {
    border-color: #a8bad0 !important;
    background: #f8fbff !important;
    color: var(--vbs-primary-strong) !important;
}

body.ui-modern .google-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #ea4335 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    box-shadow: none !important;
}

body.ui-modern .auth-button-arrow {
    color: #8a99aa;
    font-size: 1.15rem;
    text-align: right;
}

body.ui-modern .auth-google-note {
    margin-top: 10px;
    text-align: center;
}

body.ui-modern .auth-divider {
    margin: 24px 0;
}

body.ui-modern .auth-note-modern {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 11px;
    margin-top: 24px;
    padding: 13px;
    border: 1px solid var(--vbs-border);
    border-radius: 12px;
    background: var(--vbs-surface-soft);
}

body.ui-modern .auth-note-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #e9f7ef;
    color: var(--vbs-success);
    font-weight: 700;
}

body.ui-modern .main-auth .footer {
    max-width: none;
    margin-top: 18px;
}

/* Footer */
body.ui-modern .footer {
    margin-top: 22px;
    padding: 15px 2px 2px;
    border-top: 1px solid #dce5ef;
    color: var(--vbs-muted);
}

body.ui-modern .footer strong {
    color: #475467;
    font-weight: 600;
}

/* Mobile navigation */
body.ui-modern .mobile-tabbar {
    border: 1px solid rgba(190,204,220,.96);
    border-radius: 18px !important;
    background: rgba(255,255,255,.96);
    box-shadow: 0 14px 38px rgba(15,23,42,.16);
    backdrop-filter: blur(18px) saturate(145%);
}

body.ui-modern .mobile-tabbar-link {
    min-height: 52px;
    border-radius: 12px !important;
    color: #536274;
}

body.ui-modern .mobile-tabbar-link:hover {
    background: #f3f6fa;
}

body.ui-modern .mobile-tabbar-link.is-active,
body.ui-modern .mobile-tabbar-link[aria-current="page"] {
    background: var(--vbs-primary-soft);
    color: var(--vbs-primary);
    box-shadow: none;
}

body.ui-modern .mobile-tabbar-primary,
body.ui-modern .mobile-tabbar-primary.is-active {
    background: var(--vbs-primary);
    color: #fff;
}

/* Collapsed desktop sidebar */
@media (min-width: 1025px) {
    body.ui-modern.has-sidebar.sidebar-collapsed .sidebar {
        width: var(--vbs-sidebar-collapsed);
        flex-basis: var(--vbs-sidebar-collapsed);
        padding: 12px 8px;
    }

    body.ui-modern.has-sidebar.sidebar-collapsed .sidebar-head {
        padding: 7px;
    }

    body.ui-modern.has-sidebar.sidebar-collapsed .nav-group {
        padding: 6px;
    }

    body.ui-modern.has-sidebar.sidebar-collapsed .nav-link {
        min-height: 42px;
        justify-content: center;
        padding: 6px;
        box-shadow: none;
    }

    body.ui-modern.has-sidebar.sidebar-collapsed .nav-link-active,
    body.ui-modern.has-sidebar.sidebar-collapsed .nav-link[aria-current="page"] {
        background: rgba(35,121,229,.32);
    }

    body.ui-modern.has-sidebar.sidebar-collapsed .nav-icon {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    body.ui-modern.has-sidebar.sidebar-collapsed .brand-app-logo {
        display: none;
    }
}

/* Large tablets / small desktops */
@media (max-width: 1320px) {
    body.ui-modern .topbar {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    body.ui-modern .topbar-actions {
        justify-content: space-between;
    }

    body.ui-modern .topbar-user {
        max-width: 360px;
    }

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

    body.ui-modern .bookings-searchbar > input[type="search"] {
        grid-column: span 2;
    }

    body.ui-modern .bookings-searchbar .searchbar-actions {
        grid-column: span 2;
    }

    body.ui-modern .auth-feature-grid {
        grid-template-columns: 1fr;
    }

    body.ui-modern .auth-feature-grid > div {
        min-height: auto;
    }
}

/* Off-canvas sidebar */
@media (max-width: 1024px) {
    body.ui-modern .app-shell {
        display: block;
    }

    body.ui-modern .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(88vw, 330px);
        height: 100dvh;
        flex-basis: min(88vw, 330px);
        padding: 12px;
        transform: translateX(-104%);
        box-shadow: 18px 0 50px rgba(15,23,42,.22);
    }

    body.ui-modern.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.ui-modern.has-sidebar .main-content {
        width: 100%;
        max-width: none;
        padding: 14px;
    }

    body.ui-modern .sidebar-toggle-mobile {
        display: inline-flex;
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        border: 1px solid var(--vbs-border);
        border-radius: 11px;
        background: #fff;
        box-shadow: none;
    }

    body.ui-modern .topbar {
        top: 8px;
        min-height: auto;
    }

    body.ui-modern .auth-shell-modern {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    body.ui-modern .auth-hero-modern {
        min-height: auto;
    }
}

/* Tablet and mobile content layout */
@media (max-width: 900px) {
    body.ui-modern.has-sidebar {
        padding-bottom: calc(var(--vbs-mobile-nav-height) + env(safe-area-inset-bottom) + 12px);
    }

    body.ui-modern .topbar-actions {
        display: none;
    }

    body.ui-modern .topbar {
        grid-template-columns: minmax(0, 1fr);
    }

    body.ui-modern .grid-2,
    body.ui-modern .grid-3,
    body.ui-modern .grid-4,
    body.ui-modern .dashboard-hero.card,
    body.ui-modern .dispatch-intro,
    body.ui-modern .driver-hero,
    body.ui-modern .dispatch-card,
    body.ui-modern .mission-detail-grid,
    body.ui-modern .route-detail-grid,
    body.ui-modern .vehicle-admin-grid,
    body.ui-modern .profile-photo-layout {
        grid-template-columns: 1fr !important;
    }

    body.ui-modern .dashboard-hero.card {
        align-items: stretch;
    }

    body.ui-modern .quick-actions {
        width: 100%;
    }

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

    body.ui-modern .request-step {
        min-height: auto;
    }

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

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

    body.ui-modern .results-head {
        align-items: flex-start;
    }

    /* Responsive table cards */
    body.ui-modern .table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    body.ui-modern .table-wrap table,
    body.ui-modern .table-wrap thead,
    body.ui-modern .table-wrap tbody,
    body.ui-modern .table-wrap tr,
    body.ui-modern .table-wrap th,
    body.ui-modern .table-wrap td {
        width: 100%;
        min-width: 0;
    }

    body.ui-modern .table-wrap tbody {
        gap: 12px;
    }

    body.ui-modern .table-wrap tr {
        border: 1px solid var(--vbs-border);
        border-radius: var(--vbs-radius) !important;
        background: #fff;
        box-shadow: var(--vbs-shadow-xs);
    }

    body.ui-modern .table-wrap td {
        display: grid;
        grid-template-columns: minmax(108px, 32%) minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding: 10px 12px;
        border-bottom: 1px solid #e7edf4;
        background: transparent !important;
    }

    body.ui-modern .table-wrap td[data-label]::before {
        display: block;
        margin: 0;
        color: #667085;
        font-size: .76rem;
        font-weight: 600;
        letter-spacing: 0;
        text-transform: none;
    }

    body.ui-modern .table-wrap td:last-child {
        display: block;
        padding-top: 12px;
        border-bottom: 0;
        background: #fafcff !important;
    }

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

    body.ui-modern .table-wrap td:last-child .actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    body.ui-modern .table-wrap td:last-child .actions > *,
    body.ui-modern .table-wrap td:last-child .actions .btn,
    body.ui-modern .table-wrap td:last-child .actions button.btn {
        width: 100%;
    }

    body.ui-modern .mobile-tabbar {
        display: grid;
    }

    body.ui-modern .footer {
        padding-bottom: 8px;
    }
}

/* Phones */
@media (max-width: 640px) {
    body.ui-modern.has-sidebar .main-content,
    body.ui-modern.no-sidebar .main-content {
        padding: 9px;
    }

    body.ui-modern .topbar {
        top: 6px;
        gap: 10px;
        margin-bottom: 12px;
        padding: 11px;
        border-radius: 14px !important;
    }

    body.ui-modern .topbar-left {
        gap: 9px;
        align-items: flex-start;
    }

    body.ui-modern .topbar-university-logo {
        display: none;
    }

    body.ui-modern .topbar-kicker {
        max-width: calc(100vw - 95px);
        font-size: .67rem;
    }

    body.ui-modern .topbar h1 {
        font-size: 1.12rem;
    }

    body.ui-modern .topbar p {
        display: -webkit-box;
        overflow: hidden;
        font-size: .82rem;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    body.ui-modern .card {
        padding: 14px;
    }

    body.ui-modern .dashboard-hero.card {
        min-height: auto;
        padding: 16px;
    }

    body.ui-modern .dashboard-hero h2 {
        font-size: 1.3rem;
    }

    body.ui-modern .dashboard-context {
        gap: 5px;
    }

    body.ui-modern .dashboard-context span {
        font-size: .72rem;
    }

    body.ui-modern .form-grid,
    body.ui-modern .bookings-searchbar {
        grid-template-columns: 1fr;
    }

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

    body.ui-modern .actions,
    body.ui-modern .quick-actions,
    body.ui-modern .searchbar-actions,
    body.ui-modern .map-actions-inline {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    body.ui-modern .actions > *,
    body.ui-modern .actions .btn,
    body.ui-modern .quick-actions .btn,
    body.ui-modern .searchbar-actions .btn,
    body.ui-modern .map-actions-inline .btn {
        width: 100%;
    }

    body.ui-modern .table-wrap td {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    body.ui-modern .table-wrap td[data-label]::before {
        color: #758295;
    }

    body.ui-modern .table-wrap td:last-child .actions {
        grid-template-columns: 1fr;
    }

    body.ui-modern .request-submit-bar {
        bottom: calc(var(--vbs-mobile-nav-height) + 14px);
        padding: 8px;
    }

    body.ui-modern .pagination {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    body.ui-modern .pagination-link,
    body.ui-modern .pagination-ellipsis {
        flex: 0 0 auto;
    }

    body.ui-modern .mobile-tabbar {
        left: 7px;
        right: 7px;
        bottom: calc(7px + env(safe-area-inset-bottom));
        padding: 5px;
    }

    body.ui-modern .mobile-tabbar-link {
        min-width: 0;
        min-height: 50px;
        gap: 1px;
    }

    body.ui-modern .mobile-tabbar-link strong {
        display: block;
        font-size: .64rem;
        white-space: nowrap;
    }

    body.ui-modern .auth-shell-modern {
        gap: 12px;
    }

    body.ui-modern .auth-hero-modern {
        padding: 24px 18px;
        border-radius: 18px !important;
    }

    body.ui-modern .auth-brand-lockup {
        grid-template-columns: 50px minmax(0, 1fr);
        gap: 12px;
    }

    body.ui-modern .auth-brand-logo {
        width: 50px;
        height: 50px;
        border-radius: 14px;
    }

    body.ui-modern .auth-hero-modern h2 {
        font-size: 1.72rem;
    }

    body.ui-modern .auth-feature-grid {
        margin-top: 20px;
    }

    body.ui-modern .auth-form-card-modern {
        padding: 22px 16px;
        border-radius: 18px !important;
    }

    body.ui-modern .auth-google-btn {
        min-height: 58px;
        grid-template-columns: 34px minmax(0, 1fr) 18px;
        padding: 9px 10px;
        font-size: .9rem;
    }

    body.ui-modern .footer {
        display: block;
        text-align: center;
    }

    body.ui-modern .footer-meta {
        margin-top: 5px;
    }
}

@media (max-width: 420px) {
    body.ui-modern .sidebar-toggle-mobile {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    body.ui-modern .topbar h1 {
        font-size: 1.02rem;
    }

    body.ui-modern .topbar p {
        font-size: .78rem;
    }

    body.ui-modern .mobile-tabbar-link strong {
        font-size: .59rem;
    }

    body.ui-modern .mobile-tabbar-icon {
        font-size: 1rem;
    }
}

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

@media print {
    body.ui-modern .sidebar,
    body.ui-modern .topbar,
    body.ui-modern .mobile-tabbar,
    body.ui-modern .footer,
    body.ui-modern .request-submit-bar {
        display: none !important;
    }

    body.ui-modern.has-sidebar .main-content,
    body.ui-modern.no-sidebar .main-content {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
    }

    body.ui-modern .card {
        break-inside: avoid;
        border-color: #cbd5e1 !important;
        box-shadow: none !important;
    }
}


/* Login page refresh 2026-07-09 */
body.ui-modern[data-page="login.php"] {
    background:
        radial-gradient(circle at top left, rgba(21,87,176,.10), transparent 28%),
        radial-gradient(circle at bottom right, rgba(94,234,212,.10), transparent 24%),
        linear-gradient(180deg, #f4f8fc 0%, #eef4fb 100%);
}

body.ui-modern[data-page="login.php"] .main-content {
    max-width: 1380px;
    padding-top: clamp(20px, 2.4vw, 34px);
    padding-bottom: 18px;
}

body.ui-modern[data-page="login.php"] .main-auth {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 100dvh;
}

body.ui-modern[data-page="login.php"] .main-auth .footer {
    margin-top: 16px;
    padding-top: 12px;
    text-align: center;
}

body.ui-modern .auth-shell-login {
    position: relative;
}

body.ui-modern .auth-hero-login {
    overflow: hidden;
}

body.ui-modern .auth-hero-topline {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

body.ui-modern .auth-hero-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 7px 12px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    color: #fff;
    font-size: .8rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

body.ui-modern .auth-hero-badge-soft {
    background: rgba(255,255,255,.06);
    color: #d8ebff;
}

body.ui-modern .auth-mini-stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

body.ui-modern .auth-mini-stat {
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px;
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(8px);
}

body.ui-modern .auth-mini-stat strong,
body.ui-modern .auth-mini-stat span {
    display: block;
}

body.ui-modern .auth-mini-stat strong {
    color: #fff;
    font-size: .98rem;
    font-weight: 700;
}

body.ui-modern .auth-mini-stat span {
    margin-top: 4px;
    color: rgba(255,255,255,.74);
    font-size: .82rem;
    line-height: 1.55;
}

body.ui-modern .auth-trust-strip {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

body.ui-modern .auth-trust-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.88);
    font-size: .84rem;
}

body.ui-modern .auth-trust-icon {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(94,234,212,.18);
    color: #5eead4;
    font-size: .78rem;
    font-weight: 700;
}

body.ui-modern .auth-login-panel {
    border: 1px solid rgba(203,215,229,.78);
    background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(248,251,255,.98) 100%);
}

body.ui-modern .auth-login-intro {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #dce7f2;
    border-radius: 16px;
    background: #f8fbff;
}

body.ui-modern .auth-login-intro-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #1557b0 0%, #2f7ae5 100%);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
}

body.ui-modern .auth-google-btn {
    min-height: 64px;
    padding: 12px 14px;
    border: 1px solid #b8cbe2 !important;
    border-radius: 16px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%) !important;
    box-shadow: 0 10px 26px rgba(21,87,176,.08);
}

body.ui-modern .auth-google-btn > span:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

body.ui-modern .auth-google-btn strong {
    color: #17324d;
    font-size: .97rem;
    font-weight: 700;
    line-height: 1.4;
}

body.ui-modern .auth-google-btn small {
    color: #64748b;
    font-size: .78rem;
    line-height: 1.4;
}

body.ui-modern .auth-google-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(21,87,176,.12);
}

body.ui-modern .google-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
}

body.ui-modern .auth-checklist {
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px solid #dce6f1;
    border-radius: 16px;
    background: #ffffff;
}

body.ui-modern .auth-checklist-title,
body.ui-modern .auth-support-title {
    margin-bottom: 10px;
    color: #17324d;
    font-size: .93rem;
    font-weight: 700;
}

body.ui-modern .auth-checklist ul,
body.ui-modern .auth-support-card ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

body.ui-modern .auth-checklist li,
body.ui-modern .auth-support-card li {
    position: relative;
    padding-left: 22px;
    color: #516173;
    font-size: .86rem;
    line-height: 1.7;
}

body.ui-modern .auth-checklist li + li,
body.ui-modern .auth-support-card li + li {
    margin-top: 6px;
}

body.ui-modern .auth-checklist li::before,
body.ui-modern .auth-support-card li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: #0f9f6e;
    font-weight: 700;
}

body.ui-modern .auth-local-box {
    padding: 16px;
    border: 1px solid #d8e4ef;
    border-radius: 16px;
    background: #fbfdff;
}

body.ui-modern .auth-config-alert-inline {
    margin: 0;
}

body.ui-modern .auth-support-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 18px;
}

body.ui-modern .auth-note-plain {
    margin: 0;
}

body.ui-modern .auth-support-card {
    padding: 16px 18px;
    border: 1px solid #dce6f1;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
}

@media (max-width: 1180px) {
    body.ui-modern .auth-shell-login {
        grid-template-columns: 1fr;
    }

    body.ui-modern .auth-hero-login,
    body.ui-modern .auth-login-panel {
        min-height: auto;
    }
}

@media (max-width: 900px) {
    body.ui-modern[data-page="login.php"] .main-auth {
        min-height: auto;
    }

    body.ui-modern .auth-mini-stats,
    body.ui-modern .auth-feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body.ui-modern[data-page="login.php"] .main-content {
        padding: 10px;
    }

    body.ui-modern .auth-hero-topline {
        margin-bottom: 18px;
    }

    body.ui-modern .auth-hero-badge {
        min-height: 28px;
        padding: 6px 10px;
        font-size: .74rem;
    }

    body.ui-modern .auth-mini-stat,
    body.ui-modern .auth-feature-grid > div,
    body.ui-modern .auth-checklist,
    body.ui-modern .auth-local-box,
    body.ui-modern .auth-support-card,
    body.ui-modern .auth-login-intro {
        border-radius: 14px;
    }

    body.ui-modern .auth-login-intro {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 10px;
        padding: 12px;
    }

    body.ui-modern .auth-login-intro-icon {
        width: 36px;
        height: 36px;
        border-radius: 11px;
        font-size: 1rem;
    }

    body.ui-modern .auth-google-btn {
        min-height: 62px;
        grid-template-columns: 36px minmax(0, 1fr) 18px;
        gap: 10px;
        padding: 10px 12px;
    }

    body.ui-modern .auth-google-btn strong {
        font-size: .92rem;
    }

    body.ui-modern .auth-google-btn small {
        font-size: .75rem;
    }

    body.ui-modern .auth-trust-strip {
        gap: 8px;
    }

    body.ui-modern .auth-trust-item {
        width: 100%;
        justify-content: flex-start;
    }
}


/* Login concise content 2026-07-09 */
body.ui-modern[data-page="login.php"] .auth-shell-login {
    min-height: auto;
    grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr);
    align-items: start;
}

body.ui-modern[data-page="login.php"] .auth-hero-login {
    align-self: start;
    height: auto;
    min-height: 0;
    justify-content: flex-start;
    padding: clamp(22px, 2.5vw, 34px);
}

body.ui-modern[data-page="login.php"] .auth-brand-lockup {
    align-items: center;
}

body.ui-modern[data-page="login.php"] .auth-brand-lockup > div:last-child {
    align-self: center;
}

body.ui-modern[data-page="login.php"] .auth-eyebrow {
    margin-bottom: 0;
    font-size: .88rem;
    font-weight: 600;
}

body.ui-modern[data-page="login.php"] .auth-hero-desc {
    max-width: 720px;
    margin-top: 16px;
    font-size: clamp(.98rem, 1vw, 1.08rem);
    line-height: 1.72;
}

body.ui-modern[data-page="login.php"] .auth-trust-note {
    margin-top: 14px;
}

body.ui-modern[data-page="login.php"] .auth-login-panel {
    align-self: start;
    height: auto;
    min-height: 0;
    justify-content: flex-start;
    padding: clamp(22px, 2.4vw, 32px);
}

body.ui-modern[data-page="login.php"] .auth-form-head-modern {
    margin-bottom: 14px;
}

body.ui-modern[data-page="login.php"] .auth-form-head-modern .section-title {
    margin-bottom: 0;
}

body.ui-modern[data-page="login.php"] .auth-google-btn {
    margin-top: 2px;
}

body.ui-modern[data-page="login.php"] .auth-google-note {
    margin-top: 8px;
}

body.ui-modern[data-page="login.php"] .auth-support-grid {
    margin-top: 14px;
}

body.ui-modern[data-page="login.php"] .auth-support-card {
    padding: 12px 14px;
}

@media (max-width: 1180px) {
    body.ui-modern[data-page="login.php"] .auth-shell-login {
        grid-template-columns: 1fr;
        align-items: start;
    }

    body.ui-modern[data-page="login.php"] .auth-hero-login,
    body.ui-modern[data-page="login.php"] .auth-login-panel {
        width: 100%;
        height: auto;
        min-height: 0;
    }
}

@media (max-width: 900px) {
    body.ui-modern[data-page="login.php"] .auth-hero-login,
    body.ui-modern[data-page="login.php"] .auth-login-panel {
        padding: 22px;
    }
}

@media (max-width: 640px) {
    body.ui-modern[data-page="login.php"] .auth-hero-login,
    body.ui-modern[data-page="login.php"] .auth-login-panel {
        padding: 18px;
    }

    body.ui-modern[data-page="login.php"] .auth-hero-topline {
        margin-bottom: 14px;
    }

    body.ui-modern[data-page="login.php"] .auth-hero-desc {
        margin-top: 14px;
        font-size: .94rem;
        line-height: 1.66;
    }

    body.ui-modern[data-page="login.php"] .auth-trust-note {
        margin-top: 14px;
        align-items: flex-start;
    }
}


/* Login content-height responsive override 2026-07-09 */
body.ui-modern[data-page="login.php"] .auth-shell-login {
    align-items: start !important;
}

body.ui-modern[data-page="login.php"] .auth-hero-login,
body.ui-modern[data-page="login.php"] .auth-login-panel {
    align-self: start !important;
    height: auto !important;
    min-height: 0 !important;
}


/* Responsive tables without horizontal scrollbars 2026-07-09 */
body.ui-modern .table-wrap {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    overflow-x: clip;
    overflow-y: visible;
}

body.ui-modern .table-wrap table {
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    table-layout: auto;
}

body.ui-modern .table-wrap th,
body.ui-modern .table-wrap td {
    min-width: 0 !important;
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

body.ui-modern .table-wrap thead th {
    white-space: normal;
    line-height: 1.45;
}

body.ui-modern .table-wrap td:last-child {
    min-width: 0 !important;
}

body.ui-modern .table-wrap td > *,
body.ui-modern .table-wrap th > *,
body.ui-modern .table-wrap a,
body.ui-modern .table-wrap span,
body.ui-modern .table-wrap strong,
body.ui-modern .table-wrap small,
body.ui-modern .table-wrap form,
body.ui-modern .table-wrap input,
body.ui-modern .table-wrap select,
body.ui-modern .table-wrap textarea {
    max-width: 100%;
}

body.ui-modern .table-wrap .actions {
    min-width: 0;
    flex-wrap: wrap;
    align-items: flex-start;
}

body.ui-modern .table-wrap .actions form {
    min-width: 0;
    max-width: 100%;
}

body.ui-modern .table-wrap .badge,
body.ui-modern .table-wrap .chip,
body.ui-modern .table-wrap .filter-chip {
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.35;
}

body.ui-modern .table-wrap .table-link {
    overflow-wrap: anywhere;
}

/* Tables with many columns become denser before switching to mobile cards. */
@media (min-width: 901px) {
    body.ui-modern .table-wrap table.table-density-medium th,
    body.ui-modern .table-wrap table.table-density-medium td {
        padding: 10px;
    }

    body.ui-modern .table-wrap table.table-density-compact {
        font-size: .88rem;
    }

    body.ui-modern .table-wrap table.table-density-compact th,
    body.ui-modern .table-wrap table.table-density-compact td {
        padding: 9px 8px;
    }

    body.ui-modern .table-wrap table.table-density-compact .btn {
        min-height: 34px;
        padding: 6px 8px;
        font-size: .8rem;
    }
}

@media (min-width: 901px) and (max-width: 1180px) {
    body.ui-modern .table-wrap th,
    body.ui-modern .table-wrap td {
        padding: 9px 8px;
        font-size: .84rem;
    }

    body.ui-modern .table-wrap .btn {
        min-height: 34px;
        padding: 6px 8px;
        font-size: .79rem;
    }
}

@media (max-width: 900px) {
    body.ui-modern .table-wrap {
        overflow: visible;
    }

    body.ui-modern .table-wrap table {
        min-width: 0 !important;
        max-width: 100%;
    }

    body.ui-modern .table-wrap td,
    body.ui-modern .table-wrap td > *,
    body.ui-modern .table-wrap td a,
    body.ui-modern .table-wrap td span,
    body.ui-modern .table-wrap td strong,
    body.ui-modern .table-wrap td small {
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}


/* Google sign-in button isolation 2026-07-09 */
body.ui-modern[data-page="login.php"] a.google-signin-button.auth-google-btn {
    width: 100%;
    min-height: 56px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #dadce0 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    background-image: none !important;
    color: #3c4043 !important;
    -webkit-text-fill-color: #3c4043 !important;
    text-decoration: none;
    text-align: center;
    font-family: 'Sarabun', sans-serif;
    font-size: .98rem;
    font-weight: 600;
    line-height: 1.35;
    box-shadow: 0 1px 2px rgba(60,64,67,.08), 0 1px 3px rgba(60,64,67,.06) !important;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

body.ui-modern[data-page="login.php"] a.google-signin-button.auth-google-btn::after {
    content: '';
    width: 34px;
    height: 1px;
}

body.ui-modern[data-page="login.php"] a.google-signin-button.auth-google-btn .google-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 7px;
    border: 0 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    box-shadow: none !important;
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
}

body.ui-modern[data-page="login.php"] a.google-signin-button.auth-google-btn .google-mark svg {
    display: block;
    width: 20px;
    height: 20px;
}

body.ui-modern[data-page="login.php"] a.google-signin-button.auth-google-btn .google-signin-copy {
    min-width: 0;
    color: #3c4043 !important;
    -webkit-text-fill-color: #3c4043 !important;
    overflow-wrap: anywhere;
}

body.ui-modern[data-page="login.php"] a.google-signin-button.auth-google-btn:hover {
    border-color: #c7cbd1 !important;
    background: #f8faff !important;
    background-image: none !important;
    color: #202124 !important;
    -webkit-text-fill-color: #202124 !important;
    box-shadow: 0 2px 5px rgba(60,64,67,.16), 0 1px 2px rgba(60,64,67,.10) !important;
    transform: translateY(-1px);
}

body.ui-modern[data-page="login.php"] a.google-signin-button.auth-google-btn:hover .google-signin-copy {
    color: #202124 !important;
    -webkit-text-fill-color: #202124 !important;
}

body.ui-modern[data-page="login.php"] a.google-signin-button.auth-google-btn:active {
    background: #f1f3f4 !important;
    transform: translateY(0);
}

body.ui-modern[data-page="login.php"] a.google-signin-button.auth-google-btn:focus-visible {
    outline: 3px solid rgba(26,115,232,.24);
    outline-offset: 3px;
    border-color: #1a73e8 !important;
}

@media (max-width: 640px) {
    body.ui-modern[data-page="login.php"] a.google-signin-button.auth-google-btn {
        min-height: 54px;
        grid-template-columns: 32px minmax(0, 1fr) 32px;
        gap: 8px;
        padding: 9px 10px;
        font-size: .92rem;
    }

    body.ui-modern[data-page="login.php"] a.google-signin-button.auth-google-btn::after {
        width: 32px;
    }

    body.ui-modern[data-page="login.php"] a.google-signin-button.auth-google-btn .google-mark {
        width: 32px;
        height: 32px;
        padding: 6px;
    }
}

/* =========================================================
   2026-07-09 Full Code Audit Stability & Responsive Pass
   Final overrides after the visual refresh layer.
   ========================================================= */

/* Keep content cards aligned to the same rail and equal within each row. */
body.ui-modern .dashboard-stats,
body.ui-modern .monthly-snapshot,
body.ui-modern .dashboard-admin-panels,
body.ui-modern .dashboard-main-grid {
    width: 100%;
    min-width: 0;
    grid-auto-rows: 1fr;
}

body.ui-modern .dashboard-stats > .card,
body.ui-modern .monthly-snapshot > .card,
body.ui-modern .dashboard-admin-panels > .card,
body.ui-modern .dashboard-main-grid > .card {
    width: 100%;
    min-width: 0;
    height: 100%;
}

/* Operational forms: clearer hierarchy, validation and spacing. */
body.ui-modern .operations-grid {
    align-items: start;
}

body.ui-modern .operation-form-card,
body.ui-modern .operation-side-card {
    min-width: 0;
}

body.ui-modern .operation-metrics {
    margin-top: 6px;
}

body.ui-modern .section-gap {
    margin-top: 18px;
}

body.ui-modern .form-actions-end {
    justify-content: flex-end;
    margin-top: 18px;
}

body.ui-modern .form-error-list {
    margin: 8px 0 0;
    padding-left: 1.25rem;
}

body.ui-modern .form-error-list li + li {
    margin-top: 4px;
}

body.ui-modern .required-mark {
    color: var(--vbs-danger, #c62828);
    font-weight: 800;
}

body.ui-modern .count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 10px;
    border: 1px solid #cbdcf0;
    border-radius: 999px;
    background: #f4f8fd;
    color: #24558d;
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Never hide table content merely to remove a scrollbar. */
body.ui-modern .table-wrap {
    overflow-x: visible !important;
    overflow-y: visible;
}

body.ui-modern .table-wrap table {
    min-width: 0 !important;
}

/* Very wide tables switch to the proven card pattern earlier on notebooks/tablets. */
@media (max-width: 1180px) {
    body.ui-modern .table-wrap table.table-card-early,
    body.ui-modern .table-wrap table.table-card-early thead,
    body.ui-modern .table-wrap table.table-card-early tbody,
    body.ui-modern .table-wrap table.table-card-early tr,
    body.ui-modern .table-wrap table.table-card-early th,
    body.ui-modern .table-wrap table.table-card-early td {
        display: block;
        width: 100%;
    }

    body.ui-modern .table-wrap table.table-card-early {
        border: 0;
        background: transparent;
    }

    body.ui-modern .table-wrap table.table-card-early thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    body.ui-modern .table-wrap table.table-card-early tbody {
        display: grid;
        gap: 12px;
    }

    body.ui-modern .table-wrap table.table-card-early tr {
        overflow: hidden;
        border: 1px solid #dbe5f0;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 5px 18px rgba(15, 23, 42, .045);
    }

    body.ui-modern .table-wrap table.table-card-early td {
        display: grid;
        grid-template-columns: minmax(118px, .75fr) minmax(0, 1.25fr);
        align-items: start;
        gap: 12px;
        padding: 10px 14px;
        border: 0;
        border-bottom: 1px solid #edf1f6;
        text-align: left;
    }

    body.ui-modern .table-wrap table.table-card-early td:last-child {
        border-bottom: 0;
    }

    body.ui-modern .table-wrap table.table-card-early td[data-label]::before {
        content: attr(data-label);
        color: #617083;
        font-size: .78rem;
        font-weight: 700;
        line-height: 1.45;
    }

    body.ui-modern .table-wrap table.table-card-early td:last-child .actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    body.ui-modern .table-wrap table.table-card-early td:last-child .actions > *,
    body.ui-modern .table-wrap table.table-card-early td:last-child .actions .btn,
    body.ui-modern .table-wrap table.table-card-early td:last-child .actions button.btn {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    body.ui-modern .operations-grid {
        gap: 14px;
    }

    body.ui-modern .section-gap {
        margin-top: 14px;
    }

    body.ui-modern .form-actions-end .btn {
        width: 100%;
    }

    body.ui-modern .table-wrap table.table-card-early td {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 10px 12px;
    }

    body.ui-modern .table-wrap table.table-card-early td:last-child .actions {
        grid-template-columns: 1fr;
    }
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }

    body.ui-modern *,
    body.ui-modern *::before,
    body.ui-modern *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* =========================================================
   2026-07-09 Sidebar without visible scrollbars
   ซ่อนแถบเลื่อน แต่ยังคงเลื่อนด้วย wheel / touchpad / touch ได้
   ========================================================= */
body.ui-modern .sidebar {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* Legacy Edge / IE */
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

body.ui-modern .sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}


/* ===== Place search + route waypoints (2026-07-09) ===== */
body.ui-modern .map-actions-inline .btn.is-active {
    border-color: var(--vbs-primary);
    background: var(--vbs-primary-soft);
    color: var(--vbs-primary);
    box-shadow: 0 0 0 3px rgba(32, 94, 153, .10);
}

body.ui-modern .map-place-picker {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #cbdced;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

body.ui-modern .map-place-picker[hidden] {
    display: none !important;
}

body.ui-modern .map-place-picker-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

body.ui-modern .map-place-step,
body.ui-modern .map-route-badge {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--vbs-primary);
    color: #fff;
    font-weight: 800;
    line-height: 1;
}

body.ui-modern .map-place-autocomplete-host {
    position: relative;
    width: 100%;
    min-height: 52px;
}

body.ui-modern .map-place-autocomplete,
body.ui-modern gmp-place-autocomplete,
body.ui-modern .map-place-search-fallback {
    display: block;
    width: 100%;
    max-width: none;
    min-height: 52px;
}

body.ui-modern .map-place-search-fallback {
    padding: 12px 14px;
    border: 1px solid #b9cde2;
    border-radius: 12px;
    background: #fff;
    font: inherit;
}

body.ui-modern .map-place-picker-tip {
    margin-top: 8px;
}

body.ui-modern .map-route-points {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

body.ui-modern .map-route-point {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--vbs-border);
    border-radius: 14px;
    background: #fff;
}

body.ui-modern .map-route-point > div,
body.ui-modern .map-route-point-detail {
    min-width: 0;
}

body.ui-modern .map-route-point small,
body.ui-modern .map-route-point strong {
    display: block;
}

body.ui-modern .map-route-point strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.ui-modern .map-route-point-waypoint .map-route-badge {
    background: #d79a12;
}

body.ui-modern .map-route-point-end .map-route-badge {
    background: #c94848;
}

body.ui-modern .map-waypoint-list {
    display: grid;
    gap: 8px;
}

body.ui-modern .map-waypoint-empty {
    padding: 8px 12px 8px 54px;
    color: var(--vbs-muted);
    font-size: .9rem;
}

body.ui-modern .map-waypoint-remove {
    min-height: 34px;
    padding: 6px 10px;
}

body.ui-modern .map-waypoint-upgrade-alert {
    margin-top: 14px;
}

body.ui-modern .route-waypoint-detail-list {
    margin: 0;
    padding-left: 1.25rem;
}

.pac-container {
    z-index: 10050 !important;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
}

@media (max-width: 720px) {
    body.ui-modern .map-place-picker {
        padding: 12px;
    }

    body.ui-modern .map-route-point {
        grid-template-columns: 32px minmax(0, 1fr);
    }

    body.ui-modern .map-route-point .map-waypoint-remove {
        grid-column: 2;
        justify-self: start;
    }

    body.ui-modern .map-route-point strong {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}


/* ===== Direct point selection inside map (2026-07-09 v5) ===== */
body.ui-modern .map-direct-control {
    margin-top: 10px;
    max-width: min(760px, calc(100vw - 28px));
    font-family: inherit;
    pointer-events: auto;
}

body.ui-modern .map-direct-control-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(148, 163, 184, .55);
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
    backdrop-filter: blur(10px);
}

body.ui-modern .map-direct-mode-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: #334155;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

body.ui-modern .map-direct-mode-button:hover {
    background: #f1f5f9;
}

body.ui-modern .map-direct-mode-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .24);
    outline-offset: 2px;
}

body.ui-modern .map-direct-mode-button.is-active {
    border-color: #8eb7e3;
    background: #eaf4ff;
    color: #174f86;
    box-shadow: inset 0 0 0 1px rgba(32, 94, 153, .08);
}

body.ui-modern .map-direct-mode-badge {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #205e99;
    color: #fff;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1;
}

body.ui-modern [data-map-direct-mode="waypoint"] .map-direct-mode-badge {
    background: #d79a12;
}

body.ui-modern [data-map-direct-mode="destination"] .map-direct-mode-badge {
    background: #c94848;
}

body.ui-modern .map-direct-status {
    width: fit-content;
    max-width: calc(100% - 20px);
    margin: 6px auto 0;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .88);
    color: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .18);
    font-size: .78rem;
    font-weight: 600;
    text-align: center;
}

body.ui-modern .map-canvas {
    cursor: crosshair;
}

@media (max-width: 720px) {
    body.ui-modern .map-direct-control {
        margin-top: 6px;
        max-width: calc(100vw - 18px);
    }

    body.ui-modern .map-direct-control-buttons {
        gap: 3px;
        padding: 4px;
        border-radius: 13px;
    }

    body.ui-modern .map-direct-mode-button {
        min-height: 40px;
        gap: 4px;
        padding: 5px 7px;
        font-size: .78rem;
    }

    body.ui-modern .map-direct-mode-badge {
        width: 23px;
        height: 23px;
        font-size: .72rem;
    }

    body.ui-modern .map-direct-status {
        font-size: .72rem;
        white-space: normal;
    }
}

@media (max-width: 430px) {
    body.ui-modern .map-direct-mode-button span:last-child {
        display: none;
    }

    body.ui-modern .map-direct-mode-button {
        min-width: 48px;
        padding-inline: 9px;
    }
}

/* =========================================================
   2026-07-09 Map search + marker reliability fix (v7)
   ========================================================= */

/* Global responsive image rules can distort or hide Google Maps internals. */
body.ui-modern #booking-map-canvas .gm-style img {
    max-width: none !important;
}

body.ui-modern .map-place-search-shell {
    position: relative;
    width: 100%;
}

body.ui-modern .map-place-search-input {
    width: 100%;
    min-height: 52px;
    padding: 12px 46px 12px 14px;
    border: 1px solid #b9cde2;
    border-radius: 12px;
    background: #fff;
    color: var(--vbs-text);
    font: inherit;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

body.ui-modern .map-place-search-input:focus {
    border-color: var(--vbs-primary);
    box-shadow: 0 0 0 4px rgba(32, 94, 153, .12);
}

body.ui-modern .map-place-search-status {
    min-height: 22px;
    margin-top: 7px;
    color: var(--vbs-muted);
    font-size: .84rem;
}

body.ui-modern .map-place-search-status[data-state="loading"] {
    color: var(--vbs-primary);
}

body.ui-modern .map-place-search-status[data-state="error"],
body.ui-modern .map-place-search-status[data-state="empty"] {
    color: #b42318;
}

body.ui-modern .map-place-search-results {
    position: relative;
    z-index: 30;
    display: grid;
    max-height: 320px;
    margin-top: 6px;
    overflow-y: auto;
    border: 1px solid #cbdced;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .14);
}

body.ui-modern .map-place-search-results[hidden] {
    display: none !important;
}

body.ui-modern .map-place-result-button {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 58px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #e8eef5;
    background: #fff;
    color: var(--vbs-text);
    text-align: left;
    cursor: pointer;
}

body.ui-modern .map-place-result-button:last-child {
    border-bottom: 0;
}

body.ui-modern .map-place-result-button:hover,
body.ui-modern .map-place-result-button:focus-visible,
body.ui-modern .map-place-result-button.is-active {
    background: #edf5ff;
    outline: none;
}

body.ui-modern .map-place-result-icon {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--vbs-primary-soft);
    color: var(--vbs-primary);
    font-size: 1.1rem;
    font-weight: 800;
}

body.ui-modern .map-place-result-detail {
    min-width: 0;
}

body.ui-modern .map-place-result-detail strong,
body.ui-modern .map-place-result-detail small {
    display: block;
}

body.ui-modern .map-place-result-detail strong {
    overflow: hidden;
    color: var(--vbs-text);
    font-size: .95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.ui-modern .map-place-result-detail small {
    margin-top: 2px;
    overflow: hidden;
    color: var(--vbs-muted);
    font-size: .8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 720px) {
    body.ui-modern .map-place-search-results {
        max-height: 260px;
    }

    body.ui-modern .map-place-result-detail strong,
    body.ui-modern .map-place-result-detail small {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}
