/* =====================================================================
   OPP SAF — design system.

   Three rules taken from the UX research and applied throughout:

   1. Panel vs report. Dashboard tiles are for a glance; the list behind
      a number lives in Relatórios. Every tile links to its report.
   2. Colour signals state. Brand green lives in the chrome (sidebar,
      buttons); data uses a neutral/semantic ramp, so a red cell always
      means "attention" and never "this is our colour".
   3. Density is the user's choice, kept in the session — a coach on a
      phone and a manager on a 27" monitor do not want the same rows.

   Brand colours sit in :root. When the visual manual arrives, that
   block changes and nothing else.
   ===================================================================== */

:root {
  /* Neutrals */
  --ink:        #15181e;
  --ink-2:      #474d59;
  --ink-3:      #767d8a;
  --ink-4:      #a2a8b4;
  --line:       #e4e7ec;
  --line-2:     #f0f2f5;
  --bg:         #f6f7f9;
  --paper:      #ffffff;

  /* Brand — chrome only.
     Taken from the official logo PDF: the navy is C90 M76 Y47 K54 and
     the gold is C14 M32 Y64 K3 (#D3A554), read straight off the file
     rather than eyedropped from a screenshot. */
  --brand:      #152a4a;
  --brand-2:    #1e3a63;
  --brand-3:    #2a4d7f;
  --accent:     #d3a554;

  /* State — data only */
  --ok:         #10724a;
  --ok-bg:      #e7f4ed;
  --warn:       #8a5a00;
  --warn-bg:    #fdf4e3;
  --danger:     #b02a20;
  --danger-bg:  #fdeeec;
  --info:       #1f5aa8;
  --info-bg:    #ebf2fd;

  /* Rhythm */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;

  --shadow:    0 1px 2px rgba(16,24,40,.05);
  --shadow-md: 0 4px 12px rgba(16,24,40,.08);

  /* Density — overridden by body.density-compact */
  --row-y:   .6rem;
  --card-p:  1.35rem;
  --gap:     1.25rem;
}

body.density-compact {
  --row-y:  .35rem;
  --card-p: 1rem;
  --gap:    .9rem;
  font-size: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-2); text-underline-offset: 2px; }

h1, h2, h3 { line-height: 1.25; letter-spacing: -.011em; }

/* Numbers line up when they share a column. */
.num, .table td.num, .table th.num,
.stat-value, .bar-value, .money { font-variant-numeric: tabular-nums; }
.table td.num, .table th.num, .money { text-align: right; }

/* ===================================================================
   Icons
   =================================================================== */
.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -.17em; }
.stat-icon  { width: 1.25rem; height: 1.25rem; color: var(--ink-4); }
.state-icon { width: 2.25rem; height: 2.25rem; color: var(--ink-4); }
.placeholder { width: 38%; height: 38%; color: var(--ink-4); }

/* ===================================================================
   Brand
   =================================================================== */
.brand { display: flex; align-items: baseline; gap: .4rem; text-decoration: none; }
.brand-mark { font-weight: 800; font-size: 1.45rem; letter-spacing: -.025em; color: #fff; }
.brand-word {
  font-weight: 600; font-size: .72rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent);
}
.brand-lg { justify-content: center; }
.brand-lg .brand-mark { font-size: 2.2rem; color: var(--brand); }

/* ===================================================================
   Shell
   =================================================================== */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 218px; flex-shrink: 0; background: var(--brand);
  padding: 1.35rem 0; display: flex; flex-direction: column;
  gap: 1.5rem; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 0 1.2rem; }
.sidebar nav { display: flex; flex-direction: column; overflow-y: auto; }

.nav-section {
  padding: 1rem 1.2rem .35rem; font-size: .64rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.38);
}

.nav-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .52rem 1.2rem; color: rgba(255,255,255,.74);
  text-decoration: none; font-size: .875rem;
  border-left: 3px solid transparent;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-link.is-active {
  color: #fff; font-weight: 600;
  border-left-color: var(--accent); background: rgba(255,255,255,.09);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .85rem 1.6rem; background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { margin: 0; font-size: 1.08rem; font-weight: 650; }
.topbar-right { display: flex; align-items: center; gap: .6rem; }

.account { display: flex; align-items: center; gap: .55rem; font-size: .84rem; }
.account-name { font-weight: 600; }

.icon-button {
  display: grid; place-items: center; width: 1.95rem; height: 1.95rem;
  background: none; border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink-3); cursor: pointer;
}
.icon-button:hover { color: var(--ink); border-color: var(--ink-4); }
.icon-button.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.icon-button.danger:hover { color: var(--danger); border-color: var(--danger); }

main { padding: 1.5rem 1.6rem 3rem; flex: 1; }

/* ===================================================================
   Cards
   =================================================================== */
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); padding: var(--card-p);
  box-shadow: var(--shadow); margin-bottom: var(--gap);
}
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: var(--card-p) var(--card-p) 0; margin-bottom: .8rem; }
.card.flush .card-hint { padding-inline: var(--card-p); }
.card.flush .form-actions { padding: 0 var(--card-p) var(--card-p); }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: .85rem;
}
.card-head h2 {
  margin: 0; font-size: .92rem; font-weight: 650;
  display: flex; align-items: center; gap: .45rem;
}
.card-head .icon { color: var(--ink-3); }
.card-hint {
  margin: -.35rem 0 .9rem; font-size: .82rem;
  color: var(--ink-3); max-width: 74ch;
}

.grid-2 { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid-3 { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ===================================================================
   Stat tiles — a glance, then a link to the list behind the number
   =================================================================== */
.stat-row {
  display: grid; gap: var(--gap); margin-bottom: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
}
.stat {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); padding: .95rem 1.1rem;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .1rem;
  text-decoration: none; color: inherit; position: relative;
}
a.stat:hover { border-color: var(--ink-4); box-shadow: var(--shadow-md); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-value { font-size: 1.65rem; font-weight: 700; line-height: 1.15; }
.stat-label { font-size: .78rem; color: var(--ink-3); }
.stat-foot { font-size: .74rem; color: var(--ink-4); margin-top: .2rem; }

.stat.is-warn   { border-color: #e9d4a3; background: var(--warn-bg); }
.stat.is-warn   .stat-value { color: var(--warn); }
.stat.is-danger { border-color: #f3c9c4; background: var(--danger-bg); }
.stat.is-danger .stat-value { color: var(--danger); }

/* ===================================================================
   Tables
   =================================================================== */
.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th, .table td {
  padding: var(--row-y) .65rem; text-align: left;
  border-bottom: 1px solid var(--line-2); vertical-align: middle;
}
.table thead th {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-4); font-weight: 650; white-space: nowrap;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--paper); z-index: 1;
}
.card.flush .table th:first-child,
.card.flush .table td:first-child { padding-left: var(--card-p); }
.card.flush .table th:last-child,
.card.flush .table td:last-child { padding-right: var(--card-p); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--line-2); }
.table a { text-decoration: none; }
.table a:hover { text-decoration: underline; }

.table-input input[type="number"] { width: 4.2rem; padding: .25rem .35rem; }
.table-input input[type="text"] { padding: .25rem .35rem; }
.table-input select { padding: .25rem .35rem; font-size: .83rem; }
.table-input td { padding-block: .3rem; }

.truncate { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* Bars — neutral by default; colour only when it carries meaning. */
.bars { width: 100%; border-collapse: collapse; font-size: .85rem; }
.bars th {
  text-align: left; font-weight: 500; padding: .28rem .6rem .28rem 0;
  width: 1%; white-space: nowrap; color: var(--ink-2);
}
.bar-cell { width: 100%; padding: .28rem 0; }
.bar {
  display: block; height: .5rem; border-radius: 99px;
  background: var(--ink-4); min-width: 2px;
}
.bar.is-low  { background: var(--danger); }
.bar.is-high { background: var(--ok); }
.bar-value { white-space: nowrap; padding-left: .7rem; text-align: right; }

.bar-0{width:0}.bar-5{width:5%}.bar-10{width:10%}.bar-15{width:15%}
.bar-20{width:20%}.bar-25{width:25%}.bar-30{width:30%}.bar-35{width:35%}
.bar-40{width:40%}.bar-45{width:45%}.bar-50{width:50%}.bar-55{width:55%}
.bar-60{width:60%}.bar-65{width:65%}.bar-70{width:70%}.bar-75{width:75%}
.bar-80{width:80%}.bar-85{width:85%}.bar-90{width:90%}.bar-95{width:95%}
.bar-100{width:100%}

/* ===================================================================
   Badges, chips, tags
   =================================================================== */
.badge, .chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .13rem .5rem; border-radius: 99px;
  font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.chip { background: var(--line-2); color: var(--ink-2); font-weight: 500; }
.chip-count { color: var(--ink-4); font-variant-numeric: tabular-nums; }

.badge-ok, .badge-available, .badge-decisive, .badge-paid,
.badge-running, .badge-active { background: var(--ok-bg); color: var(--ok); }

.badge-warn, .badge-transition, .badge-neutral, .badge-open,
.badge-not_started, .badge-paused { background: var(--warn-bg); color: var(--warn); }

.badge-danger, .badge-medical, .badge-overdue { background: var(--danger-bg); color: var(--danger); }

.badge-muted, .badge-inactive, .badge-ineffective, .badge-cancelled,
.badge-finished, .badge-closed { background: var(--line-2); color: var(--ink-3); }

.tag-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .85rem; }
.tag {
  padding: .14rem .55rem; border-radius: var(--r-sm);
  font-size: .75rem; background: var(--line-2); color: var(--ink-2);
  border: 1px solid var(--line);
}
.tag-technical { background: var(--info-bg); color: var(--info); border-color: #d3e2f8; }
.tag-tactical  { background: #f3effc; color: #5a3fa5; border-color: #e0d7f6; }
.tag-physical  { background: var(--danger-bg); color: var(--danger); border-color: #f5d4d0; }
.tag-cognitive { background: var(--ok-bg); color: var(--ok); border-color: #cde7da; }
.tag-behaviour { background: var(--warn-bg); color: var(--warn); border-color: #eedfb9; }

/* ===================================================================
   Toolbars and filters
   =================================================================== */
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: var(--gap); }
.page-actions .spacer { flex: 1; }

.filter-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.chip-link { text-decoration: none; border: 1px solid var(--line); background: var(--paper); }
.chip-link:hover { border-color: var(--ink-4); }
.chip-link.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip-link.is-active .chip-count { color: rgba(255,255,255,.7); }

.filter-bar {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  margin-bottom: var(--gap);
}
.filter-bar select, .filter-bar input { width: auto; }
.field-inline {
  display: flex; align-items: center; gap: .4rem;
  padding: 0 .6rem; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink-4);
}
.field-inline input { border: 0; padding: .45rem 0; background: none; min-width: 13rem; }
.field-inline input:focus { outline: none; }

.result-count { font-size: .8rem; color: var(--ink-3); margin: 0 0 .7rem; }

/* ===================================================================
   Athlete grid
   =================================================================== */
.athlete-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}
.athlete-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; text-decoration: none;
  color: inherit; box-shadow: var(--shadow);
}
.athlete-card:hover { border-color: var(--ink-4); box-shadow: var(--shadow-md); }
.athlete-photo {
  position: relative; aspect-ratio: 3 / 4; background: var(--line-2);
  display: grid; place-items: center;
}
.athlete-photo img { width: 100%; height: 100%; object-fit: cover; }
.athlete-photo .badge { position: absolute; left: .45rem; bottom: .45rem; }
.athlete-body { padding: .6rem .7rem; display: flex; flex-direction: column; gap: .08rem; }
.athlete-body strong { font-size: .88rem; }
.athlete-body .muted { font-size: .74rem; }

/* ===================================================================
   Profile
   =================================================================== */
.profile { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.profile-photo {
  width: 142px; aspect-ratio: 3 / 4; border-radius: var(--r);
  background: var(--line-2); display: grid; place-items: center;
  overflow: hidden; flex-shrink: 0;
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { flex: 1; min-width: 240px; }
.profile-info h2 { margin: 0; font-size: 1.25rem; }

.facts {
  display: grid; gap: .55rem 1.4rem; margin: .9rem 0 0;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}
.facts div { display: flex; flex-direction: column; gap: .08rem; }
.facts dt {
  font-size: .69rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-4); font-weight: 650;
}
.facts dd { margin: 0; font-size: .88rem; }

/* ===================================================================
   Lists
   =================================================================== */
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li {
  display: flex; align-items: center; justify-content: space-between;
  gap: .7rem; padding: .45rem 0; border-bottom: 1px solid var(--line-2);
}
.plain-list li:last-child { border-bottom: 0; }
.plain-list a { text-decoration: none; display: flex; gap: .45rem; align-items: baseline; }
.plain-list a:hover strong { text-decoration: underline; }

.next-match-date { font-size: .8rem; color: var(--ink-3); margin: 0 0 .15rem; }
.next-match-rival { font-size: 1.15rem; font-weight: 700; margin: 0 0 .25rem; }
.next-match .button { margin-top: .85rem; }

/* ===================================================================
   Forms
   =================================================================== */
.form { max-width: 1000px; }
.field-grid {
  display: grid; gap: .85rem 1rem;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
}
.field { display: flex; flex-direction: column; gap: .22rem; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field.check { flex-direction: row; align-items: flex-start; gap: .5rem; }
.field.check label { display: flex; align-items: flex-start; gap: .5rem; margin: 0; font-weight: 400; }

label { font-size: .79rem; font-weight: 650; color: var(--ink-2); }
.hint { font-size: .75rem; color: var(--ink-4); margin: .08rem 0 0; }
.req { color: var(--danger); }

/* Matches every text-like field, including <input> written without a
   `type` — which defaults to text and used to fall through unstyled. */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
select, textarea {
  width: 100%; padding: .46rem .58rem; font: inherit; font-size: .9rem;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; color: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand-3); outline-offset: 1px; border-color: transparent;
}
input[readonly], input:disabled, select:disabled, textarea:disabled {
  background: var(--line-2); color: var(--ink-3); cursor: not-allowed;
}
textarea { resize: vertical; line-height: 1.5; }

.form-actions {
  display: flex; gap: .5rem; margin-top: 1rem; align-items: center; flex-wrap: wrap;
}

.button {
  display: inline-flex; align-items: center; gap: .38rem;
  padding: .46rem .85rem; font: inherit; font-size: .86rem; font-weight: 600;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.button:hover { border-color: var(--ink-4); }
.button-primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.button-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.button-danger { color: var(--danger); border-color: #f0cac5; }
.button-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.button-block { width: 100%; justify-content: center; margin-top: 1rem; }
.button-sm { padding: .3rem .6rem; font-size: .8rem; }

.link { color: var(--ink-3); font-size: .83rem; }

/* ===================================================================
   Skills, drills, scores
   =================================================================== */
.skill-group, .drill, .score-group {
  border: 1px solid var(--line); border-radius: var(--r);
  padding: .85rem 1rem; margin-bottom: .8rem;
}
.skill-group legend, .drill legend, .score-group legend {
  font-size: .74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-3); padding: 0 .35rem;
}
.skill-options { display: flex; flex-wrap: wrap; gap: .4rem; }
.skill-option {
  display: flex; align-items: center; gap: .35rem;
  padding: .26rem .58rem; border: 1px solid var(--line); border-radius: 99px;
  font-size: .82rem; font-weight: 400; cursor: pointer;
}
.skill-option:hover { border-color: var(--ink-4); }
.skill-option:has(input:checked) {
  background: var(--ok-bg); border-color: var(--ok); color: var(--ok); font-weight: 600;
}
.skill-option input { accent-color: var(--ok); }

.drill-view { padding: .7rem 0; border-bottom: 1px solid var(--line-2); }
.drill-view:last-child { border-bottom: 0; }
.drill-view h3 { margin: 0 0 .3rem; font-size: .9rem; display: flex; align-items: center; gap: .45rem; }
.drill-view p { margin: 0 0 .3rem; font-size: .86rem; }

.checkbox-grid { display: grid; gap: .45rem; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); }
.checkbox-card {
  display: flex; align-items: center; gap: .45rem;
  padding: .4rem .55rem; border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: .84rem; font-weight: 400; cursor: pointer;
}
.checkbox-card:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); }

.score-table th { font-weight: 500; font-size: .85rem; color: var(--ink-2); }
.score-options { display: flex; gap: .25rem; }
.score-option { cursor: pointer; }
.score-option input { position: absolute; opacity: 0; pointer-events: none; }
.score-option span {
  display: grid; place-items: center; width: 1.8rem; height: 1.8rem;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: .8rem; font-weight: 650; color: var(--ink-3);
}
.score-option:hover span { border-color: var(--ink-4); }
.score-option input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.score-option input:focus-visible + span { outline: 2px solid var(--brand-3); outline-offset: 1px; }

.score {
  display: inline-grid; place-items: center; min-width: 2rem;
  padding: .1rem .4rem; border-radius: var(--r-sm);
  font-weight: 700; font-size: .83rem; font-variant-numeric: tabular-nums;
}
.score-1, .score-2 { background: var(--danger-bg); color: var(--danger); }
.score-3 { background: var(--warn-bg); color: var(--warn); }
.score-4, .score-5 { background: var(--ok-bg); color: var(--ok); }

.score-dots { display: flex; align-items: center; gap: .22rem; }
.dot { width: .46rem; height: .46rem; border-radius: 99px; background: var(--line); }
.dot.is-on { background: var(--ink-2); }
.score-dots strong { margin-left: .35rem; font-size: .8rem; }

.delta { font-size: .78rem; font-weight: 600; }
.delta.up   { color: var(--ok); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--ink-4); }

/* ===================================================================
   Notices and states
   =================================================================== */
.notice {
  display: flex; align-items: flex-start; gap: .5rem;
  padding: .6rem .8rem; border-radius: var(--r-sm);
  font-size: .86rem; margin-bottom: var(--gap); border: 1px solid;
}
.notice .icon { margin-top: .12em; }
.notice-ok    { background: var(--ok-bg);     border-color: #c6e3d3; color: var(--ok); }
.notice-error { background: var(--danger-bg); border-color: #f2cac5; color: var(--danger); }
.notice-warn  { background: var(--warn-bg);   border-color: #ecdcb0; color: var(--warn); }
.notice-info  { background: var(--info-bg);   border-color: #cfe0f7; color: var(--info); }

/* Empty state: says what is missing AND how to fix it. */
.empty-state { text-align: center; padding: 2.25rem 1.25rem; }
.empty-state .icon { width: 2rem; height: 2rem; color: var(--ink-4); }
.empty-state h3 { margin: .7rem 0 .3rem; font-size: .95rem; }
.empty-state p { margin: 0 auto 1.1rem; max-width: 52ch; color: var(--ink-3); font-size: .87rem; }

.card.flush .empty, .card.flush .card-hint + .empty { padding: 0 var(--card-p) var(--card-p); }
.empty { color: var(--ink-3); font-size: .88rem; margin: .4rem 0; }
.muted { color: var(--ink-3); }
.prose { max-width: 72ch; font-size: .9rem; line-height: 1.65; }

.state-card { text-align: center; padding: 2.5rem 1.5rem; }
.state-card h2 { margin: .7rem 0 .35rem; font-size: 1.05rem; }
.state-card p { margin: 0 auto 1.2rem; max-width: 56ch; }
.planned { max-width: 46ch; margin: 0 auto 1.5rem; text-align: left; }
.planned li { display: flex; gap: .5rem; align-items: flex-start; color: var(--ink-3); border: 0; }
.planned .icon { color: var(--ok); margin-top: .22em; }

/* ===================================================================
   Login
   =================================================================== */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.login-card {
  width: 100%; max-width: 356px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 2rem; box-shadow: var(--shadow-md);
}
.login-sub { text-align: center; color: var(--ink-3); font-size: .83rem; margin: .5rem 0 1.5rem; }
.login-card form { display: flex; flex-direction: column; gap: .25rem; }
.login-card label { margin-top: .55rem; }

/* ===================================================================
   Printable call-up sheet
   =================================================================== */
.sheet-page { background: var(--bg); padding: 2rem 1rem; }
.sheet {
  max-width: 640px; margin: 0 auto; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r); padding: 2.5rem;
}
.sheet-head { text-align: center; margin-bottom: 1.6rem; }
.sheet-head h1 { margin: 1.1rem 0 .45rem; font-size: 1.35rem; letter-spacing: .08em; text-transform: uppercase; }
.sheet-meta { margin: 0; font-size: .88rem; color: var(--ink-3); line-height: 1.7; }
.sheet-list { list-style: none; margin: 0; padding: 0; }
.sheet-list li { display: flex; align-items: center; gap: .85rem; padding: .5rem 0; border-bottom: 1px solid var(--line-2); }
.sheet-number { width: 1.9rem; text-align: center; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.sheet-name { flex: 1; font-weight: 600; }
.sheet-position { font-size: .78rem; color: var(--ink-3); }
.sheet-total { margin-top: 1.2rem; font-size: .84rem; color: var(--ink-3); }
.sheet-foot { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .74rem; color: var(--ink-4); text-align: center; }
.sheet-actions { max-width: 640px; margin: 1.2rem auto 0; text-align: center; }

/* ===================================================================
   Narrow screens — tables become cards
   =================================================================== */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center;
    gap: .9rem; padding: .6rem .9rem; overflow-x: auto;
  }
  .sidebar nav { flex-direction: row; gap: .15rem; }
  .nav-section { display: none; }
  .nav-link {
    white-space: nowrap; border-left: 0;
    border-bottom: 3px solid transparent; padding: .4rem .65rem;
  }
  .nav-link span { display: none; }
  .nav-link.is-active { border-left: 0; border-bottom-color: var(--accent); }
  main, .topbar { padding: .9rem; }
  .profile-photo { width: 104px; }
  .account-name { display: none; }

  /* Each row becomes a labelled block; headers are hidden. */
  .table.stackable thead { display: none; }
  .table.stackable, .table.stackable tbody,
  .table.stackable tr, .table.stackable td { display: block; width: 100%; }
  .table.stackable tr {
    border: 1px solid var(--line); border-radius: var(--r-sm);
    padding: .55rem .7rem; margin-bottom: .55rem;
  }
  .table.stackable td {
    border: 0; padding: .16rem 0; display: flex;
    justify-content: space-between; gap: 1rem; text-align: right;
  }
  .table.stackable td::before {
    content: attr(data-label); font-size: .72rem; font-weight: 650;
    color: var(--ink-4); text-transform: uppercase; letter-spacing: .05em;
    text-align: left; flex-shrink: 0;
  }
  .table.stackable td:first-child { font-weight: 650; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .sidebar, .topbar, .page-actions, .filter-bar, .filter-chips { display: none !important; }
  main { padding: 0; }
  .card { border: 0; box-shadow: none; page-break-inside: avoid; }
}

/* ===================================================================
   Lineup builder
   =================================================================== */
.lineup-layout {
  display: grid; gap: var(--gap);
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  align-items: start;
}

.pitch-card { padding: 1rem; }

.pitch {
  /* Height drives the size: a pitch at 100% of a wide card becomes
     1100px tall and pushes the goalkeeper below the fold. 48vh wide
     x 2:3 keeps the whole formation on one screen. */
  position: relative; aspect-ratio: 2 / 3;
  width: min(100%, 44vh); margin-inline: auto;
  border-radius: var(--r);
  background:
    repeating-linear-gradient(
      to bottom,
      #3a7d52 0 7.14%,
      #347248 7.14% 14.28%
    );
  overflow: hidden;
}
.pitch-lines {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.pitch-lines rect, .pitch-lines circle, .pitch-lines line {
  fill: none; stroke: rgba(255,255,255,.4); stroke-width: .5;
  vector-effect: non-scaling-stroke;
}

.slot {
  position: absolute; transform: translate(-50%, -50%);
  width: 3.6rem; display: flex; flex-direction: column;
  align-items: center; gap: .1rem; cursor: pointer; text-align: center;
}
.slot-shirt {
  display: grid; place-items: center;
  width: 2.3rem; height: 2.3rem; border-radius: 99px;
  background: rgba(255,255,255,.14); color: #fff;
  border: 1.5px dashed rgba(255,255,255,.55);
  font-size: .76rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.slot.is-filled .slot-shirt {
  background: var(--paper); color: var(--brand);
  border: 2px solid var(--accent); border-style: solid;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.slot-name {
  font-size: .66rem; font-weight: 650; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.65); line-height: 1.2;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.slot-role { display: none; }
.slot.is-over .slot-shirt {
  background: var(--accent); border-color: #fff; color: #11160f; transform: scale(1.12);
}

/* Bench */
.bench-card { position: sticky; top: 4.5rem; }
.bench {
  list-style: none; margin: 0; padding: 0;
  max-height: 60vh; overflow-y: auto;
}
.bench-player {
  display: flex; align-items: center; gap: .55rem;
  padding: .4rem .5rem; border: 1px solid var(--line);
  border-radius: var(--r-sm); margin-bottom: .35rem;
  cursor: grab; background: var(--paper); user-select: none;
}
.bench-player:hover { border-color: var(--ink-4); }
.bench-player.is-picked { border-color: var(--accent); background: var(--warn-bg); }
.bench-player.is-dragging { opacity: .45; }
.bench-player.is-used { opacity: .4; }
.bench-shirt {
  display: grid; place-items: center; width: 1.7rem; height: 1.7rem;
  border-radius: 99px; background: var(--line-2); color: var(--ink-2);
  font-size: .72rem; font-weight: 700; flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.bench-name { flex: 1; min-width: 0; font-size: .84rem; font-weight: 600; line-height: 1.25; }
.bench-name small { display: block; font-weight: 400; font-size: .72rem; color: var(--ink-3); }

.lineup-layout + .card, .pitch-card .filter-bar { margin-bottom: 0; }
.filter-bar .field { gap: 0; }

.label-inline {
  display: block; font-size: .72rem; font-weight: 650;
  color: var(--ink-3); margin-bottom: .15rem;
}

@media (max-width: 860px) {
  .lineup-layout { grid-template-columns: 1fr; }
  .bench-card { position: static; }
  .bench { max-height: none; }
  .slot { width: 3rem; }
  .slot-shirt { width: 2rem; height: 2rem; font-size: .7rem; }
}

/* Instalador de uma vez só (_setup.php). */
.setup-card { max-width: 520px; }
.setup-card h2 { font-size: .95rem; margin: 1.25rem 0 .5rem; }
