/* Poninski Operations Board.
 *
 * The visual language agreed on the mockup: black artboard, hairline grid,
 * monospace uppercase for every piece of chrome, hard corners throughout.
 * Single dark world, so colours are painted outright rather than switched
 * by theme.
 *
 * Fonts are the system stack, not Geist and IBM Plex Mono as in the mockup.
 * Loading them would mean either an external request on every page — which the
 * Content-Security-Policy deliberately forbids — or shipping the font files.
 * That is a decision worth making once the pages exist, not a default.
 */

:root {
  color-scheme: dark;

  --canvas: #000000;
  --surface: #0C0C0C;
  --surface-2: #171717;
  --hairline: #262626;
  --hairline-soft: #1A1A1A;

  --ink: #FFFFFF;
  --ink-muted: #999999;
  --ink-faint: #5A5A5A;

  --accent: #0099FF;

  /* State. Separate from the accent on purpose — blue never means "wrong". */
  --success: #22C55E;
  --warning: #FF7A3D;
  --critical: #FF5577;

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

  --wrap: 1180px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mono { font-family: var(--mono); font-size: .92em; }

/* ---------- chrome ---------- */
.chrome,
.eyebrow,
.nav__item,
.btn,
thead th,
.panel__label,
.field__label {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--hairline);
  padding: 8px 13px;
  font-size: 11px;
  color: var(--ink);
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--ink);
  flex: none;
}

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  cursor: pointer;
  font-size: 11px;
  padding: 12px 18px;
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  color: var(--ink);
}
.btn:hover { border-color: var(--ink-muted); }
.btn--primary {
  background: var(--ink);
  color: var(--canvas);
  border-color: var(--ink);
}
.btn--primary:hover { background: #E6E6E6; }
.btn--quiet {
  background: none;
  border-color: transparent;
  color: var(--ink-muted);
  padding: 8px 10px;
}
.btn--quiet:hover { color: var(--ink); border-color: var(--hairline); }

/* ---------- top bar ---------- */
.shell { max-width: var(--wrap); margin: 0 auto; padding: 20px 24px 80px; }

.bar {
  border: 1px solid var(--hairline);
  background: var(--canvas);
}
.bar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.5px;
}
/* The coat of arms. The artwork is white on transparency, so it needs no colour
 * treatment — it sits directly on the canvas. Sized in the two places it
 * appears: small beside the wordmark in the bar, large on the sign-in page. */
.crest { display: block; width: auto; flex: none; }
.crest--bar { height: 30px; }
.crest--large { height: 104px; }

/* Sign-in lockup: arms above the wordmark, echoing the printed logo's
 * wide-set caps with "LIMITED" beneath. */
.lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.lockup__word {
  font-size: 29px;
  font-weight: 600;
  letter-spacing: .17em;
  text-transform: uppercase;
  line-height: 1;
  /* letter-spacing adds a trailing gap; pull it back so the word reads centred */
  text-indent: .17em;
}
.lockup__sub {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-indent: .34em;
}
.whoami {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.whoami b { color: var(--ink); font-weight: 500; }
.whoami form { margin: 0; }

/* ---------- panels ---------- */
.panel { border: 1px solid var(--hairline); background: var(--surface); }
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.panel__label { font-size: 11px; color: var(--ink); }
.panel__meta { font-size: 12.5px; color: var(--ink-muted); }
.panel__body { padding: 18px; color: var(--ink-muted); font-size: 13.5px; }

/* ---------- login ---------- */
.login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px 20px;
}
.login__form {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 10px; color: var(--ink-muted); }
.field input {
  font-family: var(--sans);
  font-size: 15px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--ink);
  border-radius: 0;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

/* Fixed height so an error appearing doesn't shove the form down the page. */
.login__error {
  min-height: 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--critical);
  text-align: center;
}
.login__note {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}

@media (max-width: 640px) {
  .shell { padding: 14px 14px 60px; }
}

/* The lockup adds real height to the sign-in page. On a short screen — a phone
 * in landscape, or a small laptop — give some of it back rather than pushing
 * the button below the fold. */
@media (max-height: 780px) {
  .crest--large { height: 64px; }
  .login { gap: 18px; }
  .lockup__word { font-size: 23px; }
}

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


/* ---------- pages ----------
 * Written out rather than lifted wholesale from the mockup: a regex extraction
 * re-defined .panel, .eyebrow and .shell on top of the definitions above, which
 * is exactly the cascade collision that makes spacing mysteriously not apply.
 * Only what the pages actually use is here.
 */

/* Navigation */
.nav { display: flex; border-top: 1px solid var(--hairline); overflow-x: auto; }
.nav__item {
  border: 0;
  border-right: 1px solid var(--hairline);
  padding: 12px 16px;
  font-size: 11px;
  color: var(--ink-muted);
  background: none;
  white-space: nowrap;
  text-decoration: none;
}
.nav__item:hover { color: var(--ink); background: var(--surface); text-decoration: none; }
.nav__item.is-active {
  color: var(--ink);
  background: var(--surface-2);
  box-shadow: inset 0 -2px 0 var(--accent);
}

main { display: flex; flex-direction: column; gap: 22px; padding-top: 22px; }

.page__head { display: flex; flex-direction: column; gap: 14px; }
.page__head h1 { font-size: 26px; font-weight: 700; letter-spacing: -1px; line-height: 1.1; }
.page__head p { color: var(--ink-muted); font-size: 14px; max-width: 62ch; }

/* Headline figures */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); }
.figure {
  padding: 17px 18px;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.figure__label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.figure__value {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.figure__note { font-size: 12.5px; color: var(--ink-muted); }
.figure--alert .figure__value { color: var(--critical); }

/* Tables */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left;
  font-size: 10px;
  color: var(--ink-muted);
  padding: 11px 18px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
tbody td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--hairline-soft);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.soft { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }

/* Severity. The only place colour means anything is "this is wrong". */
td.stripe { border-left: 2px solid transparent; }
tr.is-critical td.stripe { border-left-color: var(--critical); }
tr.is-warning td.stripe { border-left-color: var(--warning); }
tr.is-critical .flag { color: var(--critical); }
tr.is-warning .flag { color: var(--warning); }

/* Status tags: semantic state reads by colour. Selection, below, reads by lift. */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 7px;
  background: var(--surface-2);
  color: var(--ink-muted);
  white-space: nowrap;
}
.tag--live { color: var(--ink); }
.tag--done { color: var(--success); }
.tag--warn { color: var(--warning); }

/* What needs attention */
.alerts { display: flex; flex-direction: column; }
.alert {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--hairline-soft);
  border-left: 2px solid transparent;
}
.alert:last-child { border-bottom: 0; }
.alert--critical { border-left-color: var(--critical); }
.alert--warning { border-left-color: var(--warning); }
.alert--idle { border-left-color: var(--hairline); }
.alert__count {
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  line-height: 1.15;
}
.alert--critical .alert__count { color: var(--critical); }
.alert--warning .alert__count { color: var(--warning); }
.alert--idle .alert__count { color: var(--ink-faint); }
.alert__body { display: flex; flex-direction: column; gap: 3px; }
.alert__what { font-size: 14.5px; font-weight: 500; }
.alert__why { font-size: 12.5px; color: var(--ink-muted); }
.alert--idle .alert__what { color: var(--ink-muted); }
/* Pushed right so every alert ends at the same place — the eye finds the
   action without reading the sentence first. */
.alert__go {
  margin-left: auto;
  align-self: center;
  flex-shrink: 0;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.alert__go:hover { text-decoration: underline; }

/* Filters. Selection reads as lift, never colour — that is reserved for state. */
.chips { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--hairline); }
.chip {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 11px 15px;
  border: 0;
  border-right: 1px solid var(--hairline);
  background: none;
  color: var(--ink-muted);
  text-decoration: none;
}
.chip:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.chip.is-on { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

/* Panel headings. The number is a real sequence on the pages that use it —
 * sections read in order — so it is set as chrome, not as body text. */
.panel__title { display: flex; align-items: baseline; gap: 10px; }
.panel__no {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* A stated fact, as opposed to .figure__value which carries a headline number. */
.figure__fact { font-size: 14px; color: var(--ink); }

/* ---------- forms ----------
 * The enquiry capture screen. Shares .field with the sign-in page; what is added
 * here is the two-column row, and matching treatment for textarea and select,
 * which the login page never needed.
 */
.form { display: flex; flex-direction: column; gap: 16px; padding: 18px; }

/* Controls that sit inside a panel alongside content, rather than being the
 * whole page — the stage mover and the quote box on a job. */
.form--inline {
  flex-direction: row;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  border-top: 1px solid var(--hairline);
}
.form--inline .field { flex: 1 1 160px; }

.tickbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-muted);
  padding-bottom: 12px;
  white-space: nowrap;
}
.tickbox input { accent-color: var(--accent); width: 16px; height: 16px; }

/* Won / lost, sitting inside a table cell rather than as a page-level action. */
.inline-actions { display: flex; gap: 6px; margin: 0; align-items: center; }
.btn--tiny { font-size: 9.5px; padding: 6px 10px; }

/* An editable value in a table cell. Sized to the column, not to the page. */
.input--inline {
  font-family: var(--sans);
  font-size: 13.5px;
  padding: 6px 9px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--ink);
  border-radius: 0;
  min-width: 0;
  width: 100%;
  max-width: 240px;
}
.input--inline:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

/* A retired lookup row. Still there — historic records point at it — but plainly
   no longer in play. */
tr.is-retired td { color: var(--ink-faint); }
tr.is-retired .input--inline { color: var(--ink-faint); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field--narrow { max-width: 170px; }

.form textarea,
.form select {
  font-family: var(--sans);
  font-size: 15px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--ink);
  border-radius: 0;
  width: 100%;
}
.form textarea { resize: vertical; min-height: 76px; line-height: 1.45; }
.form textarea::placeholder { color: var(--ink-faint); }
.form textarea:focus,
.form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.form__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.form__note { font-size: 12.5px; color: var(--ink-muted); }

.form__error {
  border-left: 2px solid var(--critical);
  background: var(--surface-2);
  padding: 12px 14px;
  font-size: 13.5px;
}

.form button[disabled] { opacity: .45; cursor: not-allowed; }

@media (max-width: 640px) {
  .form__row { grid-template-columns: 1fr; }
  .field--narrow { max-width: none; }
}

/* ---------- the job timeline ----------
 * Oldest first, because that is the order things happened in. The timestamp
 * column is fixed-width and monospaced so the events line up down the page and
 * the eye can find a date without reading every row.
 */
.events { display: flex; flex-direction: column; }

.event {
  display: flex;
  gap: 18px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline-soft);
}
.event:last-child { border-bottom: 0; }

.event__when {
  flex: none;
  width: 148px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.event__stamp {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.event__kind {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* The rule is the spine of the timeline — it reads as one continuous thread
 * rather than as a stack of separate rows. */
.event__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 1px solid var(--hairline);
  padding-left: 18px;
  min-width: 0;
}
.event__what { font-size: 14px; }
.event__who { font-size: 12.5px; color: var(--ink-faint); }

@media (max-width: 640px) {
  .event { flex-direction: column; gap: 6px; }
  .event__when { width: auto; flex-direction: row; align-items: baseline; gap: 10px; }
  .event__body { border-left: 0; padding-left: 0; }
}

/* ---------- the approval queue ----------
 * These replace inline style attributes that the Content-Security-Policy
 * (style-src 'self') silently blocked, so they never actually applied.
 */
.decide { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.decide__note { flex: 1; min-width: 180px; max-width: none; }
.decide__locked {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-faint);
}

.alert__body--grow { flex: 1; }
.scroll--spaced { margin-top: 10px; }
.payload__key { width: 160px; }

/* Empty states. Never a blank panel — always what is missing and why. */
.notyet {
  padding: 18px;
  font-size: 13.5px;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.notyet b { color: var(--ink); font-weight: 600; }

.footnote {
  font-size: 12.5px;
  color: var(--ink-muted);
  padding: 13px 18px;
  border-top: 1px solid var(--hairline);
}

@media (max-width: 640px) {
  .figure { border-right: 0; }
}
