* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary-color: #8b5cf6;
    --secondary-light: #a78bfa;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #1e293b;
    --darker-bg: #0f172a;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%);
    --table-radius: 18px;
    --table-border: rgba(15, 23, 42, 0.08);
    --table-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --table-head-bg: linear-gradient(135deg, rgba(59, 130, 246, 0.92), rgba(139, 92, 246, 0.92));
    --table-head-text: rgba(255, 255, 255, 0.98);
    --table-row-alt: rgba(15, 23, 42, 0.02);
    --table-row-hover: rgba(59, 130, 246, 0.06);
    --table-divider: rgba(15, 23, 42, 0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Login Screen - Stile Chiaro con Sketch */
.login-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 2rem;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
}

/* Background con sketch effetto */
.login-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(248, 250, 252, 0.3) 100%),
        url('images/soccer-sketch.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: 0;
}

.soccer-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
}

/* Login Box pulito e moderno */
.login-box {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    padding: 2rem 2rem;
    border-radius: 1.5rem;
    box-shadow:
        0 20px 60px 0 rgba(0, 0, 0, 0.25),
        0 2px 10px 0 rgba(0, 0, 0, 0.2),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.15);
    width: 100%;
    max-width: 380px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
}

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

/* Logo con scudo e ali */
.login-box .logo {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.logo-shield {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.shield-svg {
    width: 70px;
    height: 70px;
    color: #667eea;
    filter: drop-shadow(0 3px 6px rgba(102, 126, 234, 0.3));
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.wings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 60px;
    pointer-events: none;
}

.wing {
    position: absolute;
    top: 0;
    width: 30px;
    height: 40px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(102, 126, 234, 0.1) 100%);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.wing-left {
    left: -10px;
    transform: rotate(-25deg) scaleX(1.5);
}

.wing-right {
    right: -10px;
    transform: rotate(25deg) scaleX(1.5);
}

.login-box h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 0.5rem;
    color: #1a202c;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.subtitle {
    color: #2d3748;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.form-group {
    margin-bottom: 1.5rem;
}

.login-container .form-group label {
    display: none;
}
.input-icon {
    display: none;
}

/* Input wrapper con icona */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1rem;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    background: rgba(255,255,255,0.08);
    color: #0f172a;
    transition: all 0.3s ease;
}

.input-wrapper input::placeholder {
    color: #475569;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    font-weight: 400;
}

.input-wrapper input:focus {
    outline: none;
    background: rgba(255,255,255,0.12);
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.input-icon {
    position: absolute;
    right: 1.25rem;
    font-size: 1.1rem;
    pointer-events: none;
    color: #a0aec0;
}

/* Bottone Login moderno */
.login-btn {
    position: relative;
    width: 100%;
    padding: 1rem 2rem;
    margin-top: 1.1rem;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 1.25rem;
    background: transparent;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.login-btn.btn-primary {
    background: transparent !important;
    color: #0f172a !important;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15) !important;
    border: 1px solid rgba(255,255,255,0.35) !important;
    text-transform: none !important;
}
.login-btn.btn-primary:hover {
    transform: translateY(-1px);
    background: transparent !important;
    box-shadow: 0 16px 34px rgba(0,0,0,0.2) !important;
}
.login-btn.btn-primary:active {
    background: transparent !important;
}
.login-container .btn-primary span {
    display: inline;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(0,0,0,0.2);
}

.login-btn:active {
    transform: translateY(0px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.btn-icon {
    font-size: 1.1rem;
}

/* Forgot password link */
.forgot-password {
    text-align: center;
    margin-top: 1.5rem;
}

.forgot-password a {
    color: #000000;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-shadow: none;
}

.forgot-password a:hover {
    color: #1a202c;
    text-decoration: underline;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 1);
}

/* Error message per il login */
#login-error.error-message {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #fca5a5;
    border-radius: 1rem;
    font-weight: 500;
}

/* Stili vecchi per compatibilità con altre pagine */
.form-group input:not(.input-wrapper input) {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
}

.form-group input:not(.input-wrapper input):focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.error-message {
    color: var(--danger-color);
    font-size: 0.9rem;
    margin: 1rem 0;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 0.5rem;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

.hidden-permission {
    display: none !important;
}

.main-app {
    display: flex;
    width: 100%;
}

.app-container {
    display: flex;
    min-height: 100vh;
    margin: 0 auto;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background:
        linear-gradient(to right, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.25) 100%),
        url('images/menu-background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow-xl);
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    scrollbar-width: auto;
    scrollbar-color: rgba(255,255,255,0.5) transparent;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: rgba(255,255,255,0.08); }
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.5);
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.logo-icon {
    font-size: 2rem;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0%, 90%, 100% { transform: rotate(0deg); }
    95% { transform: rotate(360deg); }
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.user-menu-dropdown {
    display: none;
}

@keyframes userMenuSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-menu-item {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
    transition: background 0.2s, color 0.2s;
}

.user-menu-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-dark);
}

.user-menu-item span:first-child {
    font-size: 1.25rem;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-start;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    background: transparent;
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    border-bottom: none;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid rgba(59, 130, 246, 0.8);
}

.nav-item .icon {
    font-size: 1.5rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

/* Bold labels in sidebar (desktop) */
.sidebar .nav-item span:not(.icon) {
    font-weight: 700;
}

/* Main Content */
.main-content {
    flex: 1;
    background:
        linear-gradient(135deg, rgba(248, 250, 252, 0.4) 0%, rgba(241, 245, 249, 0.35) 100%),
        url('images/dashboard-background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    overflow-y: auto;
}

.top-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: none;
}

.search-bar {
    position: relative;
    width: 400px;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 3rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.date {
    color: var(--text-secondary);
    font-weight: 500;
}

.content-area {
    padding: 2rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    width: 100%;
    flex-wrap: nowrap;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.page-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: nowrap;
    margin-left: auto;
    justify-content: flex-end;
    flex-shrink: 0;
    align-self: flex-start;
}

.page-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    padding: 1.75rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 20px;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.stat-card:hover::before {
    opacity: 0.05;
}

.stat-icon {
    font-size: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    color: var(--primary-dark);
    background: none;
    box-shadow: none;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.stat-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary-dark);
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.stats-grid.standout {
    margin-top: 1rem;
}

.gradient-text {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
    font-weight: 700;
}

.dashboard-hero .eyebrow {
    color: var(--text-secondary);
}

.muted {
    color: var(--text-secondary);
    font-weight: 500;
}

.section-hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: var(--shadow-md);
}

.section-hero h2.page-title {
    margin: 0.1rem 0 0.35rem 0;
    color: var(--text-primary);
}

.section-subtitle {
    color: var(--text-secondary);
    font-weight: 600;
}

.section-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.section-hero .pill {
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary-dark);
}

.btn-help {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.22);
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary-dark);
    font-weight: 900;
    font-size: 1.15rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-help:hover {
    background: rgba(59, 130, 246, 0.18);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn-help:active { transform: translateY(-1px); }

.modal-content.help-modal {
    max-width: 720px;
}
.modal-content.help-modal #modal-body {
    color: var(--text-secondary);
    font-weight: 600;
}
.help-btn-sample {
    pointer-events: none;
    cursor: default;
    transform: none !important;
}
.help-list {
    margin: 0.75rem 0 0 1.1rem;
    padding: 0;
}
.help-list li { margin: 0.35rem 0; }
.modal-content.help-modal .help-list li strong { color: var(--text-primary); }
.modal-content.help-modal .help-list li .btn { vertical-align: middle; margin-right: 0.5rem; }

.section-actions {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

.page-header.actions-only {
    justify-content: flex-end;
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    gap: 1.75rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 18px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.04);
    align-items: center;
    color: var(--text-primary);
}

.hero-copy .page-title {
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: #f8fafc;
    border: 1px solid var(--border-color);
}

.chip.success {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.35);
}

.chip.neutral {
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary-dark);
    border-color: rgba(59, 130, 246, 0.3);
}

.chip.outline {
    background: rgba(15, 23, 42, 0.02);
    color: var(--text-secondary);
    border-color: rgba(15, 23, 42, 0.08);
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    gap: 1rem;
    min-width: 320px;
}

.hero-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 18px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.kpi-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
}

.kpi-value {
    font-size: 2.4rem;
    color: var(--text-primary);
    font-weight: 800;
    margin: 0.25rem 0;
}

.progress-shell {
    position: relative;
    height: 8px;
    background: rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #60a5fa 0%, #22c55e 100%);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.kpi-sub {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.dashboard-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.dashboard-panels.triple {
    grid-template-columns: repeat(3, minmax(320px, 1fr));
}

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

.card-panel.span-two + .card-panel {
    min-height: 100%;
}

@media (max-width: 1100px) {
    .dashboard-panels.triple {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .card-panel.span-two {
        grid-column: span 1;
    }
}

.card-panel {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.card-panel.wide {
    grid-column: 1 / -1;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary-dark);
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
}

.pill.live {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.compact-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.payments-details {
    display: none;
    background: rgba(248, 250, 252, 0.7);
}

.payments-details .mini-table {
    width: 100%;
    border-collapse: collapse;
}

.payments-details .mini-table th,
.payments-details .mini-table td {
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.payments-details .mini-table th:nth-child(1),
.payments-details .mini-table td:nth-child(1) { width: 22%; }
.payments-details .mini-table th:nth-child(2),
.payments-details .mini-table td:nth-child(2) { width: 18%; text-align: center; }
.payments-details .mini-table th:nth-child(3),
.payments-details .mini-table td:nth-child(3) { width: 18%; text-align: right; }
.payments-details .mini-table th:nth-child(4),
.payments-details .mini-table td:nth-child(4) { width: 18%; }
.payments-details .mini-table th:nth-child(5),
.payments-details .mini-table td:nth-child(5) { width: 24%; text-align: center; }

.staff-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.staff-summary .stat-card {
    margin: 0;
    box-shadow: none;
    padding: 0.5rem 0.65rem;
    border-radius: 10px;
}

.match-row {
    display: grid;
    grid-template-columns: 120px 1fr 120px;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
    box-shadow: var(--shadow-sm);
}

.match-time {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.vs-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.65rem;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-dark);
}

@media (max-width: 768px) {
    .dashboard-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
        text-align: left;
    }

    .hero-copy {
        width: 100%;
    }

    .hero-metrics {
        width: 100%;
        min-width: 0;
        grid-template-columns: 1fr;
    }

    .hero-card {
        width: 100%;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .card-header .pill {
        align-self: flex-start;
    }

    .match-row {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .match-time {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }

    .expiring-cert-card {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .cert-status-info {
        gap: 0.75rem;
    }

    .cert-action-btn {
        width: 100%;
        text-align: center;
    }
}

.match-tournament {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.match-countdown {
    text-align: right;
    font-weight: 700;
    color: var(--primary-dark);
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.insight-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.85rem 1rem;
}

.insight-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.insight-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.status-tile {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: var(--text-primary);
}

.status-tile span {
    color: var(--text-secondary);
    font-weight: 600;
}

.status-tile.clickable {
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    width: 100%;
    text-align: left;
}

.status-tile.clickable:hover {
    background: #eef2ff;
    transform: translateY(-1px);
}

.status-tile.clickable:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.status-tile.clickable:active {
    transform: translateY(0);
}

.reimbursements-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
}

.reimbursements-section .section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.reimbursements-section h4 {
    margin: 0;
}

.reimbursements-section .eyebrow {
    margin-bottom: 0.15rem;
}

.donut-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    align-items: center;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.donut-card.compact {
    grid-template-columns: 160px 1fr;
    padding: 0.75rem;
}

.donut-card.spacious {
    grid-template-columns: 230px 1fr;
    padding: 1rem;
}

.donut-card.stacked {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
}

@media (max-width: 768px) {
    .donut-card,
    .donut-card.compact,
    .donut-card.spacious {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .donut-card .pie-wrapper {
        justify-self: center;
    }

    .donut-card .donut-side {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .insights-grid-cards {
        grid-template-columns: 1fr;
    }

    .mini-bar {
        padding: 0.7rem 0.75rem;
    }

    .mini-bar-label {
        font-size: 0.92rem;
    }

    .pie-chart {
        width: 210px;
        height: 210px;
    }

    .metric-card {
        min-width: 0;
        flex: 1 1 140px;
    }
}

.pie-wrapper {
    position: relative;
    display: inline-block;
}

.pie-chart {
    width: 240px;
    height: 240px;
    display: block;
}

.pie-tooltip {
    position: absolute;
    background: #0f172a;
    color: #fff;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
    pointer-events: none;
    transform: translate(-50%, -120%);
    white-space: nowrap;
    z-index: 2;
}

.donut-card .donut-side {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mini-bars {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.mini-bar {
    padding: 0.75rem 0.85rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(255, 255, 255, 0.95) 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.mini-bar-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: center;
}

.mini-bar-label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    color: #0f172a;
    font-weight: 800;
    font-size: 0.95rem;
}

.mini-bar-label span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-bar-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex: 0 0 10px;
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.22);
}

.mini-bar-value {
    text-align: right;
    font-weight: 900;
    font-size: 0.95rem;
    color: #0f172a;
    white-space: nowrap;
}

.mini-bar-track {
    margin-top: 0.55rem;
    height: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.3);
    overflow: hidden;
}

.mini-bar-fill {
    height: 100%;
    border-radius: 999px;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.15);
}

.provisional-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem;
}

.prov-card {
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
}

.prov-card p {
    margin: 0;
    font-size: 0.9rem;
    color: #475569;
}

.prov-card strong {
    font-size: 1.05rem;
    color: #0f172a;
}

.prov-card.income {
    border-color: #c7f0d9;
    background: #f0fdf4;
}

.prov-card.expense {
    border-color: #fcd9d7;
    background: #fff1f2;
}

.insights-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.attendance-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.attendance-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.attendance-pie {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.pie-wrapper.compact {
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pie-wrapper.compact .pie-chart {
    width: 220px;
    height: 220px;
}

.pie-wrapper.compact .pie-empty {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, #ffffff 55%, #e2e8f0 56%, #cbd5e1 100%);
    color: #475569;
    font-weight: 700;
    box-shadow: inset 0 0 0 10px #f8fafc;
}

.pie-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    padding: 0.5rem 0.9rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    min-width: 120px;
}

.pie-center p {
    margin: 0;
    color: #475569;
    font-size: 0.9rem;
}

.pie-center strong {
    display: block;
    font-size: 1.8rem;
    color: #0f172a;
}

.pie-center small {
    color: #475569;
}

.pie-center.small {
    min-width: 110px;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

.attendance-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    flex: 1;
    min-width: 240px;
}

.breakdown-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    background: #f8fafc;
    box-shadow: 0 12px 28px -20px rgba(0, 0, 0, 0.25);
}

.breakdown-card p {
    margin: 0 0 0.15rem 0;
    color: #475569;
    font-weight: 700;
}

.breakdown-card strong {
    display: block;
    font-size: 1.5rem;
    color: #0f172a;
    line-height: 1.1;
}

.breakdown-card span {
    font-weight: 700;
    color: #475569;
}

.breakdown-card.train {
    border-color: #c7e8ff;
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
}

.breakdown-card.match {
    border-color: #ffd3dd;
    background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
}

.attendance-legend {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
}

.attendance-legend .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.attendance-legend .dot.train { background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%); }
.attendance-legend .dot.match { background: linear-gradient(180deg, #fb7185 0%, #e11d48 100%); }

.attendance-pies {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    align-items: start;
}

.pie-card {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.75rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    box-shadow: 0 12px 28px -20px rgba(0,0,0,0.2);
}

.pie-card .pie-wrapper {
    width: 100%;
}

.pie-card .pie-center {
    background: rgba(255,255,255,0.9);
}

.pie-card .pie-legend {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: #0f172a;
}

.pie-card .pie-legend .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.training-pie-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #f8fafc;
    margin-bottom: 0.75rem;
}

.training-pie-legend {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.95rem;
}

.training-pie-legend .legend-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.training-pie-legend .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.training-pie-legend .dot.present { background: #10b981; }
.training-pie-legend .dot.absent { background: #ef4444; }

.attendance-breakdown-inline {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.attendance-breakdown-inline .chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.65rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    background: #f8fafc;
}

.attendance-breakdown-inline .chip.present {
    border-color: #c7f0d9;
    background: #f0fdf4;
    color: #166534;
}

.attendance-breakdown-inline .chip.absent {
    border-color: #fcd9d7;
    background: #fff1f2;
    color: #9f1239;
}
.finance-metrics {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.metric-card {
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #f8fafc;
    min-width: 140px;
}

.metric-card small {
    display: block;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.15rem;
}

.metric-card strong {
    font-size: 1.05rem;
    color: #0f172a;
}

.metric-card.income {
    border-color: #c7f0d9;
    background: #f0fdf4;
    color: #0f172a;
}

.metric-card.expense {
    border-color: #fcd9d7;
    background: #fff1f2;
    color: #0f172a;
}

.fault-status-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.fault-status-wrapper .tabs {
    margin: 0;
    display: flex;
}

.donut-chart {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
}

.donut-chart.large {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
}

.donut-chart.full {
    border-radius: 50%;
    width: 220px;
    height: 220px;
    display: block;
}

.donut-chart.xl {
    width: 220px;
    height: 220px;
}

.donut-chart::after {
    content: '';
    position: absolute;
    width: 104px;
    height: 104px;
    background: #ffffff;
    border-radius: 50%;
}

.donut-chart.full::after {
    content: none;
}

.donut-center {
    position: relative;
    text-align: center;
    z-index: 1;
    max-width: 130px;
}

.donut-label {
    color: #6b7280;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

.donut-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
}

.donut-sub {
    color: #475569;
    font-weight: 600;
    font-size: 0.9rem;
}

.donut-legend {
    display: grid;
    gap: 0.4rem;
}

.stacked-legend {
    width: 100%;
    margin-top: 0.75rem;
}

.donut-legend.minimal {
    gap: 0.35rem;
}

.legend-row {
    display: grid;
    grid-template-columns: 18px 1fr auto;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #0f172a;
}

.legend-row.total-row {
    margin-top: 0.35rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.35rem;
}

.legend-row.pct-row {
    color: #475569;
    font-weight: 700;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.income {
    background: #10b981;
}

.legend-dot.expense {
    background: #ef4444;
}

.legend-dot.expense-rimborsi {
    background: #ef4444;
}

.legend-dot.expense-compensi {
    background: #3b82f6;
}

.legend-dot.expense-materiali {
    background: #f59e0b;
}

.mini-tournament {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px dashed var(--border-color);
}

.mini-tournament:last-child {
    border-bottom: none;
}

.mini-tournament h4 {
    margin: 0;
    font-size: 1rem;
}

.mini-tournament small {
    color: var(--text-secondary);
}

.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.activity-chip {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #f8fafc;
}

.activity-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.activity-title {
    font-weight: 800;
    color: var(--text-primary);
}

.activity-text {
    color: var(--text-secondary);
    margin-top: 0.15rem;
}
/* Dashboard Sections */
.dashboard-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.recent-matches,
.upcoming-matches {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.recent-matches h3,
.upcoming-matches h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.matches-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.match-item {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s;
}

.match-item:hover {
    border-color: var(--primary-color);
    background: #f8fafc;
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.match-tournament {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.match-score {
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* Teams Grid */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.team-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.team-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.team-header {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.team-badge {
    font-size: 4rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.team-leva {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.8);
    letter-spacing: 0.5px;
}

.team-body {
    padding: 1.5rem;
}

.team-name {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
}

.team-coach {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.team-coach::before {
    content: '👤';
    font-size: 1.1rem;
}

.team-stats {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.team-stat {
    text-align: center;
}

.team-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.team-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.team-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Tournaments Grid */
.tournaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.tournament-card {
    background: white;
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.tournament-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.tournament-header {
    display: flex;
    align-items: start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tournament-icon {
    font-size: 2.5rem;
}

.tournament-info {
    flex: 1;
}

.tournament-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.tournament-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
}

.tournament-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.tournament-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.tournament-detail-label {
    color: var(--text-secondary);
}

.tournament-detail-value {
    font-weight: 600;
}

.tournament-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Matches Grid */
.matches-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.match-card {
    background: white;
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.match-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.match-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.match-tournament-name {
    font-weight: 600;
    color: var(--primary-color);
}

.match-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.match-status.scheduled {
    background: #dbeafe;
    color: #1e40af;
}

.match-status.completed {
    background: #d1fae5;
    color: #065f46;
}

.match-card-body {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    align-items: center;
    gap: 1rem;
}

.match-team {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.match-team.away {
    justify-content: flex-end;
}

.match-team-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.match-team-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.match-card-score {
    text-align: center;
}

.match-score-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.match-vs {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.match-card-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.match-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filters-row label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.filters-row select,
.filters-row input {
    width: 100%;
}

.filters-row.compact {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem;
    align-items: center;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.checkbox-inline {
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1.2rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon-only {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
}

.btn-icon-only span {
    display: block;
    font-size: 1.8rem;
    line-height: 1;
    transition: transform 0.2s ease, scale 0.2s ease;
}

.btn-icon-only:hover span {
    transform: translateX(2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 2vh 0;
}

.modal-content {
    background: white;
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Larger modal for wizard */
.modal-content:has(.tournament-wizard) {
    max-width: 1400px !important;
    width: 95% !important;
    max-height: 90vh !important;
    height: 90vh !important;
    overflow: auto !important;
    margin: 2vh auto !important;
}

.modal-content:has(.tournament-wizard) .modal-body {
    max-height: calc(90vh - 120px) !important;
    height: calc(90vh - 120px) !important;
    overflow-y: auto !important;
    padding: 1rem !important;
}

/* Wizard modal class (fallback if :has() not supported) */
.modal-content.wizard-modal {
    max-width: 1400px !important;
    width: 95% !important;
    max-height: 90vh !important;
    height: 90vh !important;
    overflow: auto !important;
    margin: 2vh auto !important;
}

.modal-content.wizard-modal .modal-body {
    max-height: calc(90vh - 120px) !important;
    height: calc(90vh - 120px) !important;
    overflow-y: auto !important;
    padding: 1rem !important;
}

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

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.close {
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    transition: color 0.3s;
}

.close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input[type="color"] {
    height: 50px;
    cursor: pointer;
}

.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    padding: 0;
    margin: 0 0.5rem 0 0;
    border: none;
    border-radius: 4px;
    accent-color: var(--primary-color);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.info-banner {
    padding: 0.6rem 0.75rem;
    background: #f1f5f9;
    border-left: 4px solid #0ea5e9;
    border-radius: 8px;
    color: #0f172a;
    font-size: 0.95rem;
}

.score-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.score-section h4 {
    margin-bottom: 1rem;
}

.score-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state.small {
    padding: 1.25rem;
    font-size: 0.9rem;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state-text {
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }

    .logo h1,
    .nav-item span:not(.icon) {
        display: none;
    }

    .logo {
        justify-content: center;
    }

    .nav-item {
        justify-content: center;
    }

    .search-bar {
        width: 100%;
    }

    .top-bar {
        flex-direction: column;
        gap: 1rem;
    }

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

    .dashboard-sections {
        grid-template-columns: 1fr;
    }

    .teams-grid {
        grid-template-columns: 1fr;
    }

    .tournaments-grid {
        grid-template-columns: 1fr;
    }

    .match-card-body {
        grid-template-columns: 1fr;
        text-align: center;
    }

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

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Teams Selection in Tournament Modal */
.teams-selection {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
}

.team-checkbox-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.team-checkbox-item:hover {
    background: #f8fafc;
}

.team-checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.team-checkbox-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.team-checkbox-info {
    flex: 1;
}

.team-checkbox-name {
    font-weight: 600;
    font-size: 1rem;
}

.team-checkbox-leva {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Large Modal for Bracket */
.modal-large .modal-content-large {
    max-width: 1200px;
    width: 95%;
    height: 90vh;
}

.modal-large .modal-body {
    padding: 0;
    height: calc(90vh - 80px);
}

/* Expiring Certificates List */
.expiring-certs-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
    max-height: 70vh;
    overflow-y: auto;
}

.expiring-cert-card {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr;
    gap: 1rem;
    padding: 1.25rem;
    background: white;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s;
    align-items: center;
}

.expiring-cert-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.expiring-cert-card.no-certificate {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
}

.expiring-cert-card.expired {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}

.expiring-cert-card.expiring {
    border-left: 4px solid #eab308;
    background: #fefce8;
}

.cert-player-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
}

.cert-team {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.cert-status-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cert-expiry-date {
    margin: 0;
    font-size: 0.875rem;
    color: #475569;
}

.cert-status-badge {
    margin: 0;
}

.badge-no-cert,
.badge-expired,
.badge-expiring {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.813rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-no-cert {
    background: #fee2e2;
    color: #991b1b;
}

.badge-expired {
    background: #fed7aa;
    color: #9a3412;
}

.badge-expiring {
    background: #fef08a;
    color: #854d0e;
}

.cert-action {
    display: flex;
    justify-content: flex-end;
}

.cert-action-btn {
    align-self: flex-start;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}

.no-data {
    text-align: center;
    padding: 3rem;
    color: #10b981;
    font-size: 1.125rem;
    font-weight: 600;
}

.loading-text {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

/* Bracket Container */
.bracket-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: 100%;
}

.bracket-sidebar {
    background: #f8fafc;
    padding: 1.5rem;
    border-right: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bracket-sidebar h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.bracket-teams-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bracket-team-item {
    padding: 0.75rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s;
}

.bracket-team-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.bracket-team-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.bracket-team-badge {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.bracket-team-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.bracket-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.bracket-main {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.bracket-header {
    margin-bottom: 1.5rem;
}

.bracket-header h4 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.bracket-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.bracket-schedule {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.bracket-match-slot {
    background: white;
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    min-height: 100px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s;
}

.bracket-match-slot.drag-over {
    border-color: var(--primary-color);
    background: #eff6ff;
    border-style: solid;
}

.bracket-match-slot.complete {
    border-style: solid;
    border-color: var(--success-color);
    background: #f0fdf4;
}

.bracket-slot-team {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 12px;
    min-height: 60px;
    position: relative;
}

.bracket-slot-team.home {
    justify-content: flex-start;
}

.bracket-slot-team.away {
    justify-content: flex-end;
}

.bracket-slot-team.empty {
    border: 2px dashed var(--border-color);
    background: white;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.bracket-slot-team.filled {
    background: white;
    border: 2px solid var(--border-color);
}

.bracket-slot-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.bracket-slot-team:hover .bracket-slot-remove {
    opacity: 1;
}

.bracket-slot-vs {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-secondary);
    text-align: center;
}

.bracket-match-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.bracket-match-info input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    flex: 1;
}

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

/* Drag and Drop States */
.draggable {
    cursor: grab;
    user-select: none;
}

.draggable:active {
    cursor: grabbing;
}

.drop-zone {
    transition: all 0.3s;
}

.drop-zone.drag-over {
    background: #eff6ff;
    border-color: var(--primary-color);
}

/* Tournament Card Enhancement */
.tournament-card {
    position: relative;
}

.tournament-manage-btn {
    margin-top: 0.5rem;
}

/* Bracket Tabs */
.bracket-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.5rem;
    border-bottom: 2px solid var(--border-color);
    background: #f8fafc;
}

.bracket-tab {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.bracket-tab:hover {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

.bracket-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.bracket-tab-content {
    display: none;
    height: calc(100% - 60px);
}

.bracket-tab-content.active {
    display: block;
}

/* Groups Management */
.groups-container {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.groups-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.groups-header h4 {
    font-size: 1.25rem;
}

.groups-content {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.group-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    height: fit-content;
}

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

.group-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.group-teams-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.group-team-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.group-team-item:hover {
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.group-team-position {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.group-team-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.group-team-info {
    flex: 1;
}

.group-team-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.group-team-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.group-team-remove {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.group-team-item:hover .group-team-remove {
    opacity: 1;
}

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

/* Knockout Bracket */
.knockout-container {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.knockout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.knockout-header h4 {
    font-size: 1.25rem;
}

.knockout-controls {
    display: flex;
    gap: 0.5rem;
}

.knockout-bracket {
    flex: 1;
    overflow: auto;
    background: #f8fafc;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.knockout-rounds {
    display: flex;
    justify-content: space-around;
    gap: 3rem;
    min-width: fit-content;
}

.knockout-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 2rem;
    min-width: 250px;
}

.knockout-round-title {
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.knockout-match {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
}

.knockout-match:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.knockout-match.completed {
    border-color: var(--success-color);
    background: #f0fdf4;
}

.knockout-match.upcoming {
    border-style: dashed;
    opacity: 0.7;
}

.knockout-match-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.knockout-team {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: #f8fafc;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
}

.knockout-team:last-child {
    margin-bottom: 0;
}

.knockout-team.winner {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 2px solid var(--success-color);
    font-weight: 700;
}

.knockout-team.loser {
    opacity: 0.5;
}

.knockout-team.empty {
    border: 2px dashed var(--border-color);
    background: white;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.knockout-team-badge {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.knockout-team-name {
    flex: 1;
    font-weight: 600;
}

.knockout-team-score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 30px;
    text-align: center;
}

.knockout-vs {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.25rem 0;
}

.knockout-match-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.knockout-match-actions button {
    flex: 1;
}

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

.knockout-winner-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #8b4513;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Empty State for Knockout */
.knockout-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
}

.knockout-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.knockout-empty-text {
    font-size: 1.1rem;
}

/* Responsive Bracket */
@media (max-width: 1024px) {
    .bracket-container {
        grid-template-columns: 1fr;
    }

    .bracket-sidebar {
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        max-height: 200px;
    }

    .modal-large .modal-content-large {
        width: 98%;
        height: 95vh;
    }

    .groups-content {
        grid-template-columns: 1fr;
    }

    .knockout-rounds {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .bracket-match-slot {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .bracket-slot-vs {
        transform: rotate(90deg);
    }

    .bracket-tabs {
        flex-wrap: wrap;
    }

    .bracket-tab {
        flex: 1;
        min-width: 120px;
    }
}

/* Additional Styles for Supervisor */
.role-badge {
    background: var(--warning-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    text-align: center;
    margin-top: 0.5rem;
    font-weight: 600;
}

.nav-footer {
    padding: 1rem;
    margin-top: auto;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 1.5rem 0;
}

/* Card Styling for Supervisor Portal */
.data-grid .card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
}

.data-grid .card:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(102, 126, 234, 0.5);
}

.data-grid .card h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: white;
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    padding: 0.75rem 1.25rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    letter-spacing: 0.5px;
    text-align: center;
}

.data-grid .card p {
    margin: 0.75rem 0;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.08) 100%);
    border-left: 3px solid var(--warning-color);
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.data-grid .card p strong {
    display: inline-block;
    min-width: 120px;
    color: var(--warning-color);
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.card-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.card-header h3 {
    margin: 0;
    flex-shrink: 0;
}

.card-header .card-actions {
    margin-top: 0.5rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    padding: 0.75rem;
    background: var(--card-bg);
    border-left: 3px solid var(--primary-color);
    border-radius: 0.5rem;
}

.btn-block {
    width: 100%;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
}

/* Welcome modal (primo accesso) */
.modal-content.welcome-modal {
    position: relative;
    max-width: 760px;
    padding: 0;
    overflow: hidden;
    border-radius: 20px;
}

.modal-content.welcome-modal #modal-title {
    display: none;
}

.modal-content.welcome-modal #modal-body {
    padding: 0;
}

.modal-content.welcome-modal .close {
    position: absolute;
    top: 14px;
    right: 18px;
    float: none;
    z-index: 2;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 10px 22px rgba(15, 23, 42, 0.25);
}

.modal-content.welcome-modal .close:hover,
.modal-content.welcome-modal .close:focus {
    color: #ffffff;
}

.welcome-modal-shell {
    display: grid;
    gap: 0;
}

.welcome-hero {
    padding: 1.5rem 1.6rem 1.3rem;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.25), transparent 55%),
        linear-gradient(135deg, #4f46e5 0%, #9333ea 55%, #ec4899 100%);
    color: #ffffff;
}

.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.welcome-hero h2 {
    margin: 0.75rem 0 0;
    font-size: 1.75rem;
    line-height: 1.15;
}

.welcome-hero p {
    margin: 0.4rem 0 0;
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.92);
}

.welcome-grid {
    display: grid;
    gap: 1rem;
    padding: 1.4rem 1.6rem 1.15rem;
    background: #ffffff;
}

.welcome-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1rem 1.1rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.welcome-card h4 {
    margin: 0 0 0.55rem;
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}

.welcome-card p {
    margin: 0;
    color: #475569;
    line-height: 1.55;
}

.welcome-card ul {
    margin: 0;
    padding-left: 1.25rem;
    color: #475569;
    line-height: 1.55;
}

.welcome-card li + li {
    margin-top: 0.35rem;
}

.welcome-card a {
    color: #4f46e5;
    font-weight: 800;
    text-decoration: none;
}

.welcome-card a:hover {
    text-decoration: underline;
}

.welcome-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0 1.6rem 1.6rem;
    background: #ffffff;
}

.welcome-actions .btn {
    padding: 0.85rem 1.2rem;
    border-radius: 12px;
}

.welcome-actions .welcome-dismiss-btn {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    box-shadow: none;
}

.welcome-actions .welcome-dismiss-btn:hover {
    background: #eef2f7;
    transform: translateY(-2px);
}

@media (min-width: 720px) {
    .welcome-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover,
.close:focus {
    color: var(--danger-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    background-color: white;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Users Section */
.user-group {
    margin-bottom: 2rem;
}

.user-group h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.25rem;
}

/* Users Table */
.users-table-container {
    margin-top: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(255, 255, 255, 0.9);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9rem;
    min-width: 800px;
    table-layout: fixed;
}

.users-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.users-table th {
    padding: 0.875rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.users-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s;
}

.users-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.users-table tbody tr:hover {
    background-color: #f9fafb;
}

.users-table tbody tr:last-child {
    border-bottom: none;
}

.users-table td {
    padding: 0.75rem 0.75rem;
    vertical-align: middle;
    font-size: 0.9rem;
    word-break: break-word;
}

.users-table td:first-child {
    font-weight: 500;
}

/* Rendi alcune colonne più strette */
.users-table th:nth-child(1), /* Username */
.users-table td:nth-child(1) {
    width: 10%;
    min-width: 100px;
}

.users-table th:nth-child(2), /* Nome */
.users-table td:nth-child(2) {
    width: 12%;
    min-width: 120px;
}

.users-table th:nth-child(3), /* Email */
.users-table td:nth-child(3) {
    width: 18%;
    min-width: 150px;
    word-break: break-word;
}

.users-table th:nth-child(4), /* Ruolo */
.users-table td:nth-child(4) {
    width: 10%;
    min-width: 100px;
}

.users-table th:nth-child(5), /* Società */
.users-table td:nth-child(5) {
    width: 15%;
    min-width: 120px;
}

.users-table th:nth-child(6), /* Stato */
.users-table td:nth-child(6) {
    width: 8%;
    min-width: 80px;
    text-align: center;
}

.users-table th:nth-child(7), /* Ultimo Accesso */
.users-table td:nth-child(7) {
    width: 12%;
    min-width: 110px;
    font-size: 0.85rem;
}

.users-table th:nth-child(8), /* Azioni */
.users-table td:nth-child(8) {
    width: 15%;
    min-width: 150px;
}

/* Tabella giocatori (pannello organizzazione) */
#players-list .users-table {
    table-layout: auto;
    min-width: 1100px;
}

#players-list .users-table th[data-col-key="full_name"],
#players-list .users-table td[data-col-key="full_name"] {
    width: 140px !important;
    min-width: 120px !important;
    max-width: 180px !important;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

#players-list .users-table th[data-col-key="leva"],
#players-list .users-table td[data-col-key="leva"] {
    min-width: 80px;
    width: auto;
}

#players-list .users-table th[data-col-key="parents"],
#players-list .users-table td[data-col-key="parents"] {
    width: 150px !important;
    min-width: 130px !important;
    max-width: 170px !important;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

#players-list .users-table th[data-col-key="group"],
#players-list .users-table td[data-col-key="group"] {
    width: 70px !important;
    min-width: 70px !important;
    max-width: 80px !important;
    text-align: left;
}

#players-list .users-table th[data-col-key="email"],
#players-list .users-table td[data-col-key="email"] {
    width: 150px !important;
    min-width: 130px !important;
    max-width: 200px !important;
    word-break: break-word;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

#players-list .users-table th[data-col-key="public_username"],
#players-list .users-table td[data-col-key="public_username"] {
    width: 120px !important;
    min-width: 100px !important;
    max-width: 150px !important;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

#players-list .users-table th[data-col-key="position"],
#players-list .users-table td[data-col-key="position"] {
    width: 110px !important;
    min-width: 90px !important;
    max-width: 140px !important;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Tornei: colonne più strette e azioni compatte */
#tournaments-list .users-table {
    min-width: 720px;
}

#tournaments-list .users-table th:nth-child(1),
#tournaments-list .users-table td:nth-child(1) {
    width: 22%;
}

#tournaments-list .users-table th:nth-child(2),
#tournaments-list .users-table td:nth-child(2) {
    width: 14%;
}

#tournaments-list .users-table th:nth-child(3),
#tournaments-list .users-table td:nth-child(3),
#tournaments-list .users-table th:nth-child(4),
#tournaments-list .users-table td:nth-child(4) {
    width: 15%;
}

#tournaments-list .users-table th:nth-child(5),
#tournaments-list .users-table td:nth-child(5) {
    width: 12%;
    text-align: center;
}

#tournaments-list .users-table th:nth-child(6),
#tournaments-list .users-table td:nth-child(6) {
    width: 22%;
    text-align: center !important;
}

#tournaments-list .users-table td.tight-actions {
    padding: 0.55rem 0.5rem;
    text-align: center !important;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    margin: 0 auto;
}

.table-actions .btn-icon {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.table-actions .btn-icon:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.table-actions .btn-icon.danger {
    background: #fef2f2;
    border-color: #fecdd3;
    color: #b91c1c;
}

.table-actions .btn-icon.danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Dimensioni specifiche per la tabella delle leve (4 colonne) */
#teams-list .users-table th:nth-child(1), /* Leva */
#teams-list .users-table td:nth-child(1) {
    width: 25%;
    min-width: 150px;
}

#teams-list .users-table th:nth-child(2), /* Mister */
#teams-list .users-table td:nth-child(2) {
    width: 30%;
    min-width: 180px;
}

#teams-list .users-table th:nth-child(3), /* Giocatori */
#teams-list .users-table td:nth-child(3) {
    width: 20%;
    min-width: 100px;
    text-align: center;
}

#teams-list .users-table th:nth-child(4), /* Azioni */
#teams-list .users-table td:nth-child(4) {
    width: 25%;
    min-width: 150px;
    text-align: center;
}

/* Colonna gruppo (tabella giocatori) */
.users-table th[data-col-key="group"],
.users-table td[data-col-key="group"] {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 70px !important;
    text-align: left;
}

/* Colonna azioni (tabella giocatori) */
.users-table th[data-col-key="actions"],
.users-table td[data-col-key="actions"] {
    width: 140px !important;
    min-width: 120px !important;
    max-width: 160px !important;
    text-align: center;
}

/* Colonna certificato (tabella giocatori) */
.users-table th[data-col-key="cert"],
.users-table td[data-col-key="cert"] {
    width: 150px !important;
    min-width: 140px !important;
    max-width: 180px !important;
    text-align: left;
}

/* Barre filtri (giocatori / staff) */
.players-filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    align-items: end;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.players-filter-bar .filter-field label {
    display: block;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.players-filter-bar .filter-field input,
.players-filter-bar .filter-field select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #fff;
}

.players-filter-bar .filter-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
}

.cert-expiry-cell {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: flex-start;
    text-align: left;
}

.cert-status {
    font-size: 0.85rem;
    font-weight: 700;
}

.cert-status.warning {
    color: #b45309;
}

.cert-status.ok {
    color: #15803d;
}

.cert-status.expired {
    color: #b91c1c;
}

.cert-file.ok {
    color: #15803d;
    font-weight: 700;
}

.cert-file.missing {
    color: #b91c1c;
    font-weight: 700;
}

/* Parents Table */
.parents-table {
    min-width: 600px;
}

.parents-table th:nth-child(1),
.parents-table td:nth-child(1) {
    width: 28%;
    min-width: 200px;
}

.parents-table th:nth-child(2),
.parents-table td:nth-child(2) {
    width: 22%;
    min-width: 180px;
}

.parents-table th:nth-child(3),
.parents-table td:nth-child(3) {
    width: 28%;
    min-width: 200px;
}

.parents-table th:nth-child(4),
.parents-table td:nth-child(4) {
    width: 12%;
    min-width: 120px;
    text-align: center;
}

.parent-user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.parent-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--secondary-color);
}

.parent-name {
    font-weight: 600;
}

.parent-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.parent-contact-lines span {
    display: block;
    margin-bottom: 0.25rem;
    white-space: nowrap;
}

.parents-table td:nth-child(2) .parent-contact-lines span {
    margin-bottom: 0.15rem;
}

.parent-contact-lines a {
    color: inherit;
    text-decoration: underline;
}

.parent-players-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.parent-player-chip {
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.parent-empty-players {
    color: var(--text-secondary);
    font-style: italic;
}

.parent-player-list {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
    background: rgba(248, 250, 252, 0.6);
}

.parent-player-option {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.4rem 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s, border 0.2s;
    border: 1px solid transparent;
}

.parent-player-option:hover {
    background: #fff;
    border-color: var(--border-color);
}

.parent-player-option input {
    margin-top: 0.3rem;
}

.parent-player-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.parent-player-filter label {
    font-weight: 600;
    color: var(--text-secondary);
}

.parent-player-filter select {
    min-width: 160px;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    background: white;
}

.parent-player-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.parent-player-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    align-items: start;
}

.reminders-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(360px, 1fr));
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 900px) {
    .reminders-panels {
        grid-template-columns: 1fr;
    }
}

.form-grid .form-group {
    margin-bottom: 0;
}

.form-grid > .form-actions,
.form-grid > .modal-actions,
.form-grid > .form-message,
.form-grid > .chip-row,
.form-grid > .pill {
    grid-column: 1 / -1;
}

.full-width {
    grid-column: 1 / -1;
}

.check-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rem-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.7);
    border: 1px solid rgba(226, 232, 240, 0.95);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, border 0.15s ease;
}

.rem-toggle:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.rem-toggle-title {
    font-weight: 800;
    color: var(--text-primary);
}

.rem-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.rem-switch {
    margin-left: auto;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.45);
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s ease, border 0.2s ease;
}

.rem-switch::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #ffffff;
    transform: translateY(-50%);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
    transition: transform 0.2s ease;
}

.rem-toggle input[type="checkbox"]:checked + .rem-switch {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.55);
}

.rem-toggle input[type="checkbox"]:checked + .rem-switch::before {
    transform: translate(20px, -50%);
}

.rem-toggle input[type="checkbox"]:focus-visible + .rem-switch {
    outline: 2px solid rgba(37, 99, 235, 0.45);
    outline-offset: 2px;
}

.rem-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.rem-chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.rem-chip span {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.75rem;
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.75);
    border: 1px solid rgba(226, 232, 240, 0.95);
    font-weight: 750;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, border 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.rem-chip:hover span {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--text-primary);
}

.rem-chip input[type="checkbox"]:checked + span {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
    color: var(--primary-dark);
}

.rem-chip input[type="checkbox"]:checked + span::before {
    content: '✓';
    font-weight: 900;
    margin-right: 0.35rem;
}

.rem-chip input[type="checkbox"]:focus-visible + span {
    outline: 2px solid rgba(37, 99, 235, 0.45);
    outline-offset: 2px;
}

.reminders-team-select {
    min-width: 220px;
    width: auto;
    flex: 1 1 240px;
}

.reminders-result {
    padding: 0.85rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    line-height: 1.6;
}

.parent-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.form-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.role-badge.role-admin {
    background: #fef3c7;
    color: #92400e;
}

.role-badge.role-org-admin {
    background: #dbeafe;
    color: #1e40af;
}

.role-badge.role-coach {
    background: #d1fae5;
    color: #065f46;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.active {
    color: #065f46;
    background: #d1fae5;
}

.status-badge.inactive {
    color: #991b1b;
    background: #fee2e2;
}

/* Action Buttons */
.actions-cell {
    white-space: nowrap;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
    width: 100%;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 0.4rem;
    transition: all 0.2s;
}

.col-resize {
    display: none;
}

.draggable-header {
    position: relative;
    user-select: none;
    padding-right: 12px;
}

.draggable-header.dragging {
    opacity: 0.6;
}

.col-resizing, .col-resizing * {
    cursor: default !important;
}

.btn-icon:hover {
    background: #f3f4f6;
    transform: scale(1.1);
}

.btn-icon.success:hover {
    background: #d1fae5;
}

.btn-icon.warning:hover {
    background: #fef3c7;
}

.btn-icon.danger:hover {
    background: #fee2e2;
    transform: scale(1.15);
}

/* Responsive Table */
@media (max-width: 1200px) {
    .users-table {
        font-size: 0.85rem;
    }

    .users-table th,
    .users-table td {
        padding: 0.75rem 0.5rem;
    }

    .btn-icon {
        font-size: 1.1rem;
        padding: 0.25rem;
    }
}

/* Tournament Management Styles */
.tournament-management {
    padding: 1rem;
}

.management-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.tabs {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.4rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    margin: 0.25rem 0 0.75rem 0;
}

.tab-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-start;
    margin: 0.25rem 0 0.75rem 0;
}

.tab-row .tabs {
    margin: 0;
}

.tab-btn {
    padding: 0.55rem 1.15rem;
    background: #ffffff;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    color: #475569;
    transition: all 0.18s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

@media (max-width: 640px) {
    .tab-row {
        flex-direction: column;
        align-items: stretch;
    }
    .tab-row .tabs {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 0.35rem;
    }
    .tab-row .tabs .tab-btn {
        width: 100%;
        text-align: center;
    }
    .tab-row > div {
        width: 100%;
        display: flex;
        gap: 0.4rem;
        flex-wrap: wrap;
    }
    .tab-row input[type="date"] {
        flex: 1;
        min-width: 0;
    }
    .tab-row .btn.btn-secondary {
        width: 100%;
        justify-content: center;
    }
    #finance-range-label,
    #attendance-range-label {
        display: block;
        margin-top: 0.2rem;
    }
}

.tab-btn:hover {
    color: #1e293b;
    border-color: rgba(37, 99, 235, 0.2);
    background: #eef2ff;
}

.tab-btn.active {
    color: #ffffff;
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 8px 18px -8px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.tab-btn:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.4);
    outline-offset: 2px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Fault materials status row: keep width on content but force its own line */
#fault-material-status-tabs {
    display: none;
}

/* Player assignment modal */
.player-checkbox-wrapper {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.6rem;
    background: #f8fafc;
}

.player-checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.35rem 0.75rem;
}

.player-check-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.65rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, border 0.15s ease;
}

.player-check-row:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.player-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--primary-color);
}

.player-check-name {
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
}

/* Groups Container */
.groups-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.groups-section,
.teams-section {
    background: #f9fafb;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h4 {
    margin: 0;
    font-size: 1.125rem;
    color: #111827;
}

.filter-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.form-control-small {
    padding: 0.375rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

/* Groups List */
.groups-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.group-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s;
}

.group-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.group-header h5 {
    margin: 0;
    font-size: 1rem;
    color: #111827;
}

.group-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-tiny {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-tiny:hover {
    transform: scale(1.05);
}

/* Drop Zone */
.drop-zone {
    min-height: 100px;
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 0.75rem;
    background: #f9fafb;
    transition: all 0.2s;
}

.drop-zone.drag-over {
    border-color: #2563eb;
    background: #eff6ff;
}

.drop-hint {
    text-align: center;
    color: #9ca3af;
    padding: 2rem 0;
    margin: 0;
}

/* Team Items */
.team-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.team-item:last-child {
    margin-bottom: 0;
}

.team-item.draggable {
    cursor: move;
}

.team-item.draggable:hover {
    background: #f3f4f6;
    border-color: #2563eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.team-item.dragging {
    opacity: 0.5;
}

.drag-handle {
    color: #9ca3af;
    cursor: grab;
    font-size: 1.25rem;
    line-height: 1;
}

.drag-handle:active {
    cursor: grabbing;
}

.btn-remove {
    margin-left: auto;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Available Teams */
.teams-pool {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 600px;
    overflow-y: auto;
}

.available-team {
    cursor: default;
}

.team-leva {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    background: transparent;
    padding: 0;
    margin: 0;
}

/* Match Generator */
.matches-generation {
    padding: 2rem;
}

.match-generator-form {
    max-width: 500px;
    margin: 0 auto;
    background: #f9fafb;
    padding: 2rem;
    border-radius: 0.75rem;
}

.match-generator-form .form-group {
    margin-bottom: 1.5rem;
}

.match-generator-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.match-generator-form .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
}

/* Standings */
.standings-group {
    margin-bottom: 2rem;
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.standings-group h4 {
    margin: 0 0 1rem 0;
    color: #111827;
    font-size: 1.25rem;
}

.standings-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.standings-table thead {
    background: #f9fafb;
}

.standings-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.standings-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.standings-table tbody tr:hover {
    background: #f9fafb;
}

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

/* Responsive Tournament Management */
@media (max-width: 1024px) {
    .groups-container {
        grid-template-columns: 1fr;
    }

    .management-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 0.5rem 0.85rem;
        font-size: 0.875rem;
    }
}

/* =====================================================
   TOURNAMENT WIZARD STYLES
   ===================================================== */

.tournament-wizard {
    min-height: 0 !important;
    height: auto !important;
    display: flex;
    flex-direction: column;
}

/* Wizard Header with Actions */
.wizard-header {
    position: relative;
    margin-bottom: 1rem;
}

.wizard-actions-top {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.wizard-actions-top .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Progress Bar */
.wizard-progress {
    margin-bottom: 0;
    background: #f9fafb;
    padding: 1.5rem;
    padding-right: 250px; /* Space for buttons */
    border-radius: 0.75rem;
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: #e5e7eb;
    z-index: 0;
}

.progress-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-step.active .step-number {
    background: #2563eb;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.progress-step.completed .step-number {
    background: #10b981;
    color: white;
}

.step-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    text-align: center;
}

.progress-step.active .step-label {
    color: #2563eb;
    font-weight: 700;
}

/* Wizard Content */
.wizard-content {
    flex: 1;
    padding: 1rem;
    max-height: none !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
}

.wizard-step h3 {
    color: #111827;
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.step-description {
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Wizard Actions */
/* Old wizard actions (bottom) - removed, now using wizard-actions-top */
/* .wizard-actions {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem;
    border-top: 2px solid #e5e7eb;
    background: #f9fafb;
    margin-top: auto;
} */

/* STEP 1: Groups Configuration */
.step-groups {
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.groups-config-form {
    max-width: 600px;
    margin: 0 auto;
    flex: 1;
    overflow-y: auto;
}

.form-group-large {
    margin-bottom: 2rem;
}

.form-group-large label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.form-control-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.25rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    text-align: center;
    transition: all 0.2s;
}

.form-control-large:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group-large small {
    display: block;
    margin-top: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.existing-groups-info {
    margin-bottom: 2rem;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-info {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    color: #1e40af;
}

.alert-success {
    background: #f0fdf4;
    border-left: 4px solid #10b981;
    color: #065f46;
}

.preview-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 0.75rem;
    border: 2px solid #e5e7eb;
    max-height: 600px;
    overflow-y: auto;
}

.preview-section h4 {
    margin-bottom: 1rem;
    color: #374151;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
    padding-bottom: 0.5rem;
}

.groups-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
}

.group-preview-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.group-preview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.group-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.group-name {
    font-weight: 700;
    font-size: 1rem;
}

/* STEP 2: Teams Assignment */
.teams-assignment-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    height: auto;
    min-height: 0;
}

.available-teams-panel {
    background: #f9fafb;
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.panel-header h4 {
    margin: 0;
    color: #374151;
    font-size: 1rem;
    width: 100%;
}

.search-box {
    width: 100%;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-results-count {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    font-weight: 600;
}

.teams-pool-wizard {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-prompt {
    text-align: center;
    color: #9ca3af;
    padding: 3rem 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.team-item-wizard {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.2s;
    position: relative;
}

.team-item-wizard.available {
    cursor: grab;
    touch-action: none;
}

/* Custom modal sizes */
.modal-content.modal-large {
    max-width: 1100px;
    width: 95%;
}

@media (min-width: 1024px) {
    .modal-content.fee-details-modal h3 {
        font-size: 2.25rem;
    }

    .modal-content.fee-details-modal .users-table-container {
        max-height: 65vh;
        overflow-y: auto;
    }
}

.team-item-wizard.available:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.team-item-wizard .team-name {
    flex: 1;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.team-item-wizard .team-leva,
.group-dropzone .team-leva {
    color: #6b7280;
    font-size: 0.875rem;
    background: #f3f4f6;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    position: static;
    top: auto;
    right: auto;
    margin-left: 0;
    flex-shrink: 0;
    line-height: 1.1;
}

.btn-quick-add {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-quick-add:hover {
    background: #1d4ed8;
    transform: scale(1.1);
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    padding: 0.5rem;
}

.group-card-wizard {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem;
    height: fit-content;
}

.group-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.group-card-header h4 {
    margin: 0;
    color: #111827;
    font-size: 1.1rem;
}

.team-counter {
    background: #eff6ff;
    color: #2563eb;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.group-dropzone {
    min-height: 150px;
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 0.75rem;
    background: #f9fafb;
    transition: all 0.2s;
}

.group-dropzone.drag-over {
    border-color: #2563eb;
    border-width: 3px;
    background: #eff6ff;
    box-shadow: inset 0 0 20px rgba(37, 99, 235, 0.1);
    animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.team-item-wizard.assigned {
    background: #f3f4f6;
    border-color: #d1d5db;
    cursor: move;
}

.team-item-wizard.draggable {
    cursor: grab;
    touch-action: none;
}

.team-item-wizard.draggable:active {
    cursor: grabbing;
}

.team-item-wizard.draggable:hover {
    background: white;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    transform: translateY(-2px);
}

.team-item-wizard.dragging {
    opacity: 0.4;
    transform: scale(0.95);
    border: 2px dashed #2563eb;
}

.btn-remove-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: none;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove-small:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* STEP 3: Match Calendar */
.calendar-config {
    max-width: 800px;
    margin: 0 auto;
}

.match-type-selection {
    margin-bottom: 2rem;
}

.match-type-selection h4 {
    margin-bottom: 1rem;
    color: #374151;
}

.radio-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.radio-card {
    position: relative;
    cursor: pointer;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.card-content {
    padding: 1.5rem;
    border: 3px solid #e5e7eb;
    border-radius: 0.75rem;
    background: white;
    transition: all 0.2s;
    text-align: center;
}

.radio-card input:checked + .card-content {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.card-content:hover {
    border-color: #93c5fd;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.card-title {
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.card-description {
    color: #6b7280;
    font-size: 0.9rem;
}

.calendar-preview {
    margin-top: 2rem;
}

.calendar-preview h4 {
    margin-bottom: 1rem;
    color: #374151;
}

.calendar-day-card {
    transition: border-color 0.2s ease, background 0.2s ease;
}

.calendar-day-card.calendar-drop-target {
    border-color: #2563eb !important;
    background: #eff6ff !important;
}

.calendar-event-draggable {
    cursor: grab;
    touch-action: none;
}

.calendar-event-dragging {
    opacity: 0.7;
    cursor: grabbing;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.preview-table thead {
    background: #f3f4f6;
}

.preview-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.preview-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.preview-table tbody tr:hover {
    background: #f9fafb;
}

/* Responsive fixes for Tournament Wizard */
@media (max-width: 1200px) {
    .modal-content.modal-large {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .tournament-wizard {
        min-height: auto !important;
    }

    .wizard-progress {
        padding: 1rem;
        padding-right: 1rem;
    }

    .wizard-actions-top {
        position: static;
        margin-top: 0.5rem;
    }
}

@media (max-width: 900px) {
    .wizard-content {
        max-height: calc(100vh - 200px) !important;
        min-height: auto !important;
        height: auto !important;
    }

    .progress-bar {
        flex-direction: column;
        gap: 0.75rem;
    }

    .progress-bar::before {
        display: none;
    }

    .progress-step {
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.75rem;
    }

    .step-label {
        text-align: left;
    }

    .teams-assignment-container {
        grid-template-columns: 1fr;
    }

    .available-teams-panel {
        max-height: 40vh;
    }
}

@media (max-width: 640px) {
    .wizard-progress {
        padding: 0.75rem;
    }

    .wizard-actions-top .btn {
        padding: 0.6rem 0.9rem;
        font-size: 0.9rem;
    }

    .wizard-step h3 {
        font-size: 1.35rem;
    }

    .step-description {
        font-size: 1rem;
    }

    .match-type-selection .radio-cards {
        grid-template-columns: 1fr;
    }

    .preview-table th,
    .preview-table td {
        padding: 0.75rem;
    }
}

.preview-table tfoot {
    background: #f9fafb;
    font-weight: 700;
}

.preview-table tfoot td {
    border-bottom: none;
}

/* STEP 4: Bracket */
.bracket-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.bracket-group {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.group-title {
    margin: 0 0 1rem 0;
    color: #111827;
    font-size: 1.5rem;
    text-align: center;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #2563eb;
}

.standings-table-compact {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.standings-table-compact thead {
    background: #f3f4f6;
}

.standings-table-compact th {
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.standings-table-compact td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.standings-table-compact tbody tr:hover {
    background: #f9fafb;
}

.standings-table-compact .pos-cell {
    font-weight: 700;
    color: #6b7280;
}

.standings-table-compact .pos-1 .pos-cell {
    color: #eab308;
}

.standings-table-compact .pos-2 .pos-cell {
    color: #9ca3af;
}

.standings-table-compact .pos-3 .pos-cell {
    color: #cd7f32;
}

.standings-table-compact .team-cell {
    font-weight: 600;
    color: #111827;
}

.standings-table-compact .positive {
    color: #10b981;
}

.standings-table-compact .negative {
    color: #ef4444;
}

/* STEP 5: Management */
.management-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.option-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.option-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateY(-4px);
}

.option-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.option-card h4 {
    margin: 0 0 0.5rem 0;
    color: #111827;
    font-size: 1.25rem;
}

.option-card p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Responsive Wizard */
@media (max-width: 1024px) {
    .teams-assignment-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .available-teams-panel {
        max-height: 300px;
    }

    .groups-grid {
        grid-template-columns: 1fr;
    }

    .bracket-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .progress-bar {
        flex-wrap: wrap;
    }

    .progress-step {
        flex: 1 0 45%;
        margin-bottom: 1rem;
    }

    .progress-bar::before {
        display: none;
    }

    .wizard-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .wizard-actions button {
        width: 100%;
    }

    .radio-cards {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Organization Profile Page Styles - HORIZONTAL LAYOUT
   ======================================== */

.org-profile-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Header Section */
.org-profile-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    padding: 3rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.org-profile-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.org-logo-container {
    position: relative;
    z-index: 1;
}

.org-logo-large {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 15px;
    background: white;
    padding: 15px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.org-logo-placeholder {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.org-logo-icon {
    font-size: 4rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.btn-icon-floating {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 3px solid white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-floating:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

.org-header-info {
    z-index: 1;
}

.org-name {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #2d3748;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.org-description {
    font-size: 1.1rem;
    color: #4a5568;
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

.org-founded {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.org-founded-label {
    font-size: 0.9rem;
    color: #718096;
}

.org-founded-year {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3748;
}

.btn-edit-org {
    z-index: 1;
    height: fit-content;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    white-space: nowrap;
}

/* Stats Section - HORIZONTAL */
.org-stats-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.org-stats-horizontal {
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
}

.org-stat-card {
    background: white;
    border-radius: 15px;
    padding: 2rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.8rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.org-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.org-stat-card .stat-icon {
    font-size: 3rem;
    line-height: 1;
}

.org-stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
}

.org-stat-card .stat-label {
    font-size: 0.95rem;
    color: #718096;
    font-weight: 500;
}

/* Bottom Row - Info e Colori affiancati */
.org-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Colors Section - HORIZONTAL */
.org-colors-section {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.org-colors-horizontal {
    display: flex;
    gap: 1.5rem;
}

.color-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.color-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.color-preview-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.color-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.color-label {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
}

.color-value {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    font-family: 'Courier New', monospace;
}

/* Info Section - HORIZONTAL */
.org-info-section {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.org-info-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.info-item {
    flex: 1;
    min-width: 200px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
}

.info-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.info-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.info-label {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
}

.info-value {
    font-size: 1rem;
    color: #2d3748;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .org-profile-header {
        grid-template-columns: auto 1fr;
        gap: 1.5rem;
    }

    .btn-edit-org {
        grid-column: 1 / -1;
        justify-self: center;
        width: 100%;
        max-width: 300px;
    }

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

    .org-bottom-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .org-profile-container {
        padding: 1rem;
    }

    .org-profile-header {
        padding: 2rem 1.5rem;
        grid-template-columns: 1fr;
        text-align: center;
    }

    .org-logo-container {
        justify-self: center;
    }

    .org-logo-large,
    .org-logo-placeholder {
        width: 120px;
        height: 120px;
    }

    .org-name {
        font-size: 2rem;
    }

    .org-description {
        font-size: 1rem;
    }

    .org-founded {
        justify-content: center;
    }

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

    .org-colors-horizontal {
        flex-direction: column;
    }

    .org-info-horizontal {
        flex-direction: column;
    }

    .info-item {
        min-width: 100%;
    }

    .btn-edit-org {
        width: 100%;
        max-width: none;
    }
}

.forgot-password {
    text-align: center;
    margin-top: 1rem;
}

.forgot-password a {
    color: #000000;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.forgot-password a:hover {
    color: #000000;
    text-decoration: underline;
}

/* Data Grid Layout (like coach portal) */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 0;
}

/* Card Styling for Grid */
.data-grid .card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
}

.data-grid .card:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(102, 126, 234, 0.5);
}

.data-grid .card h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 0.75rem 1.25rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    letter-spacing: 0.5px;
    text-align: center;
}

.data-grid .card p {
    margin: 0.75rem 0;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(37, 99, 235, 0.08) 100%);
    border-left: 3px solid var(--primary-color);
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.data-grid .card p strong {
    display: inline-block;
    min-width: 120px;
    color: var(--primary-color);
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.card-actions .btn {
    flex: 1;
    padding: 0.6rem;
    font-size: 0.9rem;
    border-radius: 10px;
}

/* Mobile responsive for grid */
@media (max-width: 768px) {
    .data-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
}

/* Mobile Header - Hidden on desktop */
.mobile-header {
    display: none;
}

.mobile-menu-overlay {
    display: none;
}
@media (max-width: 768px) {
    .app-container {
        display: block;
    }
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.65rem;
        padding: 0.75rem 1rem;
        background: transparent;
        border-bottom: none;
        position: relative;
        top: auto;
        z-index: 1;
    }
    .burger-menu-btn {
        background: transparent;
        border: none;
        color: #ffffff;
        width: auto;
        height: auto;
        border-radius: 0;
        font-size: 1.5rem;
        line-height: 1;
        cursor: pointer;
        padding: 0.25rem 0.5rem 0.25rem 0;
    }
    .mobile-logo img {
        height: 36px;
        width: auto;
        object-fit: contain;
        margin: 0;
        transform: none;
        display: block;
    }
    .mobile-logo {
        display: flex;
        align-items: center;
        gap: 0.4rem;
    }
    #mobile-user-name-inline {
        color: #ffffff;
        font-weight: 700;
        font-size: 0.95rem;
    }
    #mobile-org-name-inline {
        color: #cbd5e1;
        font-weight: 700;
        font-size: 0.9rem;
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        bottom: 0;
        width: 260px;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 4px 0 18px rgba(0,0,0,0.35);
        overflow-y: auto;
        scrollbar-width: none;
        padding-top: 4.5rem;
    }
    .sidebar.open {
        left: 0;
    }
    .sidebar .nav-item {
        color: #fff;
        flex-wrap: nowrap;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        gap: 0.75rem;
    }
    .sidebar .nav-item span:not(.icon) {
        color: #fff !important;
        font-weight: 700 !important;
        display: inline !important;
        font-size: 0.95rem !important;
        flex: 1;
        text-align: left;
    }
    .sidebar .nav-item .icon {
        width: 28px;
        text-align: center;
    }
    .sidebar .logo img {
        height: 88px;
        width: auto;
        object-fit: contain;
        margin-top: 8px;
    }
    .sidebar .logo {
        flex-direction: column;
        align-items: center;
    }
    .sidebar::-webkit-scrollbar {
        width: 0;
        height: 0;
    }
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    .mobile-menu-overlay.show {
        display: block;
    }
    .main-content {
        padding-top: 60px;
        margin-left: 0;
    }
}


/* Table scroll indicator */
.users-table-container::after {
    content: '';
    position: sticky;
    right: 0;
    width: 30px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(to left, rgba(0,0,0,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.users-table-container:hover::after {
    opacity: 1;
}

.standings-table-wrapper::after {
    content: '';
    position: sticky;
    right: 0;
    width: 30px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(to left, rgba(0,0,0,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.standings-table-wrapper:hover::after {
    opacity: 1;
}

/* Faults */
#faults-page .form-message {
    margin-top: 0.35rem;
    font-weight: 600;
}

.materials-list {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.material-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.material-desc {
    color: #0f172a;
    font-size: 0.9rem;
}

.material-edit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.35rem;
    width: 100%;
}

.fault-collection .card-header {
    border-bottom: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 1rem;
}

.fault-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.75rem;
}

.fault-grid .card {
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fault-grid .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: #cbd5e1;
}

.fault-collection .card-header {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
}

.fault-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.75rem;
}

/* =====================================================
   LOGIN KICKSTARTS - RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-box {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }
    
    .logo-shield {
        margin-bottom: 1rem;
    }
    
    .shield-svg {
        width: 60px;
        height: 60px;
    }
    
    .wings {
        width: 100px;
        height: 45px;
    }
    
    .wing {
        width: 25px;
        height: 35px;
    }
    
    .login-box h1 {
        font-size: 1.5rem;
        letter-spacing: 1.5px;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .input-wrapper input {
        padding: 0.9rem 3rem 0.9rem 1rem;
        font-size: 0.9rem;
    }
    
    .login-btn {
        padding: 0.9rem 1.5rem;
        font-size: 1rem;
        letter-spacing: 1.5px;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 1.5rem 1rem;
    }
    
    .shield-svg {
        width: 50px;
        height: 50px;
    }
    
    .login-box h1 {
        font-size: 1.3rem;
    }
    
    .particles {
        opacity: 0.2;
    }
}

/* =====================================================
   GLASSMORPHISM PER TUTTE LE CARD
   ===================================================== */

.card-panel,
.recent-matches,
.upcoming-matches,
.team-card,
.tournament-card,
.match-card,
.group-card,
.knockout-match,
.bracket-match-slot,
.modal-content,
.users-table,
.standings-group,
.bracket-group,
.stat-card {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(10px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(10px) saturate(180%) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

.card-panel:hover,
.team-card:hover,
.tournament-card:hover,
.match-card:hover,
.group-card:hover {
    background: rgba(255, 255, 255, 0.85) !important;
}

/* Bracket / calendario tornei */
.bracket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 1.5rem;
    max-width: 1280px;
    margin: 0 auto;
}

.bracket-group-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
    animation: bracketFade 0.45s ease forwards;
    opacity: 0;
}

.bracket-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.badge-soft {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    font-weight: 700;
    font-size: 0.85rem;
}

.bracket-group-card h3 {
    margin-top: 0.35rem;
    font-size: 1rem;
    color: var(--text-secondary);
}

.matchday-card {
    position: relative;
    overflow: hidden;
}

.matchday-track {
    /* Hidden to avoid drawing links between unrelated matches */
    display: none;
}

.bracket-match-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
    position: relative;
    z-index: 1;
}

.matchday-card .bracket-match-list {
    grid-template-columns: 1fr;
}

.bracket-match-card {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border: 2px solid #0f172a;
    border-radius: 12px;
    background: #ffffff;
    animation: matchPop 0.35s ease forwards;
    opacity: 0;
    transform: translateY(6px);
    animation-delay: var(--delay, 0s);
    position: relative;
    min-height: 170px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.16);
}

.bracket-match-card.aligned-left {
    margin-right: 14%;
}

.bracket-match-card.aligned-right {
    margin-left: 14%;
}

.match-node {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 14px;
    background: #3b82f6;
    border: 3px solid #e0e7ff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.12), 0 6px 12px rgba(0,0,0,0.08);
}

.bracket-match-card.lined::after,
.bracket-match-card.lined:last-child::after {
    display: none;
}

.bracket-match-card::before {
    display: none;
}

.team-block {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    justify-content: center;
}

.team-block.align-right {
    text-align: right;
    align-items: flex-end;
}

.team-name {
    font-weight: 700;
    color: #0f172a;
}

.team-tag {
    font-size: 0.8rem;
    color: #0f172a;
}

.team-tag-strong {
    font-weight: 700;
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    display: inline-block;
}

.score-block {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 150px;
    justify-content: center;
}

.score-block .score {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 1px;
}

.match-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: #0f172a;
}

.status-pill {
    display: inline-block;
    padding: 0.1rem 0;
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0;
    position: static;
    background: transparent;
    color: #111827;
    box-shadow: none;
}
.status-pill::before,
.status-pill::after {
    content: none !important;
}

.status-completed {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.status-live,
.status-in_progress {
    background: rgba(59, 130, 246, 0.14);
    color: #1d4ed8;
}

.status-scheduled {
    background: rgba(107, 114, 128, 0.12);
    color: #374151;
}

.status-postponed {
    background: rgba(245, 158, 11, 0.14);
    color: #92400e;
}

.bracket-group-card,
.bracket-group-card * {
    color: #0f172a !important;
}

/* Calendario tornei: forza contrasto e sfondo neutro */
#tournament-calendar-page {
    background: #e5e7eb !important;
    padding: 1rem !important;
    color: #0f172a !important;
}

#tournament-calendar-content {
    background: #ffffff !important;
    padding: 1rem !important;
    border-radius: 16px !important;
    box-shadow: 0 18px 36px rgba(0,0,0,0.22) !important;
}

#tournament-calendar-page .page-header,
#tournament-calendar-page h1,
#tournament-calendar-page h2,
#tournament-calendar-page h3,
#tournament-calendar-page p,
#tournament-calendar-page span,
#tournament-calendar-page div {
    color: #0f172a !important;
}

.bracket-match-card,
.bracket-match-card * {
    color: #0f172a !important;
}
#tournament-calendar-page h1,
#tournament-calendar-page h2,
#tournament-calendar-page h3,
#tournament-calendar-page p,
#tournament-calendar-page span,
#tournament-calendar-page div {
    color: #0f172a !important;
}
.status-canceled {
    background: rgba(239, 68, 68, 0.14);
    color: #991b1b;
}

.match-actions-row {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

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

@keyframes matchPop {
    from { opacity: 0; transform: translateY(10px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
    .bracket-match-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .team-block.align-right {
        text-align: center;
        align-items: center;
    }

    .score-block {
        min-width: auto;
    }

    .match-actions-row {
        justify-content: center;
    }
}

/* Manual match builder (wizard step) */
.manual-matches-builder {
    margin-top: 2rem;
    padding: 1.25rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.manual-builder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.manual-draft-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.draft-match {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
}

.draft-match .drag-handle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    user-select: none;
}

.draft-match .draft-body {
    flex: 1;
}

.draft-teams {
    font-weight: 700;
    color: var(--text-primary);
}

.draft-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.empty-draft {
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    text-align: center;
}

.bracket-builder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.manual-group-card {
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.manual-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.manual-group-header .btn-group {
    display: flex;
    gap: 0.35rem;
}

.manual-fields label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

.manual-fields .form-control {
    width: 100%;
    margin: 0.2rem 0 0.5rem 0;
}

.manual-fields .btn-full {
    width: 100%;
    margin-top: 0.6rem;
}

.manual-matches-list {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.manual-match-row {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* =====================================================
   TABLES (Unified visual style)
   ===================================================== */

.users-table-container,
.standings-table-wrapper {
    border-radius: var(--table-radius);
    border: 1px solid var(--table-border);
    box-shadow: var(--table-shadow);
    background: rgba(255, 255, 255, 0.92);
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
}

.standings-table-wrapper {
    margin-top: 0.75rem;
}

.users-table,
.standings-table,
.preview-table,
.standings-table-compact,
.payments-details .mini-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.users-table thead,
.standings-table thead,
.preview-table thead,
.standings-table-compact thead,
.payments-details .mini-table thead {
    background: var(--table-head-bg);
    color: var(--table-head-text);
}

.users-table th,
.standings-table th,
.preview-table th,
.standings-table-compact th,
.payments-details .mini-table th {
    padding: 0.9rem 0.85rem;
    text-align: left;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-transform: none;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.users-table td,
.standings-table td,
.preview-table td,
.standings-table-compact td,
.payments-details .mini-table td {
    padding: 0.85rem 0.85rem;
    border-bottom: 1px solid var(--table-divider);
    vertical-align: middle;
}

.users-table tbody tr:nth-child(even),
.standings-table tbody tr:nth-child(even),
.preview-table tbody tr:nth-child(even),
.standings-table-compact tbody tr:nth-child(even),
.payments-details .mini-table tbody tr:nth-child(even) {
    background: var(--table-row-alt);
}

.users-table tbody tr:hover,
.standings-table tbody tr:hover,
.preview-table tbody tr:hover,
.standings-table-compact tbody tr:hover,
.payments-details .mini-table tbody tr:hover {
    background: var(--table-row-hover);
}

.users-table tbody tr:last-child td,
.standings-table tbody tr:last-child td,
.preview-table tbody tr:last-child td,
.standings-table-compact tbody tr:last-child td,
.payments-details .mini-table tbody tr:last-child td {
    border-bottom: none;
}

/* Preview table (wizard) should look like a card too */
.preview-table {
    border-radius: var(--table-radius);
    overflow: hidden;
    border: 1px solid var(--table-border);
    box-shadow: var(--table-shadow);
    border-collapse: separate;
    border-spacing: 0;
}

.preview-table tfoot {
    background: rgba(15, 23, 42, 0.03);
    font-weight: 800;
}

/* Standings tables */
.standings-table {
    min-width: 680px;
}

.standings-table th:nth-child(n+3),
.standings-table td:nth-child(n+3) {
    text-align: center;
}

.standings-table .pos-cell {
    font-weight: 900;
    color: #0f172a;
}

.standings-table .team-cell .team-name {
    font-weight: 800;
    color: #0f172a;
}

.standings-table .team-cell .team-note {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 700;
    margin-left: 0.35rem;
}

.standings-table .team-cell .org-name {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 700;
    margin-top: 0.15rem;
}

.standings-table .stat-win { color: #16a34a; font-weight: 800; }
.standings-table .stat-draw { color: #64748b; font-weight: 800; }
.standings-table .stat-loss { color: #dc2626; font-weight: 800; }

.standings-table .stat-diff { font-weight: 900; }
.standings-table .stat-diff.positive { color: #16a34a; }
.standings-table .stat-diff.negative { color: #dc2626; }
.standings-table .stat-diff.neutral { color: #64748b; }
.standings-table .stat-diff.muted { color: #94a3b8; }

.standings-table .stat-pts {
    font-weight: 900;
    font-size: 1.05rem;
    color: #0f172a;
}

.standings-table tbody tr.not-played {
    opacity: 0.72;
}

.standings-table tbody tr.not-played .team-cell .team-name,
.standings-table tbody tr.not-played .team-cell .org-name,
.standings-table tbody tr.not-played .team-cell .team-note,
.standings-table tbody tr.not-played .stat-pts,
.standings-table tbody tr.not-played .stat-diff,
.standings-table tbody tr.not-played td {
    color: #94a3b8;
}

.standings-table tbody tr.not-played .stat-win,
.standings-table tbody tr.not-played .stat-draw,
.standings-table tbody tr.not-played .stat-loss {
    color: #cbd5e1;
}

.standings-table tbody tr.pos-1 { background: rgba(16, 185, 129, 0.12); }
.standings-table tbody tr.pos-2 { background: rgba(59, 130, 246, 0.10); }
.standings-table tbody tr.pos-3 { background: rgba(245, 158, 11, 0.12); }

.standings-table tbody tr.pos-1 td:first-child { border-left: 4px solid #10b981; }
.standings-table tbody tr.pos-2 td:first-child { border-left: 4px solid #3b82f6; }
.standings-table tbody tr.pos-3 td:first-child { border-left: 4px solid #f59e0b; }
.standings-table tbody tr.not-played td:first-child { border-left: 4px solid rgba(148, 163, 184, 0.55); }

/* Embedded tables (compact/mini) keep a lighter container */
.standings-table-compact,
.payments-details .mini-table {
    border: 1px solid var(--table-border);
    border-radius: 14px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}

.payments-details .mini-table th,
.payments-details .mini-table td {
    padding: 0.6rem 0.65rem;
    font-size: 0.9rem;
}

.standings-group h4 {
    padding-bottom: 0.6rem;
    border-bottom: 2px solid rgba(59, 130, 246, 0.25);
}
