/* ==========================================================================
   VAIA App — Global Styles
   ========================================================================== */


/* --- Design Tokens --- */
:root {
    --tblr-font-sans-serif: 'Inter Var', -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif;
    --vaia-radius: 12px;
    --vaia-radius-lg: 14px;
    --vaia-btn-radius: 10px;
    --vaia-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    --vaia-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --vaia-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --separator-color: rgba(4, 32, 69, 0.14);
}

[data-bs-theme="dark"] {
    --separator-color: var(--tblr-dark-mode-border-color-translucent);
}


/* --- Base --- */
html {
    scrollbar-gutter: stable;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--tblr-body-bg);
    padding-right: 1rem !important;
}

.container-fluid {
    min-width: 99%;
}


/* --- Cards --- */
.card {
    border-radius: var(--vaia-radius-lg);
    box-shadow: var(--vaia-shadow-sm);
    transition: var(--vaia-transition);
}

a.card:hover,
.card-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--vaia-shadow-hover);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(4, 32, 69, 0.05);
    padding: 1.25rem 1.5rem;
}

.card-title {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

[data-bs-theme="dark"] .card {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}


/* --- Buttons --- */
.btn {
    border-radius: var(--vaia-btn-radius);
    transition: var(--vaia-transition);
}

.btn-primary {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


/* --- Form Controls --- */
.form-control,
.form-select,
.ts-control {
    border-radius: var(--vaia-radius);
    padding: 0.5rem 0.75rem;
    transition: var(--vaia-transition);
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 3px rgba(var(--tblr-primary-rgb), 0.15);
}

.myTablerForm label {
    font-weight: bold;
    margin-bottom: 2px;
}

.myTablerForm .helptext {
    color: var(--tblr-secondary-color);
    margin-bottom: 3px;
}

.myTablerForm .errorlist {
    color: var(--tblr-danger);
}


/* --- Tables --- */
.table thead th {
    background-color: #f8fafc;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: var(--tblr-secondary);
}

.table tbody td {
    vertical-align: middle;
    padding: 0.75rem 0.75rem;
}

[data-bs-theme="dark"] .table thead th {
    background-color: rgba(0, 0, 0, 0.2);
}


/* --- Badges --- */
.badge {
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.35em 0.6em;
}


/* --- Page Header --- */
.page-header {
    margin-bottom: 2rem;
}

.page-pretitle {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}


/* --- Breadcrumbs --- */
.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--tblr-secondary);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
}

.breadcrumb-item a:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.breadcrumb-item.active {
    color: var(--tblr-muted);
}

.breadcrumb-arrows a i {
    font-size: 1.1em;
    vertical-align: text-bottom;
    color: var(--tblr-muted);
}

.breadcrumb-arrows a i:hover {
    color: var(--tblr-primary);
}


/* --- Litepicker (date range) --- */
.is-in-range {
    background: #000;
}

body[data-bs-theme="dark"] .litepicker .container__days .day-item.is-in-range {
    background-color: #1e1e1e;
    color: #f0f0f0;
}


/* --- Tom-Select (flash prevention) --- */
select.tom-select {
    opacity: 0;
    pointer-events: none;
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
}

.ts-wrapper {
    visibility: visible;
}

.ts-wrapper:not(.ts-initialized) {
    min-height: 38px;
}


/* --- Dark mode: scrollbar --- */
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
}


/* --- Navigation / Menu (relocalizado desde menu.html, sin cambios) --- */

    /* 2. Estilo de los Enlaces (Píldoras) */
    .navbar-nav .nav-link {
        padding: 0.6rem 1rem;
        margin: 0 0.25rem; /* Espacio entre items */
        color: var(--tblr-secondary);
        position: relative;
        display: flex;
        align-items: center;
        border-radius: var(--vaia-btn-radius);
    }

    /* Iconos */
    .nav-link-icon {
        --tblr-icon-size: 1.25rem;
        width: var(--tblr-icon-size);
        height: var(--tblr-icon-size);
        font-size: var(--tblr-icon-size);
        vertical-align: bottom;
        stroke-width: 1.5;
        width: 1.25rem;
        height: 1.25rem;
        margin-right: .5rem;
        color: inherit;
        margin-bottom: 0.5rem;
    }


    .navbar-nav .nav-link:hover {
        color: var(--tblr-primary);
    }

    .navbar-nav .nav-link:hover .nav-link-icon {
        opacity: 1;
    }

    .navbar-nav .nav-item.active .nav-link-icon {
        color: var(--tblr-primary);
        opacity: 1;
    }

    .nav-link-title {
        letter-spacing: -0.01em;
    }

    .navbar-nav .nav-item.active .nav-link-title {
        color: var(--tblr-primary);
        opacity: 1;
    }

    .dropdown-toggle::after {
        display: none;
    }

    .dropdown-toggle-icon {
        margin-top: 0.2rem;
        margin-left: 0.5rem;
        font-size: 0.85rem;
        opacity: 0.5;
    }

    .dropdown-item {
        color: var(--tblr-secondary);
        border-radius: calc(var(--vaia-btn-radius) - 2px);
        padding: 0.5rem 1rem;
        margin-bottom: 2px;
    }

    .dropdown-item:hover {
        color: var(--tblr-primary);
    }

    .dropdown-header {
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-weight: 700;
        color: var(--tblr-muted);
        padding: 0.5rem 1rem;
        margin-bottom: 0.25rem;
    }


/* ==========================================================================
   Shared components — base Tabler + toque VAIA
   Criterio: preferir componentes de Tabler estilados acá, en lugar de CSS a
   medida por template. Reusable en cualquier pantalla.
   ========================================================================== */


/* --- Etiqueta de sección (Tabler .subheader) --- */
.subheader {
    letter-spacing: 0.06em;
}


/* --- Listas accionables (Tabler .list-group-item-actions) ---
   Reemplaza worklists a medida tipo .row-item. Sirve para cualquier lista
   clickeable: llamadas, agentes, resultados. El acento de marca al hover es
   la firma VAIA (inset, sin reflow). */
.list-group-item-actions,
.list-group-item-actions:hover {
    text-decoration: none;
}

.list-group-item-actions {
    transition: var(--vaia-transition);
}

.list-group-item-actions:hover {
    background: var(--tblr-bg-surface-secondary, rgba(0, 0, 0, .02));
    box-shadow: inset 2px 0 0 var(--tblr-primary);
}


/* --- Filtros en offcanvas (patrón reusable; movido desde filter_offcanvas.css) --- */
.offcanvas-body {
    display: flex;
    flex-direction: column;
}

.offcanvas-filters-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.offcanvas-footer-actions {
    position: sticky;
    bottom: 0;
    background: var(--tblr-body-bg);
    border-top: 1px solid var(--separator-color);
    padding: 1rem 1.5rem;
    margin-top: auto;
    z-index: 10;
}

[data-bs-theme="dark"] .offcanvas-footer-actions {
    background: var(--tblr-dark);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
}

.filter-badge-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 10px;
    background: var(--tblr-danger);
    color: #fff;
    border: 2px solid var(--tblr-body-bg);
}

.offcanvas-backdrop {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

/* Litepicker por encima del offcanvas (movido desde el inline de dashboard.html) */
.litepicker {
    z-index: 1060 !important;
}


/* --- Checkbox en fila (paneles de filtros) — antes .form-check-vaia comentado --- */
.form-check-vaia {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.form-check-vaia input[type="checkbox"] {
    cursor: pointer;
}

.form-check-vaia span {
    font-weight: 500;
}




* --- Texto truncado a 2 líneas (justificaciones, descripciones) --- */
.vaia-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
 
 
/* --- Tablas crudas de pandas (reportes: {{ df_table|safe }}) ---
   Hace que la salida .dataframe de pandas se vea como una tabla de VAIA,
   sin los bordes por defecto. Reusable en cualquier reporte. */
.table-responsive .dataframe {
    width: 100%;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    font-size: 0.875rem;
}
 
.table-responsive .dataframe th,
.table-responsive .dataframe td {
    padding: 0.5rem 0.75rem;
    border: 0;
    border-bottom: 1px solid var(--tblr-border-color);
    white-space: nowrap;
    vertical-align: middle;
}
 
.table-responsive .dataframe thead th {
    background: var(--tblr-bg-surface-secondary, #f8fafc);
    color: var(--tblr-secondary);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    font-weight: 600;
    border-bottom: 2px solid var(--tblr-border-color);
    position: sticky;
    top: 0;
    z-index: 1;
}
 
.table-responsive .dataframe tbody tr:hover {
    background: var(--tblr-bg-surface-secondary, rgba(0, 0, 0, .02));
}
