/* Shades Track : admin portal + public pages */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --ink: #15171c;          /* sidebar, headings */
  --ink-2: #23262e;
  --paper: #f3f4f6;        /* page background */
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --line: #e3e5ea;
  --line-2: #d4d7de;
  --text: #1b1d22;
  --muted: #646b78;
  --faint: #9298a4;
  --rec: #e5484d;          /* record red: live state + primary action */
  --rec-soft: #fdecec;
  --link: #2f5fd0;
  --series-hours: #257de0;
  --prod: #0f9960;
  --neutral: #a3a9b3;
  --unprod: #d9480f;
  --ok: #0f9960; --ok-soft: #e4f5ed;
  --warn: #b26b00; --warn-soft: #fdf3e1;
  --bad: #c92a2a; --bad-soft: #fdeaea;
  --radius: 10px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Manrope', -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #0d0e11; --ink-2: #1a1c22; --paper: #121317; --surface: #1a1c21; --surface-2: #20232a;
    --line: #2b2f37; --line-2: #383d47; --text: #e8eaee; --muted: #a0a6b2; --faint: #747b88;
    --rec-soft: #3a1c1e; --link: #8fb0ff; --series-hours: #338ced;
    --ok-soft: #12322a; --warn: #e0a33a; --warn-soft: #33281a; --bad: #f07272; --bad-soft: #3a1d1d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #0d0e11; --ink-2: #1a1c22; --paper: #121317; --surface: #1a1c21; --surface-2: #20232a;
  --line: #2b2f37; --line-2: #383d47; --text: #e8eaee; --muted: #a0a6b2; --faint: #747b88;
  --rec-soft: #3a1c1e; --link: #8fb0ff; --series-hours: #338ced;
  --ok-soft: #12322a; --warn: #e0a33a; --warn-soft: #33281a; --bad: #f07272; --bad-soft: #3a1d1d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--text); font: 500 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.01em; }
.mono, .num { font-family: var(--mono); font-feature-settings: 'tnum'; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- record dot ---------- */
.rec { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--rec); box-shadow: 0 0 0 3px rgba(229,72,77,.18); vertical-align: middle; }
.rec.live { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(229,72,77,.05); } }
@media (prefers-reduced-motion: reduce) { .rec.live { animation: none; } }

/* ---------- buttons + forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--rec); border-color: var(--rec); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
label > input, label > select, label > textarea { display: block; width: 100%; margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input:not([type]), select, textarea {
  height: 38px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 500; font-size: 14px; }
textarea { height: auto; padding: 9px 11px; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 18%, transparent); }
label.check { display: flex; gap: 9px; align-items: center; color: var(--text); font-weight: 600; font-size: 13.5px; }
label.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--rec); }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 20px; cursor: pointer; transition: .15s; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }

/* ---------- public pages (sign in, invite, install) ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 40px;
  background: radial-gradient(1200px 500px at 50% -200px, #262a33 0, var(--ink) 60%); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 14px; padding: 30px; box-shadow: 0 30px 60px rgba(0,0,0,.3); }
.auth-card.wide { max-width: 620px; }
.auth-card h1 { font-size: 23px; margin: 18px 0 8px; }
.auth-card p { margin: 0 0 16px; }
.auth-card form { margin-top: 18px; }
.auth-card .btn.primary { width: 100%; height: 42px; font-size: 14px; }
.auth-card fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 14px 14px 4px; margin: 0 0 16px; }
.auth-card legend { font-weight: 800; padding: 0 6px; font-size: 13px; }
.brand { font-family: var(--mono); font-weight: 600; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; display: flex; align-items: center; gap: 9px; }
.auth-card .brand { color: var(--muted); }
.alert { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: 13.5px; margin: 10px 0 14px; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.notice { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; margin: 6px 0 16px; font-size: 13.5px; }
.notice p { margin: 6px 0 10px; color: var(--muted); }
.downloads { display: grid; gap: 10px; margin: 18px 0 8px; }
.dl { display: block; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--text); }
.dl:hover { border-color: var(--text); }
.dl.suggested { border-color: var(--rec); background: var(--rec-soft); }
.dl.suggested .dl-title::after { content: 'Your Mac'; margin-left: 10px; font-size: 11px; background: var(--rec); color: #fff; padding: 2px 7px; border-radius: 10px; vertical-align: 2px; }
.dl-title { display: block; font-weight: 800; font-size: 15px; }
.dl-sub { display: block; color: var(--muted); font-size: 13px; }
.steps { padding-left: 20px; margin: 18px 0 0; }
.steps li { margin-bottom: 8px; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #c9ccd3; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { color: #fff; padding: 4px 10px 18px; }
.side .company { color: #7d838f; font-size: 12px; padding: 0 10px 14px; margin-top: -12px; }
.nav-group { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #6d7380; padding: 16px 10px 6px; }
.nav a { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-radius: 7px; color: #c9ccd3; text-decoration: none; font-weight: 600; font-size: 13.5px; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.active { background: #2b2f38; color: #fff; }
.nav .count { background: var(--rec); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 7px; font-weight: 800; }
.side-foot { margin-top: 24px; padding: 12px 10px; border-top: 1px solid #262a32; font-size: 12.5px; }
.side-foot b { color: #fff; display: block; }
.side-foot button { background: none; border: 0; color: #8b919d; padding: 0; cursor: pointer; font-weight: 600; margin-top: 4px; }
.side-foot button:hover { color: #fff; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px);
  padding: 14px 26px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 20px; margin-right: auto; }
.menu-btn { display: none; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 0 11px; height: 34px; font-weight: 700; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: #fff; }
.filters input[type=date] { height: 36px; }
.filters select { height: 36px; max-width: 200px; }
.page { padding: 22px 26px 60px; max-width: 1400px; }

/* ---------- cards + grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card h2 { font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h2 .aside { margin-left: auto; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.grid > .card + .card { margin-top: 0; }
.kpi { padding: 16px 18px; }
.kpi .k { font-size: 12px; font-weight: 700; color: var(--muted); }
.kpi .v { font-family: var(--mono); font-size: 27px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; }
.kpi .s { font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 26px 12px; font-size: 13.5px; }
.empty .btn { margin-top: 10px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--mono); white-space: nowrap; }
tbody tr:hover { background: var(--surface-2); }
.who { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 800; color: #fff; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.dim { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.rec { background: var(--rec-soft); color: var(--rec); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.bar-mini { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; min-width: 60px; }
.bar-mini > span { display: block; height: 100%; background: var(--series-hours); border-radius: 3px; }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 500 11px var(--mono); }
.chart .bar { fill: var(--series-hours); }
.chart .bar:hover, .chart .hit:hover + .bar { filter: brightness(1.12); }
.tip { position: fixed; z-index: 100; pointer-events: none; background: var(--ink); color: #fff; padding: 7px 10px; border-radius: 7px; font-size: 12.5px; box-shadow: 0 8px 20px rgba(0,0,0,.25); white-space: nowrap; }
.tip b { font-family: var(--mono); }
.split { display: flex; height: 14px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface); }
.split > span { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.p-prod { background: var(--prod); } .p-neutral { background: var(--neutral); } .p-unprod { background: var(--unprod); }

/* ---------- live list ---------- */
.live-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.live-row:last-child { border-bottom: 0; }
.live-row .meta { flex: 1; min-width: 0; }
.live-row .meta div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-row .timer { font-family: var(--mono); font-weight: 600; }

/* ---------- SIGNATURE: editing-timeline report ---------- */
.tl { --label-w: 170px; position: relative; background: var(--ink); color: #c9ccd3; border-radius: var(--radius); padding: 0 0 6px; overflow: hidden; }
.tl-scroll { overflow-x: auto; }
.tl-inner { min-width: 900px; position: relative; }
.tl-ruler { display: grid; grid-template-columns: var(--label-w) 1fr; height: 34px; border-bottom: 1px solid #2b2f38; position: sticky; top: 0; background: var(--ink); z-index: 2; }
.tl-ruler .ticks { position: relative; }
.tl-ruler .tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid #2b2f38; font: 500 10.5px var(--mono); color: #7d838f; padding: 9px 0 0 5px; }
.tl-ruler .tick.minor { top: 24px; color: transparent; }
.tl-track { display: grid; grid-template-columns: var(--label-w) 1fr; height: 54px; border-bottom: 1px solid #22252d; }
.tl-track:nth-child(odd) .lane { background: #191b21; }
.tl-label { padding: 8px 12px; font-weight: 700; color: #fff; font-size: 13px; border-right: 1px solid #2b2f38; overflow: hidden; }
.tl-label .t { font: 500 11.5px var(--mono); color: #8b919d; display: block; }
.lane { position: relative; }
.clip { position: absolute; top: 8px; height: 26px; border-radius: 4px; background: var(--c, #5b6cff); color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 4px 7px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); cursor: default; min-width: 3px; }
.clip.manual { background: repeating-linear-gradient(135deg, var(--c, #5b6cff) 0 6px, color-mix(in srgb, var(--c, #5b6cff) 70%, #000) 6px 12px); }
.clip.pending { opacity: .55; outline: 1.5px dashed #fff; outline-offset: -2px; }
.clip.live::after { content: ''; position: absolute; right: 5px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.brk { position: absolute; top: 8px; height: 26px; border-radius: 4px; border: 1px dashed #7d838f; color: #a7adb8; font-size: 11px; padding: 4px 6px; overflow: hidden; white-space: nowrap; }
.act { position: absolute; bottom: 6px; height: 5px; border-radius: 1px; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--rec); z-index: 3; pointer-events: none; }
.playhead::before { content: ''; position: absolute; top: 0; left: -5px; width: 12px; height: 12px; border-radius: 0 0 6px 6px; background: var(--rec); }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 14px 4px; font-size: 12px; color: #8b919d; }
.tl-legend i { display: inline-block; width: 18px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* ---------- screenshots ---------- */
.shots-user { margin-bottom: 26px; }
.shots-user > h3 { font-size: 15px; margin-bottom: 10px; display: flex; gap: 10px; align-items: center; }
.hour-row { display: grid; grid-template-columns: 64px 1fr; gap: 12px; margin-bottom: 12px; }
.hour-row .h { font: 600 12.5px var(--mono); color: var(--muted); padding-top: 6px; }
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.shot { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: zoom-in; padding: 0; text-align: left; }
.shot img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; background: var(--surface-2); }
.shot .cap { padding: 6px 8px; font-size: 11.5px; display: flex; justify-content: space-between; gap: 6px; color: var(--muted); }
.shot .cap span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-meter { height: 4px; background: var(--surface-2); }
.act-meter span { display: block; height: 100%; background: var(--series-hours); }

/* ---------- modal + toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10,11,14,.55); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; padding: 22px; box-shadow: 0 30px 70px rgba(0,0,0,.35); }
.modal.xl { max-width: 1100px; padding: 12px; }
.modal h2 { font-size: 18px; margin-bottom: 14px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.modal img { width: 100%; border-radius: 8px; display: block; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 9px; font-weight: 700; font-size: 13.5px; z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 140px; }
.settings-list .set { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.settings-list .set:last-child { border-bottom: 0; }
.settings-list .set b { display: block; font-size: 13.5px; }
.settings-list .set span { color: var(--muted); font-size: 12.5px; }
.settings-list .set select, .settings-list .set input { width: auto; min-width: 110px; }
.copy-link { display: flex; gap: 6px; margin-top: 6px; }
.copy-link input { flex: 1; font-family: var(--mono); font-size: 12px; }
.week { display: grid; grid-template-columns: 80px 1fr 1fr; gap: 6px 10px; align-items: center; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 9px 12px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--rec); }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .page { padding: 16px 16px 50px; }
  .grid.g2, .grid.g3 { grid-template-columns: 1fr; }
  .tl { --label-w: 110px; }
}

/* ---------- my dashboard: day timelines ---------- */
.tl-table td { padding: 8px 10px; }
.hours { display: flex; justify-content: space-between; font: 500 10.5px var(--mono); color: var(--faint); text-transform: none; letter-spacing: 0; }
.daybar { position: relative; height: 18px; background: var(--surface-2); border-radius: 4px; min-width: 260px; }
.daybar i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.daybar .seg { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; background: var(--series-hours); }
.daybar .seg.manual { background: var(--prod); }
.daybar .seg.break { background: transparent; border: 1px dashed var(--neutral); }
.daybar .seg.pending { opacity: .5; }
