/* Redwood Sky Studios (WFH) portal */
:root {
  --bg: #f3f4f7; --card: #fff; --ink: #172033; --muted: #64708a; --line: #e4e7ee; --soft: #f6f7fa;
  --side: #121a2b; --side-ink: #c9d1e3; --side-active: #1f2a42;
  --brand: #a3392b; --primary: #2563eb; --primary-ink: #fff;
  --green: #15803d; --green-bg: #e8f6ee; --amber: #b45309; --amber-bg: #fff4e0;
  --red: #b42318; --red-bg: #fdecea; --blue: #2563eb; --blue-bg: #e8effe; --slate: #475569; --slate-bg: #eef1f5;
  --c-active: #22a052; --c-idle: #f0a020; --c-break: #4f86f7; --c-locked: #6b7a90; --c-none: #e7eaf0;
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 14px; } .mt2 { margin-top: 22px; } .mb { margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* layout */
.shell { display: flex; min-height: 100vh; }
.side { width: 232px; flex: none; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 18px 18px 14px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid #222c42; }
.brand .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; }
.brand .nm { color: #fff; font-weight: 700; font-size: 14px; line-height: 1.2; }
.brand .tag { font-size: 11px; color: #8f9bb6; }
.nav { padding: 10px 8px; flex: 1; overflow: auto; }
.nav .sec { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #6f7c98; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-ink); text-decoration: none; }
.nav a:hover { background: #18223a; }
.nav a.on { background: var(--side-active); color: #fff; }
.nav .badge { margin-left: auto; background: var(--brand); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; }
.workpill { margin: 8px; padding: 10px 12px; border-radius: 10px; background: #1a2338; font-size: 12px; color: #c9d1e3; display: flex; gap: 8px; align-items: center; cursor: pointer; }
.workpill .d { width: 9px; height: 9px; border-radius: 50%; background: #6b7a90; flex: none; }
.workpill.on .d { background: #34d36b; box-shadow: 0 0 0 3px rgba(52,211,107,.2); }
.workpill.brk .d { background: #6aa0ff; }
.workpill.idle .d { background: #f6b23c; }
.me { padding: 12px 16px; border-top: 1px solid #222c42; font-size: 12px; }
.me b { color: #fff; display: block; font-size: 13px; }
.me a { color: #9fb0d4; }
.main { flex: 1; min-width: 0; padding: 22px 26px 60px; }
.pagehead { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.pagehead .sub { color: var(--muted); }
@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .side { width: auto; height: auto; position: static; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav .sec { display: none; }
  .main { padding: 16px; }
}

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card.tight { padding: 12px 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 2px; }
.stat .s { font-size: 12px; color: var(--muted); }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 14px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--soft); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: #1d4fd0; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.red { background: var(--red-bg); border-color: #f5c8c3; color: var(--red); }
.btn.big { padding: 14px 22px; font-size: 16px; border-radius: 11px; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: default; }
label.f { display: block; font-size: 12.5px; font-weight: 600; margin: 12px 0 5px; color: #2b3650; }
.inp, select.inp, textarea.inp { width: 100%; padding: 9px 11px; border: 1px solid #cfd5df; border-radius: 9px; background: #fff; }
.inp:focus { outline: 2px solid rgba(37,99,235,.2); border-color: var(--primary); }
textarea.inp { min-height: 80px; resize: vertical; }
.inp.num { max-width: 140px; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 14px; }
.check { display: inline-flex; gap: 6px; align-items: center; margin-right: 12px; font-size: 13px; }
.seg { display: inline-flex; background: var(--slate-bg); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--slate); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }

/* messages */
.msg { padding: 10px 13px; border-radius: 9px; font-size: 13.5px; margin-top: 12px; }
.msg.err { background: var(--red-bg); color: var(--red); }
.msg.ok { background: var(--green-bg); color: var(--green); }
.msg.warn { background: var(--amber-bg); color: #8a4b00; }
.msg.info { background: var(--blue-bg); color: #1e40af; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 99; background: #172033; color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.2); max-width: 380px; }
.toast.err { background: var(--red); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--slate-bg); color: var(--slate); }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.blue { background: var(--blue-bg); color: var(--blue); }
.chip .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; background: #fff; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line); background: var(--soft); position: sticky; top: 0; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fafbfd; }
.tblwrap { border: 1px solid var(--line); border-radius: var(--r); overflow: auto; background: #fff; }

/* progress */
.prog { height: 8px; background: var(--slate-bg); border-radius: 99px; overflow: hidden; position: relative; min-width: 80px; }
.prog > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green); border-radius: 99px; }
.prog > i.p { background: #9ec5a9; }
.prog.amber > i { background: var(--c-idle); }

/* my day */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1000px) { .hero { grid-template-columns: 1fr; } }
.countdown { border-radius: var(--r); padding: 16px 18px; font-size: 15px; display: flex; gap: 14px; align-items: center; }
.countdown .t { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.countdown.ok { background: var(--green-bg); color: #0f5a2c; }
.countdown.warn { background: var(--amber-bg); color: #7a4300; }
.countdown.bad { background: var(--red-bg); color: #8f1c13; }
.countdown.info { background: var(--blue-bg); color: #1e3a8a; }
.preview { width: 100%; aspect-ratio: 16/9; background: #0d1322; border-radius: 10px; object-fit: contain; display: block; }
.statebig { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.statebig .d { width: 14px; height: 14px; border-radius: 50%; }
.steps { counter-reset: s; margin: 0; padding: 0; list-style: none; }
.steps li { counter-increment: s; position: relative; padding: 0 0 12px 34px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 50%; background: var(--slate-bg); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.steps li.done::before { content: "✓"; background: var(--green-bg); color: var(--green); }
.breaks { display: flex; gap: 8px; flex-wrap: wrap; }

/* live grid */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile, 320px), 1fr)); gap: 14px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; transition: box-shadow .15s; }
.tile:hover { box-shadow: 0 6px 20px rgba(16,24,40,.10); }
.tile .scr { position: relative; aspect-ratio: 16/9; background: #0d1322; }
.tile .scr img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tile .scr .ov { position: absolute; inset: 0; display: none; place-items: center; text-align: center; padding: 10px; color: #fff; font-weight: 600; background: rgba(13,19,34,.65); }
.tile.dim .scr .ov { display: grid; }
.tile.dim .scr img { filter: grayscale(1); opacity: .5; }
.tile .scr .tag { position: absolute; top: 8px; left: 8px; }
.tile .meta { padding: 10px 12px; }
.tile .meta .n { font-weight: 700; }
.tile .bar { display: flex; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 3px; flex-wrap: wrap; }
.warnline { color: var(--red); font-size: 12px; font-weight: 600; margin-top: 4px; }

/* timeline */
.tl { position: relative; height: 34px; background: var(--c-none); border-radius: 7px; overflow: hidden; cursor: pointer; }
.tl .seg { position: absolute; top: 0; bottom: 0; }
.tl .mark { position: absolute; top: 0; bottom: 0; width: 2px; background: #111827; opacity: .55; }
.tl .cursor { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #e11d48; }
.tlaxis { position: relative; height: 18px; font-size: 11px; color: var(--muted); }
.tlaxis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.player { background: #0d1322; border-radius: var(--r); padding: 12px; color: #dfe5f1; }
.player .stage { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.player .stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.player .stage .cap { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.65); padding: 3px 9px; border-radius: 6px; font-size: 12px; }
.player .ctl { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.player .ctl input[type=range] { flex: 1; min-width: 160px; }
.player .btn, .player select.inp { background: #1f2a42; border-color: #2c3957; color: #fff; }
.player .seg { background: #1f2a42; }
.player .seg button { color: #c9d1e3; }
.player .seg button.on { background: #fff; color: var(--ink); }
.events { max-height: 420px; overflow: auto; }
.events div { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.events .tm { color: var(--muted); width: 70px; flex: none; font-variant-numeric: tabular-nums; }

/* leads */
.leads { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lead { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.lead .pic { aspect-ratio: 16/10; background: var(--soft); display: grid; place-items: center; color: var(--muted); font-size: 12px; cursor: zoom-in; }
.lead .pic img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.lead .body { padding: 10px 12px; font-size: 13px; }
.lead .body b { display: block; }
.lead.bad { opacity: .6; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(10,15,28,.55); z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal .box { background: #fff; border-radius: 14px; width: min(560px, 100%); max-height: 92vh; overflow: auto; padding: 22px; }
.modal .box.wide { width: min(1100px, 100%); }
.modal .box.img { width: auto; max-width: 96vw; padding: 8px; background: #0d1322; }
.modal .box.img img { max-width: 94vw; max-height: 88vh; display: block; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 500px at 10% -10%, #fbe9e6, transparent), radial-gradient(900px 500px at 110% 110%, #e3ecff, transparent), var(--bg); }
.auth .box { width: min(420px, 100%); }
.auth .logo { width: 46px; height: 46px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.auth h1 { margin: 14px 0 4px; }
.alerts .a { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.alerts .a:last-child { border-bottom: 0; }
.alerts .a .d { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; }
.alerts .a.red .d { background: var(--red); }
.alerts .a.amber .d { background: var(--c-idle); }
.empty { padding: 30px; text-align: center; color: var(--muted); }
