﻿@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
}

body {
    background-color: #f4f6f9;
    color: #333;
    font-size: 12px;
}

html, body {
    height: 100% !important;
    margin: 0;
    padding: 0;
}

.main-header {
    background-color: #1e429f;
    color: white;
    padding: 10px 25px;
    border-bottom: 5px solid #16347a;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    background: white;
    color: #009fe3;
    padding: 8px;
    border-radius: 4px;
    font-size: 24px;
    height: 45px;
    width: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.logo-text {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
}

.divider {
    width: 1px;
    height: 40px;
    background-color: rgba(255,255,255,0.3);
    margin: 0 5px;
}

.system-title {
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
}

.mobile-burger-btn {
    display: none !important;
}

.mobile-controls-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Sección de Usuario */
.user-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    text-align: right;
    line-height: 1.2;
}

.user-name {
    display: block;
    font-weight: 700;
    font-size: 13px;
}

.user-role {
    font-size: 11px;
    opacity: 0.9;
}

.user-role-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    font-family: inherit;
}

    .user-role-btn:hover {
        color: #ffffff;
    }

.user-role-dd {
    position: relative;
    display: inline-block;
}

.user-role-menu {
    right: 0;
    left: auto !important;
    min-width: 160px;
}

.user-avatar {
    background-color: #ddd;
    color: #555;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.sirce-content-shell {
    background-color: white;
    padding: 25px 30px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    min-height: calc(100vh - 120px);
}

.page-title {
    color: #204592;
    font-size: 20px;
    margin-bottom: 30px;
    font-weight: 700;
}

.filters-container {
    display: flex;
    justify-content: space-between;
    gap: 80px;
    margin-bottom: 30px;
}

.filter-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    align-items: center;
}

    .form-group label {
        width: 150px;
        font-weight: 600;
        color: #444;
        font-size: 13px;
    }

    .form-group select,
    .form-group input {
        flex: 1;
        padding: 8px 10px;
        border: 1px solid #ccc;
        border-radius: 4px;
        background-color: #f7f7f7;
        font-size: 13px;
        color: #333;
    }

.button-group {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 5px;
}

.sirce-btn {
    border: none;
    padding: 9px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: background 0.2s;
}

.btn-primary {
    background-color: #00a0df;
    color: white;
}

    .btn-primary:hover {
        background-color: #008cc3;
    }

.action-bar {
    border-top: 1px solid #eee;
    padding-top: 25px;
    padding-bottom: 25px;
    display: flex;
    gap: 15px;
}

.action-pill {
    background-color: #00a0df;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

    .action-pill i {
        font-size: 14px;
    }

.table-container {
    overflow-x: auto;
}
.sirce-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.sirce-thead th {
    background-color: #274e9b;
    color: white;
    padding: 12px 5px;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    border: 1px solid #274e9b;
}

.sirce-tbody td {
    padding: 10px 5px;
    text-align: center;
    border: 1px solid #e0e0e0;
    color: #333;
}

.sirce.tbody td:nth-child(3) {
    text-align: left;
    padding-left: 10px;
}

.sirce-tbody tr:hover {
    background-color: #f9f9f9;
}


.row-error {
    background-color: #ffdadb !important;
}


.icon-blue {
    color: #00a0df;
    font-size: 16px;
    cursor: pointer;
}

.icon-green {
    color: #28a745;
    font-size: 16px;
}

.icon-orange {
    color: #ffc107;
    font-size: 16px;
}

.icon-red {
    color: #dc3545;
    font-size: 16px;
}


.sirce-table a {
    color: #00a0df;
    text-decoration: underline;
    font-size: 11px;
}


.pagination-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    font-size: 12px;
}

.results-text {
    color: #333;
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    gap: 5px;
}

.page-btn {
    border: 1px solid #ddd;
    background: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: #555;
    min-width: 32px;
}

    .page-btn.btn-blue {
        background-color: #00a0df;
        color: white;
        border-color: #00a0df;
    }

/* ---------- DataTables: paginación a la derecha ---------- */
.dataTables_paginate {
    text-align: right !important;
}

    .dataTables_paginate .pagination {
        justify-content: flex-end !important;
        margin: 2px 0 !important;
        white-space: nowrap !important;
    }

    .dataTables_paginate .paginate_button {
        padding: 0 !important;
        margin-left: 0 !important;
    }

/* menus*/

.sirce-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 18px;
}

.sirce-nav-link {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 4px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    .sirce-nav-link:hover {
        background: rgba(255,255,255,0.12);
        color: #fff;
    }

/* Botón que parece link */
.sirce-nav-btn {
    background: transparent;
    border: none;
    cursor: pointer;
}

.sirce-main {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding-left: clamp(12px, 2vw, 40px);
    padding-right: clamp(12px, 2vw, 40px);
    padding-top: 18px;
    padding-bottom: 24px;
}

/* En pantallas grandes, que no se vaya "full full", sino elegante */
@media (min-width: 1400px) {
    .sirce-main {
        padding-left: 40px;
        padding-right: 40px;
    }
}

/* para el SPINER OVERLAY */
.app-spinner {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.app-spinner__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.25);
}

.app-spinner__box {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    background: #fff;
    border-radius: 14px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,.2);
}

.app-spinner__text {
    font-size: 14px;
}


/* DataTables*/

.table-container {
    overflow-x: auto;
}

:root {
    --dt-primary: #274e9b;
    --dt-primary-contrast: #ffffff;
    --dt-border: #e0e0e0;
    --dt-row-hover: #f9f9f9;
    --dt-row-error: #ffdadb;
    --dt-text: #333333;
    --dt-font-size: 12px;
    --dt-th-font-size: 11px;
    --dt-link: #00a0df;
}

table.datatable {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--dt-font-size);
    color: var(--dt-text);
}


    /* Encabezados */
    table.datatable thead th {
        background-color: var(--dt-primary);
        color: var(--dt-primary-contrast);
        padding: 12px 5px;
        text-align: center;
        font-weight: 600;
        font-size: var(--dt-th-font-size);
        border: 1px solid var(--dt-primary);
        white-space: nowrap;
    }

    /* Celdas */
    table.datatable tbody td {
        padding: 6px 4px !important;
        text-align: center;
        border: 1px solid var(--dt-border);
        vertical-align: middle;
    }

        /* Alinear una columna específica a la izquierda (ver utilidades abajo) */
        /* Ejemplo: cuarta columna a la izquierda */
        table.datatable tbody td:nth-child(4).text-left-col,
        table.datatable tbody td.text-left {
            text-align: left;
            padding-left: 10px;
        }

    /* Hover de fila */
    table.datatable tbody tr:hover {
        background-color: var(--dt-row-hover);
    }

    /* Fila con error (aplica la clase .row-error en tu render) */
    table.datatable tbody tr.row-error td {
        background-color: var(--dt-row-error) !important;
    }

    /* Enlaces más pequeños dentro de la tabla */
    table.datatable a {
        color: var(--dt-link);
        text-decoration: underline;
        font-size: 11px;
    }

/* ---------- DataTables: paginación a la derecha ---------- */
div.dataTables_wrapper div.dataTables_paginate {
    text-align: right !important;
}

    div.dataTables_wrapper div.dataTables_paginate ul.pagination {
        justify-content: flex-end !important;
    }

/* ---------- Utilidades opcionales ---------- */
/* Alineaciones rápidas por celda o columna */
.text-left {
    text-align: left !important;
}

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

/* Tamaños de fuente */
.text-xs {
    font-size: 10px !important;
}

.text-sm {
    font-size: 12px !important;
}

.text-md {
    font-size: 14px !important;
}

/* Estados */
.row-error td {
    background-color: var(--dt-row-error) !important;
}

/* Tema oscuro (opcional) */
.dark table.datatable thead th {
    background-color: #1f2a44;
    border-color: #1f2a44;
}

.dark table.datatable,
.dark table.datatable tbody td {
    color: #e6e6e6;
    border-color: #3a3a3a;
}

    .dark table.datatable tbody tr:hover {
        background-color: #2a2a2a;
    }


.app-spinner-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-spinner-box {
    min-width: 210px;
    max-width: 280px;
    padding: 22px 26px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    text-align: center;
}

.app-spinner__icon {
    width: 2.5rem;
    height: 2.5rem;
}

.app-spinner__text {
    font-weight: 600;
    color: #334155;
    font-size: 0.95rem;
}

/* Cards de Galería Horizontal - HISTORIAL */
/* Tarjeta con dimensiones fijas exactas de 170x120 */
.adjunto-card-thumb {
    width: 140px !important;
    min-width: 140px;
    height: 120px !important;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none !important;
    position: relative !important;
}

    .adjunto-card-thumb:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    /* Área de previsualización (75px de alto) */
    .adjunto-card-thumb .thumb-preview {
        height: 75px !important;
        width: 100% !important;
        background-color: #f1f5f9;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

        /* Imagen escalada sin recortes ni deformación */
        .adjunto-card-thumb .thumb-preview img {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            object-fit: contain; /* Muestra el contenido completo del documento/imagen */
        }

    /* Menú desplegable de 3 puntos (Opciones) */
    .adjunto-card-thumb .thumb-actions {
        position: absolute;
        top: 4px;
        right: 4px;
        z-index: 10;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .adjunto-card-thumb:hover .thumb-actions {
        opacity: 1;
        visibility: visible;
    }

    .adjunto-card-thumb .btn-thumb-menu {
        width: 24px;
        height: 24px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(255, 255, 255, 0.9);
        border: 1px solid #cbd5e1;
        color: #334155;
        border-radius: 50%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

        .adjunto-card-thumb .btn-thumb-menu:hover {
            background-color: #ffffff;
            color: #0f172a;
        }

/* Chat Item */
.chat-avatar {
    width: 36px;
    height: 36px;
    background-color: #4f46e5;
    color: white;
    font-weight: bold;
    font-size: 13px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-card-body {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.chat-img-preview {
    width: 120px;
    height: 120px;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    cursor: pointer;
}

/* =========================================================
   RESPONSIVE LIMPIO SIRCE
   Mantiene header compacto en desktop
   y responsive en tablet/mobile
   ========================================================= */

/* ancho principal */
.sirce-main {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding-left: clamp(12px, 2vw, 40px);
    padding-right: clamp(12px, 2vw, 40px);
    padding-top: 18px;
    padding-bottom: 24px;
}

/* ===== DESKTOP: mantener header compacto ===== */
.main-header {
    background-color: #1e429f;
    color: white;
    padding: 10px 25px;
    border-bottom: 5px solid #16347a;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 15px;
}

.user-controls-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    overflow: visible;
}

.logo-icon {
    flex: 0 0 auto;
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
    flex: 0 0 auto;
}

.system-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 auto;
}

.sirce-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 14px;
    flex-wrap: nowrap;
    width: auto;
    padding-top: 0;
    border-top: 0;
    overflow: visible;
    position: relative;
    z-index: 20;
}

.sirce-nav-link {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 4px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

    .sirce-nav-link:hover {
        background: rgba(255,255,255,0.12);
        color: #fff;
    }

.sirce-nav-btn {
    background: transparent;
    border: none;
    cursor: pointer;
}

.sirce-nav-dd {
    position: relative;
    overflow: visible;
}

    .sirce-nav-dd .sirce-nav-menu {
        display: none;
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        min-width: 190px;
        background: #fff;
        border: 1px solid #e6e6e6;
        border-radius: 8px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.12);
        z-index: 9999;
    }

    .sirce-nav-dd.open .sirce-nav-menu {
        display: block;
    }

ul.nav-tabs,
.nav-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
}

    ul.nav-tabs .nav-item,
    .nav-tabs .nav-item {
        flex: 0 0 auto !important;
    }

    ul.nav-tabs::-webkit-scrollbar {
        display: none;
    }

ul.nav-tabs {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sirce-nav-menu a {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
    color: #333;
    font-size: 12px;
    font-weight: 600;
}

    .sirce-nav-menu a:hover {
        background: #f4f6f9;
    }

/* filtros */
.filters-container {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
    flex-wrap: nowrap;
}

.filter-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sirce-form-group {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.form-group label {
    width: 150px;
    min-width: 150px;
    font-weight: 600;
    color: #444;
    font-size: 13px;
}

.form-group select,
.form-group input {
    flex: 1 1 auto;
    min-width: 0;
}

/* botones */
.action-bar,
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.button-group {
    justify-content: flex-end;
}

.table-container,
.table-responsive {
    width: 100%;
    margin-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#tblUsua td:last-child {
    white-space: nowrap;
}

.btn-outline-amarillo {
    color: #808279;
    border-color: #ffe066; 
    background-color: transparent;
}

    .btn-outline-amarillo:hover {
        color: #000000;
        background-color: #ffe066;
        border-color: #ffe066;
    }

    .btn-outline-amarillo:focus,
    .btn-outline-amarillo.focus {
        box-shadow: 0 0 0 0.2rem rgba(255, 224, 102, 0.5) !important;
    }


.sirce-logout {
    margin: 0 !important;
}

.sirce-logout-btn {
    width: 38px !important;
    height: 38px !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    background: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-shadow: none !important;
}

    .sirce-logout-btn:hover {
        background: rgba(255, 255, 255, 0.28) !important;
    }


@media (min-width: 1300px) {
    .main-header {
        height: 70px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0 25px;
    }

    .header-top-row {
        width: auto;
    }

    .mobile-controls-row {
        display: none !important;
    }

    .navigation-block.collapse:not(.show),
    .navigation-block {
        display: flex !important;
        align-items: center;
        flex: 1;
        height: auto !important;
    }

    .sirce-nav {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-left: auto !important;
        margin-right: 25px !important;
    }

    .mobile-burger-btn {
        display: none !important;
        margin-left: auto;
        gap: 12px;
        margin-left: 0 !important;
    }
}

@media (max-width: 1299.98px) {
    .main-header {
        height: auto !important;
        padding: 10px 15px;
    }

    .header-top-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .user-section-desktop {
        display: none !important;
    }

    .user-section-mobile {
        display: flex !important;

    }
    .mobile-burger-btn {
        display: block !important;
        background: transparent;
        border: none;
        color: white;
    }

    .navigation-block {
        width: 100%;
        margin-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        padding-top: 10px;
    }

    .sirce-nav {
        display: flex;
        flex-direction: row;
        gap: 10px;
        padding-bottom: 5px;
    }
}

@media (max-width: 768px) {
    .system-title,
    .divider {
        display: none !important;
    }

    .user-info {
        display: none; 
    }

    .logo-text {
        font-size: 20px;
    }

    .divider {
        display: none;
    }
}