/* ============================================================
   ARCHIVO CSS PRINCIPAL - VERSIÓN CON NAVBAR HÍBRIDO
   (PALETA VERDE: principal + acento en verde suave)
   ============================================================ */

:root {
    --font-family-sans-serif: "Open Sans", -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
        "Noto Color Emoji";

    /* Layout */
    --sidebar-width: 80px;
    --topbar-height: 70px;

    /* Base (brand) */
    --primary-color: #208793;   /* TU color */
    --primary-dark:  #176F79;   /* más profundo (hover/headers) */

    /* Acento (más claro / vibrante, sin perder elegancia) */
    --accent-color:  #35A7B0;   /* brillo suave para accents */
    --accent-dark:   #1F7E86;   /* acento oscuro coherente */

    /* Neutros modernos */
    --text-dark:     #1F2937;
    --text-muted:    #6B7280;
    --bg-light:      #F8FAFC;
    --border-color:  #E5E7EB;

    /* Fondos “tint” (teal muy suave, para hovers y paneles) */
    --tint-50:  #EAF7F7;  /* muy claro */
    --tint-100: #D4F0F1;  /* claro */
    --tint-200: #B9E7EA;  /* hover suave */

    /* Estados */
    --success: #16A34A;
    --danger:  #DC2626;
    --warning: #F59E0B;

    /* Sombras (adaptadas al brand #208793) */
    --shadow-soft: 0 10px 30px rgba(32, 135, 147, 0.14);
    --shadow-hover: 0 14px 40px rgba(32, 135, 147, 0.18);
}

*,
*::before,
*::after {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

html {
    font-family: sans-serif;
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

nav {
    display: block;
}

body {
    margin: 0;
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji",
        "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #334155;
    text-align: left;
    background-color: #F1F5F9;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    background-color: transparent;
}

a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: "Nunito", sans-serif;
    margin-bottom: 0.5rem;
    font-weight: 500;
    line-height: 1.2;
}

h1, .h1 {
    font-size: 2.5rem;
    font-weight: normal;
}

/* ============================================================
   RESET DE ESTILOS DEL NAVBAR ANTIGUO
   ============================================================ */

.dashboard-nav { display: none !important; }
.dashboard-toolbar { display: none !important; }

/* ============================================================
   LAYOUT PRINCIPAL - ADAPTADO AL NUEVO NAVBAR
   ============================================================ */

main { min-height: 100vh; }

.dashboard {
    display: flex;
    min-height: 100vh;
}

.dashboard-app {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    transition: margin-left 0.3s ease;
}

.dashboard-content {
    flex-grow: 1;
    padding: 2rem;
    background: linear-gradient(135deg, #F8FAFC 0%, #EEF2F7 100%);
    min-height: calc(100vh - var(--topbar-height));
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

@media (max-width: 768px) {
    .dashboard-app { margin-left: 0; }
    .dashboard-content { padding: 1rem; }
}

/* ============================================================
   TOPBAR SUPERIOR
   ============================================================ */

.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: white;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    border-bottom: 3px solid var(--primary-color);
    transition: left 0.3s ease;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.page-title i {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Búsqueda en topbar */
.search-box {
    position: relative;
    transition: all 0.3s ease;
}

.search-box input {
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    background: var(--bg-light);
    color: var(--text-dark);
    width: 200px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.search-box input::placeholder { color: #94A3B8; }

.search-box input:focus {
    outline: none;
    background: white;
    border-color: var(--primary-color);
    width: 280px;
    box-shadow: 0 0 0 3px rgba(46, 136, 114, 0.18);
}

.search-box i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.search-box.search-active i { color: var(--primary-color); }

/* Notificaciones */
.notification-bell {
    position: relative;
    width: 40px;
    height: 40px;
    background: var(--bg-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notification-bell:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

.notification-bell:hover i { color: white; }

.notification-bell i {
    font-size: 1.2rem;
    color: #555;
    transition: color 0.3s ease;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.45rem;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 10px rgba(59, 159, 134, 0.35);
}

/* Info del usuario en topbar */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #F8FAFC, #EEF2F7);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.user-info:hover {
    background: linear-gradient(135deg, #EEF2F7, #E5E7EB);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 3px 10px rgba(46, 136, 114, 0.28);
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Botones topbar */
.btn-logout-top {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #DC2626, #B91C1C);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.25);
}

.btn-logout-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35);
    background: linear-gradient(135deg, #B91C1C, #991B1B);
}

.btn-logout-top i { font-size: 1rem; }

.btn-login-top {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, var(--primary-color), #208793);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(46, 136, 114, 0.25);
    text-decoration: none;
}

.btn-login-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 136, 114, 0.35);
    color: white;
    text-decoration: none;
}

/* ============================================================
   SIDEBAR COMPACTO
   ============================================================ */

.compact-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-dark), var(--primary-color));
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.sidebar-logo {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-logo a {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo img{
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.25)); /* solo sombra */
}

.sidebar-logo:hover img {
    transform: scale(1.1) rotate(5deg);
}

/* Menú del sidebar */
.sidebar-menu {
    flex: 1;
    padding: 1.5rem 0;
    overflow: visible;
}

/* Items del sidebar */
.sidebar-item {
    position: relative;
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: white;
    border-radius: 0 4px 4px 0;
    transition: height 0.3s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

.sidebar-link:hover::before { height: 60%; }

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.sidebar-link.active::before {
    height: 60%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.sidebar-link i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.sidebar-link:hover i { transform: scale(1.15); }

.sidebar-link span {
    font-size: 0.7rem;
    text-align: center;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tooltip para items sin submenu */
.sidebar-item:not(.has-submenu) .sidebar-link::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-dark);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-left: 15px;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    pointer-events: none;
}

.sidebar-item:not(.has-submenu) .sidebar-link:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   SUBMENÚS FLOTANTES - SOLUCIÓN MEJORADA
   ============================================================ */

.sidebar-item.has-submenu .submenu {
    position: absolute;
    left: var(--sidebar-width);
    top: 0;
    min-width: 220px;
    background: white;
    border-radius: 0 12px 12px 0;
    box-shadow: 5px 5px 25px rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-left: 4px solid var(--accent-color);
    z-index: 9999;

    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    pointer-events: none;

    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

/* Puente invisible para evitar cierre rápido */
.sidebar-item.has-submenu::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 0;
    width: 20px;
    height: 100%;
    background: transparent;
    z-index: 9998;
    display: none;
}

.sidebar-item.has-submenu:hover::after { display: block; }

/* Mostrar submenu en hover */
.sidebar-item.has-submenu:hover .submenu,
.sidebar-item.has-submenu .submenu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

.sidebar-item.has-submenu .submenu {
    padding-left: 0.75rem;
    margin-left: 0;
}

/* Extender área de hover del submenu */
.sidebar-item.has-submenu .submenu::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    width: 20px;
    height: 100%;
    background: transparent;
}

/* Items del submenu */
.submenu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    color: #555;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
    margin: 2px 0;
}

.submenu-item:hover {
    background: linear-gradient(135deg, var(--primary-color), #208793 60%, var(--accent-color) 140%);
    color: white;
    transform: translateX(5px);
    text-decoration: none;
}

.submenu-item i {
    width: 22px;
    text-align: center;
    font-size: 0.95rem;
    transition: transform 0.2s ease;
}

.submenu-item:hover i { transform: scale(1.1); }

/* Título del submenu */
.submenu-title {
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-dark);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

/* Footer del sidebar */
.sidebar-footer {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
}

.version-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ============================================================
   MOBILE TOGGLE Y OVERLAY
   ============================================================ */

.mobile-toggle {
    display: none;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    color: var(--primary-color);
    font-size: 1.3rem;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
    display: none;
}

.sidebar-overlay.active { display: block; }

/* ============================================================
   RESPONSIVE - MÓVIL
   ============================================================ */

@media (max-width: 768px) {
    .mobile-toggle { display: block; }

    .compact-sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .compact-sidebar.mobile-active { transform: translateX(0); }

    .sidebar-link {
        flex-direction: row;
        justify-content: flex-start;
        padding: 1rem 1.5rem;
        gap: 1rem;
    }

    .sidebar-link i {
        margin-bottom: 0;
        font-size: 1.3rem;
    }

    .sidebar-link span {
        font-size: 0.95rem;
        text-transform: none;
    }

    /* Submenús como acordeón */
    .sidebar-item.has-submenu .submenu {
        position: static;
        left: auto;
        margin-left: 0;
        margin-top: 0;
        transform: none;
        box-shadow: none;
        border-left: none;
        border-top: 1px solid rgba(46, 136, 114, 0.22);
        border-radius: 0;
        background: rgba(255, 255, 255, 0.95);
        padding: 0.5rem 0 0.5rem 2rem;

        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }

    .sidebar-item.has-submenu .submenu::before { display: none; }
    .sidebar-item.has-submenu::after { display: none !important; }

    .sidebar-item.has-submenu.submenu-open .submenu {
        max-height: 500px;
        padding: 0.5rem 0 0.5rem 2rem;
    }

    /* No mostrar en hover en móvil */
    .sidebar-item.has-submenu:hover .submenu {
        max-height: 0;
        padding: 0 0 0 2rem;
    }

    .sidebar-item.has-submenu.submenu-open:hover .submenu {
        max-height: 500px;
        padding: 0.5rem 0 0.5rem 2rem;
    }

    /* Indicador de flecha */
    .sidebar-item.has-submenu .sidebar-link::after {
        content: '\f078';
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 0.7rem;
        margin-left: auto;
        transition: transform 0.3s ease;
    }

    .sidebar-item.has-submenu.submenu-open .sidebar-link::after {
        transform: rotate(180deg);
    }

    /* Ocultar tooltips en móvil */
    .sidebar-item:not(.has-submenu) .sidebar-link::after {
        display: none !important;
    }

    .topbar { left: 0; }

    .page-title { font-size: 1.2rem; }
    .page-title span { display: none; }

    .search-box,
    .notification-bell,
    .user-details {
        display: none;
    }

    .btn-logout-top span,
    .btn-login-top span {
        display: none;
    }

    .btn-logout-top,
    .btn-login-top {
        padding: 0.6rem;
    }
}

@media (max-width: 576px) {
    .topbar { padding: 0 1rem; }
}

/* Animación del sidebar móvil */
@keyframes slideInFromLeft {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}

.compact-sidebar.mobile-active {
    animation: slideInFromLeft 0.3s ease;
}

/* ============================================================
   TARJETAS Y CONTENEDORES
   ============================================================ */

.card-contenido {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0;
}

.card-body-contenido { flex: 1 1 auto; padding: 1.25rem; }

.card-header-contenido {
    padding: 0.75rem 1.25rem;
    margin-bottom: 0;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    text-align: center;
}

.colorize { width: 90px; padding: 15px; }

/* ============================================================
   FORMULARIO DE LOGIN
   ============================================================ */

.card {
    max-width: 450px;
    background-color: rgba(5, 14, 26, 0.922) !important;
    border-radius: 10px;
}

.logo-form { max-width: 40%; height: auto; }

@media (max-width: 576px) {
    .card { max-width: 70%; }
    .logo-form { max-width: 35%; }
}

.card-header h3 { color: white; margin: 0; }

.input-group-text {
    width: 50px;
    background-color: var(--primary-color);
    color: #fff;
    border: 0 !important;
}

input:focus { outline: none !important; box-shadow: none !important; }

.login_btn {
    background-color: var(--primary-color);
    color: #fff;
    width: 100%;
    border: none;
    transition: background-color 0.3s;
}

.login_btn:hover { color: white; background: #208793; }

.enlace { color: var(--primary-color); margin-left: 4px; }
.enlace:hover { color: var(--accent-dark); margin-left: 4px; }

/* ============================================================
   FORMULARIO DE REVISIÓN
   ============================================================ */

.card-revision {
    max-width: 450px;
    background-color: rgba(0, 0, 0, 0.5) !important;
    border-radius: 10px;
}

.logo-form-revision { max-width: 20%; height: auto; }

@media (max-width: 576px) {
    .card-revision { max-width: 70%; }
    .logo-form-revision { max-width: 35%; }
}

/* ============================================================
   PREGUNTAS Y ENCUESTAS
   ============================================================ */

.pregunta-card {
    background-color: #E8EEF6 !important;
    width: 100%;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pregunta-card .opciones-container {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #F1F5F9;
    border-radius: 0.25rem;
}

.btn-sm { font-size: 0.8rem; padding: 0.25rem 0.5rem; }

.pregunta-label {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.pregunta-input { background-color: var(--tint-50); }

.opciones-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.opciones-container input { flex: 1; }

.contenido-formulario {
    flex-grow: 2;
    margin: 50px;
    padding: 25px;
    background-color: rgba(46, 136, 114, 0.08);
    border-radius: 25px;
}

.btn-morado {
    background-color: var(--primary-color) !important;
    border-color: #208793 !important;
    color: white !important;
}

.btn-morado:hover {
    background-color: #208793 !important;
    border-color: var(--accent-color) !important;
    color: white !important;
}

.titulo-azul {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
}

.card-encuesta {
    background-color: #F8FAFC;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-encuesta .card-body { padding: 1.25rem; }

/* ============================================================
   ESTILOS ENCUESTA PÚBLICA
   ============================================================ */

.encuesta-header { margin-bottom: 2rem; }

.icono-encuesta {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #208793 70%, var(--accent-color) 160%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 8px 25px rgba(46, 136, 114, 0.25);
}

.icono-encuesta i { font-size: 2rem; color: white; }

.subtitulo-encuesta {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 0.5rem;
}

.seccion-encuesta {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out;
}

.seccion-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #208793 60%, var(--accent-color) 160%);
    color: white;
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.seccion-header-preguntas {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 60%, var(--accent-color) 160%);
}

.seccion-body { padding: 1.5rem; }

.label-encuesta {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.95rem;
}

.icono-label { color: var(--primary-color); width: 18px; margin-right: 5px; }

.input-encuesta {
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.input-encuesta:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 136, 114, 0.18);
}

.input-encuesta::placeholder { color: #94A3B8; }

.pregunta-item {
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.pregunta-item:hover { background-color: var(--tint-50); }

.numero-pregunta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #208793 70%, var(--accent-color) 160%);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 12px;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(46, 136, 114, 0.18);
}

.pregunta-texto {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
    line-height: 1.5;
    padding-top: 4px;
}

.opciones-respuesta { margin-left: 44px; }

.opcion-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.opcion-item:hover {
    border-color: var(--accent-color);
    background: var(--tint-50);
}

.opcion-item .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    cursor: pointer;
}

.opcion-item .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 136, 114, 0.22);
}

.opcion-item .form-check-label {
    cursor: pointer;
    margin-bottom: 0;
    flex: 1;
}

.respuesta-abierta { margin-left: 44px; }
.respuesta-abierta textarea { resize: vertical; min-height: 100px; }

.btn-enviar-encuesta {
    background: linear-gradient(135deg, var(--primary-color) 0%, #208793 55%, var(--accent-color) 120%);
    border: none;
    color: white;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: 0 8px 26px rgba(46, 136, 114, 0.25);
    transition: all 0.3s ease;
}

.btn-enviar-encuesta:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(46, 136, 114, 0.22);
    color: white;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 55%, var(--accent-dark) 120%);
}

.btn-enviar-encuesta:active { transform: translateY(-1px); }

.texto-confidencial { color: var(--text-muted); font-size: 0.875rem; }

.alert-custom {
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .encuesta-publica-container { padding: 1rem 0; }

    .icono-encuesta { width: 60px; height: 60px; }
    .icono-encuesta i { font-size: 1.5rem; }

    .seccion-body { padding: 1rem; }

    .opciones-respuesta,
    .respuesta-abierta {
        margin-left: 0;
        margin-top: 1rem;
    }

    .numero-pregunta { min-width: 28px; height: 28px; font-size: 0.8rem; }

    .btn-enviar-encuesta {
        width: 100%;
        padding: 1rem 2rem;
    }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   ESTILOS DE TABLAS
   ============================================================ */

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.header-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 70%, var(--accent-color) 160%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 10px 25px rgba(46, 136, 114, 0.22);
}

.header-icon i {
    font-size: 1.8rem;
    color: white;
}

.header-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Botones gradient */
.btn-gradient-primary {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 70%, var(--accent-color) 160%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(46, 136, 114, 0.22);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-gradient-primary::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 26px;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(59, 159, 134, 0.0),
        rgba(59, 159, 134, 0.55),
        rgba(59, 159, 134, 0.0)
    );
    opacity: 0.75;
}

.btn-gradient-primary:hover {
    transform: translateY(-2px);
    color: white;
    box-shadow: 0 6px 20px rgba(46, 136, 114, 0.24);
    text-decoration: none;
}

.btn-gradient-success {
    background: linear-gradient(135deg, #16A34A, #22C55E);
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    font-size: 0.95rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-gradient-success:hover {
    background: linear-gradient(135deg, #15803D, #16A34A);
    color: white;
    text-decoration: none;
}

.btn-gradient-danger {
    background: linear-gradient(135deg, #DC2626, #B91C1C);
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    font-size: 0.95rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-gradient-danger:hover {
    background: linear-gradient(135deg, #B91C1C, #991B1B);
    color: white;
    text-decoration: none;
}

.btn-gradient-secondary {
    background: white;
    color: #475569;
    border: 2px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-gradient-secondary:hover {
    border-color: var(--accent-color);
    color: var(--primary-dark);
    transform: translateY(-2px);
    text-decoration: none;
}

/* Botones de acción */
.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: all 0.3s ease;
    margin: 0 2px;
    color: white;
    box-shadow: 0 3px 5px rgba(0,0,0,0.1);
}

.btn-view { background: linear-gradient(135deg, var(--primary-color), #208793); }
.btn-edit { background: linear-gradient(135deg, var(--accent-color), var(--accent-dark)); }
.btn-delete { background: linear-gradient(135deg, #FB7185, #E11D48); }

.btn-icon-small {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    box-shadow: 0 3px 10px rgba(46, 136, 114, 0.18);
    transition: all 0.2s;
}

.btn-icon-small:hover { transform: scale(1.1); color: white; }

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.15);
    color: white;
}

/* Tarjetas de tabla */
.table-card,
.custom-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: none;
    margin-bottom: 2rem;
    position: relative;
}

.table-card:hover,
.custom-card:hover { box-shadow: var(--shadow-hover); }

.card-top-accent {
    height: 6px;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-color), var(--accent-color));
    width: 100%;
}

.card-body-custom { padding: 1.5rem; }

/* Tabla personalizada */
.custom-table {
    width: 100% !important;
    border-collapse: collapse;
}

.custom-table thead {
    background-color: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
}

.custom-table th {
    color: var(--text-dark);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 1rem 0.75rem;
    letter-spacing: 0.5px;
    border: none;
    white-space: nowrap;
}

.custom-table td {
    padding: 0.85rem 0.75rem;
    vertical-align: middle;
    color: #555;
    border-bottom: 1px solid #f1f1f1;
    font-size: 0.9rem;
}

.custom-table tbody tr { transition: all 0.2s ease; }

.custom-table tbody tr:hover { background-color: var(--tint-50); }

.custom-table tbody tr:last-child td { border-bottom: none; }

/* DataTables personalizados */
.dataTables_wrapper .dataTables_filter { margin-bottom: 1rem; }

.dataTables_wrapper .dataTables_filter input {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 136, 114, 0.18);
    outline: none;
}

.dataTables_wrapper .dataTables_length select {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.4rem 2rem 0.4rem 0.75rem;
    margin: 0 0.5rem;
}

.dataTables_wrapper .dataTables_info {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding-top: 1rem;
}

.dataTables_wrapper .dataTables_paginate { padding-top: 1rem; }

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: none !important;
    background: transparent !important;
    color: #555 !important;
    padding: 0.5rem 0.85rem;
    margin: 0 2px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--tint-50) !important;
    color: var(--primary-dark) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 70%, var(--accent-color) 160%) !important;
    color: white !important;
    font-weight: 600;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled { color: #ccc !important; }

/* Badges */
.badge-encuesta {
    background-color: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Sidebar de preguntas */
.question-list { border: none; padding: 0; }

.question-item {
    border: none;
    border-radius: 12px !important;
    margin-bottom: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    color: #555;
    font-weight: 500;
    background-color: var(--bg-light);
}

.question-item:hover {
    background-color: var(--tint-50);
    transform: translateX(5px);
    color: var(--primary-dark);
}

.question-item.active {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 70%, var(--accent-color) 160%) !important;
    color: white !important;
    box-shadow: 0 5px 15px rgba(46, 136, 114, 0.18);
}

.question-item.active .badge {
    background-color: rgba(255,255,255,0.2) !important;
    color: white;
}

/* Estado vacío */
.empty-state { text-align: center; padding: 3rem; }
.empty-state i { font-size: 3rem; color: #cbd5e0; margin-bottom: 1rem; }

/* ============================================================
   ESTILOS DEL FORMULARIO
   ============================================================ */

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 1rem;
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.form-section-title i { color: var(--primary-dark); }

.form-label-custom {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.input-group-custom {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
    z-index: 10;
    font-size: 0.9rem;
}

.form-control-custom {
    padding: 0.75rem 1rem 0.75rem 45px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: #FAFBFC;
}

.form-control-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 136, 114, 0.18);
    background-color: white;
    outline: none;
}

.form-control-custom::placeholder { color: #94A3B8; }

select.form-control-custom {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding-top: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .form-actions { flex-direction: column; }
    .form-actions .btn-gradient-success,
    .form-actions .btn-gradient-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Animaciones */
.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

/* Responsive para tablas */
@media (max-width: 992px) {
    .table-responsive-custom {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .custom-table { min-width: 900px; }
}

@media (max-width: 768px) {
    .custom-table th,
    .custom-table td {
        font-size: 0.8rem;
        padding: 0.6rem 0.5rem;
    }

    .action-btn { width: 28px; height: 28px; }

    .page-header h2 { font-size: 1.6rem; }

    .header-icon { width: 55px; height: 55px; }
    .header-icon i { font-size: 1.4rem; }

    .header-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn-gradient-primary,
    .btn-gradient-success,
    .btn-gradient-secondary {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
    background:
        linear-gradient(225deg, var(--accent-color) 25%, transparent 25%) 0px 0/46px 46px,
        linear-gradient(315deg, #F7F4F8 100%, transparent 25%) 0px 0/46px 46px;
    background-size: cover;
    color: rgb(35, 0, 54);
    text-align: center;
    padding: 0.2rem;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

@media (max-width: 768px) {
    footer { margin-left: 0; }
}
