/* OPS Day screen (build: ops-day-2). Dark, sized for a big screen; scales with the viewport. */
:root {
  --od-bg: #0c0b0a;
  --od-panel: #151311;
  --od-panel-2: #1c1916;
  --od-line: #2b2723;
  --od-text: #f6f2ed;
  --od-muted: #a59e96;
  --od-subtle: #6f6962;
  --od-accent: #e5582f;
  --od-accent-soft: rgba(229, 88, 47, 0.16);
  --od-good: #34c48e;
  --od-good-soft: rgba(52, 196, 142, 0.16);
  --od-gold: #f2c94c;
  --od-silver: #cfd4dc;
  --od-bronze: #d39063;
  --od-igv: #19c3cb;
  --od-igt: #8c6ae0;
  --od-b2b: #e9e4dd;
  --od-ogt: #f6963a;
  --od-ogv: #3d97f5;
  --od-b2c: #22b26a;
  --od-bd: #f2c94c;
  --od-display: "Yanone Kaffeesatz", "Oswald", sans-serif;
  --od-ui: "Oswald", system-ui, sans-serif;
  --od-body: "Poppins", system-ui, sans-serif;
  --od-gap: clamp(10px, 1.1vw, 22px);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body.od {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: var(--od-gap);
  height: 100%;
  padding: var(--od-gap) calc(var(--od-gap) * 1.4);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(229, 88, 47, 0.14), transparent 60%),
    var(--od-bg);
  color: var(--od-text);
  font-family: var(--od-body);
  font-size: clamp(12px, 0.78vw, 18px);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- top bar ---------- */
.od-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--od-gap); }
.od-brand { display: flex; align-items: center; gap: 14px; }
.od-brand img { width: clamp(34px, 2.6vw, 56px); height: auto; }
.od-kicker { margin: 0; font-family: var(--od-ui); font-size: 0.85em; letter-spacing: 0.22em; text-transform: uppercase; color: var(--od-muted); }
.od-brand h1 { margin: 0; font-family: var(--od-display); font-weight: 700; font-size: clamp(2.4rem, 3.6vw, 5rem); line-height: 0.85; letter-spacing: 0.02em; text-transform: uppercase; }
.od-live { display: flex; align-items: center; gap: 14px; justify-self: center; }
.od-pill {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px;
  background: var(--od-accent); color: #fff;
  font-family: var(--od-ui); font-size: 1.05em; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
}
.od-pill.is-stale { background: #8a6d1f; }
.od-pill.is-final .od-dot { animation: none; }
.od-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: od-pulse 1.4s ease-in-out infinite; }
@keyframes od-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.75); } }
.od-updated { font-family: var(--od-ui); letter-spacing: 0.06em; color: var(--od-muted); }
.od-clock { justify-self: end; display: grid; justify-items: end; }
.od-time { font-family: var(--od-display); font-weight: 600; font-size: clamp(2.2rem, 3.2vw, 4.4rem); line-height: 0.9; font-variant-numeric: tabular-nums; }
.od-date { font-family: var(--od-ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--od-muted); font-size: 0.9em; }

/* ---------- KPIs ---------- */
.od-kpis { display: grid; grid-template-columns: 1.15fr 1.15fr 1fr 1fr; gap: var(--od-gap); }
.od-kpi {
  position: relative; display: grid; gap: 4px; padding: clamp(12px, 1.1vw, 22px) clamp(14px, 1.3vw, 26px);
  background: var(--od-panel); border: 1px solid var(--od-line); overflow: hidden;
}
.od-kpi.is-main::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--od-accent); }
.od-kpi.is-approved::after { background: var(--od-good); }
.od-kpi.is-people::after { background: var(--od-gold); }
.od-kpi-label { font-family: var(--od-ui); font-size: 0.9em; letter-spacing: 0.18em; text-transform: uppercase; color: var(--od-muted); }
.od-kpi-value { font-family: var(--od-display); font-weight: 700; font-size: clamp(3rem, 4.6vw, 6.6rem); line-height: 0.88; font-variant-numeric: tabular-nums; }
.od-kpi-name { font-size: clamp(2.2rem, 3vw, 4.2rem); line-height: 1; padding-top: 0.12em; text-transform: uppercase; }
.od-kpi-sub { color: var(--od-muted); font-size: 0.95em; min-height: 1.4em; }
.od-kpi-value.is-bumped { animation: od-bump 0.9s ease-out; }
@keyframes od-bump { 0% { color: var(--od-gold); transform: translateY(-4px); } 100% { color: inherit; transform: none; } }

/* ---------- panels ---------- */
.od-grid { display: grid; grid-template-columns: 0.95fr 1.2fr 1.2fr; gap: var(--od-gap); min-height: 0; }
.od-panel { display: flex; flex-direction: column; min-height: 0; background: var(--od-panel); border: 1px solid var(--od-line); }
.od-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: clamp(10px, 0.9vw, 18px) clamp(14px, 1.2vw, 22px) 8px; border-bottom: 1px solid var(--od-line); }
.od-panel-head h2 { margin: 0; font-family: var(--od-display); font-weight: 700; font-size: clamp(1.7rem, 2vw, 2.9rem); line-height: 0.95; text-transform: uppercase; letter-spacing: 0.02em; }
.od-panel-head p { margin: 0; color: var(--od-muted); font-size: 0.9em; text-align: right; }
.od-approved-panel .od-panel-head h2 { color: var(--od-good); }

/* ---------- campaign points ---------- */
.od-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px clamp(14px, 1.2vw, 22px); border-bottom: 1px solid var(--od-line); font-family: var(--od-ui); font-size: 0.82em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--od-muted); }
.od-legend span { display: inline-flex; align-items: center; gap: 6px; }
.od-legend i { width: 10px; height: 10px; display: inline-block; }
.od-board { list-style: none; margin: 0; padding: 4px 0; flex: 1; min-height: 0; overflow: hidden; display: grid; grid-auto-rows: minmax(0, 1fr); font-size: min(1em, 1.6vh); }
.od-board li {
  position: relative; display: grid; grid-template-columns: 2.4em minmax(5.5em, 8.5em) minmax(0, 1fr) 3.6em;
  align-items: center; gap: clamp(8px, 0.7vw, 14px); min-height: 0; overflow: hidden;
  padding: 0 clamp(14px, 1.2vw, 22px); border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: transform 0.6s cubic-bezier(.2, .8, .2, 1);
}
.od-board .od-name { min-width: 0; font-weight: 500; font-size: 1.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-bar { display: flex; height: clamp(8px, 0.65vw, 14px); background: rgba(255, 255, 255, 0.05); }
.od-bar span { display: block; height: 100%; transition: width 0.8s ease; }
.od-points-total { text-align: right; font-family: var(--od-display); font-weight: 700; font-size: 1.6em; line-height: 1; font-variant-numeric: tabular-nums; }
.od-board .od-rank { width: 1.9em; height: 1.9em; }

.od-rank {
  display: inline-flex; align-items: center; justify-content: center; width: 2em; height: 2em;
  font-family: var(--od-ui); font-weight: 600; font-size: 0.95em; color: var(--od-muted);
  border: 1px solid var(--od-line);
}
.is-1 .od-rank { background: var(--od-gold); color: #1a1406; border-color: var(--od-gold); }
.is-2 .od-rank { background: var(--od-silver); color: #15171a; border-color: var(--od-silver); }
.is-3 .od-rank { background: var(--od-bronze); color: #1d120a; border-color: var(--od-bronze); }
.is-1 b, .is-1 .od-name, .is-1 .od-points-total, .is-1 .od-total { color: var(--od-gold); }
.od-table th.od-col-people { color: var(--od-gold); }
.od-table td.od-people { color: var(--od-gold); font-family: var(--od-display); font-weight: 600; font-size: 1.35em; text-align: right; padding-right: clamp(10px, 1vw, 18px); }
.od-move { position: absolute; left: 4px; font-size: 0.7em; font-family: var(--od-ui); }
.od-move.up { color: var(--od-good); }
.od-move.down { color: #e5584a; }

/* ---------- applications / approvals tables ---------- */
.od-table-wrap { flex: 1; min-height: 0; overflow: hidden; }
/* Text follows the screen height so all LCs and the Egypt row fit on any display. */
.od-table { width: 100%; height: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; font-size: min(1em, 1.45vh); }
.od-table th { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-table th {
  padding: 8px 6px; font-family: var(--od-ui); font-weight: 500; font-size: 0.82em; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--od-muted); text-align: center; border-bottom: 1px solid var(--od-line); background: var(--od-panel-2);
}
.od-table th.od-lc, .od-table td.od-lc { text-align: left; }
.od-table th.od-group { color: var(--od-text); font-size: 0.75em; letter-spacing: 0.22em; border-bottom: 0; padding-bottom: 0; }
.od-table th.od-col-total { color: var(--od-text); }
.od-table td { padding: 0 6px; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.04); font-size: 1.02em; }
.od-table tr { transition: transform 0.6s cubic-bezier(.2, .8, .2, 1); }
.od-table td.od-rank-cell { width: 3em; text-align: left; padding-left: clamp(10px, 1vw, 18px); }
.od-table td.od-lc b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.od-table td.od-zero { color: var(--od-subtle); }
.od-table td.od-heat { color: #fff; font-weight: 600; }
.od-table td.od-total { font-family: var(--od-display); font-weight: 700; font-size: 1.7em; text-align: right; padding-right: clamp(10px, 1vw, 18px); }
.od-table td.od-cell.is-new { animation: od-flash 2.4s ease-out; }
@keyframes od-flash { 0% { background: var(--od-gold); color: #1a1406; } 100% { background: transparent; } }
.od-table tfoot td { border-top: 1px solid var(--od-line); border-bottom: 0; color: var(--od-muted); font-family: var(--od-ui); letter-spacing: 0.06em; padding: 8px 6px; font-size: 0.95em; }
.od-table tfoot td.od-total { color: var(--od-text); font-size: 1.4em; }
.od-table .od-sep { border-left: 1px solid var(--od-line); }

/* ---------- footer ticker ---------- */
.od-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--od-gap); align-items: center; }
.od-ticker { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 10px 14px; background: var(--od-panel); border: 1px solid var(--od-line); }
.od-ticker-label { flex: none; padding: 3px 10px; background: var(--od-accent); color: #fff; font-family: var(--od-ui); letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.85em; }
#od-ticker { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.05em; }
.od-source { color: var(--od-subtle); font-size: 0.8em; max-width: 46ch; text-align: right; }

/* ---------- celebration ---------- */
.od-celebrate {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 6px; padding: 34px 64px;
  background: var(--od-good); color: #04170f; text-align: center; box-shadow: 0 30px 120px rgba(0, 0, 0, 0.6);
  animation: od-pop 4.2s ease forwards; z-index: 10;
}
.od-celebrate[hidden] { display: none; }
.od-celebrate-kicker { font-family: var(--od-ui); letter-spacing: 0.3em; text-transform: uppercase; font-size: 1.1em; }
.od-celebrate strong { font-family: var(--od-display); font-size: clamp(3.4rem, 6vw, 8rem); line-height: 0.9; text-transform: uppercase; }
.od-celebrate span:last-child { font-family: var(--od-ui); font-size: 1.6em; letter-spacing: 0.1em; text-transform: uppercase; }
@keyframes od-pop {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
  12%, 82% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -55%) scale(0.98); }
}

/* Smaller screens: stack, and let the page scroll. */
@media (max-width: 1100px) {
  body.od { height: auto; overflow: auto; grid-template-rows: auto; }
  .od-top { grid-template-columns: 1fr; justify-items: start; }
  .od-live, .od-clock { justify-self: start; justify-items: start; }
  .od-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .od-grid { grid-template-columns: 1fr; }
  .od-board { display: block; }
  .od-board li { min-height: 46px; }
  .od-table tr { height: 40px; }
  .od-foot { grid-template-columns: 1fr; }
  .od-source { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Tables: keep every row slim enough that all LCs and the Egypt row fit. */
.od-table td { line-height: 1.1; }
.od-table .od-rank { width: 1.55em; height: 1.55em; font-size: 0.85em; }
.od-table td.od-total { font-size: 1.4em; }
.od-table td.od-people { font-size: 1.15em; }
.od-table thead th { padding-top: 6px; padding-bottom: 6px; }
