/* ============================================================
   TCS — Txtur Communication System theme
   One source of truth for brand + status colors (spec: theme
   variables, not colors sprinkled through code).
   Sage = brand accent. Saturated signal colors = status ONLY.
   ============================================================ */
:root {
  /* Brand (approximated from Txtur logo; refine from original files) */
  --sage: #8FA69F;
  --sage-dim: #5f746e;
  --charcoal: #33383a;

  /* Surfaces (dark, plant-floor friendly) */
  --bg: #101314;
  --surface: #1a1f21;
  --surface-2: #232a2d;
  --line: #313a3e;

  /* Text */
  --text: #f2f5f4;
  --text-dim: #9fb0ab;

  /* Status colors — Production Clock phases (distinct from sage) */
  --phase-production: #2fbf5f;
  --phase-break: #3b82f6;
  --phase-lunch: #3b82f6;
  --phase-cleanup: #f59e0b;
  --phase-offshift: #6b7280;

  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); }
a { color: var(--sage); }

/* ---- Txtur wordmark (CSS recreation of the typographic logo; swap for
       the real image asset once brand files are in the repo) ---- */
.wordmark {
  display: inline-block; border: 3px solid var(--sage);
  padding: .35em .9em; background: #fff; color: var(--charcoal);
  font-weight: 800; letter-spacing: .55em; text-indent: .55em;
  font-size: 1rem; line-height: 1; user-select: none;
}
.wordmark.dark { background: transparent; color: var(--text); }

/* ============================ STATION ============================ */
.station { display: flex; flex-direction: column; height: 100vh; overflow: hidden;
  cursor: none; }
.station-header { display: flex; align-items: center; justify-content: space-between;
  padding: 1.2vh 2vw; border-bottom: 2px solid var(--line); background: var(--surface); }
.station-header .corevalue { font-size: 3.4vh; font-weight: 600; color: var(--sage);
  font-style: italic; letter-spacing: .02em; text-align: center; flex: 1;
  padding: 0 2vw; }
.station-header .hdr-right { display: flex; flex-direction: column;
  align-items: flex-end; gap: .3vh; }
.station-header .dept { font-size: 2.4vh; font-weight: 700; color: var(--sage);
  text-transform: uppercase; letter-spacing: .12em; }
.station-header .date { font-size: 1.9vh; color: var(--text-dim); }
/* ---- Layout panels (the 5 standard layouts) ---- */
.panels { flex: 1; display: grid; overflow: hidden; padding: 1.6vh 1vw; gap: 1.6vh; }
.panels.single_hf, .panels.single_full { grid-template-columns: 1fr; }
.panels.split_hf { grid-template-columns: 1fr 1fr; }
.panels.quad_hf, .panels.quad_full { grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr; }
.panel-zone { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.panel-body { flex: 1; display: flex; flex-direction: column; overflow: hidden;
  min-height: 0; }
.zone-label { font-size: 2.2vh; font-weight: 700; color: var(--sage);
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1.2vh; }
.zone-empty { flex: 1; display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 2.4vh; background: var(--surface);
  border: 1px dashed var(--line); border-radius: var(--radius); }

/* Announcement rotation card */
.ann-card { flex: 1; display: flex; flex-direction: column; justify-content: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 3vh 2.5vw; overflow: hidden; }
.ann-card .ann-title { font-size: 6.5vh; font-weight: 800; line-height: 1.15;
  margin-bottom: 2.2vh; }
.ann-card .ann-body { font-size: 4vh; line-height: 1.4; color: var(--text-dim);
  white-space: pre-wrap; }
.ann-dots { text-align: center; padding: .6vh 0 0; }
.ann-dots span { display: inline-block; width: 1.3vh; height: 1.3vh; border-radius: 50%;
  background: var(--line); margin: 0 .5vh; }
.ann-dots span.on { background: var(--sage); }
/* smaller type when announcements share the screen */
.split_hf .ann-title { font-size: 4.6vh; }
.split_hf .ann-body { font-size: 3vh; }
.quad_hf .ann-title, .quad_full .ann-title { font-size: 3.6vh; }
.quad_hf .ann-body, .quad_full .ann-body { font-size: 2.4vh; }

/* Static board */
.board { flex: 1; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2.4vh 1.6vw; overflow: hidden; }
.board-item { margin-bottom: 2vh; }
.board-title { font-size: 3.4vh; font-weight: 700; line-height: 1.2; }
.board-body { font-size: 2.6vh; color: var(--text-dim); line-height: 1.35;
  white-space: pre-wrap; }
.single_hf .board-title, .single_full .board-title { font-size: 4.6vh; }
.single_hf .board-body, .single_full .board-body { font-size: 3.4vh; }

/* Production status */
.status { flex: 1; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2.4vh 1.6vw; overflow: hidden; }
.status-item { display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--line); padding: 1.4vh 0; }
.status-item:last-child { border-bottom: none; }
.status-name { font-size: 2.8vh; color: var(--text-dim); }
.status-value { font-size: 4vh; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Weekly / Monthly Goals — progress bars toward target */
.goals { flex: 1; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2.4vh 1.6vw; overflow: hidden; }
.goal { margin-bottom: 2.6vh; }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; }
.goal-title { font-size: 2.8vh; font-weight: 700; }
.goal-dept { font-size: 1.8vh; font-weight: 600; color: var(--sage);
  text-transform: uppercase; letter-spacing: .08em; margin-left: .6vw; }
.goal-period { font-size: 1.6vh; font-weight: 700; color: var(--text-dim);
  letter-spacing: .12em; border: 1px solid var(--line); border-radius: 999px;
  padding: .2vh .8vw; }
.goal-track { height: 2.6vh; background: var(--surface-2); border-radius: 6px;
  margin: 1vh 0 .6vh; overflow: hidden; }
.goal-fill { height: 100%; background: var(--sage); border-radius: 0 4px 4px 0;
  transition: width .8s ease; }
.goal-fill.met { background: var(--phase-production); }
.goal-nums { display: flex; justify-content: space-between;
  font-size: 2.2vh; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.goal-spark { display: block; width: 100%; height: 4.5vh; margin-top: .8vh; }
.spark-line { fill: none; stroke: var(--sage); stroke-width: 1.6;
  stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-target { stroke: var(--text-dim); stroke-width: 1; stroke-dasharray: 3 4;
  opacity: .5; vector-effect: non-scaling-stroke; }
.spark-dot { fill: var(--sage); }
.quad_hf .goal-spark, .quad_full .goal-spark { height: 3vh; }
.quad_hf .goal-title, .quad_full .goal-title { font-size: 2.2vh; }
.quad_hf .goal-track, .quad_full .goal-track { height: 1.9vh; }
.quad_hf .goal-nums, .quad_full .goal-nums { font-size: 1.7vh; }
.quad_hf .goal, .quad_full .goal { margin-bottom: 1.8vh; }

/* Txtur Quoteables */
.quotepanel { flex: 1; position: relative; display: flex; flex-direction: column;
  justify-content: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 4vh 4vw; overflow: hidden; }
.quote-mark { position: absolute; top: -1vh; left: 1.2vw; font-size: 16vh;
  color: var(--sage); opacity: .18; font-family: Georgia, "Times New Roman", serif;
  line-height: 1; user-select: none; }
.quote-text { font-family: Georgia, "Times New Roman", serif; font-style: italic;
  line-height: 1.35; z-index: 1; }
.quote-who { margin-top: 2.5vh; text-align: right; color: var(--sage);
  font-size: 2.6vh; font-weight: 600; letter-spacing: .04em; z-index: 1; }
.quote-cat { position: absolute; top: 1.4vh; right: 1.2vw; font-size: 1.6vh;
  font-weight: 700; color: var(--text-dim); letter-spacing: .12em;
  border: 1px solid var(--line); border-radius: 999px; padding: .3vh .9vw;
  text-transform: uppercase; }
.quad_hf .quote-cat, .quad_full .quote-cat { font-size: 1.3vh; }
.q-short .quote-text { font-size: 7vh; }
.q-med   .quote-text { font-size: 5vh; }
.q-long  .quote-text { font-size: 3.6vh; }
.split_hf .q-short .quote-text { font-size: 5vh; }
.split_hf .q-med .quote-text   { font-size: 3.6vh; }
.split_hf .q-long .quote-text  { font-size: 2.7vh; }
.quad_hf .q-short .quote-text, .quad_full .q-short .quote-text { font-size: 3.8vh; }
.quad_hf .q-med .quote-text,   .quad_full .q-med .quote-text   { font-size: 2.9vh; }
.quad_hf .q-long .quote-text,  .quad_full .q-long .quote-text  { font-size: 2.2vh; }
.quad_hf .quote-who, .quad_full .quote-who { font-size: 1.9vh; margin-top: 1.2vh; }
.quad_hf .quote-mark, .quad_full .quote-mark { font-size: 9vh; }

/* Photo slideshow panel (Display Station Art) — two stacked layers crossfade */
.mediapanel { flex: 1; position: relative; overflow: hidden; background: #000;
  border-radius: var(--radius); }
.mediapanel .slide { position: absolute; inset: 0; opacity: 0;
  transition: opacity .9s ease; }
.mediapanel .slide.show { opacity: 1; }
.mediapanel .slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mediapanel.cover .slide img { object-fit: cover; }
.mediapanel .slide-cap { position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.6vh 2vw; font-size: 2.6vh; font-weight: 600; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); text-shadow: 0 1px 3px #000; }
.split_hf .mediapanel .slide-cap { font-size: 2.1vh; }
.quad_hf .mediapanel .slide-cap, .quad_full .mediapanel .slide-cap { font-size: 1.7vh; padding: 1vh 1.2vw; }

/* Shift schedule panel */
.shiftpanel { flex: 1; display: flex; gap: 1.5vw; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2.4vh 1.6vw; overflow: hidden; }
.shift-col { flex: 1; min-width: 0; }
.shift-table { width: 100%; border-collapse: collapse; }
.shift-table td { font-size: 2.4vh; padding: 1vh .3vw;
  border-bottom: 1px solid var(--line); }
.shift-table td:last-child { text-align: right; font-variant-numeric: tabular-nums;
  font-weight: 700; }
.quad_hf .shift-table td, .quad_full .shift-table td { font-size: 1.9vh; padding: .7vh .3vw; }
.quad_hf .shiftpanel { flex-direction: row; }
.stale { position: fixed; top: 1vh; right: 1vw; font-size: 1.8vh; color: var(--phase-cleanup);
  background: rgba(0,0,0,.6); padding: .4vh 1vw; border-radius: 6px; display: none; }
.stale.show { display: block; }

/* ---- Production Clock bar (spec §5.3) ---- */
.clockbar { display: flex; align-items: center; justify-content: space-between;
  padding: 1.6vh 2.5vw; border-top: 6px solid var(--phase-offshift);
  background: var(--surface); transition: border-color .5s, background .5s; }
.clockbar .time { font-size: 9vh; font-weight: 800; font-variant-numeric: tabular-nums;
  line-height: 1; }
.clockbar .phase { text-align: center; }
.clockbar .phase .phase-label { font-size: 4.5vh; font-weight: 800; letter-spacing: .15em; }
.clockbar .phase .phase-next { font-size: 2.2vh; color: var(--text-dim); }
.clockbar .sched { font-size: 2.2vh; color: var(--text-dim); text-align: right; }

.clockbar[data-phase="production"] { border-top-color: var(--phase-production); }
.clockbar[data-phase="production"] .phase-label { color: var(--phase-production); }
.clockbar[data-phase="break"]      { border-top-color: var(--phase-break); }
.clockbar[data-phase="break"] .phase-label      { color: var(--phase-break); }
.clockbar[data-phase="lunch"]      { border-top-color: var(--phase-lunch); }
.clockbar[data-phase="lunch"] .phase-label      { color: var(--phase-lunch); }
.clockbar[data-phase="cleanup"]    { border-top-color: var(--phase-cleanup); }
.clockbar[data-phase="cleanup"] .phase-label    { color: var(--phase-cleanup); }
.clockbar[data-phase="offshift"]   { border-top-color: var(--phase-offshift); }
.clockbar[data-phase="offshift"] .phase-label   { color: var(--phase-offshift); }

/* ============================ REMOTE (phone-first) ============================ */
.remote { max-width: 640px; margin: 0 auto; padding: 16px; }
.remote h1 { font-size: 1.1rem; color: var(--text-dim); font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; margin: 20px 0 10px; }
.remote .card { background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.remote .card .t { font-weight: 700; font-size: 1.05rem; margin-bottom: 4px; }
.remote .card .b { color: var(--text-dim); white-space: pre-wrap; }
.remote table { width: 100%; border-collapse: collapse; }
.remote td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.remote td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.remote .topbar { display: flex; justify-content: space-between; align-items: center;
  padding-top: 8px; }
.remote .now { font-size: .95rem; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); }

/* ============================ PAIRING ============================ */
.pairpage { height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4vh; }
.paircode { font-size: 18vh; font-weight: 800; letter-spacing: .2em;
  color: var(--sage); }
.pairpage p { font-size: 3vh; color: var(--text-dim); }

/* ============================ ADMIN ============================ */
.admin { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }
.admin-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px 0; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.admin-nav a { color: var(--text-dim); text-decoration: none; font-weight: 600; }
.admin-nav a.active, .admin-nav a:hover { color: var(--sage); }
.admin-nav .spacer { flex: 1; }
.admin h1 { font-size: 1.5rem; margin: 8px 0 18px; }
.admin h2 { font-size: 1.1rem; margin: 26px 0 10px; color: var(--text-dim); }

.grid { display: grid; gap: 12px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.panel { background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; }
.panel .big { font-size: 1.8rem; font-weight: 800; }
.panel .lbl { color: var(--text-dim); font-size: .85rem; }

table.list { width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th { text-align: left; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-dim); padding: 10px 12px;
  border-bottom: 1px solid var(--line); }
table.list td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; }
.badge.on  { background: rgba(47,191,95,.15); color: var(--phase-production); }
.badge.off { background: rgba(107,114,128,.2); color: var(--phase-offshift); }
.badge.remote { background: rgba(143,166,159,.15); color: var(--sage); }

form.stack { display: grid; gap: 10px; max-width: 520px; }
form.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
label { font-size: .85rem; color: var(--text-dim); display: block; margin-bottom: 3px; }
input, select, textarea { width: 100%; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px;
  font-family: inherit; font-size: .95rem; }
form.inline input, form.inline select { width: auto; }
textarea { min-height: 90px; resize: vertical; }
input[type="checkbox"] { width: auto; }
button, .btn { background: var(--sage); color: #10201c; border: none; border-radius: 8px;
  padding: 10px 18px; font-weight: 700; font-size: .95rem; cursor: pointer; }
button.danger { background: transparent; color: #e05d5d; border: 1px solid #e05d5d;
  padding: 5px 12px; font-size: .8rem; }
.error { color: #e05d5d; margin-bottom: 10px; }

.steps ol { margin: 8px 0 16px; padding-left: 22px; }
.steps li { margin: 7px 0; line-height: 1.5; }
.steps code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { width: 340px; display: grid; gap: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  text-align: center; }
.muted { color: var(--text-dim); font-size: .85rem; }
.notice { color: var(--phase-production); margin-bottom: 10px; }

/* Photos library grid (admin) */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.media-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; }
.media-card.off { opacity: .5; }
.media-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #000; }
.media-meta { padding: 10px 12px; display: grid; gap: 4px; }
.media-cap { font-weight: 600; font-size: .9rem; }
.media-actions { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.media-actions .btn { padding: 5px 12px; font-size: .8rem; text-decoration: none; }
.media-actions button { padding: 5px 10px; font-size: .8rem; }
.tag { display: inline-block; background: rgba(143,166,159,.15); color: var(--sage);
  border-radius: 999px; padding: 1px 8px; font-size: .75rem; margin-right: 4px; }
