/* =====================================================================
   FuelApp: complete stylesheet (design system + app shell + components)
   Replaces both the old site.css and fuelapp.css. Load after Bootstrap.
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
    --primary: #0F172A;
    --on-primary: #FFFFFF;
    --secondary: #1E3A8A;
    --on-secondary: #FFFFFF;
    --accent: #A16207;
    --on-accent: #FFFFFF; /* rewards/premium only, once per screen */
    --background: #F8FAFC;
    --foreground: #020617;
    --card: #FFFFFF;
    --card-foreground: #020617;
    --muted: #E8ECF1;
    --muted-foreground: #475569;
    --border: #E2E8F0; /* decorative only, never an input edge */
    --destructive: #DC2626;
    --on-destructive: #FFFFFF;
    --ring: #0F172A;
    --on-dark-muted: #94A3B8; /* secondary text on navy, 6.9:1 */

    --font-sans: "IBM Plex Sans", system-ui, sans-serif;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --radius-none: 0;
    --radius-sm: 8px;
    --radius-full: 9999px;
    --shadow-none: none;
    --shadow-lg: 0 10px 15px rgba(0,0,0,.1);
    --focus-ring-width: 3px;
    --touch-target: 44px;
    --content-max: 1200px;
    --motion: 200ms;
    --sidebar-w: 256px;
    --topbar-h: 64px;
    /* Legacy names still used inline in views (Default.cshtml, _DatePicker, ...) */
    --color-primary: var(--secondary);
    --color-primary-tint: var(--muted);
    --color-body: var(--muted-foreground);
    --color-text: var(--foreground);
    --color-heading: var(--foreground);
    --color-border: var(--border);
    --color-bg: var(--background);
    --color-surface: var(--card);
    --color-danger: var(--destructive);
    --icon-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
    /* Bootstrap 5 bridge */
    --bs-body-font-family: var(--font-sans);
    --bs-body-color: var(--foreground);
    --bs-body-bg: var(--background);
    --bs-primary: #0F172A;
    --bs-primary-rgb: 15,23,42;
    --bs-secondary: #1E3A8A;
    --bs-secondary-rgb: 30,58,138;
    --bs-danger: #DC2626;
    --bs-danger-rgb: 220,38,38;
    --bs-border-color: var(--border);
    --bs-link-color: var(--secondary);
    --bs-link-color-rgb: 30,58,138;
    --bs-link-hover-color: var(--primary);
    --bs-link-hover-color-rgb: 15,23,42;
    --bs-border-radius: var(--radius-sm);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    font-weight: 400;
    color: var(--foreground);
    background: var(--background);
}

h1, .text-heading {
    font-size: 24px;
    line-height: 1.25;
    font-weight: 600;
    margin: 0 0 var(--space-md);
    color: var(--foreground);
}

h2 {
    font-size: 20px;
    line-height: 1.3;
    font-weight: 600;
    margin: 0 0 var(--space-sm);
}

h3, h4, .text-subheading {
    font-size: 18px;
    line-height: 1.35;
    font-weight: 600;
    margin: 0 0 var(--space-sm);
}

p {
    margin: 0 0 var(--space-md);
}

.text-display, .balance {
    font-size: 32px;
    line-height: 1.2;
    font-weight: 600;
}

.text-label {
    font-weight: 500;
}

.text-sm, small {
    font-size: 14px;
    line-height: 1.5;
}

.text-caption {
    font-size: 12px;
    line-height: 1.4;
    font-weight: 500;
}

.text-muted {
    color: var(--muted-foreground) !important;
}

.money, .balance, td.num, th.num {
    font-variant-numeric: tabular-nums;
}

td.num, th.num {
    text-align: right;
}

a {
    color: var(--secondary);
    text-underline-offset: 2px;
}

    a:hover {
        color: var(--primary);
    }

:where(a, button, input, select, textarea, summary, [tabindex], .btn):focus-visible {
    outline: var(--focus-ring-width) solid var(--ring);
    outline-offset: 2px;
    box-shadow: none;
}

/* "Skip to content" link: hidden until keyboard focus */
.skip-link, a[href="#main-content"] {
    position: absolute;
    left: var(--space-md);
    top: -100px;
    z-index: 100;
    background: var(--card);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--muted-foreground);
}

    .skip-link:focus, a[href="#main-content"]:focus {
        top: var(--space-sm);
    }

/* ---------- 3. App shell: fixed sidebar + top bar ----------
   Works whether _TopBar renders before .app-shell (_AdminLayout)
   or inside it (the other sidebars include _TopBar themselves). */
.app-shell {
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    padding: var(--space-lg) var(--space-md);
    background: var(--primary);
    color: var(--on-primary);
    overflow-y: auto;
}

    .app-sidebar :focus-visible {
        outline-color: var(--on-primary);
    }

    .app-sidebar .brand {
        font-size: 20px;
        line-height: 1.2;
        font-weight: 600;
        color: var(--on-primary);
        padding: 0 var(--space-sm);
    }

    .app-sidebar .portal-label {
        font-size: 14px;
        color: var(--on-dark-muted);
        padding: var(--space-xs) var(--space-sm) 0;
        margin-bottom: var(--space-lg);
    }

    .app-sidebar nav {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .app-sidebar .nav-group-label {
        font-size: 12px;
        line-height: 1.4;
        font-weight: 500;
        color: var(--on-dark-muted);
        padding: var(--space-md) var(--space-sm) var(--space-xs);
    }

        .app-sidebar .nav-group-label:first-child {
            padding-top: 0;
        }

    .app-sidebar nav a {
        display: flex;
        align-items: center;
        min-height: var(--touch-target);
        padding: 0 var(--space-sm) 0 calc(var(--space-sm) - 3px);
        border-left: 3px solid transparent;
        color: #E2E8F0;
        text-decoration: none;
        font-size: 15px;
        transition: background-color var(--motion), color var(--motion);
    }

        .app-sidebar nav a:hover {
            background: rgba(255,255,255,.06);
            color: var(--on-primary);
        }

        .app-sidebar nav a.active {
            background: var(--secondary);
            color: var(--on-secondary);
            border-left-color: var(--on-primary);
            font-weight: 500;
        }

.app-topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-w);
    z-index: 20;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: 0 var(--space-xl);
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.app-main {
    margin-left: var(--sidebar-w);
    padding: calc(var(--topbar-h) + var(--space-xl)) var(--space-xl) var(--space-2xl);
    min-width: 0;
}

    .app-main > * {
        max-width: var(--content-max);
    }

/* ---------- 4. User menu (details/summary in _TopBar) ---------- */
.user-menu {
    position: relative;
}

    .user-menu > summary {
        list-style: none;
        display: flex;
        align-items: center;
        gap: var(--space-sm);
        min-height: var(--touch-target);
        padding: var(--space-xs) var(--space-sm);
        border-radius: var(--radius-sm);
        cursor: pointer;
        transition: background-color var(--motion);
    }

        .user-menu > summary::-webkit-details-marker {
            display: none;
        }

        .user-menu > summary:hover {
            background: var(--muted);
        }

.avatar {
    flex: none;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: var(--secondary);
    color: var(--on-secondary);
    font-size: 14px;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
}

.user-role, .user-menu-email {
    font-size: 12px;
    color: var(--muted-foreground);
}

.user-menu-email {
    font-size: 14px;
}

.user-menu-chevron {
    color: var(--muted-foreground);
    transition: transform var(--motion);
}

.user-menu[open] .user-menu-chevron {
    transform: rotate(180deg);
}

.user-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + var(--space-sm));
    width: 280px;
    z-index: 40;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.user-menu-head {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border);
}

    .user-menu-head .user-role {
        margin-top: var(--space-xs);
    }

.user-menu-logout {
    margin: 0;
}

    .user-menu-logout button {
        width: 100%;
        min-height: var(--touch-target);
        display: flex;
        align-items: center;
        gap: var(--space-sm);
        padding: 0 var(--space-md);
        background: none;
        border: 0;
        text-align: left;
        font: 500 15px/1.5 var(--font-sans);
        color: var(--foreground);
        cursor: pointer;
    }

        .user-menu-logout button:hover {
            background: var(--muted);
        }

/* ---------- 5. Language switcher ---------- */
.lang-switch-form {
    display: inline-flex;
    margin: 0;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    min-height: var(--touch-target);
    padding: 0 var(--space-md);
    background: var(--card);
    color: var(--foreground);
    border: 1px solid var(--muted-foreground);
    border-radius: var(--radius-sm);
    font: 500 14px/1 var(--font-sans);
    cursor: pointer;
}

    .lang-switch:hover {
        background: var(--muted);
    }

    .lang-switch svg {
        color: var(--secondary);
    }

/* ---------- 6. Page header & stat cards ---------- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

    .page-header h1, .page-header h2 {
        margin: 0;
    }

.page-subtitle {
    color: var(--muted-foreground);
    margin: var(--space-xs) 0 0;
}

.stat-grid, .stats-grid, .kpi-grid, .stats {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: var(--space-xl);
}

.stat-card, .kpi-card, .stat {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.stat-value, .kpi-value, .stat-number {
    font-size: 32px;
    line-height: 1.2;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--foreground);
}

.stat-label, .kpi-label {
    font-size: 14px;
    color: var(--muted-foreground);
}

.stat-icon, .kpi-icon {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    color: var(--secondary);
    font-size: 24px;
    line-height: 1;
}

/* ---------- 7. Cards & panels: square, flat, bordered ---------- */
.fa-card, .card {
    display: block;
    background: var(--card);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.app-main .card {
    overflow-x: auto;
}

.card > .card-body {
    padding: 0;
}

.card-header, .card-footer {
    background: none;
    border-color: var(--border);
    padding: 0 0 var(--space-md);
}

.fa-panel {
    background: var(--muted);
    padding: var(--space-lg);
}

.fa-container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
}

.fa-grid {
    display: grid;
    gap: var(--space-xl);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ---------- 8. Buttons: only buttons and inputs are rounded ---------- */
.fa-btn, .btn {
    font: 500 16px/1.5 var(--font-sans);
    min-height: var(--touch-target);
    min-width: var(--touch-target);
    padding: 0 var(--space-lg);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--motion), border-color var(--motion), color var(--motion);
}

.fa-btn--primary, .btn-primary {
    background: var(--primary);
    color: var(--on-primary);
    border-color: var(--primary);
}

    .fa-btn--primary:hover, .btn-primary:hover, .btn-primary:active {
        background: #1E293B;
        border-color: #1E293B;
        color: var(--on-primary);
    }

.fa-btn--secondary, .btn-outline, .btn-outline-primary, .btn-secondary, .btn-outline-secondary {
    background: var(--card);
    color: var(--secondary);
    border-color: var(--secondary);
}

    .fa-btn--secondary:hover, .btn-outline:hover, .btn-outline-primary:hover, .btn-secondary:hover, .btn-outline-secondary:hover {
        background: var(--secondary);
        color: var(--on-secondary);
        border-color: var(--secondary);
    }

.fa-btn--destructive, .btn-danger {
    background: var(--destructive);
    color: var(--on-destructive);
    border-color: var(--destructive);
}

.btn-outline-danger {
    background: var(--card);
    color: var(--destructive);
    border-color: var(--destructive);
}

    .btn-outline-danger:hover {
        background: var(--destructive);
        color: var(--on-destructive);
    }

.btn-link {
    background: none;
    border-color: transparent;
    color: var(--secondary);
    padding: 0 var(--space-sm);
}

.btn-sm {
    font-size: 14px;
    padding: 0 var(--space-md);
}

.fa-btn:disabled, .btn:disabled, .btn.disabled {
    background: var(--muted);
    color: var(--muted-foreground);
    border-color: var(--muted);
    cursor: not-allowed;
    opacity: 1;
}

/* ---------- 9. Forms ---------- */
.fa-input, .form-control, .form-select,
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], input[type=tel], input[type=date], input[type=url], select, textarea {
    font: 400 16px/1.5 var(--font-sans);
    min-height: var(--touch-target);
    padding: 0 var(--space-md);
    background-color: var(--card);
    color: var(--foreground);
    border: 1px solid var(--muted-foreground);
    border-radius: var(--radius-sm);
    width: 100%;
}

textarea {
    padding: var(--space-sm) var(--space-md);
}

.input-sm {
    font-size: 14px;
    padding: 0 var(--space-sm);
}

input::placeholder, textarea::placeholder {
    color: var(--muted-foreground);
    opacity: 1;
}

input[type=checkbox], input[type=radio] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    flex: none;
    margin: 2px 0 0;
}

.fa-field, .field {
    display: grid;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

    .fa-field label, .field label, .form-label {
        font-weight: 500;
        margin: 0;
    }

.fa-help, .field-hint, .form-text {
    font-size: 14px;
    color: var(--muted-foreground);
}

.fa-error, .field-error, .invalid-feedback, .field-validation-error, .text-danger {
    font-size: 14px;
    color: var(--destructive) !important;
}

    .field-error:empty {
        display: none;
    }

.input-validation-error, .is-invalid {
    border-color: var(--destructive) !important;
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: flex-end;
}

    .form-inline .field {
        margin: 0;
    }

.check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
}

    .check small {
        display: block;
        color: var(--muted-foreground);
    }

details > summary {
    cursor: pointer;
}

/* ---------- 10. Tables ---------- */
.fa-table, .table, .data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--border);
    margin: 0;
}

    .fa-table th, .table th, .data-table th {
        background: var(--muted);
        color: var(--foreground);
        text-align: left;
        font-size: 14px;
        font-weight: 600;
        padding: var(--space-sm) var(--space-md);
        white-space: nowrap;
        border-bottom: 1px solid var(--border);
    }

    .fa-table td, .table td, .data-table td {
        font-size: 14px;
        padding: var(--space-md);
        vertical-align: middle;
        border-top: 1px solid var(--border);
        font-variant-numeric: tabular-nums;
    }

    .data-table tbody tr:hover, .table tbody tr:hover {
        background: var(--background);
    }

.fa-table-wrap, .table-responsive {
    overflow-x: auto;
}

.data-table td form {
    margin: 0;
}

/* ---------- 11. Badges: pills, icon or word, never colour alone ---------- */
.fa-badge, .badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 12px;
    line-height: 1.4;
    font-weight: 500;
    padding: 2px var(--space-sm);
    border-radius: var(--radius-full);
    border: 1px solid var(--muted);
    background: var(--muted);
    color: var(--muted-foreground);
    white-space: nowrap;
    vertical-align: middle;
}

    .badge + .badge {
        margin-left: var(--space-xs);
    }

.badge-dot::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.fa-badge--paid, .badge-success {
    color: var(--foreground);
    background: var(--card);
    border-color: var(--muted-foreground);
}

.fa-badge--pending, .badge-warning, .badge-muted, .badge-secondary {
    color: var(--muted-foreground);
    background: var(--muted);
    border-color: var(--muted);
}

.fa-badge--failed, .badge-danger {
    color: var(--on-destructive);
    background: var(--destructive);
    border-color: var(--destructive);
}

.fa-badge--refunded, .badge-info, .badge-primary {
    color: var(--secondary);
    background: var(--card);
    border-color: var(--secondary);
}

.badge-accent {
    color: var(--on-accent);
    background: var(--accent);
    border-color: var(--accent);
}

.fa-reward {
    background: var(--accent);
    color: var(--on-accent);
    padding: var(--space-sm) var(--space-md);
    font-weight: 500;
}

/* ---------- 12. Alerts ---------- */
.alert {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
    border: 1px solid var(--border);
    border-left: 4px solid var(--secondary);
    background: var(--card);
    color: var(--foreground);
    padding: var(--space-md);
    border-radius: 0;
    margin-bottom: var(--space-md);
}

.fa-alert--error, .alert-danger {
    border-color: var(--destructive);
    border-left-color: var(--destructive);
}

.alert-warning {
    border-left-color: var(--accent);
}

.alert-success {
    border-left-color: var(--primary);
}

/* ---------- 13. Floating layers: the only things with shadow ---------- */
.fa-modal, .modal-content, .dropdown-menu, .fa-sheet {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0;
    box-shadow: var(--shadow-lg);
}

.modal-header, .modal-footer {
    border-color: var(--border);
}

.dropdown-item {
    min-height: var(--touch-target);
    display: flex;
    align-items: center;
}

    .dropdown-item.active, .dropdown-item:active {
        background: var(--secondary);
    }

/* Bootstrap nav tabs & pagination */
.nav-tabs {
    border-color: var(--border);
}

    .nav-tabs .nav-link {
        color: var(--muted-foreground);
        border-radius: 0;
        min-height: var(--touch-target);
    }

        .nav-tabs .nav-link.active {
            color: var(--secondary);
            border-color: var(--border) var(--border) var(--card);
            font-weight: 500;
        }

.page-link {
    color: var(--secondary);
    border-color: var(--border);
    min-width: var(--touch-target);
    min-height: var(--touch-target);
    display: grid;
    place-items: center;
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
}

.page-item:first-child .page-link, .page-item:last-child .page-link {
    border-radius: 0;
}

/* Payment summary */
.fa-summary-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    font-variant-numeric: tabular-nums;
}

.fa-summary-row--total {
    border-top: 1px solid var(--border);
    font-weight: 600;
    font-size: 18px;
    padding-top: var(--space-md);
}

/* ---------- 14. Auth pages (Login, Register) ---------- */
.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: var(--background);
}

.auth-panel-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-md);
}

.auth-panel-form-inner {
    width: 100%;
    max-width: 420px;
}

.auth-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.auth-back, .eyebrow-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    min-height: var(--touch-target);
    font-weight: 500;
    text-decoration: none;
    color: var(--secondary);
}

    .auth-back:hover, .eyebrow-link:hover {
        text-decoration: underline;
    }

.auth-wordmark {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--space-xl);
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    padding: var(--space-xl) var(--space-lg);
}

    .auth-card h1 {
        margin-bottom: var(--space-lg);
    }

.auth-submit {
    width: 100%;
    margin-top: var(--space-sm);
}

.auth-alt {
    margin: var(--space-lg) 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--muted-foreground);
}

    .auth-alt a {
        font-weight: 500;
    }

.auth-panel-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: var(--space-3xl) var(--space-2xl);
    background: var(--primary);
    color: var(--on-primary);
}

    .auth-panel-brand :focus-visible {
        outline-color: var(--on-primary);
    }

.auth-panel-brand-content {
    position: relative;
    z-index: 1;
    max-width: 46ch;
}

.auth-panel-brand h1 {
    font-size: 32px;
    line-height: 1.2;
    color: var(--on-primary);
    margin: 0 0 var(--space-md);
}

.auth-panel-brand p {
    color: #CBD5E1;
    margin: 0;
}

.auth-panel-brand .brand-mark {
    display: none;
}
/* Swiss grid: square tiles cut into the navy, one blue block and one gold block */
.auth-panel-brand::before {
    content: "";
    position: absolute;
    inset: 0 0 50% 0;
    pointer-events: none;
    background: conic-gradient(from 270deg at 8px 8px, rgba(248,250,252,.14) 0 25%, transparent 0) 20px 20px / 48px 48px;
}

.auth-panel-brand::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 144px;
    height: 144px;
    pointer-events: none;
    background: var(--secondary);
    box-shadow: 24px 168px 0 -24px var(--accent);
}

/* ---------- 15. Narrow screens ---------- */
@media (max-width: 960px) {
    .app-shell {
        display: flex;
        flex-direction: column;
    }

    .app-topbar {
        position: static;
        order: 0;
        height: auto;
        min-height: var(--topbar-h);
        padding: var(--space-sm) var(--space-md);
    }

    .app-sidebar {
        position: static;
        order: 1;
        width: auto;
        flex-direction: row;
        align-items: center;
        gap: var(--space-md);
        padding: var(--space-sm) var(--space-md);
        overflow-x: auto;
        overflow-y: hidden;
    }

        .app-sidebar .brand {
            font-size: 18px;
            flex: none;
        }

        .app-sidebar .portal-label, .app-sidebar .nav-group-label {
            display: none;
        }

        .app-sidebar nav {
            flex-direction: row;
            gap: var(--space-xs);
        }

            .app-sidebar nav a {
                white-space: nowrap;
                border-left: 0;
                border-bottom: 3px solid transparent;
                padding: 0 var(--space-sm);
            }

                .app-sidebar nav a.active {
                    border-bottom-color: var(--on-primary);
                }

        .app-sidebar > form {
            margin: 0 0 0 auto !important;
            flex: none;
        }

    .app-main {
        order: 2;
        margin-left: 0;
        padding: var(--space-lg) var(--space-md) var(--space-2xl);
    }

    .user-info {
        display: none;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-panel-brand {
        order: -1;
        padding: var(--space-xl) var(--space-md);
    }

        .auth-panel-brand h1 {
            font-size: 24px;
        }

        .auth-panel-brand::before, .auth-panel-brand::after {
            display: none;
        }

    .auth-panel-form {
        align-items: flex-start;
        padding-top: var(--space-xl);
    }

    .auth-wordmark {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0ms !important;
        animation-duration: 0ms !important;
    }
}

/* =====================================================================
   16. Page components found in Views (added from the class inventory)
   ===================================================================== */

/* --- Dashboard stats: .stat-grid > .card with .stat-value + .stat-label --- */
.stat-grid > .card {
    position: relative;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-height: 120px;
    justify-content: flex-end;
}
    /* Any icon in the card (currently emoji) sits top-right, quiet and monochrome */
    .stat-grid > .card > :not(.stat-value):not(.stat-label):not(:has(.stat-value, .stat-label)) {
        position: absolute;
        top: var(--space-lg);
        right: var(--space-lg);
        margin: 0;
        font-size: 24px;
        line-height: 1;
        color: var(--secondary);
        filter: grayscale(1);
        opacity: .7;
    }

    .stat-grid > .card > svg {
        filter: none;
        opacity: 1;
    }

.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

/* --- Small type helpers --- */
.eyebrow {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary);
    margin-bottom: var(--space-xs);
}

.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .9em;
    font-variant-numeric: tabular-nums;
}

.cell-sub {
    display: block;
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted-foreground);
    margin-top: 2px;
}

.text-warning {
    color: var(--accent) !important;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

/* --- Form layout --- */
.form-grid {
    display: grid;
    gap: var(--space-md) var(--space-lg);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: var(--space-md);
}

    .form-grid .field {
        margin: 0;
    }

.form-section {
    margin-bottom: var(--space-xl);
}

    .form-section + .form-section {
        border-top: 1px solid var(--border);
        padding-top: var(--space-lg);
    }

.form-section-head {
    margin-bottom: var(--space-md);
}

    .form-section-head :is(h2, h3, h4) {
        margin: 0 0 var(--space-xs);
    }

    .form-section-head p {
        color: var(--muted-foreground);
        font-size: 14px;
        margin: 0;
    }

.field-value {
    font-weight: 500;
    color: var(--foreground);
    min-height: 24px;
    font-variant-numeric: tabular-nums;
}

.label-optional {
    font-size: 14px;
    font-weight: 400;
    color: var(--muted-foreground);
    margin-left: var(--space-xs);
}

label.required::after {
    content: " *";
    color: var(--destructive);
}

span.required, abbr.required {
    color: var(--destructive);
    text-decoration: none;
}

/* Input with a prefix/suffix, e.g. an amount in FCFA */
.input-affix {
    display: flex;
    align-items: stretch;
}

    .input-affix > input, .input-affix > select {
        flex: 1;
        min-width: 0;
    }

    .input-affix .affix {
        display: flex;
        align-items: center;
        flex: none;
        padding: 0 var(--space-md);
        background: var(--muted);
        color: var(--muted-foreground);
        border: 1px solid var(--muted-foreground);
        font-size: 14px;
        font-weight: 500;
        white-space: nowrap;
    }

    .input-affix > :first-child:not(:last-child) {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

    .input-affix > :last-child:not(:first-child) {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }

    .input-affix > .affix:first-child {
        border-right: 0;
        border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    }

    .input-affix > .affix:last-child {
        border-left: 0;
        border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    }

.date-range {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
}

    .date-range input {
        width: auto;
        flex: 1 1 150px;
    }

/* Segmented control: buttons, links, or radio + label pairs */
.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    border: 1px solid var(--muted-foreground);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--card);
}

    .segmented input[type=radio] {
        position: absolute;
        opacity: 0;
        width: 1px;
        height: 1px;
    }

    .segmented > a, .segmented > button, .segmented > label {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: var(--touch-target);
        padding: 0 var(--space-md);
        margin: 0;
        background: none;
        border: 0;
        border-right: 1px solid var(--muted-foreground);
        font: 500 14px/1 var(--font-sans);
        color: var(--foreground);
        text-decoration: none;
        cursor: pointer;
        transition: background-color var(--motion);
    }

    .segmented > :last-child {
        border-right: 0;
    }

    .segmented > a:hover, .segmented > button:hover, .segmented > label:hover {
        background: var(--muted);
    }

    .segmented > .active, .segmented input:checked + label {
        background: var(--primary);
        color: var(--on-primary);
    }

    .segmented input:focus-visible + label {
        outline: var(--focus-ring-width) solid var(--ring);
        outline-offset: -3px;
    }

/* Role picker: selectable cards */
.role-grid {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: var(--space-lg);
}

    .role-grid > label, .role-grid > a, .role-grid > div {
        display: flex;
        gap: var(--space-sm);
        align-items: flex-start;
        padding: var(--space-md);
        background: var(--card);
        border: 1px solid var(--muted-foreground);
        color: var(--foreground);
        text-decoration: none;
        cursor: pointer;
        transition: border-color var(--motion), background-color var(--motion);
    }

    .role-grid > :hover {
        background: var(--background);
    }

    .role-grid > :has(input:checked), .role-grid > .active {
        border-color: var(--primary);
        box-shadow: inset 0 0 0 1px var(--primary);
    }

/* --- Wizard --- */
.wizard-steps-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    overflow-x: auto;
}

    .wizard-steps-indicator .wizard-step {
        display: flex;
        align-items: center;
        gap: var(--space-sm);
        flex: none;
    }

.step-dot {
    flex: none;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--muted-foreground);
    background: var(--card);
    color: var(--muted-foreground);
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.step-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted-foreground);
    white-space: nowrap;
}

.step-line {
    flex: 1 1 24px;
    min-width: 24px;
    height: 2px;
    background: var(--border);
}

.active > .step-dot, .step-dot.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
}

.active > .step-label, .step-label.active {
    color: var(--foreground);
}

.done > .step-dot, .completed > .step-dot, .step-dot.done {
    background: var(--secondary);
    border-color: var(--secondary);
    color: var(--on-secondary);
}

.step-line.active, .step-line.done {
    background: var(--secondary);
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

/* --- Buttons --- */
.btn-auto {
    width: auto !important;
}

.btn-ghost {
    background: transparent;
    color: var(--secondary);
    border-color: transparent;
}

    .btn-ghost:hover {
        background: var(--muted);
        color: var(--primary);
    }

.icon-btn {
    width: var(--touch-target);
    height: var(--touch-target);
    display: inline-grid;
    place-items: center;
    flex: none;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--muted-foreground);
    cursor: pointer;
    transition: background-color var(--motion), color var(--motion);
}

    .icon-btn:hover {
        background: var(--muted);
        color: var(--foreground);
    }

.icon-btn-danger {
    color: var(--destructive);
}

    .icon-btn-danger:hover {
        background: #FEF2F2;
        color: var(--destructive);
    }

.btn-close {
    width: var(--touch-target);
    height: var(--touch-target);
    padding: 0;
}

/* --- Tables --- */
.row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-xs);
    white-space: nowrap;
}

    .row-actions form {
        margin: 0;
    }

.data-table.striped tbody tr:nth-child(even), .table.striped tbody tr:nth-child(even) {
    background: var(--background);
}

.data-table.compact td, .compact .data-table td, .table.compact td {
    padding: var(--space-sm) var(--space-md);
}

.redflag-row, .data-table.striped tbody tr.redflag-row, .table.striped tbody tr.redflag-row {
    background: #FEF2F2;
}

    .redflag-row > td:first-child {
        box-shadow: inset 4px 0 0 var(--destructive);
    }

.data-table tbody tr.redflag-row:hover {
    background: #FEE2E2;
}

.invoice-checkbox {
    margin: 0;
}

.data-table th.num, .table th.num, .data-table td.num, .table td.num {
    text-align: right;
}

/* --- Badges used for account and request states --- */
.badge-active {
    color: var(--foreground);
    background: var(--card);
    border-color: var(--muted-foreground);
}

.badge-inactive {
    color: var(--muted-foreground);
    background: var(--card);
    border: 1px dashed var(--muted-foreground);
}

.badge-pending {
    color: var(--muted-foreground);
    background: var(--muted);
    border-color: var(--muted);
}

@media (max-width: 960px) {
    .cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 600px) {
    .form-grid, .cols-2, .cols-4 {
        grid-template-columns: 1fr !important;
    }

    .wizard-steps-indicator .step-label {
        display: none;
    }

    .wizard-steps-indicator .active > .step-label {
        display: inline;
    }
}

/* =====================================================================
   17. Dialogs (fuelapp-ux.js confirmations, e.g. "Log out?")
   Native <dialog> styling, plus a fallback that pins a non-modal
   dialog to the centre of the screen instead of the top of the page.
   ===================================================================== */
dialog {
    width: min(440px, calc(100% - 2 * var(--space-md)));
    max-height: calc(100vh - 2 * var(--space-xl));
    padding: var(--space-lg);
    background: var(--card);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: 0;
    box-shadow: var(--shadow-lg);
}

    dialog[open]:not(:modal) {
        position: fixed;
        inset: 0;
        margin: auto;
        z-index: 1000;
        height: fit-content;
    }

    dialog::backdrop {
        background: rgba(2, 6, 23, .5);
    }

    dialog :is(h2, h3) {
        margin: 0 0 var(--space-sm);
    }

    dialog p {
        color: var(--muted-foreground);
    }

    dialog form[method=dialog], dialog menu, dialog footer {
        display: flex;
        justify-content: flex-end;
        gap: var(--space-sm);
        margin: var(--space-lg) 0 0;
        padding: 0;
    }

/* =====================================================================
   18. Data tables: toolbar, pagination (built by site.js) and
       fuelapp-ux.js pieces: confirm dialog, toasts, loading, empty rows
   ===================================================================== */

/* --- Tighter, calmer rows --- */
.data-table td {
    padding: 10px var(--space-md);
}

.data-table th {
    padding: 10px var(--space-md);
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.fx-table-wrap {
    overflow-x: auto;
}

/* --- Toolbar above the table: search + row count --- */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.table-search {
    position: relative;
    display: block;
    flex: 1 1 280px;
    max-width: 360px;
    margin: 0;
}

    .table-search svg {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--muted-foreground);
        pointer-events: none;
    }

    .table-search input[type=search] {
        padding-left: 42px;
    }

        .table-search input[type=search]::-webkit-search-cancel-button {
            cursor: pointer;
        }

.table-count {
    font-size: 14px;
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* --- Pagination under the table --- */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-top: var(--space-md);
}

.table-pagination-info {
    font-size: 14px;
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
}

    .table-pagination-info strong {
        color: var(--foreground);
        font-weight: 600;
    }

.table-pagination-controls {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.page-btn {
    min-width: var(--touch-target);
    height: var(--touch-target);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0 var(--space-sm);
    background: var(--card);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: 500 14px/1 var(--font-sans);
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background-color var(--motion), border-color var(--motion), color var(--motion);
}

    .page-btn:hover:not(:disabled):not([aria-current="page"]) {
        background: var(--background);
        border-color: var(--muted-foreground);
    }

    .page-btn[aria-current="page"] {
        background: var(--primary);
        color: var(--on-primary);
        border-color: var(--primary);
        font-weight: 600;
        cursor: default;
    }

.page-prev, .page-next {
    padding: 0 var(--space-md) 0 var(--space-sm);
    color: var(--secondary);
}

.page-next {
    padding: 0 var(--space-sm) 0 var(--space-md);
}

.page-btn:disabled {
    background: var(--background);
    color: #94A3B8;
    border-color: var(--border);
    cursor: not-allowed;
}

.page-gap {
    min-width: 28px;
    text-align: center;
    color: var(--muted-foreground);
    font-size: 14px;
    user-select: none;
}

/* --- Empty table row (fuelapp-ux.js) --- */
.data-table tr.empty td, .table tr.empty td {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
    color: var(--muted-foreground);
    font-size: 14px;
}

.fx-empty-icon {
    display: block;
    margin: 0 auto var(--space-sm);
    width: 40px;
    height: 40px;
    line-height: 40px;
    background: var(--muted);
    color: var(--muted-foreground);
    font-size: 18px;
}

/* --- Confirmation dialog, e.g. "Sign out?" (fuelapp-ux.js) --- */
.fx-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000; /* above Bootstrap modals (1055), e.g. the cost confirmation on "Add employee" */
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    background: rgba(2, 6, 23, .5);
}

    .fx-dialog-backdrop.is-open {
        display: flex;
    }

.fx-dialog {
    width: min(440px, 100%);
    padding: var(--space-lg);
    background: var(--card);
    color: var(--foreground);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.fx-dialog-icon {
    width: 40px;
    height: 40px;
    margin-bottom: var(--space-md);
    display: grid;
    place-items: center;
    background: var(--muted);
    color: var(--secondary);
    font-size: 20px;
    font-weight: 700;
}

.fx-dialog.is-danger .fx-dialog-icon {
    background: #FEF2F2;
    color: var(--destructive);
}

.fx-dialog-title {
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
    margin: 0 0 var(--space-sm);
}

.fx-dialog-text {
    color: var(--muted-foreground);
    margin: 0;
    white-space: pre-line;
}

.fx-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

    .fx-dialog-actions .btn + .btn {
        margin-left: 0;
    }

/* --- Toasts (fuelapp-ux.js) --- */
.fx-toasts {
    position: fixed;
    right: var(--space-md);
    bottom: var(--space-md);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-width: calc(100vw - 2 * var(--space-md));
}

.fx-toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 280px;
    max-width: 420px;
    padding: var(--space-sm) var(--space-xs) var(--space-sm) var(--space-md);
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    line-height: 1.45;
    transition: opacity var(--motion), transform var(--motion);
}

    .fx-toast > span:nth-child(2) {
        flex: 1;
    }

.fx-toast-icon {
    flex: none;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .12);
    font-weight: 700;
    font-size: 13px;
}

.fx-toast button {
    flex: none;
    width: var(--touch-target);
    height: var(--touch-target);
    background: none;
    border: 0;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    opacity: .8;
}

    .fx-toast button:hover {
        opacity: 1;
    }

.fx-toast :focus-visible {
    outline-color: var(--on-primary);
}

.fx-toast-error {
    background: var(--card);
    color: var(--foreground);
    border: 1px solid var(--destructive);
}

    .fx-toast-error .fx-toast-icon {
        background: var(--destructive);
        color: var(--on-destructive);
    }

    .fx-toast-error :focus-visible {
        outline-color: var(--ring);
    }

.fx-toast.is-leaving {
    opacity: 0;
    transform: translateY(8px);
}

/* --- Button loading state (fuelapp-ux.js) --- */
.btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

    .btn.is-loading > * {
        visibility: hidden;
    }

    .btn.is-loading::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: 18px;
        height: 18px;
        margin: -9px 0 0 -9px;
        border: 2px solid var(--muted);
        border-top-color: var(--secondary);
        border-radius: 50%;
        animation: fx-spin .7s linear infinite;
    }

.btn-primary.is-loading::after, .btn-danger.is-loading::after {
    border-color: rgba(255, 255, 255, .35);
    border-top-color: #FFFFFF;
}

@keyframes fx-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 600px) {
    .table-search {
        max-width: none;
    }

    .table-pagination {
        justify-content: center;
    }

    .page-prev span, .page-next span {
        display: none;
    }
    /* arrows only on phones */
    .page-prev, .page-next {
        padding: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn.is-loading::after {
        animation-duration: 2s;
    }
}

/* =====================================================================
   19. Plate card (wwwroot/js/plate-card.js): hover a plate to see the driver
   ===================================================================== */
[data-plate] {
  cursor: help;
  border-bottom: 1px dotted var(--muted-foreground);
  text-decoration: none;
}
[data-plate]:hover, [data-plate]:focus-visible { color: var(--secondary); border-bottom-color: var(--secondary); }

.plate-card {
  position: fixed; z-index: 1200;
  display: none;
  width: 300px; max-width: calc(100vw - 16px);
  padding: var(--space-md);
  background: var(--card); color: var(--foreground);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 14px; line-height: 1.4;
}
.plate-card.is-open { display: block; }
.plate-card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-sm);
  padding-bottom: var(--space-sm); margin-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}
.plate-card-head strong { font-size: 16px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.plate-card-model { color: var(--muted-foreground); font-size: 13px; text-align: right; }
.plate-card-row { display: flex; gap: var(--space-sm); padding: 3px 0; }
.plate-card-label { flex: none; width: 92px; color: var(--muted-foreground); }
.plate-card-value { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
a.plate-card-value { color: var(--secondary); }
.plate-card-note { color: var(--muted-foreground); padding: 2px 0 6px; }
.plate-card-alert {
  margin-bottom: var(--space-sm); padding: 4px 8px;
  background: #FEF2F2; color: #991B1B; border: 1px solid var(--destructive);
  font-size: 13px; font-weight: 600;
}

/* =====================================================================
   20. Wizards in pop-ups: one step at a time, no scrolling
   (steps are created/split by site.js: splitLongWizardSteps, autoWizardModals)
   ===================================================================== */
.wizard-step[data-wizard-step] { display: none; }
.wizard-step[data-wizard-step].active { display: block; animation: wizard-in var(--motion) ease-out; }
@keyframes wizard-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }

.wizard-steps-indicator { flex-wrap: nowrap; }
.wizard-steps-indicator .step-label {
  max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wizard-steps-indicator .step-dot { transition: background-color var(--motion), color var(--motion); }
/* Many steps: numbers only, plus the name of the current step */
.wizard-steps-indicator.many .step-label { display: none; }
.wizard-steps-indicator.many .step-label.active { display: inline; max-width: 220px; }
.wizard-steps-indicator.many .step-line { min-width: 12px; }

/* Buttons always visible at the bottom of the step */
.modal .wizard-nav { margin-top: var(--space-lg); padding-top: var(--space-md); }
.modal .wizard-nav [data-wizard-back] { margin-right: auto; }
.modal-body { padding: var(--space-lg); }

@media (prefers-reduced-motion: reduce) {
  .wizard-step[data-wizard-step].active { animation: none; }
}

/* =====================================================================
   21. SOFT STYLE (Oct 2026): rounded, compact small text, tinted icon
   buttons, soft pills: the style of the reference design, in the
   FuelApp colours (navy, deep blue, gold; no colour tokens change here).
   To go back to the square look, delete this whole section.
   ===================================================================== */
:root {
  --font-sans: "Montserrat", "IBM Plex Sans", system-ui, sans-serif;

  --radius-sm: 10px;             /* buttons, inputs */
  --radius-md: 12px;             /* inner rows, alerts, icon buttons */
  --radius-lg: 16px;             /* cards, pop-ups */
  --radius-full: 9999px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, .14);

  /* neutral tints of the FuelApp palette, for icon buttons and soft fills */
  --tint: #EDF1F7;
  --tint-strong: #DDE4EE;
  --danger-tint: #FEF2F2;

  --sidebar-w: 248px;
  --topbar-h: 60px;
  --bs-border-radius: 10px;
}

/* ---- compact typography ---- */
body { font-size: 14px; line-height: 1.5; letter-spacing: -0.005em; }
h1, .text-heading { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 700; }
h3, h4, .text-subheading { font-size: 15px; font-weight: 700; }
.text-display, .balance, .stat-value, .kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
small, .text-sm, .field-hint, .fa-help, .form-text, .cell-sub, .page-subtitle { font-size: 12px; }
.text-caption, .eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
a { text-underline-offset: 3px; }

/* ---- shell ---- */
.app-sidebar { padding: 20px 14px; }
.app-sidebar .brand { font-size: 18px; }
.app-sidebar .portal-label { font-size: 12px; }
.app-sidebar .nav-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.app-sidebar nav a {
  min-height: 40px; font-size: 13.5px; border-radius: var(--radius-md);
  border-left: 0; padding: 0 12px; margin: 1px 0;
}
.app-sidebar nav a.active { font-weight: 600; }
.app-topbar { background: rgba(255, 255, 255, .88); backdrop-filter: blur(8px); }
.app-main { padding: calc(var(--topbar-h) + 24px) 28px 40px; }
.avatar { border-radius: var(--radius-md); }
.user-menu > summary { border-radius: var(--radius-md); }
.user-menu-panel { border-radius: var(--radius-lg); overflow: hidden; }
.lang-switch { border-radius: var(--radius-sm); font-size: 13px; }

/* ---- cards ---- */
.fa-card, .card, .stat-grid > .card, .stat-card, .kpi-card, .auth-card {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-card) !important;
  padding: 20px;
}
.card h2, .card h3 { margin-bottom: 4px; }
.card > p:first-of-type, .form-section-head p { font-size: 13px; color: var(--muted-foreground); }
.fa-panel { border-radius: var(--radius-md); }
.stat-label, .kpi-label { font-size: 12px; font-weight: 500; }

/* ---- buttons ---- */
.fa-btn, .btn {
  font: 600 13.5px/1.2 var(--font-sans);
  min-height: 40px; padding: 0 18px; border-radius: var(--radius-sm);
}
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 12.5px; }
.fa-btn--secondary, .btn-outline, .btn-outline-primary, .btn-secondary, .btn-outline-secondary { border-width: 1.5px; }
/* Tinted square icon buttons (view / download / delete), like the reference */
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--tint); color: var(--primary);
}
.icon-btn:hover { background: var(--tint-strong); color: var(--primary); }
.icon-btn-danger { background: var(--danger-tint); color: var(--destructive); }
.icon-btn-danger:hover { background: #FDE2E2; color: var(--destructive); }
/* the "✕" delete buttons in tables (btn-outline with red text) become tinted red icon buttons */
.data-table td .btn-outline[style*="B42318"], .table td .btn-outline[style*="B42318"] {
  min-height: 36px; min-width: 36px; padding: 0; border: 0;
  background: var(--danger-tint); color: var(--destructive) !important; border-radius: var(--radius-sm);
}

/* ---- forms ---- */
.fa-input, .form-control, .form-select,
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], input[type=tel], input[type=date], input[type=url], select, textarea {
  font-size: 14px; min-height: 42px; border-radius: var(--radius-sm);
}
.fa-field label, .field label, .form-label { font-size: 13px; font-weight: 600; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; }
/* Confirmation boxes like the reference ("I confirm that…") */
.check {
  padding: 14px 16px; border: 1px solid var(--primary); border-radius: var(--radius-md); background: var(--card);
  font-size: 14px;
}
.check small { font-size: 12px; }
.segmented { border-radius: var(--radius-sm); }
.role-grid > label, .role-grid > a, .role-grid > div { border-radius: var(--radius-md); }

/* ---- tables ---- */
.fa-table-wrap, .table-responsive { border-radius: var(--radius-md); }
.fa-table, .table, .data-table {
  border-radius: var(--radius-md); border-collapse: separate; border-spacing: 0; overflow: hidden;
}
.fa-table th, .table th, .data-table th { font-size: 12px; font-weight: 600; padding: 10px 14px; }
.fa-table td, .table td, .data-table td { font-size: 13.5px; padding: 10px 14px; }
.table-search input[type=search] { border-radius: var(--radius-sm); }
.page-btn { border-radius: var(--radius-sm); min-width: 36px; height: 36px; font-size: 13px; }

/* ---- badges: soft pills (FuelApp colours unchanged) ---- */
.fa-badge, .badge { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-full); }

/* ---- alerts, pop-ups, floating layers ---- */
.alert { border-radius: var(--radius-md); font-size: 13.5px; }
.fa-modal, .modal-content, .dropdown-menu, .fa-sheet, .fx-dialog, .plate-card {
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal-header { padding: 18px 24px; }
.modal-title { font-size: 17px; font-weight: 700; }
.fx-dialog-icon { border-radius: var(--radius-md); }
.fx-toast { border-radius: var(--radius-md); }
.fx-toast-icon, .fx-empty-icon { border-radius: var(--radius-sm); }
.plate-card-alert { border-radius: var(--radius-sm); }

/* ---- wizard steps ---- */
.step-dot { border-radius: var(--radius-sm); width: 30px; height: 30px; font-size: 13px; }
.step-label { font-size: 13px; }

/* =====================================================================
   22. Dashboard & settings building blocks (tidy, consistent spacing)
   ===================================================================== */

/* Page header: title + one-line subtitle on the left, actions on the right */
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 12px 16px; margin-bottom: 20px;
}
.page-head h1 { margin: 0; }
.page-head .page-subtitle { margin: 4px 0 0; color: var(--muted-foreground); font-size: 13px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-actions input, .page-actions select { width: auto; min-height: 40px; }

/* Stat tiles: number + label + icon in a tinted square */
.stat-tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 20px; }
.stat-tile {
  position: relative;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg, 0);
  padding: 18px 20px; box-shadow: var(--shadow-card, none); min-width: 0;
}
.stat-tile > .icon-tile { position: absolute; top: 16px; right: 16px; }
.stat-tile > div:first-child { min-width: 0; }
.stat-tile .stat-label { font-size: 12px; font-weight: 600; color: var(--muted-foreground); padding-right: 52px; }
.stat-tile .stat-value {
  font-size: clamp(20px, 1.8vw, 26px); line-height: 1.15; font-weight: 700;
  font-variant-numeric: tabular-nums; margin-top: 26px; overflow-wrap: anywhere;
}
.stat-tile .stat-note { font-size: 12px; color: var(--muted-foreground); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-tile {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--radius-md, 0); background: var(--tint, var(--muted)); color: var(--secondary);
}
.icon-tile.is-gold { background: #FBF3E4; color: var(--accent); }

/* Grids of cards */
.dash-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; align-items: start; }
.dash-grid.wide-left { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.dash-grid > .card, .stat-tiles + .card, .dash-stack > .card { margin-bottom: 0; }
.dash-stack { display: grid; gap: 16px; margin-bottom: 16px; }

/* Card header: icon + title + subtitle, link on the right */
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 15px; }
.card-head .card-sub { margin: 2px 0 0; font-size: 12px; color: var(--muted-foreground); }
.card-head .card-link { margin-left: auto; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.card-head .card-link:hover { text-decoration: underline; }

/* Ranked list with a bar (top companies / stations) */
.rank-list { display: grid; gap: 12px; }
.rank-row-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 6px; }
.rank-row-top strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-bar { height: 8px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.rank-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--secondary); }
.rank-bar.is-alt > span { background: var(--primary); }

/* Simple rows: title + sub on the left, value(s) on the right */
.list-rows { display: grid; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; padding-bottom: 0; }
.list-row:first-child { padding-top: 0; }
.list-row-title { font-weight: 600; color: var(--foreground); font-size: 14px; }
.list-row-sub { font-size: 12px; color: var(--muted-foreground); }
.list-row-value { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.list-row-value strong { font-size: 14px; }
.list-row form { margin: 0; }

/* Column chart (days / months) */
.col-chart { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 8px; }
.col-chart-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.col-chart-bar {
  width: 100%; max-width: 30px; min-height: 2px; border-radius: 6px 6px 2px 2px;
  background: var(--secondary); opacity: .85; transition: opacity var(--motion);
}
.col-chart-col:hover .col-chart-bar { opacity: 1; }
.col-chart-label { margin-top: 6px; font-size: 11px; color: var(--muted-foreground); white-space: nowrap; }

/* Empty state inside a card */
.empty-note { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--radius-md, 0); background: var(--muted); color: var(--muted-foreground); font-size: 13px; }

/* ---------- Settings pages ---------- */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-h) + 20px); display: grid; gap: 2px; }
.settings-nav a {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px;
  border-radius: var(--radius-sm, 0); color: var(--muted-foreground); font-size: 13.5px; font-weight: 500; text-decoration: none;
}
.settings-nav a:hover { background: var(--card); color: var(--foreground); }
.settings-nav a.is-current { background: var(--card); color: var(--primary); font-weight: 600; box-shadow: var(--shadow-card, none); }
.settings-nav a svg { width: 18px; height: 18px; }
.settings-sections { display: grid; gap: 16px; }
.settings-section { scroll-margin-top: calc(var(--topbar-h) + 16px); margin-bottom: 0 !important; padding: 0 !important; overflow: hidden; }
.settings-head { display: flex; gap: 12px; align-items: flex-start; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.settings-head h3 { margin: 0; font-size: 15px; }
.settings-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted-foreground); max-width: 70ch; }
.settings-body { padding: 16px 20px; }
.settings-body .data-table { margin: 0; }
.settings-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; background: var(--background); border-top: 1px solid var(--border); }
.settings-body fieldset { border: 0; padding: 0; margin: 0 0 16px; }
.settings-body legend { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); margin-bottom: 8px; }

/* Label + hint on the left, control on the right */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.setting-row:first-child { padding-top: 0; }
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-row-text { min-width: 0; }
.setting-row-title { font-weight: 600; font-size: 14px; }
.setting-row-hint { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; }
.setting-row-control { flex: none; display: flex; align-items: center; gap: 8px; }
.setting-row-control .input-affix { width: 170px; }
.setting-row-control input[type=number] { width: 110px; }

.chip-check { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font-size: 13px; cursor: pointer; }
.chip-check:has(input:checked) { border-color: var(--secondary); background: var(--tint, var(--muted)); color: var(--primary); font-weight: 600; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 960px) {
  .dash-grid, .dash-grid.wide-left { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; gap: 6px; }
  .settings-nav a { white-space: nowrap; background: var(--card); }
}
@media (max-width: 600px) {
  .setting-row { flex-direction: column; align-items: stretch; }
  .setting-row-control .input-affix, .setting-row-control input[type=number] { width: 100%; }
}
input[type=month], input[type=week], input[type=time], input[type=datetime-local] {
  font: 400 14px/1.5 var(--font-sans); min-height: 40px; padding: 0 10px;
  background: var(--card); color: var(--foreground);
  border: 1px solid var(--muted-foreground); border-radius: var(--radius-sm);
}

/* ---- 22b. extra dashboard helpers ---- */
.icon-tile.is-danger { background: #FEF2F2; color: var(--destructive); }
.stat-tile.is-danger .stat-value { color: var(--destructive); }
.btn-group { display: inline-flex; }
.btn-group > .btn { border-radius: 0; margin: 0; }
.btn-group > .btn + .btn { margin-left: -1px; }
.btn-group > .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-group > .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.col-chart-value { font-size: 10.5px; color: var(--muted-foreground); margin-bottom: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-foot-note { font-size: 12px; color: var(--muted-foreground); margin: 10px 0 0; }
.job-card { margin-bottom: 16px; }
.job-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.job-head .avatar { width: 44px; height: 44px; font-size: 15px; flex: none; }
.job-head h3 { margin: 0 0 4px; font-size: 16px; }
.job-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--muted-foreground); }
.job-date { margin-left: auto; font-size: 12px; color: var(--muted-foreground); white-space: nowrap; }
.check-strip { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-md, 0); background: var(--muted); margin-bottom: 14px; font-size: 13px; }
.check-strip strong.check-title { display: block; font-size: 14px; margin-bottom: 2px; }
.check-strip.is-ok { background: #EEF2FA; } .check-strip.is-ok .check-title { color: var(--secondary); }
.check-strip.is-warn { background: #FBF7EE; } .check-strip.is-warn .check-title { color: #854D0E; }
.check-strip.is-bad { background: #FEF2F2; } .check-strip.is-bad .check-title { color: #991B1B; }
.kv-grid { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 16px; font-size: 13.5px; margin-bottom: 14px; }
.kv-grid dt { color: var(--muted-foreground); }
.kv-grid dd { margin: 0; overflow-wrap: anywhere; }
.doc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm, 0); background: var(--card);
  font-size: 13px; font-weight: 500; color: var(--secondary); text-decoration: none;
}
.doc-chip:hover { background: var(--tint, var(--muted)); }
.doc-chip svg { width: 16px; height: 16px; }
.job-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.job-actions form { margin: 0; }
@media (max-width: 600px) { .kv-grid { grid-template-columns: 1fr; } .job-date { margin-left: 0; } }
.check-strip > svg { flex: none; margin-top: 1px; color: var(--muted-foreground); }
.check-strip.is-ok > svg { color: var(--secondary); }
.check-strip.is-warn > svg { color: #854D0E; }
.check-strip.is-bad > svg { color: var(--destructive); }

/* =====================================================================
   23. Font Awesome icons (loaded in _Layout / _AdminLayout)
   ===================================================================== */
.icon-btn i, .icon-btn .fa-solid, .icon-btn .fa-regular { font-size: 15px; line-height: 1; }
.icon-tile i { font-size: 18px; line-height: 1; }
.btn i { font-size: 0.95em; }
.settings-nav a i { width: 18px; text-align: center; font-size: 15px; }
.doc-chip i { font-size: 14px; }
.empty-note i { font-size: 16px; }
.badge i { font-size: 0.9em; margin-right: 1px; }
.check-strip > i { flex: none; margin-top: 2px; font-size: 18px; color: var(--muted-foreground); }
.check-strip.is-ok > i { color: var(--secondary); }
.check-strip.is-warn > i { color: #854D0E; }
.check-strip.is-bad > i { color: var(--destructive); }
.text-ok { color: var(--secondary) !important; }
.row-actions { gap: 6px; }

/* =====================================================================
   24. Actions menu (⋮) on list rows — UAT-07/09/11
   <details class="action-menu"><summary>…</summary><div class="action-menu-list">items</div></details>
   The list opens as a floating panel (site.js positions it), so table corners don't clip it.
   ===================================================================== */
.action-menu { position: relative; display: inline-block; }
.action-menu > summary { list-style: none; cursor: pointer; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu-list {
  position: fixed; z-index: 1100; min-width: 220px; padding: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md, 0);
  box-shadow: var(--shadow-lg);
}
.action-menu-list form { margin: 0; }
.action-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 38px; padding: 0 12px; border: 0; border-radius: var(--radius-sm, 0);
  background: transparent; color: var(--foreground); font: 500 13.5px/1.2 var(--font-sans);
  text-align: left; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.action-menu-item:hover, .action-menu-item:focus-visible { background: var(--muted); color: var(--foreground); outline: none; }
.action-menu-item i { width: 16px; text-align: center; color: var(--muted-foreground); }
.action-menu-item.is-danger, .action-menu-item.is-danger i { color: var(--destructive); }
.action-menu-item.is-danger:hover { background: #FEF2F2; }
.action-menu-item[disabled] { opacity: .45; cursor: not-allowed; }
.action-menu-sep { height: 1px; margin: 4px 6px; background: var(--border); }
a.stat-tile { display: block; } a.stat-tile:hover { border-color: var(--secondary); }
/* UAT-06: field checked as you leave it */
.field-error { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 500; color: var(--destructive); }
.field-error:empty { display: none; }
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--destructive) !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
/* Stat tiles: pills and notes stay inside the card */
.stat-tile .pill-row { padding-right: 0; }
.stat-tile .pill-row .badge { white-space: normal; text-align: left; line-height: 1.35; max-width: 100%; }
.stat-tile .stat-note { white-space: normal; overflow: visible; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stat-tile .pill-row .badge { border-radius: 10px; padding: 4px 10px; }

/* =====================================================================
   25. FuelApp logo (wwwroot/img/brand — from the official letterhead)
   ===================================================================== */
.app-sidebar .brand { line-height: 0; margin-bottom: 4px; }
.app-sidebar .brand img { height: 34px; width: auto; display: block; }
.auth-wordmark img { height: 52px; width: auto; display: block; }
.auth-panel-logo { height: 64px; width: auto; display: block; margin-bottom: 28px; }
@media (max-width: 600px) { .auth-wordmark img { height: 42px; } }
