/* ============================================================================
 * fuel-admin.css — the Fuel Surcharge tab.
 * ----------------------------------------------------------------------------
 * SOFT PASS (v32). Same information, same controls, softer surface treatment.
 * Nothing here defines a colour: every value resolves to a token in
 * styles.css, so light and dark both follow and a brand change lands once.
 *
 * What changed from v31, and why:
 *
 *   BORDERS → TINT + SHADOW.  Almost every 1px --border outline is gone.
 *   Panels separate by sitting on a lighter surface with a low shadow
 *   instead. Sixteen stacked hairlines is what made the page read as hard.
 *   Borders are kept only where they carry meaning: a pressed table tab, a
 *   focused input, a search hit.
 *
 *   RADII.  6/10/14 → 12/18/22 plus a pill for every control. Rounder reads
 *   softer at identical contrast, which is the cheapest softening there is.
 *
 *   TYPE WEIGHT.  Headings sit at --ink, body at --ink-2, captions at
 *   --ink-3, so the page has a gradient of weight rather than one flat black.
 *   The display face stays ALL CAPS per the brand guidelines but is used at
 *   12-19px with wider tracking — brand.css already applies the face, this
 *   file only sets size and spacing.
 *
 *   MOTION.  Timing comes from motion.css (--t-fast/--t/--t-slow, --ez*).
 *   Nothing here invents a duration except the band rail glide, which is
 *   deliberately slower than anything else on the page because it is the one
 *   animation carrying information rather than polish.
 *
 * LOCAL TOKENS are declared on #panel-fuel, not :root — this tab can be
 * softer than the rest of the app without changing the rest of the app. If
 * the treatment is rolled out elsewhere later, these lines move up to
 * styles.css and everything below keeps working unchanged.
 * ==========================================================================*/

#panel-fuel {
  --fz-r: 12px;
  --fz-r-lg: 18px;
  --fz-r-xl: 22px;
  --fz-pill: 999px;

  /* Two depths only. A third tempts every element into having its own. */
  --fz-sh: 0 1px 2px rgba(35, 31, 32, 0.04), 0 2px 10px rgba(35, 31, 32, 0.035);
  --fz-sh-2: 0 2px 6px rgba(35, 31, 32, 0.05), 0 10px 26px rgba(35, 31, 32, 0.06);

  --fz-glide: 620ms;
}

html[data-theme='dark'] #panel-fuel {
  --fz-sh: 0 1px 2px rgba(0, 0, 0, 0.22);
  --fz-sh-2: 0 6px 22px rgba(0, 0, 0, 0.28);
}

/* ── Metric tiles ──────────────────────────────────────────────────────────
 *
 * Was a single bordered strip reading "Diesel week X · N tables · N clients".
 * Same figures, one tile each, so the eye lands on a number instead of
 * parsing a sentence. The first tile is tinted because the diesel week is the
 * thing every other number on the page is relative to.
 *
 * Deliberately five short tiles and not a dashboard: no charts, no trends
 * beyond the one week-on-week delta, nothing that would turn a configuration
 * screen into an analytics screen.
 * ────────────────────────────────────────────────────────────────────────── */

.fuel-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.fuel-met {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--fz-r-lg);
  box-shadow: var(--fz-sh);
  transition: transform var(--t) var(--ez), box-shadow var(--t) var(--ez);
}

.fuel-met:hover {
  transform: translateY(-2px);
  box-shadow: var(--fz-sh-2);
}

.fuel-met.lead {
  background: linear-gradient(150deg, var(--accent-soft), var(--surface) 78%);
}

.fuel-met .ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--accent);
}

.fuel-met.lead .ic {
  background: var(--accent-mint);
  color: var(--accent-deep);
}

.fuel-met.warn .ic {
  background: var(--warn-soft);
  color: var(--warn);
}

.fuel-met .k {
  font-size: 0.72rem;
  color: var(--ink-3);
  font-weight: 500;
}

.fuel-met .v {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.18rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
  margin-top: 2px;
}

.fuel-met .v.small {
  font-size: 0.9rem;
  line-height: 1.4;
  margin-top: 4px;
}

.fuel-met .s {
  font-size: 0.72rem;
  color: var(--ink-3);
  line-height: 1.45;
}

/* Deltas keep their arrow as well as their colour — the sign is the signal,
   the hue is the reinforcement. */
.fuel-delta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.fuel-delta.up {
  color: var(--neg);
}

.fuel-delta.down {
  color: var(--pos);
}

/* ── Sub-tabs ─────────────────────────────────────────────────────────────
 * Scoped override of .dat-subtab-btn: segmented pill instead of an underline
 * on a rule. The rule was one more hard horizontal line in a column that
 * already had several.
 * ────────────────────────────────────────────────────────────────────────── */

#panel-fuel .dat-subnav {
  display: inline-flex !important;
  gap: 4px;
  padding: 4px;
  border: 0 !important;
  border-radius: var(--fz-pill);
  background: var(--surface-2);
  margin-bottom: 18px !important;
}

#panel-fuel .dat-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border: 0;
  border-radius: var(--fz-pill);
  background: none;
  color: var(--ink-3);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t) var(--ez);
}

#panel-fuel .dat-subtab-btn:hover {
  color: var(--ink);
}

#panel-fuel .dat-subtab-btn.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--fz-sh);
}

/* ── Toolbar ──────────────────────────────────────────────────────────── */

.fuel-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.fuel-search {
  position: relative;
  flex: 1;
  min-width: 230px;
}

.fuel-search input {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border: 1px solid transparent;
  border-radius: var(--fz-pill);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.86rem;
  box-shadow: var(--fz-sh);
  transition: border-color var(--t) var(--ez), box-shadow var(--t) var(--ez);
}

.fuel-search input::placeholder {
  color: var(--ink-3);
}

.fuel-search input:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.fuel-search svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.fuel-search-note {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--ink-3);
  margin-bottom: 12px;
  padding-left: 4px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────
 * Pills, no outline, one shadow depth. Hover lifts rather than darkens,
 * which is the same affordance with less contrast change.
 * ────────────────────────────────────────────────────────────────────────── */

.fuel-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  border: 0;
  border-radius: var(--fz-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 0.81rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--fz-sh);
  transition: transform var(--t-fast) var(--ez), box-shadow var(--t) var(--ez),
    background var(--t) var(--ez), color var(--t) var(--ez);
}

.fuel-btn:hover:not(:disabled) {
  transform: translateY(-1.5px);
  box-shadow: var(--fz-sh-2);
  color: var(--ink);
}

.fuel-btn:active:not(:disabled) {
  transform: translateY(0);
}

.fuel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fuel-btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.fuel-btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  color: var(--on-accent);
}

/* The quiet variants — used for per-card actions, where a row of five equally
   heavy buttons competes with the rate they act on. */
.fuel-btn-soft {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}

.fuel-btn-soft:hover:not(:disabled) {
  background: var(--accent-tint);
  color: var(--accent);
}

.fuel-btn-quiet {
  background: transparent;
  box-shadow: none;
  color: var(--ink-3);
}

.fuel-btn-quiet:hover:not(:disabled) {
  background: var(--surface-2);
  box-shadow: none;
}

.fuel-btn-sm {
  padding: 7px 12px;
  font-size: 0.78rem;
}

.fuel-btn-danger:hover:not(:disabled),
.fuel-btn-quiet.danger:hover:not(:disabled) {
  background: var(--neg-soft);
  color: var(--neg);
}

.fuel-btn-destructive {
  background: var(--neg);
  color: #fff;
}

.fuel-btn-destructive:hover:not(:disabled) {
  background: var(--neg);
  filter: brightness(1.08);
  color: #fff;
}

.fuel-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--t-fast) var(--ez);
}

.fuel-icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.fuel-icon-btn.danger:hover {
  background: var(--neg-soft);
  color: var(--neg);
}

.fuel-link-btn {
  border: 0;
  background: none;
  padding: 0 2px;
  color: var(--accent);
  font: inherit;
  font-size: 0.76rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.fuel-link-btn:hover {
  color: var(--accent-hover);
}

/* ── Client card ──────────────────────────────────────────────────────────
 *
 * One card per client — the shape settled on after four other layouts. The
 * head is inside the card and opens with who the card is about.
 * ────────────────────────────────────────────────────────────────────────── */

.fuel-group {
  margin-bottom: 14px;
  animation: ipe-rise var(--t-slow) var(--ez-out) both;
}

.fuel-card {
  background: var(--surface);
  border: 0;
  border-radius: var(--fz-r-xl);
  box-shadow: var(--fz-sh);
  overflow: hidden;
  transition: box-shadow var(--t) var(--ez);
}

.fuel-card:hover {
  box-shadow: var(--fz-sh-2);
}

.fuel-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 20px 13px;
  flex-wrap: wrap;
}

.fuel-group-id {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

/* Initials rather than a logo — there is no client logo anywhere in this
   product and inventing one would be inventing data. It exists to give the
   card a fixed left anchor so a column of cards scans down cleanly. */
.fuel-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  transition: background var(--t) var(--ez), color var(--t) var(--ez);
}

.fuel-card:hover .fuel-avatar {
  background: var(--accent-mint);
  color: var(--accent-deep);
}

.fuel-group-name {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink);
  line-height: 1.3;
}

.fuel-group-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 1px;
  font-size: 0.76rem;
  color: var(--ink-3);
}

.fuel-group-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.fuel-shown {
  color: var(--accent);
  font-weight: 500;
}

/* A search hit is marked by one inset rule, not by a coloured left border
   plus a dot before the name — three signals for one state was two too many. */
.fuel-group.matched > .fuel-card {
  box-shadow: var(--fz-sh-2), inset 0 0 0 1px var(--accent-border);
}

/* ── Table strip ──────────────────────────────────────────────────────────
 *
 * Every fuel table this client has, visible at once, with its rate. The card
 * still shows ONE table body at a time, so height stays flat whether a client
 * has two tables or fifteen — but which tables exist is no longer hidden
 * behind a control you have to open first. That was the one thing the picker
 * could not do.
 *
 * Horizontal scroll rather than wrap: a client with fifteen tables should
 * cost one row of the card, not four.
 * ────────────────────────────────────────────────────────────────────────── */

.fuel-tabstrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px 14px;
  scrollbar-width: thin;
}

.fuel-tt {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: var(--fz-r);
  background: var(--surface-1);
  text-align: left;
  cursor: pointer;
  transition: all var(--t) var(--ez);
}

.fuel-tt:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.fuel-tt[aria-pressed='true'] {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  box-shadow: var(--fz-sh);
}

.fuel-tt .ic {
  color: var(--ink-3);
  transition: color var(--t) var(--ez);
}

.fuel-tt[aria-pressed='true'] .ic {
  color: var(--accent);
}

.fuel-tt .nm {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.fuel-tt .rt {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-3);
}

.fuel-tt[aria-pressed='true'] .rt {
  color: var(--accent);
}

.fuel-tt.off .nm,
.fuel-tt.off .rt {
  color: var(--ink-3);
}

/* ── Card body ────────────────────────────────────────────────────────── */

.fuel-card-body {
  padding: 0 20px 18px;
}

.fuel-multi-item {
  padding: 16px 18px;
  border-radius: var(--fz-r-lg);
  background: var(--surface-1);
  animation: ipe-fade var(--t) var(--ez);
}

.fuel-multi-item + .fuel-multi-item {
  margin-top: 10px;
}

/* With several tables on screen only the paused one dims, not the card. */
.fuel-multi-item.inactive {
  opacity: 0.62;
}

.fuel-multi-none {
  padding: 20px;
  border-radius: var(--fz-r-lg);
  background: var(--surface-1);
  color: var(--ink-3);
  font-size: 0.82rem;
  text-align: center;
}

.fuel-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.fuel-card-name {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink);
}

.fuel-card-note {
  margin-top: 10px;
  max-width: 60ch;
  font-size: 0.81rem;
  color: var(--ink-2);
  line-height: 1.55;
}

.fuel-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.fuel-card-fpm {
  text-align: right;
  flex: none;
}

.fuel-card-fpm .val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.fuel-card-fpm .val .unit {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink-3);
}

/* "No deduction" is a sentence, not a figure, so it does not get figure
   sizing — at 1.7rem it reads as a price at a glance. */
.fuel-card-fpm .val.na {
  font-size: 1.05rem;
  color: var(--ink-2);
}

.fuel-card-fpm .val.warn {
  font-size: 1.05rem;
  color: var(--warn);
}

.fuel-card-fpm .cap {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-3);
}

/* ── Badges ───────────────────────────────────────────────────────────── */

.fuel-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.fuel-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border: 0;
  border-radius: var(--fz-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.72rem;
  font-weight: 500;
  box-shadow: var(--fz-sh);
  white-space: nowrap;
}

.fuel-badge svg {
  flex: none;
}

.fuel-badge.lh,
.fuel-badge.allin {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}

.fuel-badge.off {
  background: var(--warn-soft);
  color: var(--warn);
  box-shadow: none;
}

/* ── Config fields ────────────────────────────────────────────────────── */

.fuel-card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 14px;
}

.fuel-field .k {
  display: block;
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}

.fuel-field .v {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink);
  margin-top: 2px;
}

.fuel-field .v.muted {
  color: var(--ink-3);
}

/* ── The band rail ────────────────────────────────────────────────────────
 *
 * THE ONE PIECE OF THIS TAB THAT IS NEW RATHER THAN RESTYLED.
 *
 * A line-haul table used to print two facts — "Starts at $1.29/gal →
 * $0.000/mi" and "Then +$0.012/mi per $0.05/gal" — and leave the reader to do
 * the arithmetic that explains why the figure on the right says $1.008. The
 * rail draws that escalator as a scale and puts this week's diesel price on
 * it, so the relationship is read rather than computed.
 *
 * It is drawn from the SAME numbers the card already had: anchor, step, and
 * the preview the backend returns. It does not re-derive the rate — the
 * bubble shows the backend's own figure, so the picture can never disagree
 * with what actually prices a load.
 *
 * Not drawn for: All In (no calculation), fixed rate (no escalator), or a
 * table with no diesel row for its region (nothing to place).
 * ────────────────────────────────────────────────────────────────────────── */

.fuel-rail {
  margin-top: 18px;
}

.fuel-rail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 0.72rem;
  color: var(--ink-3);
}

.fuel-rail-body {
  position: relative;
  height: 44px;
}

.fuel-road {
  position: absolute;
  left: 0;
  right: 0;
  top: 22px;
  height: 8px;
  border-radius: var(--fz-pill);
  background: var(--surface-3);
}

/* --accent-bright is fills-only in the token system. This is a fill. */
.fuel-road-done {
  position: absolute;
  left: 0;
  top: 22px;
  height: 8px;
  width: 0;
  border-radius: var(--fz-pill);
  background: linear-gradient(90deg, var(--accent-mint), var(--accent-bright));
  transition: width var(--fz-glide) var(--ez-out);
}

.fuel-tick {
  position: absolute;
  top: 34px;
  width: 1px;
  height: 5px;
  border-radius: 1px;
  background: var(--border-strong);
}

.fuel-tick b {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--ink-3);
}

.fuel-truck {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateX(-50%);
  color: var(--accent);
  transition: left var(--fz-glide) var(--ez-out);
}

.fuel-bub {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: var(--fz-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--fz-sh);
}

.fuel-bub::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  margin-left: -4px;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: var(--accent);
  transform: rotate(45deg);
}

/* The anchor price — where this client's schedule starts charging. */
.fuel-drop {
  position: absolute;
  top: 24px;
  left: 0;
  transform: translateX(-50%);
  color: var(--accent-bright);
  animation: fuel-bob 3.4s var(--ez-out) infinite;
}

@keyframes fuel-bob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-3px);
  }
}

.fuel-rail-foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.fuel-rail-fx {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.79rem;
  color: var(--ink-2);
}

.fuel-rail-fx .ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--fz-sh);
}

.fuel-rail-fx b {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink);
}

/* All In gets a sentence where the rail would be, because the absence of a
   calculation is itself the thing worth stating plainly. */
.fuel-allin {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--fz-r-lg);
  background: var(--accent-soft);
  color: var(--ink-2);
  font-size: 0.81rem;
  line-height: 1.55;
}

.fuel-allin .ic {
  color: var(--accent);
  flex: none;
}

/* ── PDF attachments ──────────────────────────────────────────────────────
 * One compact row per table. A twice-a-year action does not earn a permanent
 * 40px drop zone on every card — the row itself is still the drop target.
 * ────────────────────────────────────────────────────────────────────────── */

.fuel-docs-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 4px;
  font-size: 0.74rem;
  color: var(--ink-3);
  border-radius: var(--fz-r);
  transition: background var(--t) var(--ez), box-shadow var(--t) var(--ez);
}

.fuel-docs-row.over {
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-border);
}

.fuel-docs-row.busy {
  opacity: 0.6;
}

.fuel-docs-title {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}

.fuel-doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  padding: 5px 6px 5px 12px;
  border-radius: var(--fz-pill);
  background: var(--surface);
  box-shadow: var(--fz-sh);
}

.fuel-doc-chip a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.75rem;
}

.fuel-doc-chip a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.fuel-doc-pdf {
  font-family: var(--font-display);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--neg-soft);
  color: var(--neg);
}

.fuel-doc-x {
  border: 0;
  background: none;
  color: var(--ink-3);
  padding: 2px 5px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  transition: all var(--t-fast) var(--ez);
}

.fuel-doc-x:hover {
  background: var(--neg-soft);
  color: var(--neg);
}

.fuel-doc-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 0;
  border-radius: var(--fz-pill);
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
  transition: all var(--t-fast) var(--ez);
}

.fuel-doc-add:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--ink);
}

.fuel-doc-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fuel-doc-meta {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--ink-3);
}

/* ── Empty, loading and error ─────────────────────────────────────────────
 * One tile, three messages. Each names what happened and offers the single
 * control that resolves it — an empty screen with no way forward is the most
 * common way a filter gets blamed on the data.
 * ────────────────────────────────────────────────────────────────────────── */

.fuel-state {
  text-align: center;
  padding: 60px 28px;
  background: var(--surface);
  border-radius: var(--fz-r-xl);
  box-shadow: var(--fz-sh);
  animation: ipe-fade var(--t) var(--ez);
}

.fuel-state .ic {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: var(--accent-soft);
  color: var(--accent);
  animation: fuel-bob 4s var(--ez-out) infinite;
}

.fuel-state.bad .ic {
  background: var(--neg-soft);
  color: var(--neg);
}

.fuel-state h3 {
  margin: 0 0 7px;
  font-size: 0.94rem;
  color: var(--ink);
}

.fuel-state p {
  margin: 0 auto 20px;
  max-width: 46ch;
  font-size: 0.83rem;
  color: var(--ink-2);
  line-height: 1.6;
}

.fuel-state code {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
}

.fuel-state-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Kept as aliases so any caller still emitting the old class names renders as
   the new tile rather than unstyled. */
.fuel-empty,
.fuel-error {
  text-align: center;
  padding: 40px 24px;
  background: var(--surface);
  border-radius: var(--fz-r-xl);
  box-shadow: var(--fz-sh);
  color: var(--ink-2);
  font-size: 0.83rem;
}

.fuel-empty strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: var(--ink);
}

.fuel-error {
  color: var(--neg);
}

/* Skeletons, not a spinner: the shape of what is coming is itself
   information, and a blocking spinner makes a 400ms load feel like a stall. */
.fuel-skel {
  background: linear-gradient(
    100deg,
    var(--surface-2) 20%,
    var(--surface-1) 42%,
    var(--surface-2) 64%
  );
  background-size: 280% 100%;
  border-radius: var(--fz-pill);
  animation: ipe-shimmer 1.7s linear infinite;
}

.fuel-skel-card {
  padding: 18px 20px;
  background: var(--surface);
  border-radius: var(--fz-r-xl);
  box-shadow: var(--fz-sh);
  margin-bottom: 14px;
}

/* ── Add / Edit dialog ────────────────────────────────────────────────────
 * The dialog is unchanged in substance — same fields, same ids, same save
 * path, same conditional show/hide. This is surface only: softer box, tinted
 * header with the fuel mark, and a footer on its own surface so Save is
 * findable without hunting.
 *
 * Field styling moved here from inline cssText in fuel-admin.js. Set in JS it
 * could not follow the theme, so the dialog stayed light in dark mode.
 * ────────────────────────────────────────────────────────────────────────── */

.fuel-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 30, 24, 0.34);
  backdrop-filter: blur(3px);
  animation: ipe-fade var(--t-fast) var(--ez);
}

.fuel-modal-box {
  width: min(540px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--fz-r-xl);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  animation: fuel-modal-rise var(--t) var(--ez-out);
}

@keyframes fuel-modal-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.fuel-modal-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 22px 16px;
  background: linear-gradient(160deg, var(--accent-soft), var(--surface) 72%);
}

.fuel-modal-head .ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--accent-mint);
  color: var(--accent-deep);
}

.fuel-modal-title {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.3;
}

.fuel-modal-sub {
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--ink-3);
}

.fuel-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 4px;
}

.fuel-modal-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 22px;
  background: var(--surface-1);
}

.fuel-modal-err {
  flex: 1;
  min-height: 1em;
  font-size: 0.78rem;
  color: var(--neg);
  text-align: left;
}

#fuel-modal-overlay .dat-modal-field {
  margin-bottom: 14px;
}

#fuel-modal-overlay .dat-modal-field > label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-2);
}

#fuel-modal-overlay .dat-modal-field input:not([type='checkbox']):not([type='file']),
#fuel-modal-overlay .dat-modal-field select,
#fuel-modal-overlay .dat-modal-field textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--fz-r);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.85rem;
  transition: border-color var(--t) var(--ez), box-shadow var(--t) var(--ez);
}

#fuel-modal-overlay .dat-modal-field textarea {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  resize: vertical;
}

#fuel-modal-overlay .dat-modal-field input:focus,
#fuel-modal-overlay .dat-modal-field select:focus,
#fuel-modal-overlay .dat-modal-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

#fuel-modal-overlay .dat-modal-field input[type='file'] {
  width: 100%;
  font-size: 0.8rem;
  color: var(--ink-2);
}

/* The Active checkbox is the one label in the dialog that is a control, not a
   heading, so it does not take the display face. */
#fuel-modal-overlay .dat-modal-field > label.fuel-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

#fuel-modal-overlay input[type='checkbox'] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.fuel-modal-hint {
  margin-top: 5px;
  font-size: 0.72rem;
  color: var(--ink-3);
  line-height: 1.5;
}

.fuel-modal-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 11px 13px;
  border-radius: var(--fz-r);
  background: var(--surface-1);
  font-size: 0.76rem;
  color: var(--ink-2);
  line-height: 1.55;
}

.fuel-modal-note .ic {
  color: var(--ink-3);
  flex: none;
}

.fuel-modal-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

/* ── Confirm dialog ───────────────────────────────────────────────────── */

.fuel-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 30, 24, 0.34);
  backdrop-filter: blur(3px);
  animation: ipe-fade var(--t-fast) var(--ez);
}

.fuel-confirm-box {
  width: min(430px, 100%);
  padding: 22px 24px 18px;
  background: var(--surface);
  border-radius: var(--fz-r-xl);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  animation: fuel-modal-rise var(--t) var(--ez-out);
}

.fuel-confirm-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.fuel-confirm-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}

.fuel-confirm-icon.danger {
  background: var(--neg-soft);
  color: var(--neg);
}

.fuel-confirm-copy {
  min-width: 0;
}

.fuel-confirm-title {
  margin: 0 0 5px;
  font-size: 0.92rem;
  color: var(--ink);
}

.fuel-confirm-msg {
  font-size: 0.83rem;
  color: var(--ink-2);
  line-height: 1.6;
}

.fuel-confirm-detail {
  margin-top: 8px;
  font-size: 0.76rem;
  color: var(--ink-3);
}

.fuel-confirm-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ── EIA index tab ────────────────────────────────────────────────────── */

.fuel-index-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.fuel-index-note {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.79rem;
  color: var(--ink-3);
}

.fuel-index-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.fuel-panel {
  background: var(--surface);
  border-radius: var(--fz-r-xl);
  box-shadow: var(--fz-sh);
  overflow: hidden;
}

.fuel-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 20px 12px;
}

.fuel-panel-title {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink);
}

.fuel-panel-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-3);
}

.fuel-panel-scroll {
  max-height: 520px;
  overflow: auto;
}

#panel-fuel .fuel-panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

#panel-fuel .fuel-panel th {
  text-align: left;
  padding: 10px 20px;
  background: var(--surface-1);
  color: var(--ink-3);
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  border: 0;
}

#panel-fuel .fuel-panel td {
  padding: 12px 20px;
  border: 0;
  box-shadow: inset 0 -1px 0 var(--border);
  color: var(--ink-2);
}

#panel-fuel .fuel-panel tbody tr {
  cursor: pointer;
  transition: background var(--t-fast) var(--ez);
}

#panel-fuel .fuel-panel tbody tr:hover {
  background: var(--surface-1);
}

#panel-fuel .fuel-panel tbody tr[aria-selected='true'] {
  background: var(--accent-soft);
}

.fuel-region-name {
  display: flex;
  align-items: center;
  gap: 11px;
}

.fuel-region-name .ic {
  color: var(--ink-3);
  flex: none;
}

.fuel-region-name strong {
  color: var(--ink);
  font-weight: 600;
}

.fuel-region-code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-3);
}

.fuel-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.fuel-spark {
  padding: 6px 20px 10px;
}

.fuel-spark svg {
  overflow: visible;
  color: var(--accent);
}

.fuel-spark-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-3);
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .fuel-index-grid {
    grid-template-columns: 1fr;
  }

  .fuel-card-top {
    flex-direction: column;
  }

  .fuel-card-fpm {
    text-align: left;
  }

  .fuel-card-actions {
    justify-content: flex-start;
  }

  .fuel-group-head {
    align-items: flex-start;
  }

  .fuel-modal-grid2 {
    grid-template-columns: 1fr;
  }
}

/* ── Reduced motion ───────────────────────────────────────────────────────
 * The two ambient loops stop outright. The rail still moves, because the
 * truck's POSITION is the information — it just arrives immediately.
 * ────────────────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .fuel-drop,
  .fuel-state .ic {
    animation: none;
  }

  .fuel-truck,
  .fuel-road-done {
    transition-duration: 0ms;
  }

  .fuel-btn:hover:not(:disabled),
  .fuel-met:hover,
  .fuel-tt:hover {
    transform: none;
  }
}