/* Octane Tolls Performance Reports - shared design tokens + hub frame.
   Light theme only. Every hub class is prefixed "hub-" so it never collides
   with the report pages it is injected into. */
:root {
  --hub-page:      #f6f7f9;
  --hub-surface:   #ffffff;
  --hub-border:    #e3e6eb;
  --hub-hairline:  #eef0f3;
  --hub-ink:       #111827;
  --hub-ink-2:     #4b5563;
  --hub-muted:     #8a8f98;
  --hub-accent:    #2a78d6;
  --hub-accent-2:  #1c5cab;
  --hub-accent-bg: #e8f1fc;
  --hub-track:     #cde2fb;
  --hub-good:      #0a7d0a;
  --hub-good-bg:   #e7f5e7;
  --hub-warn:      #8a5a00;
  --hub-warn-bg:   #fff4dc;
  --hub-warn-mark: #fab219;
  --hub-crit:      #b42323;
  --hub-crit-bg:   #fdeaea;
  --hub-radius:    10px;
  --hub-font:      system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

/* ---------- top bar (on every page) ---------- */
.hub-bar, .hub-bar * { box-sizing: border-box; }
.hub-bar {
  font-family: var(--hub-font);
  background: var(--hub-surface);
  border-bottom: 1px solid var(--hub-border);
  display: flex; align-items: center; gap: 28px;
  padding: 0 24px; min-height: 56px; flex-wrap: wrap;
  position: relative; z-index: 50;
}
.hub-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--hub-ink); }
.hub-logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--hub-accent);
  color: #fff; font-weight: 700; font-size: 15px; display: grid; place-items: center;
}
.hub-brand-text { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.15; }
.hub-brand-text small { display: block; font-size: 11px; font-weight: 500; color: var(--hub-muted); letter-spacing: 0; }
.hub-nav, .hub-bar nav.hub-nav { display: flex; gap: 4px; flex-wrap: wrap; padding: 0; border: 0; background: none; }
.hub-nav a {
  font-size: 13.5px; font-weight: 550; color: var(--hub-ink-2); text-decoration: none;
  padding: 18px 12px 16px; border-bottom: 2px solid transparent; line-height: 1;
}
.hub-nav a:hover { color: var(--hub-ink); }
.hub-nav a.hub-active { color: var(--hub-accent-2); border-bottom-color: var(--hub-accent); }
.hub-bar-meta { font-size: 12px; color: var(--hub-muted); }

/* ---------- global search ---------- */
.hub-search { position: relative; margin-left: auto; flex: 0 1 380px; min-width: 220px; }
.hub-search input {
  width: 100%; font: 13.5px var(--hub-font); color: var(--hub-ink);
  padding: 9px 34px 9px 34px; border: 1px solid var(--hub-border); border-radius: 8px; background: var(--hub-page)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a8f98' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") no-repeat 11px 50%;
  outline: none; -webkit-appearance: none; appearance: none;
}
.hub-search input:focus { border-color: var(--hub-accent); background-color: var(--hub-surface); box-shadow: 0 0 0 3px var(--hub-accent-bg); }
.hub-search kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 11px var(--hub-font);
  color: var(--hub-muted); border: 1px solid var(--hub-border); border-radius: 4px; padding: 0 5px; background: var(--hub-surface);
  pointer-events: none;
}
.hub-search input:focus + kbd { display: none; }
.hub-s-panel {
  position: absolute; right: 0; top: calc(100% + 6px); width: min(620px, 92vw); max-height: 72vh; overflow-y: auto;
  background: var(--hub-surface); border: 1px solid var(--hub-border); border-radius: var(--hub-radius);
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.14); z-index: 1000; padding: 6px; text-align: left;
}
.hub-s-panel[hidden] { display: none; }
.hub-s-acc { padding: 8px 6px 6px; }
.hub-s-acc + .hub-s-acc { border-top: 1px solid var(--hub-hairline); }
.hub-s-name { font-size: 14px; font-weight: 600; color: var(--hub-ink); padding: 0 6px 4px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.hub-s-name mark { background: #fff1c2; color: inherit; border-radius: 2px; }
.hub-s-meta { font-size: 12px; font-weight: 500; color: var(--hub-muted); margin-left: auto; }
.hub-s-aka { font-size: 11.5px; font-weight: 500; color: var(--hub-muted); }
.hub-s-hit {
  display: flex; align-items: baseline; gap: 10px; padding: 6px; border-radius: 6px;
  text-decoration: none; color: var(--hub-ink-2); font-size: 12.5px; outline: none;
}
.hub-s-hit:hover, .hub-s-hit:focus { background: var(--hub-accent-bg); color: var(--hub-ink); }
.hub-s-where { flex: 1 1 auto; min-width: 0; }
.hub-s-val { flex: none; font-variant-numeric: tabular-nums; color: var(--hub-ink); font-weight: 550; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-s-val i { font-style: normal; font-weight: 500; color: var(--hub-muted); }
.hub-s-more, .hub-s-empty { font-size: 12px; color: var(--hub-muted); padding: 4px 6px 2px; }
.hub-s-empty { padding: 14px 10px; font-size: 13px; }

/* ---------- account summary page ---------- */
.hub-a-head { margin-bottom: 16px; }
.hub-a-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.hub-a-chip { padding: 14px 16px; }
.hub-a-chip span { display: block; font-size: 12.5px; color: var(--hub-ink-2); font-weight: 550; }
.hub-a-chip b { display: block; font-size: 20px; font-weight: 650; margin-top: 4px; letter-spacing: -0.01em; }
.hub-a-chip b.good { color: var(--hub-good); }
.hub-a-chip b.crit { color: var(--hub-crit); }
.hub-a-flags { margin-bottom: 12px; border-left: 3px solid var(--hub-warn-mark); }
.hub-a-flags.hub-a-clear { border-left-color: var(--hub-good); display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--hub-ink-2); padding: 14px 18px; }
.hub-a-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px; align-items: start; }
.hub-a-sec h2, .hub-a-flags h2 { font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--hub-ink-2); margin: 0 0 10px; }
.hub-a-sec ul, .hub-a-flags ul { list-style: none; margin: 0; padding: 0; }
.hub-a-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; font-size: 13.5px; line-height: 1.45; border-top: 1px solid var(--hub-hairline); }
.hub-a-item:first-child { border-top: 0; }
.hub-a-item a { color: var(--hub-ink); text-decoration: none; }
.hub-a-item a:hover { color: var(--hub-accent-2); }
.hub-a-go { color: var(--hub-muted); font-size: 11px; margin-left: 6px; }
.hub-a-item a:hover .hub-a-go { color: var(--hub-accent); }
.hub-a-mark { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; margin-top: 1px; }
.hub-a-mark.good { background: var(--hub-good-bg); color: var(--hub-good); }
.hub-a-mark.warn { background: var(--hub-warn-bg); color: var(--hub-warn); }
.hub-a-mark.crit { background: var(--hub-crit-bg); color: var(--hub-crit); }
.hub-a-places .hub-a-item { font-size: 12.5px; color: var(--hub-ink-2); }
.hub-a-empty { max-width: 560px; }
.hub-a-empty p { color: var(--hub-ink-2); margin: 6px 0 0; }
.hub-s-name a { color: inherit; text-decoration: none; }
.hub-s-name a:hover, .hub-s-name a:focus { color: var(--hub-accent-2); text-decoration: underline; outline: none; }
.hub-s-sum { font-size: 11.5px; font-weight: 600; color: var(--hub-accent-2); background: var(--hub-accent-bg); border-radius: 999px; padding: 1px 8px; text-decoration: none; }
.hub-s-sum:hover, .hub-s-sum:focus { background: var(--hub-accent); color: #fff; outline: none; }
@media (max-width: 900px) { .hub-a-grid { grid-template-columns: minmax(0, 1fr); } }

/* row a search result jumped to */
tr.hub-hit-row > td { animation: hub-flash 3.2s ease-out; }
@keyframes hub-flash { 0%, 55% { background: #fff1c2; } 100% { background: transparent; } }

/* ---------- overview page ---------- */
body.hub-page { margin: 0; background: var(--hub-page); color: var(--hub-ink); font-family: var(--hub-font); font-size: 14px; }
.hub-main { max-width: 1400px; margin: 0 auto; padding: 28px 24px 64px; }
.hub-h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; margin: 0 0 4px; }
.hub-sub { color: var(--hub-ink-2); margin: 0 0 22px; font-size: 13.5px; }
.hub-h2 {
  font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--hub-ink-2); margin: 34px 0 12px; display: flex; align-items: baseline; gap: 12px;
}
.hub-h2 a { font-size: 12.5px; text-transform: none; letter-spacing: 0; font-weight: 550; color: var(--hub-accent-2); text-decoration: none; }
.hub-h2 a:hover { text-decoration: underline; }

.hub-card {
  background: var(--hub-surface); border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius); padding: 20px 22px;
}

/* freshness strip */
.hub-fresh { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hub-fresh-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.hub-fresh-item b { display: block; font-size: 13.5px; font-weight: 600; }
.hub-fresh-item span { font-size: 12.5px; color: var(--hub-ink-2); }
.hub-fresh-item a { color: inherit; text-decoration: none; }
.hub-fresh-item a:hover b { color: var(--hub-accent-2); }
.hub-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 1px; }
.hub-dot.ok   { background: var(--hub-good-bg); color: var(--hub-good); }
.hub-dot.warn { background: var(--hub-warn-bg); color: var(--hub-warn); }
.hub-dot.crit { background: var(--hub-crit-bg); color: var(--hub-crit); }
.hub-alert {
  margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-size: 13px;
  background: var(--hub-warn-bg); color: var(--hub-warn); border: 1px solid #f3dca6;
}

/* hero + meter */
.hub-hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px; }
.hub-hero-label { font-size: 13px; color: var(--hub-ink-2); font-weight: 550; }
.hub-hero-value { font-size: 52px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.05; margin: 6px 0 2px; }
.hub-hero-value small { font-size: 18px; font-weight: 550; color: var(--hub-ink-2); letter-spacing: 0; margin-left: 6px; }
.hub-hero-note { font-size: 13px; color: var(--hub-ink-2); }
.hub-meter { position: relative; margin: 34px 0 30px; }
.hub-meter-track { height: 12px; border-radius: 6px; background: var(--hub-track); position: relative; }
.hub-meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--hub-accent); }
.hub-tick { position: absolute; top: -8px; bottom: -8px; width: 2px; background: var(--hub-ink); border-radius: 1px; }
.hub-tick.dashed { background: repeating-linear-gradient(to bottom, var(--hub-ink-2) 0 3px, transparent 3px 6px); }
.hub-tick-label { position: absolute; top: 22px; transform: translateX(-50%); font-size: 11.5px; color: var(--hub-ink-2); white-space: nowrap; }
.hub-tick-label.top { top: -26px; }
.hub-tick-label b { color: var(--hub-ink); font-weight: 600; }
.hub-meter-ends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--hub-muted); margin-top: 6px; }
.hub-hit { position: absolute; top: -12px; bottom: -12px; width: 18px; transform: translateX(-50%); cursor: default; }
.hub-hit:hover::after, .hub-hit:focus::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--hub-ink); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; white-space: nowrap; z-index: 5;
}

/* stat tiles */
.hub-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.hub-tile { padding: 16px 18px; text-decoration: none; color: inherit; display: block; transition: border-color .15s; }
a.hub-tile:hover { border-color: var(--hub-accent); }
.hub-tile-label { font-size: 12.5px; color: var(--hub-ink-2); font-weight: 550; }
.hub-tile-value { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; margin: 6px 0 4px; line-height: 1.1; }
.hub-tile-sub { font-size: 12.5px; color: var(--hub-ink-2); }
.hub-tile-src { font-size: 11px; color: var(--hub-muted); margin-top: 8px; }

.hub-delta-up   { color: var(--hub-good); font-weight: 600; }
.hub-delta-down { color: var(--hub-crit); font-weight: 600; }
.hub-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.hub-pill.warn { background: var(--hub-warn-bg); color: var(--hub-warn); }
.hub-pill.ok   { background: var(--hub-good-bg); color: var(--hub-good); }

/* rep table */
.hub-table-wrap { overflow-x: auto; padding: 0; }
.hub-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.hub-table th, .hub-table td { padding: 10px 9px; text-align: right; white-space: nowrap; }
.hub-table th:first-child, .hub-table td:first-child { text-align: left; }
.hub-table thead tr.hub-group th {
  font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--hub-ink-2);
  text-align: center; border-bottom: 1px solid var(--hub-border); padding-top: 14px;
}
.hub-table thead tr.hub-group th a { color: inherit; text-decoration: none; }
.hub-table thead tr.hub-group th a:hover { color: var(--hub-accent-2); }
.hub-table thead tr.hub-cols th { font-size: 12px; font-weight: 550; color: var(--hub-muted); border-bottom: 1px solid var(--hub-border); }
.hub-table tbody td { border-bottom: 1px solid var(--hub-hairline); }
.hub-table tbody tr:hover td { background: #fafbfc; }
.hub-table .hub-sep { border-left: 1px solid var(--hub-border); }
.hub-table td.hub-rep { font-weight: 600; }
.hub-table tr.hub-other td { color: var(--hub-ink-2); }
.hub-table tfoot td { font-weight: 650; border-top: 1px solid var(--hub-border); }
.hub-table td.hub-flags { text-align: left; white-space: normal; min-width: 150px; max-width: 220px; font-size: 12px; color: var(--hub-ink-2); }
.hub-dim { color: var(--hub-muted); }
.hub-foot { font-size: 12px; color: var(--hub-muted); margin-top: 10px; line-height: 1.5; }

@media (max-width: 900px) {
  .hub-fresh, .hub-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hub-main { padding: 20px 16px 48px; }
  .hub-bar { padding: 0 16px; gap: 10px; }
  .hub-bar-meta { display: none; }
  .hub-search { flex: 1 1 100%; margin: 0 0 10px; order: 3; }
  .hub-nav { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .hub-nav a { white-space: nowrap; padding: 14px 10px 12px; }
  .hub-hero-value { font-size: 40px; }
}
