/**
 * Theme 2026 — modern visual skin.
 * Loaded LAST so it wins the cascade over legacy styles (app.css and the
 * component files). All new colors/radii/shadows live here as tokens;
 * feature CSS keeps its layout rules untouched.
 */

:root {
    /* Brand (anchored on the existing menu gradient #667eea → #764ba2) */
    --brand: #4f46e5;
    --brand-hover: #4338ca;
    --brand-soft: #eef2ff;
    --brand-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    /* Neutrals */
    --surface: #ffffff;
    --app-bg: #f1f5f9;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Semantic */
    --ok: #16a34a;
    --ok-soft: #f0fdf4;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --warning: #d97706;
    --warning-hover: #b45309;

    /* Shape & depth */
    --radius-sm: 8px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 14px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 4px 10px rgba(15, 23, 42, 0.06), 0 12px 32px rgba(15, 23, 42, 0.10);

    --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ========== Base ========== */

body {
    font-family: var(--font-stack);
    background-color: var(--app-bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.container {
    background: var(--app-bg);
}

h1, h2, h3, h4 {
    color: var(--text);
    letter-spacing: -0.02em;
}

h2 { font-size: 1.6rem; font-weight: 700; margin: 28px 0 16px 0; }
h3 { font-size: 1.25rem; font-weight: 650; }

/* ========== Buttons ========== */

.btn {
    font-family: var(--font-stack);
    text-transform: none;          /* legacy ALL-CAPS off */
    letter-spacing: 0;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: var(--brand);
    color: #fff;
    box-shadow: var(--shadow-sm);
    transition: background-color 150ms ease, border-color 150ms ease,
                box-shadow 150ms ease, transform 100ms ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn:active { transform: translateY(0); }

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.35);
}

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25); }

/* Secondary became a quiet outline button instead of a gray slab */
.btn-secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: #f8fafc;
    color: var(--text);
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
    box-shadow: none;
}
.btn-outline-secondary:hover { background: #f8fafc; color: var(--text); }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); box-shadow: 0 6px 16px rgba(220, 38, 38, 0.25); }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: var(--warning-hover); box-shadow: 0 6px 16px rgba(217, 119, 6, 0.25); }

.btn-success, .btn.success { background: var(--ok); }

/* ========== Inputs ========== */

input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="date"], input[type="datetime-local"],
select, textarea {
    font-family: var(--font-stack);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    background-color: var(--surface);
    color: var(--text);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* ========== Cards ========== */

.dashboard-card, .admin-section, .user-card,
.monthly-standings-container, .fixtures-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.dashboard-card { padding: 20px; }

.dashboard-card h3, .admin-section h3 {
    margin-top: 0;
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--text);
}

/* Stat tiles */
.stat-item, .stat-card {
    background: var(--brand-soft);
    border: 1px solid #e0e7ff;
    border-radius: var(--radius);
}

.stat-number { color: var(--brand); font-weight: 750; letter-spacing: -0.03em; }
.stat-label { color: var(--text-secondary); }

/* ========== Tables ========== */

/* Light headers instead of the heavy navy slabs */
.players-table th,
#standings-table thead,
#standings-table th,
.monthly-standings-table th,
.sync-history-table th {
    background: #f8fafc;
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
}

#standings-table .sub-header th {
    background-color: #f1f5f9;
    color: var(--text-muted);
}

.players-table-container,
#standings-table,
.monthly-standings-table {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.players-table td, #standings-table td {
    border-bottom: 1px solid #f1f5f9;
    color: var(--text);
}

.players-table tbody tr:nth-child(even) { background-color: transparent; }
.players-table tbody tr:hover,
#standings-table tbody tr:hover,
.players-table tbody tr:nth-child(even):hover {
    background-color: var(--brand-soft);
}

.rank-cell { color: var(--brand); }

/* Champions League / relegation zebra tints — softer */
.top-four { background-color: #ecfdf5 !important; }
.top-four:hover { background-color: #d1fae5 !important; }
.relegation { background-color: #fef2f2 !important; }
.relegation:hover { background-color: #fee2e2 !important; }

/* ========== Fixtures ========== */

/* The purple hero banner becomes a clean card with a brand accent */
.fixtures-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: var(--text);
    padding: 18px 22px;
}

.fixtures-header h3 {
    color: var(--text);
    text-shadow: none;
    font-size: 1.2rem;
}

.fixtures-stats { color: var(--text-secondary); opacity: 1; }

.fixture-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    backdrop-filter: none;
}

.fixture-item:hover { box-shadow: var(--shadow); }

/* ========== Side menu polish ========== */

.side-menu {
    border-right: 1px solid var(--border);
}

#league-switcher {
    font-family: var(--font-stack);
    font-weight: 600;
    cursor: pointer;
}

/* Dashboard league badge */
#current-league-name {
    display: inline-block;
    color: var(--brand) !important;
    background: var(--brand-soft);
    border: 1px solid #e0e7ff;
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 13px !important;
    font-weight: 650 !important;
}

/* ========== Chips & badges ========== */

.chip {
    display: inline-block;
    background: #f1f5f9;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 10px;
    margin: 2px;
    font-size: 12px;
    font-weight: 550;
    white-space: nowrap;
}

.chip-brand {
    background: var(--brand-soft);
    color: var(--brand);
    border-color: #e0e7ff;
    font-weight: 650;
}

.chip-danger {
    background: #fef2f2;
    color: var(--danger);
    border-color: #fee2e2;
    font-weight: 650;
}

.chip-muted { color: var(--text-muted); font-size: 12px; }

/* Row action buttons: quiet ghost style instead of colored slabs */
.action-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 9px;
    font-size: 13px;
    line-height: 1;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.action-btn:hover {
    background: var(--brand-soft);
    border-color: #c7d2fe;
}

.action-btn.danger { background: var(--surface); }
.action-btn.danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

/* ========== Misc legacy cleanups ========== */

/* Status pills */
.sync-status.success { color: var(--ok); }
.sync-status.error { color: var(--danger); }

/* Modals */
.modal-content { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }

/* Auth card (login screen) */
#auth-section {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm);
}
