:root {
  /* CM Labels & Packaging brand */
  --navy: #212F62;
  --burgundy: #8C1B24;
  --cream: #F5F1E8;
  --blush: #D7A5AA;      /* burgundy tint – accent text on navy */

  --bg: #10182F;         /* deep navy page ground */
  --panel: #212F62;      /* brand navy cards */
  --panel-2: #2B3B78;
  --line: rgba(255,255,255,.14);
  --text: #F5F1E8;
  --muted: rgba(245,241,232,.66);
  --accent: var(--blush);
  --brand: var(--burgundy);

  /* status colours (kept semantic) */
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --grey: #8a93ad;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", "Segoe UI", Roboto, Arial, sans-serif;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  font-size: clamp(14px, 1.1vw, 28px);
}

/* ---------- Header ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2vh 2vw;
  background: var(--panel);
  border-bottom: 4px solid var(--brand);
  gap: 2vw;
}
.brand { display: flex; align-items: center; gap: .8vw; font-weight: 800; letter-spacing: .15em; color: var(--accent); font-size: 1.3em; }
.brand img { height: 5vh; width: auto; }
.slide-title { font-size: 2em; font-weight: 800; letter-spacing: -.01em; flex: 1; text-align: center; }
.meta { display: flex; gap: 1.5vw; align-items: center; color: var(--muted); font-size: 1.1em; }
.clock { color: var(--text); font-weight: 700; font-size: 1.4em; font-variant-numeric: tabular-nums; }
.offline { color: var(--red); font-weight: 700; }

/* ---------- Slides ---------- */
.slides { position: relative; flex: 1; }
.slide {
  position: absolute; inset: 0;
  padding: 2.5vh 2vw;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2vw;
  opacity: 0;
  transform: translateX(2vw);
  transition: opacity .7s ease, transform .7s ease;
  pointer-events: none;
}
.slide.active { opacity: 1; transform: none; pointer-events: auto; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2.5vh 1.8vw;
  display: flex;
  flex-direction: column;
  gap: 2.5vh;
  min-height: 0;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1vw; }
.machine-name { font-size: 2.2em; font-weight: 800; letter-spacing: -.02em; }
.machine-id { color: var(--muted); font-size: 1em; letter-spacing: .1em; }

.badge {
  padding: .35em 1em;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.3em;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.st-running   { background: rgba(34,197,94,.18);  color: var(--green); border: 2px solid var(--green); }
.st-setup     { background: rgba(245,158,11,.18); color: var(--amber); border: 2px solid var(--amber); }
.st-idle      { background: rgba(100,116,139,.2); color: #cbd5e1;      border: 2px solid var(--grey); }
.st-breakdown { background: rgba(239,68,68,.2);   color: var(--red);   border: 2px solid var(--red); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .45; } }

/* ---------- Slide 1: operators ---------- */
.operators { display: flex; justify-content: space-around; align-items: center; flex: 1; gap: 2vw; }
.operator { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.5vh; }
.operator img {
  width: min(16vw, 30vh);
  height: min(16vw, 30vh);
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid var(--panel-2);
  box-shadow: 0 0 0 5px var(--brand);
  background: var(--panel-2);
}
.op-name { font-size: 1.8em; font-weight: 700; }
.op-role { color: var(--accent); font-size: 1.2em; }
.current-job { border-left: 6px solid var(--brand); background: var(--panel-2); border-radius: 12px; padding: 1.5vh 1.2vw; font-size: 1.3em; }
.current-job b { color: var(--accent); }

/* ---------- Slide 2: plan table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 1.25em; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 1vh .6vw; border-bottom: 2px solid var(--line); font-size: .85em; text-transform: uppercase; letter-spacing: .05em; }
td { padding: 1.6vh .6vw; border-bottom: 1px solid var(--line); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.current td { background: rgba(140,27,36,.35); }
tr.current td:first-child { box-shadow: inset 6px 0 0 var(--accent); }
tr.done td { color: var(--muted); }
.chip { padding: .2em .7em; border-radius: 999px; font-size: .8em; font-weight: 700; white-space: nowrap; }
.chip.done { background: rgba(34,197,94,.18); color: var(--green); }
.chip.inprogress { background: var(--brand); color: var(--cream); }
.chip.pending { background: rgba(100,116,139,.2); color: #cbd5e1; }
.plan-total { margin-top: auto; display: flex; justify-content: space-between; font-size: 1.4em; color: var(--muted); }
.plan-total b { color: var(--text); }

/* ---------- Slide 3: output ---------- */
.big-row { display: flex; align-items: baseline; gap: 1vw; }
.big-num { font-size: 5.5em; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.big-of { font-size: 1.8em; color: var(--muted); }
.pct { margin-left: auto; font-size: 3.5em; font-weight: 800; }
.bar { height: 4.5vh; background: var(--panel-2); border-radius: 999px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 999px; transition: width 1s ease; }
.bar-target { position: absolute; top: -4px; bottom: -4px; width: 4px; background: var(--text); opacity: .8; }
.fill-good { background: linear-gradient(90deg, #16a34a, var(--green)); }
.fill-warn { background: linear-gradient(90deg, #d97706, var(--amber)); }
.bar-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 1.1em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1vw; margin-top: auto; }
.stat { background: var(--panel-2); border-radius: 12px; padding: 1.8vh 1vw; }
.stat-label { color: var(--accent); font-size: 1em; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 2.2em; font-weight: 800; margin-top: .5vh; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted); font-size: 1em; }
.job-progress .bar { height: 2.5vh; }

/* ---------- Footer ---------- */
.footer { position: relative; display: flex; justify-content: center; align-items: center; padding: 1.2vh 2vw 1.8vh; gap: 2vw; }
.dots { display: flex; gap: .8vw; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--line); cursor: pointer; }
.dot.active { background: var(--accent); }
.hint { position: absolute; right: 2vw; color: var(--muted); font-size: .85em; }
.hint.paused { color: var(--amber); font-weight: 700; }
.timer { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; }
.timer-bar { height: 100%; width: 0; background: var(--brand); }

.empty { color: var(--muted); font-size: 1.4em; grid-column: 1 / -1; display: grid; place-items: center; }
