/* ==========================================================================
   SE Rides web panel theme
   --------------------------------------------------------------------------
   The colours, type and shapes of the mobile app (CabShuttle/theme/*.js),
   for the web: brand orange #FF6B00 with soft tints, light-grey page, white
   rounded cards, Inter, Material Symbols. Every colour is a variable below,
   with a dark set, so pages never hard-code a colour.

   Built on Bootstrap 5.3: its variables are pointed at these tokens, so
   .btn-primary, .text-primary, .bg-primary-subtle, focus rings etc. all come
   out in the brand colour, and data-bs-theme="dark" switches the whole lot.
   ========================================================================== */

:root,
[data-bs-theme="light"] {
    /* Brand */
    --se-primary: #FF6B00;
    --se-primary-rgb: 255, 107, 0;
    --se-primary-dark: #E05E00;
    --se-primary-tint: #FFF3E0;

    /* Surfaces */
    --se-bg: #F5F5F5;
    --se-surface: #FFFFFF;
    --se-surface-alt: #F0F0F0;
    --se-border: #DDDDDD;
    --se-border-light: #EEEEEE;

    /* Text */
    --se-text: #333333;
    --se-text-secondary: #666666;
    --se-text-muted: #999999;

    /* Status */
    --se-success: #4CAF50;  --se-success-dark: #2E7D32;  --se-success-tint: #E8F5E9;
    --se-danger:  #F44336;  --se-danger-dark:  #C62828;  --se-danger-tint:  #FFEBEE;
    --se-warning: #FF9800;  --se-warning-dark: #E65100;  --se-warning-tint: #FFE0B2;
    --se-info:    #2196F3;  --se-info-dark:    #1565C0;  --se-info-tint:    #E3F2FD;

    --se-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .05);
    --se-shadow-lg: 0 8px 28px rgba(0, 0, 0, .12);
    --se-overlay: rgba(0, 0, 0, .45);
}

[data-bs-theme="dark"] {
    --se-primary: #FF7A1A;
    --se-primary-rgb: 255, 122, 26;
    --se-primary-dark: #FF8F3F;
    --se-primary-tint: rgba(255, 122, 26, .16);

    --se-bg: #121212;
    --se-surface: #1C1C1E;
    --se-surface-alt: #26262A;
    --se-border: #3A3A3E;
    --se-border-light: #2C2C30;

    --se-text: #ECECEC;
    --se-text-secondary: #B5B5B5;
    --se-text-muted: #8A8A8A;

    --se-success: #66BB6A;  --se-success-dark: #81C784;  --se-success-tint: rgba(102, 187, 106, .16);
    --se-danger:  #EF5350;  --se-danger-dark:  #E57373;  --se-danger-tint:  rgba(239, 83, 80, .16);
    --se-warning: #FFA726;  --se-warning-dark: #FFB74D;  --se-warning-tint: rgba(255, 167, 38, .16);
    --se-info:    #42A5F5;  --se-info-dark:    #64B5F6;  --se-info-tint:    rgba(66, 165, 245, .16);

    --se-shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --se-shadow-lg: 0 8px 28px rgba(0, 0, 0, .6);
    --se-overlay: rgba(0, 0, 0, .6);
}

/* ---- Bootstrap, pointed at the tokens ------------------------------------ */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
    --bs-primary: var(--se-primary);
    --bs-primary-rgb: var(--se-primary-rgb);
    --bs-primary-text-emphasis: var(--se-primary-dark);
    --bs-primary-bg-subtle: var(--se-primary-tint);
    --bs-primary-border-subtle: var(--se-primary);
    --bs-body-bg: var(--se-bg);
    --bs-body-color: var(--se-text);
    --bs-secondary-color: var(--se-text-secondary);
    --bs-tertiary-color: var(--se-text-muted);
    --bs-secondary-bg: var(--se-surface-alt);
    --bs-tertiary-bg: var(--se-surface-alt);
    --bs-border-color: var(--se-border);
    --bs-border-color-translucent: var(--se-border-light);
    --bs-link-color: var(--se-primary);
    --bs-link-color-rgb: var(--se-primary-rgb);
    --bs-link-hover-color: var(--se-primary-dark);
    --bs-emphasis-color: var(--se-text);
    --bs-heading-color: var(--se-text);
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-size: .9375rem;
    --bs-border-radius: 8px;
    --bs-border-radius-lg: 12px;
    --bs-border-radius-sm: 6px;
    --bs-focus-ring-color: rgba(var(--se-primary-rgb), .25);
    /* Solid status fills (badges, bg-*): the app's darker shades, so white
       text on them stays readable */
    --bs-success-rgb: 46, 125, 50;
    --bs-danger-rgb: 198, 40, 40;
    --bs-info-rgb: 21, 101, 192;
    --bs-warning-rgb: 255, 152, 0;
    --bs-success: var(--se-success);
    --bs-danger: var(--se-danger);
    --bs-warning: var(--se-warning);
    --bs-info: var(--se-info);
}

html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--se-bg);
    color: var(--se-text);
    font-family: var(--bs-body-font-family);
    font-size: var(--bs-body-font-size);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.01em; }
.text-muted { color: var(--se-text-muted) !important; }
.text-primary-emphasis { color: var(--se-text) !important; }

/* Material Symbols (the app's icon family): <span class="ms">local_taxi</span> */
.ms {
    font-family: "Material Symbols Rounded";
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}
.ms-fill { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }

/* ---- Buttons --------------------------------------------------------------- */
.btn { font-weight: 600; border-radius: 8px; }
.btn-primary {
    --bs-btn-bg: var(--se-primary);
    --bs-btn-border-color: var(--se-primary);
    --bs-btn-hover-bg: var(--se-primary-dark);
    --bs-btn-hover-border-color: var(--se-primary-dark);
    --bs-btn-active-bg: var(--se-primary-dark);
    --bs-btn-active-border-color: var(--se-primary-dark);
    --bs-btn-disabled-bg: var(--se-primary);
    --bs-btn-disabled-border-color: var(--se-primary);
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
}
.btn-outline-primary {
    --bs-btn-color: var(--se-primary);
    --bs-btn-border-color: var(--se-primary);
    --bs-btn-hover-bg: var(--se-primary);
    --bs-btn-hover-border-color: var(--se-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--se-primary-dark);
    --bs-btn-active-border-color: var(--se-primary-dark);
}
.btn-light { --bs-btn-bg: var(--se-surface-alt); --bs-btn-border-color: var(--se-border-light); --bs-btn-color: var(--se-text); --bs-btn-hover-bg: var(--se-border-light); }

/* ---- Cards ----------------------------------------------------------------- */
.card {
    --bs-card-bg: var(--se-surface);
    --bs-card-border-color: var(--se-border-light);
    --bs-card-border-radius: 12px;
    --bs-card-inner-border-radius: 11px;
    --bs-card-cap-bg: transparent;
    --bs-card-color: var(--se-text);
    box-shadow: var(--se-shadow);
    margin-bottom: 1.25rem;
}
.card-header { padding: .875rem 1.25rem; border-bottom: 1px solid var(--se-border-light); }
.card-header h5, .card-header .card-title { font-size: 1rem; font-weight: 700; margin: 0; }
.card-body { padding: 1.25rem; }

/* Stat tiles (dashboard and pages) */
.se-stat {
    display: flex; align-items: center; gap: .875rem;
    background: var(--se-surface); border: 1px solid var(--se-border-light); border-radius: 12px;
    padding: 1rem 1.125rem; box-shadow: var(--se-shadow); height: 100%;
    color: inherit; text-decoration: none;
}
.se-stat[role="button"] { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.se-stat[role="button"]:hover { transform: translateY(-2px); box-shadow: var(--se-shadow-lg); }
.se-stat-icon {
    flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--se-primary-tint); color: var(--se-primary);
}
.se-stat-icon .ms { font-size: 24px; }
.se-stat-label { font-size: .8125rem; color: var(--se-text-secondary); margin: 0 0 .125rem; line-height: 1.25; }
.se-stat-value { font-size: 1.375rem; font-weight: 700; margin: 0; line-height: 1.2; color: var(--se-text); }
.se-tone-success .se-stat-icon { background: var(--se-success-tint); color: var(--se-success-dark); }
.se-tone-danger  .se-stat-icon { background: var(--se-danger-tint);  color: var(--se-danger-dark); }
.se-tone-warning .se-stat-icon { background: var(--se-warning-tint); color: var(--se-warning-dark); }
.se-tone-info    .se-stat-icon { background: var(--se-info-tint);    color: var(--se-info-dark); }
.se-tone-muted   .se-stat-icon { background: var(--se-surface-alt);  color: var(--se-text-secondary); }

/* ---- Tables ---------------------------------------------------------------- */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--se-text);
    --bs-table-border-color: var(--se-border-light);
    --bs-table-striped-bg: rgba(var(--se-primary-rgb), .025);
    --bs-table-hover-bg: rgba(var(--se-primary-rgb), .05);
    --bs-table-striped-color: var(--se-text);
    --bs-table-hover-color: var(--se-text);
    vertical-align: middle;
}
.table > thead th {
    background: var(--se-surface-alt);
    color: var(--se-text-secondary);
    font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--se-border);
    white-space: nowrap;
}
.table > :not(caption) > * > * { padding: .7rem .8rem; }
.table-responsive { border-radius: 10px; }

/* DataTables controls */
.dataTables_wrapper { color: var(--se-text-secondary); font-size: .875rem; }
body .dataTables_wrapper .dataTables_filter input,
body .dataTables_wrapper .dataTables_length select {
    background: var(--se-surface); color: var(--se-text);
    border: 1px solid var(--se-border); border-radius: 8px; padding: .3rem .6rem; margin-left: .4rem;
}
body .dataTables_wrapper .dataTables_filter input:focus { outline: none; border-color: var(--se-primary); box-shadow: 0 0 0 3px rgba(var(--se-primary-rgb), .2); }
body .dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid transparent !important; border-radius: 8px !important;
    color: var(--se-text-secondary) !important; background: transparent !important; margin: 0 2px;
}
body .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--se-primary) !important; border-color: var(--se-primary) !important; color: #fff !important;
}
body .dataTables_wrapper .dataTables_paginate .paginate_button:not(.current):hover { background: var(--se-primary-tint) !important; color: var(--se-primary) !important; }
table.dataTable thead th, table.dataTable thead td { border-bottom: 1px solid var(--se-border) !important; }
table.dataTable.no-footer { border-bottom: 1px solid var(--se-border-light) !important; }
table.dataTable tbody tr { background: transparent !important; }

/* DataTables shades rows and the sorted column itself (inset box-shadow);
   hand that back to Bootstrap's striped / hover colours above. */
body table.dataTable > tbody > tr > *,
body table.dataTable.display > tbody > tr > .sorting_1,
body table.dataTable.display > tbody > tr.odd > *,
body table.dataTable.stripe > tbody > tr.odd > *,
body table.dataTable.display > tbody > tr.odd > .sorting_1,
body table.dataTable.display > tbody > tr.even > .sorting_1,
body table.dataTable.order-column > tbody > tr > .sorting_1,
body table.dataTable.display > tbody > tr:hover > *,
body table.dataTable.hover > tbody > tr:hover > * {
    box-shadow: inset 0 0 0 9999px var(--bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-accent-bg)));
}
body .dataTables_wrapper .dataTables_paginate .paginate_button.disabled { color: var(--se-text-muted) !important; opacity: .6; }

/* ---- Forms ----------------------------------------------------------------- */
.form-control, .form-select {
    background-color: var(--se-surface); color: var(--se-text);
    border-color: var(--se-border); border-radius: 8px;
}
.form-control:focus, .form-select:focus { border-color: var(--se-primary); box-shadow: 0 0 0 3px rgba(var(--se-primary-rgb), .2); }
.form-control::placeholder { color: var(--se-text-muted); }
.form-label { font-weight: 500; font-size: .875rem; color: var(--se-text-secondary); }
.form-check-input:checked { background-color: var(--se-primary); border-color: var(--se-primary); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(var(--se-primary-rgb), .2); border-color: var(--se-primary); }

/* ---- Nav pills (the app's TabPills) ---------------------------------------- */
.nav-pills { gap: .375rem; }
.nav-pills .nav-link {
    border-radius: 999px; padding: .4rem .95rem; font-weight: 500; font-size: .875rem;
    color: var(--se-text-secondary); background: var(--se-surface); border: 1px solid var(--se-border);
}
.nav-pills .nav-link:hover { color: var(--se-primary); border-color: var(--se-primary); }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background: var(--se-primary); border-color: var(--se-primary); color: #fff; }

/* ---- Badges, alerts, dropdowns, modals ------------------------------------- */
.badge { font-weight: 600; border-radius: 999px; padding: .35em .7em; }
.alert { border-radius: 10px; }
.dropdown-menu {
    --bs-dropdown-bg: var(--se-surface);
    --bs-dropdown-color: var(--se-text);
    --bs-dropdown-border-color: var(--se-border-light);
    --bs-dropdown-link-color: var(--se-text);
    --bs-dropdown-link-hover-bg: var(--se-primary-tint);
    --bs-dropdown-link-hover-color: var(--se-primary);
    --bs-dropdown-link-active-bg: var(--se-primary);
    border-radius: 10px; box-shadow: var(--se-shadow-lg); padding: .375rem;
}
.dropdown-item { border-radius: 6px; padding: .45rem .75rem; }
.modal {
    --bs-modal-bg: var(--se-surface);
    --bs-modal-color: var(--se-text);
    --bs-modal-border-color: var(--se-border-light);
    --bs-modal-border-radius: 14px;
    --bs-modal-header-border-color: var(--se-border-light);
    --bs-modal-footer-border-color: var(--se-border-light);
}
.modal-content { box-shadow: var(--se-shadow-lg); }
.modal-title { font-weight: 700; font-size: 1.0625rem; }
.modal-backdrop { --bs-backdrop-bg: #000; }

/* SweetAlert2 in the brand */
.swal2-popup { border-radius: 14px !important; font-family: var(--bs-body-font-family) !important; background: var(--se-surface) !important; color: var(--se-text) !important; }
.swal2-title, .swal2-html-container { color: var(--se-text) !important; }
.swal2-styled.swal2-confirm { background: var(--se-primary) !important; border-radius: 8px !important; }
.swal2-styled.swal2-confirm:focus { box-shadow: 0 0 0 3px rgba(var(--se-primary-rgb), .3) !important; }
.swal2-styled.swal2-cancel { border-radius: 8px !important; }

/* ==========================================================================
   App shell: sidebar + top bar + content
   ========================================================================== */
.se-shell { min-height: 100vh; }

.se-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 1040;
    width: 260px; display: flex; flex-direction: column;
    background: var(--se-surface); border-right: 1px solid var(--se-border-light);
    transition: transform .22s ease;
}
.se-brand {
    display: flex; align-items: center; gap: .625rem;
    height: 64px; padding: 0 1.125rem; flex: 0 0 auto;
    border-bottom: 1px solid var(--se-border-light);
    color: var(--se-text); text-decoration: none;
}
.se-brand img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; background: #fff; }
.se-brand-name { font-size: 1.125rem; font-weight: 800; letter-spacing: -.02em; }
.se-brand-name b { color: var(--se-primary); }
.se-brand:hover { color: var(--se-text); }

.se-nav { flex: 1 1 auto; overflow-y: auto; padding: .75rem .625rem 1rem; }
.se-nav-section { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--se-text-muted); padding: .875rem .75rem .375rem; }
.se-nav a, .se-nav button.se-nav-link {
    display: flex; align-items: center; gap: .75rem; width: 100%;
    padding: .55rem .75rem; margin-bottom: 2px; border-radius: 10px; border: 0; background: none;
    color: var(--se-text-secondary); font-weight: 500; font-size: .9rem; text-decoration: none; text-align: left;
}
.se-nav a .ms, .se-nav button.se-nav-link .ms { font-size: 21px; color: var(--se-text-muted); }
.se-nav a:hover, .se-nav button.se-nav-link:hover { background: var(--se-surface-alt); color: var(--se-text); }
.se-nav a.active { background: var(--se-primary-tint); color: var(--se-primary); font-weight: 600; }
.se-nav a.active .ms { color: var(--se-primary); font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
.se-nav .se-sub { padding-left: 2.1rem; }
.se-nav .se-sub a { font-size: .85rem; padding: .45rem .75rem; }
.se-nav .se-caret { margin-left: auto; transition: transform .2s ease; }
.se-nav button[aria-expanded="true"] .se-caret { transform: rotate(180deg); }

.se-sidebar-foot { padding: .75rem 1rem; border-top: 1px solid var(--se-border-light); font-size: .75rem; color: var(--se-text-muted); }

.se-main { margin-left: 260px; min-height: 100vh; display: flex; flex-direction: column; }

.se-topbar {
    position: sticky; top: 0; z-index: 1030;
    height: 64px; display: flex; align-items: center; gap: .75rem;
    padding: 0 1.5rem;
    background: color-mix(in srgb, var(--se-surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(10px); backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--se-border-light);
}
.se-page-title { font-size: 1.125rem; font-weight: 700; margin: 0; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.se-icon-btn {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px; border: 1px solid var(--se-border-light);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--se-surface); color: var(--se-text-secondary); cursor: pointer;
}
.se-icon-btn:hover { color: var(--se-primary); border-color: var(--se-primary); }
.se-menu-btn { display: none; }

.se-user { display: flex; align-items: center; gap: .625rem; padding: .25rem .5rem .25rem .25rem; border-radius: 999px; border: 1px solid var(--se-border-light); background: var(--se-surface); color: var(--se-text); text-decoration: none; }
.se-user:hover { border-color: var(--se-primary); color: var(--se-text); }
.se-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--se-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .875rem; flex: 0 0 32px; }
.se-user-name { font-weight: 600; font-size: .875rem; line-height: 1.1; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.se-user-role { font-size: .72rem; color: var(--se-text-muted); line-height: 1.1; }

.se-content { flex: 1 1 auto; padding: 1.5rem; width: 100%; max-width: 1440px; margin: 0 auto; }
#DisplayDiv { margin: 0; }
/* A page's own column sits flush with the panel (the panel already pads). */
#DisplayDiv > .col-12 { padding-left: 0; padding-right: 0; }
#DisplayDiv > .container,
#DisplayDiv .container.mt-2 { max-width: none; padding-left: 0; padding-right: 0; margin-top: 0 !important; }

/* Loading: a thin orange bar under the top bar while a page loads */
.se-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000; background: var(--se-primary); box-shadow: 0 0 8px rgba(var(--se-primary-rgb), .6); transition: width .3s ease, opacity .3s ease; opacity: 0; }
.se-progress.on { opacity: 1; width: 70%; transition: width 2s cubic-bezier(.1, .6, .2, 1); }
.se-progress.done { opacity: 0; width: 100%; transition: width .2s ease, opacity .4s ease .2s; }

.se-backdrop { position: fixed; inset: 0; z-index: 1035; background: var(--se-overlay); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease; }

/* Phones and small tablets: the sidebar slides in over the page */
@media (max-width: 991.98px) {
    .se-sidebar { transform: translateX(-100%); width: min(290px, 85vw); }
    .se-shell.menu-open .se-sidebar { transform: none; box-shadow: var(--se-shadow-lg); }
    .se-shell.menu-open .se-backdrop { opacity: 1; visibility: visible; }
    .se-main { margin-left: 0; }
    .se-menu-btn { display: inline-flex; }
    .se-topbar { padding: 0 1rem; }
    .se-content { padding: 1rem; }
}
@media (max-width: 575.98px) {
    .se-user-text { display: none; }
    .se-user { padding: .25rem; }
    .card-body { padding: 1rem; }
    .card-header { padding: .75rem 1rem; }
    /* Two tiles a row on phones, as in the app: icon above the figures */
    .se-stat { padding: .875rem; flex-direction: column; align-items: flex-start; gap: .5rem; }
    .se-stat-icon { flex-basis: 38px; width: 38px; height: 38px; border-radius: 10px; }
    .se-stat-icon .ms { font-size: 21px; }
    .se-stat-value { font-size: 1.2rem; }
}

/* ==========================================================================
   Pages
   ========================================================================== */

/* Bootstrap's fixed light utilities, made to follow the theme */
.text-dark { color: var(--se-text) !important; }
.bg-white { background-color: var(--se-surface) !important; }
.bg-light { background-color: var(--se-surface-alt) !important; }

/* Icons inside buttons and menu items */
.btn .ms, .dropdown-item .ms { font-size: 18px; margin-top: -2px; }
.dropdown-item .ms { color: var(--se-text-muted); }
.dropdown-item:hover .ms, .dropdown-item:focus .ms { color: inherit; }
.btn-sm .ms { font-size: 16px; }

/* A page's list card: title + actions in the header, wrapping on phones */
.card-header.d-flex { flex-wrap: wrap; gap: .5rem .75rem; }
.se-head-sub { font-size: .8125rem; color: var(--se-text-muted); font-weight: 400; }

/* Stat tiles that switch the list below them (Active / De-Active, Booked /
   Allocated / ...). The page's own click handler loads the list; the shell
   marks the clicked tile .is-active. */
.se-stat-tab { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background-color .12s ease; position: relative; }
.se-stat-tab:hover { transform: translateY(-2px); box-shadow: var(--se-shadow-lg); }
.se-stat-tab:focus-visible { outline: 3px solid rgba(var(--se-primary-rgb), .35); outline-offset: 2px; }
.se-stat-tab.is-active { border-color: var(--se-primary); background: var(--se-primary-tint); box-shadow: inset 4px 0 0 var(--se-primary), var(--se-shadow); }
.se-stat-tab.is-active .se-stat-label { color: var(--se-primary-dark); font-weight: 600; }

/* ---- Filter bar and daily capacity strip (Bookings) ------------------------------ */
.se-filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.se-filters > div { min-width: 160px; flex: 0 1 auto; }
.se-filters label { font-size: .75rem; font-weight: 600; color: var(--se-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .25rem; display: block; }
.se-filters .form-select, .se-filters .form-control { min-height: 38px; }
.se-cap { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: thin; }
.se-cap-day {
    flex: 0 0 auto; min-width: 84px; padding: .5rem .65rem; border-radius: 10px; cursor: pointer; text-align: left;
    background: var(--se-surface); border: 1px solid var(--se-border-light); color: var(--se-text);
}
.se-cap-day:hover { border-color: var(--se-primary); }
.se-cap-day .d { font-size: .72rem; color: var(--se-text-muted); font-weight: 600; text-transform: uppercase; }
.se-cap-day .n { font-weight: 700; font-size: .95rem; }
.se-cap-day .bar { height: 4px; border-radius: 4px; background: var(--se-surface-alt); margin-top: .35rem; overflow: hidden; }
.se-cap-day .bar > i { display: block; height: 100%; background: var(--se-success); }
.se-cap-day.is-busy .bar > i { background: var(--se-warning); }
.se-cap-day.is-over { border-color: var(--se-danger); background: var(--se-danger-tint); }
.se-cap-day.is-over .n { color: var(--se-danger-dark); }
.se-cap-day.is-over .bar > i { background: var(--se-danger); }
.se-cap-day.is-on { box-shadow: inset 0 0 0 2px var(--se-primary); }

/* A bill: label - amount rows, totals in bold */
.se-bill > div { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; }
.se-bill > div.sub { font-weight: 700; border-top: 1px solid var(--se-border-light); padding-top: .45rem; }
.se-bill-total { display: flex; justify-content: space-between; align-items: center; padding: .85rem 1rem; margin-top: .75rem;
    border-radius: 10px; background: var(--se-primary-tint); color: var(--se-primary-dark); font-weight: 700; font-size: 1.1rem; }

/* ---- Book a Trip / My Bookings (customers and agents) ------------------------ */
.se-trips { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.se-trip { background: var(--se-surface); border: 1px solid var(--se-border-light); border-radius: 14px; box-shadow: var(--se-shadow);
    padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .65rem; }
.se-trip-route { display: flex; align-items: center; gap: .5rem; }
.se-trip-route .place { flex: 1; min-width: 0; }
.se-trip-route .place:last-child { text-align: right; }
.se-trip-route .lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--se-text-muted); font-weight: 600; }
.se-trip-route .city { font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }
.se-trip-route > .ms { color: var(--se-primary); }
.se-trip-meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .85rem; color: var(--se-text-secondary); }
.se-trip-meta .ms { font-size: 1rem; vertical-align: -3px; margin-right: .2rem; color: var(--se-text-muted); }
.se-trip-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: auto;
    padding-top: .65rem; border-top: 1px solid var(--se-border-light); }
.se-trip-price { font-size: 1.2rem; font-weight: 700; color: var(--se-primary-dark); }
.se-trip-price small { font-size: .75rem; font-weight: 500; color: var(--se-text-muted); }
.se-trip-desc { font-size: .85rem; color: var(--se-text-secondary); white-space: pre-line; }
mark.se-hl { background: var(--se-warning-tint); color: inherit; padding: 0; border-radius: 2px; }

.se-pax { border: 1px solid var(--se-border-light); border-radius: 12px; padding: .9rem 1rem .25rem; margin-bottom: .9rem; background: var(--se-surface); }
.se-pax-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.se-pax-head h6 { margin: 0 auto 0 0; font-weight: 700; color: var(--se-primary-dark); }

.se-scan { position: relative; border-radius: 12px; overflow: hidden; background: #000; }
.se-scan video { display: block; width: 100%; max-height: 60vh; object-fit: cover; }
.se-scan-frame { position: absolute; inset: 12% 22%; border: 3px solid var(--se-primary); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); pointer-events: none; }

.se-ticket { border: 1px solid var(--se-border-light); border-radius: 16px; overflow: hidden; background: var(--se-surface); box-shadow: var(--se-shadow); }
.se-ticket-head { display: flex; align-items: center; gap: .75rem; padding: .9rem 1.1rem; background: var(--se-primary); color: #fff; }
.se-ticket-head .brand { font-weight: 800; letter-spacing: .08em; }
.se-ticket-head .tag { font-size: .75rem; opacity: .9; }
.se-ticket-body { padding: 1rem 1.1rem; }
.se-ticket-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem 1rem; }
.se-ticket-grid .k { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--se-text-muted); font-weight: 600; }
.se-ticket-grid .v { font-weight: 600; overflow-wrap: anywhere; }
.se-ticket-cut { border-top: 2px dashed var(--se-border); margin: 1rem -1.1rem; }
.se-ticket-qr { display: flex; align-items: center; gap: 1rem; }
.se-ticket-qr img, .se-ticket-qr svg { width: 110px; height: 110px; background: #fff; padding: 6px; border-radius: 8px; flex: 0 0 auto; }

/* ---- Forms in pop-ups -------------------------------------------------------- */
.form-group { margin-bottom: 1rem; }
.modal-body label:not(.form-check-label),
.card-body form label:not(.form-check-label) { font-weight: 500; font-size: .8125rem; color: var(--se-text-secondary); margin-bottom: .35rem; }
.modal-body form h5,
.modal-body form h6.text-primary-emphasis {
    font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--se-primary) !important; margin: .75rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--se-border-light);
}
.modal-body form > br { display: none; }
/* The Save / Cancel row at the end of a form */
.modal-body .text-end:has(> .btn),
.modal-body .se-form-actions {
    display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; align-items: center;
    padding-top: 1rem; margin-top: 1rem !important; border-top: 1px solid var(--se-border-light);
}
.modal-body .text-end:has(> .btn) > .btn { margin: 0 !important; }
.modal-body .text-end:has(> .btn) > .btn-primary { order: 2; }
.modal-header { position: sticky; top: 0; z-index: 2; background: var(--se-surface); border-top-left-radius: inherit; border-top-right-radius: inherit; }

/* ---- Phones: table rows as cards ------------------------------------------------
   The shell gives every list table (3+ columns) .se-rtable, and each cell its
   column name in data-label, the first real column .se-td-title and the
   actions cell .se-td-action (a ⋮ menu, put in the card's corner) or
   .se-td-buttons (plain buttons, put along the bottom). */
@media (max-width: 767.98px) {
    body table.se-rtable { border: 0 !important; background: transparent; }
    body table.se-rtable > thead { display: none; }
    body table.se-rtable > tbody,
    body table.se-rtable > tbody > tr,
    body table.se-rtable > tbody > tr > td { display: block; width: 100% !important; }
    body table.se-rtable > tbody > tr {
        position: relative; margin-bottom: .75rem; padding: .75rem .875rem;
        background: var(--se-surface) !important; border: 1px solid var(--se-border-light); border-radius: 12px; box-shadow: var(--se-shadow);
    }
    body table.se-rtable > tbody > tr > td {
        display: flex; justify-content: flex-end; flex-wrap: wrap; align-items: center; gap: .25rem .5rem;
        padding: .3rem 0 !important; border: 0 !important; box-shadow: none !important; background: none !important;
        text-align: right; min-height: 1.9rem; word-break: break-word;
    }
    body table.se-rtable > tbody > tr > td::before {
        content: attr(data-label); flex: 0 0 42%; margin-right: auto; text-align: left;
        font-size: .8125rem; font-weight: 500; color: var(--se-text-muted);
    }
    body table.se-rtable > tbody > tr > td.se-td-title { justify-content: flex-start; font-size: 1rem; font-weight: 700; text-align: left; padding-right: 2.75rem !important; padding-bottom: .5rem !important; margin-bottom: .25rem; border-bottom: 1px solid var(--se-border-light) !important; }
    body table.se-rtable > tbody > tr > td.se-td-title::before,
    body table.se-rtable > tbody > tr > td.se-td-action::before,
    body table.se-rtable > tbody > tr > td.se-td-buttons::before,
    body table.se-rtable > tbody > tr > td.se-td-full::before { display: none; }
    body table.se-rtable > tbody > tr > td.se-td-action { position: absolute; top: .45rem; right: .45rem; width: auto !important; padding: 0 !important; min-height: 0; }
    body table.se-rtable > tbody > tr > td.se-td-buttons { justify-content: flex-start; flex-wrap: wrap; gap: .4rem; padding-top: .6rem !important; margin-top: .3rem; border-top: 1px solid var(--se-border-light) !important; }
    body table.se-rtable > tbody > tr > td.se-td-full { display: block; text-align: center; color: var(--se-text-muted); }
    body table.se-rtable > tbody > tr > td.se-td-serial,
    body table.se-rtable > tbody > tr > td.se-td-empty { display: none; }
    body table.se-rtable > tfoot { display: block; }
    body table.se-rtable > tfoot > tr { display: flex; flex-wrap: wrap; gap: .5rem; padding: .75rem .875rem; background: var(--se-surface-alt); border-radius: 12px; }
    body table.se-rtable > tfoot > tr > * { border: 0 !important; padding: 0 !important; }
    body table.se-rtable > tbody > tr > td.se-td-title.se-td-id { display: block; }
    body table.se-rtable > tbody > tr > td.se-td-title.se-td-id::before { display: block; font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .1rem; }
    .table-responsive:has(> table.se-rtable) { overflow: visible; }
    /* The list's own card steps back so the row cards aren't boxed twice */
    .card:has(table.se-rtable):not(.modal .card) { background: transparent; border: 0; box-shadow: none; }
    .card:has(table.se-rtable):not(.modal .card) > .card-header { padding: 0 0 .75rem; border: 0; }
    .card:has(table.se-rtable):not(.modal .card) > .card-body { padding: 0; }

    /* DataTables controls: search full width, no "Show N entries" */
    body .dataTables_wrapper .dataTables_length { display: none; }
    body .dataTables_wrapper .dataTables_filter { float: none; text-align: left; margin-bottom: .75rem; }
    body .dataTables_wrapper .dataTables_filter label { display: flex; align-items: center; width: 100%; }
    body .dataTables_wrapper .dataTables_filter input { flex: 1 1 auto; width: auto; margin-left: .5rem; }
    body .dataTables_wrapper .dataTables_info { float: none; text-align: center; padding-top: .25rem; }
    body .dataTables_wrapper .dataTables_paginate { float: none; text-align: center; }
}

/* ---- Phones: pop-ups fill the screen, Save / Cancel stays at the bottom -------- */
@media (max-width: 575.98px) {
    .modal-dialog:not(.modal-sm):not(.modal-dialog-centered) { margin: 0; max-width: none; width: 100%; min-height: 100%; }
    .modal-dialog:not(.modal-sm):not(.modal-dialog-centered) > .modal-content { min-height: 100vh; min-height: 100dvh; border: 0; border-radius: 0; }
    .modal-dialog:not(.modal-sm):not(.modal-dialog-centered) .modal-header { border-radius: 0; }
    /* Short forms: the Save / Cancel row sits at the bottom of the screen */
    .modal-dialog:not(.modal-sm):not(.modal-dialog-centered) > .modal-content { display: flex; flex-direction: column; }
    .modal-dialog:not(.modal-sm):not(.modal-dialog-centered) .modal-body { flex: 1 1 auto; display: flex; flex-direction: column; }
    .modal-dialog:not(.modal-sm):not(.modal-dialog-centered) .modal-body > form { flex: 1 1 auto; display: flex; flex-direction: column; }
    .modal-dialog:not(.modal-sm):not(.modal-dialog-centered) .modal-body > form > :last-child { margin-top: auto !important; }
    .modal-dialog:not(.modal-sm):not(.modal-dialog-centered) .modal-body .text-end:has(> .btn),
    .modal-dialog:not(.modal-sm):not(.modal-dialog-centered) .modal-body .se-form-actions,
    .modal-dialog:not(.modal-sm):not(.modal-dialog-centered) .modal-footer {
        position: sticky; bottom: 0; z-index: 2; background: var(--se-surface);
        margin-left: -1rem; margin-right: -1rem; margin-bottom: -1rem; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
        box-shadow: 0 -4px 12px rgba(0, 0, 0, .06);
    }
    .modal-body .text-end:has(> .btn) > .btn,
    .modal-body .se-form-actions > .btn { flex: 1 1 0; }
    .modal-dialog:not(.modal-sm):not(.modal-dialog-centered) .modal-footer { margin: 0; }

    /* Tiles that switch lists become a row of chips you swipe sideways */
    .se-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -1rem; margin-right: -1rem; padding: 0 1rem .25rem; --bs-gutter-x: .5rem; }
    .se-tabs::-webkit-scrollbar { display: none; }
    .se-tabs > [class*="col"] { flex: 0 0 auto; width: auto; }
    .se-tabs .se-stat-tab { flex-direction: row; align-items: center; gap: .5rem; padding: .45rem .5rem .45rem .875rem; border-radius: 999px; }
    .se-tabs .se-stat-tab:hover { transform: none; }
    .se-tabs .se-stat-tab .se-stat-icon { display: none; }
    .se-tabs .se-stat-tab > div { display: flex; align-items: center; gap: .5rem; }
    .se-tabs .se-stat-tab .se-stat-label { margin: 0; white-space: nowrap; font-size: .875rem; }
    .se-tabs .se-stat-tab .se-stat-value { font-size: .8125rem; min-width: 1.75rem; padding: .15rem .5rem; border-radius: 999px; background: var(--se-surface-alt); text-align: center; }
    .se-tabs .se-stat-tab.is-active { background: var(--se-primary); border-color: var(--se-primary); box-shadow: none; }
    .se-tabs .se-stat-tab.is-active .se-stat-label { color: #fff; }
    .se-tabs .se-stat-tab.is-active .se-stat-value { background: rgba(255, 255, 255, .25); color: #fff; }
}

/* ==========================================================================
   Login
   ========================================================================== */
.se-auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--se-bg); }
.se-auth-art { position: relative; background: #1d3b2a url("../img/se-rides-login.jpg") center / cover no-repeat; }
.se-auth-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.55)); }
.se-auth-art-text { position: absolute; left: 2.5rem; right: 2.5rem; bottom: 2.5rem; z-index: 1; color: #fff; }
.se-auth-art-text h2 { font-size: 2rem; font-weight: 800; margin-bottom: .5rem; }
.se-auth-art-text p { opacity: .9; margin: 0; max-width: 28rem; }
.se-auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.se-auth-card { width: 100%; max-width: 400px; }
.se-auth-logo { width: 84px; height: 84px; border-radius: 20px; box-shadow: var(--se-shadow); background: #fff; object-fit: cover; }
.se-auth-card h1 { font-size: 1.625rem; margin: 1.25rem 0 .25rem; }
.se-auth-card .form-control { height: 48px; }
.se-input-icon { position: relative; }
.se-input-icon > .ms { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--se-text-muted); pointer-events: none; }
.se-input-icon > .form-control { padding-left: 2.6rem; }
.se-input-icon > .se-pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--se-text-muted); width: 40px; height: 40px; border-radius: 8px; }
.se-input-icon > .se-pw-toggle:hover { color: var(--se-primary); }
.se-auth-card .btn-primary { height: 48px; font-size: 1rem; }
@media (max-width: 991.98px) {
    .se-auth { grid-template-columns: 1fr; grid-template-rows: 220px 1fr; }
    .se-auth-art-text { left: 1.25rem; right: 1.25rem; bottom: 1.25rem; }
    .se-auth-art-text h2 { font-size: 1.5rem; }
}
@media (max-width: 575.98px) {
    .se-auth { grid-template-rows: 160px 1fr; }
    .se-auth-art-text p { display: none; }
}

/* Theme switch icon: show the one for the mode you'd switch to */
.se-theme-btn .when-dark { display: none; }
[data-bs-theme="dark"] .se-theme-btn .when-dark { display: inline-block; }
[data-bs-theme="dark"] .se-theme-btn .when-light { display: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
