/* ADROOM floor board: admin Performance tab as a TV presentation (readable from ~3 m). */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/fraunces-latin.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/outfit-latin.woff2") format("woff2"); }

.tv-board {
  --tv-bg: #7a2e39; --tv-card: #fff7ed; --tv-num: #d81b60; --tv-gold: #f9a825; --tv-blue: #1565c0; --tv-ink: #3b1a20;
  position: relative; box-sizing: border-box;
  width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
  height: calc(100vh - 80px); min-height: 640px;
  background: var(--tv-bg); color: var(--tv-card);
  font-family: "Outfit", system-ui, sans-serif;
  padding: clamp(16px, 2vw, 40px) clamp(16px, 3vw, 56px) clamp(56px, 5vw, 80px);
  display: flex; flex-direction: column; gap: clamp(14px, 1.6vw, 28px);
  overflow: hidden;
}
.tv-board *, .tv-board *::before, .tv-board *::after { box-sizing: border-box; }
.tv-top { display: flex; align-items: center; gap: clamp(12px, 2vw, 32px); flex-wrap: wrap; }
.tv-brand { font-weight: 800; letter-spacing: .14em; font-size: clamp(18px, 1.6vw, 32px); }
.tv-title { font-family: "Fraunces", Georgia, serif; font-weight: 800; font-size: clamp(28px, 3vw, 60px); color: var(--tv-gold); line-height: 1; }
.tv-clock { margin-left: auto; text-align: right; line-height: 1.05; }
.tv-clock b { display: block; font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: clamp(32px, 3.2vw, 64px); font-variant-numeric: tabular-nums; }
.tv-clock span { font-size: clamp(14px, 1.1vw, 22px); opacity: .85; }
.tv-btn { font: 800 clamp(16px, 1.2vw, 24px) "Outfit", sans-serif; color: var(--tv-ink); background: var(--tv-gold); border: 0; border-radius: 999px; padding: .55em 1.2em; cursor: pointer; }
.tv-btn:focus-visible { outline: 4px solid var(--tv-card); outline-offset: 3px; }
.tv-status { font-size: clamp(13px, 1vw, 20px); opacity: .8; }

.tv-slides { position: relative; flex: 1; min-height: 0; }
.tv-slide { display: none; position: absolute; inset: 0; gap: clamp(14px, 1.6vw, 28px); animation: tvIn .5s ease; }
.tv-slide.on { display: grid; }
@keyframes tvIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tv-slide { animation: none; } }
.tv-slide-1 { grid-template-rows: auto minmax(0, 1fr); }
.tv-slide-2 { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr); }

.tv-card { background: var(--tv-card); color: var(--tv-ink); border-radius: clamp(14px, 1.4vw, 28px); padding: clamp(14px, min(1.6vw, 2.6vh), 34px) clamp(16px, 1.8vw, 36px); min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.tv-tile { display: block; }
.tv-card h2 { margin: 0 0 .4em; flex: none; font: 800 clamp(22px, 1.8vw, 38px) "Outfit", sans-serif; color: var(--tv-bg); letter-spacing: .02em; }
.tv-card h2 small { font-weight: 600; font-size: .6em; color: var(--tv-ink); opacity: .7; letter-spacing: 0; }

.tv-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 1.6vw, 28px); }
.tv-tile { text-align: left; }
.tv-tile b { display: block; font-family: "Fraunces", Georgia, serif; font-weight: 800; color: var(--tv-num); font-size: clamp(64px, min(7vw, 14vh), 160px); line-height: .95; font-variant-numeric: tabular-nums; }
.tv-tile span { display: block; margin-top: .2em; font-weight: 700; font-size: clamp(22px, min(1.8vw, 3.2vh), 38px); }
.tv-tile.gold b { color: #c77700; }
.tv-tile.blue b { color: var(--tv-blue); }

.tv-staff { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 1.6vw, 28px); min-height: 0; }
.tv-staff-rows { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); align-content: stretch; gap: clamp(4px, .8vh, 14px); }
.tv-srow { display: grid; grid-template-columns: minmax(7em, 13em) 1fr auto; align-items: center; gap: clamp(10px, 1vw, 20px); }
.tv-sname { font-weight: 800; font-size: clamp(28px, min(2.1vw, 3.8vh), 44px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-stime { display: block; font-weight: 600; font-size: clamp(15px, min(1vw, 1.8vh), 22px); color: #7a2e39; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.tv-track { height: clamp(18px, min(2.2vw, 3.2vh), 46px); background: #f3dcc4; border-radius: 999px; overflow: hidden; }
.tv-fill { height: 100%; width: 0; background: var(--tv-gold); border-radius: 999px; transition: width .8s ease; }
.tv-snum { text-align: right; line-height: 1; display: flex; align-items: baseline; gap: .5em; }
.tv-snum b { font-family: "Fraunces", Georgia, serif; font-weight: 800; color: var(--tv-num); font-size: clamp(36px, min(3.4vw, 5.4vh), 72px); font-variant-numeric: tabular-nums; min-width: 1.2em; }
.tv-snum small { order: -1; font-size: clamp(14px, 1vw, 20px); font-weight: 600; opacity: .75; white-space: nowrap; }

.tv-regions { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: clamp(4px, .6vh, 12px); }
.tv-rrow { display: grid; grid-template-columns: minmax(7em, 12em) 1fr auto; align-items: center; gap: clamp(10px, 1vw, 18px); font-size: clamp(20px, min(1.5vw, 2.8vh), 32px); font-weight: 700; }
.tv-rrow .tv-track { height: clamp(16px, min(1.8vw, 2.6vh), 40px); background: #e3ebf7; }
.tv-rrow .tv-fill { background: var(--tv-blue); }
.tv-rrow .tv-rname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-rrow .tv-rnum { font-family: "Fraunces", Georgia, serif; font-weight: 800; color: var(--tv-blue); font-size: clamp(26px, min(2vw, 3.6vh), 44px); font-variant-numeric: tabular-nums; min-width: 2.2em; text-align: right; }
.tv-rrow .tv-rnum small { font-family: "Outfit", sans-serif; font-size: .5em; color: var(--tv-ink); opacity: .7; font-weight: 600; }

.tv-contracts { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 0; }
.tv-crow { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; padding: clamp(4px, .6vh, 12px) 0; border-bottom: 2px solid #f0d9c0; }
.tv-crow:last-child { border-bottom: 0; }
.tv-cname { font-weight: 800; font-size: clamp(24px, min(1.9vw, 3.4vh), 40px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-cmeta { grid-column: 1; font-size: clamp(18px, min(1.3vw, 2.4vh), 28px); font-weight: 600; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-cdays { grid-row: 1 / span 2; grid-column: 2; text-align: right; line-height: 1; }
.tv-cdays b { font-family: "Fraunces", Georgia, serif; font-weight: 800; color: var(--tv-num); font-size: clamp(48px, min(4vw, 6.4vh), 88px); font-variant-numeric: tabular-nums; }
.tv-cdays small { display: block; font-size: clamp(14px, 1vw, 22px); font-weight: 700; }
.tv-cdays.soon b { color: #c77700; }
.tv-empty { font-size: clamp(24px, 1.9vw, 40px); font-weight: 700; opacity: .7; padding: 1em 0; }
.tv-more { flex: none; margin: .3em 0 0; font-size: clamp(18px, 1.3vw, 28px); font-weight: 700; opacity: .7; }

/* Payroll slide: current half, other half, this week, this month (2 x 2). */
.tv-pay { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: clamp(12px, 1.4vw, 24px); height: 100%; min-height: 0; }
.tv-pcard { border: 4px solid transparent; }
.tv-pcard.current { border-color: var(--tv-gold); box-shadow: 0 0 0 4px rgba(249,168,37,.35); background: #fffbf2; }
.tv-pcard h2 { display: flex; align-items: baseline; gap: .5em; flex-wrap: wrap; font-size: clamp(22px, min(1.7vw, 3vh), 40px); }
.tv-ptag { font-size: .62em; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; background: #f0d9c0; color: var(--tv-ink); border-radius: 999px; padding: .15em .7em; }
.tv-pcard.current .tv-ptag { background: var(--tv-gold); color: #111; }
.tv-plabel { color: var(--tv-bg); }
.tv-pnote { font-size: .55em; font-weight: 700; opacity: .7; }
.tv-ptable { width: 100%; border-collapse: collapse; background: transparent; border-radius: 0; flex: 1; font-size: clamp(18px, min(1.4vw, 2.3vh), 34px); color: var(--tv-ink); }
.tv-ptable th, .tv-ptable td { position: static; background: transparent; white-space: nowrap; padding: .1em .35em; border-bottom: 2px solid #f0d9c0; text-align: right; font-variant-numeric: tabular-nums; vertical-align: middle; }
.tv-ptable thead th { background: transparent; font: 700 clamp(13px, min(.9vw, 1.6vh), 22px) "Outfit", sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--tv-bg); opacity: .85; }
.tv-ptable th:first-child { text-align: left; }
.tv-ptable tbody th, .tv-ptable tfoot th { color: var(--tv-ink); font-family: "Outfit", system-ui, sans-serif; font-size: inherit; font-weight: 800; text-transform: none; letter-spacing: 0; }
.tv-ptable tbody td { font-family: "Fraunces", Georgia, serif; font-weight: 800; color: var(--tv-num); }
.tv-ptable tbody td:last-child { color: var(--tv-blue); }
.tv-ptable tfoot th, .tv-ptable tfoot td { border-bottom: 0; font-weight: 800; color: var(--tv-ink); }

.tv-dots { position: absolute; left: 0; right: 0; bottom: clamp(14px, 1.8vh, 26px); display: flex; justify-content: center; gap: 14px; }
.tv-dots button { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--tv-card); background: transparent; padding: 0; cursor: pointer; }
.tv-dots button.on { background: var(--tv-gold); border-color: var(--tv-gold); }
.tv-details { margin-top: 18px; }
.tv-details summary { cursor: pointer; font-weight: 700; }

/* Present mode: board fills the screen, desk chrome hidden. */
body.tv-present { overflow: hidden; background: #7a2e39 !important; }
body.tv-present .site-nav, body.tv-present .whoami, body.tv-present .tabs, body.tv-present #mode,
body.tv-present #staff-note, body.tv-present footer, body.tv-present .tv-details, body.tv-present #tab-performance > .editor > h3,
body.tv-present #perf-msg { display: none !important; }
body.tv-present .tv-board { position: fixed; inset: 0; z-index: 9999; width: 100vw; height: 100vh; min-height: 0; margin: 0; }
/* Small screens (phone/laptop preview): let the board grow and scroll instead of squeezing. */
/* Present mode never uses this fallback: the board is fixed to the screen in either orientation. */
@media (max-width: 1100px), (max-height: 700px) {
  body:not(.tv-present) .tv-board { height: auto; }
  body:not(.tv-present) .tv-slides { flex: none; }
  body:not(.tv-present) .tv-slide { position: static; }
  body:not(.tv-present) .tv-tiles { grid-template-columns: repeat(2, 1fr); }
  body:not(.tv-present) .tv-staff, body:not(.tv-present) .tv-slide-2, body:not(.tv-present) .tv-pay { grid-template-columns: 1fr; }
  body:not(.tv-present) .tv-pay { grid-template-rows: none; height: auto; }
  body:not(.tv-present) .tv-staff-rows, body:not(.tv-present) .tv-regions, body:not(.tv-present) .tv-contracts { grid-auto-rows: auto; }
}

/* Present buttons: Landscape (16:9, 1920x1080) and Portrait (9:16, 1080x1920). */
.tv-actions { display: flex; gap: clamp(8px, .8vw, 14px); flex-wrap: wrap; }
.tv-actions .tv-btn[hidden] { display: none; }
.tv-btn[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--tv-card); }
.tv-btn.tv-exit { background: var(--tv-card); }

/* Present: the board is sized to its orientation's aspect ratio and centred (letterboxed if the screen
   doesn't match), so a Portrait choice on a sideways signal still renders the 9:16 layout. */
body.tv-present.tv-present-landscape .tv-board { width: min(100vw, calc(100vh * 16 / 9)); height: min(100vh, calc(100vw * 9 / 16)); margin: auto; }
body.tv-present.tv-present-portrait .tv-board { width: min(100vw, calc(100vh * 9 / 16)); height: min(100vh, calc(100vw * 16 / 9)); margin: auto; }

/* ---- Portrait layout (designed for 1080x1920). Sizes use container units of the board itself. ---- */
body.tv-present .tv-board.tv-portrait { container-type: size; }
.tv-board.tv-portrait { padding: 3.4cqw 4cqw 6cqw; gap: 1.5cqh; }
.tv-portrait .tv-top { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "brand clock" "title clock" "status actions"; gap: .6cqh 3cqw; align-items: center; }
.tv-portrait .tv-brand { grid-area: brand; font-size: 3cqw; }
.tv-portrait .tv-title { grid-area: title; font-size: 6.4cqw; }
.tv-portrait .tv-clock { grid-area: clock; margin: 0; }
.tv-portrait .tv-clock b { font-size: 8cqw; }
.tv-portrait .tv-clock span { font-size: 2.2cqw; }
.tv-portrait .tv-status { grid-area: status; font-size: 2.1cqw; }
.tv-portrait .tv-actions { grid-area: actions; justify-content: flex-end; }
.tv-portrait .tv-btn { font-size: 2.3cqw; }
.tv-portrait .tv-slide { gap: 1.4cqh; }
.tv-portrait .tv-card { border-radius: 2.6cqw; padding: 1.4cqh 3.6cqw; }
.tv-portrait .tv-card h2 { font-size: 4.2cqw; }

/* Slide 1: inventory cards stacked, then week and month leaderboards stacked. */
.tv-portrait .tv-slide-1 { grid-template-rows: auto minmax(0, 1fr); }
.tv-portrait .tv-tiles { grid-template-columns: 1fr; gap: 1cqh; }
.tv-portrait .tv-tile { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 3cqw; padding-block: .6cqh; overflow: visible; }
.tv-portrait .tv-tile span { order: -1; margin: 0; font-size: 4.8cqw; }
.tv-portrait .tv-tile b { font-size: 9.2cqw; line-height: 1; }
.tv-portrait .tv-staff { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; gap: 1.2cqh; }
.tv-portrait .tv-staff-rows { gap: .5cqh; }
.tv-portrait .tv-srow { grid-template-columns: 30cqw 1fr 29cqw; gap: 2.4cqw; }
.tv-portrait .tv-sname { font-size: max(28px, 4.2cqw); line-height: 1.05; }
.tv-portrait .tv-stime { font-size: max(15px, 1.9cqw); margin-top: 0; }
.tv-portrait .tv-track { height: 2.6cqw; }
.tv-portrait .tv-snum { flex-direction: column; align-items: flex-end; gap: .1em; }
.tv-portrait .tv-snum b { font-size: 5.8cqw; }
.tv-portrait .tv-snum small { order: 1; font-size: max(14px, 1.9cqw); }

/* Payroll slide: the four periods stacked. */
.tv-portrait .tv-pay { grid-template-columns: 1fr; grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 1.1cqh; }
.tv-portrait .tv-pcard h2 { font-size: 3.6cqw; margin-bottom: .1em; }
.tv-portrait .tv-ptable { font-size: max(20px, 2.6cqw); }
.tv-portrait .tv-ptable thead th { font-size: max(13px, 1.8cqw); }
.tv-portrait .tv-ptable th, .tv-portrait .tv-ptable td { padding: 0 .35em; }
.tv-portrait .tv-pcard { padding-block: 1cqh; }

/* Slide 2: walls by region on top, contracts ending in 30 days below. */
.tv-portrait .tv-slide-2 { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1.25fr) minmax(0, 1fr); }
.tv-portrait .tv-rrow { grid-template-columns: 30cqw 1fr 24cqw; gap: 2.4cqw; font-size: max(28px, 3.6cqw); }
.tv-portrait .tv-rrow .tv-track { height: 2.6cqw; }
.tv-portrait .tv-rrow .tv-rnum { font-size: 5cqw; }
.tv-portrait .tv-cname { font-size: max(28px, 4cqw); }
.tv-portrait .tv-cmeta { font-size: max(18px, 2.7cqw); }
.tv-portrait .tv-cdays b { font-size: 8cqw; }
.tv-portrait .tv-cdays small { font-size: max(14px, 2cqw); }
.tv-portrait .tv-empty { font-size: 4cqw; }
.tv-portrait .tv-more { font-size: max(18px, 2.6cqw); }
.tv-portrait .tv-dots { bottom: 2cqw; }
.tv-portrait .tv-dots button { width: 2.2cqw; height: 2.2cqw; }
