/* RFP Manager – background #262626, accent from the production team's settings. */
:root { --accent: #00ff82; --on-accent: #0b0b0b; --bg: #262626; --panel: #1d1d1d; --panel2: #303030; --line: #3d3d3d; --text: #f2f2f2; --dim: #a8a8a8; --danger: #ff5a5a; --warn: #ffc94d; --radius: 8px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0; font-weight: 700; } h2 { font-size: 17px; margin: 0 0 12px; font-weight: 700; } h3 { font-size: 13px; margin: 0 0 8px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.boot { padding: 60px; text-align: center; color: var(--dim); }
.dim { color: var(--dim); } .small { font-size: 13px; } .right { text-align: right; } .nowrap { white-space: nowrap; } .num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; } .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .stack > * + * { margin-top: 14px; } .spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hide { display: none !important; }

/* layout */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; font-weight: 700; font-size: 16px; }
.brand .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); flex: none; }
.side select { width: 100%; margin-bottom: 8px; }
.side .pc-pick { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .side .pc-pick select { margin: 0; flex: 1; min-width: 0; font-size: 13px; }
.shell.side-min .pc-pick { display: none; }
.nav-group { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 12px 10px 4px; }
.nav a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--text); }
.nav a:hover { background: var(--panel2); text-decoration: none; }
.nav a.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.side .foot { margin-top: auto; padding: 10px 8px 2px; border-top: 1px solid var(--line); font-size: 13px; }
.sync { display: flex; align-items: center; gap: 7px; color: var(--dim); font-size: 12px; padding: 6px 8px; }
.led { width: 9px; height: 9px; border-radius: 50%; background: #666; flex: none; } .led.ok { background: var(--accent); } .led.bad { background: var(--danger); } .led.warn { background: var(--warn); }
.main { padding: 24px 28px 60px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .grow { min-width: 160px; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; width: 250px; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .shell.open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.6); }
  .main { padding: 14px 16px 60px; }
  .menu-btn { display: inline-flex; }
}

/* controls */
button, .btn { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 7px 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; justify-content: center; white-space: nowrap; }
button:hover, .btn:hover { border-color: #666; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button.primary, .btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--danger); } button.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
button.ghost { background: transparent; border-color: transparent; } button.ghost:hover { background: var(--panel2); }
button.sm { padding: 3px 9px; font-size: 13px; }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--text); background: #171717; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; width: 100%; min-width: 0; }
textarea { min-height: 76px; resize: vertical; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); }
input[type=color] { padding: 2px; width: 42px; height: 36px; flex: none; }
input::placeholder, textarea::placeholder { color: #6f6f6f; }
label.f { display: block; } label.f > span, .flabel { display: block; font-size: 12px; color: var(--dim); margin-bottom: 4px; }
.help { font-size: 12px; color: var(--dim); margin-top: 4px; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px 16px; }
.form .wide { grid-column: 1 / -1; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile b { display: block; font-size: 28px; line-height: 1.1; } .tile span { color: var(--dim); font-size: 13px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 20px; background: var(--panel2); color: var(--dim); white-space: nowrap; }
.pill.live { background: var(--danger); color: #fff; } .pill.ok { background: var(--accent); color: var(--on-accent); } .pill.warn { background: var(--warn); color: #111; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #171717; border-radius: 20px; padding: 3px 11px; cursor: pointer; font-size: 13px; user-select: none; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid #555; vertical-align: -3px; margin-right: 6px; }
.thumb { width: 34px; height: 34px; object-fit: contain; background: #171717; border-radius: 5px; vertical-align: middle; }
.imgfield { display: flex; gap: 10px; align-items: center; } .imgfield .pv { width: 64px; height: 64px; border: 1px dashed var(--line); border-radius: 6px; display: flex; align-items: center; justify-content: center; background: #171717; overflow: hidden; flex: none; color: var(--dim); font-size: 11px; } .imgfield img { max-width: 100%; max-height: 100%; }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 8px 12px; border-bottom: 1px solid #2c2c2c; vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: #252525; }
table.t td.r, table.t th.r { text-align: right; }
table.sub td { padding: 4px 4px; border: 0; } table.sub th { padding: 2px 6px 4px; border: 0; }
table.sub input, table.sub select { padding: 5px 7px; }
.empty { padding: 34px 18px; text-align: center; color: var(--dim); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 8px 14px; color: var(--dim); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

/* overlays */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(420px, 90vw); }
.toast { background: #111; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.toast.error { border-left-color: var(--danger); }
.veil { position: fixed; inset: 0; background: rgba(0,0,0,.62); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 14px; overflow-y: auto; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; width: min(760px, 100%); padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.modal.wide { width: min(1040px, 100%); }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.gallery .g { background: #171717; border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; cursor: pointer; font-size: 12px; overflow: hidden; }
.gallery .g:hover { border-color: var(--accent); }
.gallery .g img { width: 100%; height: 90px; object-fit: contain; display: block; margin-bottom: 6px; }
.gallery .g div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .box { width: min(440px, 100%); }
.login h1 { font-size: 28px; margin-bottom: 4px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 12px; margin: 16px 0; } .or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }

/* dashboard */
.hero { border-radius: 10px; background: linear-gradient(120deg, #151515, #2e2e2e); border: 1px solid var(--line); padding: 26px; display: flex; align-items: center; gap: 22px; margin-bottom: 18px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--accent); }
.hero img { height: 96px; max-width: 220px; object-fit: contain; }
.hero h1 { font-size: 30px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } @media (max-width: 1100px) { .two { grid-template-columns: 1fr; } }
.two > .card + .card { margin-top: 0; }
.fx { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #2c2c2c; flex-wrap: wrap; } .fx:last-child { border-bottom: 0; }
.fx .when { width: 62px; color: var(--dim); font-variant-numeric: tabular-nums; flex: none; }
.fx .sc { font-weight: 700; font-variant-numeric: tabular-nums; }
.day { margin: 18px 0 6px; font-size: 13px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }

/* scoring */
.board { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; margin-bottom: 16px; }
.board .tm { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; text-align: center; border-top: 6px solid #888; min-width: 0; }
.board .tm .n { font-size: 20px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .tm .s { font-size: 76px; font-weight: 800; line-height: 1; margin: 6px 0; font-variant-numeric: tabular-nums; }
.board .tm .x { color: var(--dim); font-size: 13px; min-height: 19px; }
.board .mid { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; text-align: center; min-width: 230px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.board .clock { font-size: 54px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.board .clock.run { color: var(--accent); }
@media (max-width: 900px) { .board { grid-template-columns: 1fr 1fr; } .board .mid { grid-column: 1 / -1; order: -1; } .board .tm .s { font-size: 56px; } }
.pad { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.pad button { padding: 14px 8px; font-weight: 600; white-space: normal; line-height: 1.2; flex-direction: column; }
.pad button small { color: var(--dim); font-weight: 400; } .pad button.primary small { color: inherit; opacity: .75; }
.big-btn { padding: 26px 10px !important; font-size: 22px; }
.tl { max-height: 420px; overflow-y: auto; }
.tl .e { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid #2c2c2c; } .tl .e .m { width: 46px; color: var(--dim); font-variant-numeric: tabular-nums; flex: none; }
.tl .e.gone { opacity: .4; text-decoration: line-through; }
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.players button { justify-content: flex-start; padding: 10px; text-align: left; white-space: normal; }
.players button b { min-width: 26px; color: var(--accent); }
.balls { display: flex; gap: 6px; flex-wrap: wrap; } .balls span { min-width: 30px; height: 30px; border-radius: 15px; background: var(--panel2); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; padding: 0 6px; }

/* control */
.ctl { display: grid; grid-template-columns: 250px minmax(0, 1fr) 420px; gap: 14px; align-items: start; }
@media (max-width: 1250px) { .ctl { grid-template-columns: 220px minmax(0, 1fr); } .ctl .pvw { grid-column: 1 / -1; } }
@media (max-width: 760px) { .ctl { grid-template-columns: 1fr; } }
.glist button { display: flex; width: 100%; justify-content: space-between; margin-bottom: 5px; text-align: left; }
.glist button.sel { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.glist button.air { background: #4a1515; border-color: var(--danger); }
.pvbox { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; border: 1px solid var(--line); background-color: #333; background-image: linear-gradient(45deg, #3d3d3d 25%, transparent 25%, transparent 75%, #3d3d3d 75%), linear-gradient(45deg, #3d3d3d 25%, transparent 25%, transparent 75%, #3d3d3d 75%); background-size: 24px 24px; background-position: 0 0, 12px 12px; }
.pvbox iframe { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; pointer-events: none; }
.take { background: var(--danger) !important; border-color: var(--danger) !important; color: #fff !important; font-weight: 700; padding: 12px 22px !important; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 8px; font-size: 13px; max-height: 300px; overflow-y: auto; } .kv code { color: var(--dim); overflow: hidden; text-overflow: ellipsis; } .kv input { padding: 3px 6px; font-size: 13px; }
.rd-now td { background: color-mix(in srgb, var(--accent) 20%, transparent) !important; } .rd-done td { opacity: .45; }

@media print {
  body { background: #fff; color: #000; } .side, .no-print, #toasts, .menu-btn { display: none !important; } .shell { display: block; } .main { padding: 0; }
  .card, .tablewrap { border-color: #bbb; background: #fff; } table.t th, .dim, .flabel, h3 { color: #444; } table.t td { border-color: #ddd; } a { color: #000; }
  input, select, textarea { background: #fff; color: #000; border-color: #bbb; }
}

/* run order – same on screen and on paper: header box, blue column heads, coloured lines */
.runorder { background: #fff; color: #000; padding: 22px 26px; border-radius: 6px; font: 12px/1.25 Arial, Helvetica, sans-serif; overflow-x: auto; }
.runorder .ro-head { border: 1px solid #000; text-align: center; padding: 4px 8px; margin: 0 auto 26px; max-width: 880px; line-height: 1.45; }
.runorder .ro-head b, .runorder .ro-head div { display: block; }
table.ro { border-collapse: collapse; width: 100%; max-width: 880px; margin: 0 auto; }
table.ro th { background: #92cddc; border: 1px solid #000; padding: 3px 8px; font-weight: 700; text-align: center; }
table.ro th.thin { font-weight: 400; }
table.ro td { border: 1px solid #000; padding: 3px 6px; vertical-align: middle; }
table.ro td.c { text-align: center; } table.ro td.pre { white-space: pre-line; } table.ro td.b { font-weight: 700; }
table.ro tr.click { cursor: pointer; }
table.ro tr.ro-now td { box-shadow: inset 0 3px 0 #00a152, inset 0 -3px 0 #00a152; font-weight: 700; }
table.ro tr.ro-done td { color: #8a8a8a; }
/* call sheet */
.callsheet { background: #fff; color: #000; padding: 26px 30px; border-radius: 6px; font: 13px/1.35 Arial, Helvetica, sans-serif; max-width: 900px; }
.callsheet p { margin: 0 0 9px; }
.cs-box { border: 1px solid #000; }
.cs-top { display: flex; justify-content: space-between; gap: 20px; padding: 10px 12px 2px; }
.cs-logo { max-height: 90px; max-width: 300px; object-fit: contain; align-self: flex-start; margin-top: 14px; }
.cs-name { font-size: 30px; font-weight: 800; letter-spacing: -1px; align-self: flex-start; margin-top: 14px; }
table.cs { width: 100%; border-collapse: collapse; }
table.cs th { text-align: left; padding: 10px 12px; font-weight: 700; }
table.cs td { border-top: 1px solid #000; border-left: 1px solid #000; padding: 7px 8px; vertical-align: top; }
table.cs td:first-child { border-left: 0; padding-left: 12px; }
table.cs tr.cs-group td { background: #d9d9d9; }
.cs-more { padding: 22px 30px 0; } .cs-more .runorder { padding: 0; }
table.cs-plain td { padding: 2px 26px 2px 0; }
.cs-foot { margin-top: 26px; padding-top: 8px; border-top: 1px solid #999; font-size: 11px; color: #444; text-align: center; }
@media print {
  .runorder, .callsheet { padding: 0; border-radius: 0; max-width: none; }
  .runorder { font-size: 10px; } table.ro tr { break-inside: avoid; } table.cs tr { break-inside: avoid; }
  .cs-break { break-before: page; padding: 0; }
  table.ro th, table.ro tr[style], table.cs tr.cs-group td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 14mm; }
}

/* the side menu made narrow: only the menu button and the brand dot stay */
.shell.side-min { grid-template-columns: 46px 1fr; }
.shell.side-min .side { padding: 14px 6px; overflow: hidden; }
.shell.side-min .side > *:not(.brand) { display: none; }
.shell.side-min .side .brand > span:not(.dot) { display: none; }
.shell.side-min .side .brand { flex-direction: column; gap: 10px; }
.shell.side-min .side-toggle { transform: rotate(180deg); }
.shell.side-min .side .brand .logo { height: 18px !important; }

/* ================= phones and tablets ================= */
.fx .grow { flex: 1 1 220px; min-width: 0; }
@media (pointer: coarse) {
  button, .btn, select, .side a { touch-action: manipulation; }
  button, .btn { min-height: 38px; }
  button.sm, .btn.sm { min-height: 34px; padding: 6px 11px; }
  input, select, textarea { font-size: 16px; }          /* iOS zooms into smaller text fields */
  .side a { padding-top: 10px; padding-bottom: 10px; }
}
@media (max-width: 860px) {
  .hero { flex-wrap: wrap; padding: 18px; gap: 14px; }
  .hero h1 { font-size: 24px; }
  .hero img { height: 64px; }
  .hero > div:last-child { flex-wrap: wrap; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .tile { padding: 12px; } .tile b { font-size: 24px; }
  .page-head h1 { font-size: 22px; }
  .page-head { gap: 8px; }
  .fx { gap: 6px 10px; }
  .fx .when { width: auto; min-width: 48px; }
  .fx .grow { flex: 1 1 calc(100% - 70px); }
  .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs > * { flex: none; }
  .tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .modal, .dialog { width: 96vw !important; max-width: 96vw; }
}
@media (max-width: 520px) {
  .main { padding: 10px 10px 60px; }
  .card { padding: 14px; }
  .form { grid-template-columns: 1fr !important; }
}
.conn-dev { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: rgba(255,255,255,.015); }
.conn-dev .row > label.f { min-width: 0; }
.conn-dev code, .card code { font-size: 12px; }
.conn-dev .row > select, .conn-dev .row > input, .card .row > select { width: auto; flex: 0 1 auto; min-width: 120px; max-width: 100%; }
.conn-dev .row > input[type=number] { min-width: 60px; }

/* productions calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.cal-head { padding: 6px 8px; font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
.cal-day { min-height: 104px; padding: 4px 5px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: #191919; }
.cal-day.other .cal-n { opacity: .45; }
.cal-day.today .cal-n { background: var(--accent); color: var(--on-accent); border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; font-weight: 700; }
.cal-n { font-size: 12px; margin-bottom: 3px; }
.cal-ev { font-size: 12px; padding: 2px 6px; border-radius: 4px; margin-bottom: 3px; background: #3a3a3a; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev:hover { filter: brightness(1.25); }
.cal-ev.production { background: #2f4e6b; }
.cal-ev.fixture { background: #4b4b4b; }
.cal-ev.booked { background: var(--accent); color: var(--on-accent); font-weight: 600; }
@media (max-width: 700px) { .cal-day { min-height: 70px; padding: 2px; } .cal-ev { font-size: 10px; padding: 1px 3px; } .cal-head { font-size: 10px; padding: 4px; } }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Send call sheet: who gets it */
.cs-picks { max-height: 46vh; overflow: auto; border: 1px solid var(--line, #333); border-radius: 8px; margin-bottom: 10px; }
.cs-pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line, #333); cursor: pointer; }
.cs-pick:last-child { border-bottom: 0; }
.cs-pick input { width: 18px; height: 18px; flex: none; }
.cs-pick .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
