:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: #e2e8f0;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --sidebar-width: 260px;
    --topbar-height: 60px;
}

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

html { font-size: 16px; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ============================================
   MOBILE TOP BAR (visible on small screens)
   ============================================ */
.mobile-top-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--secondary);
    color: white;
    padding: 0 16px;
    z-index: 200;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.mobile-top-bar .logo {
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-top-bar .logo small {
    font-weight: 400;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

.hamburger {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.hamburger:hover { background: rgba(255,255,255,0.1); }

.hamburger-close {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 150;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--secondary);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 175;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.sidebar-header small {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
}

.sidebar-nav {
    padding: 8px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.05);
    color: white;
    text-decoration: none;
}

.sidebar-nav a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--accent);
}

.sidebar-nav a .icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}

.sidebar-footer a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.sidebar-footer a:hover { color: white; }

/* ============================================
   MAIN LAYOUT
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ============================================
   LOGIN
   ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--secondary) 0%, #1e40af 100%);
    padding: 20px;
}

.login-box {
    background: var(--card);
    border-radius: var(--radius);
    padding: 40px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 26px;
    color: var(--secondary);
}

.login-box .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 28px;
    font-size: 14px;
}

.login-box .error {
    background: #fef2f2;
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
}

/* ============================================
   TOP BAR (internal pages)
   ============================================ */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.top-bar h1 {
    font-size: 24px;
    font-weight: 700;
    word-break: break-word;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-light);
}

.user-info span {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    flex-shrink: 0;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 17px;
    font-weight: 600;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
}

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

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-card .stat-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.stat-card .stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: white;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

select.form-control { cursor: pointer; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #16a34a; }

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

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #d97706; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover { background: var(--bg); }

.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 0 4px;
    scroll-behavior: smooth;
}

.table-container::-webkit-scrollbar {
    height: 6px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

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

table th, table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

table th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg);
    position: sticky;
    top: 0;
}

table tr:hover { background: #f8fafc; }

table .actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fef2f2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.modal-overlay.show { display: flex; }

.modal {
    background: white;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 28px 20px 24px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s ease;
}

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

.modal h3 {
    font-size: 18px;
    margin-bottom: 20px;
    padding-right: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-wrap: wrap;
}

.modal-actions .btn {
    flex: 1;
    min-width: 0;
}

/* ============================================
   PARTIDO CARD
   ============================================ */
.partido-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 10px;
    transition: all 0.2s;
    flex-wrap: wrap;
}

.partido-card:hover { background: #e2e8f0; }

.partido-equipos {
    flex: 1;
    min-width: 140px;
}

.partido-equipo {
    font-weight: 600;
    font-size: 15px;
    word-break: break-word;
}

.partido-vs {
    font-weight: 700;
    color: var(--text-light);
    font-size: 12px;
    text-transform: uppercase;
    margin: 2px 0;
}

.partido-resultado {
    text-align: center;
    min-width: 50px;
}

.partido-resultado .score {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.partido-resultado .score.winner { color: var(--success); }

.partido-info {
    text-align: right;
    font-size: 12px;
    color: var(--text-light);
    min-width: 100px;
}

/* ============================================
   RANKING
   ============================================ */
.ranking-list { list-style: none; }

.ranking-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.ranking-item:last-child { border-bottom: none; }

.ranking-position {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.ranking-position.top-1 { background: #fef3c7; color: #b45309; }
.ranking-position.top-2 { background: #e5e7eb; color: #374151; }
.ranking-position.top-3 { background: #fed7aa; color: #9a3412; }

.ranking-info { flex: 1; min-width: 0; }
.ranking-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-detail { font-size: 12px; color: var(--text-light); }

.ranking-stats {
    text-align: right;
    flex-shrink: 0;
}

.ranking-stats .pts { font-weight: 700; font-size: 16px; color: var(--primary); }
.ranking-stats .label { font-size: 11px; color: var(--text-light); }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-state .icon { font-size: 42px; margin-bottom: 14px; }
.empty-state h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ============================================
   MATCH SUMMARY
   ============================================ */
.match-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.match-teams {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.match-team { font-weight: 600; font-size: 15px; }

.match-score {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 1px;
}

.match-score .winner { color: var(--success); }
.match-meta { font-size: 12px; color: var(--text-light); }

/* ============================================
   LEGEND / FOOTER NOTE
   ============================================ */
.ranking-legend {
    margin-top: 12px;
    text-align: right;
    color: var(--text-light);
    font-size: 12px;
    line-height: 1.6;
}

/* ============================================
   RESPONSIVE: TABLETS (≤1024px)
   ============================================ */
@media (max-width: 1024px) {
    .main-content {
        padding: 24px 20px;
    }

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

    .ranking-table th:nth-child(n+6):nth-child(-n+9),
    .ranking-table td:nth-child(n+6):nth-child(-n+9) {
        display: none;
    }

    .partido-info .btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}

/* ============================================
   RESPONSIVE: MOBILE (≤768px)
   ============================================ */
@media (max-width: 768px) {
    .mobile-top-bar {
        display: flex;
    }

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

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

    .sidebar-overlay.show {
        display: block;
    }

    .hamburger-close {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-top: calc(var(--topbar-height) + 8px);
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 16px;
    }

    .top-bar h1 {
        font-size: 20px;
    }

    .user-info {
        width: 100%;
        justify-content: flex-end;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card .stat-number {
        font-size: 20px;
    }

    .stat-card .stat-label {
        font-size: 12px;
    }

    .card {
        padding: 16px;
        margin-bottom: 14px;
    }

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

    .card-header h2 {
        font-size: 16px;
    }

    .table-container {
        margin: 0 -12px;
        padding: 0 8px;
    }

    table {
        min-width: 500px;
    }

    table th, table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .ranking-table th:nth-child(8),
    .ranking-table td:nth-child(8),
    .ranking-table th:nth-child(9),
    .ranking-table td:nth-child(9),
    .ranking-table th:nth-child(10),
    .ranking-table td:nth-child(10) {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .login-box {
        padding: 28px 20px;
    }

    .login-box h1 {
        font-size: 22px;
    }

    .modal {
        max-height: 90vh;
        padding: 24px 16px 20px;
        border-radius: var(--radius) var(--radius) 0 0;
    }

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

    .modal-actions .btn {
        width: 100%;
        padding: 10px 14px;
        font-size: 13px;
    }

    .partido-card {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 8px;
    }

    .partido-equipos {
        text-align: center;
    }

    .partido-info {
        text-align: center;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .partido-info .btn {
        width: 100%;
    }

    .top-bar .btn {
        width: 100%;
        justify-content: center;
    }

    .ranking-item {
        gap: 10px;
    }

    .ranking-stats .pts {
        font-size: 14px;
    }

    .ranking-legend {
        text-align: center;
    }

    .card-header .btn.btn-sm {
        width: 100%;
        justify-content: center;
    }

    .empty-state {
        padding: 30px 16px;
    }

    .empty-state .icon {
        font-size: 34px;
    }
}

/* ============================================
   RESPONSIVE: SMALL PHONES (≤480px)
   ============================================ */
@media (max-width: 480px) {
    .main-content {
        padding: 12px;
        padding-top: calc(var(--topbar-height) + 4px);
    }

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

    .stat-card {
        padding: 12px;
    }

    .stat-card .stat-number {
        font-size: 18px;
    }

    .stat-card .stat-icon {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .top-bar h1 {
        font-size: 18px;
    }

    .card {
        padding: 14px;
        border-radius: 8px;
    }

    .card-header {
        padding-bottom: 10px;
        margin-bottom: 12px;
    }

    .card-header h2 {
        font-size: 15px;
    }

    .table-container {
        margin: 0 -8px;
        padding: 0 4px;
    }

    table {
        min-width: 380px;
    }

    table th, table td {
        padding: 6px 8px;
        font-size: 11px;
    }

    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }

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

    .partido-equipo {
        font-size: 14px;
    }

    .partido-resultado .score {
        font-size: 18px;
    }

    .modal {
        padding: 20px 14px 16px;
        max-height: 92vh;
    }

    .login-box {
        padding: 24px 18px;
    }

    .login-box h1 {
        font-size: 20px;
    }

    .login-box .subtitle {
        font-size: 13px;
    }

    .user-info span {
        max-width: 120px;
        font-size: 13px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .ranking-table th:nth-child(4),
    .ranking-table td:nth-child(4),
    .ranking-table th:nth-child(7),
    .ranking-table td:nth-child(7),
    .ranking-table th:nth-child(11),
    .ranking-table td:nth-child(11) {
        display: none;
    }

    .match-summary {
        flex-direction: column;
        text-align: center;
    }

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

    .match-score {
        font-size: 22px;
    }
}

/* ============================================
   RESPONSIVE: VERY SMALL PHONES (≤360px)
   ============================================ */
@media (max-width: 360px) {
    .main-content {
        padding: 8px;
        padding-top: calc(var(--topbar-height) + 2px);
    }

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

    .stat-card {
        padding: 10px;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .stat-card .stat-icon {
        font-size: 22px;
        margin-bottom: 0;
    }

    .stat-card .stat-number {
        font-size: 16px;
    }

    .stat-card .stat-label {
        font-size: 11px;
    }

    .top-bar h1 {
        font-size: 16px;
    }

    .card {
        padding: 10px;
        margin-bottom: 10px;
        border-radius: 6px;
    }

    .card-header h2 {
        font-size: 14px;
    }

    table {
        min-width: 300px;
    }

    table th, table td {
        padding: 5px 6px;
        font-size: 10px;
    }

    .btn {
        padding: 7px 12px;
        font-size: 12px;
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }

    .modal {
        padding: 16px 10px 14px;
        border-radius: 8px 8px 0 0;
    }

    .login-box {
        padding: 20px 14px;
        border-radius: 8px;
    }

    .login-box h1 {
        font-size: 18px;
    }

    .partido-card {
        padding: 10px;
        gap: 6px;
    }

    .partido-equipo {
        font-size: 13px;
    }

    .partido-resultado .score {
        font-size: 16px;
    }

    .ranking-item {
        padding: 8px 0;
        gap: 8px;
    }

    .ranking-position {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .ranking-name {
        font-size: 13px;
    }

    .ranking-stats .pts {
        font-size: 13px;
    }

    .ranking-detail {
        font-size: 10px;
    }

    .ranking-legend {
        font-size: 10px;
    }

    .mobile-top-bar {
        padding: 0 10px;
    }

    .mobile-top-bar .logo {
        font-size: 15px;
    }

    .mobile-top-bar .logo small {
        font-size: 9px;
    }

    .hamburger {
        width: 34px;
        height: 34px;
        font-size: 20px;
    }

    .empty-state {
        padding: 24px 12px;
    }

    .empty-state .icon {
        font-size: 32px;
    }

    .empty-state h3 {
        font-size: 14px;
    }

    .empty-state p {
        font-size: 12px;
    }

    .ranking-table th:nth-child(3),
    .ranking-table td:nth-child(3),
    .ranking-table th:nth-child(6),
    .ranking-table td:nth-child(6) {
        display: none;
    }
}

/* ============================================
   RESPONSIVE: TABLES - make scrollable on any overflow
   ============================================ */
@media (max-width: 600px) {
    table {
        min-width: 420px;
    }
}

@media (max-width: 400px) {
    table {
        min-width: 350px;
    }
}

/* ============================================
   RESPONSIVE: LANDSCAPE MOBILE
   ============================================ */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 220px;
    }

    .sidebar-nav a {
        padding: 10px 16px;
        font-size: 14px;
    }

    .sidebar-header {
        padding: 16px 16px;
    }

    .sidebar-header h2 {
        font-size: 17px;
    }

    .main-content {
        padding-top: calc(var(--topbar-height) + 4px);
    }

    .modal {
        max-height: 80vh;
    }
}

/* ============================================
   RESPONSIVE: TABLETS IN LANDSCAPE (1025px - 1280px)
   ============================================ */
@media (min-width: 1025px) and (max-width: 1280px) {
    .main-content {
        padding: 28px 24px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    }

    .ranking-table th:nth-child(8),
    .ranking-table td:nth-child(8),
    .ranking-table th:nth-child(10),
    .ranking-table td:nth-child(10) {
        display: none;
    }
}

/* ============================================
   ACCESSIBILITY & TOUCH
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .btn:hover { transform: none; }
    .stat-card:hover { transform: none; }
    table tr:hover { background: inherit; }
    .partido-card:hover { background: var(--bg); }

    .sidebar-nav a {
        padding: 16px 20px;
    }

    .btn {
        padding: 12px 18px;
    }

    .btn-sm {
        padding: 8px 14px;
    }

    .btn-icon {
        width: 40px;
        height: 40px;
    }

    .hamburger {
        width: 44px;
        height: 44px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .sidebar,
    .mobile-top-bar,
    .sidebar-overlay,
    .btn,
    form {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}