/* ==============================================================================
   RESCUE CUP - BACKOFFICE CSS STYLESHEET
   Clean, Modern Sports Administration Panel
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Montserrat:wght@600;700;800;900&display=swap');

:root {
  --admin-bg: #070c18;
  --admin-sidebar: #040812;
  --admin-card: #0c1424;
  --admin-card-elevated: #111b30;
  --admin-card-border: rgba(255, 255, 255, 0.08);
  --admin-accent: #0096ff;
  --admin-accent-glow: rgba(0, 150, 255, 0.25);
  --admin-amber: #f59e0b;
  --admin-emerald: #10b981;
  --admin-red: #ef4444;
  --admin-purple: #8b5cf6;
  --admin-text: #f8fafc;
  --admin-muted: #94a3b8;
  --admin-dim: #64748b;
  --admin-input-bg: #060b14;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.7);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--admin-sidebar);
  border-right: 1px solid var(--admin-card-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 22px 20px;
  border-bottom: 1px solid var(--admin-card-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 38px;
  height: 38px;
}

.sidebar-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
  color: #fff;
  letter-spacing: 0.5px;
}

.sidebar-badge {
  font-size: 10px;
  font-weight: 800;
  color: var(--admin-amber);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
}

.sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.sidebar-btn.active {
  background: rgba(0, 150, 255, 0.1);
  color: var(--admin-accent);
  font-weight: 700;
  border-left: 3px solid var(--admin-accent);
}

.sidebar-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--admin-card-border);
}

.btn-back-site {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--admin-card-border);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.btn-back-site:hover {
  background: rgba(0, 150, 255, 0.15);
  border-color: var(--admin-accent);
  color: var(--admin-accent);
}

/* Main Content Area */
.admin-main {
  margin-left: 260px;
  flex: 1;
  padding: 28px 36px 60px;
  max-width: 1400px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--admin-card-border);
}

.page-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.page-sub {
  font-size: 13px;
  color: var(--admin-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Stat Cards (Cleaner & more compact) */
.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-card-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-family: 'Montserrat', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  margin: 6px 0;
}

.stat-desc {
  font-size: 11px;
  color: var(--admin-dim);
}

/* Content Panels */
.tab-content-panel {
  display: none;
}

.tab-content-panel.active {
  display: block;
}

.admin-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.card-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--admin-card-border);
}

.card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Filter controls bar inside cards */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Filter Tab Pills */
.pill-tabs {
  display: flex;
  gap: 8px;
  background: rgba(0,0,0,0.3);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-card-border);
}

.pill-tab-btn {
  background: transparent;
  border: none;
  color: var(--admin-muted);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-tab-btn.active {
  background: var(--admin-accent);
  color: #040812;
  font-weight: 800;
}

/* Tables in Admin */
.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background: rgba(0, 0, 0, 0.35);
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: var(--admin-dim);
  text-transform: uppercase;
  padding: 12px 14px;
  border-bottom: 1px solid var(--admin-card-border);
}

.admin-table td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--admin-card-border);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Action Buttons */
.btn-sm-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--admin-card-border);
  color: #fff;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sm-action:hover {
  background: rgba(0, 150, 255, 0.15);
  border-color: var(--admin-accent);
  color: var(--admin-accent);
}

.btn-sm-action.btn-primary {
  background: var(--admin-accent);
  border-color: var(--admin-accent);
  color: #040812;
  font-weight: 800;
}
.btn-sm-action.btn-primary:hover {
  background: #38bdf8;
  box-shadow: 0 0 15px var(--admin-accent-glow);
}

.btn-sm-danger {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-sm-danger:hover {
  background: var(--admin-red);
  color: #fff;
}

/* Form Controls in Backoffice */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--admin-muted);
  letter-spacing: 0.5px;
}

.form-input, .form-select, .form-textarea {
  background: var(--admin-input-bg);
  border: 1px solid var(--admin-card-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: 0 0 10px rgba(0, 150, 255, 0.2);
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.input-color {
  width: 44px;
  height: 38px;
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-card-border);
  background: var(--admin-input-bg);
  cursor: pointer;
}

.team-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  vertical-align: middle;
  margin-right: 4px;
}

/* ==============================================================================
   TRUE MODAL OVERLAYS (Floating centered dialogs with dark blur backdrop)
   ============================================================================== */
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none !important;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}

.modal-overlay.active {
  display: flex !important;
}

.modal-dialog {
  background: var(--admin-card-elevated);
  border: 1px solid rgba(0, 150, 255, 0.35);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.95), 0 0 30px var(--admin-accent-glow);
  position: relative;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--admin-card-border);
  background: rgba(0, 0, 0, 0.4);
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--admin-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: var(--admin-red);
  color: #fff;
  border-color: var(--admin-red);
}

.modal-body {
  padding: 24px;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Toast Alerts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
}

.toast {
  background: #0f172a;
  border: 1px solid var(--admin-accent);
  border-left: 4px solid var(--admin-accent);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease;
}

.toast.success {
  border-color: var(--admin-emerald);
  border-left-color: var(--admin-emerald);
}

.toast.error {
  border-color: var(--admin-red);
  border-left-color: var(--admin-red);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 1024px) {
  .admin-sidebar {
    width: 70px;
  }
  .sidebar-title, .sidebar-badge, .sidebar-btn span, .btn-back-site span {
    display: none;
  }
  .admin-main {
    margin-left: 70px;
    padding: 20px;
  }
  .admin-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
