/*
 * Doorway IQ — the wall display.
 *
 * Built for a meeting-room screen: full width, large type, readable from the
 * far end of a table. No selector here names a panel, a figure or anything
 * else withheld from a role — the stylesheet is the one file every role
 * downloads, so a rule called #panel-comparison would put the comparison's
 * frame into bytes gc_admin receives. Everything is generic: .panel, .num,
 * .badge, .fill.
 *
 * COLOUR NEVER CARRIES MEANING ALONE. Every status colour appears beside a
 * word and a glyph. Roughly one man in twelve cannot reliably tell the
 * measured green from the fallback amber, and a fallback that reads as
 * "fine, just a different shade" is the single most expensive
 * misunderstanding this screen could cause.
 *
 * Fonts are self-hosted: Archivo and IBM Plex Mono, both SIL Open Font
 * License 1.1, latin subset only. Self-hosted rather than fetched from a CDN
 * so the screen renders identically on a site network that blocks it, and so
 * the page needs no third-party origin in its content security policy.
 */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/dashboard/assets/archivo-500.ab74eca5ad11.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/dashboard/assets/archivo-700.abada6cd4c92.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/dashboard/assets/plexmono-500.01d285447409.woff2') format('woff2');
}

:root {
  --petrol: #0b3c49;
  --petrol-deep: #06262f;
  --petrol-line: #17505f;
  --petrol-ink: #e8f1f3;
  --paper: #f4f7f8;
  --ink: #10262d;
  --ink-soft: #476069;
  --rule: #d3dfe3;

  /* Semantic, and never used without a word beside them. */
  --measured: #1a6b46;
  --measured-wash: #e4f2ea;
  --fallback: #a33a12;
  --fallback-wash: #fceee8;
  --pending: #4a5b66;
  --pending-wash: #eef2f4;

  --body: 'Archivo', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --figures: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ---- the bar --------------------------------------------------------- */

.bar {
  background: var(--petrol);
  color: var(--petrol-ink);
  padding: 18px 28px;
  display: flex;
  align-items: baseline;
  gap: 20px;
  flex-wrap: wrap;
  border-bottom: 4px solid var(--petrol-deep);
}

.bar h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.bar .who {
  margin-left: auto;
  font-size: 15px;
  opacity: 0.85;
}

.bar .stamp {
  font-family: var(--figures);
  font-size: 15px;
  opacity: 0.85;
}

.bar form {
  display: inline;
}

.bar button {
  font: inherit;
  font-size: 14px;
  color: var(--petrol-ink);
  background: transparent;
  border: 1px solid var(--petrol-line);
  border-radius: 4px;
  padding: 4px 12px;
  cursor: pointer;
}

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

main {
  padding: 24px 28px 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.panel {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}

.panel > h2 {
  margin: 0;
  padding: 14px 20px;
  font-size: 19px;
  font-weight: 700;
  background: #fff;
  border-bottom: 2px solid var(--petrol);
}

.panel > p {
  margin: 0;
  padding: 12px 20px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 20px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

th {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: var(--paper);
}

tbody tr:last-child td {
  border-bottom: none;
}

.group td {
  background: var(--petrol-deep);
  color: var(--petrol-ink);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.num {
  font-family: var(--figures);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.wide {
  font-size: 22px;
  font-weight: 700;
}

.said {
  color: var(--ink-soft);
  font-style: italic;
  font-size: 15px;
}

/* ---- badges: colour plus a word, always ------------------------------ */

.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.badge-measured {
  color: var(--measured);
  background: var(--measured-wash);
}

.badge-fallback {
  color: var(--fallback);
  background: var(--fallback-wash);
}

.badge-pending,
.badge-unknown {
  color: var(--pending);
  background: var(--pending-wash);
}

/* A row whose space is not being counted. Unmistakable at ten feet, and
   never a blank that could pass for a quiet room. */
tr.is-fallback td {
  background: var(--fallback-wash);
}

tr.is-fallback td:first-child {
  box-shadow: inset 5px 0 0 var(--fallback);
}

/* ---- tank fill ------------------------------------------------------- */

.fill {
  display: inline-block;
  width: 180px;
  height: 14px;
  background: var(--rule);
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 12px;
}

.fill > span {
  display: block;
  height: 100%;
  background: var(--petrol);
}

/*
 * Widths as classes, in steps of five, because the page carries no inline
 * style attribute at all — style-src 'self' forbids them, and that is the
 * policy that also forbids a script. The exact figure is printed beside the
 * bar, so rounding the bar costs nothing a reader relies on.
 */
.fill-0 > span { width: 0%; }
.fill-5 > span { width: 5%; }
.fill-10 > span { width: 10%; }
.fill-15 > span { width: 15%; }
.fill-20 > span { width: 20%; }
.fill-25 > span { width: 25%; }
.fill-30 > span { width: 30%; }
.fill-35 > span { width: 35%; }
.fill-40 > span { width: 40%; }
.fill-45 > span { width: 45%; }
.fill-50 > span { width: 50%; }
.fill-55 > span { width: 55%; }
.fill-60 > span { width: 60%; }
.fill-65 > span { width: 65%; }
.fill-70 > span { width: 70%; }
.fill-75 > span { width: 75%; }
.fill-80 > span { width: 80%; }
.fill-85 > span { width: 85%; }
.fill-90 > span { width: 90%; }
.fill-95 > span { width: 95%; }
.fill-100 > span { width: 100%; }

/* ---- sign-in --------------------------------------------------------- */

.signin {
  max-width: 420px;
  margin: 12vh auto;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 32px;
}

.signin h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
}

.signin p {
  margin: 0 0 24px;
  color: var(--ink-soft);
}

.signin p.hint {
  margin: -2px 0 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

.signin label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.signin input {
  font: inherit;
  font-family: var(--figures);
  width: 100%;
  padding: 11px 13px;
  margin-bottom: 20px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
}

.signin input:focus {
  outline: 3px solid var(--petrol-line);
  outline-offset: 1px;
}

.signin button {
  font: inherit;
  font-weight: 700;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 4px;
  background: var(--petrol);
  color: var(--petrol-ink);
  cursor: pointer;
}

.refused {
  padding: 11px 14px;
  margin-bottom: 20px;
  border-radius: 4px;
  color: var(--fallback);
  background: var(--fallback-wash);
  border: 1px solid currentColor;
  font-size: 15px;
}

.foot {
  padding: 0 28px 32px;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ---- the full-width grid --------------------------------------------- */
/*
 * Generic names only, as the header says: this file is downloaded by every
 * role, so a selector called .difference or .savings would carry the fact that
 * such a column exists into bytes a role is gated away from. .grid, .tot,
 * .picker, .lead and .ahead say how something is laid out and nothing about
 * what it contains.
 */

body.full main {
  padding: 20px 20px 48px;
  gap: 20px;
}

.picker {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 15px;
}

.bar .picker,
.bar a.picker {
  margin-left: auto;
}

.picker label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 13px;
  color: var(--ink-soft);
}

.picker input {
  font-family: var(--figures);
  font-size: 17px;
  padding: 7px 10px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}

.picker a {
  color: var(--petrol);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 1px;
}

.picker a:hover,
.picker a:focus {
  border-bottom-color: var(--petrol);
}

p.lead {
  margin: 0;
  font-size: 17px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

/* The totals block. Figures large, limits stated underneath in words. */
div.tot {
  background: #fff;
  border: 1px solid var(--rule);
  border-left: 5px solid var(--petrol);
  border-radius: 6px;
  padding: 16px 20px;
}

div.tot.lead {
  background: var(--petrol);
  border-color: var(--petrol-deep);
  color: var(--petrol-ink);
}

div.tot .who {
  display: block;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 13px;
  color: var(--ink-soft);
}

div.tot.lead .who,
div.tot.lead .said {
  color: var(--petrol-ink);
}

div.tot dl {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin: 10px 0 8px;
}

div.tot dt {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

div.tot.lead dt {
  color: var(--petrol-ink);
}

div.tot dd {
  margin: 2px 0 0;
}

div.tot dd .num {
  font-size: 34px;
  font-weight: 500;
}

div.tot dd .said {
  font-size: 19px;
}

div.tot p.said {
  margin: 0;
  max-width: 96ch;
  line-height: 1.5;
}

/* The seven-day grid. */
table.grid th,
table.grid td {
  padding: 9px 12px;
  border-right: 1px solid var(--rule);
}

table.grid th:first-child,
table.grid td:first-child {
  width: 1%;
  white-space: nowrap;
  background: var(--paper);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
  color: var(--ink);
}

table.grid thead th {
  text-align: right;
  white-space: nowrap;
}

table.grid thead th .said {
  font-style: normal;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}

table.grid td {
  text-align: right;
}

table.grid td .num {
  display: block;
  font-size: 18px;
}

table.grid td .said {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

table.grid .ahead {
  color: var(--pending);
  background: var(--pending-wash);
}

table.grid .tot {
  background: var(--paper);
  border-right: none;
  border-left: 2px solid var(--petrol);
}

table.grid td.tot .num {
  font-weight: 700;
}

@media (max-width: 1100px) {
  table.grid {
    display: block;
    overflow-x: auto;
  }
}

table.grid .group td {
  text-align: left;
}

/* The one button on a refused page, to the reader's own start page. */
a.button { display: inline-block; min-height: 44px; padding: 10px 16px; border-radius: 8px; background: var(--petrol); color: var(--petrol-ink); font-weight: 600; text-decoration: none; }
