/*
 * style.css — Hoja de estilos unificada
 * Sistema de Validación de Constancias Escolares
 * ================================================
 * ÍNDICE:
 *  1.  Variables & Colores        → tokens de color, sombra, radio y transición
 *  2.  Reset & Base               → box-sizing, body, tipografía, enlaces
 *  3.  Layout & Contenedor        → .container, ancho máximo, padding general
 *  4.  Navbar principal           → barra superior #611232, logo, nav-links, ícono lupa
 *  5.  Navbar secundaria          → barra inferior #390b1f, menú centrado, hamburger móvil
 *  6.  Hero                       → portada de index.php, gradiente, título y subtítulo
 *  7.  Búsqueda                   → tarjeta buscador, tabs, inputs, botón dorado
 *  8.  Tarjetas informativas      → cards-grid con imágenes (index.php, sección inferior)
 *  9.  Alertas                    → .alert-success / .alert-danger / .alert-warning
 * 10.  Tabla de resultados        → resultado.php: encabezado, tabla, badge de cédula
 * 11.  Botones globales           → .btn, variantes (primary, gold, danger, outline…)
 * 12.  Footer                     → pie de página público e ícono de redes
 * 13.  Admin — Login              → página de acceso administrativo
 * 14.  Admin — Layout             → topbar, sidebar, wrapper, nav-link activo
 * 15.  Admin — Paneles internos   → stats cards, admin-card, formularios (.fg), tabla
 * 16.  Verificación QR            → verificar.php: tarjeta verde/roja, filas de datos
 * 17.  Documentos imprimibles     → generar_constancia.php y generar_cedula.php
 * 18.  Página de instalación      → instalar.php: wizard de configuración
 * 19.  Responsive                 → breakpoints 900 px y 640 px
 */


/* =============================================
   1. VARIABLES & COLORES
   — Edita aquí para cambiar el esquema global
   ============================================= */
:root {
    /* Institucional */
    --primary:       #1a3a5c;   /* azul oscuro — textos, sidebar admin */
    --primary-dark:  #611232;   /* guinda — login header, gradientes admin */
    --primary-lt:    #2d5f8a;   /* azul medio — hover botones primarios */
    --gold:          #c8a200;   /* dorado — tab activo, badge, botón buscar */
    --gold-lt:       #e5b800;   /* dorado claro — hover del botón buscar */
    /* Estado */
    --success:       #2e7d32;
    --success-bg:    #e8f5e9;
    --danger:        #c62828;
    --danger-bg:     #ffebee;
    --warning-bg:    #fef3c7;
    /* Grises */
    --white:         #ffffff;
    --gray-50:       #fafafa;
    --gray-100:      #f5f5f5;
    --gray-200:      #eeeeee;
    --gray-300:      #e0e0e0;
    --gray-400:      #bdbdbd;
    --gray-600:      #757575;
    --gray-800:      #424242;
    /* Utilidades */
    --shadow:        0 2px 8px rgba(0,0,0,.10);
    --shadow-md:     0 4px 16px rgba(0,0,0,.15);
    --radius:        8px;
    --radius-sm:     6px;
    --tr:            .2s ease;
}


/* =============================================
   2. RESET & BASE
   — Normalize, body, fuentes, enlaces
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
    font-family: 'Open Sans', 'Segoe UI', sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* Páginas públicas (index, resultado, verificar) */
body.page-public {
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 { font-family: 'Montserrat', sans-serif; line-height: 1.3; }
a { text-decoration: none; color: inherit; }


/* =============================================
   3. LAYOUT & CONTENEDOR
   — Ancho máximo y padding horizontal general
   ============================================= */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}


/* =============================================
   4. NAVBAR PRINCIPAL
   — Barra superior: logo SVG, links y lupa
   — Fondo: #611232 (guinda institucional)
   ============================================= */
.navbar {
    background: #611232;
    color: var(--white);
    padding: 0 1rem;
    box-shadow: 0 2px 10px rgba(97,18,50,.35);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    color: var(--white);
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: rgba(255,255,255,.85); font-size: .9rem; transition: color var(--tr); }
.nav-links a:hover { color: var(--white); }

/* Ícono lupa (favicon.svg) */
.nav-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    transition: background var(--tr);
    flex-shrink: 0;
}
.nav-icon-btn:hover { background: rgba(255,255,255,.25); }

.nav-lupa {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
    filter: brightness(0) invert(1);
    opacity: .9;
}


/* =============================================
   5. NAVBAR SECUNDARIA
   — Segunda fila: menú de secciones centrado
   — Fondo: #390b1f | Hamburger para móvil
   ============================================= */
.secondary-nav {
    background: #390b1f;
    border-top: 1px solid rgba(255,255,255,.08);
    position: sticky;
    top: 64px;
    z-index: 99;
}

.secondary-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.main-nav a {
    color: rgba(255,255,255,.82);
    font-size: .82rem;
    font-weight: 500;
    padding: 10px 14px;
    white-space: nowrap;
    transition: background .18s, color .18s;
    border-right: 1px solid rgba(255,255,255,.1);
    letter-spacing: .01em;
}
.main-nav a:first-child { border-left: 1px solid rgba(255,255,255,.1); }
.main-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Botón hamburger (visible solo en móvil) */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
}
.hamburger-menu span {
    display: block;
    width: 24px;
    height: 2px;
    background: rgba(255,255,255,.85);
    border-radius: 2px;
    transition: all .25s;
}
.hamburger-menu.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-menu.open span:nth-child(2) { opacity: 0; }
.hamburger-menu.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Panel desplegable móvil */
.mobile-nav-panel {
    display: none;
    flex-direction: column;
    background: #390b1f;
    padding: 8px 0 12px;
    border-top: 1px solid rgba(255,255,255,.1);
}
.mobile-nav-panel.open { display: flex; }
.mobile-nav-panel a {
    color: rgba(255,255,255,.85);
    font-size: .9rem;
    padding: 10px 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    transition: background .15s;
}
.mobile-nav-panel a:hover { background: rgba(255,255,255,.1); color: #fff; }


/* =============================================
   6. HERO
   — Portada de index.php: logo, título, subtítulo
   — Gradiente guinda; se solapa 40 px con la sección búsqueda
   ============================================= */
.hero {
    /* El gradiente guinda se usa como fallback si no hay imagen */
    min-height: 320px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px 70px;
}

.hero-inner    { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.hero-title    { font-size: 2.2rem; font-weight: 700; color: #fff; margin-bottom: 16px; }
.hero-subtitle { font-size: 1.05rem; color: rgba(255,255,255,.88); }


/* =============================================
   7a. SECCIÓN INTRODUCTORIA
   — Aparece entre el hero y el buscador en index.php
   — Breadcrumb, título, descripción, aviso legal y CTA
   ============================================= */
.intro-section {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 28px 0 24px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    color: var(--gray-600);
    margin-bottom: 16px;
}
.breadcrumb-sep    { color: var(--gray-400); font-size: .9rem; }
.breadcrumb-active { color: var(--primary-dark); font-weight: 600; }

.intro-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.intro-text {
    font-size: .93rem;
    color: var(--gray-800);
    line-height: 1.7;
    margin-bottom: 14px;
    max-width: 860px;
}

.intro-disclaimer {
    font-size: .8rem;
    color: var(--gray-600);
    line-height: 1.65;
    background: var(--gray-50);
    border-left: 3px solid var(--gray-300);
    padding: 10px 14px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    max-width: 860px;
    margin-bottom: 18px;
}

.intro-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, #8b1a46 100%);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: .9rem;
    padding: 10px 22px;
    border-radius: 50px;
    letter-spacing: .02em;
}

.intro-free {
    margin-top: 14px;
    font-size: .88rem;
    color: var(--success);
    background: var(--success-bg);
    border: 1px solid #a5d6a7;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    display: inline-block;
    max-width: 860px;
}


/* =============================================
   7. SECCIÓN DE BÚSQUEDA
   — Tarjeta buscador, pestañas, inputs y botón dorado
   — Usado en index.php
   ============================================= */
.search-section { background: var(--white); margin-top: 0; padding: 48px 0 60px; }

.search-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 40px;
}

/* Pestañas */
.tabs {
    display: flex;
    border-bottom: 1px solid #cecece;
}

.tab-btn {
    flex: 0 0 auto;
    padding: 14px 32px;
    border: none;
    border-bottom: none;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: .88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background var(--tr), color var(--tr);
    /* Inactiva */
    background: #e8e8e8;
    color: #555;
}

.tab-btn:hover:not(.active) {
    background: #d8d8d8;
    color: #333;
}

.tab-btn.active {
    background: #6B1A35;
    color: #fff;
}

.tab-content        { display: none; padding: 28px 36px 36px; }
.tab-content.active { display: block; }

/* Inputs del formulario de búsqueda */
.form-grid       { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.form-grid-4     { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.form-group-full { grid-column: 1 / -1; }
.form-group      { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: .8rem;
    color: var(--gray-800);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--gray-800);
    transition: border-color var(--tr), box-shadow var(--tr);
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,58,92,.1);
}
.form-group small { font-size: .77rem; color: var(--gray-400); }
.required { color: var(--danger); }
.form-actions { text-align: center; }

/* Botón principal de búsqueda */
.btn-search {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-lt) 100%);
    color: var(--primary-dark);
    border: none;
    padding: 14px 48px;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform var(--tr), box-shadow var(--tr);
    box-shadow: 0 4px 15px rgba(200,162,0,.4);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.btn-search:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(200,162,0,.5); }

/* Fila de botones del buscador */
.search-btn-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 8px;
}

/* Tamaño base compartido por los tres botones */
.btn-search,
.btn-limpiar,
.btn-csv {
    height: 42px;
    padding: 0 28px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: .88rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--tr), color var(--tr);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Buscar — contorno guinda */
.btn-search {
    background: #fff;
    color: #6B1A35;
    border: 2px solid #6B1A35;
    box-shadow: none;
    border-radius: var(--radius-sm);
    text-transform: none;
    letter-spacing: 0;
}
.btn-search:hover {
    background: #6B1A35;
    color: #fff;
    transform: none;
    box-shadow: none;
}

/* Limpiar — contorno dorado */
.btn-limpiar {
    background: #fff;
    color: #B8972E;
    border: 2px solid #B8972E;
}
.btn-limpiar:hover {
    background: #B8972E;
    color: #fff;
}

/* Descargar CSV — deshabilitado */
.btn-csv {
    background: #d5d5d5;
    color: #999;
    border: 1px solid #ccc;
    cursor: not-allowed;
    pointer-events: none;
    opacity: .85;
}

/* Descargar CSV — activo (hay resultado) */
.btn-csv-on {
    background: #fff;
    color: #1a3a5c;
    border: 2px solid #1a3a5c;
    cursor: pointer;
    pointer-events: auto;
    opacity: 1;
}
.btn-csv-on:hover { background: #1a3a5c; color: #fff; }

/* ── Tabla de resultados inline (index.php) ── */
.results-inline {
    margin-top: 24px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid #e0e0e0;
}

.results-inline-header {
    background: #6B1A35;
    color: #fff;
    padding: 12px 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: .9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.results-clear {
    color: rgba(255,255,255,.75);
    font-size: .8rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--tr);
}
.results-clear:hover { color: #fff; }

.result-download-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    white-space: nowrap;
}

.btn-dl {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: .75rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--tr);
    white-space: nowrap;
}

.btn-dl-constancia {
    background: #fff;
    color: #6B1A35;
    border: 1.5px solid #6B1A35;
}
.btn-dl-constancia:hover { background: #6B1A35; color: #fff; }

.btn-dl-cedula {
    background: #fff;
    color: #B8972E;
    border: 1.5px solid #B8972E;
}
.btn-dl-cedula:hover { background: #B8972E; color: #fff; }


/* =============================================
   8. TARJETAS INFORMATIVAS
   — Grid de 3 tarjetas con imagen en index.php
   — También usado en páginas genéricas (.cards-2)
   ============================================= */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.cards-2    { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); max-width: 700px; margin-left: auto; margin-right: auto; }
.cards-3    { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all .25s;
    border: 2px solid transparent;
    color: var(--gray-800);
}
.card:hover     { box-shadow: var(--shadow-md); border-color: var(--primary); transform: translateY(-3px); }
.card h3        { margin-bottom: .5rem; color: var(--primary); }
.card p         { font-size: .9rem; color: var(--gray-600); }

/* Imagen dentro de la tarjeta */
.card-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    display: block;
    margin: 0 auto 1.1rem;
}


/* =============================================
   9. ALERTAS
   — Mensajes de éxito, error y advertencia
   ============================================= */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: .9rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alert-success { background: var(--success-bg); border-left: 4px solid var(--success); color: var(--success); }
.alert-danger  { background: var(--danger-bg);  border-left: 4px solid var(--danger);  color: var(--danger); }
.alert-warning { background: var(--warning-bg); border-left: 4px solid #b7791f;        color: #7c5315; }


/* =============================================
  10. TABLA DE RESULTADOS
   — resultado.php: encabezado guinda, tabla de datos
   — Incluye badge de cédula y botones de acción PDF
   ============================================= */
.results-section { padding: 40px 0 60px; }

.results-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-md); overflow: hidden; }

.results-header {
    background: linear-gradient(135deg, #611232 0%, #8b1a46 100%);
    color: #fff;
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.results-header h2   { font-size: 1.2rem; font-weight: 700; }
.results-badge {
    background: var(--gold);
    color: var(--primary-dark);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.table-wrapper { overflow-x: auto; }
table          { width: 100%; border-collapse: collapse; }
thead th {
    background: var(--gray-50);
    padding: 13px 16px;
    text-align: left;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: .77rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--gray-200); font-size: .88rem; color: var(--gray-800); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover         { background: var(--gray-50); }

.cedula-badge {
    background: var(--primary);
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: .83rem;
    font-family: monospace;
}

/* Botones de descarga al pie de la tarjeta */
.doc-actions       { padding: 24px 32px; display: flex; gap: 14px; flex-wrap: wrap; border-top: 2px solid var(--gray-200); align-items: center; }
.doc-actions-label { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: .8rem; color: var(--gray-600); text-transform: uppercase; letter-spacing: .05em; flex-shrink: 0; }

/* Tabla de datos del panel admin */
.data-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th, .data-table td { padding: .75rem 1rem; text-align: left; font-size: .9rem; }
.data-table th  { background: var(--primary); color: var(--white); font-weight: 600; }
.data-table tr:nth-child(even) { background: var(--gray-50); }
.data-table tr:hover           { background: var(--gray-200); }
.data-table code { background: var(--gray-200); padding: .15rem .4rem; border-radius: 4px; font-size: .85rem; }
.actions { white-space: nowrap; display: flex; gap: .5rem; }
.badge { padding: .2rem .6rem; border-radius: 12px; font-size: .8rem; font-weight: 600; }
.badge-activo   { background: var(--success-bg); color: var(--success); }
.badge-inactivo { background: var(--danger-bg);  color: var(--danger); }
.empty-state { text-align: center; padding: 3rem; color: var(--gray-600); font-size: 1.1rem; }


/* =============================================
  11. BOTONES GLOBALES
   — Base .btn + variantes de color y tamaño
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: .85rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--tr);
    white-space: nowrap;
}
.btn-primary   { background: var(--primary);    color: #fff; }
.btn-primary:hover   { background: var(--primary-lt); }
.btn-gold      { background: var(--gold);       color: var(--primary-dark); }
.btn-gold:hover      { background: var(--gold-lt); }
.btn-success   { background: var(--success);    color: #fff; }
.btn-danger    { background: var(--danger);     color: #fff; }
.btn-outline   { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover   { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--gray-200);   color: var(--gray-800); }
.btn-secondary:hover { background: var(--gray-400); color: #fff; }
.btn-sm  { padding: 6px 14px;  font-size: .78rem; }
.btn-lg  { padding: 14px 32px; font-size: .95rem; }
.btn-full { width: 100%; justify-content: center; }


/* =============================================
  12. FOOTER
   — Pie de página del portal público
   — Incluye logo y enlaces de redes sociales
   ============================================= */
.footer {
    background: #390b1f;
    color: rgba(255,255,255,.7);
    padding: 1rem;
    margin-top: auto;
    font-size: .85rem;
}


/* =============================================
  13. ADMIN — PÁGINA DE LOGIN
   — admin/index.php: pantalla de acceso
   ============================================= */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-lt) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card   { background: var(--white); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 100%; max-width: 420px; overflow: hidden; }
.login-header { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%); padding: 36px 32px; text-align: center; color: #fff; }
.login-logo   { width: 70px; height: 70px; background: var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; margin: 0 auto 16px; }
.login-header h1 { font-size: 1.25rem; font-weight: 700; margin-bottom: 6px; }
.login-header p  { font-size: .83rem; opacity: .8; }
.login-body  { padding: 32px; }
.login-body .form-group      { margin-bottom: 18px; }
.login-body label            { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: .8rem; color: var(--gray-800); text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 6px; }
.login-body input            { width: 100%; padding: 12px 16px; border: 2px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 1rem; transition: border-color var(--tr), box-shadow var(--tr); }
.login-body input:focus      { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,110,.1); }
.btn-login { width: 100%; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-lt) 100%); color: #fff; border: none; padding: 14px; border-radius: var(--radius-sm); font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1rem; cursor: pointer; transition: opacity var(--tr); }
.btn-login:hover { opacity: .9; }


/* =============================================
  14. ADMIN — LAYOUT
   — Topbar, sidebar y área de contenido
   — admin/dashboard.php, alumnos.php, etc.
   ============================================= */
.admin-body    { background: var(--gray-100); min-height: 100vh; display: flex; flex-direction: column; }

.admin-topbar  { background: var(--white); border-bottom: 1px solid var(--gray-200); padding: 0 32px; display: flex; align-items: center; justify-content: space-between; height: 64px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.topbar-left   { display: flex; align-items: center; gap: 16px; }
.topbar-brand  { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.topbar-brand .logo-circle { width: 38px; height: 38px; font-size: 18px; }
.topbar-title  { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1rem; color: var(--primary); }
.topbar-right  { display: flex; align-items: center; gap: 14px; font-size: .88rem; color: var(--gray-600); }
.topbar-right a { color: var(--danger); text-decoration: none; font-size: .82rem; padding: 6px 14px; border: 1px solid var(--danger); border-radius: 4px; transition: all var(--tr); }
.topbar-right a:hover { background: var(--danger); color: #fff; }

.admin-wrapper { display: flex; min-height: calc(100vh - 64px); }
.admin-sidebar { width: 240px; background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%); color: #fff; flex-shrink: 0; }
.sidebar-nav        { padding: 16px 0; }
.nav-section-label  { padding: 14px 20px 6px; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.4); }
.nav-link           { display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: rgba(255,255,255,.8); text-decoration: none; font-size: .88rem; font-weight: 500; transition: all var(--tr); border-left: 3px solid transparent; }
.nav-link:hover     { background: rgba(255,255,255,.1); color: #fff; padding-left: 26px; }
.nav-link.active    { background: rgba(255,255,255,.15); color: #fff; border-left-color: var(--gold); }
.nav-icon           { font-size: 1.05rem; width: 22px; text-align: center; }

.admin-main    { flex: 1; display: flex; flex-direction: column; }
.admin-content { flex: 1; padding: 28px 32px; }
.page-title    { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.page-subtitle { font-size: .88rem; color: var(--gray-600); margin-bottom: 28px; }

/* Logo círculo (topbar admin) */
.logo-circle { width: 50px; height: 50px; background: var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }


/* =============================================
  15. ADMIN — PANELES INTERNOS
   — Stats, tarjetas de contenido y formularios
   ============================================= */
/* Tarjetas de estadísticas */
.stats-grid  { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card   { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px; }
.stat-icon   { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.stat-icon-blue  { background: rgba(26,58,92,.10); }
.stat-icon-gold  { background: rgba(200,162,0,.12); }
.stat-icon-green { background: rgba(46,125,50,.10); }
.stat-info h3    { font-size: 1.9rem; font-weight: 700; color: var(--primary); line-height: 1; margin-bottom: 4px; }
.stat-info p     { font-size: .82rem; color: var(--gray-600); font-weight: 500; }

/* Tarjeta genérica de contenido */
.admin-card         { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px; }
.admin-card-header  { padding: 18px 24px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-card-header h2 { font-size: 1rem; font-weight: 700; color: var(--primary); }
.admin-card-body    { padding: 24px; }

/* Formularios de agregar / editar alumno */
.form-grid-admin    { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.fg                 { display: flex; flex-direction: column; gap: 5px; }
.fg.full            { grid-column: 1 / -1; }
.fg label           { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: .77rem; color: var(--gray-800); text-transform: uppercase; letter-spacing: .04em; }
.fg input, .fg select, .fg textarea { width: 100%; padding: 9px 13px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); font-size: .9rem; color: var(--gray-800); transition: border-color var(--tr), box-shadow var(--tr); }
.fg input:focus, .fg select:focus, .fg textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,58,92,.1); }
.fg small { font-size: .73rem; color: var(--gray-400); }

/* Filtro de tabla */
.list-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }


/* =============================================
  16. VERIFICACIÓN QR
   — verificar.php: tarjeta verde (válido) o roja (inválido)
   ============================================= */
.verify-page    { background: var(--gray-100); display: flex; align-items: flex-start; justify-content: center; padding: 40px 24px; }
.verify-card    { width: 100%; max-width: 680px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-md); overflow: hidden; }
.verify-valid   { background: linear-gradient(135deg, #1a7a4a 0%, #276749 100%); padding: 32px; text-align: center; color: #fff; }
.verify-invalid { background: linear-gradient(135deg, var(--danger) 0%, #a01b1b 100%); padding: 32px; text-align: center; color: #fff; }
.verify-icon    { font-size: 3.5rem; display: block; margin-bottom: 10px; }
.verify-body    { padding: 32px; }
.verify-row     { display: flex; padding: 10px 0; border-bottom: 1px solid var(--gray-200); }
.verify-row:last-child { border-bottom: none; }
.verify-label   { font-weight: 600; font-size: .82rem; color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; min-width: 170px; flex-shrink: 0; }
.verify-value   { font-size: .9rem; color: var(--gray-800); }


/* =============================================
  17. DOCUMENTOS IMPRIMIBLES
   — generar_constancia.php y generar_cedula.php
   — Tamaño carta, estilos formales, código QR
   ============================================= */
.document-container { background: #f0f0f0; min-height: 100vh; padding: 30px; }
.print-actions      { position: fixed; top: 20px; right: 20px; display: flex; gap: 10px; z-index: 1000; }

.doc-page {
    width: 215.9mm;
    min-height: 279.4mm;
    margin: 0 auto;
    background: #fff;
    padding: 20mm 22mm;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    position: relative;
    font-family: 'Times New Roman', Times, serif;
    color: #111;
}
.doc-page * { box-sizing: border-box; }

.doc-header           { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 3px solid #1e3a6e; }
.doc-escudo           { font-size: 52px; line-height: 1; }
.doc-header-center    { text-align: center; flex: 1; padding: 0 16px; }
.doc-institution-name { font-size: 11pt; font-weight: bold; color: #1e3a6e; text-transform: uppercase; letter-spacing: 1px; line-height: 1.3; }
.doc-subtitle         { font-size: 8pt; color: #555; margin-top: 4px; letter-spacing: .5px; }

.doc-title-block { text-align: center; margin: 20px 0; }
.doc-title       { display: inline-block; font-size: 17pt; font-weight: bold; color: #1e3a6e; text-transform: uppercase; letter-spacing: 1.5px; border: 2.5px solid #c8a200; padding: 8px 24px; }

.doc-body      { margin-top: 20px; }
.doc-text      { font-size: 10.5pt; line-height: 1.9; text-align: justify; margin-bottom: 14px; }
.doc-highlight { font-weight: bold; text-transform: uppercase; }

.doc-info-table                { width: 100%; border-collapse: collapse; margin: 16px 0; }
.doc-info-table td             { padding: 7px 10px; border: 1px solid #ccc; font-size: 10pt; }
.doc-info-table td:first-child { font-weight: bold; background: #f5f5f5; color: #333; width: 200px; white-space: nowrap; }

.verification-box    { background: #f8f8f8; border: 1px solid #ddd; border-radius: 4px; padding: 10px 12px; margin: 16px 0; }
.verification-label  { font-size: 8pt; font-weight: bold; color: #666; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }
.verification-string { font-family: Courier, 'Courier New', monospace; font-size: 7.5pt; color: #444; word-break: break-all; line-height: 1.5; }

.doc-bottom       { display: flex; align-items: flex-start; justify-content: space-between; margin-top: 30px; gap: 20px; }
.qr-block         { text-align: center; flex-shrink: 0; }
.qr-block img     { width: 110px; height: 110px; display: block; margin: 0 auto; }
.qr-block p       { font-size: 7pt; color: #666; margin-top: 5px; max-width: 120px; }
.signatures-block { flex: 1; display: flex; justify-content: space-around; align-items: flex-end; padding-bottom: 10px; }
.sig-box          { text-align: center; width: 160px; }
.sig-line         { border-top: 1px solid #333; padding-top: 6px; font-size: 8.5pt; color: #333; line-height: 1.4; }

.doc-footer-note  { font-size: 7.5pt; color: #888; text-align: center; margin-top: 24px; padding-top: 10px; border-top: 1px solid #ddd; }
.doc-folio-stamp  { position: absolute; top: 20mm; right: 22mm; text-align: right; }
.doc-folio-stamp span   { display: block; font-size: 8pt; color: #666; }
.doc-folio-stamp strong { font-size: 10pt; color: #1e3a6e; }

/* Cédula profesional */
.cedula-header-stripe     { background: #1e3a6e; color: #fff; padding: 8px 14px; display: flex; justify-content: space-between; align-items: center; }
.cedula-header-stripe .num  { font-size: 9pt; opacity: .8; }
.cedula-header-stripe .tipo { font-size: 11pt; font-weight: bold; letter-spacing: 1px; text-transform: uppercase; }
.cedula-fields-grid       { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid #bbb; margin: 18px 0; }
.cedula-field             { padding: 9px 12px; border: 1px solid #ccc; font-size: 9.5pt; }
.cedula-field.full        { grid-column: 1 / -1; }
.cedula-field .label      { font-size: 7.5pt; font-weight: bold; color: #666; text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 2px; }
.cedula-field .value      { font-size: 11pt; font-weight: bold; color: #111; letter-spacing: .5px; }

@media print {
    .print-actions, .no-print { display: none !important; }
    .document-container { background: white; padding: 0; }
    .doc-page           { box-shadow: none; margin: 0; padding: 15mm 20mm; }
    body                { background: white; }
}


/* =============================================
  18. PÁGINA DE INSTALACIÓN
   — instalar.php: wizard de pasos de configuración
   ============================================= */
.install-page   { min-height: 100vh; background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-lt) 100%); display: flex; align-items: center; justify-content: center; padding: 24px; }
.install-card   { background: var(--white); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 100%; max-width: 560px; overflow: hidden; }
.install-header { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%); padding: 32px; text-align: center; color: #fff; }
.install-body   { padding: 32px; }
.step           { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--gray-200); }
.step:last-child { border-bottom: none; }
.step-icon      { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.step-info h3   { font-size: .9rem; font-weight: 700; margin-bottom: 2px; }
.step-info p    { font-size: .82rem; color: var(--gray-600); }
.step-ok  .step-info h3 { color: var(--success); }
.step-err .step-info h3 { color: var(--danger); }


/* =============================================
  19. RESPONSIVE
   — 900 px: oculta sidebar admin, info-grid a 2 col
   — 640 px: una columna en formularios y tarjetas
   ============================================= */
@media (max-width: 900px) {
    .info-grid     { grid-template-columns: 1fr 1fr; }
    .admin-sidebar { display: none; }
}

@media (max-width: 768px) {
    .nav-container  { flex-direction: column; height: auto; padding: .75rem 0; gap: .5rem; }
    .nav-links      { gap: 1rem; }
    .main-nav       { display: none; }
    .hamburger-menu { display: flex; }
}

@media (max-width: 640px) {
    .form-grid        { grid-template-columns: 1fr; }
    .form-grid-4      { grid-template-columns: 1fr 1fr; }
    .info-grid        { grid-template-columns: 1fr; }
    .cards-grid       { grid-template-columns: 1fr; }
    .hero-title       { font-size: 1.6rem; }
    .tabs             { flex-direction: column; }
    .tab-content      { padding: 20px; }
    .admin-content    { padding: 16px; }
    .doc-page         { padding: 10mm 12mm; }
    .form-grid-admin  { grid-template-columns: 1fr; }
    .cedula-fields-grid { grid-template-columns: 1fr; }
    .verify-row       { flex-direction: column; }
    .verify-label     { min-width: unset; margin-bottom: .15rem; }
}
