﻿/* =========================================================
           CHECKINNOVA LAYOUT
           Objetivo:
           - Elevar percepción de calidad del producto
           - Mejorar jerarquía visual
           - Crear shell más limpio y consistente
           ========================================================= */

:root {
    --ci-bg: #ffffff;
    --ci-surface: #ffffff;
    --ci-surface-soft: #f9fbfd;
    --ci-border: #e5eaf1;
    --ci-border-strong: #d6deea;
    --ci-text: #16202f;
    --ci-text-soft: #5d6b82;
    --ci-text-muted: #7b88a1;
    --ci-primary: #2563eb;
    --ci-primary-soft: rgba(37, 99, 235, 0.10);
    --ci-primary-border: rgba(37, 99, 235, 0.18);
    --ci-shadow-sm: 0 2px 8px rgba(16, 24, 40, 0.05);
    --ci-shadow-md: 0 10px 30px rgba(16, 24, 40, 0.08);
    --ci-shadow-lg: 0 18px 50px rgba(16, 24, 40, 0.12);
    --ci-radius-sm: 10px;
    --ci-radius-md: 16px;
    --ci-radius-lg: 22px;
    --ci-sidebar-open: 288px;
    --ci-sidebar-closed: 76px;
    --ci-transition: 180ms ease;
}

.ci-shell {
    min-height: 100vh;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.07), transparent 22%), radial-gradient(circle at left bottom, rgba(15, 23, 42, 0.05), transparent 28%), var(--ci-bg);
    color: var(--ci-text);
}

.ci-app-frame {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

/* =========================
           OVERLAY MÓVIL
           ========================= */
.ci-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.36);
    backdrop-filter: blur(3px);
    z-index: 1020;
}

/* =========================
           SIDEBAR
           ========================= */
.ci-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1030;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-right: 1px solid var(--ci-border);
    box-shadow: var(--ci-shadow-sm);
    transition: width var(--ci-transition), transform var(--ci-transition), box-shadow var(--ci-transition);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
}

.ci-sidebar-open {
    width: var(--ci-sidebar-open);
}

.ci-sidebar-collapsed {
    width: var(--ci-sidebar-closed);
}

/* =========================
   HEADER SIDEBAR (CORREGIDO)
   ========================= */

/* ✅ modo abierto */
.ci-sidebar-open .ci-sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

/* ✅ modo colapsado */
.ci-sidebar-collapsed .ci-sidebar-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
}

.ci-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ✅ centrado correcto en colapsado */
.ci-sidebar-collapsed .ci-brand {
    justify-content: center;
}


.ci-brand-collapsed {
    justify-content: center;
    width: 100%;
    margin-top: 0.25rem;
}

.ci-brand-mark {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--ci-primary), #1d4ed8);
    color: #fff;
    font-size: 1.05rem;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}

.ci-brand-copy {
    min-width: 0;
}

.ci-brand-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--ci-text);
    line-height: 1.1;
    letter-spacing: 0.01em;
}

.ci-brand-subtitle {
    font-size: 0.74rem;
    color: var(--ci-text-muted);
    margin-top: 0.18rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ci-sidebar-toggle,
.ci-mobile-menu {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--ci-border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--ci-text-soft);
    transition: all var(--ci-transition);
}

    .ci-sidebar-toggle:hover,
    .ci-mobile-menu:hover {
        background: var(--ci-primary-soft);
        border-color: var(--ci-primary-border);
        color: var(--ci-primary);
        transform: scale(1.08);
    }


.ci-sidebar-collapsed .ci-sidebar-toggle {
    margin-top: -2px;
}


.ci-sidebar-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.6rem 0.4rem 1rem 0.4rem;
}

.ci-sidebar-footer {
    border-top: 1px solid var(--ci-border);
    padding: 0.85rem 1rem 1rem 1rem;
    background: rgba(255,255,255,0.85);
}

.ci-sidebar-footer-text {
    font-size: 0.74rem;
    line-height: 1.35;
    color: var(--ci-text-muted);
}



/* =========================
           MAIN / TOPBAR / WORKSPACE
           ========================= */
.ci-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ci-topbar {
    position: sticky;
    top: 0;
    z-index: 1010;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(244, 247, 251, 0.78);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229, 234, 241, 0.9);
}

.ci-topbar-left,
.ci-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.ci-context {
    min-width: 0;
}

.ci-context-label {
    font-size: 0.72rem;
    line-height: 1;
    color: var(--ci-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
}

.ci-context-title {
    font-size: 1.02rem;
    line-height: 1.1;
    font-weight: 700;
    color: var(--ci-text);
}

.ci-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #16a34a;
    box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.12);
}

.ci-status-text {
    font-size: 0.82rem;
    color: var(--ci-text-soft);
    font-weight: 600;
}

.ci-workspace {
    flex: 1 1 auto;
    padding: 1.5rem;
}

.ci-content-wrap {
    max-width: 1680px;
    margin: 0 auto;
}

    /* =========================
           MEJORAS VISUALES GLOBALES
           Sin romper tus componentes actuales
           ========================= */
    .ci-content-wrap .card {
        border-radius: var(--ci-radius-md);
        border-color: var(--ci-border);
        box-shadow: var(--ci-shadow-sm);
    }

        .ci-content-wrap .card.shadow-sm,
        .ci-content-wrap .shadow-sm {
            box-shadow: var(--ci-shadow-sm) !important;
        }

    .ci-content-wrap .shadow-lg {
        box-shadow: var(--ci-shadow-md) !important;
    }

    .ci-content-wrap .table {
        --bs-table-bg: transparent;
    }

        .ci-content-wrap .table thead th {
            font-size: 0.78rem;
            letter-spacing: 0.01em;
            color: var(--ci-text-soft);
            font-weight: 700;
            border-bottom-width: 1px;
        }

        .ci-content-wrap .table tbody td {
            vertical-align: middle;
        }

    .ci-content-wrap .badge {
        border-radius: 999px;
        font-weight: 600;
        letter-spacing: 0.01em;
    }

    .ci-content-wrap .form-control,
    .ci-content-wrap .form-select,
    .ci-content-wrap .input-group-text,
    .ci-content-wrap .btn {
        border-radius: 12px;
    }

    .ci-content-wrap .form-control,
    .ci-content-wrap .form-select {
        border-color: var(--ci-border-strong);
        min-height: 42px;
        box-shadow: none;
    }

        .ci-content-wrap .form-control:focus,
        .ci-content-wrap .form-select:focus {
            border-color: rgba(37, 99, 235, 0.45);
            box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
        }

    .ci-content-wrap .btn-primary {
        box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
    }

    .ci-content-wrap .btn {
        transition: all var(--ci-transition);
    }

        .ci-content-wrap .btn:hover {
            transform: translateY(-1px);
        }

/* =========================
           RESPONSIVE
   ========================= */
@@media (max-width: 991.98px) {
    .ci-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100vh;
        transform: translateX(-100%);
        box-shadow: var(--ci-shadow-lg);
    }

        .ci-sidebar.ci-sidebar-open {
            transform: translateX(0);
        }

        .ci-sidebar.ci-sidebar-collapsed {
            transform: translateX(-100%);
            width: var(--ci-sidebar-open);
        }

    .ci-topbar {
        padding: 0.9rem 1rem;
    }

    .ci-workspace {
        padding: 1rem;
    }

    .ci-context-title {
        font-size: 0.95rem;
    }

    .ci-status-text {
        display: none;
    }
}

@@media (min-width: 992px) {
    .ci-mobile-menu {
        display: none !important;
    }
}


/* =========================
           Menu
   ========================= */
    
    .ci-nav {
        width: 100%;
    }

    .ci-nav-expanded {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .ci-nav-collapsed {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        padding-top: 0.5rem;
    }

/* =========================
   NAV ITEMS - MEJORADOS
   ========================= */

.ci-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--ci-transition);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ci-text-soft);
}

    /* Hover elegante */
    .ci-nav-item:hover {
        background: var(--ci-primary-soft);
        color: var(--ci-primary);
    }

    /* Estado activo (clave de UX) */
    .ci-nav-item.active {
        background: rgba(37, 99, 235, 0.14);
        color: var(--ci-primary);
        font-weight: 600;
    }

/* =========================
   SUBMENÚ
   ========================= */



.ci-submenu {
    padding-left: 1rem;
    margin-top: 0.3rem;
    border-left: 2px solid var(--ci-border);
}

    /* Items dentro del submenu */
    .ci-submenu a {
        display: block;
        padding: 0.45rem 0.6rem;
        margin-bottom: 0.1rem;
        border-radius: 8px;
        font-size: 0.85rem;
        color: var(--ci-text-muted);
        text-decoration: none;
        transition: all var(--ci-transition);
    }

        /* Hover submenu */
        .ci-submenu a:hover {
            background: var(--ci-primary-soft);
            color: var(--ci-primary);
        }

        /* Activo submenu */
        .ci-submenu a.active {
            color: var(--ci-primary);
            font-weight: 600;
        }

/* =========================
   GRUPOS
   ========================= */

.ci-nav-group {
    margin-bottom: 0.25rem;
}

/* =========================
   VISIBILIDAD POR DISPOSITIVO
   ========================= */

.ci-desktop-only {
    display: inline-flex;
}

.ci-mobile-only {
    display: none;
}

@media (max-width: 991.98px) {
    .ci-desktop-only {
        display: none !important;
    }

    .ci-mobile-only {
        display: inline-flex !important;
    }
}

.ci-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--ci-border);
    background: white;
    transition: all var(--ci-transition);
}

    .ci-icon-btn:hover {
        background: var(--ci-primary-soft);
        border-color: var(--ci-primary-border);
        color: var(--ci-primary);
    }

/* =========================
   SELECTOR DE SEDE (NUEVO)
   ========================= */

.ci-sede-selector {
    margin-bottom: 0.75rem;
}

.ci-sede-btn {
    background: #fff;
    border: 1px solid var(--ci-border);
    border-radius: 12px;
    padding: 0.5rem 0.9rem;
    font-weight: 500;
    color: var(--ci-text);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--ci-shadow-sm);
    transition: all var(--ci-transition);
}

    .ci-sede-btn:hover {
        border-color: var(--ci-primary-border);
        box-shadow: var(--ci-shadow-md);
    }


/* =========================
   BARRA DE TABS + SEDE
   ========================= */

.ci-tabs-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

/* Lado izquierdo (tabs) */
.ci-tabs-left {
    display: flex;
    align-items: center;
}

/* Lado derecho (sede) */
.ci-tabs-right {
    display: flex;
    align-items: center;
}

    /* Ajuste fino del selector */
    .ci-tabs-right .ci-sede-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

/* =========================
   CONTROL BAR (NUEVO)
   ========================= */

.ci-control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
    background: #ffffff;
    border: 1px solid var(--ci-border);
    border-radius: 14px;
    box-shadow: var(--ci-shadow-sm);
}

/* Lados */
.ci-control-left,
.ci-control-right {
    display: flex;
    align-items: center;
}

/* Tabs más tipo producto */
.ci-tabs-group {
    gap: 0.25rem;
}

.ci-tab {
    border: none;
    border-radius: 10px;
    padding: 0.35rem 0.75rem;
    background: transparent;
    color: var(--ci-text-soft);
    font-weight: 500;
}

    /* Hover */
    .ci-tab:hover {
        background: var(--ci-primary-soft);
        color: var(--ci-primary);
    }

    /* Activo */
    .ci-tab.active {
        background: var(--ci-primary);
        color: #fff;
    }

/* =========================================================
   MODAL ESTANDARIZADO PREMIUM
   ========================================================= */
.modal.fade.show.d-block {
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.modal-content {
    border-radius: var(--ci-radius-md) !important;
    border: 1px solid var(--ci-border) !important;
    box-shadow: var(--ci-shadow-lg) !important;
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--ci-border) !important;
    background: var(--ci-surface-soft);
    padding: 1.1rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--ci-border) !important;
    background: var(--ci-surface-soft);
    padding: 1.1rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

/* =========================================================
   BADGES Y ESTADOS PREMIUM
   ========================================================= */
.ci-content-wrap .badge {
    padding: 0.45em 0.85em;
    font-size: 0.78rem;
    border-radius: 999px;
    font-weight: 600;
}

/* =========================================================
   KPI CARDS PREMIUM
   ========================================================= */
.kpi-card {
    border: 1px solid var(--ci-border) !important;
    box-shadow: var(--ci-shadow-sm) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: var(--ci-surface);
    border-radius: var(--ci-radius-md);
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ci-shadow-md) !important;
}

.bg-primary-soft {
    background-color: var(--ci-primary-soft) !important;
}

.bg-success-soft {
    background-color: rgba(25, 135, 84, 0.08) !important;
}

.bg-info-soft {
    background-color: rgba(13, 202, 240, 0.08) !important;
}

.bg-warning-soft {
    background-color: rgba(255, 193, 7, 0.08) !important;
}

/* pulse animation */
.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}





/* =========================================================
   ESTILOS CENTRALIZADOS DE COMPONENTES
   ========================================================= */

.ci-sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8f9fa !important;
}

.badge-sm {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

.ci-row-highlight {
    animation: ciHighlight 3s ease-out;
}

@keyframes ciHighlight {
    0% { background-color: rgba(13, 202, 240, 0.25); }
    100% { background-color: transparent; }
}

.table-smooth-transition tbody {
    transition: opacity 0.2s ease-in-out;
}

.table-smooth-transition.loading tbody {
    opacity: 0.5;
}

.pagination-loading {
    pointer-events: none;
    opacity: 0.6;
}

.table-container-min-height {
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

/* =========================================================
   ESTILOS PREMIUM KPI CARDS (SIN BORDES IZQUIERDOS)
   ========================================================= */

.ci-kpi-card {
    border-radius: var(--ci-radius-md) !important;
    background: var(--ci-surface) !important;
    border: 1px solid var(--ci-border) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 18px -2px rgba(16, 24, 40, 0.04), 0 2px 6px -1px rgba(16, 24, 40, 0.02) !important;
}

.ci-kpi-card:hover {
    transform: translateY(-3px) !important;
    border-color: rgba(37, 99, 235, 0.3) !important;
}

.ci-kpi-primary:hover {
    box-shadow: 0 12px 28px -4px rgba(37, 99, 235, 0.12), 0 4px 12px -2px rgba(37, 99, 235, 0.06) !important;
    border-color: rgba(37, 99, 235, 0.4) !important;
}

.ci-kpi-success:hover {
    box-shadow: 0 12px 28px -4px rgba(22, 163, 74, 0.12), 0 4px 12px -2px rgba(22, 163, 74, 0.06) !important;
    border-color: rgba(22, 163, 74, 0.4) !important;
}

.ci-kpi-info:hover {
    box-shadow: 0 12px 28px -4px rgba(8, 145, 178, 0.12), 0 4px 12px -2px rgba(8, 145, 178, 0.06) !important;
    border-color: rgba(8, 145, 178, 0.4) !important;
}

.ci-kpi-indigo:hover {
    box-shadow: 0 12px 28px -4px rgba(79, 70, 229, 0.12), 0 4px 12px -2px rgba(79, 70, 229, 0.06) !important;
    border-color: rgba(79, 70, 229, 0.4) !important;
}

.ci-kpi-secondary:hover {
    box-shadow: 0 12px 28px -4px rgba(100, 116, 139, 0.12), 0 4px 12px -2px rgba(100, 116, 139, 0.06) !important;
    border-color: rgba(100, 116, 139, 0.4) !important;
}
.ci-kpi-danger:hover {
    box-shadow: 0 12px 28px -4px rgba(220, 38, 38, 0.12), 0 4px 12px -2px rgba(220, 38, 38, 0.06) !important;
    border-color: rgba(220, 38, 38, 0.4) !important;
}