/* Mundial Pronósticos 2026 — #0D1B3E · #C8102E · blanco · negro */

:root {
    --navy: #0D1B3E;
    --red: #C8102E;
    --white: #ffffff;
    --black: #000000;
    --gray-100: #f7f7f7;
    --gray-200: #e8e8e8;
    --gray-400: #999999;
    --gray-600: #555555;
    --border: #e0e0e0;
}

* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--white);
    color: var(--black);
    min-height: 100vh;
    font-size: 0.9375rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.navbar-mundial {
    background: var(--navy);
    padding: 0;
    border-bottom: 3px solid var(--red);
}

.navbar-mundial .container { padding-top: 0.875rem; padding-bottom: 0.875rem; }

.navbar-mundial .navbar-brand {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.01em;
    color: var(--white) !important;
}

.navbar-mundial .nav-link {
    color: rgba(255, 255, 255, 0.65) !important;
    font-weight: 400;
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem !important;
}

.navbar-mundial .nav-link:hover { color: var(--white) !important; }

.navbar-mundial .nav-link.active {
    color: var(--white) !important;
    font-weight: 500;
}

.navbar-mundial .nav-link.active::after {
    content: "";
    display: block;
    height: 2px;
    background: var(--red);
    margin-top: 0.25rem;
}

.user-meta { color: rgba(255, 255, 255, 0.75); font-size: 0.8125rem; }
.user-meta .logout { color: rgba(255, 255, 255, 0.5); text-decoration: none; margin-left: 0.75rem; }
.user-meta .logout:hover { color: var(--white); }

.page-header { padding: 2.5rem 0 2rem; border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 0.25rem; color: var(--navy); }
.page-header .subtitle { color: var(--gray-600); font-size: 0.875rem; margin: 0; }
.page-header .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.btn-primary-m {
    background: var(--navy); color: var(--white); border: 1px solid var(--navy);
    font-size: 0.8125rem; font-weight: 500; padding: 0.5rem 1rem; border-radius: 0;
    text-decoration: none; display: inline-block;
}
.btn-primary-m:hover { background: #162a5c; color: var(--white); }

.btn-accent-m {
    background: var(--red); color: var(--white); border: 1px solid var(--red);
    font-size: 0.8125rem; font-weight: 500; padding: 0.5rem 1rem; border-radius: 0;
    text-decoration: none; display: inline-block;
}
.btn-accent-m:hover { background: #a30d25; color: var(--white); border-color: #a30d25; }

.btn-ghost-m {
    background: transparent; color: var(--navy); border: 1px solid var(--navy);
    font-size: 0.8125rem; font-weight: 500; padding: 0.5rem 1rem; border-radius: 0;
    text-decoration: none; display: inline-block;
}
.btn-ghost-m:hover { background: var(--navy); color: var(--white); }

.alert-minimal {
    border-left: 3px solid var(--red); background: var(--gray-100);
    padding: 0.75rem 1rem; display: flex; align-items: center;
    justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem;
}
.alert-minimal p { margin: 0; font-size: 0.875rem; color: var(--black); }

.stats-row {
    display: grid; grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 2.5rem;
}
.stat-item { padding: 1.25rem 1rem; border-right: 1px solid var(--border); text-align: center; }
.stat-item:last-child { border-right: none; }
.stat-value { font-size: 1.75rem; font-weight: 600; color: var(--navy); line-height: 1; letter-spacing: -0.03em; }
.stat-label { font-size: 0.75rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.35rem; }

.section { margin-bottom: 2.5rem; }
.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--navy);
}
.section-head h2 { font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--navy); margin: 0; }
.section-head a { font-size: 0.75rem; color: var(--gray-600); text-decoration: none; }
.section-head a:hover { color: var(--red); }

.match-list { list-style: none; padding: 0; margin: 0; }
.match-item {
    display: grid; grid-template-columns: 3rem 1fr auto; align-items: center;
    gap: 1rem; padding: 0.875rem 0; border-bottom: 1px solid var(--border);
}
.match-item:last-child { border-bottom: none; }
.match-day { font-size: 0.75rem; color: var(--gray-400); text-align: center; line-height: 1.3; }
.match-day strong { display: block; font-size: 1.125rem; font-weight: 600; color: var(--navy); }
.match-day .time { display: block; margin-top: 0.2rem; font-size: 0.8125rem; font-weight: 500; color: var(--navy); }
.match-teams .team-line-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.7;
}
.match-teams .team-line-item + .team-line-item,
.match-teams .team-line-item + .text-muted-small { margin-top: 0.1rem; }
.team-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.team-vs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
}
.team-vs .team-line-item { display: inline-flex; }
.vs-sep { color: var(--gray-400); font-size: 0.75rem; }
.match-info { text-align: right; font-size: 0.75rem; color: var(--gray-600); }
.match-info .time { display: block; font-size: 0.875rem; font-weight: 500; color: var(--black); }
.match-score { font-size: 1rem; font-weight: 600; color: var(--navy); min-width: 3rem; text-align: center; }
.status { font-size: 0.6875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.status-live { color: var(--red); }
.status-done { color: var(--gray-400); }

.leader-block { background: var(--navy); color: var(--white); padding: 1.5rem; margin-bottom: 2rem; border-left: 4px solid var(--red); }
.leader-block .label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.5); margin-bottom: 0.5rem; }
.leader-block .name { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.125rem; }
.leader-metrics { display: flex; gap: 2rem; }
.leader-metrics dt { font-size: 1.125rem; font-weight: 600; margin: 0; }
.leader-metrics dd { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.45); margin: 0; }

.table-minimal { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table-minimal thead th {
    text-align: left; font-size: 0.6875rem; font-weight: 500; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--gray-400); padding: 0.5rem 0.75rem; border-bottom: 2px solid var(--black);
}
.table-minimal tbody td { padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--border); }
.table-minimal tbody tr:hover { background: var(--gray-100); }
.table-minimal .pos { font-weight: 600; color: var(--gray-400); width: 2rem; }
.table-minimal .pos-1 { color: var(--red); }
.table-minimal .name { font-weight: 500; }
.table-minimal .pts { font-weight: 600; color: var(--navy); }
.table-minimal tr.is-you { background: var(--gray-100); }
.table-minimal tr.is-you .name::after {
    content: "tú"; margin-left: 0.5rem; font-size: 0.625rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em; color: var(--red);
}
.trend-up { color: var(--navy); }
.trend-down { color: var(--red); }
.trend-same { color: var(--gray-400); }

.footer-mundial { border-top: 1px solid var(--border); padding: 1.25rem 0; margin-top: 3rem; font-size: 0.75rem; color: var(--gray-400); }
.footer-mundial strong { color: var(--navy); font-weight: 500; }

/* Auth */
.auth-body { background: var(--navy); }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-box {
    width: 100%; max-width: 380px; background: var(--white); padding: 2.5rem 2rem;
    border-top: 4px solid var(--red);
}
.auth-box h1 { font-size: 1.25rem; font-weight: 600; color: var(--navy); margin: 0 0 0.25rem; text-align: center; }
.auth-sub { font-size: 0.875rem; color: var(--gray-600); text-align: center; margin-bottom: 2rem; }
.auth-form .form-label { font-size: 0.8125rem; font-weight: 500; color: var(--navy); }
.auth-form .form-control { border-radius: 0; border-color: var(--border); font-size: 0.875rem; }
.auth-form .form-control:focus { border-color: var(--navy); box-shadow: none; }
.auth-link { font-size: 0.875rem; }
.auth-link a { color: var(--red); text-decoration: none; font-weight: 500; }
.auth-link a:hover { text-decoration: underline; }
.auth-note { font-size: 0.75rem; }
.status-pending { color: #b45309; }
tr.is-pending { background: rgba(184, 83, 9, 0.04); }

@media (max-width: 991.98px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .stat-item:nth-child(2) { border-right: none; }
    .stat-item:nth-child(1), .stat-item:nth-child(2) { border-bottom: 1px solid var(--border); }
}

.text-muted-small { font-size: 0.75rem; color: var(--gray-400); display: block; }
.text-muted { color: var(--gray-600); }
.text-success { color: var(--navy); font-size: 0.75rem; }
.text-danger { color: var(--red); font-size: 0.75rem; }

/* Pronósticos — input alineado con cada equipo */
.pronosticos-list { list-style: none; padding: 0; margin: 0; }

.pronostico-row {
    display: grid;
    grid-template-columns: 3rem 1fr;
    gap: 1rem 1.25rem;
    align-items: start;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.pronostico-row:last-child { border-bottom: none; }

.pronostico-form,
.pronostico-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.pronostico-team {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0.65rem;
    background: var(--gray-100);
    border-left: 3px solid var(--navy);
}

.pronostico-team .team-line-item {
    min-width: 0;
}

.score-input {
    width: 3rem;
    text-align: center;
    border: 1px solid var(--border);
    background: var(--white);
    padding: 0.4rem 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
}
.score-input:focus { outline: none; border-color: var(--navy); }

.score-display {
    min-width: 3rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
}
.score-display.score-empty { color: var(--gray-400); }

.pronostico-meta {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    color: var(--gray-400);
}

.pronostico-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.puntos-badge { font-size: 0.75rem; font-weight: 600; color: var(--navy); }

.score-inputs { display: flex; align-items: center; gap: 0.35rem; }
.score-sep { color: var(--gray-400); font-weight: 500; }
.admin-resultado-row { grid-template-columns: 3rem 1fr auto !important; }
.filter-select { border-radius: 0; border-color: var(--border); font-size: 0.8125rem; min-width: 160px; }
.form-feedback { font-size: 0.75rem; min-height: 1rem; }

.admin-subnav { border-bottom: 1px solid var(--border); background: var(--gray-100); }
.admin-subnav-list {
    list-style: none; margin: 0; padding: 0.5rem 0;
    display: flex; gap: 1.25rem; flex-wrap: wrap;
}
.admin-subnav-list a {
    font-size: 0.8125rem; color: var(--gray-600); text-decoration: none;
    text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500;
}
.admin-subnav-list a:hover, .admin-subnav-list a.active { color: var(--red); }
.admin-form .form-control, .admin-form .form-select {
    border-radius: 0; border-color: var(--border); font-size: 0.875rem;
}
.admin-form .form-control:focus, .admin-form .form-select:focus {
    border-color: var(--navy); box-shadow: none;
}
.admin-actions { white-space: nowrap; }
.admin-actions .view-all + .view-all { margin-left: 0.75rem; }

.toast-container-m {
    position: fixed; top: 1rem; right: 1rem; z-index: 1080;
    display: flex; flex-direction: column; gap: 0.5rem; max-width: 360px;
    pointer-events: none;
}
.toast-m {
    padding: 0.75rem 1rem; font-size: 0.875rem; color: var(--white);
    background: var(--navy); box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0; transform: translateY(-8px); transition: opacity 0.3s, transform 0.3s;
}
.toast-m.is-visible { opacity: 1; transform: translateY(0); }
.toast-m-error { background: var(--red); }
.btn-spinner {
    display: inline-block; width: 0.875rem; height: 0.875rem;
    border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff;
    border-radius: 50%; animation: spin 0.7s linear infinite;
    vertical-align: -0.125em; margin-right: 0.35rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 767.98px) {
    .page-header { padding: 1.5rem 0 1.25rem; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .match-item { grid-template-columns: 2.5rem 1fr; }
    .match-info { grid-column: 2; text-align: left; padding-left: 0; }
    .leader-metrics { gap: 1.25rem; }
    .user-meta .user-name { display: none; }
    .navbar-mundial .nav-link.active::after { display: none; }
    .pronostico-row { grid-template-columns: 2.5rem 1fr; gap: 0.75rem; }
    .admin-resultado-row { grid-template-columns: 1fr !important; }
}
