/* ============================================ */
/* IDENTIDAD INSTITUCIONAL IPN 2026 - UNIFICADO */
/* ============================================ */

:root {
    --ipn-guinda: #7D2133;
    --ipn-guinda-hover: #5a1825;
    --ipn-oro: #BC955C;
    --ipn-blanco: #FFFFFF;
    --bg-gris: #f0f2f5;
    --texto-oscuro: #333;
    --texto-suave: #555;
    --shadow-deep: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-soft: 0 4px 6px rgba(0,0,0,0.07);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background-color: var(--bg-gris); 
    display: flex; 
    justify-content: center; 
    align-items: center;
    padding: clamp(10px, 5vh, 40px) 0; 
    margin: 0; 
    min-height: 100vh;
}

/* ========== TARJETA PRINCIPAL ========== */
.card { 
    background: var(--ipn-blanco); 
    padding: clamp(20px, 5%, 45px);
    border-radius: 15px; 
    box-shadow: var(--shadow-deep); 
    width: 95%; 
    max-width: 900px;
    text-align: center; 
    border-top: 12px solid var(--ipn-guinda); 
    margin: 20px auto;
    box-sizing: border-box;
}

/* ========== LOGOTIPOS ========== */
.header-logos { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; 
    padding: 0 5px;
    flex-wrap: wrap;
    gap: 15px;
}

.header-logos img { 
    height: clamp(50px, 10vw, 100px);
    width: auto; 
    object-fit: contain;
}

.header-logos img.logo-ipn { 
    height: clamp(70px, 13vw, 130px); 
}

/* ========== TÍTULOS ========== */
h2 { 
    color: var(--ipn-guinda); 
    margin-bottom: 5px; 
    font-size: clamp(1.4rem, 5vw, 2rem);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.subtitulo-diplomas { 
    color: var(--texto-suave); 
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    font-weight: 500; 
    margin-bottom: 25px; 
    border-bottom: 2px solid var(--ipn-oro);
    display: inline-block;
    padding-bottom: 5px;
}

/* ========== ACORDEONES ========== */
.acordeon-item {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    transition: 0.3s ease;
}

.acordeon-header {
    background: #f8f9fa;
    padding: clamp(15px, 3vw, 22px);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: var(--ipn-guinda);
    transition: 0.3s;
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
}

.acordeon-header:hover {
    background: #e9ecef;
}

.acordeon-content {
    display: none; 
    padding: clamp(15px, 4vw, 30px);
    background: #f1f3f5;
    text-align: left;
    border-top: 1px solid #ddd;
}

.acordeon-item.active > .acordeon-header {
    background: var(--ipn-guinda);
    color: white;
}

/* Nivel 2: Categorías internas */
.header-secundario {
    background: #ffffff !important;
    color: var(--ipn-guinda) !important;
    font-weight: 800 !important;
    border: 1px solid #ccc !important;
    border-radius: 8px;
    margin-top: 12px;
    padding: clamp(12px, 2.5vw, 18px) !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    letter-spacing: 0.5px;
    cursor: pointer;
}

.content-interno {
    padding: clamp(15px, 3vw, 25px) !important;
    background: #e9ecef; 
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    margin-bottom: 15px;
}

/* ========== BOTONES ========== */
.btn-tramite {
    background: #ffffff;
    color: var(--texto-oscuro);
    border: 1px solid #d1d1d1;
    padding: 16px 20px;
    font-size: clamp(0.9rem, 2.2vw, 1rem);
    line-height: 1.4;
    font-weight: 500;
    margin-bottom: 10px;
    border-radius: 8px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: var(--shadow-soft);
    display: block;
}

.btn-tramite:hover {
    background: #f8f8f8;
    color: var(--ipn-guinda);
    border-color: var(--ipn-guinda);
    transform: translateX(5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.btn-destacado {
    border-left: 6px solid var(--ipn-guinda) !important;
    font-weight: bold;
}

.btn-carga {
    background: var(--ipn-guinda);
    color: white;
    border: none;
    padding: 16px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    font-size: 1.1em;
    transition: 0.3s;
    box-shadow: 0 4px 6px rgba(125, 33, 51, 0.2);
}

.btn-carga:hover {
    background: var(--ipn-guinda-hover);
    transform: translateY(-2px);
}

/* ========== CAJAS DE INFORMACIÓN ========== */
.info-mails { 
    background: #e7f3ff; 
    border: 1px solid #b3d7ff; 
    color: #004085; 
    padding: 20px;
    border-radius: 8px; 
    margin-top: 15px; 
    font-size: 1rem; 
    text-align: justify;
    line-height: 1.6;
}

/* ========== FOOTER ========== */
.footer-text {
    margin-top: 35px;
    padding-top: 20px;
    border-top: 2px solid #eee;
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    color: var(--texto-suave);
    text-align: center;
}

.footer-text b {
    color: var(--ipn-guinda);
    font-weight: 600;
}

/* ========== FORMULARIOS GENERALES ========== */
.form-container { 
    text-align: left; 
    padding: 10px; 
    position: relative; 
}

.folio-box { 
    position: absolute; 
    top: -45px; 
    right: 0; 
    background: #f4f4f4; 
    border: 1px solid var(--ipn-guinda); 
    padding: 5px 15px; 
    border-radius: 4px; 
    color: #333;
}

.folio-label { 
    font-size: 0.6em; 
    font-weight: bold; 
    color: var(--ipn-guinda); 
    display: block; 
    text-transform: uppercase; 
}

.folio-numero { 
    font-family: 'Courier New', Courier, monospace; 
    font-weight: bold; 
    font-size: 1.1em; 
}

.linea-form { 
    display: grid; 
    grid-template-columns: repeat(12, 1fr); 
    gap: 10px; 
    margin-bottom: 15px; 
}

.section-tag { 
    grid-column: span 12; 
    font-size: 0.75em; 
    font-weight: bold; 
    color: var(--ipn-guinda); 
    border-bottom: 1px solid var(--ipn-guinda); 
    margin: 15px 0 5px 0; 
    padding-bottom: 3px; 
    text-transform: uppercase; 
}

.campo { 
    display: flex; 
    flex-direction: column; 
}

.campo label { 
    font-size: 0.65em; 
    font-weight: bold; 
    color: #555; 
    margin-bottom: 2px; 
    text-transform: uppercase; 
}

.campo input, .campo select, .campo textarea { 
    border: none; 
    border-bottom: 1px solid #888; 
    background: #fdfdfd; 
    padding: 5px; 
    font-size: 0.85em; 
    font-family: inherit; 
}

.area-firma { 
    margin-top: 60px; 
    text-align: center; 
    grid-column: span 12; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

.linea-firma { 
    width: 300px; 
    border-top: 1px solid #000; 
    margin-bottom: 5px; 
}

.caps { text-transform: uppercase; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.alert { 
    padding: 15px; 
    border-radius: 5px; 
    margin-bottom: 20px; 
    text-align: center; 
    font-size: 0.9em; 
}

.success { 
    background: #d4edda; 
    color: #155724; 
    border: 1px solid #c3e6cb; 
}

/* ========== UPLOAD AREA ========== */
.upload-area { 
    border: 2px dashed #ccc; 
    padding: 30px; 
    border-radius: 12px; 
    margin: 25px 0; 
    background: #fcfcfc; 
    transition: 0.3s; 
}

.upload-area:hover { 
    border-color: var(--ipn-guinda); 
    background: #fdf5f6; 
}

/* ============================================ */
/* DASHBOARD - ESTILOS ADMINISTRATIVOS          */
/* ============================================ */

.dashboard-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-gris);
}

.sidebar {
    width: 280px;
    background: var(--ipn-guinda);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 25px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.sidebar-logo {
    height: 60px;
    margin-bottom: 10px;
}

.sidebar-header h3 {
    font-size: 1.1em;
    margin: 0;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav a {
    display: block;
    padding: 12px 25px;
    color: white;
    text-decoration: none;
    transition: 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,0.1);
    border-left: 4px solid var(--ipn-oro);
}

.sidebar-nav .logout-link {
    margin-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 20px;
    color: #ff9999;
}

.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 20px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-soft);
}

.top-bar h1 {
    font-size: 1.5em;
    color: var(--ipn-guinda);
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.role-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
}

.role-badge.superadmin {
    background: #ffc107;
    color: #333;
}

.role-badge.admin {
    background: #28a745;
    color: white;
}

.role-badge.kardista {
    background: #17a2b8;
    color: white;
}

.role-badge.gestion {
    background: #17a2b8;
    color: white;
}

.role-badge.direccion {
    background: #6f42c1;
    color: white;
}

.role-badge.guardia {
    background: #fd7e14;
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-soft);
}

.stat-icon {
    font-size: 2.5em;
}

.stat-info h3 {
    font-size: 0.9em;
    color: var(--texto-suave);
    margin: 0 0 5px 0;
}

.stat-info p {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--ipn-guinda);
    margin: 0;
}

.quick-actions {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.quick-actions h2 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: var(--ipn-guinda);
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--ipn-guinda);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: 0.3s;
}

.action-btn:hover {
    background: var(--ipn-guinda-hover);
    transform: translateY(-2px);
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.form-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.form-section h2 {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: var(--ipn-guinda);
    border-bottom: 2px solid var(--ipn-oro);
    padding-bottom: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.btn-guardar {
    background: var(--ipn-guinda);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    margin-top: 15px;
}

.btn-guardar:hover {
    background: var(--ipn-guinda-hover);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.users-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: var(--ipn-guinda);
}

.users-table tr:hover {
    background: #f8f9fa;
}

.btn-eliminar {
    color: #dc3545;
    text-decoration: none;
    font-size: 1.2em;
    padding: 5px 10px;
    border-radius: 4px;
}

.btn-eliminar:hover {
    background: #dc3545;
    color: white;
}

.disabled {
    color: #ccc;
}

/* ========== LOGIN ESPECÍFICO ========== */
.login-body {
    background: var(--bg-gris);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.login-card {
    max-width: 450px;
    margin: 0 auto;
}

.login-card .header-logos {
    justify-content: center;
    margin-bottom: 20px;
}

.login-card .header-logos img {
    height: 60px;
}

.campo-login {
    text-align: left;
    margin-bottom: 20px;
}

.campo-login label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--ipn-guinda);
}

.campo-login input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

.campo-login input:focus {
    outline: none;
    border-color: var(--ipn-guinda);
    box-shadow: 0 0 0 3px rgba(125, 33, 51, 0.1);
}

.btn-login {
    background: var(--ipn-guinda);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: 0.3s;
}

.btn-login:hover {
    background: var(--ipn-guinda-hover);
    transform: translateY(-2px);
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    border-top: 8px solid var(--ipn-guinda);
    position: relative;
}

.modal-content h3 {
    color: var(--ipn-guinda);
    margin-bottom: 20px;
    font-size: 1.3em;
}

.modal-content .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-content .close:hover {
    color: var(--ipn-guinda);
}

.modal-content .campo {
    margin-bottom: 15px;
}

.modal-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.modal-content input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9em;
}

.modal-content .btn-guardar {
    width: 100%;
    margin-top: 10px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    .sidebar-header h3,
    .sidebar-nav a span {
        display: none;
    }
    .main-content {
        margin-left: 70px;
    }
    .sidebar-nav a {
        text-align: center;
        padding: 15px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .users-table {
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .card { 
        padding: 20px 15px; 
    }
    .header-logos { 
        margin-bottom: 15px; 
    }
    .header-logos img { 
        height: 45px; 
    }
    .header-logos img.logo-ipn { 
        height: 60px; 
    }
}

/* ========== IMPRESIÓN ========== */
@media print {
    .btn-tramite, .btn-carga, .alert, .acordeon-header {
        display: none !important;
    }
    .card { 
        box-shadow: none; 
        border: none; 
        width: 100%; 
        max-width: 100%; 
        margin: 0; 
        padding: 0; 
    }
    body { 
        background: white; 
    }
    input, select, textarea { 
        border-bottom: 1px solid #000 !important; 
        background: transparent !important; 
    }
    .folio-box { 
        border: 1px solid #000 !important; 
        top: 0; 
    }
    .section-tag { 
        color: black !important; 
        border-bottom: 1px solid black !important; 
    }
    @page { 
        margin: 1.5cm; 
    }
}

/* ============================================ */
/* FORZAR SUB SECCIONES E ITEMS A LA IZQUIERDA */
/* ============================================ */

/* Fuerza los headers secundarios a alinear el texto a la izquierda */
.header-secundario {
    text-align: left !important;
    justify-content: flex-start !important;
    gap: 10px;
}

/* El contenido interno de subsecciones e items también a la izquierda */
.content-interno {
    text-align: left !important;
}

/* Scroll dinámico para el sidebar */
.sidebar-nav {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: calc(100vh - 150px);
}

/* Personalizar scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: #3a0a1c;
    border-radius: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #F5B041;
    border-radius: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #e0a800;
}