/* Styles for Athlete Monitor in Middleburg Lady Broncos colors: red, black and white. */
:root {
  /* Middleburg Lady Broncos: logo red, black and white. */
  --brand-red: #c00000; --brand-black: #000000;
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f4f4f5; --ink: #0a0a0a; --muted: #5b5b62; --line: #e3e3e6;
  --accent: #c00000; --accent-ink: #ffffff; --accent-soft: #fbe6e6; --court: #b8731f;
  --good: #1d7a55; --good-soft: #dcf1e6; --warn: #8a5a00; --warn-soft: #fbecd0; --bad: #b3261e; --bad-soft: #f9dedc;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 18px rgba(0, 0, 0, .06);
  --r: 12px; --display: "Anton", "Arial Narrow", sans-serif; --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a; --surface: #141414; --surface-2: #1d1d1f; --ink: #f5f5f5; --muted: #a6a6ad; --line: #2b2b2e;
    --accent: #ff4d4d; --accent-ink: #0a0a0a; --accent-soft: #3a1010; --court: #d8953f;
    --good: #58c595; --good-soft: #13301f; --warn: #eab45a; --warn-soft: #33260f; --bad: #f08a82; --bad-soft: #3a1917;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a; --surface: #141414; --surface-2: #1d1d1f; --ink: #f5f5f5; --muted: #a6a6ad; --line: #2b2b2e;
  --accent: #ff4d4d; --accent-ink: #0a0a0a; --accent-soft: #3a1010; --court: #d8953f;
  --good: #58c595; --good-soft: #13301f; --warn: #eab45a; --warn-soft: #33260f; --bad: #f08a82; --bad-soft: #3a1917;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35); color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.display { font-family: var(--display); text-transform: uppercase; letter-spacing: .01em; line-height: 1; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); } .small { font-size: 13px; }
.eyebrow { font: 600 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }

.topbar { background: var(--brand-black); color: #ffffff; border-bottom: 4px solid var(--brand-red); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brandmark { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brandmark img { width: 42px; height: 42px; flex: none; background: #ffffff; border-radius: 9px; padding: 3px; }
.brandmark .bm { display: flex; flex-direction: column; line-height: 1.05; }
.brandmark b { font-family: var(--display); font-size: 24px; letter-spacing: .04em; text-transform: uppercase; font-weight: 400; color: #ffffff; }
.brandmark .bm span { font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #ff5c5c; }
.topbar .who { font-size: 13px; color: #d4d4d8; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.topbar .btn.ghost { color: #ffffff; border-color: #3f3f46; }
.topbar .btn.ghost:hover { border-color: var(--brand-red); }
.login-logo { width: 88px; height: 88px; align-self: center; }
.print-brand { display: none; }

nav.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 10px 0; border-bottom: 1px solid var(--line); margin-bottom: 18px; position: sticky; top: 0; background: var(--bg); z-index: 5; scrollbar-width: none; }
nav.tabs button { font: 400 17px var(--display); letter-spacing: .04em; text-transform: uppercase; background: none; border: 0; color: var(--muted); padding: 7px 13px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
nav.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); box-shadow: inset 0 -3px 0 var(--accent); }

.btn { font: 600 14px var(--font); border-radius: 8px; padding: 9px 15px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; max-width: 100%; }
textarea { min-height: 90px; resize: vertical; }
textarea.code { font: 13px/1.55 var(--mono); min-height: 180px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.f .req { color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--surface); cursor: pointer; }
.checks input { width: auto; accent-color: var(--accent); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card h2, .card h3 { margin: 0; }
.card h3 { font: 400 22px var(--display); text-transform: uppercase; letter-spacing: .02em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
fieldset { min-width: 0; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 0 0 14px; background: var(--surface); }
legend { font: 400 19px var(--display); text-transform: uppercase; letter-spacing: .03em; padding: 0 6px; }
.note { font-size: 13px; color: var(--muted); margin: 0 0 10px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.stat b { display: block; font: 400 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.statgrid input { min-width: 64px; padding: 7px 8px; }
.statgrid th, .statgrid td { padding: 6px; }

.pill { font: 500 11px var(--mono); padding: 3px 9px; border-radius: 999px; white-space: nowrap; display: inline-block; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.strong, .pill.interested, .pill.offer, .pill.done-good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.pill.possible, .pill.replied { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.reach, .pill.paused, .pill.declined { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.meter { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter.full i { background: var(--good); }

.notice { border: 1px solid var(--line); border-left: 4px solid var(--warn); background: var(--surface); padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.notice.good { border-left-color: var(--good); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; background: var(--ink); color: var(--bg); padding: 9px 15px; border-radius: 8px; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
dialog { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); padding: 0; width: min(760px, calc(100% - 24px)); max-height: calc(100% - 40px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
dialog .dhead { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
dialog .dbody { padding: 18px; }
.login { max-width: 400px; margin: 60px auto; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Athlete Monitor additions */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale.eleven { grid-template-columns: repeat(11, 1fr); }
.scale button { font: 600 16px var(--font); padding: 12px 0; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 44px; }
.scale button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.scale.eleven button { font-size: 14px; padding: 10px 0; }
.anchors { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.q { padding: 14px 0; border-bottom: 1px solid var(--line); }
.q:last-of-type { border-bottom: 0; }
.q > b { display: block; margin-bottom: 8px; }
.privacy { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.toggle { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 8px 0; }
.toggle input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); margin-top: 1px; }
.att { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.att button { border: 0; background: var(--surface); color: var(--ink); padding: 7px 10px; font: 500 13px var(--font); cursor: pointer; border-right: 1px solid var(--line); }
.att button:last-child { border-right: 0; }
.att button[aria-pressed="true"].present { background: var(--good-soft); color: var(--good); }
.att button[aria-pressed="true"].absent { background: var(--bad-soft); color: var(--bad); }
.att button[aria-pressed="true"].modified { background: var(--warn-soft); color: var(--warn); }
.attempts { display: flex; flex-wrap: wrap; gap: 6px; }
.attempt { display: flex; flex-direction: column; gap: 2px; width: 84px; }
.attempt input { padding: 7px 8px; font-family: var(--mono); }
.attempt label { font-size: 11px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.attempt label input { width: auto; }
.attempt.bad input[type="text"] { border-color: var(--bad); background: var(--bad-soft); }
.attempt.warn input[type="text"] { border-color: var(--warn); }
td.rowstatus { font-size: 12px; min-width: 140px; }
tr[data-a] select[name="status"] { min-width: 112px; }
.ok-text { color: var(--good); } .bad-text { color: var(--bad); } .warn-text { color: var(--warn); }
.pill.valid, .pill.completed, .pill.present, .pill.granted, .pill.closed { background: var(--good-soft); color: var(--good); border-color: transparent; }
.pill.corrected, .pill.modified, .pill.draft, .pill.in_progress, .pill.did_not_finish { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.invalid, .pill.withdrawn, .pill.absent, .pill.revoked, .pill.open, .pill.disabled { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chart { position: relative; max-width: 680px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font: 11px var(--mono); }
.chart .series { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .dot.pb { fill: var(--good); }
.chart .dot.flag { fill: var(--surface); stroke: var(--accent); }
.chart .bar { fill: var(--accent); }
.chart .proto { stroke: var(--muted); stroke-dasharray: 3 3; stroke-width: 1; }
.chart .proto-label { fill: var(--muted); font: 10px var(--mono); }
.chart .cross { stroke: var(--muted); stroke-width: 1; }
.chart .hit { fill: transparent; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12px; padding: 6px 9px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); z-index: 3; }
.tip b { font-family: var(--mono); }
.metric-card .big { font: 400 34px/1 var(--display); font-variant-numeric: tabular-nums; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.subnav button { font: 500 13px var(--font); border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.subnav button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg-row { display: grid; grid-template-columns: 1fr 120px auto; gap: 8px; margin-bottom: 8px; }
.ex-row { display: grid; grid-template-columns: 2fr 70px 90px 90px 80px 90px auto; gap: 6px; margin-bottom: 8px; align-items: start; }
@media (max-width: 760px) { .ex-row { grid-template-columns: 1fr 1fr 1fr; } }
.setgrid td input, .setgrid td select { padding: 6px 7px; min-width: 70px; }
.matrix select { min-width: 120px; padding: 5px 7px; font-size: 13px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
h2.section { font: 400 24px var(--display); text-transform: uppercase; letter-spacing: .02em; margin: 26px 0 10px; }
.toplinks a { color: #ffffff; font-size: 13px; }
@media print {
  .topbar, nav.tabs, .subnav, .btn, .noprint { display: none !important; }
  .print-brand { display: flex !important; align-items: center; gap: 10px; border-bottom: 3px solid #c00000; padding-bottom: 8px; margin-bottom: 12px; font: 400 20px var(--display); text-transform: uppercase; letter-spacing: .04em; }
  .print-brand img { width: 36px; height: 36px; }
  body { background: #fff; color: #000; }
  .card, .tablewrap { box-shadow: none; border-color: #ccc; }
}
