/* Hub styles. Colours only from tokens.css (copied from frontend/src/styles/tokens.css). */
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 16px; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.brand img, .logo { width: 32px; height: 32px; border-radius: 8px; }
.spacer { flex: 1; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
}
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 1.8rem; line-height: 1.1; }
.stat.red b { color: var(--crit); } .stat.yellow b { color: var(--warn); } .stat.green b { color: var(--ok); }
.two { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .two { grid-template-columns: 2fr 1fr; } }

/* landing */
.landing { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.landing .card { width: 100%; max-width: 420px; text-align: center; }
.landing .logo { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 8px; }

/* forms */
label { display: block; font-weight: 600; margin: 12px 0 4px; text-align: left; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-s);
  background: var(--surface-2); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn {
  display: inline-block; padding: 10px 16px; border: 1px solid var(--accent); border-radius: var(--radius-s);
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-strong); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.block { width: 100%; margin-top: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.linkbtn { background: none; border: 0; color: var(--text-2); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.errors, .errorlist { color: var(--crit); background: var(--crit-soft); border-radius: var(--radius-s); padding: 8px 12px; list-style: none; margin: 8px 0; text-align: left; }
.msg { background: var(--ok-soft); color: var(--ok); border-radius: var(--radius-s); padding: 8px 12px; margin-bottom: 12px; }
.helptext { color: var(--text-3); font-size: .85rem; }
.lang { display: inline-flex; gap: 8px; margin: 0; }
.lang form { display: inline; }

/* table */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
tr.inactive td { color: var(--text-3); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: .85rem; font-weight: 600; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.green { background: var(--ok-soft); color: var(--ok); }
.pill.yellow { background: var(--warn-soft); color: var(--warn); }
.pill.red { background: var(--crit-soft); color: var(--crit); }
.pill.grey { background: var(--surface-2); color: var(--text-2); }
code, pre { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
pre { background: var(--surface-2); padding: 12px; border-radius: var(--radius-s); overflow-x: auto; margin: 0; }
.token { display: block; padding: 12px; background: var(--surface-2); border: 1px dashed var(--accent); border-radius: var(--radius-s); word-break: break-all; user-select: all; }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--text-3); font-size: 11px; }
.chart .bar { fill: var(--ok); }
.chart .bar-warn { fill: var(--warn); }
.chart .line { fill: none; stroke: var(--c2); stroke-width: 2; stroke-linejoin: round; }
.chart .dot { fill: var(--c2); }
.donut { width: 140px; height: 140px; }
.donut-bg { fill: none; stroke: var(--surface-2); }
.donut-seg { fill: none; }
.donut-center { fill: var(--text); font-size: 22px; font-weight: 700; }
.seg-1 { stroke: var(--c1); } .seg-2 { stroke: var(--c2); } .seg-3 { stroke: var(--c3); }
.seg-4 { stroke: var(--c4); } .seg-5 { stroke: var(--c5); } .seg-6 { stroke: var(--c6); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.swatch.seg-1 { background: var(--c1); } .swatch.seg-2 { background: var(--c2); } .swatch.seg-3 { background: var(--c3); }
.swatch.seg-4 { background: var(--c4); } .swatch.seg-5 { background: var(--c5); } .swatch.seg-6 { background: var(--c6); }
.legend { list-style: none; padding: 0; margin: 8px 0 0; text-align: left; }
.donutbox { display: flex; flex-direction: column; align-items: center; }
