/* Console layout and base elements, on the HvBackup design system (docs/design). Colours only from tokens (css/tokens.css);
   components (pills, banner, tiles, nights, capacity, progress, chips, tabs, side menu) in css/components.css. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/20px var(--font-sans); background: var(--canvas); color: var(--ink); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Shell: white side menu, canvas main area. */
.shell { display: flex; min-height: 100vh; }
.side { width: 232px; flex: none; position: sticky; top: 0; height: 100vh; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side a:hover { text-decoration: none; }
.side .foot { margin-top: auto; }
.side .foot form { padding: 8px 10px; font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; min-width: 0; }
.who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { flex: 1; min-width: 0; padding: 32px; max-width: 1440px; display: flow-root; }
main.bare { max-width: none; }

/* Type */
h1 { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.4px; margin: 0 0 4px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; text-wrap: balance; }
h2 { font-size: 17px; line-height: 24px; font-weight: 600; margin: 28px 0 10px; }
.sub { color: var(--ink-2); margin: 0 0 20px; }
.crumbs { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.muted { color: var(--ink-3); } .small { font-size: 12px; line-height: 16px; }
.why { display: block; font-size: 12px; line-height: 16px; color: var(--ink-3); margin-top: 3px; }
.error { color: var(--bad-ink); font-weight: 600; } .okmsg { color: var(--good-ink); font-weight: 600; }

/* Cards and the health banner (banner classes come from components.css). */
.card { margin: 0 0 16px; }
.tiles { margin-bottom: 16px; }
.tile .value a { color: inherit; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .row2 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .shell { flex-direction: column; } .side { width: auto; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--line); } main { padding: 20px 16px; } }

/* Tables: every plain table looks like the design's .table. */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-card); overflow: hidden; }
th { text-align: left; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-3); padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td, tr.row:hover td { background: var(--surface-sunken); }
td.name a { font-weight: 600; color: var(--ink); } td.name .small { display: block; color: var(--ink-3); font-weight: 400; }
td.num, th.num { text-align: right; }

/* Controls: plain buttons and inputs follow the design's .btn. */
button, .btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 14px/20px var(--font-sans); cursor: pointer; }
button:hover, .btn:hover { background: var(--surface-sunken); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button[disabled] { opacity: .5; cursor: default; }
button.link { border: none; background: none; color: var(--accent); padding: 0; height: auto; font-weight: 500; }
button.link:hover { background: none; text-decoration: underline; }
input, select, textarea { font: 14px/20px var(--font-sans); height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); width: 100%; max-width: 440px; background: var(--surface); color: var(--ink); }
textarea { height: auto; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: auto; height: auto; }
label { display: block; font-weight: 600; margin: 14px 0 4px; } .hint { color: var(--ink-3); font-size: 12px; line-height: 16px; margin-top: 3px; }
.code { font: 12.5px/18px var(--font-mono); background: var(--surface-sunken); border: 1px solid var(--line); padding: 10px 12px; border-radius: var(--radius-sm); word-break: break-all; color: var(--ink); }
pre.code { white-space: pre-wrap; }
.copyrow { display: flex; gap: 8px; align-items: flex-start; } .copyrow .code { flex: 1; min-width: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
details > summary { cursor: pointer; color: var(--accent); }

/* Live activity bar (server page) uses the design's progress look. */
.bar { height: 6px; background: var(--run-tint); border-radius: var(--radius-pill); overflow: hidden; margin: 10px 0 6px; } .bar > div { height: 100%; background: var(--run); border-radius: var(--radius-pill); }

/* Legend swatches reuse the night cell colours. */
.legend { margin-top: 8px; }
.legend i.ok { background: var(--good); } .legend i.warn { background: var(--warn); } .legend i.bad { background: var(--bad); } .legend i.run { background: var(--run); } .legend i.none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--night-empty); }

/* Overview: running now, results chart, servers toolbar (P006 step 2). */
.lives { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card.live { margin: 0; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.live .top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.live .top a { color: var(--ink); }
.live .top .pill { margin-left: auto; }
.live .foot { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--ink-3); }
.progress.busy > div { width: 30%; animation: hv-busy 1.6s ease-in-out infinite; }
@keyframes hv-busy { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .progress.busy > div { animation: none; width: 100%; opacity: .5; } }
.chartcard { padding: 18px 20px; }
.chartcard .head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.chartcard h2 { margin: 0 0 6px; }
svg.chart { width: 100%; height: auto; display: block; max-height: 240px; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .axis { fill: var(--ink-3); font: 11px var(--font-sans); }
svg.chart .hit { fill: transparent; }
svg.chart g:hover .hit { fill: var(--surface-sunken); }
svg.chart .good { fill: var(--good); } svg.chart .warn { fill: var(--warn); } svg.chart .bad { fill: var(--bad); } svg.chart .run { fill: var(--run); }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 28px 0 10px; }
.toolbar h2 { margin: 0 8px 0 0; }
.toolbar input[type=search] { margin-left: auto; max-width: 260px; }
.chip.on:hover { background: var(--ink); }
@media (max-width: 700px) { .toolbar input[type=search] { margin-left: 0; max-width: none; } }
.tablewrap { overflow-x: auto; border-radius: var(--radius-md); }
@media (max-width: 1240px) { #servers .opt { display: none; } }
.live .foot span:last-child { white-space: nowrap; }
#overview.stale { opacity: .55; }

/* Backups and Alerts (P006 step 3). */
a.chip { display: inline-flex; align-items: center; text-decoration: none; }
a.chip:hover { text-decoration: none; background: var(--surface-sunken); } a.chip.on:hover { background: var(--ink); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select { width: auto; max-width: 220px; }
tr.link { cursor: pointer; }
.tabs { margin-bottom: 16px; }
.tabs a { display: inline-flex; gap: 6px; align-items: center; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs a b { font-weight: 600; font-size: 12px; color: var(--ink-3); }
.nights a { display: block; } .nights a:hover i { outline: 2px solid var(--focus); outline-offset: 1px; }
td.when { white-space: nowrap; }

/* Server page (P006 step 4). */
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pagehead h1 { margin-bottom: 12px; }
.tile .value.small { font-size: 20px; line-height: 28px; }
.tile .cap { margin-top: 10px; }
svg.chart .axis.strong { fill: var(--ink); font-weight: 600; }
.card > .head { display: flex; align-items: baseline; gap: 10px; }
