/* Academy Admin > Players page, aligned with the Academy Dashboard
   (playerid-academy-dashboard.css) visual language.
   #academyCloudPlayersView is shared with the Developer Players pane, so
   every visual rule is scoped to the Academy shell
   (#adminPanel.academy-workspace-shell), which Developer never carries.
   The repeated #adminPanel ids out-rank the older layered Players rules
   (index.html inline, premium, workspace and dark stylesheets, up to four
   ids). Colours use the --academy-* tokens so the dark theme follows. */

/* ---------- Outside the Academy shell (Developer / legacy) ---------- */
.academy-shell-page-actions,
.academy-pending-empty { display: none; }
#adminPanel:not(.academy-workspace-shell) .academy-player-directory-head > h3 { display: none; }

/* ---------- Tokens ---------- */
/* --acp-card is the shell's --academy-surface (#fff), the value the Teams
   page resolves: premium.css rebinds --academy-surface to the grey
   --pid-theme-surface-raised on this view, so it is not inherited here. */
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView {
  --acp-card: #fff;
  --acp-ink: var(--academy-ink, #122334);
  --acp-heading: #0b1f3a;
  --acp-muted: var(--academy-muted, #657687);
  --acp-line: var(--academy-line, #dce5ea);
  --acp-teal: var(--academy-teal, #10a9b5);
  --acp-teal-strong: #0e97a3;
  --acp-teal-soft: #e3f6f6;
  --acp-inset: #f5f8fa;
  --acp-shadow: 0 1px 2px rgba(11, 31, 58, .04), 0 6px 18px rgba(11, 31, 58, .05);
  --acp-shadow-hover: 0 2px 4px rgba(11, 31, 58, .05), 0 10px 24px rgba(11, 31, 58, .08);
  --acp-radius: 12px;
  display: grid !important;
  gap: 14px !important;
  min-width: 0;
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}
html[data-theme="dark"] #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView {
  --acp-card: var(--academy-surface);
  --acp-heading: var(--academy-ink);
  --acp-teal-soft: rgba(34, 199, 187, .14);
  --acp-teal-strong: var(--academy-teal);
  --acp-inset: var(--academy-surface-inset, #0c1c28);
  --acp-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  --acp-shadow-hover: 0 2px 8px rgba(0, 0, 0, .35);
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView * { box-sizing: border-box; }

/* ---------- 1. Page header: actions join the shell heading ---------- */
/* The in-view action bar is replaced (Academy only) by the same three
   controls in the shell heading; both call the same global handlers. */
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView > .academy-player-page-actions { display: none !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell[data-academy-pane="players"] > .academy-shell-page-heading {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 20px;
  align-items: center;
  padding-bottom: 12px !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell[data-academy-pane="players"] > .academy-shell-page-heading > :not(.academy-shell-page-actions) { grid-column: 1; min-width: 0; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell[data-academy-pane="players"] > .academy-shell-page-heading > h1 { margin-bottom: 3px !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell[data-academy-pane="players"] > .academy-shell-page-heading > p { margin-bottom: 0 !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell[data-academy-pane="players"] .academy-players-page-actions {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-players-page-actions .academy-player-refresh {
  display: grid !important;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0 !important;
  border: 1px solid var(--academy-line) !important;
  border-radius: 10px !important;
  background: var(--academy-surface, #fff) !important;
  color: var(--academy-ink) !important;
  box-shadow: none !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-players-page-actions .academy-player-refresh:hover { border-color: var(--academy-teal) !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-players-page-actions .academy-player-refresh svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-players-page-actions .academy-add-player {
  min-height: 44px !important;
  margin: 0 !important;
  padding: 10px 16px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  white-space: nowrap;
}

/* ---------- 2. Directory KPI row: 4 academy-level KPIs, no scrolling ---------- */
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-categories {
  display: grid !important;
  grid-auto-flow: row;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category {
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-areas: "icon label" "icon count" "icon helper";
  column-gap: 12px;
  row-gap: 0;
  align-items: center;
  align-content: center;
  flex: none;
  grid-column: auto;
  min-width: 0;
  min-height: 78px !important;
  margin: 0 !important;
  padding: 12px 14px !important;
  border: 1px solid var(--acp-line) !important;
  border-radius: var(--acp-radius) !important;
  background: var(--acp-card) !important;
  background-image: none !important;
  box-shadow: var(--acp-shadow) !important;
  color: var(--acp-ink) !important;
  text-align: left !important;
  cursor: pointer;
  scroll-snap-align: start;
  transform: none !important;
  transition: border-color .16s ease, background-color .16s ease;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category:hover { border-color: var(--acp-teal) !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category[aria-pressed="true"] {
  border-color: var(--acp-teal) !important;
  background: var(--acp-teal-soft) !important;
  box-shadow: inset 0 0 0 1px var(--acp-teal) !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category:focus-visible { outline: 2px solid var(--acp-teal) !important; outline-offset: 2px; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category-icon {
  grid-area: icon;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: var(--acp-teal-soft);
  color: var(--acp-teal-strong) !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category[aria-pressed="true"] .academy-player-category-icon { background: var(--acp-card); }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category.is-unassigned .academy-player-category-icon { background: rgba(240, 180, 60, .16); color: #b67819 !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category-icon svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category > strong {
  grid-area: label;
  overflow: hidden;
  color: var(--acp-ink) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category > b {
  grid-area: count;
  margin: 1px 0 0 !important;
  color: var(--acp-heading) !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category > small {
  grid-area: helper;
  margin: 1px 0 0 !important;
  overflow: hidden;
  color: var(--acp-muted) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 3. Search + filter toolbar ---------- */
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-cloud-player-toolbar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 180px) minmax(160px, 220px) !important;
  gap: 12px !important;
  align-items: end;
  margin: 0;
  padding: 12px 14px !important;
  border: 1px solid var(--acp-line) !important;
  border-radius: var(--acp-radius) !important;
  background: var(--acp-card) !important;
  box-shadow: var(--acp-shadow) !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-cloud-player-toolbar label { display: block; min-width: 0; margin: 0 !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-cloud-player-toolbar label > span {
  display: block;
  margin: 0 0 5px !important;
  color: var(--acp-muted) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: .02em !important;
  text-transform: none;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-cloud-player-toolbar :is(input, select) {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 9px 12px !important;
  border: 1px solid var(--acp-line) !important;
  border-radius: 9px !important;
  background-color: var(--acp-card) !important;
  color: var(--acp-heading) !important;
  box-shadow: none !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-cloud-player-toolbar :is(input, select):focus-visible {
  border-color: var(--acp-teal) !important;
  outline: 2px solid rgba(16, 169, 181, .2) !important;
  outline-offset: 1px;
}

/* ---------- 4. Pending Access card ---------- */
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-attention {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 13px 16px !important;
  border: 1px solid var(--acp-line) !important;
  border-radius: var(--acp-radius) !important;
  background: var(--acp-card) !important;
  box-shadow: var(--acp-shadow) !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-subhead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-subhead h3,
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-directory-head h3 {
  margin: 0 !important;
  color: var(--acp-heading) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  letter-spacing: -.01em;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-pending-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--acp-inset);
  color: var(--acp-muted);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-pending-count:empty { display: none; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-attention[data-pending-state="has"] .academy-pending-count { background: rgba(240, 180, 60, .18); color: #9a6a0a; }
html[data-theme="dark"] #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-attention[data-pending-state="has"] .academy-pending-count { color: #e8c77a; }
/* Nothing pending: one compact line instead of two empty boxes. */
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-attention[data-pending-state="empty"] .academy-pending-group { display: none; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-attention[data-pending-state="empty"] .academy-pending-empty {
  display: block;
  margin: 0 !important;
  color: var(--acp-muted) !important;
  font-size: 12.5px !important;
  line-height: 1.45 !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-pending-group { display: grid; gap: 6px; min-width: 0; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-pending-group > .title {
  margin: 0 !important;
  color: var(--acp-muted) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-pending-group :is(.progress-empty, .status) {
  margin: 0 !important;
  padding: 8px 12px !important;
  border: 1px solid var(--acp-line) !important;
  border-radius: 9px !important;
  background: var(--acp-inset) !important;
  box-shadow: none !important;
  font-size: 12px !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-pending-group .progress-empty { color: var(--acp-muted) !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-pending-group .pending-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin: 0 0 6px !important;
  padding: 10px 12px !important;
  border: 1px solid var(--acp-line) !important;
  border-radius: 10px !important;
  background: var(--acp-inset) !important;
  box-shadow: none !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-pending-group .pending-row:last-child { margin-bottom: 0 !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-pending-group .pending-row > div:first-child { display: grid; gap: 2px; flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-pending-group .pending-row strong { color: var(--acp-heading) !important; font-size: 13px; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-pending-group .pending-row small { color: var(--acp-muted) !important; font-size: 11.5px; line-height: 1.4; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-pending-group .pending-row .mini-actions { display: flex; gap: 8px; margin: 0 !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-pending-group .pending-row .mini-actions .btn { min-height: 40px; margin: 0 !important; }

/* ---------- 5. Registered Players ---------- */
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-directory-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 -4px;
  min-width: 0;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-cloud-player-summary {
  color: var(--acp-muted) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  white-space: nowrap;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView #academyCloudPlayerDirectory {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  margin: 0;
}

/* Directory row. .academy-player-row-body is flattened (display: contents)
   so identity, football context, team and coach can be placed in named
   areas and the same markup becomes a card on mobile. */
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-row {
  position: relative;
  display: grid !important;
  grid-template-columns: 44px minmax(170px, 1fr) minmax(0, 1.35fr) auto auto;
  grid-template-areas:
    "photo identity football status actions"
    "photo identity team     status actions"
    "photo identity coach    status actions";
  grid-template-rows: auto auto auto;
  column-gap: 18px;
  row-gap: 1px;
  align-items: center;
  align-content: center;
  min-height: 72px !important;
  margin: 0 !important;
  padding: 12px 16px !important;
  border: 1px solid var(--acp-line) !important;
  border-radius: var(--acp-radius) !important;
  background: var(--acp-card) !important;
  background-image: none !important;
  box-shadow: var(--acp-shadow) !important;
  opacity: 1 !important;
  transform: none !important;
  transition: border-color .16s ease, box-shadow .16s ease !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-row.inactive { background: var(--acp-inset) !important; }
@media (hover: hover) and (pointer: fine) {
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-row:hover {
    border-color: rgba(16, 169, 181, .45) !important;
    box-shadow: var(--acp-shadow-hover) !important;
    transform: none !important;
  }
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-row-body { display: contents !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-row .player-manage-photo {
  grid-area: photo !important;
  align-self: center;
  display: grid;
  place-items: center;
  width: 44px !important;
  height: 44px !important;
  margin: 0 !important;
  border-radius: 50% !important;
  background-color: var(--acp-teal-soft) !important;
  background-position: center top !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  box-shadow: 0 0 0 1px var(--acp-line) !important;
  color: var(--acp-teal-strong) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: .02em;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-row .player-manage-photo.has-photo { background-color: var(--acp-inset) !important; font-size: 0 !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-identity { grid-area: identity !important; align-self: center; min-width: 0; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-identity h4 {
  margin: 0 !important;
  overflow: visible;
  color: var(--acp-heading) !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-code {
  display: block;
  margin-top: 2px !important;
  color: var(--acp-muted) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: .03em;
  line-height: 1.35 !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-football {
  grid-area: football !important;
  align-self: end;
  min-width: 0;
  margin: 0 !important;
  color: var(--acp-ink) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
}
/* No age group / position / jersey on record: omit the placeholder line. */
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-football.is-empty { display: none !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-team {
  grid-area: team !important;
  align-self: start;
  min-width: 0;
  margin: 0 !important;
  color: var(--acp-muted) !important;
  font-size: 11.5px !important;
  line-height: 1.4 !important;
  white-space: normal;
  overflow-wrap: anywhere;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-coach {
  grid-area: coach !important;
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  margin: 1px 0 0 !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-coach:empty { display: none !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-coach small { color: var(--acp-muted) !important; font-size: 11px !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-coach strong { color: var(--acp-ink) !important; font-size: 11.5px !important; font-weight: 600; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-status {
  grid-area: status !important;
  align-self: center !important;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px !important;
  border: 0 !important;
  border-radius: 999px !important;
  font-size: 9.5px !important;
  font-weight: 800 !important;
  letter-spacing: .07em;
  line-height: 1.2 !important;
  text-transform: uppercase;
  white-space: nowrap;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-status.active { background: var(--acp-teal-soft) !important; color: var(--acp-teal-strong) !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-status.inactive { background: var(--academy-status-neutral-bg, #eef2f4) !important; color: var(--academy-status-neutral-text, #65717a) !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-actions {
  grid-area: actions !important;
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  margin: 0 !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-actions .academy-player-primary {
  flex: 0 0 auto;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 8px 14px !important;
  border-radius: 9px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  white-space: nowrap;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-actions .academy-player-primary:not(.academy-player-assign-team) {
  border: 1px solid var(--acp-line) !important;
  background: var(--acp-card) !important;
  background-image: none !important;
  color: var(--acp-heading) !important;
  box-shadow: none !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-actions .academy-player-primary:not(.academy-player-assign-team):hover { border-color: var(--acp-teal) !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-menu summary {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--acp-line) !important;
  border-radius: 9px;
  background: var(--acp-card) !important;
  box-shadow: none !important;
  color: var(--acp-heading) !important;
  font-size: 14px;
  letter-spacing: .05em;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-menu summary:hover,
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-menu[open] summary { border-color: var(--acp-teal) !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-menu > div {
  top: 44px;
  min-width: 170px;
  border: 1px solid var(--acp-line) !important;
  border-radius: 10px;
  background: var(--acp-card) !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-menu button { min-height: 40px; font-size: 12.5px !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-row .guardian-access-panel { grid-area: auto / 1 / auto / -1 !important; min-width: 0; margin-top: 10px; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView #academyCloudPlayerDirectory :is(.player-empty, .progress-empty, .status) {
  padding: 14px 16px !important;
  border: 1px dashed var(--acp-line) !important;
  border-radius: var(--acp-radius) !important;
  background: var(--acp-inset) !important;
  color: var(--acp-muted) !important;
  font-size: 12.5px !important;
}

/* ---------- Narrow desktop / tablet: KPI 2 x 2 ---------- */
@media (max-width: 960px) {
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-categories { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* ---------- Tablet: context moves under the name ---------- */
@media (max-width: 1180px) {
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-row {
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
    grid-template-areas:
      "photo identity status actions"
      "photo football status actions"
      "photo team     status actions"
      "photo coach    status actions";
    grid-template-rows: auto auto auto auto;
    column-gap: 14px;
  }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-football { align-self: start; margin-top: 4px !important; }
}

/* ---------- Mobile (<=768px): header stacks, rows become cards ---------- */
@media (max-width: 768px) {
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell[data-academy-pane="players"] > .academy-shell-page-heading {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 10px !important;
  }
  /* Row 1: the two Add buttons, equal width. Row 2: compact outline Refresh. */
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell[data-academy-pane="players"] .academy-players-page-actions {
    grid-column: 1;
    grid-row: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
    margin-top: 12px;
  }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-players-page-actions .academy-add-player { grid-row: 1; min-width: 0; padding: 8px 12px !important; line-height: 1.2 !important; text-align: center; white-space: normal; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-players-page-actions .academy-player-refresh {
    display: inline-flex !important;
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: start;
    align-items: center;
    gap: 6px;
    width: auto;
    height: 40px;
    padding: 0 14px !important;
    color: var(--academy-muted, #657687) !important;
    font-size: 12px;
    font-weight: 700;
  }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-players-page-actions .academy-player-refresh::after { content: "Refresh"; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-players-page-actions .academy-player-refresh svg { width: 16px; height: 16px; }

  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView { gap: 12px !important; }
  /* KPI 2 x 2. */
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-categories {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category { min-height: 72px !important; padding: 11px 12px !important; column-gap: 10px; grid-template-columns: 36px minmax(0, 1fr); }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category > strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category-icon { width: 36px; height: 36px; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category > b { font-size: 20px !important; }

  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-cloud-player-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 12px !important;
  }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-cloud-player-toolbar .academy-player-search { grid-column: 1 / -1; }

  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-attention { padding: 12px 14px !important; }

  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-row {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas:
      "photo    identity"
      "photo    status"
      "football football"
      "team     team"
      "coach    coach"
      "actions  actions";
    grid-template-rows: auto auto auto auto auto auto;
    column-gap: 12px;
    row-gap: 0;
    align-items: start;
    padding: 14px !important;
  }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-row .player-manage-photo { align-self: start; width: 48px !important; height: 48px !important; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-identity h4 { font-size: 15px !important; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-status { align-self: start !important; margin-top: 6px; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-football {
    margin-top: 12px !important;
    padding-top: 10px;
    border-top: 1px solid var(--acp-line);
  }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-team { margin-top: 2px !important; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-football.is-empty + .academy-player-team {
    margin-top: 12px !important;
    padding-top: 10px;
    border-top: 1px solid var(--acp-line);
  }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-actions { justify-content: space-between; margin-top: 12px !important; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-actions .academy-player-primary { flex: 1 1 auto; min-height: 44px !important; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-menu summary { width: 44px; height: 44px; }
}

/* ---------- Small phones ---------- */
@media (max-width: 480px) {
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-row { padding: 12px !important; column-gap: 10px; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-row .player-manage-photo { width: 44px !important; height: 44px !important; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-row { grid-template-columns: 44px minmax(0, 1fr); }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-actions { gap: 8px; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-directory-head h3 { font-size: 14px !important; }
}
@media (max-width: 400px) {
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-cloud-player-toolbar { grid-template-columns: minmax(0, 1fr) !important; }
  /* Narrow phones keep 2 summary columns with a tighter card. */
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-categories { gap: 8px !important; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category { min-height: 66px !important; padding: 10px !important; column-gap: 8px; grid-template-columns: 30px minmax(0, 1fr); }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category-icon { width: 30px; height: 30px; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category-icon svg { width: 16px; height: 16px; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category > strong { font-size: 11px !important; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category > b { font-size: 18px !important; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-category > small { font-size: 10px !important; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-players-page-actions .academy-add-player { padding: 8px 8px !important; font-size: 11.5px !important; }
}
@media (max-width: 339px) {
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell[data-academy-pane="players"] .academy-players-page-actions { grid-template-columns: minmax(0, 1fr); }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-players-page-actions .academy-add-player { grid-row: auto; }
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-players-page-actions .academy-player-refresh { grid-row: 3; }
}

@media (prefers-reduced-motion: reduce) {
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView :is(.academy-player-row, .academy-player-category), #adminPanel.academy-workspace-shell .academy-existing-result { transition: none !important; }
}

@media (max-width: 299px) {
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-categories { grid-template-columns: minmax(0, 1fr) !important; }
}

/* ---------- Player avatars (canonical photo_url, initials fallback) ---------- */
/* The <img> only exists when createAcademyPlayerAvatar() accepted a photo,
   so this is safe outside the Academy shell too (Developer Players pane). */
.player-manage-photo > img,
.academy-existing-avatar > img,
.academy-photo-preview > img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: center top;
}

/* ---------- Canonical photo Add / Change (Academy Admin, Phase 3B) ---------- */
/* Quiet secondary control under the player code; rendered only when the
   server allows the signed-in Academy Admin (academy-player-photo.js).
   Tokens only, so the dark theme follows; no fill change on hover. */
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-photo-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 6px 0 0 !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-photo-action .pid-photo-action-button {
  width: auto !important;
  min-height: 26px !important;
  padding: 3px 10px !important;
  border: 1px solid var(--acp-line) !important;
  border-radius: 8px !important;
  background: var(--acp-card) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--acp-teal-strong) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-photo-action .pid-photo-action-button:hover:not(:disabled) { border-color: var(--acp-teal) !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-photo-action .pid-photo-action-button:disabled { color: var(--acp-muted) !important; cursor: progress; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-photo-action .pid-photo-action-button[hidden] { display: none !important; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-photo-action .pid-photo-action-status { color: var(--acp-muted); font-size: 11px; font-weight: 600; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-photo-action .pid-photo-action-status.is-error { color: #b42318; }
#adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-photo-action .pid-photo-action-status.is-success { color: var(--acp-teal-strong); }
@media (max-width: 768px) {
  /* Touch target on phones; still visually secondary to the row CTA. */
  #adminPanel#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyCloudPlayersView .academy-player-photo-action .pid-photo-action-button { min-height: 36px !important; padding: 6px 12px !important; }
}

/* ---------- Player drawers: Register Player + Add Existing Player ---------- */
/* The drawers sit outside #academyCloudPlayersView; everything below is
   scoped to the Academy shell. Surface/title/input colours stay with
   index.html + playerid-academy-dark.css; only tokens are used here so the
   dark theme follows. The Register drawer is also reachable from the
   Developer Players pane, where the new section wrappers stay neutral. */
#adminPanel:not(.academy-workspace-shell) .academy-form-section-title,
#adminPanel:not(.academy-workspace-shell) .academy-photo-preview { display: none; }
#adminPanel:not(.academy-workspace-shell) .academy-form-section + .academy-form-section,
#adminPanel:not(.academy-workspace-shell) .academy-drawer-footer { margin-top: 14px; }

#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormCard, #academyExistingPlayerFormCard) {
  --acd-pad: 24px;
  --acd-teal: var(--academy-teal, #10a9b5);
  --acd-teal-tint: rgba(16, 169, 181, .08);
  padding: 20px var(--acd-pad) 0 !important;
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  overscroll-behavior: contain;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormCard, #academyExistingPlayerFormCard) * { box-sizing: border-box; }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormCard, #academyExistingPlayerFormCard) > p {
  margin: 6px 0 16px;
  color: var(--academy-muted, #657687);
  font-size: 12.5px;
  line-height: 1.5;
}

/* Sections: divider + small heading, no nested cards. */
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormCard, #academyExistingPlayerFormCard) .academy-form-section {
  padding: 18px 0;
  border-top: 1px solid var(--academy-line, #dce5ea);
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormCard, #academyExistingPlayerFormCard) .academy-form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--academy-muted, #657687);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormCard, #academyExistingPlayerFormCard) .academy-form-section-title::before {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--acd-teal);
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyPlayerFormCard .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin: 0;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyPlayerFormCard .grid + .grid { margin-top: 14px; }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyPlayerFormCard .grid > * { min-width: 0; }

/* Labels, optional badges and controls. */
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormCard, #academyExistingPlayerFormCard) label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 0 0 6px !important;
  color: var(--academy-ink, #122334);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormCard, #academyExistingPlayerFormCard) .optional-tag {
  margin: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--acd-teal-tint);
  color: var(--academy-muted, #657687);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormCard, #academyExistingPlayerFormCard) :is(input:not([type="file"]):not([type="hidden"]), select) {
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px !important;
  border-width: 1px;
  border-style: solid;
  border-radius: 10px !important;
  font-family: inherit;
  font-size: 14px;
  box-shadow: none;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormCard, #academyExistingPlayerFormCard) :is(input, select):focus-visible {
  border-color: var(--acd-teal) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 169, 181, .16);
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormCard, #academyExistingPlayerFormCard) :is(.academy-field-hint, .academy-photo-control small) {
  display: block;
  margin-top: 6px;
  color: var(--academy-muted, #657687);
  font-size: 11.5px;
  line-height: 1.45;
}

/* Photo: preview circle + native file control. */
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyPlayerFormCard .academy-photo-field {
  display: flex;
  align-items: center;
  gap: 16px;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyPlayerFormCard .academy-photo-preview {
  display: grid;
  flex: 0 0 64px;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--acd-teal-tint);
  box-shadow: 0 0 0 1px var(--academy-line, #dce5ea);
  color: var(--acd-teal);
  font-size: 0;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyPlayerFormCard .academy-photo-preview:not(.has-photo)::before {
  content: "";
  width: 26px;
  height: 26px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E") center / contain no-repeat;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyPlayerFormCard .academy-photo-control { flex: 1 1 auto; min-width: 0; }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyPlayerFormCard input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--academy-muted, #657687);
  font-family: inherit;
  font-size: 12.5px;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyPlayerFormCard input[type="file"]::file-selector-button {
  min-height: 40px;
  margin-right: 10px;
  padding: 8px 14px;
  border: 1px solid var(--academy-line, #dce5ea);
  border-radius: 10px;
  background: var(--acd-teal-tint);
  color: var(--academy-ink, #122334);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* Sticky action footer: never overlays content, it is the last flow item. */
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormCard, #academyExistingPlayerFormCard) .academy-drawer-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 4px calc(var(--acd-pad) * -1) 0;
  padding: 12px var(--acd-pad) calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--academy-line, #dce5ea);
  background: var(--academy-surface, #fff);
  box-shadow: 0 -8px 18px rgba(11, 31, 58, .06);
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormStatus, #academyExistingPlayerStatus) { max-height: 32vh; overflow-y: auto; }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormStatus, #academyExistingPlayerStatus) .status { margin: 0 0 10px !important; }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-drawer-footer .mini-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin: 0 !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-drawer-footer .mini-actions .btn {
  flex: 0 0 auto;
  width: auto;
  min-height: 44px;
  margin: 0 !important;
  padding: 10px 16px !important;
  border-radius: 10px !important;
  font-family: inherit;
  font-size: 13px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
  transform: none !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-drawer-footer .mini-actions .btn.primary {
  flex: 1 1 auto;
  border: 1px solid var(--acd-teal) !important;
  background: var(--acd-teal) !important;
  background-image: none !important;
  color: #fff !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-drawer-footer .mini-actions .btn.primary:hover:not(:disabled) { border-color: #0e97a3 !important; background: #0e97a3 !important; }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-drawer-footer .mini-actions .btn:disabled { cursor: not-allowed; opacity: .5; }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-drawer-footer .mini-actions .btn.academy-drawer-secondary {
  border: 1px solid var(--academy-line, #dce5ea) !important;
  background: var(--academy-surface, #fff) !important;
  color: var(--academy-ink, #122334) !important;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-drawer-footer .mini-actions .btn.light:not(.academy-drawer-secondary) {
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--academy-muted, #657687) !important;
}

/* Add Existing Player: search row, result cards, selected player. */
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-search .btn {
  width: auto;
  min-height: 44px;
  margin: 0 !important;
  padding: 10px 16px !important;
  border-radius: 10px !important;
  font-family: inherit;
  font-size: 13px !important;
  font-weight: 700 !important;
  white-space: nowrap;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-results { display: grid; gap: 8px; }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-results:not(:empty) { margin-top: 14px; }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-result {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--academy-line, #dce5ea);
  border-radius: 12px;
  background: var(--academy-surface, #fff);
  box-shadow: 0 1px 2px rgba(11, 31, 58, .04);
  color: var(--academy-ink, #122334);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-result:hover:not(:disabled) { border-color: var(--acd-teal); }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-result:focus-visible { outline: 2px solid var(--acd-teal); outline-offset: 2px; }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-result[aria-pressed="true"] {
  border-color: var(--acd-teal);
  background: var(--acd-teal-tint);
  box-shadow: inset 0 0 0 1px var(--acd-teal);
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-result:disabled { cursor: default; opacity: .72; }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--acd-teal-tint);
  box-shadow: 0 0 0 1px var(--academy-line, #dce5ea);
  color: var(--acd-teal);
  font-size: 13px;
  font-weight: 800;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-avatar.has-photo { font-size: 0; }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-result-info { min-width: 0; }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-result-info strong {
  display: block;
  color: var(--academy-ink, #122334);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-result-info small {
  display: block;
  margin-top: 2px;
  color: var(--academy-muted, #657687);
  font-size: 11.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-result-info .academy-existing-result-code { color: var(--acd-teal); font-weight: 700; letter-spacing: .03em; }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-result-tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(240, 180, 60, .16);
  color: #8a5a0f;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
html[data-theme="dark"] #adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-result-tag { color: #e8c77a; }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-selected {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(16, 169, 181, .35);
  border-radius: 12px;
  background: var(--acd-teal-tint);
}
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-selected strong { display: block; color: var(--academy-ink, #122334); font-size: 14px; overflow-wrap: anywhere; }
#adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-selected small { display: block; margin-top: 3px; color: var(--academy-muted, #657687); font-size: 11.5px; overflow-wrap: anywhere; }

/* Drawer mobile: one column, 16px inputs (no iOS focus zoom). */
@media (max-width: 768px) {
  #adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormCard, #academyExistingPlayerFormCard) { --acd-pad: 16px; padding-top: 16px !important; }
  #adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyPlayerFormCard .grid { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  #adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyPlayerFormCard .grid + .grid { margin-top: 12px; }
  #adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormCard, #academyExistingPlayerFormCard) .academy-form-section { padding: 16px 0; }
  #adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell :is(#academyPlayerFormCard, #academyExistingPlayerFormCard) :is(input:not([type="file"]):not([type="hidden"]), select) { font-size: 16px; }
  #adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell .academy-drawer-footer .mini-actions .btn { padding: 10px 12px !important; }
}
@media (max-width: 480px) {
  #adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-result { grid-template-columns: 44px minmax(0, 1fr); }
  #adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-result-tag { grid-column: 2; justify-self: start; }
}
@media (max-width: 360px) {
  #adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyExistingPlayerFormCard .academy-existing-search { grid-template-columns: minmax(0, 1fr); }
  #adminPanel#adminPanel#adminPanel#adminPanel.academy-workspace-shell #academyPlayerFormCard .academy-photo-field { align-items: flex-start; }
}
