﻿/* ========================================
   VENADO SOCCER — Tournament Management Platform
   Complete Modern Stylesheet
   ======================================== */

/* ========================================
   CSS CUSTOM PROPERTIES
   ======================================== */
:root {
    /* Layout */
    --navbar-height: 60px;
    --sidebar-width: 280px;

    /* Brand Colors */
    --primary-color: #1D9A78;
    --primary-dark: #0D503E;
    --primary-light: #2AB896;
    --primary-xlight: #E8F7F2;
    --secondary-color: #C4A77D;
    --secondary-dark: #a88a5c;
    --accent-color: #FF6B35;
    --accent-light: #FFF0EA;

    /* Background palette */
    --bg-light: #F5F7FA;
    --bg-mint: #E8F5F0;
    --bg-page: #F0F4F8;
    --card-bg: #ffffff;

    /* Text */
    --text-dark: #1a202c;
    --text-body: #2d3748;
    --text-muted: #718096;
    --text-light-on-dark: rgba(255, 255, 255, 0.85);

    /* Semantic colors */
    --success: #1D9A78;
    --success-bg: rgba(29, 154, 120, 0.1);
    --warning: #D97706;
    --warning-bg: rgba(217, 119, 6, 0.1);
    --danger: #E53E3E;
    --danger-bg: rgba(229, 62, 62, 0.1);
    --info: #3182CE;
    --info-bg: rgba(49, 130, 206, 0.1);

    /* Borders */
    --border-color: #e2e8f0;
    --border-radius-sm: 6px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --border-radius-pill: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.2);

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent-color) 0%, #E55A25 100%);
    --gradient-gold: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    --gradient-page: linear-gradient(160deg, var(--bg-light) 0%, #EDF2F7 100%);

    /* Legacy aliases (keep for backward compat) */
    --dark-bg: var(--bg-light);
    --darker-bg: var(--bg-page);
    --text-light: var(--text-body);
    --text-accent: var(--primary-color);
    --accent-color-old: #7BA3C4;
    --tabs-gradient: var(--gradient-primary);
    --shadow-sm: var(--shadow-xs);
}

/* ========================================
   RESET + BASE STYLES
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--gradient-page);
    color: var(--text-body);
    min-height: 100vh;
    line-height: 1.7;
    letter-spacing: 0.2px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition);
}

button {
    font-family: var(--font-sans);
}

ul, ol {
    list-style: none;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-dark);
    letter-spacing: -0.3px;
}

h1 { font-size: clamp(1.875rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { line-height: 1.7; color: var(--text-body); }

/* ========================================
   MATERIAL ICONS
   ======================================== */
.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 6px;
    line-height: 1;
    user-select: none;
}

/* ========================================
   NAVBAR
   ======================================== */
.navbar {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    height: var(--navbar-height);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 0 var(--border-color), var(--shadow);
    display: flex;
    align-items: center;
}

.navbar-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0 1.25rem;
    position: relative;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-dark);
    flex-shrink: 0;
    transition: opacity var(--transition);
}

.navbar-brand:hover { opacity: 0.85; }

.navbar-brand img,
.brand-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.navbar-brand span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-menu {
    display: flex;
    gap: 0.125rem;
    flex: 1;
    justify-content: center;
}

.navbar-menu .mobile-only,
.navbar-menu li.mobile-only {
    display: none !important;
}

.navbar-menu a {
    color: var(--text-body);
    font-weight: 600;
    padding: 0.55rem 0.9rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    letter-spacing: 0.2px;
    white-space: nowrap;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.navbar-menu a:hover {
    background: var(--primary-xlight);
    color: var(--primary-color);
}

.navbar-menu a.active {
    background: var(--primary-xlight);
    color: var(--primary-color);
    font-weight: 700;
}

.nav-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 0.375rem;
    align-self: center;
}

.navbar-menu .nav-admin { color: var(--primary-color); font-weight: 700; }
.navbar-menu .nav-admin:hover,
.navbar-menu .nav-admin.active { background: var(--primary-color); color: #fff; }

.navbar-menu .nav-coach { color: var(--accent-color); font-weight: 700; }
.navbar-menu .nav-coach:hover,
.navbar-menu .nav-coach.active { background: var(--accent-color); color: #fff; }

.navbar-menu .nav-player { color: var(--secondary-color); font-weight: 700; }
.navbar-menu .nav-player:hover,
.navbar-menu .nav-player.active { background: var(--secondary-color); color: #fff; }

/* Hamburger toggle */
.navbar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: background var(--transition);
    flex-shrink: 0;
    padding: 0;
    z-index: 1001;
}

.navbar-toggle:hover { background: var(--primary-dark); }
.navbar-toggle.active { background: var(--primary-dark); }

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 22px;
    height: 18px;
    position: relative;
}

.hamburger-icon span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
    position: absolute;
}

.hamburger-icon span:nth-child(1) { top: 0; }
.hamburger-icon span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-icon span:nth-child(3) { bottom: 0; }

.navbar-toggle.active .hamburger-icon span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}
.navbar-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
    transform: translateX(-8px) translateY(-50%);
}
.navbar-toggle.active .hamburger-icon span:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* Navbar actions (user area) */
.navbar-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-shrink: 0;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.user-greeting {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.82rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-light);
    border-radius: var(--border-radius-pill);
    border: 1px solid var(--border-color);
}

.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role-badge {
    font-size: 0.68rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--border-radius-pill);
    background: var(--primary-color);
    color: #fff;
    font-weight: 700;
}

.btn-logout {
    background: var(--gradient-accent);
    color: #fff;
    border: none;
    transition: all var(--transition);
}

.btn-logout:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.7rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.4px;
    line-height: 1;
    min-height: 44px;
    text-decoration: none;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

.btn .material-icons { font-size: 18px; margin-right: 0; }

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(29, 154, 120, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(29, 154, 120, 0.45);
    transform: translateY(-2px);
    opacity: 0.95;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: #fff;
    box-shadow: var(--shadow);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #C53030 100%);
    color: #fff;
    box-shadow: var(--shadow);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(229, 62, 62, 0.4);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.btn-accent {
    background: var(--gradient-accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.35);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.45);
}

.btn-sm {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    min-height: 36px;
    border-radius: var(--border-radius-sm);
}

.btn-lg {
    padding: 0.9rem 2rem;
    font-size: 1rem;
    min-height: 52px;
    border-radius: var(--border-radius);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
}

.btn-icon.btn-sm { width: 36px; height: 36px; }
.btn-icon.btn-lg { width: 52px; height: 52px; }

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--navbar-height) + 3rem) 1.5rem 4rem;
    background:
        linear-gradient(135deg, rgba(13, 80, 62, 0.92) 0%, rgba(29, 154, 120, 0.88) 50%, rgba(255, 107, 53, 0.75) 100%),
        url('../images/soccer-bg.jpg') center / cover no-repeat;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 25% 75%, rgba(255, 255, 255, 0.08) 0%, transparent 55%),
                radial-gradient(ellipse at 75% 25%, rgba(255, 107, 53, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 80px;
    background: var(--gradient-page);
    clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 820px;
    width: 100%;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 0.6rem 1.5rem;
    border-radius: var(--border-radius-pill);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1.75rem;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.hero h1 {
    font-size: clamp(2.25rem, 7vw, 5rem);
    font-weight: 900;
    margin-bottom: 0.75rem;
    color: #fff;
    letter-spacing: -1.5px;
    line-height: 1.05;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 1rem;
    font-weight: 500;
}

.hero-tournament {
    font-size: clamp(1.5rem, 3.5vw, 2.75rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 2rem;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2.5rem;
}

/* ========================================
   FEATURES SECTION
   ======================================== */
.features {
    padding: var(--space-16) 1.5rem;
    background: var(--gradient-page);
}

.features-container {
    width: 100%;
    max-width: 100%;
}

.section-title {
    text-align: center;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    font-weight: 900;
    letter-spacing: -0.5px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: var(--space-12);
    font-size: 1.05rem;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 2.25rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    transition: all var(--transition-slow);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 72px;
    height: 72px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: #fff;
    box-shadow: 0 4px 16px rgba(29, 154, 120, 0.35);
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.75;
}

/* ========================================
   LAYOUT / CONTAINER
   ======================================== */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 1.25rem;
}

.container-sm { max-width: 640px; margin-left: auto; margin-right: auto; }
.container-md { max-width: 900px; margin-left: auto; margin-right: auto; }
.container-lg { max-width: 1200px; margin-left: auto; margin-right: auto; }

.grid { display: grid; gap: 1.75rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-slow);
    box-shadow: var(--shadow);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1.4rem 1.75rem;
    background: linear-gradient(135deg, var(--bg-mint) 0%, rgba(232, 245, 240, 0.6) 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-header h3,
.card-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.card-body { padding: 1.75rem; }

.card-footer {
    padding: 1rem 1.75rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Stat cards (icon + value + label) */
.stat-card {
    background: var(--card-bg);
    padding: 1.75rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: all var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before { opacity: 1; }

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.stat-card-icon {
    width: 52px;
    height: 52px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(29, 154, 120, 0.3);
    flex-shrink: 0;
}

.stat-card-icon.orange { background: var(--gradient-accent); box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3); }
.stat-card-icon.gold { background: var(--gradient-gold); box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3); }
.stat-card-icon.blue { background: linear-gradient(135deg, #3182CE 0%, #2B6CB0 100%); box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3); }

.stat-card-value {
    font-size: 2.25rem;
    font-weight: 900;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 0.3rem;
}

.stat-card-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
}

.stat-card-change {
    font-size: 0.8rem;
    margin-top: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-card-change.positive { color: var(--success); }
.stat-card-change.negative { color: var(--danger); }

/* Stats grid layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Stat item (inside team cards etc.) */
.stat-item { text-align: center; }
.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--secondary-color);
    line-height: 1;
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-top: 0.2rem;
}

/* ========================================
   TEAM CARDS
   ======================================== */
.team-card { text-align: center; }

.team-logo {
    width: 88px;
    height: 88px;
    background: var(--bg-mint);
    border-radius: 50%;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 16px rgba(29, 154, 120, 0.2);
    overflow: hidden;
}

.team-name {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    color: var(--text-dark);
}

.team-coach {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.team-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   MATCH CARDS
   ======================================== */
.match-card {
    display: flex;
    align-items: center;
    padding: 1.75rem;
    gap: 1.25rem;
}

.match-team {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.match-team-logo {
    width: 64px;
    height: 64px;
    background: var(--bg-mint);
    border-radius: 50%;
    margin: 0 auto 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.match-team-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-vs {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-muted);
    padding: 0 0.5rem;
    flex-shrink: 0;
}

.match-score {
    background: var(--gradient-primary);
    color: #fff;
    padding: 0.6rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1.6rem;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(29, 154, 120, 0.35);
    flex-shrink: 0;
    letter-spacing: 2px;
}

.match-info {
    text-align: center;
    padding: 1rem 1.75rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

.match-date {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
}

.match-venue {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

/* Status badges */
.match-status {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: var(--border-radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.match-status.live { background: var(--danger-bg); color: var(--danger); animation: pulse 2s infinite; }
.match-status.scheduled { background: var(--info-bg); color: var(--info); }
.match-status.completed { background: var(--success-bg); color: var(--success); }

/* ========================================
   FORMS
   ======================================== */
.form-group { margin-bottom: 1.5rem; }

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
    letter-spacing: 0.2px;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-dark);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    transition: all var(--transition);
    line-height: 1.5;
    min-height: 44px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(29, 154, 120, 0.15);
    background: rgba(29, 154, 120, 0.01);
}

.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled { background: var(--bg-light); color: var(--text-muted); cursor: not-allowed; }

.form-control.is-valid { border-color: var(--success); }
.form-control.is-valid:focus { box-shadow: 0 0 0 3px var(--success-bg); }
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px var(--danger-bg); }

.form-text { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.35rem; }
.form-text.valid { color: var(--success); }
.form-text.invalid { color: var(--danger); }

/* Input with icon prefix */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 0.9rem;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
    font-size: 20px;
    margin: 0;
}

.input-group .form-control { padding-left: 2.75rem; }

.input-group-append {
    position: absolute;
    right: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    z-index: 1;
}

/* Floating label effect */
.form-floating {
    position: relative;
}

.form-floating .form-control {
    padding-top: 1.375rem;
    padding-bottom: 0.375rem;
}

.form-floating label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: all var(--transition);
    transform-origin: 0 0;
}

.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label {
    transform: translateY(-0.625rem) scale(0.78);
    color: var(--primary-color);
}

/* Select */
select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23718096'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 20px;
    padding-right: 2.5rem;
}

/* Form row */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

/* ========================================
   LOGIN PAGE
   ======================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    padding-top: calc(var(--navbar-height) + 2rem);
    position: relative;
    z-index: 1;
    background: var(--gradient-page);
}

.login-box {
    background: var(--card-bg);
    border-radius: var(--border-radius-xl);
    padding: 3rem;
    width: 100%;
    max-width: 460px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 10;
}

.login-form {
    position: relative;
    z-index: 20;
}

.login-form .form-control {
    position: relative;
    z-index: 25;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.875rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.login-header p { color: var(--text-muted); font-size: 0.95rem; }

.login-tabs {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 2rem;
    background: var(--bg-light);
    padding: 0.375rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.login-tab {
    flex: 1;
    padding: 0.7rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition);
    font-family: var(--font-sans);
    min-height: 40px;
}

.login-tab.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow);
}

/* Demo section */
.demo-section {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
}

.demo-section h4 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demo-credentials {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.demo-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-body);
    text-align: left;
    transition: all var(--transition);
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.demo-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-xlight);
    color: var(--primary-dark);
}

/* ========================================
   DASHBOARD LAYOUT
   ======================================== */
.dashboard,
.dashboard-container {
    display: flex;
    min-height: 100vh;
    padding-top: var(--navbar-height);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.25rem 0;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow);
    z-index: 900;
    transition: transform var(--transition-slow);
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 899;
    backdrop-filter: blur(2px);
}

.sidebar-menu { list-style: none; }
.sidebar-item { padding: 0; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.8rem 1.25rem;
    color: var(--text-muted);
    transition: all var(--transition);
    border-left: 3px solid transparent;
    font-weight: 600;
    font-size: 0.9rem;
    min-height: 48px;
}

.sidebar-link:hover {
    background: var(--primary-xlight);
    color: var(--primary-color);
    border-left-color: var(--primary-light);
}

.sidebar-link.active {
    background: var(--primary-xlight);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 700;
}

.sidebar-link .material-icons {
    font-size: 20px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    margin-right: 0;
}

.sidebar-section {
    padding: 0.75rem 1.25rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 1rem;
    letter-spacing: 0.8px;
}

/* Main content area */
.main-content,
.dashboard-content {
    flex: 1;
    padding: 0;
    padding-top: calc(var(--navbar-height) + 1rem);
    width: 100%;
    min-width: 0;
}

.main-content:has(.login-container) {
    padding: 0;
    padding-top: var(--navbar-height);
}

.dashboard .main-content,
.dashboard-container .dashboard-content {
    margin-left: var(--sidebar-width);
    padding-top: 1rem;
}

/* Page header inside dashboard */
.page-header {
    padding: 2rem 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(29, 154, 120, 0.07) 0%, rgba(255, 107, 53, 0.04) 100%);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    margin-bottom: 0.35rem;
    font-weight: 900;
    color: var(--text-dark);
}

.page-header p { color: var(--text-muted); font-size: 1rem; }

.page-header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* ========================================
   STANDINGS TABLE
   ======================================== */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    min-width: 600px;
}

.standings-table th,
.standings-table td {
    padding: 1rem 1.25rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.standings-table th {
    background: linear-gradient(135deg, var(--bg-mint) 0%, rgba(232, 245, 240, 0.7) 100%);
    font-weight: 800;
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--text-dark);
    letter-spacing: 0.6px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.standings-table tbody tr {
    transition: background var(--transition);
}

.standings-table tbody tr:nth-child(even) {
    background: rgba(245, 247, 250, 0.5);
}

.standings-table tbody tr:hover {
    background: var(--primary-xlight);
}

.standings-table tbody tr:last-child td {
    border-bottom: none;
}

.standings-table .team-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    min-width: 160px;
}

.standings-table .position {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.standings-table .position.top {
    background: var(--gradient-gold);
    color: var(--text-dark);
}

.standings-table .points {
    font-weight: 900;
    color: var(--primary-dark);
    font-size: 1.1rem;
}

/* ========================================
   TOURNAMENT BRACKET
   ======================================== */
.bracket-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
}

.bracket-container {
    display: flex;
    justify-content: flex-start;
    gap: 0;
    padding: 2.5rem 1.5rem;
    min-width: max-content;
    position: relative;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.bracket-round-label {
    text-align: center;
    color: var(--primary-dark);
    font-size: 0.78rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 0.4rem 1.25rem;
    background: var(--primary-xlight);
    border-radius: var(--border-radius-pill);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(29, 154, 120, 0.2);
}

/* backward compat with h4 label */
.bracket-round h4 {
    text-align: center;
    color: var(--primary-dark);
    font-size: 0.78rem;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 0.4rem 1.25rem;
    background: var(--primary-xlight);
    border-radius: var(--border-radius-pill);
}

.bracket-matches {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: space-around;
    flex: 1;
}

.bracket-match {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 0.875rem 1rem;
    width: 220px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: relative;
    transition: all var(--transition);
}

.bracket-match:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.bracket-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.35rem;
    background: var(--bg-light);
    transition: all var(--transition);
    gap: 0.5rem;
}

.bracket-team:last-child { margin-bottom: 0; }

.bracket-team:hover { background: var(--bg-mint); }

.bracket-team.winner {
    background: var(--primary-xlight);
    border: 1.5px solid var(--primary-color);
    font-weight: 700;
}

.bracket-team.winner .bracket-team-name { color: var(--primary-dark); }

.bracket-team.loser {
    opacity: 0.55;
}

.bracket-team-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.bracket-team-score {
    background: var(--gradient-primary);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 800;
    font-size: 0.875rem;
    flex-shrink: 0;
    min-width: 28px;
    text-align: center;
}

.bracket-team.winner .bracket-team-score {
    background: var(--primary-dark);
}

/* Connector lines between rounds */
.bracket-connector {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    align-self: stretch;
    margin-top: 3rem;
    position: relative;
}

.bracket-connector::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 2px;
    background: var(--border-color);
}

.bracket-connector-top,
.bracket-connector-bottom {
    flex: 1;
    border-right: 2px solid var(--border-color);
    position: relative;
}

.bracket-connector-top { border-bottom: 2px solid var(--border-color); }
.bracket-connector-bottom { border-top: 2px solid var(--border-color); }

/* Champion card */
.bracket-champion {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.bracket-champion-card {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 60%, #FF6B35 100%);
    border-radius: var(--border-radius-xl);
    padding: 2rem 2.5rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(255, 165, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.4);
    min-width: 200px;
    animation: float 3s ease-in-out infinite;
}

.bracket-champion-trophy {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    display: block;
}

.bracket-champion-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.25rem;
}

.bracket-champion-name {
    font-size: 1.1rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ========================================
   CHAMPIONSHIP PAGE
   ======================================== */
.championship-hero,
.champion-hero-section {
    text-align: center;
    padding: calc(var(--navbar-height) + 4rem) 2rem 5rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--accent-color) 100%);
    position: relative;
    overflow: hidden;
}

.championship-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
}

.champion-banner {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: #fff;
    padding: 3rem 2.5rem;
    border-radius: var(--border-radius-xl);
    margin: 2rem auto;
    max-width: 680px;
    box-shadow: var(--shadow-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.champion-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.champion-banner h2 {
    font-size: clamp(1.75rem, 4vw, 3rem);
    margin-bottom: 1rem;
    font-weight: 900;
    color: #fff;
}

.champion-banner p { color: rgba(255, 255, 255, 0.85); }

/* Trophy card */
.trophy-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-xl);
    padding: 3rem 2.5rem;
    text-align: center;
    border: 2px solid var(--secondary-color);
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    margin: 0 auto;
}

.trophy-icon {
    font-size: 6rem;
    line-height: 1;
    margin-bottom: 1.5rem;
    display: block;
    animation: float 3s ease-in-out infinite;
}

/* Final score card */
.final-score-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-xl);
    padding: 2.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.final-score {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 900;
    color: var(--primary-dark);
    margin: 1.5rem 0;
    letter-spacing: -2px;
    line-height: 1;
}

.final-score-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 1rem 0;
}

.final-score-team {
    text-align: center;
    flex: 1;
}

.final-score-team-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark);
}

.final-score-divider {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-muted);
    padding: 0 0.5rem;
}

/* MVP card */
.mvp-card {
    background: var(--card-bg);
    padding: 2.25rem;
    border-radius: var(--border-radius-xl);
    text-align: center;
    border: 2px solid var(--secondary-color);
    box-shadow: var(--shadow-lg);
}

.mvp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius-pill);
    font-weight: 800;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    letter-spacing: 0.5px;
}

.mvp-name {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 0.35rem;
}

.mvp-position {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

/* ========================================
   ALERTS / FLASH MESSAGES
   ======================================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-left: 4px solid;
    line-height: 1.5;
}

.alert .material-icons {
    font-size: 20px;
    flex-shrink: 0;
    margin-right: 0;
    margin-top: 1px;
}

.alert-success {
    background: var(--success-bg);
    border-left-color: var(--success);
    color: #155724;
}

.alert-success .material-icons { color: var(--success); }

.alert-warning {
    background: var(--warning-bg);
    border-left-color: var(--warning);
    color: #7B5007;
}

.alert-warning .material-icons { color: var(--warning); }

.alert-danger,
.alert-error {
    background: var(--danger-bg);
    border-left-color: var(--danger);
    color: #721c24;
}

.alert-danger .material-icons,
.alert-error .material-icons { color: var(--danger); }

.alert-info {
    background: var(--info-bg);
    border-left-color: var(--info);
    color: #0c5460;
}

.alert-info .material-icons { color: var(--info); }

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    color: currentColor;
    opacity: 0.6;
    padding: 0;
    flex-shrink: 0;
}

.alert-close:hover { opacity: 1; }

/* ========================================
   MODALS
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--card-bg);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.25s ease;
}

.modal-lg { max-width: 680px; }
.modal-xl { max-width: 860px; }

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-24px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-dark);
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
}

.modal-close:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
    flex-shrink: 0;
}

/* ========================================
   FILTERS / FILTER BAR
   ======================================== */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-btn {
    padding: 0.55rem 1.25rem;
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-pill);
    color: var(--text-body);
    cursor: pointer;
    transition: all var(--transition);
    font-weight: 600;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    min-height: 40px;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-xlight);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(29, 154, 120, 0.3);
}

/* ========================================
   PLAYER PROFILE
   ======================================== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding: 2.5rem;
    background: var(--card-bg);
    border-radius: var(--border-radius-xl);
    margin-bottom: 1.75rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.profile-avatar {
    width: 140px;
    height: 140px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    border: 4px solid var(--secondary-color);
    flex-shrink: 0;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.profile-info h1 { font-size: 1.875rem; margin-bottom: 0.5rem; }

.profile-info .position {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: #fff;
    padding: 0.3rem 1rem;
    border-radius: var(--border-radius-pill);
    font-weight: 800;
    font-size: 0.82rem;
    display: inline-block;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-info .team-name { color: var(--text-muted); font-size: 1rem; }

.profile-stats {
    display: flex;
    gap: 2.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.profile-stat { text-align: center; }

.profile-stat-value {
    font-size: 2.25rem;
    font-weight: 900;
    color: var(--secondary-color);
    line-height: 1;
}

.profile-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* ========================================
   LEADERBOARDS
   ======================================== */
.leaderboard {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.leaderboard-header {
    padding: 1.4rem 1.75rem;
    background: linear-gradient(135deg, var(--bg-mint) 0%, rgba(232, 245, 240, 0.7) 100%);
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-header h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition);
    min-height: 64px;
}

.leaderboard-item:last-child { border-bottom: none; }
.leaderboard-item:hover { background: var(--bg-light); }

.leaderboard-rank {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    margin-right: 1.25rem;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

.leaderboard-rank.gold { background: var(--gradient-gold); color: var(--text-dark); box-shadow: 0 2px 8px rgba(255, 165, 0, 0.4); }
.leaderboard-rank.silver { background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%); color: var(--text-dark); }
.leaderboard-rank.bronze { background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%); }

.leaderboard-player { flex: 1; min-width: 0; }
.leaderboard-player-name { font-weight: 700; color: var(--text-dark); font-size: 1rem; }
.leaderboard-player-team { font-size: 0.83rem; color: var(--text-muted); margin-top: 0.2rem; }
.leaderboard-value { font-size: 1.6rem; font-weight: 900; color: var(--secondary-color); flex-shrink: 0; }

/* ========================================
   ADMIN CONTROLS
   ======================================== */
.admin-section {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.admin-section h3 {
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-dark);
    font-size: 1.1rem;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background: var(--card-bg);
    padding: 3rem 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }
.footer-brand img { height: 32px; }
.footer-brand-name { font-weight: 800; font-size: 1.1rem; color: var(--text-dark); }

.footer-tagline { color: var(--text-muted); font-size: 0.875rem; line-height: 1.6; }

.footer-heading {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; transition: color var(--transition); }
.footer-links a:hover { color: var(--primary-color); }

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-text { color: var(--text-muted); font-size: 0.875rem; }

/* ========================================
   LIST ITEMS / COMMON UI
   ======================================== */
.list-container {
    max-height: 400px;
    overflow-y: auto;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition);
    min-height: 56px;
}

.list-item:hover { background: var(--bg-light); }
.list-item:last-child { border-bottom: none; }

.list-item-name { font-weight: 600; color: var(--text-dark); }
.list-item-info { font-size: 0.83rem; color: var(--text-muted); margin-left: auto; margin-right: 1rem; }
.list-item-actions { display: flex; gap: 0.5rem; }

/* ========================================
   REPORTS / INSIGHTS
   ======================================== */
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.report-stat {
    background: var(--bg-light);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid var(--border-color);
}

.report-value {
    display: block;
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
}

.report-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    font-weight: 600;
}

.insights-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.insight-card {
    background: var(--bg-light);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    border: 1px solid var(--border-color);
    border-left-width: 4px;
}

.insight-card h4 {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.insight-card p { font-size: 0.95rem; font-weight: 700; color: var(--text-dark); }

.download-options { display: flex; flex-direction: column; gap: 0.5rem; }

/* ========================================
   NOTIFICATION SYSTEM
   ======================================== */
.notification {
    position: fixed;
    top: calc(var(--navbar-height) + 12px);
    right: 16px;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 3000;
    animation: notificationSlideIn 0.3s ease;
    max-width: 380px;
    border: 1px solid var(--border-color);
}

@keyframes notificationSlideIn {
    from { opacity: 0; transform: translateX(120px); }
    to { opacity: 1; transform: translateX(0); }
}

.notification-fade {
    animation: notificationFadeOut 0.3s ease forwards;
}

@keyframes notificationFadeOut {
    to { opacity: 0; transform: translateX(120px); }
}

.notification-success { border-left: 4px solid var(--success); }
.notification-success .material-icons { color: var(--success); }
.notification-error { border-left: 4px solid var(--danger); }
.notification-error .material-icons { color: var(--danger); }
.notification-warning { border-left: 4px solid var(--warning); }
.notification-warning .material-icons { color: var(--warning); }
.notification-info { border-left: 4px solid var(--info); }
.notification-info .material-icons { color: var(--info); }

.notification-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    margin-left: auto;
    line-height: 1;
    padding: 0.2rem;
    border-radius: 4px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
}

.notification-close:hover { color: var(--text-dark); background: var(--bg-light); }

/* ========================================
   REALTIME UPDATES
   ======================================== */
.realtime-update {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 0.875rem 1rem;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid var(--primary-color);
    border: 1px solid var(--border-color);
    border-left-width: 4px;
}

.realtime-update.update-team { border-left-color: var(--info); }
.realtime-update.update-player { border-left-color: var(--accent-color); }
.realtime-update.update-match,
.realtime-update.update-score { border-left-color: var(--success); }
.realtime-update.update-tournament { border-left-color: var(--warning); }

.realtime-update .update-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-mint);
    flex-shrink: 0;
}

.realtime-update .update-icon .material-icons { font-size: 18px; color: var(--primary-color); margin: 0; }
.realtime-update.update-team .update-icon { background: var(--info-bg); }
.realtime-update.update-team .update-icon .material-icons { color: var(--info); }

.realtime-update .update-content { flex: 1; min-width: 0; }
.realtime-update .update-message { font-size: 0.875rem; color: var(--text-dark); margin-bottom: 0.2rem; line-height: 1.4; }
.realtime-update .update-time { font-size: 0.72rem; color: var(--text-muted); }

.realtime-update .update-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    margin-left: 0.375rem;
    flex-shrink: 0;
}

.realtime-update .update-close:hover { color: var(--text-dark); }
.realtime-update-fade { animation: slideOutRight 0.3s ease-in forwards; }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

/* ========================================
   RBAC / PERMISSION BADGES
   ======================================== */
.permission-denied {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}

.admin-only-badge,
.read-only-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.admin-only-badge { background: var(--danger-bg); color: var(--danger); }
.read-only-badge { background: var(--info-bg); color: var(--info); }

/* ========================================
   CONNECTION STATUS
   ======================================== */
.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: var(--border-radius-pill);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
}

.connection-status.connected { background: var(--success-bg); color: var(--success); border-color: rgba(29, 154, 120, 0.2); }
.connection-status.disconnected { background: var(--danger-bg); color: var(--danger); border-color: rgba(229, 62, 62, 0.2); }

.connection-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.loading-skeleton {
    background: linear-gradient(90deg, var(--bg-light) 25%, #e2e8f0 50%, var(--bg-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

/* ========================================
   BADGES / TAGS
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: var(--border-radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-primary { background: var(--primary-xlight); color: var(--primary-dark); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-secondary { background: #F4EDE0; color: var(--secondary-dark); }

/* ========================================
   TABS
   ======================================== */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    gap: 0;
    overflow-x: auto;
}

.tab-btn {
    padding: 0.7rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
    white-space: nowrap;
    min-height: 44px;
}

.tab-btn:hover { color: var(--primary-color); }

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 700;
}

/* ========================================
   AVATAR
   ======================================== */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar-md { width: 44px; height: 44px; font-size: 1rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.5rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 2rem; }

/* ========================================
   MOBILE MENU ITEMS
   ======================================== */
.mobile-user-info {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    background: var(--bg-light);
}

.mobile-user-greeting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9rem;
}

.mobile-role-badge {
    font-size: 0.68rem;
    padding: 0.18rem 0.55rem;
    border-radius: var(--border-radius-pill);
    background: var(--primary-color);
    color: #fff;
    margin-left: auto;
    font-weight: 700;
}

.mobile-logout { color: var(--danger) !important; }
.mobile-logout:hover { background: var(--danger-bg) !important; }
.mobile-signin { color: var(--primary-color) !important; font-weight: 700 !important; }
.mobile-signin:hover { background: var(--primary-color) !important; color: #fff !important; }

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Display */
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-none { display: none; }
.d-inline-flex { display: inline-flex; }

/* Alignment */
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* Text */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-dark { color: var(--text-dark) !important; }
.text-white { color: #fff !important; }
.font-bold { font-weight: 700; }
.font-900 { font-weight: 900; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.5px; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Spacing — margins */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-auto { margin-top: auto; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Spacing — padding */
.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }
.max-w-sm { max-width: 480px; }
.max-w-md { max-width: 680px; }
.max-w-lg { max-width: 900px; }

/* Misc */
.rounded { border-radius: var(--border-radius-sm); }
.rounded-lg { border-radius: var(--border-radius); }
.rounded-xl { border-radius: var(--border-radius-xl); }
.rounded-full { border-radius: var(--border-radius-pill); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.border { border: 1px solid var(--border-color); }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cursor-pointer { cursor: pointer; }
.pointer-events-none { pointer-events: none; }
.select-none { user-select: none; }
.opacity-50 { opacity: 0.5; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Hidden helpers */
.hidden-mobile { display: block; }
.hidden-desktop { display: none; }

/* Divider */
.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.25rem 0;
}

/* Scroll wrapper for tables / brackets */
.scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ========================================
   PAGE-SPECIFIC WRAPPERS
   ======================================== */

/* Wrapper that adds navbar offset + padding for non-dashboard pages */
.page-wrapper {
    padding-top: var(--navbar-height);
    min-height: 100vh;
}

.content-wrapper {
    padding: 1.5rem;
}

/* ========================================
   RESPONSIVE — 1280px (xl)
   ======================================== */
@media (max-width: 1280px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   RESPONSIVE — 1024px (lg / sidebar breakpoint)
   ======================================== */
@media (max-width: 1024px) {
    :root { --sidebar-width: 240px; }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard .main-content,
    .dashboard-container .dashboard-content {
        margin-left: var(--sidebar-width);
    }
}

/* ========================================
   RESPONSIVE — 768px (md / tablets)
   ======================================== */
@media (max-width: 768px) {
    /* Show hamburger, hide desktop nav */
    .navbar-toggle { display: flex; }

    .navbar-menu {
        display: none !important;
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        flex-direction: column;
        padding: 0.75rem;
        border-top: 1px solid var(--border-color);
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
        max-height: calc(100vh - var(--navbar-height));
        overflow-y: auto;
        gap: 0.2rem;
        z-index: 9999;
    }

    .navbar-menu.active { display: flex !important; }

    .navbar-menu li { width: 100%; }

    .navbar-menu a {
        padding: 0.8rem 1rem;
        border-radius: var(--border-radius-sm);
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.9rem;
        min-height: 48px;
    }

    .navbar-menu .mobile-only,
    .navbar-menu li.mobile-only,
    .mobile-only { display: flex !important; }

    .nav-divider {
        width: 100%;
        height: 1px;
        margin: 0.375rem 0;
    }

    .navbar-actions { display: none; }

    /* Sidebar: off-canvas on mobile */
    .sidebar {
        transform: translateX(-100%);
        z-index: 950;
        width: 280px !important;
    }

    .sidebar.open { transform: translateX(0); }

    .sidebar-overlay.active { display: block; }

    .dashboard .main-content,
    .dashboard-container .dashboard-content {
        margin-left: 0;
    }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Hero */
    .hero { padding-top: calc(var(--navbar-height) + 2rem); }

    .hero h1 { font-size: clamp(1.75rem, 7vw, 2.75rem); letter-spacing: -0.5px; }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-buttons .btn-lg { width: 100%; max-width: 340px; }

    /* Section title */
    .section-title { font-size: 1.75rem; }

    /* Cards */
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .profile-stats { justify-content: center; }

    /* Match card */
    .match-card { padding: 1.25rem; gap: 0.75rem; }

    /* Bracket horizontal scroll */
    .bracket-container { padding: 1.5rem 1rem; }

    /* Login */
    .login-box { padding: 2rem 1.5rem; }

    /* Page header */
    .page-header { padding: 1.5rem 1rem 1rem; }

    /* Footer */
    .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer-bottom { flex-direction: column; text-align: center; }

    /* Tables */
    .standings-table-container,
    .table-wrapper { border-radius: var(--border-radius); }

    /* Utilities */
    .hidden-mobile { display: none !important; }
    .hidden-desktop { display: block !important; }

    /* Grid */
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ========================================
   RESPONSIVE — 480px (sm)
   ======================================== */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .grid-2,
    .grid-3,
    .grid-4 { grid-template-columns: 1fr; }

    .hero h1 { letter-spacing: -0.25px; }

    .hero-badge { font-size: 0.75rem; }

    .login-box { padding: 1.5rem 1.25rem; border-radius: var(--border-radius-lg); }

    .card-body { padding: 1.25rem; }
    .card-header { padding: 1rem 1.25rem; }
    .card-footer { padding: 0.875rem 1.25rem; }

    .match-card { flex-direction: column; }
    .match-team { width: 100%; }
    .match-vs { display: none; }
    .match-score { width: 100%; text-align: center; border-radius: var(--border-radius-sm); }

    .modal-footer { flex-direction: column; }
    .modal-footer .btn { width: 100%; }

    .filter-bar { gap: 0.5rem; }
    .filter-btn { padding: 0.45rem 0.875rem; font-size: 0.8rem; }

    .form-row { grid-template-columns: 1fr; }

    .champion-banner { padding: 2rem 1.5rem; }
    .final-score { font-size: 3rem; }

    .bracket-match { width: 180px; }
    .bracket-champion-card { padding: 1.5rem; }

    .notification {
        left: 8px;
        right: 8px;
        max-width: none;
    }
}

/* ========================================
   RESPONSIVE — 320px (xs)
   ======================================== */
@media (max-width: 320px) {
    .container { padding: 0.875rem; }
    .hero { padding-left: 0.875rem; padding-right: 0.875rem; }
    .navbar-brand span { display: none; }
    .stats-grid { grid-template-columns: 1fr; }
    .btn-lg { padding: 0.8rem 1.25rem; font-size: 0.9rem; }
}

/* ========================================
   RESPONSIVE — Modal on very small screens
   ======================================== */
@media (max-width: 540px) {
    .modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
        margin-top: auto;
    }

    .modal-overlay { align-items: flex-end; padding: 0; }

    .modal-body { max-height: calc(85vh - 140px); }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .navbar, .sidebar, .navbar-toggle, .modal-overlay { display: none !important; }
    .dashboard .main-content,
    .dashboard-container .dashboard-content { margin-left: 0; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ========================================
   FOCUS VISIBLE / ACCESSIBILITY
   ======================================== */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Touch targets */
@media (hover: none) and (pointer: coarse) {
    .btn, .filter-btn, .login-tab, .tab-btn,
    .sidebar-link, .navbar-menu a,
    .list-item { min-height: 44px; }

    .bracket-team { padding: 0.75rem; }
}


/* ════════════════════════════════════════════════════════
   SAC RIVER SOCCER | Console — UI ENHANCEMENTS v2
   Enhanced look & feel: fonts, sidebar, cards, modals,
   tables, buttons, footer.
   ════════════════════════════════════════════════════════ */

/* ── Google Font: Inter ────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300..900;1,14..32,300..900&display=swap');

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* Sidebar dark palette */
    --sidebar-bg-top:    #0d1f1a;
    --sidebar-bg-mid:    #0f2820;
    --sidebar-bg-bottom: #0a1d16;
    --sidebar-link:      rgba(255,255,255,.60);
    --sidebar-link-hover:rgba(255,255,255,.90);
    --sidebar-active-bg: rgba(29,154,120,.28);
    --sidebar-hover-bg:  rgba(29,154,120,.15);
    --sidebar-section:   rgba(255,255,255,.30);
}

/* ── Brand "| Console" tag ─────────────────────────────── */
.brand-console {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #FF6B35 0%, #E55A25 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: .9;
    align-self: flex-end;
    padding-bottom: 1px;
}

/* ── NAVBAR — refined glass ────────────────────────────── */
.navbar {
    background: rgba(255,255,255,.97) !important;
    box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 3px 16px rgba(0,0,0,.06) !important;
    border-bottom: 1px solid rgba(29,154,120,.10) !important;
}

.navbar-brand {
    font-size: 1rem;
    letter-spacing: -.2px;
    gap: 8px;
}

/* ── SIDEBAR — dark professional ──────────────────────── */
.sidebar {
    background: linear-gradient(180deg,
        var(--sidebar-bg-top)    0%,
        var(--sidebar-bg-mid)    45%,
        var(--sidebar-bg-bottom) 100%) !important;
    border-right: none !important;
    box-shadow: 4px 0 24px rgba(0,0,0,.30) !important;
}

.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.10) !important; }

.sidebar-section {
    color: var(--sidebar-section) !important;
    font-size: .68rem;
    letter-spacing: 1px;
}

.sidebar-link {
    color: var(--sidebar-link) !important;
    border-left-color: transparent !important;
    border-radius: 0 6px 6px 0;
    margin-right: 10px;
}

.sidebar-link:hover {
    background: var(--sidebar-hover-bg) !important;
    color: var(--sidebar-link-hover) !important;
    border-left-color: var(--primary-light) !important;
}

.sidebar-link.active {
    background: var(--sidebar-active-bg) !important;
    color: #fff !important;
    border-left-color: var(--primary-light) !important;
    font-weight: 700;
}

.sidebar-link .material-icons { color: inherit !important; }

/* Logo area inside dark sidebar */
.sidebar-brand {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: .5rem;
}

/* ── PAGE HEADER — subtle gradient ────────────────────── */
.page-header {
    background: linear-gradient(135deg,
        rgba(29,154,120,.07) 0%,
        rgba(196,167,125,.05) 100%) !important;
    border-bottom: 1px solid rgba(29,154,120,.10) !important;
    padding: 1.75rem 1.5rem 1.5rem !important;
}

/* ── STAT CARDS — polish ───────────────────────────────── */
.stat-card {
    border-radius: var(--border-radius-lg) !important;
    border: 1px solid rgba(29,154,120,.08) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.06) !important;
    transition: all .3s cubic-bezier(.16,1,.3,1) !important;
}

.stat-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 12px 30px rgba(29,154,120,.15) !important;
    border-color: rgba(29,154,120,.22) !important;
}

.stat-card::before {
    background: var(--gradient-primary) !important;
}

.stat-card:hover::before { opacity: 1 !important; }

/* ── CARDS ─────────────────────────────────────────────── */
.card {
    border-radius: var(--border-radius-lg) !important;
    border: 1px solid rgba(0,0,0,.07) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.06) !important;
    transition: box-shadow .3s ease, transform .3s ease !important;
}

.card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,.10) !important;
    transform: translateY(-2px) !important;
}

.card-header {
    background: linear-gradient(135deg, rgba(29,154,120,.06) 0%, rgba(255,255,255,0) 100%) !important;
    border-bottom: 1px solid rgba(29,154,120,.08) !important;
}

/* ── TABLES ────────────────────────────────────────────── */
.table {
    border-collapse: collapse;
    width: 100%;
}

.table thead th {
    background: rgba(29,154,120,.06);
    color: var(--text-dark);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .7px;
    padding: .9rem 1rem;
    border-bottom: 2px solid rgba(29,154,120,.12);
    white-space: nowrap;
}

.table tbody tr {
    transition: background .12s ease;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:nth-child(even) {
    background: rgba(29,154,120,.022);
}

.table tbody tr:hover {
    background: var(--primary-xlight) !important;
}

.table td { padding: .85rem 1rem; font-size: .9rem; }

/* ── BUTTONS ───────────────────────────────────────────── */
.btn {
    position: relative;
    overflow: hidden;
    letter-spacing: .3px;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.16);
    opacity: 0;
    transition: opacity .12s ease;
    pointer-events: none;
}

.btn:active::after { opacity: 1; }

.btn-primary {
    background: var(--gradient-primary) !important;
    box-shadow: 0 2px 10px rgba(29,154,120,.35) !important;
}

.btn-primary:hover {
    box-shadow: 0 6px 22px rgba(29,154,120,.45) !important;
    transform: translateY(-2px);
}

/* ── FORM CONTROLS ─────────────────────────────────────── */
.form-control {
    background: #fff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: .9rem !important;
    transition: border-color .2s, box-shadow .2s, background .2s !important;
}

.form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(29,154,120,.13) !important;
    background: rgba(29,154,120,.01) !important;
}

/* ── SEARCH BOX ────────────────────────────────────────── */
.search-box {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.search-box .material-icons {
    position: absolute;
    left: .75rem;
    color: var(--text-muted);
    font-size: 20px;
    pointer-events: none;
    z-index: 1;
    margin: 0;
}

.search-box input {
    width: 100%;
    padding: .62rem .85rem .62rem 2.5rem;
    background: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-dark);
    font-size: .9rem;
    font-family: var(--font-sans);
    transition: all .2s;
    min-height: 40px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(29,154,120,.12);
}

/* ── MODALS ────────────────────────────────────────────── */
.modal-overlay {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9000;
    padding: 1rem;
}

.modal-overlay[style*="display:none"],
.modal-overlay[style*="display: none"] {
    display: none !important;
}

.modal {
    background: #fff !important;
    border-radius: var(--border-radius-xl) !important;
    box-shadow: 0 24px 64px rgba(0,0,0,.30) !important;
    max-height: 92vh;
    overflow-y: auto;
    width: 100%;
    animation: sacModalIn .22s cubic-bezier(.16,1,.3,1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem 1.75rem !important;
    border-bottom: 1px solid var(--border-color) !important;
    background: linear-gradient(135deg, rgba(29,154,120,.06) 0%, transparent 100%) !important;
}

.modal-header h3 {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    color: var(--text-dark) !important;
    margin: 0;
}

.modal-close {
    background: var(--bg-light) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 34px !important;
    height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    font-size: 1.35rem;
    color: var(--text-muted) !important;
    transition: all .15s !important;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--danger-bg) !important;
    color: var(--danger) !important;
}

.modal-body { padding: 1.75rem !important; }

.modal-footer {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

@keyframes sacModalIn {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

/* ── BADGES ────────────────────────────────────────────── */
.user-role-badge,
.mobile-role-badge {
    font-size: .65rem !important;
    padding: .16rem .55rem !important;
    border-radius: var(--border-radius-pill) !important;
    font-weight: 800 !important;
    letter-spacing: .3px;
}

.role-admin     { background: linear-gradient(135deg, #E53E3E, #C53030) !important; color: #fff !important; }
.role-team_lead { background: linear-gradient(135deg, #FF6B35, #E55A25) !important; color: #fff !important; }
.role-player    { background: linear-gradient(135deg, #3182CE, #2B6CB0) !important; color: #fff !important; }

/* ── TABS ──────────────────────────────────────────────── */
.tab-btn {
    font-weight: 600 !important;
    transition: color .15s, border-color .15s !important;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.tab-btn.active {
    color: var(--primary-color) !important;
    border-bottom-color: var(--primary-color) !important;
    font-weight: 700 !important;
}

/* ── FOOTER — dark match sidebar ───────────────────────── */
.footer {
    background: linear-gradient(135deg,
        #0d1f1a 0%,
        #0f2820 60%,
        #0a1d16 100%) !important;
    color: rgba(255,255,255,.70) !important;
    border-top: none !important;
    padding: 2.25rem 0 1.75rem !important;
}

.footer-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: .6rem !important;
    padding: 0 1.5rem !important;
    max-width: none !important;
}

.footer-brand {
    color: rgba(255,255,255,.92) !important;
    font-weight: 800 !important;
    font-size: 1rem !important;
    display: flex !important;
    align-items: center !important;
    gap: .6rem !important;
}

.footer-text {
    color: rgba(255,255,255,.48) !important;
    font-size: .83rem !important;
    text-align: center;
}

.footer-links {
    display: flex !important;
    gap: 1.25rem !important;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: rgba(255,255,255,.40) !important;
    font-size: .83rem !important;
    font-weight: 600 !important;
    transition: color .2s !important;
}

.footer-links a:hover { color: var(--primary-light) !important; }

.footer-novrox {
    font-size: .78rem;
    color: rgba(255,255,255,.32);
    text-align: center;
    margin-top: .35rem;
}

.footer-novrox a {
    color: var(--primary-light);
    font-weight: 700;
    text-decoration: none;
    transition: color .2s;
}

.footer-novrox a:hover { color: #fff; }

/* ── ALERTS / FLASH ────────────────────────────────────── */
.alert {
    border-radius: var(--border-radius) !important;
    backdrop-filter: blur(8px);
    font-weight: 600;
}

/* ── SCROLLBAR global ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.16); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(29,154,120,.45); }

/* ── Responsive sidebar on mobile ──────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        background: linear-gradient(180deg,
            var(--sidebar-bg-top)    0%,
            var(--sidebar-bg-bottom) 100%) !important;
    }
}