/*
  Area pass for Fuel (boards: canvas-customers-fuel FuelCards / FuelCardAdd / FuelPurchaseAdd / FuelImport /
  FuelDiscounts / FuelReconcile / FuelRejectRow / LaneRates / LaneRateForm / LaneRateDelete).
  Everything uses the pui-fuel- prefix; the page body of each view carries .pui-fuel.
*/

/* ── List card (the Fuel list, the reconciliation queue, the discount tables) ───────────────── */

.pui-fuel-list.cn-card { overflow: hidden; gap: 0; padding: 0; border-radius: 12px; }
.pui-fuel-list .pui-list-toolbar { padding: 14px 16px; border-bottom: 1px solid var(--border); gap: 12px; }
.pui-fuel-list .cn-tabs-list {
    display: flex; gap: 2px; padding: 3px; background: var(--muted); border-radius: 9px; width: max-content;
    max-width: 100%; height: auto;
}
.pui-fuel-list .cn-tabs-trigger {
    height: 30px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 500; gap: 6px; box-shadow: none;
    border: 0; color: var(--muted-foreground);
}
.pui-fuel-list .cn-tabs-trigger[aria-selected="true"] {
    background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px oklch(0.2 0.02 258 / .08);
}
.pui-fuel-count { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--muted-foreground); }

.pui-fuel-list .pui-filter-bar { align-items: center; gap: 8px; }
.pui-fuel-list .pui-filter-bar > .pui-fuel-search { position: relative; flex: 1 1 280px; max-width: 420px; }
.pui-fuel-list .pui-fuel-search > .cn-input { height: 36px; width: 100%; padding-left: 34px; border-radius: 8px; font-size: 14px; }
.pui-fuel-search-icon {
    position: absolute; left: 10px; top: 50%; margin-top: -8px; color: var(--muted-foreground); pointer-events: none; z-index: 1;
}
.pui-fuel-list .pui-filter-bar > .cn-button[data-testid="fuel-export-csv"] { margin-left: auto; }

.pui-fuel-list .pui-list-table { padding: 0; }
.pui-fuel-list table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pui-fuel-list th.cn-table-head,
.pui-fuel-list thead th {
    height: 38px; padding: 0 12px; font-size: 12px; font-weight: 500; color: var(--muted-foreground);
    border-bottom: 1px solid var(--border); white-space: nowrap; text-align: left;
}
.pui-fuel-list tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13px; }
.pui-fuel-list tbody tr:last-child td { border-bottom: 0; }
.pui-fuel-list tbody tr:hover td { background: oklch(0.98 0.004 250); }
.pui-fuel-list .pui-fuel-wide { min-width: 1040px; }
.pui-fuel-list .pui-list-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.pui-fuel-list .pui-fuel-cell-right { text-align: right; }

/* Needs-you row. */
.pui-fuel-needs-label {
    font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted-foreground); margin-right: 4px;
}
.pui-fuel .cn-button.pui-fuel-chip {
    height: 32px; padding: 0 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--border);
    font-size: 13px; font-weight: 500; color: var(--foreground); box-shadow: none; gap: 8px;
}
.pui-fuel .cn-button.pui-fuel-chip:hover { background: var(--accent); }
.pui-fuel .cn-badge.pui-badge-count { height: 20px; }
.pui-fuel .cn-badge.pui-badge-count::before { display: inline-block; }

/* ── Sheets ────────────────────────────────────────────────────────────────────────────────── */

.pui-fuel-vendors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cn-button.pui-fuel-vendor {
    height: auto; text-align: left; align-items: flex-start; justify-content: flex-start; white-space: normal;
    padding: 12px 14px; border: 1px solid var(--input); border-radius: 10px; background: var(--card);
    color: var(--foreground); font-size: 14px; font-weight: 400; box-shadow: none; flex-direction: column; gap: 2px;
}
.cn-button.pui-fuel-vendor:hover { background: var(--accent); }
.cn-button.pui-fuel-vendor[aria-checked="true"] {
    border: 1.5px solid var(--primary); background: var(--tone-info-bg); padding: 11.5px 13.5px;
}
.pui-fuel-vendor-how { font-size: 12px; font-weight: 400; color: var(--muted-foreground); line-height: 1.4; }
.cn-button.pui-fuel-vendor[aria-checked="true"] .pui-fuel-vendor-how { color: var(--tone-info-fg); }
.pui-fuel-city-state { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 14px; }
.pui-fuel-lane-pair { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; }

/* The file box of the import dialog. */
.pui-fuel-file {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px dashed var(--input);
    border-radius: 10px; background: var(--muted);
}
.pui-fuel-file-icon {
    width: 36px; height: 36px; border-radius: 9px; background: var(--card); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; color: var(--primary); flex: none;
}
.pui-fuel-file-name { font-weight: 600; font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pui-fuel-dialog-body { display: flex; flex-direction: column; gap: 18px; padding: 4px 24px 24px; }
.pui-fuel-row-summary {
    display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px;
    background: var(--muted); font-size: 13px;
}

/* ── Reconciliation ────────────────────────────────────────────────────────────────────────── */

.pui-fuel-queue-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px;
    border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.pui-fuel-queue-title { font-size: 15px; font-weight: 600; margin: 0; display: flex; gap: 8px; align-items: baseline; }
.pui-fuel-queue-hint { font-size: 12px; color: var(--muted-foreground); }
.pui-fuel-assign { display: flex; gap: 8px; }
.pui-fuel-assign > .cn-select, .pui-fuel-assign > [data-slot="select"] { min-width: 0; }
.pui-fuel-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ── Discounts ─────────────────────────────────────────────────────────────────────────────── */

.pui-fuel-saved { color: var(--tone-success-fg); font-weight: 600; }
.pui-fuel-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.pui-fuel-band-cell { padding: 18px 22px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--border); }
.pui-fuel-band-cell:last-child { border-right: 0; }
.pui-fuel-kpi { font-family: var(--font-mono); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pui-fuel-kpi-label { font-size: 12px; color: var(--muted-foreground); }
.pui-fuel-bar-track { height: 8px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.pui-fuel-bar-fill { height: 100%; border-radius: 999px; background: var(--tone-success-fg); }
.pui-fuel-two-up { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.pui-fuel-two-up > * { flex: 1 1 460px; min-width: 0; }
.pui-fuel .pui-fuel-range .cn-button { height: 28px; padding: 0 10px; border: 0; border-radius: 6px; font-size: 13px; font-weight: 500; }
.pui-fuel-range { display: inline-flex; padding: 3px; gap: 2px; background: var(--muted); border-radius: 8px; }
.pui-fuel .pui-fuel-range .cn-button[aria-pressed="true"] { background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px oklch(0.2 0.02 258 / .08); }
.pui-fuel .pui-fuel-range .cn-button[aria-pressed="false"] { background: transparent; color: var(--muted-foreground); }

/* ── Lane rates ────────────────────────────────────────────────────────────────────────────── */

.pui-fuel-customer-bar {
    display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.pui-fuel-customer-bar > .cn-field { flex: 0 1 340px; min-width: 240px; }
.pui-fuel-customer-hint { font-size: 13px; color: var(--muted-foreground); padding-bottom: 9px; margin: 0; }

/* ── Sheet frame (boards: FuelCardAdd, FuelPurchaseAdd, LaneRateForm), scoped to the sheet's wrapper ─────────── */

.pui-fuel-sheet .cn-sheet { gap: 0; background: var(--card); box-shadow: -12px 0 32px oklch(0.2 0.03 258 / 0.14); }
.pui-fuel-sheet .cn-dialog-overlay { background: oklch(0.18 0.03 258 / 0.45); }
.pui-fuel-sheet .pui-sheet-header {
    display: flex; flex-direction: column; gap: 4px; padding: 20px 68px 16px 24px; border-bottom: 1px solid var(--border);
}
.pui-fuel-sheet .cn-dialog-title { font-size: 18px; font-weight: 600; line-height: 26px; }
.pui-fuel-sheet .cn-dialog-description { font-size: 13px; line-height: 1.45; color: var(--muted-foreground); }
.pui-fuel-sheet .cn-dialog-close { top: 19px; right: 24px; width: 32px; height: 32px; }
.pui-fuel-sheet .pui-sheet-section:last-child { border-bottom: 0; }
.pui-fuel-sheet .pui-sheet-footer { padding: 14px 24px; background: var(--card); }
.pui-fuel-sheet .pui-sheet-section-title { font-size: 14px; font-weight: 600; line-height: 1.45; }
/* A section with no heading takes no room for one. */
.pui-fuel-sheet .sc-vstack:has(> .pui-sheet-section-title:empty) { display: none; }

.pui-fuel-sheet .cn-field { gap: 6px; min-width: 0; }
.pui-fuel-sheet .cn-field > .sc-vstack { gap: 6px; }
.pui-fuel-sheet .cn-label { font-size: 13px; font-weight: 500; line-height: 1.45; display: block; }
.pui-fuel-sheet .cn-field-description { font-size: 12px; line-height: 1.45; color: var(--muted-foreground); }
.pui-fuel-sheet .cn-field-error { font-size: 12px; color: var(--tone-danger-fg); }
.pui-fuel-sheet .cn-input, .pui-fuel-sheet .cn-select, .pui-fuel-sheet .cn-textarea {
    height: 36px; min-height: 36px; padding: 0 12px; border: 1px solid var(--input); border-radius: 8px;
    background: var(--card); font-size: 14px; line-height: 20px; color: var(--foreground); box-shadow: none;
}
.pui-fuel-sheet .cn-textarea { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.45; }
.pui-fuel-sheet .cn-select-root { display: block; width: 100%; }
.pui-fuel-sheet .cn-select-trigger { width: 100%; justify-content: space-between; }
.pui-fuel-sheet .cn-input::placeholder, .pui-fuel-sheet .cn-textarea::placeholder { color: var(--muted-foreground); opacity: 0.8; }
.pui-fuel-sheet .cn-input-group {
    display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--input);
    border-radius: 8px; background: var(--card); color: var(--muted-foreground); box-shadow: none;
}
.pui-fuel-sheet .cn-input-group .cn-input {
    flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent;
    box-shadow: none; font-size: 14px; color: var(--foreground);
}
.pui-fuel-sheet .cn-input-group .cn-input:focus { outline: 0; }
.pui-fuel-sheet .cn-input-group:focus-within { outline: 2px solid var(--ring); outline-offset: 0; border-color: var(--ring); }
.pui-fuel-sheet .cn-input-group [data-slot="input-group-addon"] { color: var(--muted-foreground); font-size: 14px; padding: 0; }

/* Dialogs of the fuel pages (import, reject): the board's 14px radius and width. */
.pui-fuel-import .cn-dialog { width: min(500px, calc(100vw - 32px)); padding: 0; gap: 0; border-radius: 14px; }
.pui-confirm .cn-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; gap: 0; border-radius: 14px; }
.pui-fuel-import .cn-dialog-footer, .pui-confirm .cn-dialog-footer {
    padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 8px;
}
.pui-fuel-import .cn-dialog-header, .pui-confirm .cn-dialog-header { padding: 20px 24px 16px; gap: 4px; }
.pui-fuel-dialog-body .cn-field { gap: 6px; }
.pui-fuel-dialog-body .cn-label { font-size: 13px; font-weight: 500; line-height: 1.45; }
.pui-fuel-dialog-body .cn-input { height: 36px; border-radius: 8px; font-size: 14px; }
.pui-fuel-success { color: var(--tone-success-fg); }
.pui-fuel-list .pui-fuel-stops { min-width: 900px; }

/* Segmented toggle group (the design's .cn-toggle-group): the import dialog's provider and the discount range. */
.pui-fuel-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--muted); border-radius: 8px; }
.pui-fuel-seg .cn-button { height: 28px; padding: 0 10px; border: 0; border-radius: 6px; font-size: 13px; font-weight: 500; box-shadow: none; }
.pui-fuel-seg .cn-button[aria-pressed="false"] { background: transparent; color: var(--muted-foreground); }
.pui-fuel-seg .cn-button[aria-pressed="true"] { background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px oklch(0.2 0.02 258 / .08); }

/* One-line secondary text under a cell's main value (the shared .pui-cell-secondary squeezes stacks). */
.pui-fuel-caption { font-size: 12px; line-height: 1.45; color: var(--muted-foreground); }

/* The last-import note: the design's info alert, with its icon. */
.pui-fuel-info {
    display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid oklch(0.88 0.05 250);
    border-radius: 10px; background: var(--tone-info-bg); color: var(--tone-info-fg); font-size: 13px; line-height: 1.45;
}
.pui-fuel-info svg { flex: none; margin-top: 1px; }
.pui-fuel-info-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Queue head and customer bar sit inside the list card's toolbar, which already pads and rules them. */
.pui-fuel-list .pui-list-toolbar > .pui-fuel-queue-head,
.pui-fuel-list .pui-list-toolbar > .pui-fuel-customer-bar { padding: 0; border: 0; }
.pui-fuel-customer-bar .cn-field { gap: 6px; }
.pui-fuel-customer-bar .cn-field > .sc-vstack { gap: 6px; }
.pui-fuel-customer-bar .cn-label { font-size: 13px; font-weight: 500; }
.pui-fuel-customer-bar .cn-select-root { display: block; width: 100%; }
.pui-fuel-lanes { min-width: 820px; }
