/* =========================================================================
   Estilo común — Becas Ministerio
   Basado en la estética de la página /gracias (fondo degradado verde,
   tarjetas blancas, esquinas redondeadas y sombras suaves).
   ========================================================================= */

* { box-sizing: border-box; }

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    background-attachment: fixed;
    margin: 0;
    padding: 24px 16px 60px;
    color: #333;
    min-height: 100vh;
}

/* Contenedor general de la página */
.app {
    max-width: 960px;
    margin: 0 auto;
}

.app-ancha { max-width: 1400px; }

/* ---------- Cabecera ---------- */
.cabecera {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
    padding: 28px 32px;
    margin-bottom: 24px;
    text-align: center;
}

.cabecera h1 {
    color: #2e7d32;
    margin: 0 0 6px;
    font-size: 28px;
}

.cabecera .subtitulo {
    color: #555;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.cabecera .ayuda {
    color: #777;
    font-size: 14px;
    margin: 8px 0 0;
}

/* ---------- Tarjetas / secciones ---------- */
.seccion {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 26px 30px;
    margin-bottom: 20px;
}

.seccion h2 {
    color: #2e7d32;
    font-size: 19px;
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8f5e9;
    text-align: left;
}

.seccion h3 {
    color: #33691e;
    font-size: 17px;
    margin: 8px 0;
    text-align: left;
}

.seccion h4 {
    color: #555;
    font-size: 15px;
    margin: 0 0 14px;
    text-align: left;
    font-weight: 600;
}

/* Sección con tinte verde (resumen / destacados) */
.seccion-resumen {
    background: #f1f8e9;
    border: 1px solid #c5e1a5;
}

.seccion-resumen h2,
.seccion-resumen h3 { color: #33691e; }

.seccion-resumen .dato {
    font-size: 17px;
    margin: 6px 0;
    color: #33691e;
}

.seccion-resumen .dato strong { color: #1b5e20; }

/* Enlace pequeño de apoyo */
.enlace-apoyo {
    font-size: 14px;
    color: #2e7d32;
}

/* ---------- Formularios ---------- */
form { margin: 0; }

label {
    display: block;
    margin: 16px 0 6px;
    color: #444;
    font-weight: 600;
    font-size: 15px;
}

label:first-of-type { margin-top: 0; }

select,
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 11px 12px;
    margin-bottom: 4px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
    color: #333;
    transition: border-color .15s, box-shadow .15s;
}

select:focus,
input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.20);
}

/* Inputs de sólo lectura (tabla de permisos) */
input[readonly] {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
}

/* Inputs ocultos: sin afectar al diseño */
input[type="hidden"] { display: none; }

/* ---------- Botones ---------- */
input[type="submit"],
button,
.btn {
    display: inline-block;
    width: auto;
    padding: 12px 26px;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .05s;
    text-decoration: none;
}

input[type="submit"]:hover,
button:hover,
.btn:hover { background: #43a047; }

input[type="submit"]:active,
button:active { transform: translateY(1px); }

/* Botón pequeño (tablas) */
.btn-actualizar {
    padding: 6px 12px;
    font-size: 13px;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-actualizar:hover { background: #43a047; }

/* Fila de acciones del formulario */
.acciones {
    margin-top: 8px;
    text-align: center;
}

.acciones input[type="submit"] { min-width: 240px; }

/* ---------- Contadores / estadísticas ---------- */
.tarjetas-estadisticas {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.tarjeta-estadistica {
    flex: 1 1 200px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    padding: 18px 20px;
    text-align: center;
}

.tarjeta-estadistica .etiqueta {
    display: block;
    color: #777;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
}

.tarjeta-estadistica .valor {
    display: block;
    color: #2e7d32;
    font-size: 30px;
    font-weight: 700;
}

.tarjeta-estadistica.neutro .valor { color: #1565c0; }
.tarjeta-estadistica.aviso .valor { color: #e53935; }
.tarjeta-estadistica.info .valor { color: #ef6c00; }

.contador {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    padding: 16px 20px;
    margin-bottom: 20px;
    line-height: 1.8;
}

.contador strong { color: #2e7d32; }

/* ---------- Tablas ---------- */
.tabla-contenedor {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 8px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 10px 12px;
    border-bottom: 1px solid #eceff1;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f1f8e9;
    color: #33691e;
    font-weight: 700;
    position: sticky;
    top: 0;
}

tbody tr:nth-child(even) { background: #fafafa; }
tbody tr:hover { background: #f1f8e9; }

/* Checkboxes de la tabla de permisos */
td input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4caf50;
}

/* Enlaces dentro de tablas */
td a, .enlace-tabla {
    color: #2e7d32;
    font-weight: 600;
    text-decoration: none;
}

td a:hover, .enlace-tabla:hover { text-decoration: underline; }

/* ---------- Gráficas (Chart.js) ---------- */
.grafica-contenedor {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 20px;
}

.grafica-contenedor h3 {
    color: #2e7d32;
    margin: 0 0 14px;
    font-size: 17px;
}

canvas { max-width: 100%; }

/* ---------- Utilidades ---------- */
.texto-centro { text-align: center; }
.mt { margin-top: 20px; }
.mb { margin-bottom: 20px; }
