/* PetroStation Pro — application styles (layered on Bootstrap 5.3) */

@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(../vendor/inter/inter-400.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(../vendor/inter/inter-500.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(../vendor/inter/inter-600.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(../vendor/inter/inter-700.woff2) format("woff2"); }

:root {
    --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --primary: #2563eb; --primary-600: #1d4ed8; --primary-50: #eff6ff;
    --accent: #f59e0b;
    --success: #16a34a; --warning: #d97706; --danger: #dc2626; --info: #0891b2;
    --bg: #f4f6fb; --surface: #ffffff; --surface-2: #f8fafc; --border: #e5e9f2;
    --text: #0f172a; --muted: #64748b; --soft: #94a3b8;
    --sidebar: #0b1324; --sidebar-2: #111c33; --sidebar-text: #aab5cc; --sidebar-active: #ffffff;
    --shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.06);
    --radius: 14px; --sidebar-w: 264px;
    --bs-body-font-family: var(--font);
    --bs-primary: #2563eb; --bs-primary-rgb: 37,99,235;
}
:root[data-theme="dark"] {
    --bg: #0b1120; --surface: #111a2e; --surface-2: #0f172a; --border: #1f2a44;
    --text: #e2e8f0; --muted: #94a3b8; --soft: #64748b; --primary-50: #172554;
    --sidebar: #070d1a; --sidebar-2: #0d162b;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
.text-muted { color: var(--muted) !important; }

/* ── Shell ─────────────────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2)); color: var(--sidebar-text);
    position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1040; transition: transform .25s ease; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-brand img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: #fff; padding: 4px; }
.sidebar-brand strong { display: block; font-size: 14px; line-height: 1.2; color: #fff; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-brand small { color: #7f8bab; font-size: 11px; letter-spacing: .02em; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 10px 16px; scrollbar-width: thin; scrollbar-color: #26324d transparent; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #5f6c8a; padding: 16px 10px 6px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--sidebar-text); font-weight: 500; font-size: 13.5px; margin-bottom: 1px; }
.nav-item i { font-size: 18px; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { background: rgba(37,99,235,.22); color: var(--sidebar-active); box-shadow: inset 3px 0 0 var(--primary); }
.nav-item span { flex: 1; }
.nav-item.gated { opacity: .5; }
.nav-item .nav-lock { font-size: 13px; opacity: .8; }
.nav-badge { font-style: normal; background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; border-radius: 20px; padding: 1px 7px; min-width: 22px; text-align: center; }
.nav-badge.warn { background: var(--accent); color: #1c1300; }
.sidebar-foot { padding: 10px 18px; font-size: 11px; color: #4b5877; border-top: 1px solid rgba(255,255,255,.05); }
.sidebar-backdrop { display: none; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1030; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 24px;
    background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-date { color: var(--muted); font-size: 13px; font-weight: 500; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
    display: inline-flex; align-items: center; justify-content: center; font-size: 19px; }
.icon-btn:hover { background: var(--surface-2); }
.dot-badge { position: absolute; top: -5px; right: -5px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 5px; border: 2px solid var(--surface); }
.branch-pill { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--primary-50); color: var(--primary); font-weight: 600; font-size: 13px; max-width: 260px; }
.branch-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.branch-pill.static { cursor: default; }
.user-chip { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px 6px; border-radius: 10px; color: var(--text); }
.user-chip:hover { background: var(--surface-2); }
.user-chip strong { display: block; font-size: 13px; line-height: 1.2; }
.user-chip small { color: var(--muted); font-size: 11.5px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #7c3aed); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }

.content { padding: 24px; flex: 1; position: relative; }
.app-foot { display: flex; justify-content: space-between; padding: 14px 24px; color: var(--soft); font-size: 12px; border-top: 1px solid var(--border); }

/* Setup banner */
.setup-banner { display: flex; align-items: center; gap: 14px; margin: 16px 24px 0; padding: 12px 16px; border-radius: 12px;
    background: linear-gradient(90deg, #fff7e6, #fffbeb); border: 1px solid #fde68a; color: #78350f; }
:root[data-theme="dark"] .setup-banner { background: #2a1f05; border-color: #5c4511; color: #fcd34d; }
.setup-banner > i { font-size: 22px; color: var(--accent); }
.setup-banner span { font-size: 13px; }
.setup-banner-bar { flex: 0 0 140px; height: 8px; border-radius: 6px; background: rgba(217,119,6,.18); overflow: hidden; margin-left: auto; }
.setup-banner-bar span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.setup-banner-cta { font-weight: 700; white-space: nowrap; }
.setup-banner:hover { color: #78350f; filter: brightness(.98); }

/* Subscription banner & plan */
.sub-banner { display: flex; align-items: center; gap: 12px; margin: 16px 24px 0; padding: 12px 16px; border-radius: 12px; border: 1px solid; font-size: 13px; }
.sub-banner > i { font-size: 20px; }
.sub-banner span { flex: 1; }
.sub-banner .sub-banner-cta { flex: 0 0 auto; font-weight: 700; white-space: nowrap; }
.sub-banner-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.sub-banner-warning { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.sub-banner-danger { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.sub-banner:hover { filter: brightness(.98); }
.sub-banner-info:hover { color: #1e3a8a; } .sub-banner-warning:hover { color: #78350f; } .sub-banner-danger:hover { color: #7f1d1d; }
:root[data-theme="dark"] .sub-banner-info { background: #0f1f3d; border-color: #1e3a8a; color: #bfdbfe; }
:root[data-theme="dark"] .sub-banner-warning { background: #2a1f05; border-color: #5c4511; color: #fcd34d; }
:root[data-theme="dark"] .sub-banner-danger { background: #2a0f12; border-color: #7f1d1d; color: #fecaca; }
.sidebar-plan { display: flex; align-items: center; gap: 6px; color: #c7d2fe; font-weight: 600; font-size: 12px; margin-bottom: 4px; }
.sidebar-plan i { color: var(--accent); }
.plan-card { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 22px; height: 100%; display: flex; flex-direction: column; position: relative; box-shadow: var(--shadow); }
.plan-card.current { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12), var(--shadow); }
.plan-card.featured::before { content: "Most popular"; position: absolute; top: -11px; left: 22px; background: var(--accent); color: #1c1300; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.plan-name { font-size: 17px; font-weight: 700; }
.plan-price { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 2px; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.plan-limit { font-weight: 600; color: var(--primary); margin-bottom: 10px; }
.plan-card ul { list-style: none; padding: 0; margin: 0 0 18px; flex: 1; }
.plan-card li { padding: 4px 0; font-size: 13.5px; }
.plan-card li i { color: var(--success); margin-right: 6px; }
.wallet-tile { border-radius: 14px; padding: 18px; background: linear-gradient(135deg, #0b1324, #1e3a8a 70%, #2563eb); color: #fff; }
.wallet-tile .label { color: #c7d2fe; font-size: 12.5px; }
.wallet-tile .amount { font-size: 26px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a, .seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg .active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.usage-bar { height: 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--primary); }
.usage-bar.full span { background: var(--danger); }

/* Waybill document */
.waybill-box { border: 1px dashed var(--border); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.waybill-thumb { width: 72px; height: 72px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; font-size: 30px; color: var(--soft); }
.waybill-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.waybill-preview { width: 100%; max-height: 320px; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); cursor: zoom-in; }

/* Sign-in notification pop-up */
.notif-pop-bell { position: relative; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: #fef3c7; color: #b45309; flex-shrink: 0; animation: notif-ring 1.6s ease-in-out 2; }
.notif-pop-bell em { position: absolute; top: -6px; right: -8px; font-style: normal; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; border-radius: 12px; padding: 1px 7px; border: 2px solid var(--surface); }
#notifPopup .action-item small + small { margin-top: 2px; font-size: 11.5px; }
@keyframes notif-ring { 0%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } 50% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .notif-pop-bell { animation: none; } }

/* Notifications dropdown */
.notif-menu { width: 380px; max-width: 92vw; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-setup { display: block; padding: 12px 16px; background: #fffbeb; border-bottom: 1px solid #fde68a; color: #78350f; }
:root[data-theme="dark"] .notif-setup { background: #2a1f05; border-color: #5c4511; color: #fcd34d; }
.notif-setup .progress-bar { background: var(--accent); }
.notif-setup-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 150px; overflow-y: auto; }
.notif-setup-list li { font-size: 12.5px; padding: 3px 0; display: flex; gap: 6px; align-items: baseline; }
.notif-setup-list li span { margin-left: auto; color: #a16207; font-size: 11.5px; text-align: right; }
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-item { display: block; padding: 11px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif-item.unread { background: var(--primary-50); }
.notif-item:hover { background: var(--surface-2); color: var(--text); }
.notif-title { font-weight: 600; font-size: 13px; }
.notif-body { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.notif-time { color: var(--soft); font-size: 11px; margin-top: 3px; }
.notif-foot { display: block; text-align: center; padding: 10px; font-weight: 600; font-size: 13px; }

/* Page head */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.page-sub { color: var(--muted); margin: 4px 0 0; max-width: 780px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--primary); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-header h5, .card-title { font-size: 15px; font-weight: 650; margin: 0; }
.card-body { padding: 18px; }
.card-footer { background: var(--surface-2); border-top: 1px solid var(--border); padding: 12px 18px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; margin: 0 0 10px; }

/* KPI tiles */
.kpi { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); height: 100%; }
.kpi-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.kpi-primary .kpi-icon { background: #dbeafe; color: #1d4ed8; }
.kpi-success .kpi-icon { background: #dcfce7; color: #15803d; }
.kpi-warning .kpi-icon { background: #fef3c7; color: #b45309; }
.kpi-danger  .kpi-icon { background: #fee2e2; color: #b91c1c; }
.kpi-info    .kpi-icon { background: #cffafe; color: #0e7490; }
.kpi-violet  .kpi-icon { background: #ede9fe; color: #6d28d9; }
:root[data-theme="dark"] .kpi-icon { filter: saturate(1.2) brightness(.85); }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi-body { min-width: 0; flex: 1; }
.kpi-value { font-size: clamp(16px, 0.9vw + 8px, 21px); font-weight: 700; letter-spacing: -.01em; margin-top: 2px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-foot { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Badges & chips */
.badge-soft { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-soft-success { background: #dcfce7; color: #166534; }
.badge-soft-warning { background: #fef3c7; color: #92400e; }
.badge-soft-danger  { background: #fee2e2; color: #991b1b; }
.badge-soft-info    { background: #cffafe; color: #155e75; }
.badge-soft-primary { background: #dbeafe; color: #1e40af; }
.badge-soft-secondary { background: #e2e8f0; color: #334155; }
:root[data-theme="dark"] .badge-soft { filter: brightness(.85) saturate(1.3); }
/* Product colour slots — the validated chart palette (see assets/js/charts.js). */
:root { --slot-1: #2a78d6; --slot-2: #eb6834; --slot-3: #1baf7a; --slot-other: #a3a29b; }
:root[data-theme="dark"] { --slot-1: #3987e5; --slot-2: #d95926; --slot-3: #199e70; --slot-other: #6b6b66; }
.fuel-chip.slot-1 { --chip: var(--slot-1); } .fuel-chip.slot-2 { --chip: var(--slot-2); }
.fuel-chip.slot-3 { --chip: var(--slot-3); } .fuel-chip.slot-other { --chip: var(--slot-other); }
.fuel-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; padding: 2px 10px; border-radius: 20px;
    background: color-mix(in srgb, var(--chip) 12%, transparent); color: var(--text); border: 1px solid color-mix(in srgb, var(--chip) 35%, transparent); }
.fuel-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--chip); }
.chart-box { min-height: 300px; }

/* Tables */
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); margin: 0; }
.table > :not(caption) > * > * { border-bottom-color: var(--border); padding: .7rem .8rem; }
.table thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; background: var(--surface-2); white-space: nowrap; }
.table tbody tr:hover { background: var(--surface-2); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--surface-2); }
.table-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.table-search { max-width: 260px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }

/* Forms */
.form-label { font-weight: 600; font-size: 13px; margin-bottom: 5px; color: var(--text); }
.form-control, .form-select { border-color: var(--border); border-radius: 9px; background-color: var(--surface); color: var(--text); }
.form-control:focus, .form-select:focus { border-color: #93c5fd; box-shadow: 0 0 0 .2rem rgba(37,99,235,.12); background-color: var(--surface); color: var(--text); }
.form-control::placeholder { color: var(--soft); opacity: 1; }
.input-group-text { background-color: var(--surface-2); border-color: var(--border); color: var(--muted); }
.form-control[readonly] { background: var(--surface-2); }
.form-text { color: var(--muted); font-size: 12px; }
.btn { border-radius: 9px; font-weight: 600; font-size: 13.5px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-light { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-soft-danger { background: #fee2e2; color: #b91c1c; border: 0; }
.btn-soft-danger:hover { background: #fecaca; color: #991b1b; }
.btn-soft-primary { background: #dbeafe; color: #1d4ed8; border: 0; }
.btn-soft-primary:hover { background: #bfdbfe; color: #1e40af; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--soft); font-size: 17px; }
.input-icon > .form-control { padding-left: 40px; }
.input-icon-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--soft); font-size: 18px; }
.required::after { content: " *"; color: var(--danger); }
.form-section { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface-2); margin-bottom: 16px; }
.form-section-title { font-weight: 700; font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* Filter bar */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.filter-field { display: flex; flex-direction: column; gap: 3px; min-width: 140px; }
.filter-field label { font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state > i { font-size: 44px; color: var(--soft); display: block; margin-bottom: 8px; }
.empty-state h6 { color: var(--text); font-weight: 650; }
.empty-state p { max-width: 420px; margin: 0 auto 14px; }

/* Toasts */
.toast-stack { position: fixed; top: 76px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.app-toast { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary);
    border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(15,23,42,.15); animation: toast-in .25s ease; font-weight: 500; }
.app-toast i { font-size: 20px; }
.app-toast span { flex: 1; }
.app-toast button { border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--soft); }
.app-toast-success { border-left-color: var(--success); } .app-toast-success i { color: var(--success); }
.app-toast-danger { border-left-color: var(--danger); } .app-toast-danger i { color: var(--danger); }
.app-toast-warning { border-left-color: var(--warning); } .app-toast-warning i { color: var(--warning); }
.app-toast-info i { color: var(--primary); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.confirm-icon { width: 60px; height: 60px; border-radius: 50%; background: var(--primary-50); color: var(--primary); font-size: 30px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }

/* Setup Center */
.setup-hero { background: linear-gradient(120deg, #0b1324 0%, #1e3a8a 60%, #2563eb 100%); color: #fff; border-radius: 18px; padding: 26px 28px; position: relative; overflow: hidden; margin-bottom: 22px; }
.setup-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: rgba(245,158,11,.22); }
.setup-hero h2 { font-size: 22px; font-weight: 700; margin: 0 0 6px; position: relative; z-index: 1; }
.setup-hero p { color: #c7d2fe; margin: 0; max-width: 640px; position: relative; z-index: 1; }
.setup-ring { position: relative; z-index: 1; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255,255,255,.14) 0); }
.setup-ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: #13235a; }
.setup-ring span { position: relative; font-size: 26px; font-weight: 800; }
.setup-ring small { display: block; font-size: 11px; font-weight: 500; color: #c7d2fe; text-align: center; }
.setup-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; position: relative; z-index: 1; }
.setup-meta div { background: rgba(255,255,255,.08); border-radius: 10px; padding: 8px 14px; font-size: 13px; }
.setup-meta strong { font-size: 16px; display: block; }
.step-list { display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.step-no { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; background: var(--surface-2); color: var(--muted); border: 2px solid var(--border); }
.step.done .step-no { background: var(--success); border-color: var(--success); color: #fff; }
.step.current { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37,99,235,.10), var(--shadow); }
.step.current .step-no { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.locked { opacity: .62; }
.step-icon { font-size: 20px; color: var(--primary); }
.step-main { flex: 1; min-width: 0; }
.step-title { font-weight: 650; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.step-summary { font-size: 12.5px; margin-top: 6px; font-weight: 600; }
.step.done .step-summary { color: var(--success); }
.step-issues { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: #b45309; }
.step-bar { height: 5px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-top: 8px; max-width: 320px; }
.step-bar span { display: block; height: 100%; background: var(--primary); }
.step.done .step-bar span { background: var(--success); }
.step-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* Report form */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.calc-cell { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.calc-cell label { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.calc-cell .v { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.calc-cell.good .v { color: var(--success); } .calc-cell.bad .v { color: var(--danger); }
.pump-card, .tank-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface); margin-bottom: 12px; }
.pump-card-head, .tank-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-weight: 700; }
/* Pumps with more than one meter (two-sided pumps) */
.side-tag { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; line-height: 1; }
.pump-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--primary-50); color: var(--primary); font-size: 15px; margin-right: 8px; vertical-align: middle; }
.pump-group-card { border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 12px; padding: 12px 14px 2px; background: var(--surface-2); }
.pump-group-card .pump-card { margin-bottom: 12px; }
.pump-group-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.pump-table .pump-group-head td { background: var(--surface-2); border-top: 2px solid var(--border); padding-top: 9px; padding-bottom: 9px; }
.pump-table .pump-group + .pump-group .pump-group-head td { border-top-width: 6px; border-top-color: var(--surface); }
.pump-table .pump-group-head form { margin: 0; }
.pump-subtotal td { background: var(--surface-2); font-weight: 650; }
.meter-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.meter-kind { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 12px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.meter-kind strong { font-size: 14px; }
.meter-kind small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.meter-kind-ic { display: flex; gap: 2px; margin-bottom: 6px; color: var(--muted); font-size: 20px; }
.btn-check:checked + .meter-kind { border-color: var(--primary); background: var(--primary-50); }
.btn-check:checked + .meter-kind .meter-kind-ic { color: var(--primary); }
.btn-check:focus-visible + .meter-kind { outline: 3px solid rgba(37,99,235,.35); outline-offset: 2px; }
.meter-preview { border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; background: var(--surface-2); overflow-wrap: anywhere; }
.side-diagram { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 14px; }
.side-box { border: 1.5px solid var(--border); border-radius: 10px; padding: 9px 10px; text-align: center; background: var(--surface-2); }
.side-box small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.side-box strong { font-size: 15px; }
.side-box.side-new { border-color: var(--primary); background: var(--primary-50); }
.side-pump { display: flex; flex-direction: column; align-items: center; color: var(--primary); font-weight: 700; font-size: 12px; }
.side-pump i { font-size: 30px; line-height: 1; }
.ocr-box { font-size: 12.5px; margin-top: 6px; }
.sticky-summary { position: sticky; top: 76px; }
.totals-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.evidence-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; background: rgba(2,6,23,.9); display: flex; align-items: center; justify-content: center; z-index: 3000; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 8px; }

/* Tank gauge */
.tank-gauge { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.tank-gauge span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #60a5fa); }
.tank-gauge.low span { background: linear-gradient(90deg, var(--danger), #f87171); }

/* Permission matrix */
.perm-table th, .perm-table td { text-align: center; vertical-align: middle; }
.perm-table th:first-child, .perm-table td:first-child { text-align: left; }
.perm-group td { background: var(--surface-2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.perm-table .form-check-input { width: 1.15em; height: 1.15em; }

/* Auth */
.auth-body { background: var(--bg); }
.auth-shell { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-hero { background: radial-gradient(circle at 80% 10%, rgba(245,158,11,.25), transparent 40%), linear-gradient(140deg, #0b1324, #1e3a8a 70%, #2563eb); color: #fff; display: flex; align-items: center; padding: 48px; }
.auth-hero-inner { max-width: 520px; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 48px; }
.auth-logo { width: 52px; height: 52px; border-radius: 12px; background: #fff; padding: 6px; object-fit: contain; }
.auth-brand-name { font-weight: 700; font-size: 18px; }
.auth-brand-tag { color: #a5b4fc; font-size: 13px; }
.auth-headline { font-size: 38px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-bottom: 16px; }
.auth-lead { color: #c7d2fe; font-size: 16px; line-height: 1.6; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; }
.auth-points li { padding: 6px 0; color: #e0e7ff; }
.auth-points i { color: var(--accent); margin-right: 8px; }
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); }
.auth-title { font-weight: 800; font-size: 26px; margin-bottom: 4px; }
.auth-foot { color: var(--soft); font-size: 12px; margin-top: 18px; }

/* Misc */
.stat-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.stat-row:last-child { border-bottom: 0; }
.stat-row span:first-child { color: var(--muted); }
.stat-row strong { font-variant-numeric: tabular-nums; }
.action-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.action-item:last-child { border-bottom: 0; }
.action-item i { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--primary-50); color: var(--primary); flex-shrink: 0; }
.action-item.warn i { background: #fef3c7; color: #b45309; }
.action-item.danger i { background: #fee2e2; color: #b91c1c; }
.action-item div { flex: 1; }
.action-item small { color: var(--muted); display: block; }
.dropdown-menu { border-color: var(--border); border-radius: 12px; background: var(--surface); }
.dropdown-item { color: var(--text); font-size: 13.5px; }
.dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.modal-content { background: var(--surface); color: var(--text); border-radius: 16px; border-color: var(--border); }
.nav-tabs .nav-link { font-weight: 600; color: var(--muted); }
.nav-tabs .nav-link.active { color: var(--primary); background: var(--surface); border-color: var(--border) var(--border) var(--surface); }
.list-check { list-style: none; padding: 0; margin: 0; }
.list-check li { padding: 4px 0; }
.list-check i { color: var(--success); margin-right: 6px; }
.divider-label { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 12px; }
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(2,6,23,.5); z-index: 1035; }
    .main { margin-left: 0; }
    .topbar { padding: 0 14px; }
    .content { padding: 16px; }
    .setup-banner { margin: 12px 16px 0; flex-wrap: wrap; }
    .sub-banner { margin: 12px 16px 0; flex-wrap: wrap; }
    .setup-banner-bar { flex-basis: 100%; margin-left: 0; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .sticky-summary { position: static; }
}
.table td > a.fw-semibold, .table td > .fw-semibold:first-child { white-space: nowrap; }
@media (max-width: 430px) {
    .branch-pill span, [data-theme-toggle] { display: none; }
    .topbar-actions { gap: 6px; }
}
@media (max-width: 575.98px) {
    .step { flex-wrap: wrap; }
    .step-actions { width: 100%; justify-content: flex-end; }
    .page-title { font-size: 19px; }
    .kpi-value { font-size: 18px; }
    .branch-pill { max-width: 150px; }
}

/* Print */
@media print {
    .sidebar, .topbar, .setup-banner, .sub-banner, .app-foot, .page-actions, .filter-bar, .no-print, .toast-stack { display: none !important; }
    .main { margin: 0 !important; }
    .content { padding: 0 !important; }
    body { background: #fff !important; color: #000; }
    .card { box-shadow: none !important; border-color: #ccc !important; break-inside: avoid; }
    .print-only { display: block !important; }
    a { color: #000; }
}
.print-only { display: none; }
