/* ==========================================================================
   YOLOV8 PANEL — Paleta cálida miel/ámbar con patrón de panal
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: #f9fafb;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    position: relative;
}

/* Todo el contenido por encima de la decoración de fondo */
.container-fluid {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   v6: LAYOUT CORPORATIVO — SIDEBAR COLAPSABLE + CONTENIDO RESPONSIVO
   ========================================================================== */

.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── Sidebar oscuro tipo dock ─────────────────────────────────────────────── */
.app-sidebar {
    width: 248px;
    flex-shrink: 0;
    background-color: #1f2937;
    color: #e7e5e4;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.1rem 0.85rem;
    transition: width 0.2s ease;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 0 0.25rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.sidebar-brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background-color: #047857;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: #9ca3af;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background-color: #374151;
    color: #34d399;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.6rem 0.7rem;
    border-radius: 9px;
    color: #d1d5db;
    font-weight: 500;
    font-size: 0.84rem;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background-color: #374151;
    color: #a7f3d0;
}

.sidebar-link.active {
    background-color: #047857;
    color: #ffffff;
}

.sidebar-bottom {
    border-top: 1px solid #374151;
    padding-top: 0.9rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.6rem;
    overflow: hidden;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #047857;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    overflow: hidden;
    flex: 1;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.78rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout-btn {
    background: transparent;
    border: none;
    color: #f87171;
    font-size: 0.7rem;
    padding: 0;
    cursor: pointer;
    white-space: nowrap;
}

.sidebar-logout-btn:hover {
    color: #fca5a5;
}

.sidebar-version {
    font-size: 0.65rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
}

/* ── Estado COLAPSADO: sidebar se reduce a barra de iconos ─────────────────── */
.sidebar-colapsado .app-sidebar {
    width: 68px;
}

.sidebar-colapsado .sidebar-brand-text,
.sidebar-colapsado .sidebar-link-text,
.sidebar-colapsado .sidebar-user-info,
.sidebar-colapsado .sidebar-version {
    display: none;
}

.sidebar-colapsado .sidebar-top {
    flex-direction: column;
    gap: 10px;
}

.sidebar-colapsado .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar-colapsado .sidebar-link {
    justify-content: center;
    padding: 0.6rem;
    position: relative;
}

.sidebar-colapsado .sidebar-user {
    justify-content: center;
}

/* Tooltip simple al pasar el mouse sobre íconos colapsados */
.sidebar-colapsado .sidebar-link:hover::after,
.sidebar-colapsado .sidebar-user:hover::after {
    content: attr(data-label);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    background-color: #374151;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 50;
    pointer-events: none;
}

/* ── Botón de menú móvil (oculto en escritorio) ──────────────────────────── */
.mobile-sidebar-toggle {
    background: var(--color, #ffffff);
    border: 1px solid #e5e7eb;
    color: #6b7280;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-overlay {
    display: none;
}

/* ── Contenido principal: responsivo, centrado con ancho máximo cómodo ────── */
.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.app-content {
    width: 100%;
    max-width: 1320px;
    padding: 1.75rem 2rem;
}

/* ── Responsivo: tablet ───────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .app-content {
        padding: 1.25rem 1.25rem;
    }
}

/* ── Responsivo: móvil — sidebar se convierte en panel deslizante ──────────── */
@media (max-width: 767.98px) {
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 248px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1050;
    }

    .sidebar-colapsado .app-sidebar {
        width: 248px;
    }

    .sidebar-colapsado .sidebar-brand-text,
    .sidebar-colapsado .sidebar-link-text,
    .sidebar-colapsado .sidebar-user-info,
    .sidebar-colapsado .sidebar-version {
        display: block;
    }

    .sidebar-colapsado .sidebar-top {
        flex-direction: row;
    }

    .sidebar-colapsado .sidebar-link {
        justify-content: flex-start;
    }

    .sidebar-colapsado .sidebar-user {
        justify-content: flex-start;
    }

    .sidebar-toggle {
        display: none;
    }

    .sidebar-movil-abierto .app-sidebar {
        transform: translateX(0);
    }

    .sidebar-movil-abierto .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(28, 25, 23, 0.5);
        z-index: 1040;
    }

    .app-content {
        padding: 1rem;
    }
}

@media (min-width: 768px) {
    .mobile-sidebar-toggle {
        display: none;
    }
}


/* ── Aurora Card ──────────────────────────────────────────────────────────── */
.aurora-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow:
        0 4px 6px -1px  rgba(4, 120, 87, 0.02),
        0 10px 15px -3px rgba(4, 120, 87, 0.04),
        0 0 0 1px        rgba(4, 120, 87, 0.01);
    transition: all 0.25s ease-in-out;
}

.aurora-card:hover {
    transform: translateY(-2px);
    border-color: #d1d5db;
    box-shadow:
        0 12px 20px -5px rgba(4, 120, 87, 0.08),
        0 4px 6px -2px   rgba(4, 120, 87, 0.03);
}

/* ── Fichas técnicas ──────────────────────────────────────────────────────── */
.ficha-grid-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    box-shadow:
        0 2px 4px  rgba(0, 0, 0, 0.01),
        0 4px 12px rgba(4, 120, 87, 0.03);
    transition: all 0.25s ease;
}

.ficha-grid-card:hover {
    transform: translateY(-4px);
    border-color: #047857;
    box-shadow: 0 16px 24px -8px rgba(4, 120, 87, 0.14);
}

@media (min-width: 1200px) {
    .col-xl-custom-5 {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

/* ── Contenedores de imagen ───────────────────────────────────────────────── */
.preview-box-container {
    width: 100%;
    height: 150px;
    background-color: #f3f4f6 !important;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.preview-box-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    max-width: 100%;
    max-height: 100%;
}

.aurora-image-box {
    width: 100%;
    height: 120px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9fafb !important;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.aurora-image-box:hover {
    border-color: #047857;
    background-color: #f3f4f6 !important;
}

.aurora-image-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge-verificado {
    background-color: #dcfce7;
    color: #15803d;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-vacio {
    background-color: #f3f4f6;
    color: #6b7280;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border: 1px solid #e5e7eb;
}

/* ── Tabla DataTables ─────────────────────────────────────────────────────── */
.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: #f9fafb;
    color: #1f2937;
}

.table thead th {
    background-color: #f3f4f6;
    color: #374151;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.table tbody td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    padding: 0.3rem 0.75rem !important;
    background-color: #ffffff !important;
    color: #1f2937 !important;
}

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-content-clear {
    background-color: #ffffff !important;
    border: 1px solid #d1d5db !important;
    color: #111827 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.modal-header-clear {
    background-color: #f9fafb !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.modal-footer-clear {
    background-color: #f9fafb !important;
    border-top: 1px solid #e5e7eb !important;
}

h5.text-uppercase {
    color: #111827 !important;
    font-weight: 700 !important;
}

/* ── Overlays ─────────────────────────────────────────────────────────────── */
.no-detection-overlay {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    background-color: rgba(241, 245, 249, 0.9);
    border: 1px solid #d1d5db;
    color: #374151;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    text-align: center;
}

.watermark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    overflow: hidden;
    background: repeating-linear-gradient(
        45deg,
        rgba(239, 68, 68, 0.04),
        rgba(239, 68, 68, 0.04) 10px,
        rgba(239, 68, 68, 0.08) 10px,
        rgba(239, 68, 68, 0.08) 20px
    );
}

.watermark-text {
    color: rgba(220, 38, 38, 0.35);
    font-size: 1.4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transform: rotate(-15deg);
    border: 4px double rgba(220, 38, 38, 0.35);
    padding: 8px 16px;
    border-radius: 8px;
    user-select: none;
    text-align: center;
}

/* ==========================================================================
   v2: PESTAÑAS DINÁMICAS DE INFORMACIÓN DE ESPECIE (MODAL)
   ========================================================================== */
.nav-tabs-especie {
    border-bottom: 1px solid #e5e7eb;
}

.nav-tabs-especie .nav-link {
    color: #6b7280;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 0.75rem;
}

.nav-tabs-especie .nav-link:hover {
    color: #047857;
    border-bottom-color: #d1d5db;
}

.nav-tabs-especie .nav-link.active {
    color: #047857;
    background-color: transparent;
    border-bottom-color: #047857;
}

#tabsEspecieContent {
    border-color: #e5e7eb !important;
    background-color: #f9fafb !important;
}

/* ── Modal ampliado (tamaño de página) ───────────────────────────────────── */
#historialModal .modal-dialog {
    width: 95vw;
    max-width: 1400px;
}

@media (max-width: 991.98px) {
    #historialModal .modal-dialog {
        width: 100vw;
        max-width: 100vw;
        margin: 0;
        height: 100vh;
    }
    #historialModal .modal-content {
        height: 100vh;
        border-radius: 0 !important;
    }
}

/* ==========================================================================
   v3: IMAGEN AMPLIABLE (LIGHTBOX) Y CONFIANZA CON COLOR SEMÁNTICO
   ========================================================================== */

/* Imagen dentro del modal: cursor zoom + indicador flotante */
#modalImageContainer {
    position: relative;
}

#modalImageContainer img.zoomable {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

#modalImageContainer img.zoomable:hover {
    transform: scale(1.02);
}

.zoom-hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}

/* Overlay de pantalla completa */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.92);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox-overlay img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Barras de confianza con color semántico */
.progress-bar.confianza-alta {
    background-color: #16a34a !important;
}

.progress-bar.confianza-media {
    background-color: #047857 !important;
}

.progress-bar.confianza-baja {
    background-color: #dc2626 !important;
}

.confianza-texto-alta {
    color: #16a34a !important;
}

.confianza-texto-media {
    color: #047857 !important;
}

.confianza-texto-baja {
    color: #dc2626 !important;
}

/* ==========================================================================
   v4: TAMAÑO FIJO EN PREVIEW DE IMAGEN PROCESADA + BARRA INDETERMINADA
   ========================================================================== */

/* El contenedor de "Imagen Procesada" mantiene siempre la misma altura,
   sin importar si está vacío, cargando, o mostrando el resultado final */
.preview-box-fixed {
    height: 178px !important;
    flex: 0 0 178px;
}

.preview-box-fixed img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* Barra de progreso indeterminada: se desplaza de izquierda a derecha
   en bucle continuo, sin afirmar un porcentaje real de avance */
.progress-indeterminado {
    width: 80%;
    max-width: 160px;
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
    position: relative;
}

.progress-indeterminado-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    background-color: #047857;
    border-radius: 4px;
    animation: indeterminado-loop 1.4s ease-in-out infinite;
}

@keyframes indeterminado-loop {
    0% {
        left: -40%;
    }
    100% {
        left: 100%;
    }
}

/* ==========================================================================
   v5: MODAL DE CONFIRMACIÓN DE ELIMINACIÓN (reemplaza confirm() nativo)
   ========================================================================== */
.confirm-icon-wrapper {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    border-radius: 50%;
    background-color: #fef3c7;
    color: #b45309;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

#confirmDeleteModal .btn-danger {
    background-color: #dc2626;
    border: none;
}

#confirmDeleteModal .btn-danger:hover {
    background-color: #b91c1c;
}

/* ==========================================================================
   v6: SKELETON LOADING PARA MINIATURAS
   ========================================================================== */
.img-skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==========================================================================
   v7: ANIMACIÓN DE ENTRADA PARA FICHAS Y FILAS NUEVAS
   ========================================================================== */
.ficha-nueva {
    animation: entrada-suave 0.5s ease-out;
}

tr.fila-nueva {
    animation: entrada-fila 0.6s ease-out;
}

@keyframes entrada-suave {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes entrada-fila {
    from {
        opacity: 0;
        background-color: #dbeafe;
    }
    to {
        opacity: 1;
        background-color: transparent;
    }
}

/* ── Toast de notificación de error (reemplaza alert() nativo) ──────────────── */
.toast-error-flotante {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #ffffff;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    color: #991b1b;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    z-index: 2100;
    max-width: 360px;
    display: flex;
    align-items: center;
    animation: toast-entrada 0.25s ease-out;
}

.toast-error-salida {
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s ease;
}

@keyframes toast-entrada {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   v4: PANTALLAS DE AUTENTICACIÓN (LOGIN / REGISTRO)
   ========================================================================== */
.auth-body {
    background-color: #f9fafb;
    min-height: 100vh;
}

.auth-wrapper {
    min-height: 100vh;
    padding: 2rem 1rem;
}

.auth-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow:
        0 4px 6px -1px  rgba(4, 120, 87, 0.03),
        0 10px 15px -3px rgba(4, 120, 87, 0.06);
}

.auth-card .form-control {
    border-color: #e5e7eb;
    padding: 0.6rem 0.9rem;
}

.auth-card .form-control:focus {
    border-color: #047857;
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.1);
}

/* Barra de usuario en el sidebar del dashboard */
.usuario-info-sidebar {
    background-color: #f3f4f6;
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
}

.usuario-avatar-inicial {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #047857;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ==========================================================================
   v7: FRANJA COMPACTA DE KPIs
   ========================================================================== */
.kpi-strip {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow:
        0 4px 6px -1px  rgba(4, 120, 87, 0.02),
        0 10px 15px -3px rgba(4, 120, 87, 0.04);
}

.kpi-strip-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 150px;
}

.kpi-strip-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.kpi-icon-amber {
    background-color: #f3f4f6;
    color: #047857;
}

.kpi-icon-green {
    background-color: #dcfce7;
    color: #15803d;
}

.kpi-icon-blue {
    background-color: #e0f2fe;
    color: #0369a1;
}

.kpi-strip-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
}

.kpi-strip-label {
    font-size: 0.68rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.kpi-strip-divider {
    width: 1px;
    height: 36px;
    background-color: #e5e7eb;
    flex-shrink: 0;
}

@media (max-width: 767.98px) {
    .kpi-strip {
        flex-direction: column;
        align-items: stretch;
    }
    .kpi-strip-divider {
        width: 100%;
        height: 1px;
    }
}

/* ==========================================================================
   v7: VISOR DE IMAGEN CON ZOOM (reemplaza el preview-box pequeño)
   ========================================================================== */
.visor-imagen-container {
    background-color: #f3f4f6;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex: 1;
}

.visor-imagen-viewport {
    width: 100%;
    height: 100%;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 1rem;
}

.visor-imagen-viewport img {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
    transition: transform 0.15s ease;
    transform-origin: center center;
}

@media (max-width: 767.98px) {
    .visor-imagen-container,
    .visor-imagen-viewport {
        min-height: 280px;
    }
    .visor-imagen-viewport img {
        max-height: 260px;
    }
}

/* ==========================================================================
   v8: CARRUSEL DE FICHAS — VISTA GRANDE + FILMSTRIP DE MINIATURAS
   ========================================================================== */
   v9: CARRUSEL DE FICHAS — MINIATURAS VERTICALES + PALETA CORPORATIVA
   ========================================================================== */
.carrusel-imagen-grande {
    position: relative;
    width: 100%;
    height: 460px;
    background-color: #f3f4f6;
    cursor: zoom-in;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carrusel-imagen-grande img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.carrusel-imagen-grande:hover img {
    transform: scale(1.02);
}

.carrusel-imagen-hint {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background-color: rgba(31, 41, 55, 0.8);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    pointer-events: none;
}

@media (max-width: 991.98px) {
    .carrusel-imagen-grande {
        height: 320px;
    }
}

.carrusel-panel-detalles {
    height: 460px;
    overflow-y: auto;
    border-left: 1px solid #e5e7eb;
}

.carrusel-panel-header {
    border-bottom: 1px solid #f3f4f6;
}

.carrusel-meta-box {
    background-color: #f9fafb;
    border-radius: 6px;
    padding: 6px;
}

.carrusel-especie-item {
    background-color: #f9fafb;
    border-radius: 6px;
    padding: 8px 10px;
    border-left: 3px solid #047857;
}

.carrusel-btn-detalle {
    background-color: #1f2937;
    border: none;
    color: #ffffff;
    font-size: 0.78rem;
}

.carrusel-btn-detalle:hover {
    background-color: #047857;
    color: #ffffff;
}

@media (max-width: 991.98px) {
    .carrusel-panel-detalles {
        height: auto;
        max-height: 420px;
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }
}

/* ── Filmstrip vertical de miniaturas (a la izquierda de la imagen) ───────── */
.carrusel-filmstrip-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background-color: #f9fafb;
    border-right: 1px solid #e5e7eb;
    height: 460px;
    overflow-y: auto;
    width: 96px;
    scrollbar-width: thin;
}

.carrusel-miniatura {
    flex-shrink: 0;
    width: 100%;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.15s ease;
}

.carrusel-miniatura img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    display: block;
    background-color: #e5e7eb;
}

.carrusel-miniatura:hover {
    border-color: #d1d5db;
}

.carrusel-miniatura.activa {
    border-color: #047857;
}

@media (max-width: 991.98px) {
    .carrusel-filmstrip-vertical {
        flex-direction: row;
        width: 100%;
        height: auto;
        overflow-x: auto;
        overflow-y: visible;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .carrusel-miniatura {
        width: 64px;
    }
}

/* ==========================================================================
   v10: DASHBOARD DE ANALÍTICA — ANILLOS DE KPI, GRÁFICAS Y MAPA
   ========================================================================== */
.kpi-ring-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.kpi-ring-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-ring-label {
    font-size: 0.68rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kpi-ring-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
}

.kpi-ring {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.kpi-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.kpi-ring circle {
    fill: none;
    stroke-width: 5;
}

.kpi-ring svg circle:first-child {
    stroke: #f3f4f6;
}

.kpi-ring-fill {
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

.kpi-ring-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 700;
    color: #111827;
}

#mapaMundial {
    border: 1px solid #e5e7eb;
    z-index: 0;
}
