:root {
    --primary-green: #127b75; /* Darkened for accessibility (4.5:1 on white) */
    --dark-green: #0d5e59;    /* Darkened for better contrast with white text */
    --light-green: #e9f5f4;
    --danger-color: #e23134;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    font-size: 0.875rem;
    background: linear-gradient(180deg, #81cec7 0%, #d5efed 100%);
    display: flex;
    flex-direction: column;
}

/* ----- NAVBAR PRINCIPAL ----- */
.navbar-custom {
    background: var(--dark-green);
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    flex-shrink: 0;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}
.navbar-custom .navbar-brand {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0;
}
.navbar-custom .navbar-brand img {
    height: 40px;
    filter: brightness(0) invert(1);
}

.user-nav-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2); /* Darker background for white text contrast */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
}
.user-nav-label {
    padding: 0.35rem 0.75rem;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}
.user-nav-logout {
    padding: 0.35rem 0.6rem;
    color: white;
    background: transparent;
    border: none;
    transition: background 0.2s;
}
.user-nav-logout:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffdada;
}

/* ----- MODULO PRINCIPAL ----- */
.module-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #fff;
}

/* ----- NAV PILLS ----- */
.nav-pills-modern {
    background: #f8fbfa;
    padding: 0.6rem 1.5rem;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    justify-content: center; 
    gap: 0.75rem;
    overflow-x: auto;
    flex-shrink: 0;
}

.nav-pills-modern .nav-link {
    color: #555;
    border-radius: 30px;
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
}

.nav-pills-modern .nav-link.active {
    background-color: var(--primary-green);
    color: white;
    box-shadow: 0 4px 10px rgba(1, 140, 134, 0.2);
}

.nav-pills-modern .nav-link:hover:not(.active) {
    background-color: #fff;
    border-color: #ddd;
    color: var(--dark-green);
}

/* ----- TABLA PRINCIPAL Y SCROLL ----- */
.table-wrapper {
    flex-grow: 1; 
    overflow-y: auto; 
    overflow-x: auto;
    background: #fff;
    position: relative;
}

.table-modern {
    margin: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    position: sticky;
    top: 0;
    background: var(--light-green); 
    color: var(--dark-green);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #c9e6e4;
    z-index: 10;
    white-space: nowrap;
}

.table-modern tbody td {
    padding: 0.6rem 1rem;
    vertical-align: middle;
    color: #444;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
    white-space: nowrap;
}

.table-modern tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.table-modern tbody tr:hover td {
    background-color: #d8efec;
}

.table-modern tbody tr.table-active td {
    background-color: #c7e8e5 !important;
    border-top: 1px solid #7bc5bf;
    border-bottom: 1px solid #7bc5bf;
    color: var(--dark-green);
}

.status-pill {
    background: var(--light-green);
    color: var(--dark-green);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ----- FOOTER / TOOLBAR BOTONERA ----- */
.toolbar-bottom {
    background: var(--dark-green); 
    color: white;
    padding: 0.5rem 1.5rem; 
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem; 
    flex-shrink: 0;
    z-index: 20;
}

.toolbar-bottom-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: nowrap;
    -ms-overflow-style: none; scrollbar-width: none; overflow-x: auto;
}
.toolbar-bottom-actions::-webkit-scrollbar { display: none; }

.toolbar-bottom-actions button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1rem; 
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.toolbar-bottom-actions button:hover:not(:disabled) {
    background: var(--primary-green);
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.toolbar-bottom-actions button:disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

/* ----- ESTILOS DEL MODAL DEFINITIVO (Modal 3 mejorado) ----- */
.modal-content { border: none; border-radius: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); overflow: hidden; }

.modal-header-custom { 
    background: #fff; 
    color: var(--dark-green); 
    border-bottom: 1px solid #eaeaea; 
    padding: 1rem 1.5rem; 
}
.modal-header-custom h6 { font-size: 1.05rem; margin: 0; font-weight: 700; }
.modal-header-custom .btn-close { filter: none; opacity: 0.6; background-size: 0.8rem; transition: 0.2s; }
.modal-header-custom .btn-close:hover { opacity: 1; transform: rotate(90deg); }

/* Tabs Integrados para Modales */
.nav-tabs-custom { 
    border-bottom: 2px solid #eaeaea; 
    flex-wrap: wrap; 
}
.nav-tabs-custom .nav-link { color: #666; border: none; border-bottom: 3px solid transparent; font-weight: 600; font-size: 0.85rem; padding: 0.65rem 1.2rem; border-radius: 0; }
.nav-tabs-custom .nav-link.active { color: var(--primary-green); border-bottom-color: var(--primary-green); background: #f8fbfb; }
.nav-tabs-custom .nav-link:hover:not(.active) { border-bottom-color: #ddd; }

/* Corrección Form-Floating para que flote la etiqueta visualmente */
.form-floating > .form-control, .form-floating > .form-select { height: calc(3.4rem + 2px); padding: 1rem 0.75rem 0.25rem 0.75rem; font-size: 0.85rem; }
.form-floating > label { padding: 0.8rem 0.75rem; font-size: 0.85rem; font-weight: 600; color: #666; }

/* Botones especiales del footer del modal */
.btn-modal-footer {
    min-width: 44px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
@media (min-width: 576px) {
    .btn-modal-footer { min-width: 150px; }
}


/* ========================================================= */
/* CSS ADICIONAL PARA MENU.FRONT Y LOGIN.FRONT (THEME DAS)   */
/* ========================================================= */

.das-subnavbar {
    background: #23a89e; /* Un tono un poco mas brillante que el navbar para el sub menu */
    color: white;
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.transition-colors {
    transition: color 0.15s ease;
}
.hover-primary:hover {
    color: var(--primary-green) !important;
}

/* Menu Tiles */
.menu-tile {
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    padding: 1rem 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(0,0,0,0.05);
    height: auto;
    min-height: 80px;
    width: 100%;
}
.menu-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: var(--primary-green);
}
.menu-tile.disabled {
    filter: grayscale(100%);
    opacity: 0.6;
    cursor: not-allowed;
    background: #fdfdfd;
}
.menu-tile.disabled:hover {
    transform: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.menu-tile-icon {
    font-size: 1.5rem;
    color: var(--primary-green);
    background: var(--light-green);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.25rem;
    flex-shrink: 0;
}
.menu-tile-title {
    font-weight: 700;
    font-size: 1rem;
    color: #333;
    margin-bottom: 0;
}
/* Se elimina menu-tile-desc por pedido del usuario */


/* ========================================================= */
/* MEDIA QUERIES PARA CELULARES (OPTIMIZACION RESPONSIVE 2.0)*/
/* ========================================================= */
@media (max-width: 768px) {
    .navbar-custom .navbar-brand { font-size: 1rem; }
    
    /* Nav Pills */
    .pill-text { display: none; }
    .nav-pills-modern { padding: 0.4rem 0.5rem; justify-content: flex-start; gap: 0.4rem; -ms-overflow-style: none; scrollbar-width: none; }
    .nav-pills-modern::-webkit-scrollbar { display: none; }
    .nav-pills-modern .nav-link { padding: 0.4rem 0.7rem; border-radius: 8px; }
    .nav-pills-modern .nav-link i { font-size: 1.1rem; margin-right: 0 !important; }

    /* TOOLBAR INFERIOR CINTA */
    .toolbar-bottom { flex-direction: column; padding: 0.5rem; gap: 0.4rem; }
    .toolbar-bottom-actions {
        width: 100%; justify-content: center; gap: 0.4rem; padding-bottom: 2px;
    }
    .toolbar-bottom-actions button { font-size: 1.05rem; }

    .toolbar-bottom-info-row { display: flex !important; width: 100%; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 0.3rem; }
    .d-desktop-only { display: none !important; }

    .page-info { font-size: 0.8rem !important; letter-spacing: -0.5px; }
    .total-info { font-size: 0.75rem !important; line-height: 1.1; text-align: right; }
    .table-modern tbody td { padding: 0.5rem 0.75rem; }
}

@media (min-width: 769px) { .toolbar-bottom-info-row { display: none !important; } }

/* ========================================================= */
/* UTILIDADES REUSABLES (FONDO DE CÚPULA)                    */
/* ========================================================= */
.das-bg-dome {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100vw;
    background-image: url('MediaCupula.svg');
    background-repeat: no-repeat;
    background-position: left center;
    background-size: auto 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 1;
}

.das-bg-dome-menu {
    position: fixed;
    left: 0;
    top: 100px; /* Ajuste para iniciar post-breadcrumb aprox */
    bottom: 0;
    width: 100vw;
    background-image: url('MediaCupula.svg');
    background-repeat: no-repeat;
    background-position: left bottom;
    background-size: auto 80%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.4; /* Menos translúcida como pidió el usuario */
}
