:root {
    --bg: #f3f5f3;
    --rd: 20px;
    --title: #000263;
    --text: #000000;
    --bgbtn: #1a3580;
    --bgbtnHover: #2b57d1;
    --colorBtn: #fff;
    --hlg: #adadad;
    --headerHover: #d2e5ff;
    --green: #238f0d;
    --red: #ac0707;
    --warning: #cebc1a;
}

html,
body {
    background-color: #e5ebe6;
    font-family: "Montserrat";
    color: var(--text);
    height: 100%;
}

input {
    height: 30px;
    border: 0px;
    border-radius: 15px;
    box-shadow: 0 0 10px 1px var(--hlg);
    padding-left: 15px;
    font-size: 15px;
    text-transform: uppercase;
}

input[type="password"],
input#username,
input#userName,
input[name*="user"],
input[name*="pass"],
.no-uppercase {
    text-transform: none !important;
}

input:hover {
    box-shadow: 0 0 15px 3px var(--hlg);
}

textarea {
    border: 0px;
    border-radius: var(--rd);
    box-shadow: 0 0 10px 1px var(--hlg);
    padding-left: 15px;
    font-size: 15px;
    text-transform: uppercase;
}

textarea:hover {
    box-shadow: 0 0 15px 3px var(--hlg);
}

select {
    height: 30px;
    border: 0px;
    border-radius: 15px;
    box-shadow: 0 0 10px 1px var(--hlg);
    padding-left: 15px;
    font-size: 15px;
    text-transform: uppercase;
}

select:hover {
    box-shadow: 0 0 15px 3px var(--hlg);
}

label {
    margin-bottom: 10px;
    margin-top: 10px;
}

h1 {
    color: var(--title);
    font-size: 45px;
    font-weight: 600;
}

h3 {
    font-weight: 400;
}

.title {
    color: var(--title);
}

/* Botones */
.main-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--bgbtn);
    color: var(--colorBtn);
    border: none;
    border-radius: 20px;
    margin: 0;
    font-size: 15px;
    cursor: pointer;
}

.main-btn:hover {
    background-color: var(--bgbtnHover);
}

.container-layout {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    min-width: 220px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 15px;
}

.sidebar-top {
    flex-grow: 1;
}

.sidebar-top .logo {
    display: block;
    margin: 0 auto 20px auto;
    width: 70px;
    gap: 10px;
}

.nav-menu {
    list-style: none;
    margin: 0%;
    padding: 0%;
}

.nav-menu li {
    position: relative;
    margin-bottom: 10px;
}

/* Ocultar los submenús inicialmente */
/* .nav-menu .menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
} */
/* Cuando el submenú está activo */
.nav-menu .menu.show {
    max-height: 500px;
    /* lo suficiente para mostrar todos los elementos */
}

.nav-menu a {
    display: block;
    text-decoration: none;
    color: var(--title);
    padding: 5px;
    transition: background 0.3s;
    border-radius: 0px 20px 20px 0px;
}

.dropdown-title {
    font-weight: 600;
    cursor: pointer;
}

.nav-menu a:hover,
.nav-menu li:hover>a {
    background-color: var(--headerHover);
    font-weight: 600;
    color: #010244;
}

/* Sidebar - Submenús */
.menu {
    list-style: none;
    padding-left: 15px;
    padding-top: 5px;
}

.dropdown:hover .menu {
    display: block;
}

.menu a {
    font-size: 14px;
    padding: 5px 0px 1px 10px;
    background: transparent;
}

.menu a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Estilo para el enlace activo */
.menu a.active-link {
    background-color: var(--headerHover);
    color: #010244 !important;
    font-weight: 700;
    border-radius: 0px 20px 20px 0px;
    font-size: 15px;
}

.logout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-items: center;
    text-align: center;
    gap: 10px;
    font-size: 25px;
    color: var(--title);
}

/* HeaderPag - Boton agregar nuevo */
.addBTN {
    display: flex;
    justify-content: center;
    width: auto;
    padding: 0px 40px;
    height: 40px;
    align-items: center;
    gap: 10px;
}

/* Contenido */
.content-right {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100vh;
    min-height: 900px;
    min-width: 1100px;
    overflow: hidden;
}

.page-content {
    display: flex;
    padding: 10px 20px;
    flex: 1;
    overflow: hidden;
}

/* Titulo de paginas */
.page-header {
    background-color: #fff;
    height: 50px;
    align-content: center;
    border-left: 2px groove;
    border-color: var(--bg);
    padding: 10px 0px;
}

.page-header h1 {
    font-size: 25px;
    margin: 0%;
    margin-left: 30px;
}

/* Paginas */
.page {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100vh;
}

.tab-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    margin-top: 30px;
}

/* Tablas */
.dataTables_wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background-color: #fff;
    border-radius: var(--rd);
    width: 100%;
}

.data-table table {
    width: 100%;
}

.table.dataTable td {
    white-space: nowrap;
    /* ❌ no saltos de línea */
    overflow: hidden;
    /* corta el contenido */
    text-overflow: ellipsis;
    /* … */
}

.data-table thead th {
    text-align: left;
    color: #444444;
    font-size: 14px;
    font-weight: 500;
    padding: 15px 12px;
    border-bottom: 1px solid #e0e0e0;
    /* white-space: nowrap; */
}

/* Tabla */
.data-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table tbody td {
    padding: 15px 12px;
    font-size: 14px;
    color: #333;
}

/* Tablas - Estilo del input del buscador */
.dataTables_filter input {
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    color: #333;
}

.dataTables_filter input:focus {
    outline: none;
    border-color: var(--bgbtn);
    box-shadow: 0 0 5px 1px var(--bgbtn);
}

/* Tablas - Header */
.table-header {
    width: 100%;
    height: 10% !important;
    justify-content: end;
}

.row {
    width: 100%;
    padding: 0px 0px 0px 25px;
    height: 100%;
}

.dataTable {
    width: 100% !important;
}

.col-table-search {
    width: 100% !important;
}

/* Tablas -footer */
.table-footer {
    margin-top: auto;
    /* Empuja el paginador al final */
    justify-content: center;
    width: 100%;
    border-radius: var(--rd);
    height: 10%;
}

.page-item.active .page-link {
    background-color: var(--bgbtn);
    border-color: var(--bgbtn);
    border-radius: var(--rd);
}

.page-link {
    border: none;
}

.table-pag {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Tablas - Botones */
.icon-btn {
    border-radius: 10px;
    background-color: var(--bgbtn);
    color: #fff;
}

.down-btn {
    border-radius: 10px;
    background-color: var(--red);
    color: #fff;
    border: none;
    padding: 2px 8px;
}

.active-btn {
    border-radius: 10px;
    background-color: var(--green);
    color: #fff;
    border: none;
    padding: 2px 8px;
}

.icon-btn:hover {
    background-color: var(--bgbtnHover);
}

.down-btn:hover {
    background-color: darkred;
}

.active-btn:hover {
    background-color: darkgreen;
}

/* Modal */
.modal {
    background-color: #75757565;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
}

.modal-content {
    background-color: #fff;
    text-align: center;
    border-radius: var(--rd);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    /* ocupa 90% en pantallas chicas */
    max-width: 950px;
    /* límite para que no crezca demasiado */
    max-height: 90vh;
    /* que no sobrepase el alto de pantalla */
    min-height: 550px;
    overflow-y: auto;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.form-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.modal-header h4 {
    font-weight: 700;
    color: var(--title);
    margin-top: 20px;
}

.modal-header {
    border: none;
    padding: 0;
    justify-content: space-between;
    /* título a la izq, botón a la der */
    padding-left: 20px;
    border-bottom: 1px solid #ddd;
}

.icon-close {
    background: rgb(185, 0, 0);
    color: white;
    border: none;
    border-radius: 20px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s ease;
}

.icon-close:hover {
    background: darkred;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 10px;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #ddd;
}

.nav-item {
    margin: 0 15px;
    background-color: var(--bg);
    padding: 5px 20px;
    border-radius: var(--rd);
}

.nav-item:hover {
    color: var(--title);
    font-weight: 600;
    cursor: pointer;
}

.nav-item.active {
    background: var(--bgbtn);
    color: #fff;
    font-weight: 600;
}

.form-section {
    display: flex;
    flex-direction: column;
    padding: 20px;
    width: 100%;
}

.content-hz {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem 2.5rem;
    width: 100%;
}

.field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* justify-content: end; ******************************************************/
    min-width: 30vh;
    width: 100%;
}

.entry {
    width: 100%;
}

.entry:focus {
    outline: none;
}

input[type="file"].entry {
    font-size: 10px;
    padding: 5px;
}

.modal-body {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    padding: 0;
    margin-top: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.modal-footer .main-btn,
.modal-footer button {
    width: 100%;
    border: none !important;
    outline: none !important;
}

/* Modal - Responsivo */
@media (max-width: 1055px) {
    .content-hz {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columnas en tablets */
    }

    .modal-content {
        height: auto;
        max-height: 500px;
        overflow-y: auto;
    }
}

@media (max-width: 700px) {
    .content-hz {
        grid-template-columns: 1fr;
        /* 1 columna en celulares */
    }

    .modal-content {
        height: auto;
    }
}

/* Swichs */
.tab-switch {
    display: inline-flex;
    background: #f5f9f7;
    /* color de fondo */
    border-radius: 10px;
    /* bordes redondeados */
    padding: 4px;
    padding: 10px;
    gap: 10px;
}

.tab {
    border: none;
    background: transparent;
    padding: 8px 18px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #444;
    transition: all 0.2s ease;
}

.tab:hover {
    color: var(--title);
}

.tab.active {
    background: var(--bgbtn);
    color: #fff;
    font-weight: 700;
}

.tab:focus {
    outline: none;
}

/* loading */
.spinner {
    display: none;
    /* Esta linea se quitara */
    position: fixed;
    width: 230px;
    left: 45%;
    top: 40%;
    z-index: 9999;
}

.field-info {
    display: flex;
    align-items: baseline;
}

.field-info input {
    background: none;
    border: none;
    box-shadow: none;
    font-weight: 700;
    font-size: 20px;
}

/* Adaptarlo a celulares */
@media (max-width: 850px) {
    .container-layout {
        height: 100%;
    }
}

.logoAst {
    width: 100px;
}

/* Botones de tablas */
.btn-secondary {
    background-color: var(--bgbtn);
    margin-top: 10px;
    border-radius: var(--rd);
}

.btn-secondary:hover {
    background-color: var(--bgbtnHover);
}

/* ==========================================
   REGLAS UNIVERSALES DE DISEÑO Y COMPONENTES
   ========================================== */

/* 1. Visibilidad y Utilidades */
.hidden {
    display: none !important;
}

.table-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* 2. Barras de Acciones de Página */
.page-actions,
[class$="-actions"] {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

/* 3. Contenedores de Filtros Universales (Estados, Proyectos, Búsquedas) */
.filter-container,
.status-filter-container,
.project-filter-container,
[class*="-filter-container"] {
    padding: 15px 25px 5px 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-container label,
.status-filter-container label,
.project-filter-container label,
[class*="-filter-container"] label {
    margin: 0;
    font-weight: 600;
    font-size: 15px;
    color: var(--title);
}

.filter-container select,
.filter-container input,
.status-filter-container select,
.status-filter-container input,
.project-filter-container select,
.project-filter-container input,
[class*="-filter-container"] select,
[class*="-filter-container"] input {
    min-width: 180px;
    margin: 0;
}

/* 4. Bloques de Información de Cabecera (Cliente, Proyecto, Empleado) */
.info_client,
.info_employee,
.info_project,
[class*="info_"] {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
}

.info_client h3,
.info_employee h3,
.info_project h3,
[class*="info_"] h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--title);
}

.info_client input,
.info_employee input,
.info_project input,
[class*="info_"] input {
    background: transparent;
    border: none;
    box-shadow: none;
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
}

/* 5. Colección de Botones DataTables & ColVis */
.buttons-collection {
    background-color: var(--bgbtn) !important;
    border-color: var(--bgbtn) !important;
    border-radius: 10px !important;
}

div.dt-button-collection .dt-button {
    background: white !important;
    color: var(--title) !important;
    border-radius: 5px !important;
}

div.dt-button-collection .dt-button.active {
    background: var(--headerHover) !important;
    font-weight: 600;
}