/* Copied from midnight-replacement/web/css/app.css (base, shell, forms, tables, login) on 2026-10-27; EOS screens below. */
/* Jurassic Marketing palette (CLAUDE.md "Branding"): #2B1C14 dark brown (text/headers),
   #4F392C brown, #475B2A dark green (primary actions), #899D40 light green (accents/success).
   Everything below is one of those four or a tint of one -- no invented brand colors.
   --danger/--warn/--focus stay standard semantic colors (error/warning/focus-ring are safety
   signals, not brand elements). */
:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --surface-2: #efe9e1;
  --text: #2b1c14;
  --muted: #6b5a4d;
  --line: #ded2c4;
  --brand: #475b2a;
  --brand-hover: #384717;
  --on-brand: #ffffff;
  --link: #475b2a;
  --danger: #9e2a2a;
  --danger-bg: #fbeaea;
  --warn-bg: #fff3d6;
  --warn-text: #6b4a00;
  --ok-bg: #e9edd9;
  --ok-text: #3c4e22;
  --focus: #2b7de0;
  --shadow: 0 1px 2px rgba(43, 28, 20, .08);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1712;
    --surface: #28201a;
    --surface-2: #342a22;
    --text: #f1ece4;
    --muted: #b9a99a;
    --line: #453626;
    --brand: #899d40;
    --brand-hover: #a3ba54;
    --on-brand: #1a2208;
    --link: #a9c15c;
    --danger: #ff8f8f;
    --danger-bg: #3a1e1e;
    --warn-bg: #3a2f12;
    --warn-text: #f1cf7a;
    --ok-bg: #2c3a16;
    --ok-text: #c3d98f;
    --focus: #6aa8f5;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--link); }
h1 { font-size: 1.5rem; margin: 0; line-height: 1.2; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: .9rem; margin: 1rem 0 .4rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: .9rem .6rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: .4rem .7rem; z-index: 10; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li + li { margin-top: .2rem; }

/* shell */
.topbar {
  display: flex; align-items: center; gap: 1.25rem; padding: 0 1rem; min-height: 52px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: .5rem; }
.brand img, .login-card h1 img { height: 24px; }
.logo-light, .logo-dark { display: block; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .logo-light { display: none; } .logo-dark { display: block; } }
.brand .app-name { color: var(--muted); font-weight: 600; }
.env { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; padding: .1rem .4rem; border-radius: 4px; background: var(--warn-bg); color: var(--warn-text); }
.nav { display: flex; gap: .25rem; flex: 1; }
.nav-link { padding: .4rem .7rem; border-radius: 6px; color: var(--text); text-decoration: none; }
.nav-link:hover { background: var(--surface-2); }
.nav-link[aria-current="page"] { background: var(--surface-2); font-weight: 600; }
.user { position: relative; }
.user summary { cursor: pointer; padding: .4rem .6rem; border-radius: 6px; list-style: none; }
.user summary::-webkit-details-marker { display: none; }
.user summary:hover { background: var(--surface-2); }
.user .menu {
  position: absolute; right: 0; top: calc(100% + 4px); min-width: 230px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: .75rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
  display: flex; flex-direction: column; gap: .5rem; align-items: flex-start;
}
.linklike { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; text-decoration: underline; }
.page { max-width: 1120px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.subtitle { font-weight: 400; color: var(--muted); font-size: 1.05rem; margin-left: .6rem; }
.narrow { max-width: 460px; }

/* cards + forms */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .75rem; min-width: 0; }
.field > label, .field > .label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.hint { font-size: .8rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: .45rem .6rem; min-height: 36px;
}
textarea { resize: vertical; }
input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 1rem; }
.check { display: flex; align-items: flex-start; gap: .55rem; cursor: pointer; }
.check input { margin-top: .25rem; width: 1rem; height: 1rem; }
.release { background: var(--surface-2); border-radius: 8px; padding: .6rem .8rem; margin-bottom: .5rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600;
  padding: .5rem .95rem; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  text-decoration: none; cursor: pointer; min-height: 36px;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-small { padding: .25rem .6rem; min-height: 30px; font-size: .88rem; }
.btn-danger { color: var(--danger); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn:disabled { opacity: .6; cursor: progress; }

.notice { padding: .65rem .85rem; border-radius: 8px; margin: .5rem 0 .9rem; }
.notice-error { background: var(--danger-bg); color: var(--danger); }
.notice-warn { background: var(--warn-bg); color: var(--warn-text); }
.notice-ok { background: var(--ok-bg); color: var(--ok-text); }

.tag, .chip, .badge { display: inline-block; font-size: .72rem; padding: .08rem .45rem; border-radius: 999px; margin-left: .4rem; vertical-align: 1px; }
.tag { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.chip { background: var(--surface-2); color: var(--text); margin: 0; font-size: .8rem; padding: .15rem .6rem; }
.chip-stage { background: var(--brand); color: var(--on-brand); }
.badge { background: var(--surface-2); color: var(--text); font-weight: 600; }
.badge.flag-rush { background: #f9d6d6; color: #7a1616; }
.badge.flag-hold, .badge.flag-payment_issue { background: #ffe5b8; color: #6b4200; }
.badge.flag-awaiting_items, .badge.flag-awaiting_approval { background: #dbe8fb; color: #163f7a; }
.badge.flag-proof_approved { background: #e3ecd0; color: #2f4a12; }
.badge.flag-proof_rejected { background: #f6d5d1; color: #7a1f16; }   /* 0098 */
.badge.early { background: #d8f0e2; color: #14512e; }
@media (prefers-color-scheme: dark) {
  .badge.flag-rush { background: #5a1f1f; color: #ffc9c9; }
  .badge.flag-hold, .badge.flag-payment_issue { background: #5a4213; color: #ffdf9c; }
  .badge.flag-awaiting_items, .badge.flag-awaiting_approval { background: #1f3555; color: #bcd6fb; }
  .badge.flag-proof_rejected { background: #5a201a; color: #ffc9c1; }
  .badge.early { background: #1a4029; color: #a8e8c3; }
}
.chips { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.chips .badge { margin: 0; }

/* tables */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.grid th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.grid th.num, .grid td.num { text-align: right; }
.grid tbody tr:hover { background: var(--surface-2); }
.grid tfoot td { font-weight: 600; border-bottom: 0; }
.lines.edit td { padding: .3rem .35rem; }
.lines.edit td:first-child { min-width: 260px; }
.lines.edit td.num input { text-align: right; min-width: 90px; }
.grid.lines.edit tbody tr:hover { background: transparent; }

.toolbar { display: flex; gap: .75rem; align-items: center; margin-bottom: .75rem; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 320px; }
.toolbar select { width: auto; }

/* job entry */
.picked { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .75rem; flex-wrap: wrap; }
.results { list-style: none; margin: .5rem 0 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; max-height: 320px; overflow-y: auto; }
.results li + li { border-top: 1px solid var(--line); }
.result { display: block; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 0; padding: .55rem .75rem; cursor: pointer; }
.result:hover, .result:focus-visible { background: var(--surface-2); }
.part-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .6rem; flex-wrap: wrap; }
.part-head h2 { margin: 0; }


.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.login-card h1 img { height: 34px; }

.login-or { text-align: center; color: var(--muted); font-size: .8rem; margin: .4rem 0 .8rem; }

/* ---------------- EOS ---------------- */
.page.wide { max-width: none; }
.subtitle { margin-left: .6rem; }
.nav.tabs { margin-top: .5rem; gap: .15rem; flex-wrap: wrap; }
.nav.tabs .nav-link { padding: .25rem .65rem; font-size: .88rem; }
.nav.tabs .count { margin-left: .35rem; font-size: .75rem; color: var(--muted); }
.team-pick { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--muted); }
.team-pick select { width: auto; min-width: 160px; }

/* scorecard grid */
.scorecard-wrap { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table.scorecard { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; }
.scorecard th, .scorecard td { border-bottom: 1px solid var(--line); padding: 0; white-space: nowrap; }
.scorecard thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); font-size: .74rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); padding: .5rem .45rem; text-align: left; vertical-align: bottom; }
.scorecard thead th.period { text-align: right; text-transform: none; letter-spacing: 0; font-size: .8rem; }
.scorecard thead th .sub { display: block; font-size: .68rem; font-weight: 400; }
.scorecard thead th.current, .scorecard td.current { box-shadow: inset 2px 0 0 var(--brand), inset -2px 0 0 var(--brand); }
.scorecard td.owner { padding: .4rem .5rem; color: var(--muted); font-size: .85rem; }
.scorecard th.title { padding: .4rem .5rem; font-weight: 600; text-align: left; white-space: normal; min-width: 220px; max-width: 320px;
  position: sticky; left: 0; background: var(--surface); z-index: 1; }
.scorecard thead th.title { z-index: 3; }
.scorecard td.goal { padding: .4rem .6rem; color: var(--muted); font-size: .85rem; text-align: right; }
.scorecard td.agg { padding: .4rem .6rem; font-weight: 600; background: var(--surface-2); }
.scorecard tr.group th { background: var(--surface-2); text-align: left; padding: .35rem .5rem; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.scorecard tbody tr:hover td, .scorecard tbody tr:hover th.title { background-color: var(--surface-2); }
.scorecard td.cell.ok { background: var(--ok-bg); }
.scorecard td.cell.bad { background: var(--danger-bg); }
.scorecard tbody tr:hover td.cell.ok { background: var(--ok-bg); }
.scorecard tbody tr:hover td.cell.bad { background: var(--danger-bg); }
.cell-btn { position: relative; display: block; width: 100%; min-width: 74px; min-height: 36px; padding: .35rem .5rem; border: 0;
  background: transparent; font: inherit; color: var(--text); text-align: right; cursor: pointer; }
td.cell.ok .cell-btn { color: var(--ok-text); }
td.cell.bad .cell-btn { color: var(--danger); font-weight: 600; }
.cell-btn:hover { outline: 1px solid var(--line); outline-offset: -1px; }

/* cell markers: sync dot (left), edited corner (top-right), note corner (bottom-right) */
.mark { display: inline-block; width: 7px; height: 7px; vertical-align: 1px; }
.mark.sync { border-radius: 50%; background: var(--muted); opacity: .55; }
.mark.edited { background: linear-gradient(225deg, var(--focus) 50%, transparent 50%); }
.mark.note { background: linear-gradient(315deg, var(--warn-text) 50%, transparent 50%); }
.cell-btn .mark { position: absolute; }
.cell-btn .mark.sync { left: 5px; top: 50%; margin-top: -3px; width: 5px; height: 5px; }
.cell-btn .mark.edited { right: 0; top: 0; }
.cell-btn .mark.note { right: 0; bottom: 0; }
.legend { margin-top: .6rem; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }

/* score editor */
dialog.score-editor { border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; width: min(420px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
dialog.score-editor::backdrop { background: rgba(20, 14, 10, .45); }
dialog.score-editor h2 { margin-bottom: .2rem; }
dialog.score-editor .actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
.sync-line { background: var(--surface-2); border-radius: 6px; padding: .4rem .6rem; }
.scorecard .agg.first { box-shadow: inset 2px 0 0 var(--line); }
.scorecard thead th.num { text-align: right; }
.scorecard tr.group .group-name { position: sticky; left: .5rem; }

/* Phone width: the nav gets its own row under the brand and scrolls sideways inside it, so the page never does. */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: .25rem .75rem; padding: .4rem .75rem 0; }
  .topbar .brand { flex: 1; }
  .topbar .nav { order: 3; flex: 0 0 100%; overflow-x: auto; scrollbar-width: none; padding-bottom: .35rem; }
  .topbar .nav-link { white-space: nowrap; }
  .user .menu { max-width: calc(100vw - 24px); }
  .page { padding: 1rem 16px 3rem; }
}

/* scorecard admin */
.admin-group-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.admin-group-head h2 { margin: 0; }
.admin-measurables th[scope=row] { text-transform: none; letter-spacing: 0; font-size: inherit; color: var(--text); white-space: normal; }
.admin-actions { white-space: nowrap; text-align: right; }
.admin-editor { width: min(560px, calc(100vw - 32px)); }
.admin-editor .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }
.admin-editor .actions .spacer { flex: 1; }
.admin-editor label.check { display: inline-flex; align-items: center; gap: .3rem; margin-right: .75rem; font-weight: 400; }
.admin-editor .label { font-size: .82rem; font-weight: 600; color: var(--muted); }

/* scorecard admin */
.admin-group-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.admin-group-head h2 { margin: 0; }
.admin-measurables th[scope=row] { text-transform: none; letter-spacing: 0; font-size: inherit; color: var(--text); white-space: normal; }
.admin-actions { white-space: nowrap; text-align: right; }
.admin-editor { width: min(560px, calc(100vw - 32px)); }
.admin-editor .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }
.admin-editor .actions .spacer { flex: 1; }
.admin-editor label.check { display: inline-flex; align-items: center; gap: .3rem; margin-right: .75rem; font-weight: 400; }
.admin-editor .label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.admin-interval { margin: 1.2rem 0 .5rem; } .admin-group h3 { margin: 0; text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--text); }
/* Average sits left of the periods (newest first), ninety.io style: a rule separates it from the weeks. */
.scorecard td.agg, .scorecard thead th.agg { box-shadow: inset -2px 0 0 var(--line); }
.scorecard thead th.period { white-space: nowrap; }
