:root {
  --admin-bg: #0b1220;
  --admin-surface: #151f32;
  --admin-surface-alt: #1c2940;
  --admin-border: rgba(148, 163, 184, 0.14);
  --admin-text: #f8fafc;
  --admin-muted: #94a3b8;
  --admin-accent: #38bdf8;
  --admin-accent-strong: #0ea5e9;
  --admin-success: #22c55e;
  --admin-warning: #eab308;
  --admin-danger: #ef4444;
  --admin-radius: 14px;
  --admin-shadow: 0 18px 40px rgba(2, 6, 23, 0.35);
  --admin-sidebar-width: 248px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.admin-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Raleway", sans-serif;
  color: var(--admin-text);
  background: radial-gradient(circle at top, #172554 0%, var(--admin-bg) 42%, #020617 100%);
  -webkit-font-smoothing: antialiased;
}

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--admin-sidebar-width);
  flex-shrink: 0;
  border-right: 1px solid var(--admin-border);
  background: rgba(11, 18, 32, 0.96);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}

.admin-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--admin-border);
  text-decoration: none;
  color: inherit;
}

.admin-sidebar__logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.25);
}

.admin-sidebar__brand-text {
  min-width: 0;
}

.admin-sidebar__eyebrow {
  margin: 0 0 2px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--admin-accent);
  font-weight: 600;
}

.admin-sidebar__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.admin-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px;
}

.admin-nav-section {
  margin-bottom: 18px;
}

.admin-nav-section__label {
  display: block;
  padding: 0 10px 8px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--admin-muted);
  font-weight: 700;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 10px;
  color: var(--admin-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
}

.admin-nav-link i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: var(--admin-accent);
}

.admin-nav-link:hover {
  background: rgba(56, 189, 248, 0.08);
  color: var(--admin-text);
  text-decoration: none;
}

.admin-nav-link.is-active {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.22);
  color: var(--admin-text);
}

.admin-nav-link--danger i {
  color: #fca5a5;
}

.admin-nav-link--danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.admin-sidebar__footer {
  padding: 14px 10px 18px;
  border-top: 1px solid var(--admin-border);
}

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--admin-border);
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.admin-topbar__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.admin-menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--admin-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--admin-text);
  cursor: pointer;
}

.admin-content {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.admin-flash-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.admin-alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  background: rgba(56, 189, 248, 0.1);
  color: #bae6fd;
}

.admin-page {
  width: 100%;
}

.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.admin-page-header__main {
  min-width: 0;
}

.admin-page-header__eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--admin-accent);
  font-weight: 600;
}

.admin-page-header__title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
}

.admin-page-header__meta {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--admin-muted);
}

.admin-page-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-panel {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: linear-gradient(180deg, rgba(28, 41, 64, 0.72), rgba(21, 31, 50, 0.88));
  box-shadow: var(--admin-shadow);
  overflow: hidden;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-shell .table,
.admin-shell table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  color: var(--admin-text);
  background: transparent;
}

.admin-shell .table thead th,
.admin-shell .table thead td,
.admin-shell table thead th,
.admin-shell table thead td {
  padding: 12px 14px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--admin-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--admin-border);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
}

.admin-shell .table tbody td,
.admin-shell .table tbody th,
.admin-shell table tbody td,
.admin-shell table tbody th {
  padding: 14px;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
  font-size: 14px;
}

.admin-shell .table tbody tr:last-child td,
.admin-shell table tbody tr:last-child td {
  border-bottom: none;
}

.admin-shell .table tbody tr:hover td,
.admin-shell table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.admin-shell .text-center {
  text-align: center !important;
}

.admin-cell-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-cell-stack__primary {
  font-weight: 600;
}

.admin-cell-stack__secondary {
  font-size: 13px;
  color: var(--admin-muted);
}

.admin-cell-stack__highlight {
  font-weight: 700;
  color: var(--admin-accent);
}

.admin-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.admin-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--admin-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--admin-accent);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.admin-icon-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.28);
  color: #e0f2fe;
  text-decoration: none;
}

.admin-icon-btn--danger {
  color: #fca5a5;
}

.admin-icon-btn--danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.28);
}

.admin-icon-btn .fas,
.admin-icon-btn .fa {
  font-size: 14px !important;
}

.admin-shell .form-control,
.admin-shell select,
.admin-shell input[type="text"],
.admin-shell input[type="number"],
.admin-shell input[type="email"],
.admin-shell input[type="datetime-local"],
.admin-shell input[type="password"],
.admin-shell textarea {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--admin-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--admin-text);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-shell select[multiple] {
  min-height: 160px;
}

.admin-shell .form-control:focus,
.admin-shell select:focus,
.admin-shell input:focus,
.admin-shell textarea:focus {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.admin-shell .btn,
.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.admin-btn .fas,
.admin-btn .fa,
.admin-shell .btn .fas,
.admin-shell .btn .fa {
  font-size: 14px !important;
}

.admin-btn--primary,
.admin-shell .btn-primary {
  background: linear-gradient(180deg, var(--admin-accent), var(--admin-accent-strong));
  color: #04111f;
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.28);
}

.admin-btn--primary:hover,
.admin-shell .btn-primary:hover {
  transform: translateY(-1px);
  color: #04111f;
}

.admin-btn--success,
.admin-shell .btn-success {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.28);
  color: #86efac;
}

.admin-btn--ghost,
.admin-shell .btn:not(.btn-primary):not(.btn-success) {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--admin-border);
  color: var(--admin-text);
}

.admin-form-card {
  max-width: 560px;
  padding: 24px;
}

.admin-field {
  margin-bottom: 16px;
}

.admin-field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-muted);
}

.admin-field__hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--admin-muted);
}

.admin-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.admin-errors {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.28);
  color: #fde68a;
  font-size: 13px;
}

.admin-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 16px;
}

.admin-pagination .page-item {
  list-style: none;
}

.admin-pagination .page-link,
.admin-pagination .page-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--admin-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--admin-text);
  text-decoration: none;
  font-size: 13px;
}

.admin-pagination .page-item.active span,
.admin-pagination .page-item.active .page-link {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.28);
  color: #e0f2fe;
}

.admin-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-status--locked {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.admin-status--open {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.admin-status--deleted {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.admin-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--admin-muted);
}

.admin-shell .container,
.admin-shell .container-fluid {
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  position: static;
  left: auto !important;
}

.admin-shell hr {
  display: none;
}

.admin-shell .row {
  display: contents;
}

.admin-shell .delete-form,
.admin-shell form[id^="delete-form-"],
.admin-shell form[id^="lock-form-"] {
  display: inline;
}

.admin-media-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-media-row__body {
  min-width: 0;
}

.admin-crest,
.admin-player-photo {
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--admin-border);
}

.admin-crest--sm,
.admin-player-photo--sm {
  width: 32px;
  height: 32px;
}

.admin-crest--md,
.admin-player-photo--md {
  width: 44px;
  height: 44px;
}

.admin-crest--lg,
.admin-player-photo--lg {
  width: 72px;
  height: 72px;
}

.admin-player-photo {
  object-fit: cover;
  border-radius: 999px;
}

.admin-player-photo.is-placeholder,
.admin-player-photo.is-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--admin-accent);
  background: rgba(56, 189, 248, 0.12);
}

.admin-player-photo--lg.is-placeholder,
.admin-player-photo--lg.is-fallback {
  font-size: 24px;
}

.admin-image-preview {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  border: 1px solid var(--admin-border);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 10px;
}

.admin-image-preview__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-image-preview__empty {
  font-size: 11px;
  color: var(--admin-muted);
  text-align: center;
  padding: 8px;
}

.admin-form-with-preview {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 560px) {
  .admin-form-with-preview {
    grid-template-columns: 1fr;
  }
}

.admin-shell .alert-warning {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.28);
  color: #fde68a;
  border-radius: 10px;
}

.admin-shell .close {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
}

.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
  z-index: 25;
}

.admin-shell .select2-container--default .select2-selection--single,
.admin-shell .select2-container--default .select2-selection--multiple {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--admin-border);
  background: rgba(255, 255, 255, 0.04);
}

.admin-shell .select2-container--default .select2-selection--multiple .select2-selection__choice {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #e0f2fe;
}

.admin-shell .select2-dropdown {
  background: var(--admin-surface-alt);
  border-color: var(--admin-border);
  color: var(--admin-text);
}

.admin-shell .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: rgba(56, 189, 248, 0.2);
  color: var(--admin-text);
}

@media (max-width: 960px) {
  .admin-topbar {
    display: flex;
  }

  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .admin-sidebar.is-open {
    transform: translateX(0);
  }

  .admin-overlay.is-visible {
    display: block;
  }

  .admin-content {
    padding: 16px;
  }

  .admin-page-header__title {
    font-size: 22px;
  }
}

@media (min-width: 961px) {
  .admin-overlay {
    display: none !important;
  }
}
