/* ========================================
   Admin panel components
   ======================================== */

/* Admin layout — wider content area */
.page-layout > .main > .content.-admin {
  max-width: 100%;
  padding: 2rem 2.5rem;
}

/* Page toolbar — icon + title + action button in one row */
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.admin-toolbar > .icon {
  color: var(--green);
  flex-shrink: 0;
}

.admin-toolbar > .info {
  flex: 1;
}

.admin-toolbar > .info > .title {
  font-size: 1.375rem;
  font-weight: 700;
}

.admin-toolbar > .info > .subtitle {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-top: 0.25rem;
}

/* Filter bar — tabs + search on same row */
.admin-filter-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-filter-bar > .stage-tabs {
  margin-bottom: 0;
}

.admin-filter-bar > .admin-search {
  margin-bottom: 0;
  margin-left: auto;
}

/* Search bar */
.admin-search {
  margin-bottom: 1rem;
}

.admin-search > .input {
  width: 100%;
  max-width: 320px;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 0.875rem;
}

.admin-search > .input:focus {
  outline: none;
  border-color: var(--green);
}

.admin-search {
  position: relative;
}

.admin-search > .icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
}

/* Table */
.admin-table {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.admin-table > table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  padding: 0.75rem 1rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 150ms;
}

.admin-table th:hover {
  color: var(--text-1);
}

.admin-table th.-right,
.admin-table td.-right {
  text-align: right;
}

.admin-table td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

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

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

/* Cell with actions */
.admin-table .actions-cell {
  display: flex;
  gap: 0.375rem;
  justify-content: flex-end;
}

/* Admin form — full width, transparent */
.admin-form {
  max-width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(8px);
}

/* Two-column grid for form fields */
.admin-form .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.admin-form .field {
  margin-bottom: 1.25rem;
}

.admin-form .field > .label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.375rem;
}

.admin-form .field > .input,
.admin-form .field > select.input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 0.9375rem;
  transition: border-color 150ms;
}

.admin-form .field > .input:focus,
.admin-form .field > select.input:focus {
  outline: none;
  border-color: var(--green);
}

.admin-form .field > select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.admin-form .field > select.input option {
  background: #131c2e;
  color: var(--text-1);
}

/* Number input spinners */
.admin-form .field > input[type="number"]::-webkit-inner-spin-button,
.admin-form .field > input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.admin-form .field > input[type="number"] {
  -moz-appearance: textfield;
}

/* Date/datetime inputs */
.admin-form .field > input[type="date"]::-webkit-calendar-picker-indicator,
.admin-form .field > input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
}

/* Score fields */
.admin-form .score-fields {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.admin-form .score-fields > .separator {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-3);
  padding-bottom: 0.625rem;
}

.admin-form .score-fields .input {
  width: 80px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
}

/* Field hints */
.admin-form .field-hint {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-bottom: 0.5rem;
}

/* Field preview (icon/image) */
.admin-form .field-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
}

.admin-form .field-preview > .preview-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
}

.admin-form .field-preview > .preview-icon > svg {
  width: 32px;
  height: 32px;
}

.admin-form .field-preview > .preview-bg {
  height: 48px;
  width: auto;
  border-radius: calc(var(--radius) - 2px);
  opacity: 0.7;
}

/* Code textarea */
.admin-form .field > .input.-code {
  font-family: var(--mono);
  font-size: 0.8125rem;
  resize: vertical;
  min-height: 80px;
}

/* File input */
.admin-form .field > .input.-file {
  padding: 0.5rem;
  cursor: pointer;
}

.admin-form .field > .input.-file::file-selector-button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  color: var(--text-2);
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  cursor: pointer;
  margin-right: 0.75rem;
  transition: all 150ms;
}

.admin-form .field > .input.-file::file-selector-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-1);
}

/* Form errors */
.admin-form .errors {
  background: var(--red-dim);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.admin-form .errors > .message {
  color: var(--red);
  font-size: 0.8125rem;
}

/* Form actions */
.admin-form .actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Shared button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 150ms;
  text-decoration: none;
}

.btn.-primary {
  background: var(--green);
  color: var(--text-inv);
}

.btn.-primary:hover {
  background: var(--green-hover);
}

.btn.-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}

.btn.-ghost:hover {
  border-color: var(--green);
  color: var(--green);
}

.btn.-sm {
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
}

.btn.-lg {
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
}

.btn.-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid transparent;
}

.btn.-danger:hover {
  background: var(--red-dim);
  border-color: var(--red-dim);
}

.btn.-icon-only {
  padding: 0.375rem;
  border-radius: var(--radius);
}

/* Status/role badges */
.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: var(--bg-hover);
  color: var(--text-2);
}

.badge.-admin { background: var(--gold-dim); color: var(--gold); }
.badge.-active { background: var(--green-dim); color: var(--green); }
.badge.-upcoming { background: var(--blue-dim); color: var(--blue); }
.badge.-finished { background: var(--bg-hover); color: var(--text-3); }
.badge.-scheduled { background: var(--gold-dim); color: var(--gold); }
.badge.-live { background: var(--red-dim); color: var(--red); }

/* Detail grid (show pages) */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.detail-grid > .detail > .label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 0.125rem;
}

.detail-grid > .detail > .value {
  font-size: 0.9375rem;
  font-weight: 600;
}

/* Admin actions row */
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Confirm modal (replaces native browser confirm) */
.confirm-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}

.confirm-modal.-open {
  display: flex;
}

.confirm-modal > .dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.confirm-modal > .dialog > .title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.confirm-modal > .dialog > .message {
  color: var(--text-2);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}

.confirm-modal > .dialog > .actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* Pagination bar */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.admin-pagination > .page-info {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-right: 0.25rem;
}

.admin-pagination > .page-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: all 150ms;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.admin-pagination > .page-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

.admin-pagination > .page-btn.-disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* Search form */
.admin-search {
  margin-bottom: 1rem;
  position: relative;
  display: flex;
  align-items: center;
}

.admin-search > .icon {
  position: absolute;
  left: 0.625rem;
  color: var(--text-3);
  pointer-events: none;
}

.admin-search > .input {
  width: 100%;
  max-width: 320px;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 0.875rem;
}

.admin-search > .input:focus {
  outline: none;
  border-color: var(--green);
}

/* Custom dropdown (replaces native select) */
.custom-dropdown {
  position: relative;
}

.custom-dropdown-trigger {
  width: 100%;
  padding: 0.625rem 2.25rem 0.625rem 0.875rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.custom-dropdown-trigger:hover,
.custom-dropdown.-open .custom-dropdown-trigger {
  border-color: var(--green);
}

.custom-dropdown-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #131c2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  max-height: 240px;
  overflow-y: auto;
  padding: 0.25rem;
}

.custom-dropdown.-open .custom-dropdown-list {
  display: block;
}

.custom-dropdown-item {
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--text-2);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 100ms;
}

.custom-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-1);
}

.custom-dropdown-item.-selected {
  background: var(--green-dim);
  color: var(--green);
}

.custom-dropdown-item.-placeholder {
  color: var(--text-3);
}

/* Scrollbar in dropdown */
.custom-dropdown-list::-webkit-scrollbar {
  width: 4px;
}

.custom-dropdown-list::-webkit-scrollbar-track {
  background: transparent;
}

.custom-dropdown-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* Custom datepicker */
.custom-datepicker {
  position: relative;
}

.custom-datepicker-trigger {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms;
  display: flex;
  align-items: center;
}

.custom-datepicker-trigger:hover,
.custom-datepicker.-open .custom-datepicker-trigger {
  border-color: var(--green);
}

.custom-datepicker-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  background: #131c2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: 1rem;
  width: 280px;
}

.custom-datepicker.-open .custom-datepicker-panel {
  display: block;
}

.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.dp-title {
  font-weight: 600;
  font-size: 0.9375rem;
}

.dp-nav {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  transition: all 100ms;
}

.dp-nav:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-1);
}

.dp-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 0.25rem;
}

.dp-days-header > span {
  font-size: 0.6875rem;
  color: var(--text-3);
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.25rem;
}

.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.dp-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 100ms;
  color: var(--text-2);
}

.dp-day:hover:not(.-empty) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-1);
}

.dp-day.-empty {
  cursor: default;
}

.dp-day.-today {
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-1);
}

.dp-day.-selected {
  background: var(--green);
  color: var(--text-inv);
  font-weight: 700;
}

.dp-day.-selected:hover {
  background: var(--green-hover);
}

/* Time row */
.dp-time {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dp-time > label {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-right: 0.25rem;
}

.dp-time > span {
  color: var(--text-3);
  font-weight: 700;
}

.dp-time-input {
  width: 48px;
  padding: 0.375rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 0.9375rem;
  font-weight: 600;
  -moz-appearance: textfield;
}

.dp-time-input::-webkit-inner-spin-button,
.dp-time-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.dp-time-input:focus {
  outline: none;
  border-color: var(--green);
}

/* Stat card with icon */
.stat-card > .icon {
  color: var(--text-3);
  margin-bottom: 0.375rem;
}

/* Inline inputs in admin tables */
.admin-table .input.-sm {
  padding: 0.375rem 0.625rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 0.8125rem;
}

.admin-table .input.-sm:focus {
  outline: none;
  border-color: var(--green);
}

.admin-table .input.-sm::placeholder {
  color: var(--text-3);
}

/* League picker */
.form-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin: 1.25rem 0;
}

.league-list {
  margin-top: 0.75rem;
}

.league-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.5rem;
}

.league-option {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.625rem 0.875rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  color: var(--text-1);
  text-align: left;
  cursor: pointer;
  transition: all 150ms;
}

.league-option:hover:not(:disabled) {
  border-color: var(--green);
  background: rgba(0, 229, 176, 0.04);
}

.league-option.-selected {
  border-color: var(--green);
  background: var(--green-dim);
}

.league-option.-imported {
  opacity: 0.4;
  cursor: not-allowed;
}

.league-option .league-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.league-option .league-country {
  font-size: 0.75rem;
  color: var(--text-3);
}

.league-option .league-badge {
  font-size: 0.6875rem;
  color: var(--text-3);
  font-style: italic;
}
