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

/* ==========================================================================
   SYSTEM DESIGN TOKENS - PREMIUM MINIMALIST LIGHT THEME
   ========================================================================== */
:root {
  /* Color Palette */
  --bg-main: hsl(225, 20%, 97%);         /* Soft Premium Gray */
  --bg-sidebar: hsl(0, 0%, 100%);         /* Pure White */
  --bg-card: hsl(0, 0%, 100%);            /* Pure White */
  --bg-card-hover: hsl(225, 10%, 99%);
  
  --primary: hsl(252, 90%, 58%);          /* Premium Indigo / Violet */
  --primary-glow: hsla(252, 90%, 58%, 0.15);
  --team-blue: hsl(222, 90%, 52%);        /* Team Royal Blue */
  --team-blue-glow: hsla(222, 90%, 52%, 0.15);
  --secondary: hsl(190, 95%, 45%);        /* Aqua Cyan */
  --secondary-glow: hsla(190, 95%, 45%, 0.1);
  
  --text-main: hsl(225, 20%, 12%);        /* Deep Obsidian Slate */
  --text-muted: hsl(225, 8%, 52%);        /* Soft Cool Gray */
  --text-light: hsl(0, 0%, 100%);
  
  --border-light: hsl(225, 12%, 91%);     /* Ultra-soft Gray border */
  --border-active: hsl(252, 90%, 58%);
  
  /* Status Colors */
  --color-win: hsl(150, 75%, 42%);         /* Premium Emerald */
  --color-win-glow: hsla(150, 75%, 42%, 0.12);
  --color-loss: hsl(350, 80%, 55%);        /* Premium Soft Red */
  --color-loss-glow: hsla(350, 80%, 55%, 0.12);
  --color-draw: hsl(42, 90%, 50%);         /* Premium Amber */
  --color-draw-glow: hsla(42, 90%, 50%, 0.12);
  
  /* Typography */
  --font-family-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-family-title: 'Outfit', sans-serif;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(9, 12, 23, 0.03);
  --shadow-md: 0 8px 24px rgba(9, 12, 23, 0.05);
  --shadow-lg: 0 16px 40px rgba(9, 12, 23, 0.08);
  
  /* Transitions */
  --transition-smooth: all 0.35s cubic-bezier(0.215, 0.610, 0.355, 1);
  --transition-elastic: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   RESET & BASICS
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family-body);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-smooth);
}

button {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  outline: none;
}

ul {
  list-style: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: hsl(225, 10%, 85%);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ==========================================================================
   APP SHELL LAYOUT
   ========================================================================== */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Left Sidebar Navigation (Onesport Style) */
.app-sidebar {
  width: 250px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 2.2rem 1.4rem;
  flex-shrink: 0;
  z-index: 100;
  position: fixed;
  height: 100vh;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 3.2rem;
}

.brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  background: hsl(252, 90%, 97%);
  border-radius: 10px;
  padding: 5px;
}

.brand-info h1 {
  font-family: var(--font-family-title);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  color: var(--text-main);
}

.brand-info p {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-grow: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-weight: 500;
  font-family: var(--font-family-body);
  font-size: 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.nav-link svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  transition: var(--transition-smooth);
}

.nav-link:hover {
  color: var(--text-main);
  background-color: hsl(225, 10%, 97%);
}

.nav-link.active {
  color: var(--primary);
  background-color: hsl(252, 90%, 97%);
  font-weight: 600;
}

.nav-link.active svg {
  color: var(--primary);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.8rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.staff-avatar {
  width: 38px;
  height: 38px;
  background-color: hsl(252, 90%, 97%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
}

.staff-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.staff-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Content Area */
.app-main {
  flex-grow: 1;
  margin-left: 250px;
  padding: 2.5rem 3.5rem;
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   PREMIUM CARD GLASSMORPHISM & SHADOWS
   ========================================================================== */
.glass-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: hsla(252, 90%, 58%, 0.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   COMPONENTS: DASHBOARD / HOME
   ========================================================================== */
.page-section {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.page-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header {
  margin-bottom: 2.2rem;
}

.section-header h2 {
  font-family: var(--font-family-title);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin-bottom: 0.2rem;
  color: var(--text-main);
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* KPI Score Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.2rem;
}

.kpi-card {
  padding: 1.3rem 1.6rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 1.3rem;
  left: 0;
  width: 3.5px;
  height: calc(100% - 2.6rem);
  border-radius: 2px;
  background: var(--primary);
}

.kpi-card.cyan::before {
  background: var(--secondary);
}

.kpi-icon {
  position: absolute;
  right: 1.3rem;
  top: 1.3rem;
  color: var(--text-muted);
  opacity: 0.18;
  width: 40px;
  height: 40px;
}

.kpi-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.kpi-value {
  font-family: var(--font-family-title);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
  margin-bottom: 0.3rem;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Dashboard Content Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
}

.panel-span-2 {
  grid-column: span 2;
}

/* MVP Card Styles */
.mvp-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, hsl(45, 90%, 97%) 100%);
  border-left: 3px solid hsl(45, 90%, 50%);
}

.mvp-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 0.8rem;
}

.mvp-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid hsl(45, 90%, 50%);
  box-shadow: 0 4px 15px hsla(45, 90%, 50%, 0.2);
}

.mvp-name {
  font-family: var(--font-family-title);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-main);
  text-align: center;
}

.mvp-stats {
  font-size: 1.1rem;
  font-weight: 700;
  color: hsl(45, 95%, 40%);
}

/* Ranking List Styles */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex-grow: 1;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  background: hsl(225, 12%, 97%);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.ranking-rank {
  font-family: var(--font-family-title);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-muted);
  width: 20px;
  text-align: center;
}

.ranking-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.ranking-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}

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

.ranking-value {
  font-family: var(--font-family-title);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
}

.panel-card {
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  min-height: 360px;
}

.panel-title {
  font-family: var(--font-family-title);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-main);
}

.panel-title svg {
  color: var(--primary);
  width: 18px;
  height: 18px;
}

/* Racha Widget */
.racha-container {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.racha-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-title);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-light);
}

.racha-dot.W, .racha-dot.G {
  background-color: var(--color-win);
}

.racha-dot.L, .racha-dot.P {
  background-color: var(--color-loss);
}

.racha-dot.D, .racha-dot.E {
  background-color: var(--color-draw);
}

/* NEXT MATCH WIDGET */
.next-match-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, hsl(252, 90%, 98%) 100%);
  border-left: 3px solid var(--primary);
}

.next-match-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1.2rem 0;
  gap: 1.2rem;
}

.next-match-vs {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  width: 100%;
  justify-content: center;
}

.next-team-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-light);
  padding: 4px;
  border-radius: 10px;
}

.next-match-label {
  font-family: var(--font-family-title);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.next-match-countdown {
  font-family: var(--font-family-title);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  text-align: center;
}

.next-match-details {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   COMPONENTS: STANDINGS / CLASIFICACIÓN
   ========================================================================== */
.table-filters {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 1.2rem;
  background-color: hsl(225, 12%, 93%);
  padding: 0.3rem;
  border-radius: 10px;
  width: fit-content;
  border: 1px solid var(--border-light);
}

.filter-btn {
  padding: 0.4rem 1.1rem;
  font-family: var(--font-family-body);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-radius: 7px;
  transition: var(--transition-smooth);
}

.filter-btn:hover {
  color: var(--text-main);
}

.filter-btn.active {
  color: var(--primary);
  background-color: var(--bg-card);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Standings Table Custom Styling */
.table-container {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border-light);
  background-color: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.premium-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.premium-table th {
  padding: 1rem 0.8rem;
  font-family: var(--font-family-title);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: hsl(225, 12%, 96%);
  border-bottom: 1px solid var(--border-light);
}

.premium-table td {
  padding: 0.95rem 0.8rem;
  font-size: 0.9rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.premium-table tbody tr {
  transition: var(--transition-smooth);
}

.premium-table tbody tr:hover {
  background-color: hsl(225, 10%, 98%);
}

.premium-table tbody tr.highlighted-row {
  background: hsl(252, 90%, 98%);
}

.premium-table tbody tr.highlighted-row td {
  border-bottom-color: hsla(252, 90%, 58%, 0.15);
  border-top-color: hsla(252, 90%, 58%, 0.15);
  font-weight: 500;
}

.pos-badge {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-title);
  font-weight: 700;
  font-size: 0.8rem;
  background-color: hsl(225, 12%, 93%);
  color: var(--text-muted);
}

.premium-table tr:nth-child(1) .pos-badge {
  background-color: hsl(42, 90%, 50%);
  color: var(--text-light);
  box-shadow: 0 0 8px var(--color-draw-glow);
}

.premium-table tr.highlighted-row .pos-badge {
  background-color: var(--primary);
  color: var(--text-light);
  box-shadow: 0 0 6px var(--primary-glow);
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.team-shield {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.team-name {
  font-family: var(--font-family-body);
  font-weight: 500;
  font-size: 0.9rem;
}

.pts-col {
  font-family: var(--font-family-title);
  font-weight: 800;
  font-size: 1rem;
}

.premium-table tbody tr.highlighted-row .pts-col {
  color: var(--primary);
}

/* ==========================================================================
   COMPONENTS: ROSTER / PLANTILLA (3D MINI CARDS)
   ========================================================================== */
.roster-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.8rem;
}

/* 3D CARD CONTAINER */
.card-3d-wrapper {
  perspective: 1000px;
  height: 350px;
  cursor: pointer;
}

.card-3d {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-3d-wrapper:hover .card-3d {
  transform: rotateY(15deg);
}

.card-front, .card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 1.3rem;
  overflow: hidden;
}

.card-front {
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
}

.card-back {
  background: hsl(225, 12%, 97%);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Double-click flip effect support */
.card-3d.flipped {
  transform: rotateY(180deg);
}
.card-3d-wrapper:hover .card-3d.flipped {
  transform: rotateY(165deg);
}

/* Card Front Elements */
.card-dorsal-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-family-title);
  font-size: 22rem; /* Massive watermark filling the entire card and touching the borders! */
  font-weight: 900;
  color: var(--team-blue);
  opacity: 0.05;
  z-index: 0;
  pointer-events: none;
  line-height: 0.8;
  user-select: none;
  white-space: nowrap;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  position: relative;
  z-index: 2;
}

.card-shirt-name {
  font-family: var(--font-family-title);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  color: var(--team-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
  position: relative;
}

.card-role-container {
  display: flex;
  gap: 0.35rem;
  flex-direction: row;
  align-items: center;
}

.card-role-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.6rem;
  border-radius: 5px;
  background-color: hsl(225, 12%, 95%);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}

.card-role-badge.portero {
  background-color: hsl(45, 90%, 93%);
  color: hsl(40, 95%, 38%);
  border-color: hsl(45, 80%, 85%);
}
.card-role-badge.cierre {
  background-color: hsl(225, 20%, 93%);
  color: hsl(225, 15%, 35%);
  border-color: hsl(225, 15%, 85%);
}
.card-role-badge.ala {
  background-color: hsl(190, 90%, 94%);
  color: hsl(190, 95%, 35%);
  border-color: hsl(190, 80%, 84%);
}
.card-role-badge.pivot {
  background-color: hsl(350, 90%, 94%);
  color: hsl(350, 90%, 42%);
  border-color: hsl(350, 80%, 84%);
}
.card-role-badge.cierre-ala {
  background-color: hsl(265, 85%, 95%);
  color: hsl(265, 80%, 45%);
  border-color: hsl(265, 75%, 88%);
}
.card-role-badge.ala-pivot {
  background-color: hsl(20, 95%, 93%);
  color: hsl(15, 95%, 45%);
  border-color: hsl(20, 80%, 84%);
}

.card-avatar-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  position: relative;
  margin-bottom: 1.2rem;
  z-index: 2;
}

.card-avatar-bg {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  opacity: 0.6;
  z-index: 1;
}

.card-avatar {
  width: 85px;
  height: 85px;
  border-radius: 50%;
  object-fit: cover;
  background-color: hsl(225, 12%, 95%);
  border: 1px solid var(--border-light);
  z-index: 2;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-avatar svg {
  width: 36px;
  height: 36px;
  color: var(--text-muted);
}

.card-info {
  text-align: center;
  position: relative;
  z-index: 2;
}

.card-name {
  font-family: var(--font-family-title);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.2rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-stats-preview {
  display: flex;
  justify-content: center;
  gap: 1.3rem;
  margin-top: 0.7rem;
  border-top: 1px solid var(--border-light);
  padding-top: 0.7rem;
}

.stat-preview-item {
  text-align: center;
}

.stat-preview-val {
  font-family: var(--font-family-title);
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-main);
}

.stat-preview-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Card Back Elements (Stats detailed) */
.card-back-header {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.6rem;
  margin-bottom: 0.8rem;
}

.card-back-title {
  font-family: var(--font-family-title);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.card-back-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.card-back-stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex-grow: 1;
}

.back-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.back-stat-label {
  color: var(--text-muted);
  font-weight: 500;
}

.back-stat-value {
  font-family: var(--font-family-title);
  font-weight: 700;
  color: var(--text-main);
}

.card-back-footer {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  padding-top: 0.6rem;
}

/* ==========================================================================
   COMPONENTS: CALENDAR / PARTIDOS (MINIMALIST TIMELINE)
   ========================================================================== */
.calendar-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.match-timeline-card {
  padding: 1.2rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  cursor: pointer;
  background-color: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.match-timeline-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3.5px;
  height: 100%;
  background-color: var(--text-muted);
}

.match-timeline-card.win::after { background-color: var(--color-win); }
.match-timeline-card.loss::after { background-color: var(--color-loss); }
.match-timeline-card.draw::after { background-color: var(--color-draw); }

.match-timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 130px;
}

.timeline-round {
  font-family: var(--font-family-title);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
}

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

.match-timeline-vs {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-grow: 1;
  justify-content: center;
  max-width: 550px;
}

.timeline-team {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 40%;
}

.timeline-team.home {
  justify-content: flex-end;
  text-align: right;
}

.timeline-team.away {
  justify-content: flex-start;
  text-align: left;
}

.timeline-team-name {
  font-family: var(--font-family-body);
  font-weight: 500;
  font-size: 0.9rem;
}

.timeline-shield {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.timeline-score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90px;
  justify-content: center;
}

.timeline-score {
  font-family: var(--font-family-title);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 2px;
  line-height: 1;
  margin-bottom: 0.2rem;
  color: var(--text-main);
}

.timeline-result-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

.win .timeline-result-badge { background-color: var(--color-win-glow); color: var(--color-win); }
.loss .timeline-result-badge { background-color: var(--color-loss-glow); color: var(--color-loss); }
.draw .timeline-result-badge { background-color: var(--color-draw-glow); color: var(--color-draw); }

.match-timeline-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  width: 160px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timeline-arena {
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* ==========================================================================
   MINIMALIST MODAL (MATCH SHEET DETAILED)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(9, 12, 23, 0.4);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  width: 90%;
  max-width: 750px;
  max-height: 80vh;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 2.2rem;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.215, 0.610, 0.355, 1);
  position: relative;
}

.modal-overlay.open .modal-container {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  right: 1.3rem;
  top: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  color: var(--primary);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1.2rem;
  margin-bottom: 1.2rem;
}

.modal-match-meta h3 {
  font-family: var(--font-family-title);
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
  color: var(--text-main);
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.modal-section-title {
  font-family: var(--font-family-title);
  font-size: 1rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.4rem;
  margin-bottom: 0.8rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.modal-section-title svg {
  width: 16px;
  height: 16px;
}

.modal-players-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.modal-player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  background-color: hsl(225, 10%, 97%);
  font-size: 0.8rem;
}

.modal-player-row.titular {
  border-left: 2px solid var(--primary);
}

.modal-player-num {
  font-family: var(--font-family-title);
  font-weight: 700;
  color: var(--team-blue);
  width: 32px;
  flex-shrink: 0;
}

.modal-player-name {
  flex-grow: 1;
  font-weight: 500;
}

.modal-player-badge {
  font-size: 0.6rem;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  background-color: hsl(225, 12%, 93%);
  color: var(--text-muted);
}

.timeline-event-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  background-color: hsl(225, 10%, 97%);
}

.timeline-event-min {
  font-family: var(--font-family-title);
  font-weight: 700;
  color: var(--primary);
  width: 25px;
}

.timeline-event-name {
  flex-grow: 1;
}

.event-icon-goal {
  color: var(--color-win);
}
.event-icon-yellow {
  color: var(--color-draw);
}
.event-icon-red {
  color: var(--color-loss);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 1200px) {
  .roster-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .app-sidebar {
    width: 70px;
    padding: 2rem 0.3rem;
    align-items: center;
  }
  .brand-info, .sidebar-footer .staff-info {
    display: none;
  }
  .brand-section {
    margin-bottom: 2.2rem;
  }
  .nav-link {
    justify-content: center;
    padding: 0.8rem;
    border-left: none;
  }
  .nav-link.active {
    background-color: hsl(252, 90%, 97%);
    color: var(--primary);
  }
  .app-main {
    margin-left: 70px;
    padding: 2rem;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .roster-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .roster-grid {
    grid-template-columns: 1fr;
  }
  .card-3d-wrapper {
    max-width: 290px;
    margin: 0 auto;
    width: 100%;
  }
  .match-timeline-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1.1rem;
  }
  .match-timeline-vs {
    width: 100%;
    max-width: none;
    justify-content: space-between;
    gap: 0.4rem;
  }
  .timeline-team {
    width: 45%;
  }
  .match-timeline-info {
    width: 100%;
    align-items: flex-start;
  }
  .timeline-arena {
    text-align: left;
  }
  .modal-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
}

@media (max-width: 576px) {
  /* BOTTOM NAVIGATION BAR FOR MOBILE SCREENS */
  .app-sidebar {
    width: 100% !important;
    height: 65px !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    top: auto !important;
    border-right: none !important;
    border-top: 1px solid var(--border-light) !important;
    flex-direction: row !important;
    padding: 0.3rem 0.6rem !important;
    justify-content: center !important;
    box-shadow: 0 -4px 16px rgba(9, 12, 23, 0.06) !important;
    background-color: var(--bg-sidebar) !important;
    z-index: 1000 !important;
  }
  
  .brand-section, .sidebar-footer {
    display: none !important;
  }
  
  .sidebar-nav {
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: center !important;
    width: 100% !important;
    gap: 0 !important;
  }
  
  .nav-link {
    flex-direction: column !important;
    gap: 0.15rem !important;
    font-size: 0.72rem !important;
    padding: 0.35rem !important;
    border-radius: 8px !important;
    flex-grow: 1 !important;
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
  }
  
  .nav-link svg {
    width: 16px !important;
    height: 16px !important;
  }
  
  /* MAIN CONTENT ADJUSTMENTS FOR MOBILE VIEW */
  .app-main {
    margin-left: 0 !important;
    margin-bottom: 75px !important; /* Leaving space so navigation doesn't block content */
    padding: 1.4rem 1rem !important;
  }
  
  .section-header h2 {
    font-size: 1.5rem !important;
  }
  .section-header p {
    font-size: 0.85rem !important;
  }
  
  /* COMPACT KPI METRICS GRID */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.8rem !important;
    margin-bottom: 1.5rem !important;
  }
  
  .kpi-card {
    padding: 0.9rem 0.8rem !important;
  }
  
  .kpi-card::before {
    top: 0.9rem !important;
    height: calc(100% - 1.8rem) !important;
  }
  
  .kpi-title {
    font-size: 0.65rem !important;
    letter-spacing: 0.3px !important;
    margin-bottom: 0.2rem !important;
  }
  
  .kpi-value {
    font-size: 1.6rem !important;
  }
  
  .kpi-label {
    font-size: 0.7rem !important;
  }
  
  .kpi-icon {
    display: none !important; /* Hide to avoid text overlaps */
  }
  
  /* COMPACT STANDINGS TABLE */
  .premium-table th:nth-child(7), /* GF */
  .premium-table td:nth-child(7),
  .premium-table th:nth-child(8), /* GC */
  .premium-table td:nth-child(8),
  .premium-table th:nth-child(9), /* DG */
  .premium-table td:nth-child(9) {
    display: none !important; /* Hide less critical columns to fit nicely */
  }
  
  .team-name {
    max-width: 105px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.8rem !important;
  }
  
  .team-shield {
    width: 20px !important;
    height: 20px !important;
  }
  
  .premium-table th, .premium-table td {
    padding: 0.7rem 0.4rem !important;
    font-size: 0.8rem !important;
  }
  
  .pts-col {
    font-size: 0.9rem !important;
  }
  
  /* DASHBOARD CHARTS */
  .panel-card {
    padding: 1.2rem !important;
    min-height: 280px !important;
  }
  
  .panel-card div[style*="height"] {
    height: 220px !important;
  }
  
  /* MATCH TIMELINE */
  .timeline-team-name {
    max-width: 85px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.75rem !important;
  }
  
  .timeline-shield {
    width: 22px !important;
    height: 22px !important;
  }
  
  .timeline-score {
    font-size: 1.15rem !important;
  }
  
  .timeline-round {
    font-size: 0.95rem !important;
  }
  
  .match-timeline-card {
    padding: 1rem !important;
  }
  
  .match-timeline-vs {
    gap: 0.5rem !important;
  }
  
  /* DETAILED MATCH SHEET MODAL */
  .modal-container {
    padding: 1.2rem !important;
    max-height: 90vh !important;
  }
  
  .modal-close-btn {
    right: 0.8rem !important;
    top: 0.8rem !important;
  }
  
  .modal-match-meta h3 {
    font-size: 1.1rem !important;
    padding-right: 1.5rem !important; /* Avoid overlap with absolute close button */
  }
  
  .modal-section-title {
    font-size: 0.9rem !important;
  }
  
  .modal-player-row {
    padding: 0.3rem 0.5rem !important;
  }
  
  .modal-player-name {
    font-size: 0.78rem !important;
  }
  
  .timeline-event-name {
    font-size: 0.78rem !important;
  }
}

@media (max-width: 400px) {
  .team-name {
    max-width: 85px !important;
  }
  .timeline-team-name {
    max-width: 65px !important;
  }
}
