/* PinPoint Control — Mono Edge, the app's own palette, so the panel and the
   product read as one thing. Single dark theme on purpose: this is an
   operations console, not a document. */

:root {
  color-scheme: dark;

  --ink:        #0B0B0C;
  --surface:    #111113;
  --raised:     #17171A;
  --line:       #2A2A2F;
  --line-soft:  #1C1C20;

  --violet:     #7C5CFF;
  --violet-ink: #9B85FF;
  --mint:       #00E5A0;
  --pink:       #FF3D7F;
  --amber:      #FFB020;
  --danger:     #FF4D4D;

  --text:   #FFFFFF;
  --text-2: #A4A4AC;
  --text-3: #8B8B93;

  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r-control: 10px;
  --r-card: 12px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

img { max-width: 100%; }
[hidden] { display: none !important; }

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 56px;
}

.mono-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--text-3);
}

h1, h2, h3 { text-wrap: balance; margin: 0; letter-spacing: -0.5px; }

/* ------------------------------------------------------------------ header */

header.bar {
  position: sticky;
  top: 0;
  z-index: 9;
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}
.bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.logo {
  width: 30px; height: 30px; flex: none;
  border-radius: 8px;
  background: var(--violet);
  display: grid; place-items: center;
}
.logo span { width: 11px; height: 11px; border-radius: 50%; background: var(--ink); display: block; }
.brand { font-weight: 800; font-size: 16px; letter-spacing: -0.5px; }
.brand em { font-style: normal; color: var(--text-3); font-weight: 600; }
.bar-spacer { flex: 1 1 auto; min-width: 0; }
.who {
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px;
}

/* -------------------------------------------------------------------- tabs */

nav.tabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-block: 0 22px;
}
nav.tabs button {
  appearance: none; background: none; border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-3);
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  letter-spacing: 0.3px;
  padding: 12px 14px; cursor: pointer;
  margin-bottom: -1px;
}
nav.tabs button:hover { color: var(--text-2); }
nav.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--violet); }

/* ---------------------------------------------------------------- controls */

button.btn, .btn {
  appearance: none; cursor: pointer;
  font-family: var(--sans); font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.4px;
  padding: 10px 15px; border-radius: var(--r-control);
  border: 1px solid var(--line);
  background: var(--raised); color: var(--text);
}
button.btn:hover { border-color: #3A3A42; }
button.btn.primary { background: var(--violet); border-color: var(--violet); color: var(--ink); }
button.btn.primary:hover { background: var(--violet-ink); border-color: var(--violet-ink); }
button.btn:disabled { opacity: .5; cursor: default; }
button.btn.ghost { background: transparent; }

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], select {
  font-family: var(--sans); font-size: 13px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-control);
  padding: 10px 11px; width: 100%; min-width: 0;
}
input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--violet-ink); outline-offset: 2px;
}
label.field { display: grid; gap: 6px; min-width: 0; }
label.field > span {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-3);
}

.filters {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 14px;
  margin-bottom: 16px;
  align-items: end;
}
/* The buttons get a row of their own rather than a cell in the field grid.
   As one more auto-fit cell they were placed by the grid wherever the fields
   happened to leave a gap -- which, at a wide enough window, was the far top
   corner, floating away from the controls they act on. */
.filters .actions {
  grid-column: 1 / -1;
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid var(--line-soft);
  margin-top: 4px;
}

/* ------------------------------------------------------------------- tiles */

.tile-group { margin-bottom: 26px; }
.tile-group > .mono-label { display: block; margin-bottom: 11px; }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(146px, 1fr)); }
.tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 15px 16px; min-width: 0;
}
.tile .v {
  font-size: 27px; font-weight: 800; letter-spacing: -1px;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.tile .k {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-3); margin-top: 7px;
}
.tile.accent { border-color: #35306B; }
.tile.accent .v { color: var(--violet-ink); }
.tile.good .v { color: var(--mint); }
.tile.warn .v { color: var(--amber); }
.tile.bad  .v { color: var(--danger); }

/* ------------------------------------------------------------------ charts */

.charts {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: 26px;
}
.chart {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 15px 16px 11px; min-width: 0;
}
.chart h3 { font-size: 13.5px; font-weight: 700; }
.chart .sub {
  font-family: var(--mono); font-size: 10px; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--text-3); margin-top: 5px;
}
.chart svg { display: block; width: 100%; height: auto; margin-top: 12px; }

/* ------------------------------------------------------------------ tables */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th, td {
  text-align: left; padding: 11px 13px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
th {
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-3);
  background: var(--raised); position: sticky; top: 0;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #141417; }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
td.id { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
td.wrap-cell { white-space: normal; min-width: 220px; max-width: 360px; }

.pill {
  display: inline-block; padding: 3px 8px; border-radius: 999px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
  border: 1px solid currentColor;
}
.pill.ok   { color: var(--mint); }
.pill.wait { color: var(--amber); }
.pill.off  { color: var(--text-3); }
.pill.bad  { color: var(--danger); }
.pill.hot  { color: var(--pink); }

.pager { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.pager .count {
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- login card */

.login-shell { min-height: 72vh; display: grid; place-items: center; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 28px 26px; width: 100%; max-width: 410px;
}
.card h2 { font-size: 23px; font-weight: 800; margin-bottom: 8px; }
.card p.lede { color: var(--text-2); font-size: 13.5px; line-height: 1.55; margin: 0 0 22px; }
.card .stack { display: grid; gap: 14px; }

.note {
  border: 1px solid var(--line); border-left: 3px solid var(--violet);
  background: var(--raised); border-radius: var(--r-control);
  padding: 12px 14px; color: var(--text-2);
  font-size: 12.5px; line-height: 1.55;
}
.note.err { border-left-color: var(--danger); color: var(--text); }
.note.ok  { border-left-color: var(--mint); }

.empty { padding: 44px 24px; text-align: center; color: var(--text-3); font-size: 13px; line-height: 1.6; }

.skel {
  color: var(--text-3); font-family: var(--mono); font-size: 11px;
  letter-spacing: 1.1px; text-transform: uppercase; padding: 36px 0; text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* A printed page is a report: drop the furniture, keep the data readable. */
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; }
  header.bar, nav.tabs, .filters, .pager, #signOut { display: none !important; }
  .tile, .chart, .table-wrap { border-color: #ccc; background: #fff; }
  .tile .v, h1, h2, h3 { color: #000; }
  th { background: #f2f2f2; color: #333; }
  td, .tile .k, .chart .sub { color: #333; }
}
