/* gapplesmp-admin — flat, dark, quiet.
   Borders and spacing do the work shadows would. Flat fills only. */

:root {
  --bg: #0b0e13;
  --panel: #12161d;
  --line: #232a35;
  --text: #e2e8f0;
  --muted: #64748b;
  --primary: #ffd854;
  --java: #60a5fa;
  --bedrock: #4ade80;
  --danger: #f87171;

  --radius-panel: 13px;
  --radius-chip: 7px;
  --gap: 16px;
  --pad: 24px;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3 {
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 20px;
}
h2 {
  font-size: 15px;
}

a {
  color: var(--text);
  text-decoration-color: var(--line);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-color: var(--muted);
}

/* Digits must not jump while the page polls. */
.num,
time,
th,
td,
.stat-value,
.stat-sub,
.chart text {
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- layout ---------- */

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

main.wrap {
  padding-bottom: 64px;
}

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

.site-header {
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 56px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 4px;
  margin-right: auto;
}

.nav a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius-chip);
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.nav a:hover {
  color: var(--text);
}

.nav a[aria-current="page"] {
  color: var(--primary);
  background: var(--panel);
}

.nav-auth {
  font: inherit;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  padding: 6px 12px;
  text-decoration: none;
  cursor: pointer;
}

.nav-auth:hover {
  color: var(--text);
  border-color: var(--muted);
}

.nav-auth-form {
  margin: 0;
}

/* ---------- panels ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head .hint {
  color: var(--muted);
  font-size: 12px;
}

.panel-body {
  padding: 8px 20px 16px;
}

.section {
  margin-bottom: 24px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* ---------- stat cards ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .stats {
    grid-template-columns: 1fr;
  }
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 16px 18px 18px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.1;
}

.stat-value .of {
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
}

.stat-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-sub .java {
  color: var(--java);
}
.stat-sub .bedrock {
  color: var(--bedrock);
}

/* ---------- chips ---------- */

.chip {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
  color: var(--muted);
}

/* Platform is never colour alone — the word is always there too. */
.chip-java {
  color: var(--java);
  border-color: var(--java);
}

.chip-bedrock {
  color: var(--bedrock);
  border-color: var(--bedrock);
}

.chip-first {
  color: var(--primary);
  border-color: var(--primary);
}

.chip-danger {
  color: var(--danger);
  border-color: var(--danger);
}

.chip-online {
  color: var(--bedrock);
  border-color: var(--bedrock);
}

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

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rows li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.rows li:last-child {
  border-bottom: none;
}

.row-name {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.row-name:hover {
  text-decoration: underline;
  text-decoration-color: var(--muted);
}

.row-meta {
  color: var(--muted);
  font-size: 12px;
}

.row-spacer {
  margin-left: auto;
}

/* ---------- chat ---------- */

.msg {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.msg:last-child {
  border-bottom: none;
}

.msg-time {
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
}

.msg-date {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.msg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.msg-text {
  grid-column: 2;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.msg-blocked .msg-text,
.msg-blocked .msg-head .row-name {
  color: var(--muted);
}

mark {
  background: none;
  color: var(--primary);
  border-bottom: 1px solid var(--primary);
  padding: 0;
}

@media (max-width: 520px) {
  .msg {
    grid-template-columns: 1fr;
  }
  .msg-text {
    grid-column: 1;
  }
}

/* ---------- forms ---------- */

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-grow {
  flex: 1 1 260px;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

input[type="text"],
input[type="search"],
input[type="password"] {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  padding: 8px 10px;
  width: 100%;
  min-width: 0;
}

input::placeholder {
  color: var(--muted);
}

input:hover {
  border-color: var(--muted);
}

.btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  padding: 8px 14px;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--muted);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #0b0e13;
  font-weight: 600;
}

.btn-block {
  width: 100%;
}

.btn[hidden] {
  display: none;
}

.more-wrap {
  padding: 14px 0 2px;
  text-align: center;
}

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

.login-card {
  max-width: 360px;
  margin: 48px auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 28px;
}

.login-card h1 {
  margin-bottom: 6px;
}

.login-card p.lede {
  color: var(--muted);
  margin: 0 0 20px;
}

.login-card .field {
  margin-bottom: 16px;
}

.form-error {
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius-chip);
  padding: 8px 10px;
  margin: 0 0 16px;
  font-size: 13px;
}

/* ---------- status dot ---------- */

.status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

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

.status-stale .dot {
  background: var(--danger);
}

.status-stale {
  color: var(--danger);
}

/* ---------- chart ---------- */

.chart {
  display: block;
  width: 100%;
  height: auto;
}

.chart text {
  fill: var(--muted);
  font-size: 10px;
  font-family: var(--font);
}

.chart .grid {
  stroke: var(--line);
  stroke-width: 1;
}

/* Line chart: flat strokes, round joins, solid round markers on the grid
   intersections. No fills under the lines, nothing layered. */
.chart .line-joins,
.chart .line-messages {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart .line-joins {
  stroke: var(--primary);
}

.chart .line-messages {
  stroke: var(--java);
}

.chart .dot-joins {
  fill: var(--primary);
}

.chart .dot-messages {
  fill: var(--java);
}

/* Drag-to-zoom on the activity chart. */
.chart {
  touch-action: none; /* a horizontal drag must not scroll the page instead */
  cursor: crosshair;
}

.chart-surface {
  cursor: crosshair;
}

/* Flat translucent fill, nothing layered or blurred. */
.chart-band {
  fill: var(--primary);
  fill-opacity: 0.14;
}

.chart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 2px;
  min-height: 30px;
  flex-wrap: wrap;
}

.chart-readout {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.btn-small {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-small[hidden] {
  display: none;
}

.legend {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 0 12px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: none;
}

.swatch-joins {
  background: var(--primary);
}

.swatch-messages {
  background: var(--java);
}

/* ---------- misc ---------- */

.muted {
  color: var(--muted);
}

.empty {
  color: var(--muted);
  padding: 20px 0;
  text-align: center;
}

.dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 20px;
  margin: 0;
  padding: 4px 0 8px;
}

.dl dt {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dl dd {
  margin: 0;
}

.uuid {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.active-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  padding: 12px 0 0;
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--panel);
  border: 1px solid var(--primary);
  border-radius: var(--radius-chip);
  padding: 8px 12px;
}

/* The only motion in the app: content fading in as it loads. */
.fade {
  opacity: 1;
  transition: opacity 120ms linear;
}

.fade-out {
  opacity: 0;
}

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