/* Placeholder styling until Vera's mobile design lands. Colour values are
   copied from the Cockpit's tokens (frontend/cockpit/index.html), not
   imported, so this folder stands alone. Swap the :root block to restyle. */
:root {
  --sb-void: #0A0C10;
  --sb-charcoal: #161B22;
  --sb-steel: #21262D;
  --sb-stroke: #30363D;
  --sb-teal: #2DD4BF;
  --sb-amber: #FBBF24;
  --sb-success-text: #34D399;
  --sb-error-text: #FB7185;
  --sb-text-primary: #E2E8F0;
  --sb-text-secondary: #94A3B8;
  --sb-text-muted: #8B949E;
  --sb-card-radius: 12px;
  --sb-badge-radius: 6px;
  --sb-button-radius: 10px;
  --tap: 44px;
  --tabs-h: 56px;
  --header-h: calc(57px + env(safe-area-inset-top));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sb-void);
  color: var(--sb-text-primary);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  min-height: 100vh;
}
body:not(.signed-in) { padding-bottom: env(safe-area-inset-bottom); }
body:not(.signed-in) .tabs, body:not(.signed-in) .top-actions { display: none; }

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--sb-text-muted); }

.top {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  box-sizing: border-box; min-height: var(--header-h);
  padding: calc(6px + env(safe-area-inset-top)) 16px 6px; background: var(--sb-void); border-bottom: 1px solid var(--sb-stroke);
}
.brand { font-weight: 700; letter-spacing: 0.02em; }
.top-actions { display: flex; gap: 8px; }
.icon-btn, .btn {
  min-height: var(--tap); min-width: var(--tap); padding: 0 14px;
  border-radius: var(--sb-button-radius); border: 1px solid var(--sb-stroke);
  background: var(--sb-steel); color: var(--sb-text-primary); font: inherit; cursor: pointer;
}
.btn { width: 100%; background: var(--sb-teal); color: var(--sb-void); border: 0; font-weight: 600; margin-top: 12px; }

.fresh { padding: 6px 16px; font-size: 14px; color: var(--sb-text-secondary); border-bottom: 1px solid var(--sb-stroke); }
.fresh-live::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--sb-success-text); margin-right: 8px; }
.fresh-stale, .fresh-offline { background: rgba(251, 191, 36, 0.12); color: var(--sb-amber); font-weight: 600; }

/* The page scrolls as a whole, in Safari and in standalone mode. body's
   bottom padding (tab bar + safe area) keeps the last row clear of the
   tab bar and the home indicator. */
main { padding: 8px 16px 24px; }
[id] { scroll-margin-top: calc(var(--header-h) + 56px); }

/* Placeholder section links; Vera's layout replaces these. */
.jump {
  position: sticky; top: var(--header-h); z-index: 1;
  display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 0 -16px 12px; padding: 6px 16px; background: var(--sb-void); border-bottom: 1px solid var(--sb-stroke);
  scrollbar-width: none;
}
.jump::-webkit-scrollbar { display: none; }
.jump-btn {
  flex-shrink: 0; min-height: var(--tap); padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--sb-stroke); background: var(--sb-charcoal); color: var(--sb-text-secondary);
  font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
h1 { font-size: 24px; margin: 12px 0; }
h2 { font-size: 18px; margin: 20px 0 6px; }
.note { color: var(--sb-text-secondary); font-size: 14px; margin: 4px 0 8px; }
.empty { color: var(--sb-text-muted); padding: 16px 0; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--sb-charcoal); border: 1px solid var(--sb-stroke); border-radius: var(--sb-card-radius); padding: 12px; min-height: var(--tap); }
.stat-wide { grid-column: 1 / -1; }
.stat-label { font-size: 14px; color: var(--sb-text-secondary); }
.stat-value { font-size: 22px; font-weight: 700; margin-top: 2px; }
.stat-wide .stat-value { font-size: 28px; }
.stat-sub { font-size: 14px; color: var(--sb-text-muted); margin-top: 2px; }
.tone-bad { color: var(--sb-error-text); }
.tone-good { color: var(--sb-success-text); }

.chip { display: inline-block; font-size: 13px; font-weight: 600; padding: 1px 8px; border-radius: var(--sb-badge-radius); vertical-align: middle; }
.chip-teal { background: rgba(45, 212, 191, 0.15); color: var(--sb-teal); }
.chip-amber { background: rgba(251, 191, 36, 0.15); color: var(--sb-amber); }
.chip-red { background: rgba(251, 113, 133, 0.15); color: var(--sb-error-text); }
.chip-neutral { background: var(--sb-steel); color: var(--sb-text-secondary); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--sb-stroke); }
.row { display: flex; gap: 12px; align-items: center; justify-content: space-between; min-height: 56px; padding: 8px 0; color: inherit; text-decoration: none; }
a.row { min-height: 56px; }
.row-main { min-width: 0; }
.row-title { font-weight: 600; }
.row-sub { font-size: 14px; color: var(--sb-text-secondary); }
.row-figs { text-align: right; flex-shrink: 0; }
.row-figs.big { font-size: 22px; font-weight: 700; }
.row.total { border-top: 2px solid var(--sb-stroke); }
.client { border-left: 4px solid transparent; padding-left: 10px; }
.seg-teal { border-left-color: var(--sb-teal); }
.seg-amber { border-left-color: var(--sb-amber); }
.legend { font-size: 14px; color: var(--sb-text-secondary); display: flex; align-items: center; gap: 6px; margin: 12px 0 4px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 8px; }
.sw-teal { background: var(--sb-teal); }
.sw-amber { background: var(--sb-amber); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.dot-good { background: var(--sb-success-text); }
.dot-teal { background: var(--sb-teal); }
.dot-amber { background: var(--sb-amber); }
.dot-muted { background: var(--sb-text-muted); }

.back { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--sb-teal); text-decoration: none; }
.back::before { content: "‹"; margin-right: 6px; font-size: 22px; }
.flags { padding-left: 20px; color: var(--sb-text-secondary); }

.table-wrap { overflow-x: auto; margin-top: 12px; }
table.rt { width: 100%; border-collapse: collapse; font-size: 14px; }
.rt th, .rt td { padding: 8px 6px; border-bottom: 1px solid var(--sb-stroke); text-align: right; white-space: nowrap; }
.rt th:first-child, .rt td:last-child { text-align: left; }
.rt thead th { color: var(--sb-text-secondary); font-weight: 600; }
.rt tr.future { color: var(--sb-text-muted); }
.band { font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: var(--sb-badge-radius); text-transform: capitalize; }
.band-green { background: rgba(52, 211, 153, 0.15); color: var(--sb-success-text); }
.band-amber { background: rgba(251, 191, 36, 0.15); color: var(--sb-amber); }
.band-red { background: rgba(251, 113, 133, 0.15); color: var(--sb-error-text); }

.signin .card { background: var(--sb-charcoal); border: 1px solid var(--sb-stroke); border-radius: var(--sb-card-radius); padding: 16px; margin: 12px 0; }
.signin label { display: block; font-weight: 600; margin-bottom: 6px; }
.signin input { width: 100%; min-height: var(--tap); font-size: 16px; padding: 8px 12px; border-radius: var(--sb-button-radius); border: 1px solid var(--sb-stroke); background: var(--sb-void); color: var(--sb-text-primary); }
.notice { padding: 12px; border-radius: var(--sb-card-radius); background: var(--sb-steel); margin: 8px 0; }
.notice-bad { background: rgba(251, 113, 133, 0.12); color: var(--sb-error-text); }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--sb-charcoal); border-top: 1px solid var(--sb-stroke);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}
.tabs a {
  min-height: var(--tabs-h); display: flex; align-items: center; justify-content: center;
  color: var(--sb-text-secondary); text-decoration: none; font-size: 13px; font-weight: 600;
}
.tabs a[aria-current="page"] { color: var(--sb-teal); box-shadow: inset 0 2px 0 var(--sb-teal); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--sb-teal); outline-offset: 2px; }
