/* SavePerGallon v2 — production Fuel Intelligence look.
   Dark teal, single column, no sidebar, no hero image. All classes
   used by dashboard.html and connectors.html are styled here. */

* { box-sizing: border-box; }
body { margin: 0; background: #060a09; color: #e6f0ec;
       font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: #4ade80; }
h2 { margin: 0 0 12px; font-size: 20px; color: #fff; }
button { cursor: pointer; }
input, select { background: #0a1410; color: #e6f0ec; border: 1px solid #2a3f36;
                border-radius: 8px; padding: 9px 11px; font-size: 14px; }
pre { background: #060a09; border: 1px solid #1d2f28; border-radius: 8px;
      padding: 10px; font-size: 12px; overflow: auto; color: #c9ddd3; }
details summary { cursor: pointer; color: #4ade80; font-size: 13px; }

.fi-page { max-width: 1440px; margin: 0 auto; padding: 18px 24px 32px; }

/* Slim status strip — live badges, auto-cycle, auto-send. */
.fi-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
             margin-bottom: 14px; font-size: 12px; }
.fi-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.fi-badge { background: #122019; border: 1px solid #22382e; color: #c9ddd3;
            padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.fi-badge.ok { color: #4ade80; border-color: #14532d; }
.fi-badge.bad { color: #fca5a5; border-color: #7f1d1d; }
.fi-badge.demo { color: #fbbf24; border-color: #78350f; }
.fi-updated { margin-left: auto; color: #7d938a; }

/* Header */
.fi-header { background: #0d1f1a; border: 1px solid #1d2f28; border-radius: 16px;
             padding: 28px 30px; }
.fi-header h1 { margin: 0; font-size: 42px; font-weight: 800; color: #fff;
                letter-spacing: -0.5px; }
.fi-sub { margin: 8px 0 0; color: #9db8ae; font-size: 15px; }
.fi-compare { margin: 6px 0 0; color: #7d938a; font-size: 13px; }
.fi-pill-rts { display: inline-block; margin-top: 16px; padding: 8px 16px;
               border-radius: 999px; font-weight: 800; font-size: 13px;
               letter-spacing: 0.4px; }
.fi-pill-rts.live { background: #4ade80; color: #052e16; }
.fi-pill-rts.error { background: #7f1d1d; color: #fca5a5; }
.fi-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
              margin-top: 20px; }
.fi-sweep-one, .fi-sweep-all { display: flex; gap: 12px; align-items: center; }
.fi-sweep-one input { width: 120px; }
.fi-btn-blue, .fi-btn-green { border: 0; color: #fff; font-weight: 800;
    font-size: 14px; letter-spacing: 0.5px; padding: 12px 20px; border-radius: 8px; }
.fi-btn-blue { background: #2563eb; }
.fi-btn-green { background: #16a34a; }
.fi-pill-fresh { background: linear-gradient(90deg, #16a34a, #4ade80);
                 color: #fff; font-weight: 800; font-size: 14px;
                 padding: 12px 20px; border-radius: 8px; letter-spacing: 0.4px; }
.fi-pill-fresh.stale { background: #3f3f46; color: #d4d4d8; }
.fi-rts-detail { margin: 12px 0 0; color: #7d938a; font-size: 13px; }
.fi-sweep-note { margin: 12px 0 0; color: #7d938a; font-size: 13px; }

/* KPI cards */
.fi-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px;
           margin-top: 18px; }
.fi-kpi { background: #0f1e19; border: 1px solid #1d2f28; border-top: 3px solid #2a3f36;
          border-radius: 14px; padding: 16px 18px; }
.fi-kpi.green { border-top-color: #22c55e; }
.fi-kpi.pink { border-top-color: #f472b6; }
.fi-kpi.amber { border-top-color: #fbbf24; }
.fi-kpi.blue { border-top-color: #38bdf8; }
.fi-kpi-label { display: block; color: #9db8ae; font-size: 13px; font-weight: 700; }
.fi-kpi b { display: block; font-size: 34px; line-height: 1.15; color: #fff;
            margin: 6px 0 4px; }
.fi-kpi.green b { color: #4ade80; }
.fi-kpi.pink b { color: #f472b6; }
.fi-kpi.amber b { color: #fbbf24; }
.fi-kpi.blue b { color: #7dd3fc; }
.fi-kpi-sub { display: block; color: #7d938a; font-size: 12px; line-height: 1.4; }
/* KPI cards are links to the drill-down (?show=...): same look as the
   old divs, no underline, a touch brighter on hover. */
a.fi-kpi { text-decoration: none; display: block; }
a.fi-kpi:hover { border-color: #33503f; }

/* Performance grid: table left, donut + insights right */
.fi-perf-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px;
                gap: 20px; margin-top: 18px; align-items: start; }
.fi-panel, .panel { background: #0d1a16; border: 1px solid #1d2f28;
                    border-radius: 16px; padding: 20px; }
.panel { margin-top: 18px; }
.panel-ic { margin-right: 4px; }
.fi-panel-head { display: flex; justify-content: space-between; gap: 16px;
                 align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.fi-panel-head h2 { margin: 0; }
.fi-panel-sub { margin: 4px 0 0; color: #8aa39a; font-size: 13px; line-height: 1.5; }
.fi-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fi-filter button, .panel button, .registry-row button { background: #1d2f28;
    color: #e6f0ec; border: 1px solid #2a3f36; padding: 9px 14px;
    border-radius: 8px; font-size: 14px; }
.filtered-totals { display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
                   background: #122019; border: 1px solid #1d2f28; border-radius: 10px;
                   padding: 10px 14px; margin: 0 0 12px; font-size: 13px; color: #c9ddd3; }
.empty-state { color: #fbbf24; font-size: 14px; }
.note { color: #8aa39a; font-size: 13px; line-height: 1.55; }

/* Tables — each table is its own scroll box (60vh cap) so a long
   table scrolls inside its section instead of pushing the whole
   page down; a table shorter than the cap never scrolls. */
.table-wrap { overflow-x: auto; max-height: 60vh; overflow-y: auto;
              overscroll-behavior: contain; }
table.fi-table, table.perf { width: 100%; border-collapse: collapse; font-size: 14px; }
table.fi-table th, table.perf th { text-align: left; color: #7d938a;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
    padding: 10px; border-bottom: 1px solid #1d2f28; }
/* Sticky headers: column labels stay visible while a table scrolls
   inside its box. Opaque panel background so rows cannot show through. */
table.fi-table thead th, table.perf thead th { position: sticky; top: 0;
    background: #0d1a16; z-index: 1; }
table.fi-table td, table.perf td { padding: 12px 10px; border-bottom: 1px solid #1d2f28;
    vertical-align: middle; }
table.fi-table tbody tr:hover, table.perf tbody tr:hover { background: #101f1a; }
.fi-truck { display: block; color: #7d938a; font-size: 12px; margin-top: 2px; }

/* Status dots and pills — the verdict dot is WIDE (20px) so the
   verdict reads at a glance: solid green = Followed, solid red =
   Not followed, grey = Not verified, amber = Awaiting purchase.
   EDGE is a green RING — green only on the edge, hollow center —
   never a solid green dot (Alex, 2026-11-17: an EDGE row must not
   look followed). */
.fi-dot { display: inline-block; width: 20px; height: 20px; border-radius: 50%;
          vertical-align: middle; margin-right: 6px; box-sizing: border-box; }
.fi-dot.green, .dot.green { background: #22c55e; }
.fi-dot.red, .dot.red { background: #ef4444; }
.fi-dot.amber, .dot.amber { background: #f59e0b; }
.fi-dot.grey, .dot.grey { background: #64748b; }
.fi-dot.edge, .dot.edge { background: transparent; border: 3px solid #4ade80; }
.fi-pill, .pill { display: inline-block; padding: 4px 10px; border-radius: 999px;
                  font-size: 12px; font-weight: 700; white-space: nowrap; }
.fi-pill.green, .pill.green { background: #14532d; color: #86efac; }
.fi-pill.red, .pill.red { background: #7f1d1d; color: #fca5a5; }
.fi-pill.amber, .pill.amber, .pill.orange { background: #78350f; color: #fcd34d; }
.fi-pill.grey, .pill.grey { background: #334155; color: #cbd5e1; }
.fi-chip-edge { background: #052e16; color: #4ade80; border: 1px solid #14532d;
                padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 800; }

/* Donut + legend */
.fi-side { display: flex; flex-direction: column; gap: 20px; }
.fi-donut-wrap { display: flex; align-items: center; gap: 18px; }
.fi-donut-svg { width: 190px; flex: none; }
.fi-donut-num { fill: #fff; font-size: 34px; font-weight: 800; }
.fi-donut-label { fill: #8aa39a; font-size: 12px; }
.fi-legend { list-style: none; margin: 0; padding: 0; flex: 1; }
.fi-legend li { display: flex; align-items: center; gap: 8px; padding: 7px 0;
                font-size: 14px; color: #c9ddd3; }
.fi-legend li b { margin-left: auto; color: #fff; }
.fi-legend a { color: inherit; text-decoration: none; }
.fi-legend a:hover { text-decoration: underline; }

/* Key Insights */
.fi-insights-list { margin: 0; }
.fi-insight { padding: 12px 0; border-bottom: 1px solid #1d2f28; }
.fi-insight:last-child { border-bottom: 0; }
.fi-insight dt { color: #8aa39a; font-size: 13px; }
.fi-insight dd { margin: 4px 0 0; color: #fff; font-size: 15px; font-weight: 700; }

.hero-secondary { color: #8aa39a; font-size: 13px; line-height: 1.6; margin: 18px 0 0; }
.hero-secondary b { color: #e6f0ec; }

/* History */
.summary-counts { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px;
                  color: #8aa39a; margin: 0 0 8px; }
.summary-counts b { color: #e6f0ec; }
.count.green b { color: #4ade80; }
.count.red b { color: #f472b6; }
.count.edge b { color: #4ade80; }
.history-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.history-row { display: flex; gap: 16px; align-items: center; background: #0d1a16;
               border: 1px solid #1d2f28; border-radius: 12px; padding: 14px 16px; }
/* Sent-plan mirror rows: same card look as the history rows. */
.mirror-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.mirror-row { background: #0d1a16; border: 1px solid #1d2f28;
             border-radius: 12px; padding: 14px 16px; }
.mirror-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.big-circle { display: inline-flex; align-items: center; justify-content: center;
              width: 44px; height: 44px; border-radius: 50%; font-size: 11px;
              font-weight: 800; flex: none; }
.big-circle.small { width: 28px; height: 28px; }
.big-circle.green { background: #14532d; color: #86efac; }
.big-circle.red { background: #7f1d1d; color: #fca5a5; }
.big-circle.grey { background: #334155; color: #cbd5e1; }
/* EDGE is a ring here too — hollow center, green only on the edge. */
.big-circle.edge { background: transparent; color: #4ade80; border: 2px solid #4ade80; }
.history-who { min-width: 200px; }
.history-who h3 { margin: 0; font-size: 15px; color: #fff; }
.history-who p { margin: 2px 0; color: #8aa39a; font-size: 13px; }
.status-text { color: #c9ddd3; font-size: 13px; }
.history-plans { display: flex; gap: 14px; flex-wrap: wrap; }
.history-plans .plan { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.opt-badge { background: #1d2f28; color: #a7f3d0; padding: 2px 7px;
             border-radius: 5px; font-weight: 700; font-size: 12px; }
.history-actual { margin-left: auto; text-align: right; }
.history-actual .actual-label { display: block; color: #7d938a; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.5px; }
.history-actual b { display: block; font-size: 14px; color: #fff; margin: 2px 0; }
.history-actual span:last-child { color: #8aa39a; font-size: 12px; }

/* Ranking */
.ranking { list-style: none; margin: 0; padding: 0; }
.rank-row { display: flex; gap: 14px; align-items: center; padding: 12px 0;
            border-bottom: 1px solid #1d2f28; }
.rank-num { color: #7d938a; width: 24px; flex: none; font-weight: 700; }
.rank-who b { display: block; font-size: 15px; color: #fff; }
.rank-who span { display: block; color: #8aa39a; font-size: 12px; margin-top: 2px; }
.rank-net { margin-left: auto; text-align: right; }
.rank-net b { display: block; font-size: 16px; color: #4ade80; }
.rank-net span { display: block; color: #8aa39a; font-size: 12px; margin-top: 2px; }

/* Registry */
.registry-list { list-style: none; margin: 0; padding: 0; }
/* Long non-table lists scroll inside their own box, like the tables;
   their layout rules above are untouched. */
.history-list, .mirror-list, .ranking, .registry-list {
    max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; }
.registry-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
                padding: 10px 0; border-bottom: 1px solid #1d2f28; font-size: 14px; }
.reg-truck { font-weight: 700; color: #fff; }
.reg-driver { color: #c9ddd3; }
.reg-cap { color: #8aa39a; }
.reg-motive { color: #4ade80; font-size: 12px; }
.reg-source { color: #7d938a; font-size: 12px; }
.registry-row form { margin-left: auto; }

/* Footer */
.fi-footer-line { color: #9db8ae; font-size: 13px; margin: 22px 0 0; }
.foot { color: #7d938a; font-size: 13px; line-height: 1.6; margin: 10px 0 0; }

/* Connectors page */
.top { max-width: 1100px; margin: 0 auto; padding: 28px 24px 0; }
.top h1 { margin: 0; font-size: 28px; color: #fff; }
.tag { background: #14532d; color: #86efac; border-radius: 999px; padding: 3px 10px;
       font-size: 12px; font-weight: 700; vertical-align: middle; }
.sub { color: #9db8ae; font-size: 15px; margin: 8px 0 0; }
.compare { color: #7d938a; font-size: 13px; margin: 6px 0 0; }
main { max-width: 1440px; margin: 0 auto; padding: 18px 24px 32px; }
.driver-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
               gap: 16px; margin-top: 16px; }
.driver-card { background: #0d1a16; border: 1px solid #1d2f28; border-radius: 14px;
               padding: 16px; }
.driver-top { display: flex; gap: 12px; align-items: flex-start; }
.driver-id h3 { margin: 0; font-size: 16px; color: #fff; }
.driver-id p { margin: 4px 0; color: #8aa39a; font-size: 13px; line-height: 1.5; }
.howto { font-size: 13px; color: #c9ddd3; line-height: 1.6; }
.howto code { background: #060a09; padding: 2px 6px; border-radius: 4px;
              color: #a7f3d0; font-size: 12px; }

@media (max-width: 1000px) {
  .fi-perf-grid { grid-template-columns: 1fr; }
  .fi-kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .fi-header h1 { font-size: 32px; }
  .history-row { flex-wrap: wrap; }
  .history-actual { margin-left: 0; text-align: left; }
}

/* Login page (Haull System) — same dark teal as the dashboard. */
.fi-login-page { min-height: 100vh; display: flex; align-items: center;
                justify-content: center; padding: 24px; }
.fi-login-card { background: #0d1f1a; border: 1px solid #1d2f28;
                border-radius: 16px; padding: 36px 40px; width: 100%;
                max-width: 400px; }
.fi-login-card h1 { margin: 0; font-size: 32px; font-weight: 800; color: #fff; }
.fi-login-sub { margin: 8px 0 24px; color: #9db8ae; font-size: 14px; }
.fi-login-error { background: #3f1512; border: 1px solid #7f1d1d; color: #fca5a5;
                 border-radius: 8px; padding: 10px 12px; font-size: 14px;
                 margin: 0 0 16px; }
.fi-login-label { display: block; color: #9db8ae; font-size: 13px;
                 margin: 0 0 6px; }
.fi-login-card input[type="text"], .fi-login-card input[type="password"] {
                 width: 100%; margin-bottom: 16px; }
.fi-login-btn { width: 100%; padding: 12px; font-size: 15px; }
