/* ============================================================
   Atlantic East Scout — styles
   Dark mode default, light via [data-theme="light"]
   ============================================================ */

:root {
  /* dark palette */
  --bg: #0e1014;
  --bg-1: #14171d;
  --bg-2: #1a1e26;
  --surface: #1d222b;
  --surface-2: #232936;
  --border: #2a3140;
  --border-soft: #1f2530;
  --ink: #f1f3f7;
  --ink-2: #c4c9d3;
  --ink-3: #8a90a0;
  --ink-4: #5b6172;
  --accent: #d7a900;       /* gold (default brand-ish) */
  --accent-ink: #1a1a1a;
  --danger: #e5564b;
  --success: #4caf6c;
  --info: #5fa8d3;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -16px rgba(0,0,0,.7);
  --shadow-lift: 0 18px 40px -22px rgba(0,0,0,.9), 0 0 0 1px var(--border) inset;

  /* current team accents — overridden via JS when a team is chosen */
  --team-1: var(--accent);
  --team-2: #1c2b5a;
  --team-ink: #f1f3f7;
}

[data-theme="light"] {
  --bg: #f6f5f1;
  --bg-1: #ffffff;
  --bg-2: #efedf2;
  --surface: #ffffff;
  --surface-2: #f8f7f3;
  --border: #e3e1da;
  --border-soft: #ecebe5;
  --ink: #15171c;
  --ink-2: #353841;
  --ink-3: #6b7080;
  --ink-4: #99a0b0;
  --shadow: 0 1px 0 rgba(0,0,0,.02) inset, 0 8px 24px -16px rgba(0,0,0,.18);
  --shadow-lift: 0 18px 38px -24px rgba(0,0,0,.18), 0 0 0 1px var(--border) inset;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  line-height: 1.4;
}

/* ----- typography ----- */
.title-xl, .title-l, .title-m, .title-s, .label, .nums, .display {
  font-family: 'Oswald', 'Inter', sans-serif;
  letter-spacing: .02em;
}
.display { font-family: 'Bebas Neue', 'Oswald', sans-serif; letter-spacing: .04em; }
.title-xl { font-size: 38px; font-weight: 600; line-height: 1.05; }
.title-l  { font-size: 26px; font-weight: 600; line-height: 1.1; }
.title-m  { font-size: 20px; font-weight: 600; line-height: 1.15; }
.title-s  { font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-3); }
.label    { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .18em; color: var(--ink-3); }
.nums     { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; }
.mono     { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; }
.muted    { color: var(--ink-3); }
.dim      { color: var(--ink-4); }

a { color: var(--info); }

/* ============== APP SHELL ============== */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  padding: 22px 14px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; align-self: flex-start;
  height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.brand .mark {
  width: 34px; height: 34px;
  display:flex; align-items:center; justify-content:center;
  background: var(--accent); color: var(--accent-ink);
  font-family: 'Bebas Neue'; font-size: 22px; letter-spacing: .06em;
  border-radius: 8px;
}
.brand .wm { display:flex; flex-direction:column; line-height: 1; }
.brand .wm b { font-family: 'Bebas Neue'; font-size: 20px; letter-spacing: .08em; }
.brand .wm small { font-size: 10px; letter-spacing: .2em; color: var(--ink-3); text-transform: uppercase; }

.navlist { display:flex; flex-direction: column; gap: 2px; }
.navlist a {
  text-decoration: none; color: var(--ink-2);
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
}
.navlist a:hover { background: var(--bg-2); color: var(--ink); }
.navlist a.on { background: var(--surface); color: var(--ink); border-color: var(--border); }
.navlist a .ico {
  width: 18px; height: 18px; display: inline-flex; align-items:center; justify-content:center;
  color: var(--ink-3);
}
.navlist a.on .ico { color: var(--accent); }

.sidebar .footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display:flex; gap:6px; align-items:center; }
.theme-toggle {
  flex: 1;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; cursor:pointer; font: inherit; font-size: 13px;
  display: flex; align-items:center; gap: 8px;
}
.theme-toggle:hover { background: var(--surface-2); }

.main { padding: 28px 36px 80px; min-width: 0; }

/* ============== TOP BAR (per-screen) ============== */
.crumb {
  display: flex; align-items: center; gap: 8px;
  color: var(--ink-3); font-size: 13px; margin-bottom: 6px;
}
.crumb .sep { opacity: .5; }
.crumb a, .crumb button.link { color: var(--ink-3); text-decoration: none; background:none; border:none; padding:0; cursor:pointer; font: inherit; }
.crumb a:hover, .crumb button.link:hover { color: var(--ink); }

.screen-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.screen-head .lhs h1 { margin: 4px 0 0; }

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 14px; cursor: pointer; font: inherit; font-size: 14px;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.danger { color: var(--danger); border-color: var(--border); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.iconbtn {
  width: 32px; height: 32px; display:inline-flex; align-items:center; justify-content:center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  color: var(--ink-2); cursor: pointer;
}
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 3px 9px; font-size: 12px; color: var(--ink-2);
  cursor: pointer; user-select: none;
}
.pill:hover { border-color: var(--ink-3); }
.pill.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill.accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.input, .textarea {
  width: 100%;
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font: inherit; font-size: 14px;
  outline: none;
}
.input:focus, .textarea:focus { border-color: var(--accent); }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.textarea { resize: vertical; min-height: 80px; font-family: inherit; }
select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

/* ============== TEAM PICKER HUB ============== */
.hub-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 22px;
}
.hub-tab {
  background: transparent; border: none; padding: 12px 16px; cursor: pointer;
  color: var(--ink-3); font: inherit; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.hub-tab.on { color: var(--ink); border-bottom-color: var(--accent); }

.team-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

/* ----- filter bar (Hub) ----- */
.filter-bar {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 18px;
}
.filter-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.filter-row .label { min-width: 90px; }
.filter-row select.input { padding: 6px 10px; font-size: 13px; min-width: 200px; }

/* ----- recent strip ----- */
.recent-strip { margin-bottom: 18px; }
.recent-strip .label { display: block; margin-bottom: 8px; }
.recent-row {
  display: flex; gap: 10px; overflow-x: auto;
  padding-bottom: 4px;
}
.recent-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px 8px 8px; cursor: pointer; font: inherit; color: var(--ink);
  flex-shrink: 0;
}
.recent-chip:hover { background: var(--surface-2); border-color: var(--ink-4); }
.recent-chip .chip-crest {
  width: 36px; height: 36px; border-radius: 6px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: var(--c-ink, #fff);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue'; font-size: 16px;
}
.recent-chip .chip-meta { display: flex; flex-direction: column; line-height: 1.1; }
.recent-chip .chip-meta b { font-family: 'Oswald'; font-weight: 600; font-size: 14px; }
.recent-chip .chip-meta small { font-size: 11px; color: var(--ink-3); }

/* ----- conference section ----- */
.conf-section { margin-bottom: 22px; }
.conf-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}
.conf-head .conf-name { font-family: 'Oswald'; font-weight: 600; font-size: 17px; }
.conf-head .conf-sub { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.conf-head .conf-count {
  margin-left: auto; font-family: 'JetBrains Mono'; font-size: 11px;
  background: var(--bg-2); border: 1px solid var(--border-soft);
  padding: 2px 8px; border-radius: 999px; color: var(--ink-3);
}

/* ----- add-team hint footer ----- */
.add-team-hint {
  margin-top: 28px; padding: 14px 16px;
  background: var(--bg-1); border: 1px dashed var(--border); border-radius: 10px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px;
}
.add-team-hint .label { color: var(--ink-3); margin-bottom: 2px; }
.add-team-hint .mono { color: var(--ink); background: var(--bg-2); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .12s, border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column;
  position: relative;
}
.team-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--ink-4); }
.team-card .crest {
  height: 110px; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, var(--c1, #333) 0%, var(--c2, #555) 100%);
  color: var(--c-ink, #fff);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 56px; letter-spacing: .04em;
  position: relative;
}
.team-card .crest::after{
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.18), transparent 60%);
  pointer-events: none;
}
.team-card .meta {
  padding: 12px 14px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.team-card .name { font-family: 'Oswald'; font-weight: 600; font-size: 17px; line-height: 1.15; }
.team-card .sub { color: var(--ink-3); font-size: 12px; }
.team-card .links {
  display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap;
}
.team-card .link-pill {
  font-size: 11px; padding: 2px 7px; border-radius: 999px;
  background: var(--bg-2); color: var(--ink-3); border: 1px solid var(--border);
  display: inline-flex; align-items:center; gap:4px;
}
.team-card .link-pill.has { background: rgba(95,168,211,.12); border-color: rgba(95,168,211,.3); color: var(--info); }

/* ============== TEAM DETAIL (URL EDITOR) ============== */
.team-banner {
  background: linear-gradient(135deg, var(--team-1) 0%, var(--team-2) 100%);
  color: var(--team-ink, #fff);
  border-radius: 14px;
  padding: 22px 26px; display: flex; align-items: center; gap: 20px;
  margin-bottom: 18px;
  position: relative; overflow: hidden;
}
.team-banner::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 90% 10%, rgba(255,255,255,.15), transparent 50%);
  pointer-events: none;
}
.team-banner .crest-lg {
  width: 84px; height: 84px; flex-shrink: 0;
  border-radius: 16px;
  background: rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue'; font-size: 38px; letter-spacing: .04em;
}
.team-banner h1 { margin: 0; font-family: 'Oswald'; font-weight: 600; font-size: 30px; line-height: 1.0; }
.team-banner .b-sub { opacity: .8; font-size: 13px; margin-top: 4px; }
.team-banner .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; z-index:1; }

.url-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 18px;
}
.url-card .row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; }
.url-card .row + .row { margin-top: 8px; }
.url-card .row label { font-size: 13px; color: var(--ink-3); }
.url-card .hint { font-size: 12px; color: var(--ink-3); margin-top: 8px; }

/* ============== ROSTER ============== */
.roster-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 12px; flex-wrap: wrap;
}
.roster-toolbar .group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.roster-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.roster-table th, .roster-table td {
  padding: 10px 12px; text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--border-soft);
}
.roster-table tbody tr:last-child td { border-bottom: none; }
.roster-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); font-weight: 600; background: var(--bg-2); }
.roster-table tr.row { cursor: pointer; }
.roster-table tr.row:hover { background: var(--bg-2); }
.roster-table tr.row.picked { background: rgba(215,169,0,.06); }
.roster-table tr.row.picked:hover { background: rgba(215,169,0,.10); }
.roster-table td.num, .roster-table th.num { font-family: 'JetBrains Mono'; text-align: right; font-variant-numeric: tabular-nums; }
.roster-table .photo {
  width: 36px; height: 48px; border-radius: 5px;
  background: linear-gradient(135deg, var(--bg-2), var(--surface-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--ink-4); font-family: 'JetBrains Mono';
}
.roster-table .pl-name { font-weight: 600; font-size: 14px; }
.roster-table .pl-pos { font-size: 12px; color: var(--ink-3); }
.roster-table .star {
  cursor: pointer; color: var(--ink-4); font-size: 18px; line-height: 1; user-select: none;
}
.roster-table .star.on { color: var(--accent); }
.roster-table .check {
  width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--ink-4);
  display: inline-flex; align-items: center; justify-content: center; background: var(--bg);
}
.roster-table .check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.roster-table .check.on::after { content: "✓"; font-size: 13px; font-weight: 700; }

.roster-empty {
  background: var(--surface); border: 1px dashed var(--border); border-radius: 10px;
  padding: 32px 22px; text-align: center; color: var(--ink-3);
}
.roster-empty .title-m { color: var(--ink); margin-bottom: 6px; }

.bottom-action-bar {
  position: sticky; bottom: 16px; margin-top: 18px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 16px;
  box-shadow: var(--shadow-lift);
}

/* ============== REPORT ============== */
.report-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.report-toolbar .group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg {
  display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; overflow: hidden;
}
.seg button {
  background: transparent; border: none; padding: 6px 14px; color: var(--ink-2); cursor: pointer; font: inherit; font-size: 13px;
}
.seg button.on { background: var(--ink); color: var(--bg); }

/* report header card */
.report-hero {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 22px; margin-bottom: 16px;
  display: flex; gap: 18px; align-items: center;
  position: relative; overflow: hidden;
}
.report-hero::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--team-1);
}
.report-hero .crest-md {
  width: 60px; height: 60px; border-radius: 12px;
  background: linear-gradient(135deg, var(--team-1), var(--team-2));
  color: var(--team-ink, #fff);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue'; font-size: 28px; letter-spacing: .04em;
  flex-shrink: 0;
}
.report-hero .ttl { font-family: 'Oswald'; font-weight: 600; font-size: 24px; line-height: 1.0; margin: 0; }
.report-hero .sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.report-hero .vsfield {
  display: flex; gap: 8px; align-items: center; margin-top: 8px; max-width: 360px;
}
.report-hero .vsfield .input { padding: 5px 9px; font-size: 13px; }

/* report layout — vertical (R1) */
.r-layout {
  display: grid; grid-template-columns: 1fr 320px; gap: 18px;
  align-items: flex-start;
}

.player-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px;
  display: grid; grid-template-columns: 120px 1fr; gap: 18px;
  margin-bottom: 14px;
  break-inside: avoid;
}
.player-card .photo {
  width: 120px; aspect-ratio: 3/4; border-radius: 10px;
  background:
    linear-gradient(135deg, var(--surface-2), var(--bg-2)),
    repeating-linear-gradient(135deg, transparent 0 8px, rgba(255,255,255,.04) 8px 16px);
  background-blend-mode: overlay;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
  color: var(--ink-4); font-size: 11px; font-family: 'JetBrains Mono';
  border: 1px solid var(--border);
}
.player-card .photo .mini-mark {
  width: 30px; height: 30px; border-radius: 6px;
  background: var(--team-1); color: var(--team-ink, #fff);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue'; font-size: 14px;
}
.player-card .head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.player-card .num { font-family: 'Bebas Neue'; font-size: 30px; color: var(--ink-3); letter-spacing: .04em; }
.player-card .name { font-family: 'Oswald'; font-weight: 600; font-size: 22px; }
.player-card .meta { color: var(--ink-3); font-size: 13px; }
.player-card .star-btn {
  margin-left: auto; background: none; border: none; cursor: pointer; color: var(--ink-4); font-size: 20px;
}
.player-card .star-btn.on { color: var(--accent); }

.stats-row {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  margin-top: 10px;
}
.stat {
  background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: 8px;
  padding: 6px 10px;
  display: flex; flex-direction: column;
}
.stat .v { font-family: 'Bebas Neue'; font-size: 22px; line-height: 1.0; }
.stat .k { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; }

.tags-row {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px;
}
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 8px 2px 10px; font-size: 12px; color: var(--ink-2);
}
.tag .x { color: var(--ink-4); cursor: pointer; }
.tag .x:hover { color: var(--danger); }
.tag.add { background: transparent; border-style: dashed; color: var(--ink-3); cursor: pointer; }
.tag.add:hover { color: var(--ink); border-color: var(--ink-3); }

.tag-suggest {
  position: absolute; z-index: 10;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px; box-shadow: var(--shadow-lift);
  display: flex; flex-direction: column; gap: 2px; max-width: 240px;
  margin-top: 4px;
}
.tag-suggest .input { margin-bottom: 6px; }
.tag-suggest .opt {
  padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--ink-2);
}
.tag-suggest .opt:hover, .tag-suggest .opt.hi { background: var(--bg-2); color: var(--ink); }

.note-area { margin-top: 10px; }
.note-area .textarea { min-height: 80px; }

/* last-5 trend mini chart */
.trend-row {
  display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap;
}
.trend {
  background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: 8px;
  padding: 6px 8px; min-width: 88px;
}
.trend .lbl { font-size: 9px; color: var(--ink-3); letter-spacing: .12em; text-transform: uppercase; }
.trend .chart { display: flex; gap: 2px; height: 28px; align-items: flex-end; margin-top: 4px; }
.trend .bar {
  flex: 1; background: var(--team-1); opacity: .55; border-radius: 2px 2px 0 0;
  min-height: 2px;
}
.trend .bar.last { opacity: 1; }
.trend .summary { font-size: 11px; color: var(--ink-3); margin-top: 2px; font-family: 'JetBrains Mono'; }

/* team-notes sticky sidebar */
.team-notes {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px;
  position: sticky; top: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.team-notes h3 { margin: 0; font-family: 'Oswald'; font-size: 18px; font-weight: 600; }
.team-notes .section { display: flex; flex-direction: column; gap: 4px; padding-bottom: 10px; border-bottom: 1px dashed var(--border-soft); }
.team-notes .section:last-of-type { border-bottom: none; }
.team-notes .section .label { color: var(--ink-3); }
.team-notes .actions { display:flex; gap: 6px; flex-wrap: wrap; }

/* ============== PRINT SHEET (R4) ============== */
.print-shell {
  background: var(--bg-2); padding: 22px; border-radius: 14px;
  border: 1px solid var(--border);
}
.print-sheet {
  width: 8.5in; max-width: 100%;
  margin: 0 auto; background: #ffffff; color: #15171c;
  padding: 0.5in 0.55in;
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.05);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 11in;
  position: relative;
}
.print-sheet .ps-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding-bottom: 10px; border-bottom: 3px solid var(--team-1);
  margin-bottom: 14px; gap: 16px;
}
.print-sheet .ps-head .crest-sm {
  width: 56px; height: 56px; border-radius: 10px;
  background: linear-gradient(135deg, var(--team-1), var(--team-2));
  color: var(--team-ink, #fff);
  display: flex; align-items:center; justify-content:center;
  font-family: 'Bebas Neue'; font-size: 24px;
}
.print-sheet .ps-head .ttl {
  font-family: 'Oswald'; font-weight: 600; font-size: 26px; line-height: 1.0;
}
.print-sheet .ps-head .sub { font-size: 11px; color: #5b6172; margin-top: 4px; }
.print-sheet .ps-head .right { text-align: right; font-size: 11px; color: #5b6172; }

.print-sheet .ps-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.print-sheet .ps-cell {
  border: 1px solid #d8d4c8; border-radius: 6px;
  padding: 6px 8px; display: grid; grid-template-columns: 38px 1fr; gap: 8px;
}
.print-sheet .ps-cell .ph {
  width: 38px; height: 50px; border-radius: 4px;
  background: linear-gradient(135deg, #ececec, #f7f7f4);
  display:flex; align-items:center; justify-content:center; color:#aaa; font-size: 9px; font-family: 'JetBrains Mono';
}
.print-sheet .ps-cell .nm { font-family: 'Oswald'; font-weight: 600; font-size: 13px; line-height: 1.1; }
.print-sheet .ps-cell .pos { font-size: 10px; color: #6b7080; font-family: 'JetBrains Mono'; letter-spacing: .04em; }
.print-sheet .ps-cell .stats { font-size: 10px; font-family: 'JetBrains Mono'; color: #353841; margin-top: 2px; }
.print-sheet .ps-cell .notes-area { margin-top: 4px; font-size: 11px; color: #15171c; min-height: 32px; white-space: pre-wrap; }
.print-sheet .ps-cell .notes-area:empty::after {
  content: ""; display: block;
  background: repeating-linear-gradient(to bottom, transparent 0 12px, #d8d4c8 12px 13px);
  height: 36px;
}
.print-sheet .ps-team-notes {
  margin-top: 10px; border: 1px solid #d8d4c8; border-radius: 6px; padding: 6px 8px;
}
.print-sheet .ps-team-notes .nm { font-family: 'Oswald'; font-weight: 600; font-size: 13px; }
.print-sheet .ps-team-notes .body { font-size: 11px; color: #15171c; margin-top: 4px; white-space: pre-wrap; min-height: 80px; }
.print-sheet .ps-team-notes .body:empty::after {
  content: ""; display: block;
  background: repeating-linear-gradient(to bottom, transparent 0 12px, #d8d4c8 12px 13px);
  height: 80px;
}
.print-sheet .ps-footer {
  position: absolute; left: .55in; right: .55in; bottom: .35in;
  font-size: 9px; color: #8a90a0;
  display: flex; justify-content: space-between;
  border-top: 1px dashed #d8d4c8; padding-top: 6px;
}

/* ============== SAVED REPORTS ============== */
.saved-list { display: flex; flex-direction: column; gap: 8px; }
.saved-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center;
  cursor: pointer;
}
.saved-item:hover { background: var(--surface-2); }
.saved-item .crest-xs {
  width: 44px; height: 44px; border-radius: 8px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: var(--c-ink, #fff);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue'; font-size: 18px;
}
.saved-item .ttl { font-family: 'Oswald'; font-weight: 600; font-size: 16px; }
.saved-item .sub { color: var(--ink-3); font-size: 12px; }

/* ============== MODAL ============== */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; max-width: 460px; width: 100%;
  box-shadow: var(--shadow-lift);
}
.modal h3 { margin: 0 0 12px; font-family: 'Oswald'; font-weight: 600; font-size: 20px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ============== TOAST ============== */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 500;
  z-index: 200; box-shadow: 0 16px 40px -20px rgba(0,0,0,.8);
  animation: toast-in .25s ease-out;
}
@keyframes toast-in { from { transform: translate(-50%, 8px); opacity: 0; } }

/* ============== RESPONSIVE ============== */
@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: relative; height: auto; flex-direction: row; align-items: center;
    padding: 12px 16px; gap: 14px;
  }
  .sidebar .brand { border: none; padding: 0; margin: 0; border-right: 1px solid var(--border); padding-right: 14px; }
  .sidebar .navlist { flex-direction: row; }
  .sidebar .footer { margin-top: 0; padding: 0; border: none; margin-left: auto; }
  .main { padding: 20px; }
  .r-layout { grid-template-columns: 1fr; }
  .team-notes { position: static; }
  .player-card { grid-template-columns: 80px 1fr; }
  .player-card .photo { width: 80px; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
}

/* ============== PRINT (browser print fallback — the html2pdf path also works) ============== */
@media print {
  .sidebar, .screen-head .rhs, .report-toolbar, .bottom-action-bar, .team-banner .actions { display: none !important; }
  .main { padding: 0; }
  body { background: white; color: black; }
  .print-shell { background: white; padding: 0; border: none; }
  .print-sheet { box-shadow: none; }
}

/* ============== AUTO-FILL BANNER + BADGE ============== */
.autofill-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 12px;
}
.autofill-badge {
  display: inline-flex;
  align-items: center;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ============== LOADING SPINNER ============== */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
