/* ATSR B2B QA Audit - styles. Brand tokens from the ATSR brand system. */

@font-face { font-family: "Host Grotesk"; src: url("../assets/fonts/HostGrotesk-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Host Grotesk"; src: url("../assets/fonts/HostGrotesk-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Host Grotesk"; src: url("../assets/fonts/HostGrotesk-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Host Grotesk"; src: url("../assets/fonts/HostGrotesk-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --teal: #0d4b3f;
  --teal-deep: #08332b;
  --turquoise: #27eaa6;
  --lime: #d8ff5e;
  --mint: #e8f5ee;
  --mint-deep: #d3f1e4;
  --charcoal: #232428;
  --grey: #6e7074;
  --line: #d8e2dd;
  --paper: #f6faf8;
  --red: #b3261e;
  --red-soft: #fbeceb;
  --amber: #b7791f;
  --amber-soft: #fff4de;
  --font: "Host Grotesk", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; font-family: var(--font); color: var(--charcoal); background: var(--paper); line-height: 1.45; font-size: 15px; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 30px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.01em; color: var(--teal); }
h2 { font-size: 19px; font-weight: 600; margin: 0; }
h3 { font-size: 15px; font-weight: 600; margin: 22px 0 10px; color: var(--teal); }
p { margin: 0 0 8px; }
.muted { color: var(--grey); }
.small { font-size: 12.5px; }
.warn { color: var(--red); }
.empty { padding: 40px 0; color: var(--grey); }

/* top bar */
.topbar { background: var(--teal); color: #fff; padding: 0 20px; padding-top: env(safe-area-inset-top, 0px); }
.topbar-in { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 600; }
.brand img { height: 30px; background: #fff; border-radius: 3px; padding: 3px 6px; }
.brand span { border-left: 1px solid rgba(255,255,255,.35); padding-left: 12px; }
.topbar nav a { color: #fff; opacity: .85; margin-left: 18px; font-weight: 500; }
.topbar nav a:hover { opacity: 1; text-decoration: none; }
.status { max-width: 1120px; margin: 0 auto; padding: 0 20px; font-size: 13px; min-height: 18px; color: var(--grey); }
.status.ok { color: var(--teal); }
.status.err { color: var(--red); }

main { max-width: 1120px; margin: 0 auto; padding: 14px 20px 80px; padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
.crumbs { font-size: 13px; color: var(--grey); margin: 8px 0 12px; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 8px 0 22px; flex-wrap: wrap; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 9px 16px; border-radius: 6px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; border: 1px solid transparent; line-height: 1; }
.btn.primary { background: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-deep); text-decoration: none; }
.btn.primary:disabled { background: #b9c9c3; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--teal); border-color: var(--line); }
.btn.ghost:hover { background: var(--mint); text-decoration: none; }
.btn.danger { background: #fff; color: var(--red); border-color: #efc7c4; }
.btn.danger:hover { background: var(--red-soft); }
.btn.block { width: 100%; margin-top: 8px; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--teal); cursor: pointer; }
button.link:hover { text-decoration: underline; }

/* team cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.member { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.member-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.member .role { color: var(--grey); font-size: 13px; }
.member-actions { display: flex; gap: 8px; margin-top: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 0; }
.stats.wide { grid-template-columns: repeat(4, minmax(120px, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; margin: 0 0 8px; }
.stats div { display: flex; flex-direction: column; }
.stats dt { font-size: 12px; color: var(--grey); }
.stats dd { margin: 0; font-weight: 600; font-size: 17px; }

/* badges */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.pass { background: var(--mint-deep); color: var(--teal); }
.badge.coach { background: var(--amber-soft); color: var(--amber); }
.badge.fail { background: var(--red-soft); color: var(--red); }
.badge.none { background: #eceff0; color: var(--grey); }

/* tables */
.two-col { display: grid; grid-template-columns: 1fr 320px; gap: 24px; margin-top: 26px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 18px 14px; align-self: start; }
.panel h3 { margin-top: 12px; }
ul.plain { padding-left: 18px; margin: 0 0 6px; font-size: 13.5px; }
ul.plain li { margin-bottom: 4px; }
.list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 14px; }
.list th { text-align: left; background: var(--teal); color: #fff; font-weight: 600; padding: 9px 12px; font-size: 13px; }
.list td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.list tbody tr[onclick] { cursor: pointer; }
.list tbody tr[onclick]:hover, .list tbody tr:hover { background: var(--mint); }
.list tr.dim td { color: var(--grey); }
.row-actions { white-space: nowrap; }
.row-actions a, .row-actions button { margin-right: 10px; }
.table-wrap { overflow-x: auto; }

/* forms */
input[type=text], input[type=date], select, textarea { font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--turquoise); outline-offset: 1px; }
label { display: block; font-size: 13px; color: var(--grey); font-weight: 500; }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--charcoal); font-weight: 400; font-size: 14px; }
.inline-form { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.inline-form input { max-width: 320px; }
.inline-form select { max-width: 240px; }
.meta-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.when { font-size: 13.5px; color: var(--grey); margin: 12px 2px 14px; }

/* audit layout */
.audit { display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: start; }
.audit-main { min-width: 0; }
.item { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; }
.item.is-fail { border-color: #e7b9b6; background: #fffafa; }
.item-n { font-weight: 600; color: var(--grey); font-size: 14px; padding-top: 2px; }
.item-body p { margin: 0 0 6px; font-size: 14.5px; }
.item-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; }
.ref { color: var(--grey); }
.crit { color: var(--red); font-weight: 600; }
.note { margin-top: 8px; font-size: 13px; resize: none; overflow: hidden; min-height: 34px; }
.note-ro { margin-top: 8px; font-size: 13px; background: var(--mint); border-radius: 6px; padding: 8px 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; align-self: start; }
.seg button { font: inherit; font-size: 13px; font-weight: 600; background: #fff; border: 0; border-left: 1px solid var(--line); padding: 8px 12px; cursor: pointer; color: var(--grey); }
.seg button:first-child { border-left: 0; }
.seg button:hover { background: var(--mint); }
.seg button.on[data-r=pass] { background: var(--teal); color: #fff; }
.seg button.on[data-r=fail] { background: var(--red); color: #fff; }
.seg button.on[data-r=na] { background: var(--grey); color: #fff; }
.readonly .seg { border: 0; }
.pill { display: inline-block; padding: 6px 12px; border-radius: 6px; font-weight: 600; font-size: 13px; }
.pill.pass { background: var(--teal); color: #fff; }
.pill.fail { background: var(--red); color: #fff; }
.pill.na { background: var(--grey); color: #fff; }
.pill.none { background: #eceff0; color: var(--grey); }
.coaching { margin-top: 18px; }
.coaching textarea { font-size: 14px; }
.coaching-ro { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; white-space: pre-wrap; font-size: 14px; }

/* result panel - the one loud element */
.result-panel { position: sticky; top: 16px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.score { border-radius: 8px; padding: 18px 16px 16px; color: #fff; background: var(--teal); }
.score .big { font-size: 46px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.score .word { margin-top: 6px; font-size: 16px; font-weight: 600; }
.score .why { margin-top: 4px; font-size: 12.5px; opacity: .9; }
.score.pass { background: var(--teal); }
.score.pass .word { color: var(--lime); }
.score.coach { background: var(--amber); }
.score.fail { background: var(--red); }
.score.none { background: #9aa7a2; }
.tally { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 8px; }
.tally div { text-align: center; background: var(--mint); border-radius: 6px; padding: 6px 2px; }
.tally dt { font-size: 11px; color: var(--grey); }
.tally dd { margin: 0; font-weight: 700; font-size: 16px; }

/* scorecard definitions */
.card-def { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin-bottom: 10px; }
.card-def summary { cursor: pointer; font-size: 15px; }
.def-list { padding-left: 22px; font-size: 14px; }
.def-list li { margin: 6px 0; }
.def-list .ref { margin-left: 6px; font-size: 12px; }
.def-list .crit { margin-left: 8px; font-size: 12px; }

@media (max-width: 860px) {
  .audit, .two-col { grid-template-columns: 1fr; }
  .result-panel { position: static; }
  .meta-grid { grid-template-columns: 1fr 1fr; }
  .item { grid-template-columns: 26px 1fr; }
  .item .seg { grid-column: 2; justify-self: start; }
  .topbar-in { height: auto; min-height: 52px; padding: 8px 0; gap: 10px; }
  .brand span { display: none; }
  .brand img { height: 26px; }
  .topbar nav { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
  .topbar nav a { margin: 0; }
  .stats.wide, .stats { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* v2: file-based audit header, reminders, per-person scores */
.head-block { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.seg.wide { display: flex; width: 100%; margin-bottom: 12px; }
.seg.wide button { flex: 1; padding: 10px 12px; }
.seg.wide button.on { background: var(--teal); color: #fff; }
.meta-grid.three { grid-template-columns: repeat(3, 1fr); border: 0; padding: 0; background: none; }
.people { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.people-title { font-size: 13px; font-weight: 600; color: var(--teal); margin-bottom: 6px; }
.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.remind { background: var(--mint); border-radius: 8px; padding: 10px 14px; margin: 12px 0 0; font-size: 13px; }
.remind.college { background: #fff9e6; border: 1px solid #f0dfa8; }
.remind strong { color: var(--teal); }
.remind ul { margin: 4px 0 0; padding-left: 18px; }
.remind li { margin: 2px 0; }
h3.phase { margin: 22px 0 8px; font-size: 14px; }
h3.phase .muted { font-weight: 400; font-size: 12px; margin-left: 6px; }
.who { color: var(--teal); font-weight: 600; }
.people-scores { margin: 4px 0 8px; }
.ps { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.ps > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.ps-r { font-weight: 700; padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.ps-r.pass { background: var(--mint-deep); color: var(--teal); }
.ps-r.coach { background: var(--amber-soft); color: var(--amber); }
.ps-r.fail { background: var(--red-soft); color: var(--red); }
.ps-r.none { background: #eceff0; color: var(--grey); }
@media (max-width: 860px) {
  .meta-grid.three, .people-grid { grid-template-columns: 1fr 1fr; }
  .seg.wide { flex-direction: column; }
  .seg.wide button { border-left: 0; border-top: 1px solid var(--line); }
  .seg.wide button:first-child { border-top: 0; }
}

/* v2.1: file facts line, wide label */
.meta-grid .span2 { grid-column: span 2; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; font-size: 13px; color: var(--charcoal); }
.facts:empty { display: none; }
.facts b { color: var(--teal); font-weight: 600; margin-right: 4px; }
.seg.wide button { white-space: nowrap; }
@media (max-width: 860px) { .meta-grid .span2 { grid-column: span 2; } }
.meta-grid .span3 { grid-column: 1 / -1; }
