/* CECyTE Nayarit - Sistema Oficial de Constancias Digitales
   Estilo visual alineado con Intranet y Portal Institucional (Inter / Emerald & Wine) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-page: #F0F4F8;
    --primary-color: #059669; /* Emerald Green CECyTE */
    --primary-hover: #047857;
    --brand-wine: #6B1D2F;    /* Institutional Wine Nayarit */
    --brand-wine-dark: #4A1320;
    --gold-accent: #B38E5D;
    --text-dark: #1E293B;
    --text-muted: #64748B;
    --card-bg: #FFFFFF;
    --border-color: #E2E8F0;
    --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.02);
}

body {
    background-color: var(--bg-page);
    color: var(--text-dark);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.main-content {
    flex: 1;
}

/* Institutional Header Banner */
.header-banner-container {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    padding: 1rem 0;
    text-align: center;
}

.header-banner-img {
    max-height: 65px;
    object-fit: contain;
}

/* Sub-nav bar */
.navbar-official {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.15);
    border-bottom: 3px solid var(--primary-color);
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #FFFFFF !important;
    letter-spacing: 0.5px;
}

.brand-subtitle {
    font-size: 0.72rem;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Cards & Containers (Style from test) */
.card-official {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    background: #FFFFFF;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-official:hover {
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.08);
}

.card-header-official {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    padding: 1.1rem 1.4rem;
    border-radius: 8px 8px 0 0 !important;
}

.card-title-official {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1.1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Steps Progress Badge */
.step-badge {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background-color: var(--primary-color);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    margin-right: 6px;
}

/* Dropzone styling */
.dropzone-container {
    border: 2px dashed #CBD5E1;
    border-radius: 8px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: #F8FAFC;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropzone-container:hover, .dropzone-container.dragover {
    border-color: var(--primary-color);
    background: #F0FDF4;
}

.dropzone-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

/* Custom Buttons - Todos con Color Sólido Cohesivo */
.btn {
    font-weight: 600;
    border-radius: 6px;
    border-width: 1px;
    border-style: solid;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn:active, .btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(5, 150, 105, 0.25);
}

.btn-primary-official {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: 0.55rem 1.3rem;
    border-radius: 6px;
}

.btn-primary-official:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.btn-wine {
    background-color: var(--brand-wine) !important;
    border-color: var(--brand-wine) !important;
    color: #ffffff !important;
    font-weight: 600;
    border-radius: 6px;
}

.btn-wine:hover {
    background-color: var(--brand-wine-dark) !important;
    border-color: var(--brand-wine-dark) !important;
    color: #ffffff !important;
}

/* Colores Sólidos Estándar */
.btn-success {
    background-color: #059669 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
}

.btn-success:hover {
    background-color: #047857 !important;
    border-color: #047857 !important;
    color: #ffffff !important;
}

.btn-secondary {
    background-color: #64748B !important;
    border-color: #64748B !important;
    color: #ffffff !important;
}

.btn-secondary:hover {
    background-color: #475569 !important;
    border-color: #475569 !important;
    color: #ffffff !important;
}

.btn-danger {
    background-color: #DC2626 !important;
    border-color: #DC2626 !important;
    color: #ffffff !important;
}

.btn-danger:hover {
    background-color: #B91C1C !important;
    border-color: #B91C1C !important;
    color: #ffffff !important;
}

.btn-warning {
    background-color: #EAB308 !important;
    border-color: #EAB308 !important;
    color: #1E293B !important;
    font-weight: 700 !important;
}

.btn-warning:hover {
    background-color: #CA8A04 !important;
    border-color: #CA8A04 !important;
    color: #0F172A !important;
}

.btn-dark {
    background-color: #1E293B !important;
    border-color: #1E293B !important;
    color: #ffffff !important;
}

.btn-dark:hover {
    background-color: #0F172A !important;
    border-color: #0F172A !important;
    color: #ffffff !important;
}

.btn-light {
    background-color: #FFFFFF !important;
    border-color: #CBD5E1 !important;
    color: #1E293B !important;
    font-weight: 600 !important;
}

.btn-light:hover {
    background-color: #F8FAFC !important;
    border-color: #94A3B8 !important;
    color: #0F172A !important;
}

/* Reglas de contingencia para transformar cualquier clase outline a sólido */
.btn-outline-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
}
.btn-outline-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: #ffffff !important;
}

.btn-outline-secondary {
    background-color: #64748B !important;
    border-color: #64748B !important;
    color: #ffffff !important;
}
.btn-outline-secondary:hover {
    background-color: #475569 !important;
    border-color: #475569 !important;
    color: #ffffff !important;
}

.btn-outline-success {
    background-color: #059669 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
}
.btn-outline-success:hover {
    background-color: #047857 !important;
    border-color: #047857 !important;
    color: #ffffff !important;
}

.btn-outline-danger {
    background-color: #DC2626 !important;
    border-color: #DC2626 !important;
    color: #ffffff !important;
}
.btn-outline-danger:hover {
    background-color: #B91C1C !important;
    border-color: #B91C1C !important;
    color: #ffffff !important;
}

.btn-outline-warning {
    background-color: #EAB308 !important;
    border-color: #EAB308 !important;
    color: #1E293B !important;
}
.btn-outline-warning:hover {
    background-color: #CA8A04 !important;
    border-color: #CA8A04 !important;
    color: #0F172A !important;
}

.btn-outline-dark {
    background-color: #1E293B !important;
    border-color: #1E293B !important;
    color: #ffffff !important;
}
.btn-outline-dark:hover {
    background-color: #0F172A !important;
    border-color: #0F172A !important;
    color: #ffffff !important;
}

.btn-outline-light {
    background-color: #FFFFFF !important;
    border-color: #CBD5E1 !important;
    color: #1E293B !important;
}
.btn-outline-light:hover {
    background-color: #F8FAFC !important;
    border-color: #94A3B8 !important;
    color: #0F172A !important;
}

/* Botones de acción en tablas: Solo iconos, sin color de fondo ni bordes */
.btn-table-action {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-width: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0.2rem 0.35rem !important;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none !important;
    line-height: 1;
    border-radius: 4px;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-table-action:hover {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transform: scale(1.22);
    opacity: 0.8;
}

.btn-table-action:focus,
.btn-table-action:active {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Asegurar que cualquier enlace o botón dentro de .table td.text-end sea limpio */
.table td.text-end .btn-table-action i {
    vertical-align: middle;
}

/* Cabecera Verde Institucional para Tablas */
.table-official-green th {
    background-color: var(--primary-color) !important;
    color: #FFFFFF !important;
    font-weight: 700 !important;
    font-size: 0.88rem;
    padding-top: 0.85rem !important;
    padding-bottom: 0.85rem !important;
    border-bottom: none !important;
    vertical-align: middle;
    letter-spacing: 0.3px;
}

/* Navigation Pills */
.nav-pills .nav-link {
    color: var(--text-muted);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.nav-pills .nav-link.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.2);
}

/* Status Badges */
.badge-vigente {
    background-color: #DCFCE7;
    color: #15803D;
    font-weight: 600;
    padding: 0.35em 0.75em;
    border-radius: 4px;
    border: 1px solid #BBF7D0;
}

.badge-revocada {
    background-color: #FEE2E2;
    color: #B91C1C;
    font-weight: 600;
    padding: 0.35em 0.75em;
    border-radius: 4px;
    border: 1px solid #FECACA;
}

/* Verification Shield Styles */
.verify-shield-box {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(180deg, #F0FDF4 0%, #FFFFFF 100%);
    border-radius: 12px;
    border: 2px solid #86EFAC;
    position: relative;
    overflow: hidden;
}

.verify-shield-invalid {
    background: linear-gradient(180deg, #FEF2F2 0%, #FFFFFF 100%);
    border-color: #FCA5A5;
}

.verify-icon-pulse {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7);
    animation: pulse-green 2s infinite;
}

.verify-icon-invalid {
    background-color: #EF4444;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 14px rgba(5, 150, 105, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Security Seal Strip */
.security-seal-strip {
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.85rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82rem;
    word-break: break-all;
    color: #475569;
}

/* Public Portal Search Hero */
.portal-hero {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    color: white;
    padding: 3rem 1rem;
    border-radius: 0;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
    margin-bottom: 2rem;
}

.search-input-group {
    background: white;
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.search-input-group input {
    border: none;
    border-radius: 6px;
    padding-left: 15px;
    font-size: 1.05rem;
}

.search-input-group input:focus {
    box-shadow: none;
}

.search-input-group button {
    border-radius: 6px;
    padding: 10px 24px;
    font-weight: 600;
}

/* Footer */
.footer-official {
    background: #FFFFFF;
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ==========================================================================
   LAYOUT CON MENU SIDEBAR MODERNO (CECyTE Nayarit)
   ========================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-page);
    width: 100%;
}

/* Sidebar Fijo */
.sidebar-official {
    width: 260px;
    min-width: 260px;
    background: linear-gradient(180deg, #0F172A 0%, #162032 50%, #1E293B 100%);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    border-right: none;
    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.18);
    z-index: 1045;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

/* Header del Sidebar */
.sidebar-brand {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-brand-img {
    max-height: 40px;
    object-fit: contain;
}

.sidebar-brand-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.sidebar-brand-sub {
    font-size: 0.68rem;
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Perfil en Sidebar */
.sidebar-user {
    padding: 0.85rem 1rem;
    margin: 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

/* Navegación */
.sidebar-heading {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 800;
    color: #64748B;
    padding: 1rem 1.25rem 0.4rem;
}

.sidebar-nav {
    list-style: none;
    padding: 0.5rem 0.75rem;
    margin: 0;
    flex: 1;
}

.sidebar-nav .nav-link {
    color: #94A3B8;
    padding: 0.65rem 0.95rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    text-decoration: none;
    margin-bottom: 0.25rem;
}

.sidebar-nav .nav-link:hover {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.07);
    transform: translateX(3px);
}

.sidebar-nav .nav-link.active {
    color: #FFFFFF !important;
    background-color: var(--primary-color) !important;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.sidebar-nav .nav-link i {
    font-size: 1.15rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

/* Área Principal */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

/* Topbar */
.app-topbar {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* Responsive Sidebar para pantallas menores a 992px */
@media (max-width: 991.98px) {
    .sidebar-official {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1055;
    }
    .sidebar-official.show {
        transform: translateX(0);
    }
}
