/*
 * Deliberately plain. Phase 7 builds the real admin UI on Hotwire; this is
 * enough to read a page while the schema is under review.
 *


 */

/* v1.0 */

:root {
  --ink: #16181d;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #ffffff;
  --accent: #1f6feb;
  --warn: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 13px/1.5 ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

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

code {
  font: 13px/1.4 ui-monospace, "SF Mono", Menlo, monospace;
  background: #f6f7f9;
  padding: 1px 4px;
  border-radius: 3px;
}

.admin__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.admin__brand {
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

.admin__nav { display: flex; align-items: center; gap: 0.75rem; }
.admin__who { color: var(--muted); font-size: 13px; }
.admin__main { max-width: 62rem; margin: 0 auto; padding: 1.5rem 1.5rem 1.5rem 0; }

h1 { font-size: 1.5rem; margin: 0 0 0.25rem; letter-spacing: -0.02em; }
h2 { font-size: 1rem; margin: 2rem 0 0.5rem; }

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

table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

.flash {
  margin: 0 0 1rem;
  padding: 0.6rem 0.9rem 0.6rem 0;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #f6f7f9;
}

.flash--alert { border-color: #f3c7c3; background: #fdf3f2; color: var(--warn); }

button.link {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 0.3rem 0.7rem 0.3rem 0;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

form.button_to { display: inline; }

/* ---------------------------------------------------------------------------
 * Layout only. Everything below sets position, spacing and flow — no colour,
 * border, radius or type. Those still belong to phase 7's real UI pass.
 * ------------------------------------------------------------------------ */

.admin__main--wide { max-width: 82rem; margin: 0 auto; padding: 1.5rem 1.5rem 1.5rem 0; }
.public__main { max-width: 34rem; margin: 3rem auto; padding: 0 1.5rem 0 0; }

/* Page header: title block left, actions right, wrapping on narrow screens. */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-head__meta { margin-top: 0.25rem; }

.page-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

/* Generic arrangement primitives. */
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.grid { display: grid; gap: 0.75rem 1rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--tiles { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }

/* Blocks. */
.card { padding: 0.9rem 1rem; }
.card__title { margin-bottom: 0.5rem; }

.callout { padding: 0.75rem 0.9rem; }
.callout__title { margin-bottom: 0.25rem; }
.callout ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }

.empty { padding: 1.25rem; }

/* Tables scroll sideways rather than pushing the page wide. */
.table-wrap { overflow-x: auto; margin-top: 0.5rem; }

/* Forms: label, control, hint stacked; the inline variant is for checkboxes. */
.field { display: flex; flex-direction: column; gap: 0.25rem; }
.field input, .field select, .field textarea { width: 100%; padding: 0.4rem 0.5rem; }
.field__hint { margin-top: 0.1rem; }

.field--inline { flex-direction: row; align-items: center; gap: 0.45rem; }
.field--inline input[type="checkbox"] { width: auto; margin: 0; }

.checkboxes { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.checkboxes label { display: inline-flex; align-items: center; gap: 0.3rem; }

/* Buttons and badges size themselves around their label. */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
}

.button--small { padding: 0.2rem 0.5rem; }
.badge { display: inline-block; padding: 0.1rem 0.4rem; }

/* Stat tiles. */
.stat { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 0.8rem; }

/* Message preview — the body is pre-rendered plain text, so keep its breaks. */
.preview__head { padding: 0.6rem 0.75rem; }
.preview__body { padding: 0.75rem; white-space: pre-wrap; }

/* Sequence timeline: dot sits in the left gutter of each item. */
.timeline { display: flex; flex-direction: column; gap: 1rem; }
.timeline__item { position: relative; padding-left: 1.1rem; }

.timeline__dot {
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 0.5rem;
  height: 0.5rem;
}

.timeline__when { margin-bottom: 0.1rem; }

.right { text-align: right; }
.nowrap { white-space: nowrap; }

@media (max-width: 60rem) {
  .split, .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
}
