:root {
    --erp-primary: #0d6efd;
    --erp-sidebar-active: rgba(255, 255, 255, .15);
}

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* La barra de navegacion se mantiene disponible al recorrer formularios y listados extensos. */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.cintillo-contribuyente {
    display: inline-flex;
    align-items: center;
    max-width: min(42vw, 26rem);
    white-space: nowrap;
}

.nombre-contribuyente-actual {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .cintillo-contribuyente {
        max-width: 34vw;
    }
}

.app-sidebar {
    background: var(--bs-secondary-bg) !important;
    isolation: isolate;
}

.app-sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: url("images/Fondo.jpg") center / cover no-repeat;
    opacity: .5;
    pointer-events: none;
}

.sidebar-brand {
    border-bottom-color: rgba(255, 255, 255, .15) !important;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: #fff;
}

.brand-mark {
    display: grid;
    flex: 0 0 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    line-height: 0;
    overflow: visible;
}

.brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.brand-text {
    color: #fff;
    font-weight: 700;
    letter-spacing: .025em;
}

.brand-text small {
    display: block;
    margin-top: -.2rem;
    color: rgba(255, 255, 255, .65);
    font-size: .67rem;
    font-weight: 400;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.user-avatar {
    width: 1.85rem;
    height: 1.85rem;
    border: 2px solid rgba(255, 255, 255, .75);
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
}

.user-avatar-large {
    width: 4.5rem;
    height: 4.5rem;
}

.user-photo-preview {
    width: 5rem;
    height: 5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    object-fit: cover;
}

.app-sidebar .nav-link.active {
    background: var(--erp-sidebar-active);
    color: #fff;
    box-shadow: none;
}

.app-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.app-sidebar .nav-link {
    color: rgba(255, 255, 255, .85);
}

.app-sidebar .nav-header {
    color: rgba(255, 255, 255, .55);
}

.app-content-header {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.small-box {
    overflow: hidden;
    border-radius: .65rem;
}

.small-box .small-box-icon {
    right: 1rem;
    top: 1rem;
    font-size: 4.75rem;
    opacity: .23;
}

.small-box-dashboard-values h3 {
    font-size: 2.2rem;
}

.small-box-dashboard-values p {
    margin-bottom: 0;
}

@media (max-width: 575.98px) {
    .small-box-dashboard-values h3 {
        font-size: 1.45rem;
    }
}

.card {
    border: 0;
    border-radius: .65rem;
}

.card-outline {
    border-top: 3px solid var(--bs-primary);
}

.card-header {
    padding: 1rem 1.25rem;
}

.card-title {
    font-weight: 600;
}

.callout {
    border-radius: .4rem;
}

.about-icon {
    display: grid;
    width: 3.75rem;
    height: 3.75rem;
    place-items: center;
    border-radius: .75rem;
    font-size: 1.75rem;
}

.about-logo {
    display: grid;
    width: 3.75rem;
    height: 3.75rem;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    background: #fff;
}

.about-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.about-contact {
    padding-top: 1.25rem;
    border-top: 1px solid var(--bs-border-color);
}

.login-page {
    min-height: 100vh;
    background-color: #0a63b4;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

.login-container {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1.5rem;
}

.login-card {
    width: min(100%, 26rem);
    padding: 2.25rem;
    border-radius: 1rem;
    background-color: rgba(255, 255, 255, .95);
    backdrop-filter: blur(3px);
}

.login-logo {
    width: 5rem;
    height: 5rem;
    object-fit: contain;
}

.login-footer-brand {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--bs-border-color);
    text-align: center;
}

.login-footer-brand img {
    display: block;
    width: min(100%, 13.5rem);
    height: auto;
    margin: 0 auto;
}

.roles-list {
    width: 100%;
}

.roles-list td {
    padding: .35rem .75rem .35rem 0;
    vertical-align: middle;
}

.roles-list input[type="checkbox"] {
    margin: 0 .45rem 0 0;
    vertical-align: middle;
}

.roles-list label {
    display: inline;
    font-size: .9rem;
    vertical-align: middle;
}

.modules-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: .65rem 1rem;
}

.modules-list > span {
    display: block;
    padding: .65rem .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
    background: var(--bs-tertiary-bg);
}

.modules-list input[type="checkbox"] {
    margin: .15rem .5rem 0 0;
    vertical-align: top;
}

.modules-list label {
    display: inline;
    font-size: .9rem;
}

.estado-radios input[type="radio"] {
    margin: 0 .35rem 0 0;
    vertical-align: middle;
}

.estado-radios label {
    margin: 0 1rem 0 0;
    vertical-align: middle;
}

.cabys-tree-container {
    height: clamp(20rem, calc(100vh - 20rem), 48rem);
}

/* La bandeja mantiene una sola línea y reparte las columnas de forma proporcional. */
.documentos-recibidos-grid {
    width: 100%;
    table-layout: fixed;
}

.documentos-recibidos-grid th,
.documentos-recibidos-grid td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.documentos-recibidos-grid a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Alterna las filas de datos de todos los GridView con estilo Bootstrap. */
.table > tbody > tr:nth-child(even) > th,
.table > tbody > tr:nth-child(even) > td {
    background-color: azure !important;
}

.table > tbody > tr.tabla-paginada-par > td {
    background-color: azure !important;
}

.table > tbody > tr.tabla-paginada-impar > td {
    background-color: transparent !important;
}

.correo-visor-cabecera {
    position: relative;
    align-items: flex-start;
    min-height: 3.75rem;
    padding-right: 7.5rem;
}

.correo-visor-cerrar {
    position: absolute;
    top: .875rem;
    right: 1rem;
    white-space: nowrap;
}

.correo-adjunto-visor {
    display: block;
    width: 100%;
    height: 72vh;
    border: 0;
    background: #fff;
    color-scheme: light;
}

.correo-mensaje {
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
}

.correo-mensaje-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}

.correo-mensaje-vista[hidden] {
    display: none;
}

.correo-mensaje-texto {
    min-height: 12rem;
    max-height: 45vh;
    overflow: auto;
    padding: 1.25rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
    color: var(--bs-body-color);
    font-family: inherit;
    font-size: .95rem;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    tab-size: 4;
}

.correo-mensaje-texto:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
}

.correo-mensaje-html {
    display: block;
    width: 100%;
    height: clamp(18rem, 45vh, 40rem);
    border: 0;
    background: #fff;
    color-scheme: light;
}

.selector-cliente-fila {
    cursor: pointer;
}

.selector-cliente-fila:focus > td {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
}

.paginador-adaptativo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    min-height: 3.75rem;
    padding: .65rem 1rem;
    border-top: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}

.paginador-adaptativo-resumen {
    flex: 1;
    color: var(--bs-secondary-color);
    font-size: .875rem;
    text-align: center;
}

.paginador-adaptativo-controles {
    display: flex;
    gap: .35rem;
}

@media (max-width: 575.98px) {
    .app-content-header .breadcrumb {
        float: none !important;
        margin-top: .5rem;
    }

    .login-card {
        padding: 1.5rem;
    }

    .roles-list,
    .roles-list tbody,
    .roles-list tr,
    .roles-list td {
        display: block;
    }

    .cabys-tree-container {
        height: clamp(18rem, calc(100vh - 17rem), 36rem);
    }

    .paginador-adaptativo-resumen {
        flex-basis: 100%;
        order: 3;
    }
}
