/* =====================================================================
   Material Dashboard restyle
   Design language based on Creative Tim's Material Dashboard Free:
   Roboto, #f0f2f5 canvas, dark gradient sidenav, floating gradient
   card headers, soft shadows, 0.75rem radii.
   ===================================================================== */

:root {
    --bg: #f0f2f5;
    --text-dark: #344767;
    --text-secondary: #7b809a;
    --border: #d2d6da;
    --divider: #f0f2f5;
    --radius: 0.75rem;
    --radius-sm: 0.5rem;

    --gradient-dark: linear-gradient(195deg, #42424a, #191919);
    --gradient-info: linear-gradient(195deg, #49a3f1, #1A73E8);
    --gradient-success: linear-gradient(195deg, #66BB6A, #43A047);
    --gradient-warning: linear-gradient(195deg, #FFA726, #FB8C00);
    --gradient-danger: linear-gradient(195deg, #EF5350, #E53935);
    --gradient-primary: linear-gradient(195deg, #EC407A, #D81B60);

    --shadow-card: 0 0.25rem 0.375rem -0.0625rem rgba(0, 0, 0, 0.12),
                   0 0.125rem 0.25rem -0.0625rem rgba(0, 0, 0, 0.07);
    --shadow-header: 0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(64, 64, 64, 0.4);
    --shadow-header-info: 0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(73, 163, 241, 0.4);
    --shadow-header-success: 0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(76, 175, 80, 0.4);
    --shadow-header-warning: 0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(251, 140, 0, 0.4);
    --shadow-btn: 0 3px 3px 0 rgba(0, 0, 0, 0.15), 0 3px 1px -2px rgba(0, 0, 0, 0.2),
                  0 1px 5px 0 rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }

body {
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text-dark);
    margin: 0;
    min-height: 100vh;
}

h1, h2, h3 { color: var(--text-dark); font-weight: 600; }

a { color: #1A73E8; text-decoration: none; }
a:hover { text-decoration: underline; }

.material-symbols-rounded {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 1.25rem;
    line-height: 1;
    vertical-align: middle;
}

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */

.form-group { margin-bottom: 1rem; }

label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

input, select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text-dark);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: #1A73E8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

input[type="checkbox"] { width: auto; box-shadow: none; }

.form-group select { width: 100%; }
.form-group.inline { margin-bottom: 0; }
.form-group.inline input, .form-group.inline select { width: 110px; }

.checkbox-label {
    font-size: 0.8rem;
    margin: 0.4rem 0 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.checkbox-label input { width: auto; margin: 0; }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.4rem;
    background-color: #191919;
    background-image: var(--gradient-dark);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 10px -2px rgba(0, 0, 0, 0.25), 0 3px 6px -1px rgba(0, 0, 0, 0.15);
    opacity: 0.95;
}

button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-btn);
}

.btn-info    { background-color: #1A73E8; background-image: var(--gradient-info); }
.btn-success { background-color: #43A047; background-image: var(--gradient-success); }
.btn-danger  { background-color: #E53935; background-image: var(--gradient-danger); }

.toggle-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    background-color: #fff;
    background-image: none;
    color: var(--text-dark);
    border: 1px solid var(--border);
    box-shadow: none;
    font-weight: 700;
    font-size: 0.9rem;
}

.toggle-btn:hover { box-shadow: none; background-color: var(--divider); opacity: 1; }

/* ---------------------------------------------------------------------
   Messages
   --------------------------------------------------------------------- */

.message {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    display: none;
}

.message.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ---------------------------------------------------------------------
   Auth pages (Login / Register / Reset Password)
   --------------------------------------------------------------------- */

body.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 1rem 2rem;
}

.login-container {
    background: #fff;
    padding: 0 1.5rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    width: 100%;
    max-width: 400px;
}

/* Floating gradient card header, Material Dashboard style */
.login-container h1 {
    background-image: var(--gradient-dark);
    color: #fff;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    margin: -1.5rem 0 1.5rem;
    padding: 1.4rem 1rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-header);
}

.login-container form > button[type="submit"] { width: 100%; }

p { color: var(--text-secondary); }

.login-container p { text-align: center; margin-top: 1rem; }

/* ---------------------------------------------------------------------
   Dashboard layout: sidenav + main content
   --------------------------------------------------------------------- */

.sidenav {
    position: fixed;
    top: 1rem;
    left: 1rem;
    bottom: 1rem;
    width: 250px;
    background-image: var(--gradient-dark);
    border-radius: var(--radius);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1rem 1rem 1.25rem;
    z-index: 100;
    overflow-y: auto;
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease;
}

.sidenav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem 1rem;
}

.sidenav-brand .material-symbols-rounded { font-size: 1.4rem; }

.sidenav-divider {
    border: none;
    height: 1px;
    background-image: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
    margin: 0 0 1rem;
}

.sidenav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 0.3rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidenav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
}

.sidenav-link.active {
    background-color: #1A73E8;
    background-image: var(--gradient-info);
    color: #fff;
    font-weight: 500;
    box-shadow: var(--shadow-btn);
}

.sidenav-footer { margin-top: auto; padding-top: 1rem; }

.sidenav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
}

.main-content {
    margin-left: calc(250px + 2rem);
    padding: 1rem 1.5rem 2.5rem;
    max-width: 1600px;
}

/* ---------------------------------------------------------------------
   Top bar
   --------------------------------------------------------------------- */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0 1rem;
    flex-wrap: wrap;
}

.topbar-left { display: flex; align-items: center; gap: 0.75rem; }

.breadcrumb {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}

.breadcrumb span { color: var(--text-dark); font-weight: 500; }

.topbar h1 { margin: 0; font-size: 1.25rem; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

#userInfo { font-size: 1rem; color: var(--text-secondary); }

/* Language switcher — flag buttons, pattern borrowed from www.kempenexpress.nl */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.lang-switch button {
    display: block;
    background: none;
    border: 2px solid transparent;
    border-radius: 4px;
    padding: 2px;
    margin: 0;
    cursor: pointer;
    line-height: 0;
    box-shadow: none;
    opacity: 0.55;
    transition: opacity 0.15s, border-color 0.15s;
}

.lang-switch button:hover {
    opacity: 1;
    border-color: var(--border);
    box-shadow: none;
    transform: none;
}

.lang-switch button.active {
    opacity: 1;
    border-color: #1A73E8;
}

.lang-switch button img {
    display: block;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    background-color: #fff;
    background-image: none;
    color: var(--text-dark);
    border: none;
    box-shadow: var(--shadow-card);
}

.menu-toggle:hover { box-shadow: var(--shadow-card); }

.developer-config {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: #856404;
}

.developer-config label { margin: 0; cursor: pointer; font-weight: 400; color: inherit; }

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */

.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.table-card {
    margin-top: 2rem;
    padding-bottom: 0.5rem;
}

.card-header-gradient {
    background-image: var(--gradient-dark);
    color: #fff;
    border-radius: var(--radius-sm);
    margin: -1.25rem 1rem 0.75rem;
    padding: 0.9rem 1.25rem;
    box-shadow: var(--shadow-header);
}

.card-header-gradient h2, .card-header-gradient h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.card-header-gradient.with-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.card-header-gradient .header-actions {
    display: flex;
    gap: 0.5rem;
}

.card-header-gradient .header-actions button {
    padding: 0.4rem 0.9rem;
    background-image: none;
    background-color: rgba(255, 255, 255, 0.18);
    box-shadow: none;
}

.card-header-gradient .header-actions button:hover {
    background-color: rgba(255, 255, 255, 0.28);
}

.bg-gradient-info    { background-image: var(--gradient-info);    box-shadow: var(--shadow-header-info); }
.bg-gradient-success { background-image: var(--gradient-success); box-shadow: var(--shadow-header-success); }
.bg-gradient-warning { background-image: var(--gradient-warning); box-shadow: var(--shadow-header-warning); }

/* ---------------------------------------------------------------------
   Admin bar (contractor selection + preview mode, shared by all tabs)
   --------------------------------------------------------------------- */

.admin-bar {
    padding: 0.6rem 1.25rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.admin-bar .form-group.inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-bar .checkbox-label { margin: 0; }

/* ---------------------------------------------------------------------
   Global filters bar
   --------------------------------------------------------------------- */

.global-filters {
    padding: 1rem 1.25rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.global-filters .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */

.table-container {
    max-height: 65vh;
    overflow: auto;
    background: #fff;
    border-radius: 0 0 var(--radius) var(--radius);
}

.table-card .table-container { padding: 0 0.5rem; }

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--divider);
}

th {
    background-color: #fff;
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

td { font-size: 0.875rem; color: var(--text-dark); }

td button { padding: 0.4rem 1rem; font-size: 0.75rem; }

/* Alternating colours per route (grouped by receiptid) in the invoice lines
   table; the even colour doubles as the day-section tint so the rounded day
   sections stay visible against the white card. */
#linesTable tbody tr.route-even td { background-color: #f7f9fc; }
#linesTable tbody tr.route-odd td  { background-color: #eef4fb; }

/* ---------------------------------------------------------------------
   Tabs / misc
   --------------------------------------------------------------------- */

.tab-content { min-height: 0; }

.stub-container {
    text-align: center;
    padding: 3rem;
    background: #fff;
    border-radius: var(--radius);
    border: 2px dashed var(--border);
    color: var(--text-secondary);
}

.filters {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
    background: #fff;
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

/* ---------------------------------------------------------------------
   Fuel surcharge
   --------------------------------------------------------------------- */

/* The fuel tab replaces the global contractor combobox with a company sidebar */
body.fuel-tab-active #contractorFilterGroup { display: none !important; }

.fuel-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.fuel-main { flex: 1; min-width: 0; }

/* Sidebar listing every company with invoicelines in the chosen week */
.fuel-company-sidebar {
    flex: 0 0 250px;
    position: sticky;
    top: 1rem;
    padding: 0;
    overflow: hidden;
}

.fuel-company-header {
    padding: 1rem 1.25rem 0.75rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--divider);
}

.fuel-company-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.fuel-company-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.fuel-company-item:hover { background: #eef4fb; }

.fuel-company-item.active {
    background-image: var(--gradient-info);
    color: #fff;
    box-shadow: var(--shadow-header-info);
}

.fuel-company-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.fuel-company-code { font-size: 0.85rem; font-weight: 600; }

.fuel-company-name {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fuel-company-item.active .fuel-company-name { color: rgba(255, 255, 255, 0.8); }

.fuel-company-routes {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: #eef1f6;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
}

.fuel-company-item.active .fuel-company-routes {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.fuel-company-approved { font-size: 1.1rem; color: #4CAF50; }

.fuel-company-item.active .fuel-company-approved { color: #fff; }

.fuel-company-empty {
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.fuel-approval-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
}

.fuel-notice {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    margin: 1rem 0;
}

/* Bulk-apply toolbar: configure a surcharge once, click route descriptions to
   apply it per line */
.fuel-bulk-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
}

.fuel-bulk-title { font-weight: 600; }

.fuel-bulk-params {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.fuel-bulk-hint { color: var(--text-secondary); }

/* Description cells only become click targets while a bulk strategy is armed */
.fuel-tables.bulk-armed td.desc-cell { cursor: pointer; }

.fuel-tables.bulk-armed td.desc-cell:hover {
    background: #eef4ff;
    text-decoration: underline;
}

tr.bulk-applied > td { animation: bulkAppliedFlash 1.2s ease-out; }

@keyframes bulkAppliedFlash {
    from { background: #d4edda; }
    to { background: transparent; }
}

.fuel-params { margin-bottom: 1rem; }

/* Stat cards with floating gradient icon, Material Dashboard style */
.price-summary {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.price-box {
    flex: 1;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 0.75rem 1rem 0.9rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.price-box-icon {
    flex-shrink: 0;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: var(--radius-sm);
    background-image: var(--gradient-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -1.5rem;
    box-shadow: var(--shadow-header);
}

.price-box-icon.bg-gradient-info    { box-shadow: var(--shadow-header-info); }
.price-box-icon.bg-gradient-primary { background-image: var(--gradient-primary); }

.price-box-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: right;
}

.price-box strong {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.price-box-body > span {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

.price-box small { color: var(--text-secondary); font-size: 0.75rem; }
.price-box small span { font-size: 0.75rem; font-weight: 600; }

.fuel-tables {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Day-sectioned tables (fuel + invoice lines). Dates render once per date
   group: the group's first row shows the date with the weekday under it. Each
   day is its own rounded section: no dividers between same-day lines, a
   transparent spacer row separates the days. */
.date-cell { white-space: nowrap; }

.date-cell .date-day {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

table.day-sections {
    border-collapse: separate;
    border-spacing: 0;
}

table.day-sections > tbody > tr > td {
    border-bottom: none;
    background-color: #f7f9fc;
}

table.day-sections > tbody > tr.day-spacer > td {
    background-color: transparent;
    height: 0.75rem;
    padding: 0;
}

table.day-sections tr.date-group-start > td:first-child { border-top-left-radius: var(--radius-sm); }
table.day-sections tr.date-group-start > td:last-child { border-top-right-radius: var(--radius-sm); }

/* The lines table has no detail rows, so its day groups end on a visible row */
#linesTable tr.date-group-end > td:first-child { border-bottom-left-radius: var(--radius-sm); }
#linesTable tr.date-group-end > td:last-child { border-bottom-right-radius: var(--radius-sm); }

/* A day group's last DOM row is always its (hidden) detail row: the bottom
   corners go on the row above it while collapsed, and on the detail row
   itself when it is expanded. */
.fuel-tables tr:has(+ tr.date-group-end:not(.open)) > td:first-child { border-bottom-left-radius: var(--radius-sm); }
.fuel-tables tr:has(+ tr.date-group-end:not(.open)) > td:last-child { border-bottom-right-radius: var(--radius-sm); }

.fuel-tables tr.date-group-end.open > td {
    border-bottom-left-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

.table-section { display: flex; flex-direction: column; }

.table-container.small { max-height: none; }

.route-details { display: none; }

.route-details.open { display: table-row; }

.line-details { padding: 0.75rem 1.5rem 1.25rem; }

.line-details table { font-size: 0.85rem; }

.line-details th { background-color: #f8f9fa; position: static; }

.text-calculated {
    color: #1A73E8;
    font-weight: 600;
    text-decoration: underline dotted;
}

.text-no-url { color: #E53935; font-weight: 600; }

.fuel-totals {
    display: flex;
    justify-content: flex-end;
    gap: 2.5rem;
    padding: 1rem 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.total-item { font-size: 0.85rem; color: var(--text-secondary); }

.total-item span {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-left: 0.5rem;
}

.total-item.highlighted span { color: #4CAF50; }

/* ---------------------------------------------------------------------
   Account tab
   --------------------------------------------------------------------- */

.account-section {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    max-width: 680px;
}

.account-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.account-section h2 { margin: 0 0 0.75rem 0; font-size: 1.05rem; }
.account-section-header h2 { margin: 0; }

.account-table { width: 100%; border-collapse: collapse; }

.account-table td {
    padding: 0.4rem 0.5rem 0.4rem 0;
    vertical-align: top;
    border: none;
    font-size: 0.875rem;
}

.account-table td:first-child {
    color: var(--text-secondary);
    white-space: nowrap;
    width: 45%;
}

.account-table td:last-child { font-weight: 600; }

.account-form .form-group { max-width: 320px; }

.account-section .table-container { max-height: none; border-radius: 0; }

/* =====================================================================
   Responsive
   ===================================================================== */

@media (max-width: 1024px) {
    .sidenav { transform: translateX(calc(-100% - 2rem)); }

    body.sidenav-open .sidenav { transform: translateX(0); }
    body.sidenav-open .sidenav-backdrop { display: block; }
    body.sidenav-open { overflow: hidden; }

    .main-content { margin-left: 0; padding: 0.75rem 0.75rem 2rem; }

    .menu-toggle { display: inline-flex; }
}

@media (max-width: 768px) {

    body.auth-page { padding: 3rem 0.75rem 1.5rem; }

    .login-container { max-width: 100%; }

    .topbar { flex-direction: column; align-items: flex-start; gap: 0.75rem; }

    /* --- Admin bar wrapping --- */
    .admin-bar { gap: 0.75rem; }

    .admin-bar .form-group.inline { flex-wrap: wrap; flex: 1 1 100%; }

    .admin-bar button { flex: 1 1 auto; }

    /* --- Global filters wrapping --- */
    .global-filters { gap: 0.75rem; }

    .global-filters .form-group { flex: 1 1 120px; }

    .global-filters select,
    .global-filters input,
    .form-group.inline input,
    .form-group.inline select {
        width: 100%;
        font-size: 1rem;
    }

    .global-filters button { flex: 1 1 auto; }

    /* --- Tables: horizontal scroll with touch-friendly rows --- */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-height: none;
    }

    th, td {
        padding: 0.6rem 0.5rem;
        font-size: 0.82rem;
        white-space: nowrap;
    }

    /* Expand toggle buttons for touch */
    .toggle-btn {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    /* --- Fuel: company sidebar stacks above the tables --- */
    .fuel-layout { flex-direction: column; }

    .fuel-company-sidebar {
        position: static;
        flex: none;
        width: 100%;
    }

    .fuel-company-list { max-height: 40vh; }

    /* --- Fuel: stat cards stack vertically --- */
    .price-summary { flex-direction: column; gap: 2rem; }

    .price-box { flex: none; }

    /* --- Fuel: totals stack vertically --- */
    .fuel-totals {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
