:root {
  --ink: #203038;
  --muted: #64747a;
  --paper: #f3f5f1;
  --surface: #fffefa;
  --line: #dce3dd;
  --forest: #234b45;
  --forest-deep: #193a36;
  --lime: #d7e88a;
  --sand: #ecefe7;
  --warning: #a35b2d;
  --font-ui: "DM Sans", system-ui, sans-serif;
  --font-label: "IBM Plex Mono", monospace;
}

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: .94rem;
}

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 248px;
  flex: 0 0 248px;
  background: var(--forest-deep);
  color: #eef2e9;
  display: flex;
  flex-direction: column;
}
.brand {
  padding: 1.45rem 1.5rem 1.3rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
  color: #fffefa;
  text-decoration: none;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -.045em;
}
.brand-mark {
  display: inline-flex;
  width: 27px;
  height: 27px;
  align-items: center;
  justify-content: center;
  margin-right: .55rem;
  color: var(--forest-deep);
  background: var(--lime);
  border-radius: 7px;
  font-family: var(--font-label);
  font-size: .76rem;
}
.sidebar-kicker {
  margin: 1.45rem 1.2rem .45rem;
  color: #aebfb6;
  font: 600 .65rem var(--font-label);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.sidebar .nav-link {
  margin: .12rem .7rem;
  padding: .63rem .75rem;
  border-radius: .45rem;
  color: #d2ddd6;
  font-size: .88rem;
  font-weight: 500;
}
.sidebar .nav-link:hover, .sidebar .nav-link.active {
  color: #fffefa;
  background: rgba(255,255,255,.11);
}
.sidebar .nav-link.active { box-shadow: inset 3px 0 var(--lime); }
.nav-index {
  display: inline-block;
  width: 1.6rem;
  color: #9db2a7;
  font: .67rem var(--font-label);
}
.sidebar-bottom { margin-top: auto; padding: 1rem .85rem; border-top: 1px solid rgba(255,255,255,.12); }
.league-switcher {
  display: block;
  width: 100%;
  border: 1px solid rgba(255,255,255,.18);
  padding: .7rem .8rem;
  margin-bottom: .55rem;
  text-align: left;
  color: #eef2e9;
  background: rgba(255,255,255,.06);
  border-radius: .5rem;
}
.league-switcher small { display: block; color: #aebfb6; font: .62rem var(--font-label); text-transform: uppercase; letter-spacing: .08em; }
.main-column { flex: 1; min-width: 0; }
.topbar {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255,254,250,.82);
}
.topbar-user { color: var(--muted); font-size: .83rem; }
.content { max-width: 1440px; padding: 2rem 2.2rem 3rem; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.65rem; }
.eyebrow { color: var(--forest); font: 600 .68rem var(--font-label); text-transform: uppercase; letter-spacing: .11em; margin-bottom: .4rem; }
h1, h2, h3, h4 { letter-spacing: -.035em; }
h1 { font-size: clamp(1.65rem, 3vw, 2.15rem); font-weight: 700; margin: 0; }
.lead-copy { max-width: 720px; margin: .5rem 0 0; color: var(--muted); }
.surface, .panel, .stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .65rem;
}
.panel { padding: 1.2rem 1.3rem; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-heading h2, .panel-heading h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.stat-card { height: 100%; padding: 1rem 1.05rem; }
.stat-label { color: var(--muted); font-size: .75rem; font-weight: 600; }
.stat-value { display: block; margin-top: .3rem; font-size: 1.8rem; font-weight: 700; letter-spacing: -.06em; }
.stat-note { color: var(--muted); font-size: .75rem; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table thead th { color: var(--muted); font: 600 .66rem var(--font-label); letter-spacing: .055em; text-transform: uppercase; white-space: nowrap; border-bottom-color: var(--line); }
.table td, .table th { padding: .8rem .7rem; vertical-align: middle; border-color: #e8ece7; }
.table tbody tr:last-child td { border-bottom: 0; }
.btn { --bs-btn-border-radius: .42rem; font-weight: 600; font-size: .84rem; }
.btn-primary { --bs-btn-bg: var(--forest); --bs-btn-border-color: var(--forest); --bs-btn-hover-bg: var(--forest-deep); --bs-btn-hover-border-color: var(--forest-deep); --bs-btn-active-bg: var(--forest-deep); }
.btn-outline-secondary { --bs-btn-color: var(--ink); --bs-btn-border-color: #cbd4cd; --bs-btn-hover-bg: var(--sand); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: #b9c5bc; }
.btn-accent { background: var(--lime); border-color: var(--lime); color: #263a32; }
.btn-accent:hover { background: #c9df71; border-color: #c9df71; color: #263a32; }
.form-control, .form-select { border-color: #ccd6cf; border-radius: .42rem; font-size: .9rem; padding: .58rem .7rem; }
.form-control:focus, .form-select:focus { border-color: #78988c; box-shadow: 0 0 0 .2rem rgba(35,75,69,.12); }
.form-label { margin-bottom: .35rem; color: #34464a; font-size: .81rem; font-weight: 600; }
form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="file"]),
form select, form textarea {
  display: block;
  width: 100%;
  border: 1px solid #ccd6cf;
  border-radius: .42rem;
  padding: .58rem .7rem;
  color: var(--ink);
  background-color: #fffefa;
  font: inherit;
  font-size: .9rem;
}
form input:focus, form select:focus, form textarea:focus {
  outline: 0;
  border-color: #78988c;
  box-shadow: 0 0 0 .2rem rgba(35,75,69,.12);
}
form input[type="checkbox"], form input[type="radio"] { accent-color: var(--forest); }
.helptext, .form-text { color: var(--muted); font-size: .77rem; }
.form-check-input:checked { background-color: var(--forest); border-color: var(--forest); }
.badge-soft { display: inline-flex; align-items: center; background: #e7eee8; color: #315c4a; border-radius: 99px; padding: .27rem .55rem; font-size: .68rem; font-weight: 700; letter-spacing: .025em; }
.badge-soft.warn { background: #f5e8dd; color: #8a4f28; }
.badge-soft.neutral { background: #e9ece8; color: #536167; }
.mono { font-family: var(--font-label); font-size: .79rem; }
.empty-state { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.empty-state h2 { color: var(--ink); font-size: 1.1rem; font-weight: 700; }
.alert { border-radius: .5rem; }
.callout { border-left: 3px solid #8ca56a; background: #f0f4e8; border-radius: .35rem; padding: .8rem 1rem; color: #455442; font-size: .85rem; }
.field-errors { color: #a13e37; font-size: .78rem; margin-top: .25rem; }
.auth-wrap { max-width: 480px; margin: 2.5rem auto; }
.auth-card { padding: clamp(1.3rem, 4vw, 2.3rem); }
.mobile-brand { display: none; }
.pagination .page-link { color: var(--forest); border-color: var(--line); }
.pagination .active .page-link { color: white; background: var(--forest); border-color: var(--forest); }

@media (max-width: 767.98px) {
  .app-shell { display: block; }
  .sidebar { width: auto; }
  .brand { padding: .85rem 1rem; border-bottom: 0; }
  .sidebar-kicker, .sidebar-bottom { display: none; }
  .sidebar nav { display: flex; overflow-x: auto; padding: 0 .5rem .6rem; }
  .sidebar .nav-link { flex: 0 0 auto; margin: 0 .15rem; padding: .5rem .65rem; font-size: .78rem; }
  .nav-index { display: none; }
  .topbar { height: 48px; padding: 0 1rem; }
  .content { padding: 1.25rem 1rem 2rem; }
  .page-heading { display: block; }
  .page-heading > .btn, .page-heading > div:last-child { margin-top: 1rem; }
  .table-responsive { border-radius: .45rem; }
}
