@import url("/shared/tokens.css?v=tl25up");

/* ══════════════════════════════════════════════════════════════════════
   لوحة المتابعة — the live board.

   Read from across a back-office room while something else has your attention,
   so it is built around one number that answers the only question a host asks
   all night: how many people are inside. Everything else is support, set at a
   deliberately quieter weight.

   Charts follow one rule taken from the data's job: these are magnitudes, not
   identities, so every mark is the same single hue and length does the work.
   No categorical palette means no colour-blind ambiguity to design around.
   Status (RSVP) is the one exception, and it ships with a label and a glyph so
   identity is never carried by colour alone.
   ══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--ink-900);
  color: var(--parchment);
  font-family: var(--font-ui);
  font-size: 15px;
}

.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
a { color: var(--brass); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 6px; }

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

.wrap { max-width: 1240px; margin: 0 auto; padding: 22px 20px 50px; }

/* ─────────────────────────────  masthead  ───────────────────────────── */

.masthead {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ink-700);
  box-shadow: 0 1px 0 rgba(201, 162, 74, .18);
  margin-bottom: 26px;
}

.masthead__main { flex: 1; min-width: 240px; }
.masthead__hosts { margin: 0 0 4px; font-size: 12px; letter-spacing: .18em; color: var(--brass); }
.masthead__event { margin: 0; font-family: var(--font-display); font-size: 27px; font-weight: 700; }
.masthead__meta { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }

.masthead__side { display: grid; gap: 10px; justify-items: end; }
.masthead__links { display: flex; gap: 14px; font-size: 13.5px; }

.live {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0; padding: 6px 13px;
  background: var(--ink-800); border: 1px solid var(--ink-700); border-radius: 999px;
  font-size: 12.5px; color: var(--muted);
}
.live__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-dim); }
.live[data-state="live"] { color: #10592B; background: #E9F7EE; border-color: rgba(21,136,63,.4); }
.live[data-state="live"] .live__dot { background: var(--green); animation: pulse 2s ease-in-out infinite; }
.live[data-state="lost"] { color: #7C3A0A; background: #FDF0E4; border-color: rgba(210,96,11,.45); }
.live[data-state="lost"] .live__dot { background: var(--orange); }

@keyframes pulse { 50% { opacity: .35; } }

/* ─────────────────────────────  hero  ───────────────────────────── */

.hero {
  display: grid; grid-template-columns: minmax(280px, 1.1fr) 2fr; gap: 16px;
  margin-bottom: 26px;
}

.hero__figure {
  padding: 24px 26px;
  background: var(--ink-850);
  border: 1px solid var(--ink-700);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.hero__label { margin: 0 0 10px; font-size: 13px; color: var(--muted); letter-spacing: .06em; }

/* The one number the room reads. Everything else is deliberately smaller. */
.hero__number {
  margin: 0;
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: clamp(46px, 8vw, 68px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--brass);
}
.hero__of { font-family: var(--font-ui); font-size: 14px; font-weight: 500; color: var(--muted); }

.meter {
  height: 10px; margin: 20px 0 10px;
  background: var(--ink-750);
  border-radius: 999px;
  overflow: hidden;
}
.meter__fill {
  height: 100%;
  width: 0;
  background: var(--brass);
  border-radius: 999px;
  transition: width .6s cubic-bezier(.22,.9,.28,1);
}

.hero__sub { margin: 0; font-size: 13px; color: var(--muted); }
.hero__sub span { font-family: var(--font-mono); color: var(--parchment); }

.hero__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0; }

.tile {
  padding: 16px 18px;
  background: var(--ink-850);
  border: 1px solid var(--ink-700);
  border-radius: 18px;
}
.tile dt { font-size: 12.5px; color: var(--muted-dim); }
.tile dd {
  margin: 8px 0 4px;
  font-family: var(--font-mono);
  font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums;
  line-height: 1;
}
.tile span { font-size: 11.5px; color: var(--muted-dim); }
.tile--warn dd { color: var(--orange); }

/* ─────────────────────────────  blocks  ───────────────────────────── */

.block {
  padding: 20px 22px 22px;
  background: var(--ink-850);
  border: 1px solid var(--ink-700);
  border-radius: 20px;
  margin-bottom: 16px;
}

.block__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.block__head h2 { margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.note { margin: 0; font-size: 12.5px; color: var(--muted-dim); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.split .block { margin-bottom: 16px; }

/* ─────────────────────────────  funnel  ───────────────────────────── */

.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.funnel li { display: grid; grid-template-columns: 132px 1fr auto; align-items: center; gap: 14px; }
.funnel__label { font-size: 13.5px; color: var(--muted); }

.funnel__track { display: block; height: 26px; background: var(--ink-750); border-radius: 7px; overflow: hidden; }
/* display:block matters — the bar is a <span> inside a non-flex track, and an
   inline box ignores width entirely, which renders every stage as an empty rail.
   4px rounded data-end, anchored to the baseline; length carries the value. */
.funnel__bar { display: block; height: 100%; background: var(--brass); border-radius: 0 4px 4px 0; min-width: 3px; }
.funnel li[data-tone="muted"] .funnel__bar { background: var(--ink-600); }

.funnel__value { font-family: var(--font-mono); font-size: 15px; font-weight: 600; min-width: 66px; text-align: start; }
.funnel__value small { display: block; font-size: 11px; color: var(--muted-dim); font-weight: 400; }

/* ─────────────────────────────  arrivals chart  ───────────────────────────── */

.chart { margin: 0; }

.chart__plot {
  display: flex; align-items: flex-end; gap: 2px;
  height: 190px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--ink-700);
  overflow-x: auto;
}

.bar { position: relative; flex: 1 1 0; min-width: 9px; display: flex; align-items: flex-end; height: 100%; }

.bar__mark {
  width: 100%;
  background: var(--brass);
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  transition: height .4s ease;
}
.bar:hover .bar__mark { background: var(--brass-dim); }

/* Peak is the only labelled bar: a number on every mark is noise. */
.bar__peak {
  position: absolute; top: -20px; inset-inline: 0;
  text-align: center;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--parchment);
}

.bar__tick {
  position: absolute; bottom: -22px; inset-inline: -20px;
  text-align: center;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-dim);
  white-space: nowrap;
}

.bar__tip {
  position: absolute; bottom: 100%; inset-inline-start: 50%;
  transform: translateX(50%) translateY(-6px);
  padding: 7px 10px;
  background: var(--ink-700);
  border: 1px solid var(--ink-600);
  border-radius: 8px;
  font-size: 12px; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .12s ease;
  z-index: 5;
}
.bar:hover .bar__tip, .bar:focus-within .bar__tip { opacity: 1; }

.chart__caption { margin: 14px 0 0; font-size: 12.5px; color: var(--muted-dim); }

.table-view { margin-top: 14px; }
.table-view summary { font-size: 12.5px; color: var(--muted); cursor: pointer; }
.table-view table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 13px; }
.table-view th, .table-view td { padding: 7px 10px; border-bottom: 1px solid var(--ink-800); text-align: start; }
.table-view th { color: var(--muted-dim); font-weight: 600; font-size: 12px; }
.table-view td { font-family: var(--font-mono); }

/* ─────────────────────────────  breakdown rows  ───────────────────────────── */

.brk { display: grid; gap: 13px; }

.brk__row { display: grid; gap: 7px; }
.brk__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.brk__name { font-size: 14px; }
.brk__val { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.brk__val b { color: var(--parchment); }

.brk__track { height: 9px; background: var(--ink-750); border-radius: 999px; overflow: hidden; }
.brk__fill { height: 100%; background: var(--brass); border-radius: 999px; min-width: 3px; transition: width .5s ease; }

.brk__meta { font-size: 11.5px; color: var(--muted-dim); }

/* ─────────────────────────────  feeds  ───────────────────────────── */

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 340px; overflow-y: auto; }

.feed li {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 11px 13px;
  background: var(--ink-800);
  border: 1px solid var(--ink-700);
  border-radius: 12px;
  font-size: 13.5px;
  /* leading edge marks the kind of entry — always paired with words */
  border-inline-start: 3px solid var(--ink-600);
}

.feed li[data-kind="normal"] { border-inline-start-color: var(--green); }
.feed li[data-kind="override"] { border-inline-start-color: var(--orange); }
.feed li[data-kind="offline"] { border-inline-start-color: var(--blue); }
.feed--alert li { border-inline-start-color: var(--red); }

.feed b { color: var(--parchment); font-weight: 600; }
.feed span { color: var(--muted); }
.feed time { margin-inline-start: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted-dim); }
.feed .empty { color: var(--muted-dim); }

.badge {
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: var(--ink-750); color: var(--muted);
}
.badge--warn { background: #FDF0E4; color: #7C3A0A; }
.badge--info { background: #E8EEFC; color: #143A8A; }

.foot { margin-top: 22px; text-align: center; font-size: 12px; color: var(--muted-dim); }
.foot time { font-family: var(--font-mono); }

/* ─────────────────────────────  failure  ───────────────────────────── */

.fail { text-align: center; padding: 90px 24px; }
.fail h1 { margin: 0 0 10px; font-family: var(--font-display); font-size: 23px; }
.fail p { margin: 0 0 8px; color: var(--muted); font-size: 14.5px; line-height: 1.7; }

/* ─────────────────────────────  narrow  ───────────────────────────── */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .funnel li { grid-template-columns: 104px 1fr auto; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .meter__fill, .brk__fill, .bar__mark { transition: none; }
  .live[data-state="live"] .live__dot { animation: none; }
}
