/* ================================================================
   PETROL PUMP MANAGEMENT — "Petroleum Ledger" design system
   Refined, premium dashboard. IBM Plex Sans + Plex Mono.
   Restyles shared classes + Bootstrap so all pages inherit it.
   ================================================================ */

:root {
    /* Ink (sidebar) */
    --ink-900: #0a0f1c;
    --ink-800: #0f1626;
    --ink-700: #16203a;

    /* Brand */
    --brand:      #10b981;   /* emerald */
    --brand-600:  #059669;
    --brand-700:  #047857;
    --brand-050:  #ecfdf5;
    --accent:     #f59e0b;   /* amber */
    --accent-600: #d97706;

    /* Surfaces */
    --bg:       #eef1f6;
    --surface:  #ffffff;
    --surface-2:#f7f9fc;
    --input-bg: #f1faf4;
    --input-border: #cbe7d6;
    --input-shadow: inset 0 1px 2px rgba(16,24,40,.07);
    --input-disabled: #e9ebf0;
    --border:   #e5e9f1;
    --border-2: #eef1f6;

    /* Text */
    --text:     #101828;
    --muted:    #667085;
    --muted-2:  #98a2b3;

    /* Shape */
    --radius:    14px;
    --radius-sm: 10px;
    --radius-lg: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.04);
    --shadow:    0 4px 14px -4px rgba(16,24,40,.10), 0 2px 6px -2px rgba(16,24,40,.06);
    --shadow-lg: 0 18px 40px -12px rgba(16,24,40,.22);

    --sidebar-w: 212px;

    --font-sans: 'Plus Jakarta Sans Variable', 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;
}

/* ── Base ──────────────────────────────────────── */
* { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
    font-family: var(--font-sans);
    color: var(--text);
    background:
        radial-gradient(1100px 560px at 100% -8%, rgba(16,185,129,.07), transparent 58%),
        radial-gradient(940px 520px at -8% 112%, rgba(245,158,11,.06), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    letter-spacing: -0.01em;
}
::selection { background: rgba(16,185,129,.22); }
a { text-decoration: none; }

h1,h2,h3,h4,h5,h6,.h4,.h5 { font-weight: 600; letter-spacing: -0.02em; color: var(--text); }

/* Monospace, tabular financial figures */
.kpi-value, .stat-value, .money, td .fw-bold, .table td.text-end,
.recent-table tbody td:nth-child(3), .recent-table tbody td:nth-child(4) {
    font-variant-numeric: tabular-nums;
}
.kpi-value, .stat-value { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }

/* ── Sidebar ───────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
    overflow-y: auto; overflow-x: hidden;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    padding-bottom: 24px;
    background: linear-gradient(185deg, var(--ink-900) 0%, var(--ink-800) 60%, var(--ink-700) 100%) !important;
    /* Defined edge: a bright inner hairline, a solid border, and a soft
       drop shadow so the rail reads as a raised panel, not a flat fill. */
    border-right: 1px solid rgba(0,0,0,.5);
    box-shadow:
        inset -1px 0 0 rgba(255,255,255,.07),
        4px 0 24px rgba(10,15,28,.20);
}
/* Emerald accent strip down the outer edge — ties the rail to the brand. */
.sidebar::after {
    content: '';
    position: absolute; top: 0; right: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(180deg,
        rgba(16,185,129,.75) 0%,
        rgba(16,185,129,.50) 45%,
        rgba(16,185,129,.22) 100%);
    box-shadow: 0 0 14px rgba(16,185,129,.30);
    pointer-events: none;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.28); }

.sidebar-brand {
    position: relative;
    padding: 20px 22px 18px;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,.05), transparent);
}
/* Gradient rule that fades out rather than hitting the edges hard. */
.sidebar-brand::after {
    content: '';
    position: absolute; left: 16px; right: 16px; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent, rgba(255,255,255,.16) 20%, rgba(255,255,255,.16) 80%, transparent);
}
.sidebar-brand i {
    color: var(--brand);
    font-size: 1.3rem;
    filter: drop-shadow(0 0 10px rgba(16,185,129,.5));
}

.sidebar .nav-header {
    padding: 18px 22px 6px;
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: rgba(255,255,255,.34);
}
.sidebar .nav-link {
    position: relative;
    color: #ffffff;
    padding: 9px 22px;
    margin: 1px 10px;
    border-radius: 9px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex; align-items: center;
    transition: background .16s, color .16s, transform .16s;
}
.sidebar .nav-link i {
    width: 22px; text-align: center; margin-right: 10px;
    font-size: 1rem; opacity: 1;
}
.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
    transform: translateX(2px);
}
.sidebar .nav-link:hover i { color: var(--brand); }
.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(16,185,129,.26), rgba(16,185,129,.05));
    box-shadow: inset 0 0 0 1px rgba(16,185,129,.28);
    font-weight: 600;
}
.sidebar .nav-link.active::before {
    content: '';
    position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; border-radius: 0 3px 3px 0;
    background: var(--brand);
    box-shadow: 0 0 12px rgba(16,185,129,.7);
}
.sidebar .nav-link.active i { color: var(--brand); opacity: 1; }

/* Collapsible nav groups */
.nav-group { list-style: none; position: relative; }
/* Hairline between sections so the groups read as separate blocks.
   Faded at both ends so it never collides with the rail's edges. */
.nav-group + .nav-group::before {
    content: '';
    position: absolute; left: 18px; right: 18px; top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.10) 25%, rgba(255,255,255,.10) 75%, transparent);
}
/* An open group gets a faint well, so you can see where it starts and ends. */
.nav-group.open {
    background: rgba(255,255,255,.028);
    border-radius: 12px;
    margin: 2px 6px;
}
.nav-group.open + .nav-group::before,
.nav-group.open::before { opacity: 0; }
.nav-group-toggle {
    width: calc(100% - 20px);
    margin: 8px 10px 2px;
    padding: 9px 12px;
    background: transparent; border: none;
    color: rgba(255,255,255,.92);
    font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.2px;
    display: flex; align-items: center; justify-content: flex-start; gap: 8px;
    text-align: left;
    cursor: pointer; border-radius: 8px;
    transition: color .15s, background .15s;
}
.nav-group-toggle:hover { color: #ffffff; background: rgba(255,255,255,.07); }
.nav-group.open > .nav-group-toggle { color: #ffffff; }
.nav-group-toggle > i { font-size: 0.72rem; transition: transform .2s ease, color .2s ease; opacity: .85; }
.nav-group.open > .nav-group-toggle > i { transform: rotate(90deg); color: var(--brand); opacity: 1; }
.nav-chevron { font-size: 0.8rem; transition: transform .25s ease; opacity: .8; }
.nav-group.open > .nav-group-toggle .nav-chevron { transform: rotate(180deg); }
.nav-group-items {
    list-style: none; padding: 0; margin: 0;
    max-height: 0; overflow: hidden;
    transition: max-height .28s cubic-bezier(.4,0,.2,1);
}
.nav-group.open > .nav-group-items { max-height: 720px; }

/* Submenu items sit one level below the top-level links (Dashboard, User
   Manual), so they read smaller and slightly tighter. */
.sidebar .nav-group-items .nav-link {
    font-size: 0.8rem;
    font-weight: 450;
    padding: 7px 20px;
    line-height: 1.35;
}
.sidebar .nav-group-items .nav-link i {
    font-size: 0.9rem;
    width: 20px; margin-right: 9px;
}
.sidebar .nav-group-items .nav-link.active { font-weight: 600; }

/* ── Main content + top bar ────────────────────── */
/* min-width:0 lets this flex item shrink below its content's intrinsic width
   instead of blowing the layout wider than the viewport (the mobile-overflow bug). */
.main-content { margin-left: var(--sidebar-w); min-height: 100vh; min-width: 0; }

.navbar {
    background: rgba(255,255,255,.82) !important;
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border) !important;
    padding: .6rem 1.5rem !important;
    position: sticky; top: 0; z-index: 50;
    flex-wrap: wrap; row-gap: .4rem;          /* let the top bar wrap on narrow screens */
}
.navbar .text-muted { color: var(--muted) !important; }

/* NOTE: no animation on .content-wrapper — a filling opacity/transform animation
   keeps the element composited, creating a stacking context that traps every
   position:fixed Bootstrap modal *under* the backdrop. Not worth it. */

/* Keep modals above the backdrop regardless of stacking */
.modal-backdrop { z-index: 1050; }
.modal { z-index: 1060; }

/* ── Cards ─────────────────────────────────────── */
.card {
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    background: var(--surface);
    transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-2);
    padding: 15px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
    color: var(--text);
    border-radius: var(--radius) var(--radius) 0 0 !important;
}
.card-header .btn { letter-spacing: 0; }

/* ── Buttons ───────────────────────────────────── */
.btn { font-weight: 500; border-radius: var(--radius-sm); letter-spacing: -0.01em; transition: all .16s ease; }
.btn:focus, .btn:focus-visible { box-shadow: 0 0 0 3px rgba(16,185,129,.25); }
.btn-sm { border-radius: 8px; }
.btn-primary {
    background: var(--brand); border-color: var(--brand);
    box-shadow: 0 1px 2px rgba(5,150,105,.4);
}
.btn-primary:hover, .btn-primary:focus { background: var(--brand-600); border-color: var(--brand-600); transform: translateY(-1px); }
.btn-primary:active { background: var(--brand-700); border-color: var(--brand-700); }
.btn-outline-primary { color: var(--brand-600); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }
.btn-success { background: var(--brand-600); border-color: var(--brand-600); }
.btn-success:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn-secondary { background: #eef1f6; border-color: #e2e7f0; color: #344054; }
.btn-secondary:hover { background: #e2e7f0; color: #101828; }

/* ── Forms ─────────────────────────────────────── */
.form-label { font-size: .72rem; font-weight: 600; color: #344054; margin-bottom: .35rem; letter-spacing: -0.01em; }
.form-control, .form-select {
    border: 1px solid var(--input-border, var(--border)); border-radius: var(--radius-sm);
    padding: .45rem .7rem; font-size: .82rem; color: var(--text);
    background-color: var(--input-bg);
    box-shadow: var(--input-shadow);
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: var(--input-shadow), 0 0 0 3px rgba(16,185,129,.22);
}
.form-control::placeholder { color: var(--muted-2); }

.form-control:disabled, .form-control[readonly],
.form-select:disabled, .form-select[readonly] {
    background-color: var(--input-disabled);
    box-shadow: none;
    opacity: 1;
}

/* Input group prepend icons */
.input-group-text {
    background: var(--input-bg);
    border: 1px solid var(--input-border, var(--border));
    color: var(--brand-600);
    border-radius: var(--radius-sm);
    padding: .45rem .65rem;
    min-width: 42px; justify-content: center; font-size: .82rem;
}
.input-group:focus-within .input-group-text { border-color: var(--brand); color: var(--brand-600); }
.input-group > .form-control, .input-group > .form-select { border-left: 0; }
.input-group:focus-within > .form-control, .input-group:focus-within > .form-select { border-left: 0; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(16,185,129,.18); border-color: var(--brand); }

/* ── Tables ────────────────────────────────────── */
.table { color: var(--text); }
.table th {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--muted); border-top: none; font-weight: 600;
    background: var(--surface-2);
    padding: 11px 14px; white-space: nowrap;
}
.table td { padding: 10px 12px; font-size: .82rem; border-color: var(--border-2); vertical-align: middle; }
.table-hover > tbody > tr:hover > * { background-color: var(--brand-050); }
.table > :not(caption) > * > * { box-shadow: none; }
.table-dark, .table-dark th, .table-dark td { background: var(--ink-800) !important; color: #fff; }
.table-light, tr.table-light > * { background: var(--surface-2) !important; }

/* Badges */
.badge { font-weight: 600; letter-spacing: .2px; padding: .38em .65em; border-radius: 7px; }
.badge.bg-secondary { background: #eef1f6 !important; color: #475467 !important; }
.badge.bg-info { background: #e0f2fe !important; color: #0369a1 !important; }
.badge.bg-dark { background: #101828 !important; }
.badge.bg-warning { background: #fef3c7 !important; color: #92400e !important; }

/* ═══════════ DASHBOARD — KPI CARDS ═══════════ */
.kpi-card {
    border: none; border-radius: var(--radius-lg); padding: 22px;
    color: #fff; display: flex; align-items: center; gap: 16px;
    min-height: 118px; height: 100%; position: relative; overflow: hidden;
    transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s;
    box-shadow: 0 10px 26px -10px rgba(16,24,40,.4);
    text-decoration: none;
}
.kpi-card::before {
    content: ''; position: absolute; top: -34px; right: -20px;
    width: 140px; height: 140px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.22), rgba(255,255,255,0) 70%);
    pointer-events: none;
}
.kpi-card::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,0) 40%);
    pointer-events: none;
}
.kpi-card:hover { transform: translateY(-5px); box-shadow: 0 22px 40px -12px rgba(16,24,40,.45); }

.kpi-sales     { background: linear-gradient(140deg, #10b981 0%, #047857 100%); }
.kpi-cash      { background: linear-gradient(140deg, #f59e0b 0%, #b45309 100%); }
.kpi-purchases { background: linear-gradient(140deg, #6366f1 0%, #4338ca 100%); }
.kpi-net       { background: linear-gradient(140deg, #0ea5e9 0%, #0369a1 100%); }
.kpi-loss      { background: linear-gradient(140deg, #f43f5e 0%, #be123c 100%); }

.kpi-icon {
    font-size: 1.6rem; width: 52px; height: 52px; border-radius: 15px;
    background: rgba(255,255,255,.20); border: 1px solid rgba(255,255,255,.22);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; position: relative; z-index: 1;
}
.kpi-content { position: relative; z-index: 1; flex: 1; min-width: 0; }
.kpi-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.8px; opacity: 0.9; margin-bottom: 4px; font-weight: 500; }
.kpi-value { font-size: 1.15rem; font-weight: 600; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 0.72rem; margin-top: 5px; opacity: .92; }
.trend-up   { color: #d1fae5; }
.trend-down { color: #ffe4e6; }

/* Financial summary + legacy stat cards */
.fin-card { border-radius: var(--radius) !important; }
.fin-card .card-body { padding: 16px 20px; min-height: 104px; }
.fin-icon { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.stat-card { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat-card .card-body { padding: 18px 20px; }
.stat-card .stat-value { font-size: 1.05rem; font-weight: 700; }
.stat-card .stat-label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }

/* Tank levels */
.tank-progress { height: 10px; border-radius: 8px; background: var(--border-2); overflow: hidden; }
.tank-progress .progress-bar { border-radius: 8px; transition: width 0.9s cubic-bezier(.4,0,.2,1); }
.badge-level { font-size: 0.72rem; font-weight: 700; }

/* Donut + dots */
.chart-donut-wrap { position: relative; max-width: 180px; margin: 0 auto; }
.prod-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

/* Recent sales table */
.recent-table thead th { background: var(--surface-2); color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.recent-table tbody td { padding: 11px 14px; font-size: 0.875rem; border-color: var(--border-2); vertical-align: middle; }
.recent-table tbody tr:hover td { background: var(--brand-050); }

.date-badge { display: inline-block; padding: 3px 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; font-size: 0.76rem; color: var(--muted); font-weight: 600; }

/* Payment pills */
.pay-badge { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; }
.pay-cash   { background: #d1fae5; color: #065f46; }
.pay-credit { background: #fef3c7; color: #92400e; }
.pay-other  { background: #e0e7ff; color: #3730a3; }

/* Stock validation badge */
.stock-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 8px; font-size: 0.78rem; font-weight: 600; line-height: 1.4; }
.stock-ok       { background: #d1fae5; color: #065f46; }
.stock-low      { background: #fef3c7; color: #92400e; }
.stock-critical { background: #fee2e2; color: #991b1b; }
.stock-badge i  { font-size: 0.8rem; }
.stock-tank     { opacity: 0.75; font-weight: 500; }

/* Dashboard header */
.dash-title { color: var(--text); font-size: 1.5rem; font-weight: 700; }

/* Alerts */
.alert { border: 1px solid transparent; border-radius: var(--radius-sm); }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-secondary { background: var(--surface-2); border-color: var(--border); color: #344054; }

/* Dropdowns */
.dropdown-menu { border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; }
.dropdown-item { border-radius: 8px; font-size: .875rem; padding: .5rem .7rem; }
.dropdown-item:active, .dropdown-item.active { background: var(--brand); }

/* Modals */
.modal-content { border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { border-color: var(--border-2); }

/* ── Login ─────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background:
        radial-gradient(900px 500px at 15% 10%, rgba(16,185,129,.16), transparent 55%),
        radial-gradient(800px 500px at 90% 90%, rgba(245,158,11,.14), transparent 55%),
        linear-gradient(160deg, var(--ink-900) 0%, var(--ink-800) 55%, var(--ink-700) 100%);
}
.login-card {
    width: 410px; max-width: 100%; border: 1px solid rgba(255,255,255,.10);
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,.97);
    box-shadow: 0 30px 70px -20px rgba(0,0,0,.6);
    backdrop-filter: blur(6px);
    /* The card owns its own padding. It previously had none, relying on every
       page to nest a `.card-body p-5` — so any page that didn't (register,
       both vendor pages) had its inputs running to the card's edge. */
    padding: 36px 34px 30px;
}
/* Pages that DO nest a card-body must not double up. Beats `.p-5`'s
   !important on specificity (0,2,0 vs 0,1,0). */
.login-card > .card-body { padding: 0 !important; }

@media (max-width: 480px) {
    .login-card { padding: 26px 20px 22px; border-radius: var(--radius); }
}

.login-card .bi-fuel-pump-fill { color: var(--brand) !important; filter: drop-shadow(0 4px 14px rgba(16,185,129,.5)); }
.login-card .btn-dark { background: var(--ink-800); border-color: var(--ink-800); border-radius: var(--radius-sm); padding: .7rem; font-weight: 600; }
.login-card .btn-dark:hover { background: var(--brand-600); border-color: var(--brand-600); }

/* ── Login form typography + controls ──────────── */
.login-card .form-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: .35rem;
    letter-spacing: .01em;
}
.login-card .form-control {
    padding: .62rem .85rem;
    border-radius: var(--radius-sm);
}
.login-card .form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(16,185,129,.16);
}
/* Header block: icon, title, subtitle */
.login-head { text-align: center; margin-bottom: 1.75rem; }
.login-head .login-icon {
    width: 58px; height: 58px; margin: 0 auto .9rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 16px;
    background: linear-gradient(160deg, var(--ink-800), var(--ink-700));
    box-shadow: 0 8px 20px -6px rgba(10,15,28,.55);
}
.login-head .login-icon i { font-size: 1.6rem; color: var(--brand); }
.login-head h4 { font-weight: 700; letter-spacing: -.02em; margin: 0 0 .25rem; }
.login-head p  { font-size: .85rem; color: var(--muted); margin: 0; }
/* Footer link, separated by a rule */
.login-foot {
    margin-top: 1.4rem; padding-top: 1.1rem;
    border-top: 1px solid var(--border);
    text-align: center; font-size: .85rem;
}

/* ════════════════════════════════════════════════
   DARK THEME  (html[data-theme="dark"])
   Sidebar & login are dark in both modes by design.
   ════════════════════════════════════════════════ */
[data-theme="dark"] {
    --bg:        #0b0f17;
    --surface:   #141b26;
    --surface-2: #1b2431;
    --input-bg:  #17321f;
    --input-border: #2c5138;
    --input-shadow: inset 0 1px 2px rgba(0,0,0,.30);
    --input-disabled: #141b26;
    --border:    #26313f;
    --border-2:  #222c3a;
    --text:      #e7ebf2;
    --muted:     #93a1b5;
    --muted-2:   #64748b;
    --brand-050: rgba(16,185,129,.13);
    /* stronger shadows read on dark surfaces */
    --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
    --shadow:    0 6px 18px -6px rgba(0,0,0,.6);
    --shadow-lg: 0 22px 46px -12px rgba(0,0,0,.75);
}
/* Fix: Bootstrap tables default --bs-table-bg to white — remap for dark */
[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
    color: var(--text);
}
[data-theme="dark"] .table > :not(caption) > * > * { background-color: transparent; }
[data-theme="dark"] .card { border-color: var(--border); }
[data-theme="dark"] .navbar {
    background: rgba(15,21,32,.82) !important;
    border-bottom-color: var(--border) !important;
}
[data-theme="dark"] .navbar .text-muted,
[data-theme="dark"] .navbar .text-muted a { color: var(--muted) !important; }

/* Bootstrap utility remaps */
[data-theme="dark"] .bg-white { background: var(--surface) !important; }
[data-theme="dark"] .bg-light { background: var(--surface-2) !important; color: var(--text); }
[data-theme="dark"] .text-dark { color: var(--text) !important; }
[data-theme="dark"] .text-muted { color: var(--muted) !important; }
[data-theme="dark"] .text-secondary { color: var(--muted) !important; }
[data-theme="dark"] .text-success { color: #34d399 !important; }
[data-theme="dark"] .text-danger  { color: #f87171 !important; }
[data-theme="dark"] .text-warning { color: #fbbf24 !important; }
[data-theme="dark"] .text-primary { color: #34d399 !important; }
[data-theme="dark"] .border, [data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom { border-color: var(--border) !important; }

/* Buttons */
[data-theme="dark"] .btn-secondary { background: #26313f; border-color: #2f3d4e; color: #e2e8f0; }
[data-theme="dark"] .btn-secondary:hover { background: #2f3d4e; color: #fff; }
[data-theme="dark"] .btn-outline-secondary { color: #cbd5e1; border-color: var(--border); }
[data-theme="dark"] .btn-outline-secondary:hover { background: #26313f; color: #fff; border-color: #33415a; }
[data-theme="dark"] .btn-outline-dark { color: #cbd5e1; border-color: var(--border); }

/* Badges */
[data-theme="dark"] .badge.bg-secondary { background: #26313f !important; color: #cbd5e1 !important; }
[data-theme="dark"] .badge.bg-info { background: rgba(14,165,233,.20) !important; color: #7dd3fc !important; }
[data-theme="dark"] .badge.bg-warning { background: rgba(245,158,11,.20) !important; color: #fcd34d !important; }

/* Alerts */
[data-theme="dark"] .alert-success { background: rgba(16,185,129,.13); border-color: rgba(16,185,129,.32); color: #6ee7b7; }
[data-theme="dark"] .alert-danger  { background: rgba(244,63,94,.13);  border-color: rgba(244,63,94,.32);  color: #fda4af; }
[data-theme="dark"] .alert-warning { background: rgba(245,158,11,.13); border-color: rgba(245,158,11,.32); color: #fcd34d; }
[data-theme="dark"] .alert-secondary { background: var(--surface-2); border-color: var(--border); color: #cbd5e1; }

/* Dropdown + modal surfaces */
[data-theme="dark"] .dropdown-menu { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .dropdown-item { color: var(--text); }
[data-theme="dark"] .dropdown-item:hover { background: var(--surface-2); color: #fff; }
[data-theme="dark"] .dropdown-divider { border-color: var(--border); }
[data-theme="dark"] .modal-content { background: var(--surface); color: var(--text); }

/* Inputs: dark-friendly date picker icon */
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(.6); }

[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-control[readonly],
[data-theme="dark"] .form-select:disabled,
[data-theme="dark"] .form-select[readonly] {
    background-color: var(--input-disabled);
    box-shadow: none;
    opacity: 1;
}

/* Theme toggle button */
.theme-toggle { border-color: var(--border); color: var(--muted); }
.theme-toggle:hover { color: var(--text); }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .kpi-value { font-size: 1.2rem; }
    .kpi-card  { min-height: auto; padding: 18px; }
    .kpi-icon  { width: 46px; height: 46px; font-size: 1.4rem; }

    /* top bar: fit into the phone width — tighter gaps, wraps, no giant name */
    .navbar { padding: .5rem .75rem !important; }
    .navbar .ms-auto { gap: .4rem !important; flex-wrap: wrap; justify-content: flex-end; }
    .navbar .ms-auto > .text-muted { font-size: .8rem; }
    .navbar .ms-auto > .text-muted .username { display: none; }   /* keep the icon + Logout, drop the long name */
    .content-wrapper { padding: 1rem !important; }
}

/* Belt-and-braces: never let a stray wide child scroll the whole page sideways. */
html, body { max-width: 100%; overflow-x: hidden; }

/* ── Document letterhead (invoices / receipts / reports) ──────── */
.doc-header {
    display: flex; align-items: center; gap: 16px;
    padding-bottom: 14px; margin-bottom: 18px;
    border-bottom: 2px solid var(--brand);
}
.doc-logo { max-height: 64px; max-width: 160px; object-fit: contain; }
.doc-biz-name { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.doc-biz-meta { font-size: 0.85rem; color: var(--muted); }
.doc-title {
    text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
    color: var(--brand-600); font-size: 0.95rem;
}
.doc-meta-table td { padding: 3px 0; font-size: .9rem; }
.doc-meta-table td:first-child { color: var(--muted); padding-right: 14px; }

/* ── Print ───────────────────────────────────────────────────── */
@media print {
    .sidebar, .navbar, .d-print-none, .btn, #sidebarToggle { display: none !important; }
    .main-content { margin-left: 0 !important; }
    body { background: #fff !important; }
    body, .card, .card-body { color: #000 !important; }
    .content-wrapper { padding: 0 !important; animation: none !important; }
    .card { box-shadow: none !important; border: none !important; }
    .card-header { background: #fff !important; }
    a { text-decoration: none !important; color: #000 !important; }
    .doc-header { border-bottom: 2px solid #000; }
    .doc-biz-name, .doc-title { color: #000 !important; }
    .table td, .table th { border-color: #ccc !important; }

    /* No dark / coloured fills on print — save toner. Emphasis via borders + bold. */
    .table-dark, .table-dark > *, tr.table-dark > *,
    .table-light, tr.table-light > *,
    .table th, .pnl-total td, .bs-total td, .pnl-section td, .kpi-card, .bg-dark {
        background: #fff !important;
        color: #000 !important;
    }
    .table-dark > *, tr.table-dark > * { border-top: 2px solid #000 !important; font-weight: 700; }
    .pnl-total td, .pnl-net td, .bs-total td, .pnl-subtotal td, .bs-subtotal td { border-color: #000 !important; }
    .kpi-card { border: 1px solid #000 !important; box-shadow: none !important; }
    .kpi-card::before, .kpi-card::after { display: none !important; }
    .badge, .pay-badge, .stock-badge, .date-badge {
        background: #fff !important; color: #000 !important; border: 1px solid #777 !important; font-weight: 600;
    }
    @page { margin: 14mm; }
}
.form-control:disabled, .form-control[readonly],
.form-select:disabled, .form-select[readonly] {
    background-color: var(--input-disabled);
    box-shadow: none;
    opacity: 1;
}

.modal-content{pointer-events:auto;z-index:1060}
.modal-backdrop{z-index:1055}

.nav-group-toggle{width:calc(100%-20px);margin:8px 10px 2px;padding:9px 12px;background:transparent;border:none;color:rgba(255,255,255,.34);text-align:left;font-size:0.66rem;font-weight:600;text-transform:uppercase;letter-spacing:1.4px;cursor:pointer;display:flex;align-items:center;gap:6px;transition:color .16s;list-style:none}.nav-group-toggle i{font-size:0.6rem;transition:transform .2s}.nav-group-toggle:hover{color:rgba(255,255,255,.7)}.nav-group.open>.nav-group-toggle i{transform:rotate(90deg);color:var(--brand)}.nav-group.open>.nav-group-toggle{color:rgba(255,255,255,.6)}.nav-group-items{list-style:none;max-height:0;overflow:hidden;transition:max-height .25s ease;padding:0;margin:0}.nav-group.open>.nav-group-items{max-height:800px}

/* ── Final overrides (win over the duplicated/minified rules above) ── */
.nav-group-toggle,
.nav-group.open > .nav-group-toggle { color: #ffffff !important; }
.nav-group-toggle:hover { color: #ffffff !important; }
.modal { z-index: 1060 !important; }
.modal-backdrop { z-index: 1050 !important; }
.content-wrapper { animation: none !important; }

/* ══════════════════════════════════════════════════════════════
   BEAUTY VIEW  —  toggled from Settings → Business → Interface Style
   (all rules scoped under html[data-ui="beauty"]; Simple view is
   the untouched default. Works in light & dark.)
   ══════════════════════════════════════════════════════════════ */

/* Atmospheric, graphic page background */
html[data-ui="beauty"] body {
    background:
        radial-gradient(1100px 560px at 100% -12%, rgba(16,185,129,.14), transparent 60%),
        radial-gradient(900px 520px at -12% 112%, rgba(59,130,246,.10), transparent 55%),
        var(--bg);
    background-attachment: fixed;
}

/* Sidebar: deep gradient + glowing active pill + icon chips */
html[data-ui="beauty"] .sidebar {
    background: linear-gradient(180deg, #0f2f24 0%, #0c1b2c 55%, #0a1424 100%) !important;
    box-shadow: 6px 0 30px rgba(0,0,0,.28);
}
html[data-ui="beauty"] .sidebar .nav-link { border-radius: 10px; margin: 2px 8px; }
html[data-ui="beauty"] .sidebar .nav-link > i {
    display: inline-flex; width: 27px; height: 27px; margin-right: 8px;
    align-items: center; justify-content: center;
    background: rgba(255,255,255,.07); border-radius: 8px;
    transition: background .15s, color .15s;
}
html[data-ui="beauty"] .sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(16,185,129,.32), rgba(16,185,129,.06));
    box-shadow: inset 0 0 0 1px rgba(16,185,129,.45), 0 6px 18px rgba(16,185,129,.18);
}
html[data-ui="beauty"] .sidebar .nav-link.active > i { background: var(--brand); color: #fff; }
html[data-ui="beauty"] .sidebar-brand {
    background: linear-gradient(90deg, rgba(16,185,129,.18), transparent);
}

/* Page heading icon → gradient chip */
html[data-ui="beauty"] .content-wrapper > h4 > i:first-child,
html[data-ui="beauty"] .content-wrapper > .d-flex h4 > i:first-child {
    display: inline-flex; width: 40px; height: 40px; vertical-align: -12px;
    align-items: center; justify-content: center; margin-right: 8px;
    background: linear-gradient(135deg, var(--brand), #34d399);
    color: #fff; border-radius: 12px; font-size: 1.15rem;
    box-shadow: 0 8px 20px rgba(16,185,129,.35);
}

/* Cards: soft depth + hover lift + gradient header accent */
html[data-ui="beauty"] .card {
    border: 1px solid rgba(16,185,129,.12);
    box-shadow: 0 12px 34px -14px rgba(16,24,40,.22);
    transition: transform .18s ease, box-shadow .18s ease;
}
html[data-ui="beauty"] .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 46px -16px rgba(16,24,40,.32);
}
html[data-ui="beauty"] .card-header {
    background: linear-gradient(90deg, rgba(16,185,129,.12), transparent 70%);
    border-bottom: 1px solid rgba(16,185,129,.16);
    font-weight: 700;
}

/* KPI / stat cards: glow + lively hover */
html[data-ui="beauty"] .kpi-card,
html[data-ui="beauty"] .stat-card {
    box-shadow: 0 16px 38px -14px rgba(16,24,40,.38);
    transition: transform .18s ease, box-shadow .18s ease;
}
html[data-ui="beauty"] .kpi-card:hover,
html[data-ui="beauty"] .stat-card:hover { transform: translateY(-4px) scale(1.012); }

/* Buttons: gradient + soft shadow */
html[data-ui="beauty"] .btn-primary {
    background-image: linear-gradient(135deg, var(--brand), #34d399);
    border: 0; box-shadow: 0 7px 18px rgba(16,185,129,.30);
}
html[data-ui="beauty"] .btn-success {
    background-image: linear-gradient(135deg, #15a34a, #22c55e);
    border: 0; box-shadow: 0 7px 18px rgba(34,197,94,.30);
}
html[data-ui="beauty"] .btn { transition: transform .12s ease, box-shadow .12s ease; }
html[data-ui="beauty"] .btn:hover { transform: translateY(-1px); }

/* Tables: tinted header + soft rounding */
html[data-ui="beauty"] .table thead th {
    background: rgba(16,185,129,.07);
    border-bottom: 2px solid rgba(16,185,129,.20);
}

/* Modals: gradient header + deep shadow */
html[data-ui="beauty"] .modal-content { box-shadow: 0 34px 90px -22px rgba(0,0,0,.55); }
html[data-ui="beauty"] .modal-header {
    background: linear-gradient(90deg, rgba(16,185,129,.14), transparent 75%);
}

/* Nav tabs (Settings) accent */
html[data-ui="beauty"] .nav-tabs .nav-link.active {
    box-shadow: inset 0 -3px 0 var(--brand);
    font-weight: 700;
}

/* Topbar quick-action chips a touch bolder */
html[data-ui="beauty"] .navbar { box-shadow: 0 3px 16px rgba(16,24,40,.07); }

/* Section (nav-group) headings get a subtle brand tint */
html[data-ui="beauty"] .nav-group-toggle { letter-spacing: .04em; }

/* ──────────────────────────────────────────────────────────────
   FUEL CONTROL PANEL — the Beauty dashboard hero.
   Reads like a dispenser's instrument cluster: one dominant
   petroleum-ink slab, emerald accent, mono digits.
   ────────────────────────────────────────────────────────────── */
.fuel-hero {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px;
    padding: 26px 28px;
    border-radius: 20px;
    background:
        radial-gradient(720px 300px at 8% -30%, rgba(16,185,129,.28), transparent 62%),
        linear-gradient(135deg, #0d2a20 0%, #0b1b2c 52%, #0a1322 100%);
    box-shadow: 0 26px 60px -22px rgba(4,12,10,.75), inset 0 1px 0 rgba(255,255,255,.06);
    color: #e8f2ec;
    animation: fhIn .5s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes fhIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* faint engineering grid — texture, not decoration for its own sake */
.fuel-hero .fh-grid {
    position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(680px 320px at 88% 120%, #000, transparent 70%);
    -webkit-mask-image: radial-gradient(680px 320px at 88% 120%, #000, transparent 70%);
}
.fuel-hero .fh-main, .fuel-hero .fh-side { position: relative; z-index: 1; }

.fh-eyebrow {
    display: flex; align-items: center; gap: 8px;
    font-size: .78rem; font-weight: 600; letter-spacing: .04em;
    color: rgba(232,242,236,.62); text-transform: uppercase;
}
.fh-dot { width: 4px; height: 4px; border-radius: 50%; background: rgba(232,242,236,.4); }

.fh-label {
    margin-top: 16px; font-size: .72rem; font-weight: 700;
    letter-spacing: .16em; text-transform: uppercase; color: var(--brand);
}
/* the dispenser readout */
.fh-readout {
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: clamp(2.1rem, 4.6vw, 3.4rem);
    font-weight: 600; line-height: 1.04; margin-top: 4px;
    color: #fff; letter-spacing: -.02em;
    text-shadow: 0 0 34px rgba(16,185,129,.45);
    font-variant-numeric: tabular-nums;
}

.fh-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.fh-chip {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 4px 11px; border-radius: 999px;
    font-size: .76rem; font-weight: 600;
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.10);
}
.fh-chip-up   { color: #6ee7b7; background: rgba(16,185,129,.16); border-color: rgba(16,185,129,.34); }
.fh-chip-down { color: #fca5a5; background: rgba(239,68,68,.14);  border-color: rgba(239,68,68,.30); }
.fh-chip-mute { color: rgba(232,242,236,.62); }

.fh-split { display: inline-flex; align-items: center; gap: 8px; }
.fh-split-bar {
    width: 92px; height: 6px; border-radius: 999px;
    background: rgba(255,255,255,.13); overflow: hidden;
}
.fh-split-bar i {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), #6ee7b7);
}
.fh-split-txt { font-size: .74rem; color: rgba(232,242,236,.66); font-weight: 600; }

/* right column: date nav + secondary meters */
.fh-side { display: flex; flex-direction: column; gap: 14px; }
.fh-datenav { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.fh-nav, .fh-today {
    display: inline-flex; align-items: center; justify-content: center;
    height: 32px; min-width: 32px; padding: 0 10px;
    border-radius: 9px; text-decoration: none;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
    color: #e8f2ec; transition: background .15s, transform .12s;
}
.fh-nav:hover, .fh-today:hover { background: rgba(255,255,255,.16); color: #fff; transform: translateY(-1px); }
.fh-nav.is-off { opacity: .35; pointer-events: none; }
.fh-today { background: var(--brand); border-color: transparent; font-size: .78rem; font-weight: 700; }
.fh-date {
    height: 32px; padding: 0 10px; border-radius: 9px;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
    color: #e8f2ec; font-size: .8rem; font-weight: 600; text-align: center;
    font-family: var(--font-mono, monospace);
}
.fh-date::-webkit-calendar-picker-indicator { filter: invert(1) opacity(.65); cursor: pointer; }

.fh-meters { display: grid; gap: 8px; margin-top: auto; }
.fh-meter {
    display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 10px;
    padding: 10px 14px; border-radius: 12px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    border-left: 3px solid rgba(255,255,255,.18);
}
.fh-m-label { font-size: .76rem; color: rgba(232,242,236,.66); font-weight: 600; }
.fh-m-label small { opacity: .6; font-weight: 500; }
.fh-m-value {
    font-family: var(--font-mono, monospace); font-size: 1.02rem; font-weight: 600;
    color: #fff; font-variant-numeric: tabular-nums; text-align: right;
}
.fh-m-sub { grid-column: 1 / -1; font-size: .7rem; color: rgba(232,242,236,.45); }
.fh-meter.is-good { border-left-color: var(--brand); }
.fh-meter.is-good .fh-m-value { color: #6ee7b7; }
.fh-meter.is-bad  { border-left-color: #ef4444; }
.fh-meter.is-bad  .fh-m-value { color: #fca5a5; }

@media (max-width: 991px) {
    .fuel-hero { grid-template-columns: 1fr; gap: 18px; padding: 22px; }
    .fh-datenav { justify-content: flex-start; }
}

/* ──────────────────────────────────────────────────────────────
   TANK DIP GAUGES — vertical, like the real dip sticks
   ────────────────────────────────────────────────────────────── */
/* flex-start so every tube shares one baseline even when a product name wraps */
.gauge-row { display: flex; gap: 8px; align-items: flex-start; justify-content: space-around; padding: 4px 0 2px; }
/* wide variant — for full-width cards (e.g. Dip Reading) where there's room to breathe.
   Centred so a 2–4 tank strip doesn't leave a lopsided gap; still wraps if there are many. */
.gauge-row-wide { justify-content: center; gap: 34px; flex-wrap: wrap; }
.gauge-row-wide .gauge { flex: 0 0 auto; width: 112px; }
.gauge { text-align: center; flex: 1; min-width: 0; }
.gauge-tube {
    position: relative; height: 148px; width: 46px; margin: 0 auto 10px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(15,23,42,.10), rgba(15,23,42,.18));
    border: 1px solid var(--border);
    box-shadow: inset 0 2px 8px rgba(16,24,40,.22);
    overflow: hidden;
}
/* measurement ticks */
.gauge-tube::before {
    content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
    background-image: repeating-linear-gradient(180deg,
        rgba(15,23,42,.16) 0 1px, transparent 1px 25%);
}
.gauge-fill {
    position: absolute; left: 0; right: 0; bottom: 0; height: 0;
    border-radius: 0 0 11px 11px;
    background: linear-gradient(180deg, #34d399, #059669);
    box-shadow: 0 -6px 18px rgba(16,185,129,.45);
    animation: gaugeRise .9s cubic-bezier(.2,.8,.25,1) .15s forwards;
}
@keyframes gaugeRise { to { height: var(--lvl); } }
/* liquid surface highlight */
.gauge-fill::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: rgba(255,255,255,.55);
}
.gauge-mid  .gauge-fill { background: linear-gradient(180deg, #fbbf24, #d97706); box-shadow: 0 -6px 18px rgba(245,158,11,.45); }
.gauge-low  .gauge-fill { background: linear-gradient(180deg, #f87171, #dc2626); box-shadow: 0 -6px 18px rgba(239,68,68,.45); }
.gauge-low  .gauge-tube { border-color: rgba(239,68,68,.5); }
.gauge-pct {
    position: absolute; inset: 0; z-index: 3;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono, monospace); font-size: .82rem; font-weight: 700;
    color: var(--text); text-shadow: 0 1px 3px rgba(255,255,255,.7);
}
.gauge-pct small { font-size: .62rem; opacity: .7; }
[data-theme="dark"] .gauge-pct { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
[data-theme="dark"] .gauge-tube::before { background-image: repeating-linear-gradient(180deg, rgba(255,255,255,.14) 0 1px, transparent 1px 25%); }
.gauge-name { font-size: .8rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.gauge-sub  { font-family: var(--font-mono, monospace); font-size: .62rem; color: var(--muted); white-space: nowrap; }
.gauge-sub span { opacity: .6; }
.gauge-prod { font-size: .62rem; line-height: 1.25; color: var(--muted-2, var(--muted)); margin-top: 4px; }

/* Dip marker — where the physical dip says the fuel actually is.
   Sits above the fill so it reads as a measured line across the tube. */
.gauge-dip {
    position: absolute; left: -1px; right: -1px; z-index: 3;
    height: 0; border-top: 2px dashed #0f172a;
    opacity: .78; pointer-events: none;
}
.gauge-dip::after {
    content: ''; position: absolute; right: -1px; top: -3px;
    border: 4px solid transparent; border-right-color: #0f172a;
}
[data-theme="dark"] .gauge-dip { border-top-color: #e2e8f0; }
[data-theme="dark"] .gauge-dip::after { border-right-color: #e2e8f0; }

/* Dip readout under each gauge: dip cm + variance vs book.
   Single nowrap line — the column is ~90px, so it must never wrap. */
.gauge-dipinfo {
    display: inline-flex; align-items: center; gap: 3px;
    justify-content: center; margin-top: 5px; max-width: 100%;
    padding: 2px 6px; border-radius: 999px; white-space: nowrap;
    font-family: var(--font-mono, monospace); font-size: .6rem; font-weight: 600;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.gauge-dipinfo .gd-var { font-weight: 700; }
.gauge-dipinfo .gd-sep { opacity: .45; }
.gauge-stale {
    margin-top: 3px; font-size: .58rem; color: var(--muted-2, var(--muted));
    opacity: .8; white-space: nowrap;
}
.gauge-dipinfo.is-ok    { color: #059669; border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.08); }
.gauge-dipinfo.is-short { color: #dc2626; border-color: rgba(239,68,68,.35);  background: rgba(239,68,68,.08); }
.gauge-dipinfo.is-over  { color: #d97706; border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.08); }
.gauge-dipinfo.is-none  { opacity: .6; font-style: italic; font-weight: 500; }
.gauge-dipinfo .gd-stale {
    padding: 0 4px; border-radius: 4px; font-size: .58rem;
    background: rgba(148,163,184,.25); color: var(--muted);
}
[data-theme="dark"] .gauge-dipinfo.is-ok    { color: #6ee7b7; }
[data-theme="dark"] .gauge-dipinfo.is-short { color: #fca5a5; }
[data-theme="dark"] .gauge-dipinfo.is-over  { color: #fcd34d; }

/* ── Top bar: everything on ONE line on desktop ────────────────────────────
   Quick actions shrink (tighter padding / font) instead of pushing the pump /
   theme / user cluster onto a second row. Phones keep the wrapping rules above. */
@media (min-width: 992px) {
    .navbar { flex-wrap: nowrap; }
    .navbar > .d-flex:first-child { min-width: 0; flex-shrink: 1; }
    .navbar .ms-auto { flex-shrink: 0; gap: .6rem !important; white-space: nowrap; }
    .quick-actions { gap: .4rem !important; flex-wrap: nowrap; }
    .quick-actions .btn, .navbar .ms-auto .btn { white-space: nowrap; padding: .25rem .6rem; font-size: .82rem; }
}
/* Narrow desktops: drop the quick-action labels to icons, and the long user name */
@media (min-width: 992px) and (max-width: 1399.98px) {
    .navbar .ms-auto > .text-muted .username { display: none; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    .quick-actions > a.btn .qa-label { display: none; }
}

/* New Sale: opens its Single / Bulk menu on hover as well as click. No gap
   between button and menu, so the pointer can travel into it. */
.qa-hover > .dropdown-menu { margin-top: 0 !important; top: 100%; left: 0; }
@media (hover: hover) {
    .qa-hover:hover > .dropdown-menu { display: block; }
}
