/* Shared operator shell — source of truth: starter/ui-kit/css/shell.css
   Apps set html[data-app="lobby|console|back-office"] and load a theme file. */
:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #151b23;
  --panel-2: #1c232d;
  --panel-3: #222b36;
  --line: #2a323d;
  --ink: #e6edf3;
  --ink-dim: #9aa7b4;
  --ink-faint: #6b7885;
  --accent: #4c9aff;
  --ok: #3fb950;
  --bad: #f85149;
  --warn: #d29922;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, select, input { font: inherit; }
button { cursor: pointer; }

code, .mono {
  font-family: var(--mono);
  font-size: 12px;
}

.muted { color: var(--ink-dim); }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* —— Header —— */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 30;
  flex: none;
}

.topbar-brand { min-width: 0; }

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--ink-faint);
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.15;
}

.topbar .subtitle {
  margin: 4px 0 0;
  color: var(--ink-dim);
  font-size: 13px;
  max-width: 36rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  flex-wrap: nowrap;
}

.inline-form select {
  min-width: 180px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
}

/* —— Optional nav under header —— */
.views {
  display: flex;
  gap: 4px;
  padding: 8px 18px 0;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex: none;
}

.vtab {
  border: 1px solid transparent;
  border-bottom: none;
  background: none;
  color: var(--ink-dim);
  padding: 8px 15px;
  border-radius: 8px 8px 0 0;
  font-size: 13px;
  position: relative;
  top: 1px;
}

.vtab:hover { color: var(--ink); }

.vtab[aria-selected="true"] {
  color: var(--ink);
  background: var(--bg);
  border-color: var(--line);
  border-bottom: 1px solid var(--bg);
}

/* —— Page body —— */
.page,
main.page {
  flex: 1;
  min-height: 0;
  padding: 16px;
}

/* —— Footer —— */
.site-footer {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-faint);
  font-size: 12px;
}

.site-footer a { color: var(--ink-dim); }
.site-footer a:hover { color: var(--ink); }

/* —— Card —— */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.card + .card { margin-top: 16px; }

.card > h2 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.card > h2 .hint {
  text-transform: none;
  letter-spacing: 0;
  margin-left: auto;
  color: var(--ink-faint);
  font-weight: 400;
  font-size: 11px;
}

.card-body { padding: 14px; }

/* —— Table —— */
table,
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--ink-faint);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* —— Primitives —— */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-dim);
  white-space: nowrap;
}

.pill b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pill small { color: var(--ink-faint); }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex: none;
}

.dot.on { background: var(--ok); }
.dot.off { background: var(--bad); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  transition: 0.12s;
  white-space: nowrap;
}

.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #05203f;
  font-weight: 600;
}

.btn.ghost {
  background: transparent;
  color: var(--ink-dim);
}

.btn.wide { width: 100%; }

input[type="text"],
input[type="password"],
input[type="number"],
select {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
}
