/* ============================================
   Admin Panel Styles
   ============================================ */

/* Body */
.admin-body {
  background: #f5f5f5;
  margin: 0;
}

/* Login */
.admin-login {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1714;
  padding: 20px;
}

.admin-login__card {
  background: #fff;
  border: 1px solid var(--line, #d8d5ce);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.admin-login__logo {
  margin-bottom: 16px;
  max-width: 80px;
  height: auto;
}

.admin-login__title {
  font-family: var(--head, 'Roboto Slab', serif);
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 24px;
  color: #1a1714;
}

.admin-login__btn {
  width: 100%;
  margin-top: 8px;
}

.admin-login__form label {
  font-family: var(--condensed, 'Oswald', sans-serif);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted, #68635f);
  display: block;
  margin-bottom: 6px;
  text-align: left;
}

.admin-login__form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line, #d8d5ce);
  border-radius: 6px;
  font-size: 14px;
  font-family: var(--body, 'Inter', sans-serif);
}

.admin-login__form input:focus {
  outline: none;
  border-color: var(--lime, #D30A58);
}

.admin-login__error {
  color: #ef4444;
  font-size: 12px;
  margin-top: 12px;
}

/* Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 240px;
  background: #1a1714;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  transition: transform .3s;
}

.admin-sidebar__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.admin-sidebar__header img {
  border-radius: 4px;
}

.admin-sidebar__header span {
  font-family: var(--head);
  font-weight: 900;
  font-size: 14px;
  text-transform: uppercase;
}

.admin-sidebar__nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.admin-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  font-family: var(--condensed);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color .2s, background .2s;
  text-align: left;
}

.admin-sidebar__link:hover {
  color: #fff;
  background: rgba(255,255,255,.05);
}

.admin-sidebar__link--active {
  color: #fff;
  background: rgba(255,255,255,.1);
  border-left: 3px solid var(--lime);
}

.admin-sidebar__footer {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 12px 0;
}

/* Main */
.admin-main {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-header__burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--ink);
}

.admin-header__title {
  font-family: var(--head);
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-header__actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.admin-content {
  flex: 1;
  padding: 24px;
}

/* Stats */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.admin-stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.admin-stat-card__value {
  font-family: var(--head);
  font-size: 32px;
  font-weight: 900;
  color: var(--lime);
  display: block;
}

.admin-stat-card__label {
  font-family: var(--condensed);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

/* Table */
.admin-table-wrapper {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.admin-table th {
  font-family: var(--condensed);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}

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

.admin-table tr:hover td {
  background: #fafafa;
}

.admin-table__partner-row td {
  background: #f9fafb;
  border-top: 1px dashed #e5e7eb;
  padding-top: 6px;
  padding-bottom: 6px;
}

/* Buttons */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-family: var(--condensed);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.admin-btn:hover {
  background: #f5f5f5;
}

.admin-btn--primary {
  background: var(--lime);
  color: #fff;
  border-color: var(--lime);
}

.admin-btn--primary:hover {
  background: var(--lime-hot);
}

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

.admin-btn--danger:hover {
  background: #fef2f2;
}

.admin-btn--success {
  color: #10b981;
  border-color: #a7f3d0;
}

.admin-btn--success:hover {
  background: #ecfdf5;
}

.admin-btn--sm {
  padding: 4px 8px;
  font-size: 10px;
}

/* Forms */
.admin-form-group {
  margin-bottom: 16px;
  text-align: left;
}

.admin-form-group label {
  display: block;
  font-family: var(--condensed);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.admin-input,
.admin-select,
.admin-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--inter);
  font-size: 13px;
  background: #fff;
  transition: border-color .2s;
}

.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
  outline: none;
  border-color: var(--lime);
}

.admin-textarea {
  min-height: 80px;
  resize: vertical;
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.admin-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Filters */
.admin-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-select {
  width: auto;
  min-width: 160px;
}

/* Status Badge */
.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--condensed);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-badge--active { background: #d1fae5; color: #065f46; }
.admin-badge--inactive { background: #fee2e2; color: #991b1b; }
.admin-badge--draft { background: #e5e7eb; color: #374151; }
.admin-badge--locked { background: #dbeafe; color: #1e40af; }
.admin-badge--in_progress { background: #d1fae5; color: #065f46; }
.admin-badge--completed { background: #fce7f3; color: #9d174d; }
.admin-badge--scheduled { background: #fef3c7; color: #92400e; }
.admin-badge--walkover { background: #f3e8ff; color: #6b21a8; }

/* Modal */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
}

.admin-modal__content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.admin-modal__title {
  font-family: var(--head);
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* Toast */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1a1714;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 2000;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.admin-toast--success { border-left: 4px solid #10b981; }
.admin-toast--error { border-left: 4px solid #ef4444; }
.admin-toast--info { border-left: 4px solid #3b82f6; display: flex; align-items: center; gap: 12px; }
.admin-toast__undo {
  background: #fff;
  color: #1a1714;
  border: none;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.admin-toast__undo:hover { background: #f0f0f0; }

/* Empty State */
.admin-empty {
  text-align: center;
  padding: 40px;
  color: var(--muted);
  font-size: 13px;
}

/* Sidebar overlay for mobile */
.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
}
.admin-sidebar-overlay.is-open {
  display: block;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 820px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }

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

  .admin-main {
    margin-left: 0;
  }

  .admin-header__burger {
    display: block;
  }

  .admin-content {
    padding: 16px;
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-filters {
    flex-direction: column;
  }

  .admin-select {
    width: 100%;
  }
}

@media (max-width: 580px) {
  .admin-login__card {
    padding: 24px;
  }

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

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

  .admin-table {
    font-size: 12px;
    min-width: 600px;
  }

  .admin-table th,
  .admin-table td {
    padding: 8px 10px;
  }

  .admin-header {
    padding: 12px 16px;
  }

  .admin-header__title {
    font-size: 14px;
  }

  .admin-header__actions .admin-btn {
    padding: 4px 8px;
    font-size: 10px;
  }

  .admin-modal__content {
    padding: 16px;
    max-width: 100%;
    margin: 0 8px;
  }

  .admin-modal__title {
    font-size: 14px;
  }

  .admin-quick-player {
    min-width: 100px;
    padding: 12px 16px;
  }

  .admin-quick-player__name {
    font-size: 13px;
  }

  .admin-btn--sm {
    padding: 3px 6px;
    font-size: 9px;
  }

  .admin-form-actions {
    flex-wrap: wrap;
  }

  .admin-toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
}

/* ---- Quick Match Modal ---- */
.admin-quick-match {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.admin-quick-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
  border: 2px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: all .2s;
  min-width: 140px;
  font-family: inherit;
}

.admin-quick-player:hover {
  border-color: #999;
  background: #fafafa;
}

.admin-quick-player--winner {
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
}

.admin-quick-player__name {
  font-weight: 700;
  font-size: 15px;
  color: #1a1714;
}

.admin-quick-player__badge {
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: #10b981;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: .5px;
}

.admin-quick-vs {
  font-weight: 800;
  font-size: 14px;
  color: #aaa;
}

.admin-label-bold {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin: 12px 0 6px;
  color: #1a1714;
}

.admin-match-row--pending { opacity: .7; }
.admin-match-row--in_progress { background: #fefce8; }
.admin-match-winner { color: #10b981; font-weight: 700; }
.admin-match-class {
  font-size: 11px;
  font-weight: 700;
  color: #666;
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ============================================
   CONFIG SECTION
   ============================================ */
.admin-config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.admin-config-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.admin-config-card__title {
  font-family: var(--head);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  margin: 0 0 16px;
  color: var(--ink);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

/* ============================================
   RESPONSIVE - CONFIG
   ============================================ */
@media (max-width: 820px) {
  .admin-config-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .admin-config-card {
    padding: 16px;
  }

  .admin-config-card__title {
    font-size: 13px;
  }
}
