/* =============================================
   LigaEsporte — Design System & Styles
   ============================================= */

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

/* ---- CSS Variables ---- */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --primary-glow: rgba(99, 102, 241, 0.3);

    --accent: #f59e0b;
    --accent-dark: #d97706;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --bg-base: #0f0f13;
    --bg-surface: #16161e;
    --bg-card: #1c1c27;
    --bg-hover: #252535;
    --bg-input: #1e1e2e;

    --border: #2a2a3d;
    --border-light: #333355;

    --text-primary: #e8e8f0;
    --text-secondary: #9090b8;
    --text-muted: #555580;
    --text-accent: #a5b4fc;

    --sidebar-width: 260px;
    --topbar-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-card: 0 2px 12px rgba(0,0,0,0.3);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.2s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.6;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition), width var(--transition);
}

.sidebar-header {
    padding: 20px 18px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.logo-icon { font-size: 24px; filter: drop-shadow(0 0 8px var(--primary)); }
.logo-text {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.sidebar-toggle {
    background: none; border: none; cursor: pointer;
    color: var(--text-secondary); padding: 4px;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
    display: none;
}
.sidebar-toggle:hover { color: var(--text-primary); background: var(--bg-hover); }

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-section { margin-bottom: 24px; }
.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 0 8px;
    margin-bottom: 6px;
    display: block;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13.5px;
    transition: all var(--transition);
    margin-bottom: 2px;
    position: relative;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(99,102,241,0.1));
    color: var(--primary-light);
    border: 1px solid rgba(99,102,241,0.2);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 16px; flex-shrink: 0; }
.nav-label { white-space: nowrap; }

.sidebar-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11px;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
}

/* ---- TopBar ---- */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
}

.menu-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text-secondary); padding: 6px;
    border-radius: var(--radius-sm);
    display: none;
    transition: all var(--transition);
}
.menu-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

.topbar-breadcrumb {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.current-time {
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* =============================================
   PAGES
   ============================================= */
.page {
    display: none;
    padding: 28px 28px 80px;
    flex: 1;
    animation: fadeIn 0.25s ease;
}
.page.active { display: block; }

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

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}
.page-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

/* =============================================
   STATS GRID
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s;
}
.stat-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 30px var(--primary-glow); }
.stat-card:hover::before { opacity: 1; }

.stat-icon { font-size: 32px; flex-shrink: 0; }
.stat-info { flex: 1; min-width: 0; }
.stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}
.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}
.stat-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(16,185,129,0.15);
    color: var(--success);
    white-space: nowrap;
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.card-body { padding: 0; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* =============================================
   MATCHES LIST IN DASHBOARD
   ============================================= */
.match-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.match-item:last-child { border-bottom: none; }
.match-item:hover { background: var(--bg-hover); }

.match-teams {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}
.match-team {
    font-weight: 600;
    font-size: 13px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.match-vs {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}
.match-score {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-light);
    padding: 4px 10px;
    background: rgba(99,102,241,0.1);
    border-radius: var(--radius-sm);
    letter-spacing: 2px;
}
.match-meta {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    min-width: 80px;
}
.match-liga-badge {
    font-size: 10px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    display: inline-block;
}

/* =============================================
   FILTERS BAR
   ============================================= */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
    transition: border-color var(--transition);
}
.search-box:focus-within { border-color: var(--primary); }
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-input {
    background: none; border: none; outline: none;
    color: var(--text-primary); font-size: 13px; flex: 1;
    font-family: var(--font);
}
.search-input::placeholder { color: var(--text-muted); }

.filter-select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
    padding: 8px 12px;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--primary); }
.filter-select option { background: var(--bg-card); }

/* =============================================
   TABLE
   ============================================= */
.table-wrapper { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table thead th {
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table td {
    padding: 13px 16px;
    color: var(--text-primary);
    vertical-align: middle;
}
.table-empty {
    text-align: center !important;
    color: var(--text-muted) !important;
    padding: 40px !important;
}

.classificacao-table thead th { text-align: center; }
.classificacao-table td { text-align: center; }
.classificacao-table td:nth-child(2) { text-align: left; }

/* =============================================
   STATUS BADGES
   ============================================= */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.badge-planejamento { background: rgba(148,163,184,0.15); color: #94a3b8; }
.badge-em_andamento { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-finalizada { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.badge-cancelada { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-agendada { background: rgba(59,130,246,0.15); color: var(--info); }
.badge-adiada { background: rgba(245,158,11,0.15); color: var(--warning); }

/* =============================================
   TIMES GRID
   ============================================= */
.times-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.time-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.time-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--team-color, var(--primary));
}
.time-card:hover { border-color: var(--team-color, var(--primary)); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }

.time-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.time-escudo {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.1);
}
.time-card-info { flex: 1; min-width: 0; }
.time-card-name {
    font-weight: 700; font-size: 15px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.time-card-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.time-card-actions {
    display: flex;
    gap: 8px;
}

/* =============================================
   PARTIDAS LIST
   ============================================= */
.partidas-list-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.partida-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all var(--transition);
}
.partida-card:hover { border-color: var(--primary); background: var(--bg-hover); }

.partida-card-teams {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.partida-team-name {
    font-weight: 700;
    font-size: 15px;
    max-width: 140px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}
.partida-score-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    text-align: center;
    min-width: 100px;
}
.partida-score {
    font-size: 22px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: 4px;
}
.partida-score-vs {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.partida-meta {
    min-width: 140px;
    text-align: right;
}
.partida-meta-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.partida-meta-local {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.partida-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #3730a3);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

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

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

.btn-danger {
    background: rgba(239,68,68,0.15);
    color: var(--danger);
    border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-icon {
    padding: 6px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-icon:hover { border-color: var(--primary); color: var(--primary-light); }

/* =============================================
   MODALS
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(4px);
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 540px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s ease;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal.modal-sm { max-width: 380px; }
.modal.modal-lg { max-width: 680px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}
.modal-header h2 {
    font-size: 17px;
    font-weight: 700;
}
.modal-close {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: all var(--transition);
}
.modal-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.modal-form { padding: 20px 24px; }
.modal-body { padding: 20px 24px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    margin-top: 12px;
}

/* =============================================
   FORMS
   ============================================= */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.col-span-2 { grid-column: span 2; }

label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-control {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
    padding: 10px 12px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control option { background: var(--bg-card); }

/* Color picker */
.color-picker-row {
    display: flex;
    gap: 12px;
}
.color-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}
.color-input {
    width: 40px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    padding: 2px;
}

/* Score input */
.score-input-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}
.score-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.score-input-field {
    width: 80px;
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px;
    outline: none;
    -moz-appearance: textfield;
}
.score-input-field::-webkit-outer-spin-button,
.score-input-field::-webkit-inner-spin-button { -webkit-appearance: none; }
.score-input-field:focus { border-color: var(--primary); }
.score-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.score-vs {
    font-size: 20px;
    font-weight: 300;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* =============================================
   TOAST
   ============================================= */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    font-size: 13px;
    font-weight: 500;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    pointer-events: all;
    max-width: 340px;
    border-left: 3px solid var(--info);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateX(120%); }
}

/* =============================================
   LOADING / EMPTY STATES
   ============================================= */
.loading-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-size: 14px;
}

.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 15px; font-weight: 500; color: var(--text-secondary); }
.empty-state-sub { font-size: 13px; margin-top: 6px; }

/* Skeleton */
.skeleton-load {
    position: relative;
    overflow: hidden;
}
.skeleton-load::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.03) 50%, transparent 100%);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* =============================================
   SIDEBAR-OVERLAY (Mobile)
   ============================================= */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: flex; }
    .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0; }
    .menu-btn { display: flex; }
    .page { padding: 20px 16px 60px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid-2 { grid-template-columns: 1fr; }
    .form-group.col-span-2 { grid-column: span 1; }
    .times-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .partida-card { flex-wrap: wrap; }
    .partida-meta { text-align: left; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .search-box { max-width: 100%; }
    .partida-score { font-size: 18px; }
}

/* =============================================
   ACTION BUTTONS IN TABLE
   ============================================= */
.table-actions { display: flex; gap: 6px; align-items: center; }
.pos-gold td:first-child { color: #f59e0b; font-weight: 800; }
.pos-silver td:first-child { color: #94a3b8; font-weight: 800; }
.pos-bronze td:first-child { color: #cd7c2f; font-weight: 800; }
.team-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; flex-shrink: 0; }
.modalidade-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 8px; background: var(--bg-hover); border-radius: 20px; color: var(--text-secondary); }

/* =============================================
   SIDEBAR v2 — logo sub-text + nav badge
   ============================================= */
.logo-sub { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 1px; }
.nav-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    background: var(--primary-glow);
    color: var(--primary-light);
    border-radius: 20px;
    border: 1px solid rgba(99,102,241,0.3);
}

/* =============================================
   MODAL XL (atletas)
   ============================================= */
.modal.modal-xl { max-width: 900px; }

/* =============================================
   FORM GRID 3 & PHOTO
   ============================================= */
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-grid-3 .col-span-2 { grid-column: span 2; }
.form-grid-3 .col-span-3 { grid-column: span 3; }

.pessoal-header-flex { display: flex; gap: 20px; align-items: flex-start; }
.atleta-foto-upload-container { flex-shrink: 0; width: 110px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.atleta-foto-preview { 
    width: 110px; height: 146px; /* ~3x4 ratio */
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; background: var(--bg-surface);
    transition: all var(--transition);
    overflow: hidden; position: relative;
}
.atleta-foto-preview:hover { border-color: var(--primary); background: rgba(99,102,241,0.05); }
.atleta-foto-preview img { width: 100%; height: 100%; object-fit: cover; }
.pessoal-fields-flex { flex: 1; min-width: 0; }

/* =============================================
   TAB NAVIGATION (modal atleta)
   ============================================= */
.modal-form-tabbed { display: flex; flex-direction: column; }
.tab-nav {
    display: flex;
    gap: 2px;
    padding: 12px 24px 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    overflow-x: auto;
    flex-shrink: 0;
}
.tab-btn {
    background: none; border: none; cursor: pointer;
    font-family: var(--font); font-size: 13px; font-weight: 600;
    color: var(--text-secondary);
    padding: 10px 14px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: all var(--transition);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}
.tab-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.tab-btn.active { color: var(--primary-light); border-bottom-color: var(--primary); background: rgba(99,102,241,0.08); }
.tab-pane { display: none; padding: 20px 24px; flex: 1; }
.tab-pane.active { display: block; }

/* modal-form-tabbed footer */
.modal-form-tabbed > .modal-footer { padding: 16px 24px; margin: 0; border-top: 1px solid var(--border); }

/* =============================================
   ATLETAS GRID
   ============================================= */
.atletas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.atleta-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.atleta-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--atleta-cor, var(--primary));
    opacity: 0;
    transition: opacity 0.3s;
}
.atleta-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.atleta-card:hover::before { opacity: 1; }

.atleta-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}
.atleta-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 800; color: #fff;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.1);
    overflow: hidden;
}
.atleta-avatar img { width: 100%; height: 100%; object-fit: cover; }
.atleta-info { flex: 1; min-width: 0; }
.atleta-nome { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atleta-apelido { font-size: 12px; color: var(--text-muted); font-style: italic; }
.atleta-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.atleta-meta-tag {
    font-size: 11px;
    padding: 3px 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.atleta-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 4px;
    border-top: 1px solid var(--border);
}

/* Atleta status badges */
.badge-ativo     { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-inativo   { background: rgba(148,163,184,0.15); color: #94a3b8; }
.badge-suspenso  { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-lesionado { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-M { background: rgba(59,130,246,0.1); color: #60a5fa; }
.badge-F { background: rgba(236,72,153,0.1); color: #f472b6; }

/* =============================================
   PERFIL DO ATLETA (modal)
   ============================================= */
.perfil-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.perfil-avatar-lg {
    width: 90px; height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; font-weight: 800; color: #fff;
    flex-shrink: 0;
    border: 3px solid var(--primary);
    overflow: hidden;
}
.perfil-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.perfil-title h3 { font-size: 22px; font-weight: 800; }
.perfil-title p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.perfil-badges { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

.perfil-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.perfil-section { }
.perfil-section-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted); margin-bottom: 10px; padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.perfil-field { margin-bottom: 8px; }
.perfil-field label { font-size: 11px; color: var(--text-muted); display: block; }
.perfil-field span { font-size: 13px; font-weight: 500; color: var(--text-primary); }

/* =============================================
   DOCUMENT UPLOAD AREA
   ============================================= */
.docs-notice {
    display: flex; align-items: center; gap: 8px;
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--warning);
    font-size: 13px;
    margin-bottom: 16px;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: all var(--transition);
    margin-bottom: 20px;
}
.upload-area:hover, .upload-area.drag-over { border-color: var(--primary); background: rgba(99,102,241,0.05); }
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-text { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.upload-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.upload-form-row { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }

.progress-bar {
    height: 4px; background: var(--border); border-radius: 2px;
    margin: 10px 0 4px; overflow: hidden;
}
.progress-fill {
    height: 100%; background: var(--primary);
    border-radius: 2px; transition: width 0.3s ease;
    width: 0%;
}
#progress-text { font-size: 12px; color: var(--text-muted); }

/* Document list */
.docs-list { display: flex; flex-direction: column; gap: 8px; }
.doc-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    transition: all var(--transition);
}
.doc-item:hover { border-color: var(--primary); }
.doc-icon { font-size: 22px; flex-shrink: 0; }
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.doc-tipo-badge {
    font-size: 10px; padding: 2px 7px;
    background: rgba(99,102,241,0.1); color: var(--primary-light);
    border-radius: 4px; white-space: nowrap;
}

/* =============================================
   CEP INPUT WITH BUTTON
   ============================================= */
.input-with-btn { display: flex; gap: 6px; }
.input-with-btn .form-control { flex: 1; }

/* =============================================
   DASHBOARD GRID v2 (3 cards)
   ============================================= */
.dashboard-grid { grid-template-columns: 1fr 1fr; }
.dashboard-grid .card:first-child { grid-column: 1 / -1; }

/* Atleta row in dashboard */
.atleta-dash-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 20px; border-bottom: 1px solid var(--border);
    transition: background var(--transition);
    cursor: pointer;
}
.atleta-dash-item:last-child { border-bottom: none; }
.atleta-dash-item:hover { background: var(--bg-hover); }
.atleta-dash-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary); display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0;
}
.atleta-dash-info { flex: 1; min-width: 0; }
.atleta-dash-nome { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atleta-dash-sub { font-size: 11px; color: var(--text-muted); }

/* =============================================
   RESPONSIVE v2 (Mobile Optimization)
   ============================================= */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-grid .card:first-child { grid-column: auto; }
    .form-grid-3 { grid-template-columns: 1fr 1fr; }
    .form-grid-3 .col-span-3 { grid-column: span 2; }
    .perfil-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); z-index: 200; width: 85vw; max-width: 320px; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: flex; font-size: 20px; }
    .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 150; opacity: 0; pointer-events: none; transition: opacity var(--transition); backdrop-filter: blur(2px); }
    .sidebar-overlay.open { opacity: 1; pointer-events: all; }
    
    .main-content { margin-left: 0; }
    .topbar { padding: 0 16px; }
    .menu-btn { display: flex; font-size: 20px; }
    .page { padding: 20px 16px 80px; }
    
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 16px; flex-direction: column; align-items: flex-start; gap: 12px; }
    
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
    .form-group.col-span-2,
    .form-group.col-span-3 { grid-column: span 1; }
    
    .atletas-grid { grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); }
    .perfil-grid { grid-template-columns: 1fr; }
    .perfil-header { flex-direction: column; align-items: center; text-align: center; }
    
    .pessoal-header-flex { flex-direction: column; align-items: center; }
    .atleta-foto-upload-container { width: 100%; }
    .atleta-foto-preview { width: 120px; height: 160px; }
    
    .tab-nav { padding: 8px 12px 0; -webkit-overflow-scrolling: touch; }
    .tab-nav::-webkit-scrollbar { display: none; }
    .tab-btn { font-size: 13px; padding: 12px; flex-shrink: 0; }
    
    .upload-form-row { flex-direction: column; align-items: stretch; }
    .upload-form-row .btn { width: 100%; justify-content: center; }
    
    .partida-card { flex-direction: column; gap: 12px; }
    .partida-meta { text-align: center; }
    .partida-actions { flex-direction: row; justify-content: center; width: 100%; }
    .partida-actions .btn { flex: 1; justify-content: center; }
}

@media (max-width: 480px) {
    /* Full-screen modals on very small screens for better UX */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal.modal-xl, .modal.modal-lg, .modal { 
        max-width: 100%; 
        width: 100%; 
        border-radius: 16px 16px 0 0; 
        transform: translateY(100%); 
        max-height: 95vh;
        display: flex;
        flex-direction: column;
        border-bottom: none;
    }
    .modal-overlay.open .modal { transform: translateY(0); }
    
    .modal-form-tabbed, .modal-form, .modal-body { 
        flex: 1; 
        overflow-y: auto; 
    }
    .modal-footer { 
        position: sticky; bottom: 0; 
        background: var(--bg-card); 
        padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        margin-top: 0;
        z-index: 10;
    }
    .modal-footer .btn { flex: 1; justify-content: center; padding: 12px; font-size: 14px; }
    
    .page-header { flex-direction: column; align-items: stretch; gap: 16px; }
    .page-header .btn { width: 100%; justify-content: center; padding: 12px; }
    
    .filters-bar { flex-direction: column; align-items: stretch; }
    .search-box { max-width: 100%; }
    
    .card-header { padding: 16px; }
    .atleta-dash-item { padding: 12px 16px; }
    .match-item { flex-direction: column; align-items: flex-start; gap: 8px; }
    .match-meta { text-align: left; width: 100%; display: flex; justify-content: space-between; align-items: center; }
    
    .data-table th, .data-table td { padding: 10px 12px; font-size: 12px; }
    .table-actions { flex-wrap: wrap; }
    
    .color-picker-row { flex-direction: column; align-items: stretch; }
    .color-picker-item { display: flex; justify-content: space-between; padding: 10px; background: var(--bg-surface); border-radius: var(--radius-sm); border: 1px solid var(--border); }
    
    .score-input-row { flex-direction: column; gap: 12px; }
    .score-vs { transform: rotate(90deg); margin: 0 auto; }
}

