* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; margin: 0; background: #f4f6f8; color: #222; background-image: url('voley.jpg');background-size:cover; }
nav { background: #1e3a8a; padding: 12px 20px; display: flex; gap: 15px; align-items: center; color: white; flex-wrap: wrap; }
nav a { color: #dbeafe; text-decoration: none; }
nav a:hover { color: white; }
.user-info { margin-left: auto; font-size: 0.9em; }
.user-info a { margin-left: 10px; color: #fca5a5; }
main { padding: 20px; max-width: 1200px; margin: 0 auto; }
h1 { color: #1e3a8a; }
table { width: 100%; border-collapse: collapse; background: white; margin-top: 10px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #e5e7eb; text-align: left; }
th { background: #eff6ff; color: #1e3a8a; }
.form-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: white; padding: 12px; border-radius: 6px; }
.form-inline input, .form-inline select { padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 4px; }
button { background: #1e3a8a; color: white; border: none; padding: 7px 16px; border-radius: 4px; cursor: pointer; }
button:hover { background: #1e40af; }
.login-box { max-width: 350px; margin: 100px auto; background: white; padding: 30px; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.login-box input, .login-box button { width: 100%; padding: 10px; margin-bottom: 10px; }
.error { background: #fee2e2; color: #991b1b; padding: 8px 12px; border-radius: 4px; }
.cards { display: flex; gap: 15px; flex-wrap: wrap; }
.card { background: white; padding: 20px; border-radius: 8px; flex: 1; min-width: 180px; box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
.card h3 { margin: 0 0 8px; font-size: 0.9em; color: #64748b; }
.card p { font-size: 2em; font-weight: bold; margin: 0; color: #1e3a8a; }
.badge { padding: 2px 8px; border-radius: 10px; font-size: 0.8em; background: #e0e7ff; color: #3730a3; }
.badge.programado { background: #fef3c7; color: #92400e; }
.badge.jugado { background: #d1fae5; color: #065f46; }
.badge.cancelado { background: #fee2e2; color: #991b1b; }
.info {
    background: #dbeafe;
    color: #1e40af;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 4px solid #1e40af;
}
/* ==== Logos de equipos ==== */
.logo-equipo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    padding: 2px;
    border: 1px solid #e5e7eb;
    vertical-align: middle;
}

.logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 22px;
    background: #eff6ff;
    border-radius: 6px;
}

.logo-small {
    width: 24px;
    height: 24px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 6px;
    border-radius: 4px;
    background: #fff;
}

.logo-match {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
    margin: 0 auto 8px;
}

.match-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.match-team {
    text-align: center;
    flex: 1;
}

.match-vs {
    font-size: 1.5em;
    font-weight: bold;
    color: #1e3a8a;
}
/* ================= Calendario ================= */
.calendario-wrapper {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.calendario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 1.2em;
    color: #1e3a8a;
}

.cal-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #eff6ff;
    color: #1e3a8a;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: background 0.2s;
}

.cal-nav:hover {
    background: #1e3a8a;
    color: white;
}

.calendario {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendario th {
    background: #1e3a8a;
    color: white;
    padding: 8px 4px;
    text-align: center;
    font-size: 0.85em;
    border: none;
}

.calendario td {
    border: 1px solid #e5e7eb;
    vertical-align: top;
    padding: 6px;
    height: 90px;
    width: 14.28%;
    font-size: 0.75em;
}

.calendario td.cal-vacia {
    background: #f8fafc;
    border-color: #e5e7eb;
}

.calendario td.cal-hoy {
    background: #fef3c7;
    box-shadow: inset 0 0 0 2px #f59e0b;
}

.calendario td.cal-con-partidos {
    background: #f0f9ff;
}

.calendario td.cal-hoy.cal-con-partidos {
    background: #fef3c7;
}

.cal-dia {
    font-weight: bold;
    color: #475569;
    margin-bottom: 3px;
    font-size: 0.95em;
}

.cal-hoy .cal-dia {
    color: #b45309;
}

.cal-eventos {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cal-evento {
    background: #dbeafe;
    color: #1e40af;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.72em;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}

.cal-evento.jugado {
    background: #d1fae5;
    color: #065f46;
}

.cal-evento.cancelado {
    background: #fee2e2;
    color: #991b1b;
    text-decoration: line-through;
    opacity: 0.7;
}

.cal-evento-texto {
    font-weight: 500;
}

.cal-mas {
    font-size: 0.7em;
    color: #64748b;
    font-style: italic;
    margin-top: 2px;
}

/* Botón mini para acciones */
.btn-mini {
    display: inline-block;
    background: #1e3a8a;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    text-decoration: none;
}

.btn-mini:hover {
    background: #1e40af;
    color: white;
}

/* Responsive: en pantallas pequeñas el calendario se simplifica */
@media (max-width: 768px) {
    .calendario td {
        height: 60px;
        padding: 3px;
        font-size: 0.65em;
    }
    .cal-evento {
        font-size: 0.6em;
    }
    .cal-evento-texto {
        display: none;
    }
}
.badge.rol-admin { background: #fee2e2; color: #991b1b; }
.badge.rol-capturista { background: #dbeafe; color: #1e40af; }
.badge.rol-consulta { background: #e0e7ff; color: #3730a3; }
