/* ==========================================================================
   1. VARIABLES GLOBALES Y CONFIGURACIÓN BASE
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #38bdf8; /* Azul cyan moderno */
    --primary-hover: #22d3ee;
    --bg-color: #0a0f1c; /* Fondo oscuro unificado */
    --card-bg: #111827; /* Fondo de tarjetas y formularios */
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --input-bg: #1e2937;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================================================
   2. CABECERA UNIFICADA (HEADER & NAVEGACIÓN)
   ========================================================================== */
.header {
    background: rgba(10, 15, 28, 0.97);
    backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 10px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.uni-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.logo {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

/* Badge del Integrante */
.integrante-badge {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: var(--primary-color);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 25px;
}

nav {
    display: flex;
    gap: 10px;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 30px;
}

nav a:hover {
    color: var(--primary-color);
    background: rgba(56, 189, 248, 0.08);
}

/* ==========================================================================
   3. CONTENEDORES PRINCIPALES
   ========================================================================== */
.container {
    max-width: 1200px;
    margin: 120px auto 40px;
    padding: 0 20px;
    width: 100%;
}

.main-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 120px 20px 40px 20px;
}

/* ==========================================================================
   4. COMPONENTES DE FORMULARIO (AGREGAR / EDITAR)
   ========================================================================== */
.form-box {
    background-color: var(--card-bg);
    padding: 2.2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 520px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-box h2 {
    font-size: 1.9rem;
    font-weight: 700;
    color: white;
    margin-top: 0;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-box h2 i {
    color: var(--primary-color);
}

.form-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.8rem;
    font-weight: 300;
}

.input-group {
    margin-bottom: 1.4rem;
    text-align: left;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: #f1f5f9;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 0.9rem 1.2rem;
    background-color: var(--input-bg);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: white;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #1f2937;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

/* Botón de envío */
.btn-submit {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: #0a0f1c;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1.8rem;
    text-decoration: none;
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(56, 189, 248, 0.4);
}

.btn-cancel {
    display: block;
    text-align: center;
    margin-top: 1.2rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.2s;
}

.btn-cancel:hover {
    color: #ef4444; /* Resaltado sutil en color rojo al cancelar */
}

/* ==========================================================================
   5. CONSULTA INDIVIDUAL Y TABLA GENERAL (CONSULTAR)
   ========================================================================== */
.search-box {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.search-box h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-top: 0;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box h3 i {
    color: var(--primary-color);
}

.search-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.search-form .input-group {
    margin-bottom: 0;
    flex: 1;
}

.search-form .btn-submit {
    width: auto;
    margin-top: 0;
    height: 48px;
    padding: 0 30px;
}

/* Estructura de la Tabla de Registros */
.tabla-box {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

th {
    background-color: rgba(255, 255, 255, 0.02);
    color: #f1f5f9;
    font-weight: 600;
    padding: 1.1rem 1.5rem;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

td {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.01);
}

/* Acciones en Tabla */
.action-btn {
    font-size: 1.1rem;
    margin-right: 12px;
    text-decoration: none;
    transition: transform 0.2s, color 0.2s;
    display: inline-block;
}

.action-btn:hover {
    transform: scale(1.2);
}

.edit-btn {
    color: #38bdf8;
}

.delete-btn {
    color: #ef4444;
}

/* Badge numérico */
.badge {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
}

.text-center {
    text-align: center;
    color: var(--text-muted);
    padding: 2.5rem !important;
}

/* ==========================================================================
   6. REPORTES E IMPRESIÓN (REPORTE INSTITUCIONAL)
   ========================================================================== */
.report-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.report-title h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
}

.report-title p {
    color: var(--text-muted);
    margin: 5px 0 0;
    font-size: 0.95rem;
}

/* Estilo para impresión física y PDF limpia */
@media print {
    body { 
        background-color: #ffffff !important; 
        color: #000000 !important; 
        font-size: 11pt; 
    }
    .header, .btn-submit, .btn-back-report, .btn-print, .action-btn { 
        display: none !important; 
    }
    .container {
        margin-top: 20px !important;
        padding: 0 !important;
        max-width: 100% !important;
    }
    .report-title h2 {
        color: #000000 !important;
        font-size: 20pt;
    }
    .report-title p {
        color: #555555 !important;
    }
    .tabla-box { 
        border: 1px solid #000000 !important; 
        background-color: #ffffff !important;
        box-shadow: none !important; 
        border-radius: 0 !important;
    }
    th { 
        background-color: #f2f2f2 !important; 
        color: #000000 !important; 
        border-bottom: 2px solid #000000 !important; 
        padding: 8px 12px !important;
    }
    td { 
        color: #000000 !important; 
        border-bottom: 1px solid #cccccc !important; 
        padding: 8px 12px !important;
        background-color: #ffffff !important;
    }
    .badge { 
        border: none !important; 
        background: none !important;
        color: #000000 !important; 
        padding: 0 !important; 
        font-weight: bold;
    }
}

/* ==========================================================================
   7. ALERTAS Y NOTIFICACIONES DE SISTEMA
   ========================================================================== */
.alert {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 500;
}

.alert.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert.success {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}