/* Legacy MySportsApp dashboard shell — matches safa-gp dashboard.php / includes/nav.php */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.legacy-app {
  font-family: 'Inter', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page, #0b0c10);
  min-height: 100vh;
  display: flex;
  color: var(--text, #e8e8e8);
}

.legacy-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--bg-page, #0b0c10);
  color: var(--text, #e8e8e8);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 6px solid var(--sidebar-border, #114477);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.08), 2px 0 10px rgba(0, 0, 0, 0.25);
  z-index: 20;
}

.legacy-sidebar-header {
  position: relative;
  padding: 1.75rem 1rem 1rem;
  text-align: center;
  background: linear-gradient(135deg, var(--header-grad-start) 0%, var(--header-grad-end) 70%);
  border-bottom: 3px solid var(--sidebar-border, #114477);
  clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.legacy-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.legacy-region-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary, #114477);
  color: #111;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.legacy-brand-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.5));
}

.legacy-brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.legacy-role-pill {
  display: inline-block;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.legacy-nav-list {
  list-style: none;
  padding: 1rem 0;
  flex: 1;
}

.legacy-nav-section-title {
  color: #bdbdbd;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.5rem 1.25rem 0.25rem;
  margin-top: 0.5rem;
  opacity: 0.9;
  user-select: none;
}

.legacy-nav-section {
  margin-bottom: 0.15rem;
}

.legacy-nav-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem 0.25rem;
  border: 0;
  background: transparent;
  color: #bdbdbd;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
}

.legacy-nav-section-toggle:hover {
  color: #fff;
}

.legacy-nav-section-chevron {
  font-size: 0.85rem;
  transition: transform 0.15s ease;
}

.legacy-nav-section.is-collapsed .legacy-nav-section-chevron {
  transform: rotate(-90deg);
}

.legacy-nav-section-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.legacy-nav-section.is-collapsed .legacy-nav-section-items {
  display: none;
}

.legacy-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.legacy-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.legacy-nav-list li {
  margin-bottom: 0.35rem;
}

.legacy-nav-list a,
.legacy-logout-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 1.5rem);
  margin: 0 0.75rem;
  padding: 0.75rem 1.25rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  position: relative;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.legacy-nav-list a::before,
.legacy-logout-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  border-radius: 0 4px 4px 0;
  transition: background 0.2s;
}

.legacy-nav-list a:hover,
.legacy-nav-list a.active,
.legacy-logout-link:hover {
  background: var(--primary, #114477);
  color: #111 !important;
  padding-left: 1.75rem;
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.45);
}

.legacy-nav-list a.active::before,
.legacy-nav-list a:hover::before,
.legacy-logout-link:hover::before {
  background: #fff;
}

.legacy-nav-list li.logout {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.legacy-footer-branding {
  margin: 1rem 0.75rem 1.5rem;
  font-size: 0.6rem;
  color: #d4d4d4;
  text-align: center;
  line-height: 1.2;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

.legacy-main {
  flex: 1;
  margin-left: 280px;
  padding: 40px 20px;
  width: calc(100% - 280px);
}

.legacy-card {
  background: var(--bg-card, #12161c);
  max-width: 1100px;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.legacy-card-header {
  background: linear-gradient(135deg, var(--header-grad-start) 0%, var(--header-grad-end) 70%);
  padding: 1.5rem 2rem;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.legacy-card-header h1 {
  font-size: 1.75rem;
  margin: 0;
}

.legacy-card-header .region {
  font-size: 0.8rem;
  margin-top: 4px;
  opacity: 0.9;
}

.legacy-card-body {
  padding: 1.75rem 2rem;
}

.legacy-welcome .sub {
  color: var(--muted, #c7c7c7);
  font-size: 0.95rem;
  margin-top: 4px;
}

.legacy-stats {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 1rem;
}

.legacy-stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 8px solid var(--primary, #114477);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.legacy-stat .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  opacity: 0.9;
}

.legacy-stat .value {
  font-size: 2.1rem;
  font-weight: 800;
  color: #fff;
  margin-top: 0.35rem;
  line-height: 1;
}

.legacy-stat .hint {
  font-size: 0.8rem;
  color: var(--muted, #c7c7c7);
  margin-top: 0.4rem;
}

.legacy-panel {
  background: var(--bg-card, #12161c);
  border-left: 8px solid var(--primary, #114477);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  max-width: 980px;
  margin: 0 auto;
}

.legacy-panel-header {
  padding: 1.5rem 2rem 1rem;
  background: linear-gradient(135deg, var(--header-grad-start) 0%, var(--header-grad-end) 70%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.legacy-panel-header h2 {
  margin: 0;
  font-size: 1.75rem;
  color: #fff;
}

.legacy-panel-body {
  padding: 2rem;
}

.legacy-error {
  background: #2b1517;
  border: 1px solid #5a2a2f;
  color: #ffb3b9;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 1rem;
  font-weight: 600;
}

.legacy-ok {
  background: #102119;
  border: 1px solid #2f6f50;
  color: #b2f7cc;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 1rem;
}

.legacy-form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.legacy-form-span-2 {
  grid-column: 1 / -1;
}

.legacy-form-section {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.05rem;
  color: var(--accent, #ffb612);
}

.legacy-muted {
  color: var(--muted, #9aa0a6);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.legacy-form-grid label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 700;
  color: #e0e0e0;
  font-size: 0.92rem;
}

.legacy-form-grid input,
.legacy-form-grid select,
.legacy-filters select,
.legacy-tbl-wrap select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #1e2430;
  color: #f5f5f5;
  font-size: 1rem;
}

.legacy-form-grid input[type="checkbox"],
.legacy-form-grid input[type="radio"] {
  width: auto;
  min-width: 1rem;
  height: auto;
  padding: 0;
  margin: 0;
  border-radius: 3px;
  accent-color: var(--accent, #ffb612);
}

.legacy-form-grid select option,
.legacy-filters select option,
.legacy-tbl-wrap select option {
  background: #1e2430;
  color: #f5f5f5;
}

.legacy-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: var(--primary, #114477);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
}

.legacy-btn:hover {
  filter: brightness(1.08);
}

.legacy-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.legacy-quick-actions .legacy-btn {
  margin-top: 0;
}

.legacy-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
  justify-content: flex-end;
}

.legacy-form-actions .legacy-btn {
  margin-top: 0;
}

.legacy-hint {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted, #c7c7c7);
}

.legacy-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

/* Club show page — denser layout closer to legacy members flow */
.club-show__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.club-show__title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.club-show__logo {
  height: 56px;
  width: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  flex-shrink: 0;
}

.club-show__title-text h1 {
  margin: 0;
}

.club-show__status-badge {
  display: inline-block;
  font-weight: 700;
  color: #fff;
}

.club-show__toolbar {
  margin-top: 0;
  justify-content: flex-end;
}

.club-show__inline-form {
  margin: 0;
  display: inline;
}

.club-show__inline-form .legacy-btn {
  margin-top: 0;
}

.club-show__stats {
  margin: 0 0 1rem;
}

.club-show__stats .hint a {
  color: var(--muted, #c7c7c7);
}

.club-show__filters {
  margin: 0 0 1rem;
  display: grid;
  gap: 0.65rem;
}

.club-show__chip-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.club-show__chip {
  flex: 0 0 auto;
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.club-show__chip:hover {
  filter: brightness(1.08);
}

.club-show__chip.is-active {
  background: var(--primary, #114477);
  border-color: transparent;
}

.club-show__chip--side {
  border-radius: 8px;
}

.club-show__print {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.club-show__print h3 {
  color: #fff;
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.club-show__print-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) auto;
  gap: 0.75rem;
  align-items: end;
}

.club-show__print-form label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted, #c7c7c7);
  margin-bottom: 0.25rem;
}

.club-show__print-form select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

.club-show__print-action .legacy-btn {
  margin-top: 0;
  width: 100%;
}

.club-show__roster-heading {
  color: #fff;
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.legacy-roster-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.legacy-roster-list li {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 6px solid var(--primary, #114477);
  border-radius: 10px;
}

.legacy-roster-list a {
  display: block;
  padding: 0.85rem 1rem;
  color: #fff;
  text-decoration: none;
}

.legacy-roster-list a:hover {
  border-color: rgba(17, 68, 119, 0.45);
}

.legacy-roster-list .name {
  display: block;
  font-weight: 800;
}

.legacy-roster-list .meta {
  display: block;
  font-size: 0.85rem;
  color: var(--muted, #c7c7c7);
  margin-top: 0.15rem;
}

.legacy-empty {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
}

.legacy-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.legacy-tbl-wrap {
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.legacy-tbl-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.legacy-tbl-wrap th,
.legacy-tbl-wrap td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  font-size: 0.9rem;
}

.legacy-tbl-wrap th {
  background: #161d26;
  color: #dce2e8;
}

.legacy-login-wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

body.legacy-app.legacy-login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
  background:
    linear-gradient(rgba(11, 12, 16, 0.65), rgba(11, 12, 16, 0.65)),
    var(--login-bg-image, none) center center / cover no-repeat fixed,
    var(--bg-page, #0b0c10);
}

@media (max-width: 768px) {
  body.legacy-app.legacy-login-page {
    background-attachment: scroll, scroll, scroll;
  }
}

.legacy-login-card {
  width: 100%;
  max-width: 560px;
  background: var(--bg-card, #12161c);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  backdrop-filter: blur(2px);
}

.legacy-login-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  text-align: left;
  background: linear-gradient(135deg, var(--header-grad-start) 0%, var(--header-grad-end) 70%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.legacy-login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legacy-login-brand img {
  height: 48px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.legacy-login-brand-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text, #e8e8e8);
}

.legacy-login-body {
  padding: 22px;
}

.legacy-login-brand-sub {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 0.15rem;
}

.legacy-login-heading {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text, #e8e8e8);
}

.legacy-login-sub {
  margin: 0 0 1.15rem;
  color: var(--muted, #9aa0a6);
  font-size: 0.95rem;
}

.legacy-login-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.legacy-login-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 700;
  color: #e0e0e0;
  font-size: 0.92rem;
}

.legacy-login-field input[type="email"],
.legacy-login-field input[type="password"],
.legacy-login-field input[type="text"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #1e2430;
  color: #f5f5f5;
  font-size: 1rem;
}

.legacy-login-field input:focus {
  outline: none;
  border-color: var(--accent, #ffb612);
}

.legacy-login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.legacy-login-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-weight: 500;
  color: #e0e0e0;
  cursor: pointer;
  user-select: none;
}

.legacy-login-remember input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent, #ffb612);
  cursor: pointer;
}

.legacy-login-forgot {
  color: var(--accent, #ffb612);
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 600;
}

.legacy-login-forgot:hover {
  text-decoration: underline;
}

.legacy-login-submit {
  width: 100%;
  margin-top: 0.25rem;
}

.legacy-nav-wallet {
  margin: 0.75rem 1rem 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.legacy-nav-wallet .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.legacy-nav-wallet .credits {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}

.legacy-search-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.legacy-search-bar input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.legacy-filters {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.legacy-filters .group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.legacy-filters label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.legacy-filters input,
.legacy-filters select {
  background: #0f141a;
  color: #eaeaea;
  border: 1px solid #2a2f36;
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  min-width: 200px;
}

.legacy-filter-clear {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
  padding: 0.55rem 0.2rem;
  font-size: 0.9rem;
}

.legacy-entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.legacy-entity-wrap {
  position: relative;
}

.legacy-entity-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.legacy-entity-card .legacy-entity {
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: .85rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  min-height: 92px;
}

.legacy-entity-body {
  flex: 1;
  min-width: 0;
}

.legacy-entity-edit {
  position: absolute;
  top: .65rem;
  right: .65rem;
  font-size: .78rem;
  color: var(--muted);
  text-decoration: none;
  padding: .15rem .35rem;
  z-index: 2;
}

.legacy-entity-edit:hover {
  color: #fff;
}

.legacy-entity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.legacy-entity:hover {
  background: rgba(255, 255, 255, 0.06);
}

.legacy-entity-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.legacy-entity-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #111;
  font-weight: 800;
  border-radius: 8px;
}

.legacy-entity-name {
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.legacy-entity-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.legacy-entity-badge {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 182, 18, 0.18);
  color: var(--secondary, #ffb612);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.legacy-personnel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.legacy-personnel-card {
  display: block;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s, border-color 0.2s;
}

.legacy-personnel-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--primary);
}

.legacy-personnel-card .name {
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.legacy-personnel-card .meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.legacy-personnel-card .badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--primary);
  color: #111;
  font-size: 0.7rem;
  font-weight: 700;
}

.personnel-card-wrap {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.personnel-card {
  width: 360px;
  min-height: 640px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  border: 5px solid var(--card-primary, var(--primary));
  background: #ececec var(--card-bg, none) center / cover no-repeat;
  display: flex;
  flex-direction: column;
  color: #111;
}

.personnel-card-header {
  background: var(--card-primary, var(--primary));
  color: #fff;
  text-align: center;
  padding: 1rem;
}

.personnel-card-logo {
  height: 48px;
  margin-bottom: 0.5rem;
}

.personnel-card-role {
  font-weight: 800;
  letter-spacing: 0.08em;
}

.personnel-card-body {
  padding: 1.25rem;
  text-align: center;
  flex: 1;
}

.personnel-card-photo img,
.personnel-card-photo-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.08);
  font-size: 2rem;
  font-weight: 900;
}

.personnel-card-name {
  font-size: 1.35rem;
  font-weight: 900;
  text-transform: uppercase;
}

.personnel-card-org {
  margin-top: 0.35rem;
  color: #444;
}

.personnel-card-fields {
  margin: 1rem 0 0;
  text-align: left;
  font-size: 0.85rem;
}

.personnel-card-fields div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.personnel-card-fields dt {
  font-weight: 700;
  margin: 0;
}

.personnel-card-fields dd {
  margin: 0;
}

.personnel-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.06);
}

.personnel-card-season {
  font-weight: 800;
}

.personnel-card-gender span {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #999;
  font-size: 0.75rem;
  margin-left: 0.25rem;
  opacity: 0.35;
}

.personnel-card-gender span.active {
  background: var(--card-primary, var(--primary));
  color: #fff;
  border-color: transparent;
  opacity: 1;
}

.personnel-card-qr {
  width: 56px;
  height: 56px;
}

@media print {
  .personnel-card-actions,
  .legacy-sidebar {
    display: none !important;
  }

  .legacy-main {
    margin: 0;
    width: 100%;
  }
}

.legacy-nav-toggle {
  display: none;
}

.legacy-nav-overlay {
  display: none;
}

@media (max-width: 900px) {
  .legacy-nav-toggle {
    display: block;
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    margin: 0;
    padding: 0.85rem 1rem;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: var(--bg-card);
    color: var(--text);
    font-weight: 700;
    text-align: left;
    cursor: pointer;
  }

  .legacy-nav-overlay.is-visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 35;
  }

  .legacy-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(88vw, 320px);
    height: 100vh;
    height: 100dvh;
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .legacy-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0,0,0,0.45);
  }

  .legacy-main {
    margin-left: 0;
    width: 100%;
    padding: 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  body.legacy-app {
    flex-direction: column;
  }

  .legacy-card-header,
  .legacy-panel-header {
    padding: 1rem 1.25rem;
  }

  .legacy-card-header h1,
  .legacy-panel-header h2 {
    font-size: 1.35rem;
  }

  .legacy-card-body,
  .legacy-panel-body {
    padding: 1.25rem;
  }

  .legacy-stats {
    grid-template-columns: 1fr;
  }

  .legacy-stat .value {
    font-size: 1.75rem;
  }

  .legacy-form-grid {
    grid-template-columns: 1fr;
  }

  .legacy-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .legacy-filters .group,
  .legacy-filters input,
  .legacy-filters select {
    min-width: 0;
    width: 100%;
  }

  .legacy-search-bar {
    flex-direction: column;
  }

  .legacy-search-bar input {
    min-width: 0;
    width: 100%;
  }

  .legacy-action-row,
  .legacy-inline-transfer {
    flex-direction: column;
    align-items: stretch !important;
  }

  .legacy-inline-transfer input[type="number"] {
    width: 100% !important;
  }

  .legacy-entity-grid {
    grid-template-columns: 1fr;
  }

  .legacy-quick-actions {
    flex-direction: column;
  }

  .legacy-quick-actions .legacy-btn,
  .card-page-download a,
  .legacy-btn {
    width: 100%;
    margin: 0.35rem 0 !important;
    text-align: center;
  }

  .legacy-tbl-wrap {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .legacy-tbl-wrap table {
    min-width: 520px;
  }

  .legacy-tbl-wrap td[style*="white-space:nowrap"] {
    white-space: normal !important;
  }

  .legacy-modal {
    width: 100%;
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
  }

  .legacy-modal-backdrop {
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  }
}

.legacy-action-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.legacy-inline-transfer {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.legacy-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

body.legacy-nav-open,
body.legacy-modal-open {
  overflow: hidden;
}

.legacy-modal-backdrop[hidden] {
  display: none !important;
}

.legacy-modal {
  width: min(100%, 480px);
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}

.legacy-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--header-grad-start) 0%, var(--header-grad-end) 70%);
}

.legacy-modal-body {
  padding: 1.25rem;
}

.legacy-modal-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.legacy-autocomplete {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.35rem 0;
  max-height: 240px;
  overflow-y: auto;
}

.legacy-autocomplete-item {
  display: block;
  padding: 0.55rem 0.85rem;
  color: #fff;
  text-decoration: none;
}

.legacy-autocomplete-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Competition hub / leagues elevation — dark-theme safe, matches legacy Competition Hub look */

.comp-crumb {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted, #9aa0a6);
}

.comp-crumb a {
  color: var(--accent, #ffb612);
  text-decoration: none;
}

.comp-crumb a:hover {
  text-decoration: underline;
}

.comp-page-title {
  margin: 0 0 0.35rem;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text, #e8e8e8);
}

.comp-sub {
  color: var(--muted, #9aa0a6);
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

.comp-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 1.25rem;
  list-style: none;
  padding: 0;
}

.comp-tab {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text, #e8e8e8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.comp-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent, #ffb612);
  color: #fff;
}

.comp-tab.is-active {
  background: var(--primary, #114477);
  border-color: var(--primary, #114477);
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.45);
}

.comp-card {
  background: var(--bg-card, #12161c);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  margin-bottom: 1.5rem;
}

.comp-card-header {
  padding: 1.1rem 1.5rem;
  background: linear-gradient(135deg, var(--header-grad-start) 0%, var(--header-grad-end) 70%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--primary, #114477);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.comp-card-header h2,
.comp-card-title {
  margin: 0;
  font-size: 1.15rem;
  color: #fff;
  font-weight: 800;
}

.comp-card-body {
  padding: 1.5rem;
}

.comp-stat-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1.5rem;
}

.comp-stat-grid .legacy-stat .value {
  font-size: 1.5rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #e8e8e8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  white-space: nowrap;
}

.status-chip.is-active {
  background: rgba(46, 204, 113, 0.16);
  color: #4fd88a;
  border-color: rgba(46, 204, 113, 0.35);
}

.status-chip.is-draft {
  background: rgba(241, 196, 15, 0.18);
  color: #ffd75e;
  border-color: rgba(241, 196, 15, 0.35);
}

.status-chip.is-archived {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted, #9aa0a6);
  border-color: rgba(255, 255, 255, 0.14);
}

.status-chip.is-inactive {
  background: rgba(231, 76, 60, 0.14);
  color: #ff8a80;
  border-color: rgba(231, 76, 60, 0.32);
}

.users-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.users-toolbar .group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.users-toolbar label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.users-toolbar input,
.users-toolbar select {
  background: #0f141a;
  color: #eaeaea;
  border: 1px solid #2a2f36;
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  min-width: 180px;
}

.users-toolbar input[type="checkbox"] {
  width: auto;
  min-width: 0;
}

.comp-card-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.standings-table th,
.standings-table td {
  text-align: center;
}

.standings-table td:first-child,
.standings-table th:first-child,
.standings-table td:nth-child(2),
.standings-table th:nth-child(2) {
  text-align: left;
}

.legacy-pager {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.legacy-pager__btn {
  margin-top: 0;
  min-width: 6.5rem;
  justify-content: center;
  text-align: center;
}

.legacy-pager__btn.is-disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.legacy-pager__meta {
  align-self: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.legacy-pager svg {
  width: 1rem;
  height: 1rem;
  max-width: 1rem;
  max-height: 1rem;
}

.branding-page .branding-lead {
  color: var(--muted);
  max-width: 42rem;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.branding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.branding-panel {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.03), rgba(15, 23, 42, 0.01));
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
}

.branding-panel__title {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.branding-label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.branding-select,
.branding-file {
  width: 100%;
  max-width: 100%;
}

.branding-select {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #fff;
}

.branding-hint {
  margin: 0.65rem 0 1.1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.branding-submit {
  margin-top: 0;
}

.branding-target-fixed {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.branding-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.06);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.branding-preview {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed rgba(15, 23, 42, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
}

.branding-preview img {
  max-height: 64px;
  max-width: 180px;
  object-fit: contain;
}

.topup-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.4rem 0 0.65rem;
}

.topup-preset {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #e8e8e8);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-width: 3.6rem;
}

.topup-preset:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.topup-preset.is-selected {
  border-color: var(--accent, #38bdf8);
  background: rgba(56, 189, 248, 0.16);
  color: var(--accent, #38bdf8);
}

@media (max-width: 768px) {
  .comp-tabs {
    gap: 4px;
  }

  .comp-card-header {
    padding: 1rem 1.25rem;
  }

  .comp-stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .users-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .users-toolbar .group,
  .users-toolbar input,
  .users-toolbar select {
    min-width: 0;
    width: 100%;
  }
}
