﻿@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #0366d6;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

app {
    position: relative;
    display: flex;
    flex-direction: column;
}

.top-row {
    height: 3.5rem;
    display: flex;
    align-items: center;
}

.main {
    flex: 1;
    overflow-x: hidden;
    min-width: 0;
}

    .main .top-row {
        background-color: #f7f7f7;
        border-bottom: 1px solid #d6d5d5;
        justify-content: flex-end;
    }

        .main .top-row > a, .main .top-row .btn-link {
            white-space: nowrap;
            margin-left: 1.5rem;
        }

.main .top-row a:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar {
    background-color: #3d3938;
}

    .sidebar .top-row {
        background-color: #3d3938;
    }

    .sidebar .navbar-brand {
        font-size: 1.1rem;
    }

    .sidebar .oi {
        width: 2rem;
        font-size: 1.1rem;
        vertical-align: text-top;
        top: -2px;
    }

    .sidebar .nav-item {
        font-size: 0.9rem;
        padding-bottom: 0.5rem;
    }

        .sidebar .nav-item:first-of-type {
            padding-top: 1rem;
        }

        .sidebar .nav-item:last-of-type {
            padding-bottom: 1rem;
        }

        .sidebar .nav-item a {
            color: #7a7979;
            border-radius: 4px;
            height: 3rem;
            display: flex;
            align-items: center;
            line-height: 3rem;
        }

            .sidebar .nav-item a.active {
                background-color: rgba(245,245,245,0.25);
                color: white;
            }

            .sidebar .nav-item a:hover {
                background-color: rgba(220,220,220,0.25);
                color: white;
            }

.content {
    padding-top: 1.1rem;
}

.navbar-toggler {
    background-color: rgba(245, 245, 245, 0.1);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.pcard {
    border: 1px solid #979797;
    border-radius: 10px;
    /*display: inline-block;*/
    /*width: 130px;*/
    min-width: 130px;
    height: 130px;
    padding: 8px;
    margin: 4px;
}

.pcard:hover {
    border: 1px solid #d3d3d3;
    background-color: #f7f7f7;
}

.pcard__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    text-decoration: none;
    color: #333;
    width: 100%;
    height: 100%;
}

.pcard__link:hover { 
    text-decoration:none; 
    color: #4ba6f3;
}

.pcard__frame {
    border: 1px solid #979797;
    border-radius: 50%;
    padding: 5px;
    display: inline-flex;
}

.pcard__link:hover .pcard__frame {
    border: 1px solid #4ba6f3;
}

.pcard__img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 50%;
}

.pcard__title {
    text-align: center;
    margin: 10px;
    font-size: 13px;
}

.textarea-section {
    color: #FFF;
    margin: 12px;
    padding: 8px;
    background-color: #333;
    border-radius: 8px;
}

.textarea-section__group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin: 16px;
}

.textarea-section__wrapper {
    width: 100%;
    position: relative;
}

.textarea-section__titulo {
    color: #FFF;
    background-color: #333;
    padding: 4px;
    border-radius: 8px;
    box-sizing:border-box;
    position: absolute;
    top: -15px;
    left: 20px;
    font-size: 15px;
}

.textarea-section__input {
    width: 100%;
    height: 350px;
    background-color: rgba(255,255,255,.02);
    color: #fff;
    outline: none;
    border: none;
    border-radius: 8px;
    padding: 12px;
    resize: none;
    flex: 1;
    transition: .5s;
    font-family: monospace;
    font-size: small;
}

.textarea-section__visualizer {
    width: 100%;
    height: 350px;
    background-color: #FFF;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-family: monospace;
    font-size: small;
    overflow: auto;
    white-space: nowrap;
    border: 1px solid #FFF;
    display: inline-block;
}

.textarea-section__input:focus {
    border: 1px solid #88c5f7;
}

.textarea-section__input::placeholder {
    text-align: center;
}

.textarea-section__input:read-only {
    border: none;
    font-size: medium;
    background-color: #444;
}

.textarea-section__select {
    background-color: #333;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
}

.textarea-section__select option {
    background-color: #333;
}

.textarea-section__control {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.textarea-section__control--absolute {
    position: absolute;
    top: 0;
    right: 0;
}

.textarea-section__btn {
    outline: none;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
    margin: 4px;
    text-transform: uppercase;
    font-size: small;
    font-weight: bold;
}

.textarea-section__btn:hover {
    border: 1px solid #d3d3d3;
    background-color: #444;
    color: #d3d3d3;
    cursor: default;
}

.textarea-section__btn:focus {
    outline: none;
}

.textarea-section__btn--md {
    font-size: 20px;
}

.xtb {
    display: table;
    font-family: monospace;
}

.xtc {
    display: table-cell;
}

.xmt {
    color: #0000CC;
    display: inline;
}

.xel {
    color: #990000;
    display: inline;
}

.xdt {
    color: #000000;
    display: inline;
}

.xat {
    color: #FF0000;
    display: inline;
}

.preloader {
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,.3);
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 110;
    display: none;
}

.custom-loader {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: conic-gradient(#0000 10%,#F46600);
    -webkit-mask: radial-gradient(farthest-side,#0000 calc(100% - 8px),#000 0);
    animation: s3 1s infinite linear;
}

@keyframes s3 {
    to {
        transform: rotate(1turn)
    }
}

@media (max-width: 767.98px) {
    .main .top-row:not(.auth) {
        display: none;
    }

    .main .top-row.auth {
        justify-content: space-between;
    }

    .main .top-row a, .main .top-row .btn-link {
        margin-left: 0;
    }
}

@media (min-width: 768px) {
    app {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .main .top-row {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .main > div {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }

    .navbar-toggler {
        display: none;
    }

    .sidebar .collapse {
        /* Never collapse the sidebar for wide screens */
        display: block;
    }
}

.cs-toast {
    display: none;
    padding: 1.5rem;
    color: #fff;
    z-index: 999;
    position: fixed;
    width: 25rem;
    top: 2rem;
    border-radius: 1rem;
    right: 2rem;
}

.cs-toast-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 1rem;
    font-size: 2.5rem;
}

.cs-toast-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding-left: 1rem;
}

    .cs-toast-body p {
        margin-bottom: 0;
    }

.cs-toast-visible {
    display: flex;
    flex-direction: row;
    animation: fadein 1.5s;
}

@keyframes fadein {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.child-table-container {
    max-height: 250px; /* Altura máxima antes del scroll */
    overflow-y: auto; /* Scroll vertical si es necesario */
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.child-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #333;
}

    .child-table th,
    .child-table td {
        padding: 8px 12px;
        border-bottom: 1px solid #ddd;
        text-align: left;
    }

    .child-table th {
        background-color: #f5f5f5;
        font-weight: 600;
    }

    .child-table tr:hover {
        background-color: #f0f0f0;
    }

.text-center {
    text-align: center !important;
}

.search-input {
    width: 100%;
    padding: 6px 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.modern-form {
    color: #333;
}

.form-field {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

    .form-field label {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
        font-weight: 500;
        color: #444;
    }

    .form-field input[type="text"],
    .form-field input[type="number"],
    .form-field select {
        padding: 0.5rem 0.75rem;
        border: 1px solid #ccc;
        border-radius: 6px;
        font-size: 1rem;
        background-color: #fdfdfd;
        transition: border 0.2s ease, box-shadow 0.2s ease;
    }

        .form-field input:focus,
        .form-field select:focus {
            border-color: #5a9fff;
            box-shadow: 0 0 0 2px rgba(90, 159, 255, 0.2);
            outline: none;
        }

.checkbox-field {
    margin-top: 1.5rem;
}

    .checkbox-field label {
        display: flex;
        align-items: center;
        font-weight: 500;
    }

    .checkbox-field input[type="checkbox"] {
        margin-right: 0.5rem;
    }

.ficha-empresa {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Segoe UI', Roboto, sans-serif;
    margin-top: 1rem;
    color: #333;
    background-color: #fafafa;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

    .ficha-empresa tr {
        border-bottom: 1px solid #eee;
    }

    .ficha-empresa td {
        padding: 0.70rem 1rem;
        font-size: 0.80rem;
        vertical-align: top;
    }

        .ficha-empresa td.label {
            font-weight: 600;
            color: #555;
            width: 25%;
            background-color: #f5f5f5;
        }

    .ficha-empresa tr:last-child {
        border-bottom: none;
    }

.sticky-header {
    position: sticky;
    top: 0;
    background-color: #fafafa;
    padding: 10px;
    z-index: 10;
    border-bottom: 1px solid #ddd;
}

    .sticky-header h6 {
        margin: 0 0 0.5rem 0;
    }

/* Contenedor principal */
.pantalla-inhabilitar {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f7f9fb;
    color: #2e2e2e;
    padding: 2rem;
}

/* Título principal */
.titulo {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #222;
}

/* Subtítulo o mensaje de advertencia */
.subtitulo {
    font-weight: 400;
    margin-top: 1rem;
    color: #444;
}

/* Línea divisoria */
.linea-divisoria {
    border: none;
    height: 1px;
    background-color: #e0e0e0;
    margin-bottom: 1.5rem;
}

/* Grupo de formularios */
.formulario {
    margin-bottom: 1rem;
}

/* Etiquetas de datos */
.etiqueta {
    display: block;
    font-size: 1rem;
    color: #555;
    padding: 0.5rem 0;
}

.popup-info {
    position: absolute;
    background: #ffffff;
    border: 1px solid #ccc;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 6px;
    z-index: 1000;
    font-size: 14px;
    max-width: 300px;
    display: none;
}

.badge-role {
    display: inline-block;
    margin-right: 8px;
    font-family: Arial, sans-serif;
}

.badge-role__label {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
}

.badge-role__label--admin {
    background-color: #d32f2f; /* rojo oscuro */
}

.badge-role__label--user {
    background-color: #1976d2; /* azul */
}

.properties-section {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 2px 6px rgb(0 0 0 / 0.05);
}

    .properties-section:hover {
        box-shadow: 0 4px 12px rgb(0 0 0 / 0.1);
    }

form input,
form select {
    border-radius: 0.375rem;
}

form label {
    font-weight: 500;
}

form .form-check-label {
    cursor: pointer;
}

.sidebar {
    width: 260px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.sidebar__header {
    flex-shrink: 0;
    width:100%;
    height: 56px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar__title {
    font-weight: 600;
    color: #f8f9fa;
}

/* Body */
.sidebar__body {
    flex: 1;
    display: flex;
    flex-direction: column; /* siempre columna */
    overflow-y: auto; /* scroll vertical */
    overflow-x: hidden; /* nada horizontal */
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    width: 100%;
}

.sidebar__nav {
    width: 100%;
}

/* Links */
.sidebar__link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: .65rem .75rem;
    color: #ced4da;
    white-space: nowrap;
    cursor: pointer;
}

    .sidebar__link:hover {
        background-color: rgba(255,255,255,.08);
        color: #fff;
    }

    .sidebar__link.active {
        background-color: #0d6efd;
        color: #fff;
    }

/* Footer */
.sidebar__footer {
    flex-shrink: 0;
    width: 100%;
    border-top: 1px solid rgba(255,255,255,.1);
}

.sidebar__link--logout {
    background-color: rgba(220,53,69,.20);
    color: #fff;
}

    .sidebar__link--logout:hover {
        background-color: rgba(220,53,69,.35);
    }

.sidebar__version {
    text-align: center;
    font-size: .7rem;
    color: #adb5bd;
    padding-bottom: .25rem;
}

/* Scrollbar */
.sidebar__body::-webkit-scrollbar {
    width: 6px;
}

.sidebar__body::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,.2);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: sticky;
        top: 0; /* siempre en la parte superior */
        z-index: 100; /* encima del contenido principal */
    }

    .sidebar__body.collapse {
        display: none;
    }
    
    .sidebar__body.collapse.show {
        display: block;
        max-height: 50vh;
        overflow-y: auto;
        background-color: #212529;
        transition: all 0.3s ease;
        padding-top: .5rem;
        padding-bottom: .5rem;
    }

    .sidebar__footer {
        position: relative;
    }

    .sidebar__footer .sidebar__link--logout {
        justify-content: center;
        background-color: rgba(220,53,69,.20);
        color: #fff;
    }

    .sidebar__footer .sidebar__link--logout img {
        display: none;
    }
}

/* LoginDisplay */
.login-display__user {
    display: flex;
    align-items: center;
    white-space: nowrap; /* evita que el nombre se rompa */
}

.login-display__name {
    font-family: 'Franklin Gothic Medium', sans-serif;
    font-weight: bold;
    font-size: 1rem;
    color: #000; /* texto visible sobre barra gris oscuro */
    max-width: 200px; /* opcional: evita que el nombre se salga del contenedor */
    overflow: hidden;
    text-overflow: ellipsis; /* agrega "..." si es muy largo */
}

/* Avatar */
.login-display__avatar {
    border-radius: 50%;
    border: 2px solid #f8f9fa;
}

/* Responsive */
@media (max-width: 768px) {
    .login-display__name {
        font-size: 0.9rem;
        max-width: 120px;
    }

    .badge-role__label {
        font-size: 0.65rem;
        padding: 2px 8px;
    }

    .login-display__avatar {
        width: 30px;
        height: 30px;
    }
}

/* Filter Container */
.filter-container {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border-bottom: 1px solid #e0e0e0;
}

.filter-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-header .btn {
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.filter-header .btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.filter-body {
    padding: 1.5rem;
}

.section-subtitle {
    color: #495057;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
}

.form-control-sm,
.form-select-sm {
    border-radius: 4px;
    border: 1px solid #ced4da;
    transition: all 0.2s ease;
}

.form-control-sm:focus,
.form-select-sm:focus {
    border-color: #6c757d;
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.15);
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.filter-actions .btn {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.filter-actions .btn-primary {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    border: none;
}

.filter-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(73, 80, 87, 0.4);
}

.filter-actions .btn i {
    margin-right: 0.25rem;
}

.row.g-3 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}

/* Skeleton Loader Styles */
.table-skeleton {
    animation: fadeIn 0.3s ease-in;
}

.skeleton-header,
.skeleton-cell {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    height: 20px;
}

.skeleton-header {
    height: 24px;
    margin: 4px 0;
}

.skeleton-cell {
    height: 18px;
    margin: 6px 0;
}

/* Estilos específicos para columnas de iconos (30px) */
.skeleton-cell-icon {
    width: 20px;
    height: 20px;
    margin: 0 auto;
    border-radius: 3px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@media (max-width: 768px) {
    .filter-body {
        padding: 1rem;
    }

    .filter-actions {
        flex-direction: column;
    }

    .filter-actions .btn {
        width: 100%;
    }
}

/* Pagination Styles - Professional Design */

/* Wrapper principal - Layout vertical centrado */
.pagination-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Información de registros - Centrada arriba */
.pagination-info {
    color: #495057;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    width: 100%;
}

.pagination-info strong {
    color: #212529;
    font-weight: 600;
}

/* Contenedor de navegación - Centrado abajo */
.pagination-wrapper nav {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Contenedor de paginación */
.pagination {
    margin-bottom: 0;
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Items de paginación */
.pagination .page-item {
    margin: 0;
}

/* Links/Botones de página */
.pagination .page-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 0.75rem;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    color: #495057;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
}

.pagination .page-link:hover:not(:disabled) {
    color: #212529;
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.pagination .page-link:focus {
    z-index: 3;
    color: #212529;
    background-color: #e9ecef;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(108, 117, 125, 0.2);
}

.pagination .page-link:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

/* Página activa */
.pagination .page-item.active .page-link {
    z-index: 3;
    color: #fff;
    font-weight: 600;
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    border-color: #343a40;
    box-shadow: 0 4px 12px rgba(73, 80, 87, 0.35);
    cursor: default;
}

/* Estado deshabilitado */
.pagination .page-item.disabled .page-link {
    color: #adb5bd;
    pointer-events: none;
    cursor: not-allowed;
    background-color: #f8f9fa;
    border-color: #e9ecef;
    opacity: 0.65;
    box-shadow: none;
}

/* Botones de navegación (primera, anterior, siguiente, última) */
.pagination .page-item-nav .page-link {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    font-weight: 600;
}

.pagination .page-item-nav .page-link:hover:not(:disabled) {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border-color: #545b62;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.pagination .page-item-nav.disabled .page-link {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #adb5bd;
}

/*Texto en los botones de navegación */
.pagination .page-link-text {
    margin-left: 0.4rem;
    margin-right: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Ajustar espaciado cuando hay texto + icono */
.pagination .page-item-nav .page-link {
    padding: 0.5rem 0.85rem;
    min-width: auto;
}

/* Iconos dentro de los botones */
.pagination .page-link i {
    font-size: 0.875rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Puntos suspensivos */
.pagination .page-item.disabled .page-link[aria-disabled="true"] {
    background-color: transparent;
    border-color: transparent;
    color: #6c757d;
    cursor: default;
    pointer-events: none;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pagination-wrapper {
    animation: fadeIn 0.3s ease-out;
}

/* Estilos para el control de paginación mejorado */
.pagination-wrapper {
    margin-top: 1rem;
}

.pagination-wrapper.pagination-top {
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
    animation: slideDown 0.3s ease-out;
}

.pagination-wrapper.pagination-bottom {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #dee2e6;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pagination-wrapper .pagination-info {
    text-align: center;
}

.pagination-wrapper .form-select-sm {
    min-width: 70px;
}

/* Estilos para la barra de exportación y selector de registros */
.panel-body .d-flex.justify-content-between {
    margin-bottom: 1rem;
}

@media (max-width: 576px) {
    .panel-body .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .panel-body .d-flex.justify-content-between > div {
        width: 100%;
        justify-content: space-between;
    }
    
    .pagination-wrapper .pagination-info {
        text-align: left;
    }
}

/* ===== DISEÑO MINIMALISTA PARA FORMULARIOS ===== */
.modern-form-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.modern-form-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.form-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.form-header h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    letter-spacing: -0.02em;
}

.form-header p {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0.5rem 0 0 0;
}

.form-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f3f4f6;
}

.modern-form-group {
    margin-bottom: 1.5rem;
}

.modern-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.required-indicator {
    color: #dc2626;
    margin-left: 0.25rem;
}

.modern-input,
.modern-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: #1f2937;
    background-color: #ffffff;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.2s ease;
    outline: none;
}

.modern-input:focus,
.modern-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modern-input:hover:not(:focus),
.modern-select:hover:not(:focus) {
    border-color: #9ca3af;
}

.modern-input::placeholder {
    color: #9ca3af;
}

.validation-message {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #dc2626;
}

.validation-summary {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.validation-summary ul {
    margin: 0;
    padding-left: 1.25rem;
    color: #dc2626;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.btn-modern {
    padding: 0.75rem 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.btn-modern-primary {
    background-color: #3b82f6;
    color: #ffffff;
}

.btn-modern-primary:hover {
    background-color: #2563eb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-modern-secondary {
    background-color: #f3f4f6;
    color: #374151;
}

.btn-modern-secondary:hover {
    background-color: #e5e7eb;
}

.btn-modern:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Grid mejorado para formularios */
.modern-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.compact-form-container {
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.compact-form-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
}

.compact-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.compact-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
}

.compact-header p {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}

.compact-section {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 6px;
}

.compact-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.compact-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.compact-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.compact-form-group {
    display: flex;
    flex-direction: column;
}

.compact-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.35rem;
}

.required-mark {
    color: #dc2626;
    margin-left: 0.15rem;
}

.compact-input,
.compact-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #1f2937;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.15s ease;
    outline: none;
}

.compact-input:focus,
.compact-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.compact-input:hover:not(:focus),
.compact-select:hover:not(:focus) {
    border-color: #9ca3af;
}

.compact-input::placeholder {
    color: #9ca3af;
    font-size: 0.825rem;
}

.compact-validation {
    font-size: 0.75rem;
    color: #dc2626;
    margin-top: 0.25rem;
}

.compact-validation-summary {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.compact-validation-summary ul {
    margin: 0;
    padding-left: 1rem;
    font-size: 0.8rem;
    color: #dc2626;
}

.compact-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.btn-compact {
    padding: 0.55rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
}

.btn-compact i {
    font-size: 1rem;
}

.btn-compact-primary {
    background-color: #3b82f6;
    color: #ffffff;
}

.btn-compact-primary:hover {
    background-color: #2563eb;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    color: #ffffff;
}

.btn-compact-secondary {
    background-color: #e5e7eb;
    color: #374151;
}

.btn-compact-secondary:hover {
    background-color: #d1d5db;
}

.btn-compact-success {
    background-color: #10b981;
    color: #ffffff;
}

.btn-compact-success:hover {
    background-color: #059669;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-compact-danger {
    background-color: #ef4444;
    color: #ffffff;
}

.btn-compact-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-compact:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== TOOLBAR COMPACTA ===== */
.toolbar-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ===== FILTROS COMPACTOS ===== */
.filter-compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.filter-compact-header h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-compact-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-section {
    background: #ffffff;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.section-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #f3f4f6;
}

.filter-actions-compact {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.btn-icon {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.1rem;
    transition: color 0.15s;
}

.btn-icon:hover {
    color: #1f2937;
}

/* ===== CONTROLES DE TABLA ===== */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.table-info {
    display: flex;
    align-items: center;
}

.records-badge {
    background-color: #3b82f6;
    color: #ffffff;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.table-pagesize {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-pagesize label {
    font-size: 0.85rem;
    color: #374151;
    margin: 0;
}

/* ===== PAGINACIÓN COMPACTA ===== */
.pagination-wrapper-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pagination-info-compact {
    font-size: 0.85rem;
    color: #6b7280;
}

.pagination-sm .page-link {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.page-link-text {
    display: inline;
}

/* Responsive para toolbar */
@media (max-width: 1200px) {
    .compact-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .compact-form-card {
        padding: 1rem;
    }

    .compact-grid,
    .compact-grid-3,
    .compact-grid-4 {
        grid-template-columns: 1fr;
    }

    .compact-actions {
        flex-direction: column-reverse;
    }

    .btn-compact {
        width: 100%;
    }

    .toolbar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
        justify-content: center;
    }

    .filter-actions-compact {
        flex-direction: column;
    }

    .table-controls {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .pagination-wrapper-compact {
        flex-direction: column;
        align-items: center;
    }

    .page-link-text {
        display: none;
    }
}

.module-badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: #6c757d;
    border-radius: 0.375rem;
    margin: 0.15rem;
    white-space: nowrap;
}

.modules-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    max-width: 300px;
    max-height: 60px;
    overflow: hidden;
    position: relative;
    align-items: flex-start;
}

.modules-container-scrollable {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    max-width: 300px;
    max-height: 60px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
    align-items: flex-start;
}

    .modules-container-scrollable::-webkit-scrollbar {
        width: 6px;
    }

    .modules-container-scrollable::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }

    .modules-container-scrollable::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
    }

        .modules-container-scrollable::-webkit-scrollbar-thumb:hover {
            background: #555;
        }

.module-count-badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background-color: #495057;
    border-radius: 0.375rem;
    margin: 0.15rem;
    cursor: help;
}

.no-modules-text {
    color: #6c757d;
    font-style: italic;
    font-size: 0.875rem;
}

.admin-badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-type-admin {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25em 0.5em;
    font-size: 0.813rem;
    font-weight: 600;
    color: #dc3545;
    background-color: transparent;
    border: 1.5px solid #dc3545;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.user-type-usuario {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25em 0.5em;
    font-size: 0.813rem;
    font-weight: 600;
    color: #0d6efd;
    background-color: transparent;
    border: 1.5px solid #0d6efd;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

    .user-type-admin i,
    .user-type-usuario i {
        font-size: 0.9em;
    }

/*
    ESTILOS PARA MODULO DE AUDITORIA
*/

/* Estilos para la tabla expandida de detalles */
.detalle-expandido {
    background-color: #f8f9fa;
    padding: 0px 15px;
    max-width: 100%;
    max-height: 500px;
    overflow-x: auto;
}

    .detalle-expandido .table-responsive {
        margin: 0;
        max-width: 100%;
        overflow-x: auto;
    }

    .detalle-expandido table {
        margin-bottom: 0;
        table-layout: fixed;
        width: 100%;
        background-color: white;
    }

    .detalle-expandido thead {
        position: sticky;
        top: 0;
        z-index: 10;
        background-color: #e9ecef;
    }

    /* Mejoras para celdas de la tabla de detalles */
    .detalle-expandido td {
        vertical-align: middle;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 8px 12px;
    }

    .detalle-expandido .badge {
        min-width: 70px;
        display: inline-block;
        white-space: nowrap;
    }

    /* Estilo específico para la celda de observaciones */
    .detalle-expandido td.col-observaciones {
        max-width: 250px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-word;
        cursor: help;
    }

        /* Tooltip mejorado para ver texto completo en hover */
        .detalle-expandido td.col-observaciones:hover {
            background-color: #fffbcc;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
            z-index: 1000;
            transition: all 0.2s ease;
        }

    /* Ancho fijo para columnas específicas */
    .detalle-expandido th.col-fecha,
    .detalle-expandido td.col-fecha {
        width: 150px;
        min-width: 150px;
        max-width: 150px;
    }

    .detalle-expandido th.col-operacion,
    .detalle-expandido td.col-operacion {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
        text-align: center;
    }

    .detalle-expandido th.col-usuario,
    .detalle-expandido td.col-usuario {
        width: 120px;
        min-width: 120px;
        max-width: 120px;
    }

    .detalle-expandido th.col-ip,
    .detalle-expandido td.col-ip {
        width: 120px;
        min-width: 120px;
        max-width: 120px;
    }

    .detalle-expandido th.col-observaciones {
        width: auto;
        min-width: 200px;
    }

    .detalle-expandido td.col-observaciones {
        width: auto;
        min-width: 200px;
    }

    .detalle-expandido th.col-detalles,
    .detalle-expandido td.col-detalles {
        width: 80px;
        min-width: 80px;
        max-width: 80px;
        text-align: center;
    }

/* Asegurar que el wrapper no cause overflow */
#tblAuditoria tbody tr.shown + tr td {
    padding: 0 !important;
}

/* Scroll horizontal suave */
.detalle-expandido::-webkit-scrollbar,
.detalle-expandido .table-responsive::-webkit-scrollbar {
    height: 8px;
}

.detalle-expandido::-webkit-scrollbar-track,
.detalle-expandido .table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.detalle-expandido::-webkit-scrollbar-thumb,
.detalle-expandido .table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

    .detalle-expandido::-webkit-scrollbar-thumb:hover,
    .detalle-expandido .table-responsive::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

/* Hint visual para indicar que hay más texto */
.detalle-expandido td.col-observaciones small {
    display: block;
}

.detalle-expandido td.col-observaciones:after {
    content: " 💬";
    opacity: 0.5;
    font-size: 0.7em;
    margin-left: 4px;
}

.detalle-expandido .mb-3 {
    position: sticky;
    top: 0;
    z-index: 11;
    background-color: #f8f9fa;
    margin: -15px -15px 15px -15px;
    padding: 10px 15px;
    border-bottom: 1px solid #dee2e6;
}

/* ===== TABLA DE REPORTES CON DATATABLES ===== */

/* Wrapper principal de DataTables: NO expande la página */
#tblReportes_wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    min-width: 0;
}

/* Scroll horizontal confinado al wrapper */
#tblReportes_wrapper .dataTables_scroll {
    overflow-x: auto;
    width: 100% !important;
}

#tblReportes_wrapper .dataTables_scrollBody {
    overflow-x: auto !important;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

#tblReportes_wrapper .dataTables_scrollHead {
    overflow: hidden !important;
    width: 100% !important;
}

#tblReportes_wrapper .dataTables_scrollHeadInner,
#tblReportes_wrapper .dataTables_scrollHeadInner table {
    width: 100% !important;
    box-sizing: border-box;
}

/* Tabla interna: ancho mínimo para evitar colapso de celdas */
#tblReportes {
    min-width: 600px;
}

/* Primera columna fija (sticky) al hacer scroll horizontal */
#tblReportes thead th.col-sticky-first,
#tblReportes tbody td.col-sticky-first {
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.08);
}

#tblReportes thead th.col-sticky-first {
    background-color: #f8f9fa;
    z-index: 3;
}

#tblReportes tbody tr:hover td.col-sticky-first {
    background-color: #e9ecef;
}

/* Columnas sticky adicionales: mismos estilos, el left se ajusta dinámicamente por JS */
#tblReportes thead th.col-sticky-first:not(:first-child),
#tblReportes tbody td.col-sticky-first:not(:first-child) {
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
    z-index: 1;
}

#tblReportes thead th.col-sticky-first:not(:first-child) {
    z-index: 2;
}

/* Selección de filas en tabla de reportes */
.dt-report-selected td {
    background-color: #cfe2ff !important;
    color: #084298;
}

/* Placeholder pálido para inputs de configuraciones */
.table .form-control::placeholder {
    color: #ced4da;
    opacity: 1;
}
