/* ═══════════════════════════════════════════════════════════
   QUINIELA CORPORATIVA – Design System
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ─────────────────────────────── */
:root {
  /* Primary palette – Deep emerald / gold */
  --primary-50:  #ecfdf5;
  --primary-100: #d1fae5;
  --primary-200: #a7f3d0;
  --primary-300: #6ee7b7;
  --primary-400: #34d399;
  --primary-500: #10b981;
  --primary-600: #059669;
  --primary-700: #047857;
  --primary-800: #065f46;
  --primary-900: #064e3b;

  /* Accent – Warm gold */
  --accent-400: #fbbf24;
  --accent-500: #f59e0b;
  --accent-600: #d97706;

  /* Surface / Background */
  --bg-base:     #0a0f1a;
  --bg-surface:  #111827;
  --bg-card:     #1f2937;
  --bg-elevated: #374151;
  --bg-glass:    rgba(31, 41, 55, 0.6);

  /* Text */
  --text-primary:   #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted:     #6b7280;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);

  /* Status */
  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #3b82f6;
  --live:    #ef4444;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Font */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;
}

/* ── Reset / Base ──────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 80% 50%, rgba(59, 130, 246, 0.04), transparent);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--primary-400);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-300);
}

img {
  max-width: 100%;
  height: auto;
}

/* ── Layout ────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-base);
}

.sidebar-brand {
  padding: var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
}

.company-logo {
  display: block;
  width: auto;
  object-fit: contain;
}

.sidebar-company-logo {
  max-width: 132px;
  max-height: 56px;
  margin: 0 auto var(--space-md);
  background: #fff;
  border-radius: var(--radius-md);
  padding: 8px 10px;
}

.sidebar-brand h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-400), var(--accent-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.sidebar-brand .brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-xs);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-lg) var(--space-md);
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: var(--space-md) var(--space-sm) var(--space-sm);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
  color: var(--primary-400);
  font-weight: 600;
}

.nav-link .nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-600), var(--primary-400));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: var(--space-2xl);
  min-width: 0;
}

/* ── Page Header ───────────────────────────────────────── */
.page-header {
  margin-bottom: var(--space-2xl);
}

.page-header h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header .page-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: var(--space-xs);
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.card-body {
  padding: var(--space-xl);
}

/* ── Stat Cards ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--stat-color, var(--primary-500)), transparent);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--space-xs);
}

.stat-card.highlight {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(245, 158, 11, 0.05));
  border-color: rgba(16, 185, 129, 0.2);
}

.stat-card.highlight .stat-value {
  background: linear-gradient(135deg, var(--primary-400), var(--accent-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Match Cards ───────────────────────────────────────── */
.matches-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-base);
}

.match-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.match-card.live {
  border-color: rgba(239, 68, 68, 0.3);
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(239, 68, 68, 0.3); }
  50% { border-color: rgba(239, 68, 68, 0.6); }
}

.match-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.match-phase {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-400);
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.match-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-lg);
  text-align: center;
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.team-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.team-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.match-score {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
}

.score-num {
  font-size: 1.75rem;
  font-weight: 800;
  min-width: 32px;
  text-align: center;
}

.score-separator {
  font-size: 1.25rem;
  color: var(--text-muted);
  font-weight: 300;
}

.score-vs {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.match-prediction {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  font-size: 0.85rem;
}

.match-prediction .pred-label {
  color: var(--text-muted);
}

.match-prediction .pred-score {
  font-weight: 700;
  color: var(--text-primary);
}

.match-prediction .pred-points {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.8rem;
}

.pred-points.pts-3 {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.pred-points.pts-1 {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.pred-points.pts-0 {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-muted);
}

/* ── Live badge ────────────────────────────────────────── */
.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(239, 68, 68, 0.15);
  color: var(--live);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--live);
  border-radius: 50%;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.badge-finished {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(107, 114, 128, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* ── Leaderboard ───────────────────────────────────────── */
.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
}

.leaderboard-table th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
}

.leaderboard-table td {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9rem;
}

.leaderboard-table tbody tr {
  background: var(--bg-card);
  transition: all var(--transition-fast);
}

.leaderboard-table tbody tr:hover {
  background: var(--bg-elevated);
}

.leaderboard-table tbody tr td:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.leaderboard-table tbody tr td:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.8rem;
}

.rank-1 {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1a1a1a;
}

.rank-2 {
  background: linear-gradient(135deg, #94a3b8, #cbd5e1);
  color: #1a1a1a;
}

.rank-3 {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
}

.rank-other {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.points-value {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--primary-400);
}

.is-current-user {
  background: rgba(16, 185, 129, 0.08) !important;
  border-left: 3px solid var(--primary-500);
}

/* ── Prediction Form ───────────────────────────────────── */
.pred-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  transition: all var(--transition-base);
}

.pred-form-card:hover {
  border-color: var(--border-medium);
}

.pred-form-card.has-prediction {
  border-color: rgba(16, 185, 129, 0.2);
}

.journey-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.journey-tab {
  min-height: 42px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.journey-tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: var(--space-xs);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.journey-tab:hover,
.journey-tab.active {
  border-color: var(--primary-500);
  background: rgba(37, 99, 235, 0.16);
  color: var(--text-primary);
}

.journey-tab.active span {
  background: var(--primary-500);
  color: #fff;
}

.journey-panel {
  display: none;
}

.journey-panel.active {
  display: block;
}

.pred-inputs {
  display: grid;
  grid-template-columns: 1fr auto auto auto 1fr;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

.pred-input {
  width: 60px;
  height: 48px;
  background: var(--bg-surface);
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  transition: all var(--transition-fast);
  outline: none;
}

.pred-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.pred-input::placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Buttons ───────────────────────────────────────────── */
.pred-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  border-color: rgba(16, 185, 129, 0.25);
}

.confirm-lock {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  max-width: 620px;
  margin-bottom: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--radius-md);
  color: var(--warning);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
}

.confirm-lock input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-500), var(--accent-400));
  color: #1a1a1a;
  font-weight: 700;
}

.btn-accent:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-400), var(--accent-500));
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
}

.btn-sm {
  padding: 4px var(--space-md);
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

/* ── Forms ─────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.form-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.table-input {
  width: 150px;
  padding: 6px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  outline: none;
}

.table-input-wide {
  width: 210px;
}

.admin-inline-edit {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 6px;
  min-width: 440px;
}

.admin-inline-edit .table-input,
.admin-inline-edit .table-input-wide {
  width: 100%;
}

.admin-inline-edit .btn {
  grid-column: 1 / -1;
  justify-content: center;
}

.table-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* ── Flash Messages ────────────────────────────────────── */
.flash-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 400px;
}

.flash-msg {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  animation: slideIn 0.3s ease-out, fadeOut 0.5s ease-in 4.5s forwards;
  backdrop-filter: blur(12px);
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.flash-msg.success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.flash-msg.danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.flash-msg.warning {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--warning);
}

.flash-msg.info {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--info);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* ── Auth Pages ────────────────────────────────────────── */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl) var(--space-2xl);
  box-shadow: var(--shadow-xl);
}

.auth-card .auth-logo {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.auth-company-logo {
  max-width: 190px;
  max-height: 82px;
  margin: 0 auto var(--space-lg);
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 10px 14px;
}

.auth-card .auth-logo h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-400), var(--accent-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-card .auth-logo p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: var(--space-xs);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-xl);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary-400);
  font-weight: 600;
}

/* ── Admin-specific ────────────────────────────────────── */
.admin-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-2xl);
}

.admin-action-card {
  flex: 1;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  transition: all var(--transition-base);
}

.admin-action-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.admin-action-card .action-icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.admin-action-card h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.admin-action-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.admin-match-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr)) auto;
  gap: var(--space-md);
  align-items: end;
}

.admin-match-form .form-group {
  margin-bottom: 0;
}

.admin-match-submit {
  display: flex;
  align-items: end;
}

.manual-score-form {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 210px;
}

.manual-score-form input {
  width: 46px;
  height: 34px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  text-align: center;
  outline: none;
}

.manual-score-form input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* ── Phase Section ─────────────────────────────────────── */
.phase-section {
  margin-bottom: var(--space-2xl);
}

.phase-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-400);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ── Empty State ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  font-size: 0.9rem;
}

/* ── Grid utilities ────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

/* ── Mobile Toggle ─────────────────────────────────────── */
.mobile-toggle {
  display: none;
  position: fixed;
  top: var(--space-md);
  left: var(--space-md);
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.2rem;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .mobile-toggle {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
  }

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

  .mobile-overlay.active {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: var(--space-md);
    padding-top: 60px;
  }

  .page-header {
    margin-bottom: var(--space-lg);
  }

  .page-header h2 {
    font-size: 1.45rem;
    line-height: 1.2;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .stat-card {
    padding: var(--space-md);
  }

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

  .auth-container {
    align-items: flex-start;
    padding: var(--space-md);
  }

  .auth-card {
    max-width: none;
    padding: var(--space-xl) var(--space-lg);
    border-radius: var(--radius-lg);
  }

  .auth-company-logo {
    max-width: 150px;
    max-height: 66px;
  }

  .sidebar {
    width: min(84vw, 300px);
  }

  .sidebar-brand {
    padding: var(--space-lg);
  }

  .journey-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: var(--space-xs);
    scroll-snap-type: x proximity;
  }

  .journey-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .match-teams {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    text-align: center;
  }

  .match-teams .team {
    justify-content: center;
  }

  .match-score,
  .score-vs {
    justify-self: center;
  }

  .match-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  .team-logo {
    width: 34px;
    height: 34px;
  }

  .team-name {
    font-size: 0.9rem;
    max-width: min(72vw, 280px);
    white-space: normal;
  }

  .score-num {
    font-size: 1.25rem;
  }

  .pred-inputs {
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-sm);
    justify-items: center;
  }

  .pred-inputs .team {
    grid-column: 1 / -1;
    justify-self: center !important;
    text-align: center;
  }

  .pred-inputs .team:first-child {
    grid-row: 1;
  }

  .pred-inputs .team:last-child {
    grid-row: 3;
  }

  .pred-inputs input[name^="local_"] {
    grid-column: 1;
    grid-row: 2;
  }

  .pred-inputs .score-vs {
    grid-column: 2;
    grid-row: 2;
  }

  .pred-inputs input[name^="visita_"] {
    grid-column: 3;
    grid-row: 2;
  }

  .pred-input {
    width: 58px;
    height: 46px;
    font-size: 1.05rem;
  }

  .pred-form-card,
  .match-card,
  .card {
    border-radius: var(--radius-md);
  }

  .confirm-lock {
    align-items: flex-start;
    text-align: left;
  }

  .leaderboard-table {
    min-width: 720px;
  }

  .card-body[style*="overflow-x"] {
    -webkit-overflow-scrolling: touch;
  }

  .admin-inline-edit {
    min-width: 360px;
    grid-template-columns: 1fr;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }

  .mobile-toggle {
    top: var(--space-sm);
    left: var(--space-sm);
  }

  .page-header h2 {
    font-size: 1.3rem;
  }

  .auth-card {
    padding: var(--space-lg);
  }

  .form-input {
    font-size: 16px;
  }

  .journey-tab {
    min-height: 40px;
    padding: var(--space-sm);
  }

  .phase-title {
    font-size: 1rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .pred-form-card {
    padding: var(--space-md);
  }

  .btn-lg,
  .btn-block {
    width: 100%;
    justify-content: center;
  }

  .flash-container {
    left: var(--space-sm);
    right: var(--space-sm);
    max-width: none;
  }
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Misc utilities ────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: var(--space-md); }
.mt-2 { margin-top: var(--space-xl); }
.mb-1 { margin-top: var(--space-md); }
.mb-2 { margin-bottom: var(--space-xl); }
.fw-bold { font-weight: 700; }

.hidden { display: none !important; }
