html {
    font-size: 90%;
}

:root {
    --oc-blue: #1D358E;
    --oc-red: #E61D2B;
    --oc-light-bg: #F8F9FA;
    --sidebar-width: 235px;
}

body {
    background-color: var(--oc-light-bg);
    color: #333;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

/* Tipografía auxiliar compacta para badges y detalles */
.fs-7 {
    font-size: 0.8rem !important;
}

.fs-8 {
    font-size: 0.72rem !important;
}

/* Layout Sidebar */
#wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#sidebar-wrapper {
    height: 100vh;
    width: var(--sidebar-width);
    background-color: var(--oc-blue);
    transition: margin 0.25s ease-out;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
}

#wrapper.toggled #sidebar-wrapper {
    margin-left: calc(var(--sidebar-width) * -1);
}

#page-content-wrapper {
    min-width: 0;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.25s ease-out;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    #sidebar-wrapper {
        margin-left: calc(var(--sidebar-width) * -1);
    }

    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
    }
}

/* Menu Sidebar */
.sidebar-heading {
    padding: 1.5rem 1.25rem;
    font-size: 1.25rem;
    color: #fff;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.list-group-item-action {
    color: rgba(255, 255, 255, 0.8) !important;
    transition: all 0.2s;
}

.list-group-item-action:hover,
.list-group-item-action.active {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-left: 4px solid var(--oc-red) !important;
}

.list-group-item {
    border-left: 4px solid transparent !important;
}

/* Utilidades Generales */
.bg-oc-blue {
    background-color: var(--oc-blue) !important;
}

.text-oc-blue {
    color: var(--oc-blue) !important;
}

.bg-oc-red {
    background-color: var(--oc-red) !important;
}

.btn-oc-red {
    background-color: var(--oc-red);
    color: #fff;
    border: none;
}

.btn-oc-red:hover {
    background-color: #c91724;
    color: #fff;
}

.btn-outline-oc-blue {
    border-color: var(--oc-blue);
    color: var(--oc-blue);
}

.btn-outline-oc-blue:hover {
    background-color: var(--oc-blue);
    color: #fff;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, .125);
    font-weight: 600;
}

/* Fix DataTables layout issues */
.dataTables_wrapper {
    width: 100%;
    padding: 0 5px;
}

.dataTables_wrapper .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

.dataTables_wrapper .col-sm-12 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

div.dataTables_wrapper div.dataTables_filter {
    padding-right: 5px !important;
    text-align: right;
}

div.dataTables_wrapper div.dataTables_filter input {
    border-radius: 0.375rem !important;
    display: inline-block !important;
    width: auto !important;
    margin-left: 0.5rem;
}

/* Cabeceras de tabla con fondo suave diferenciador para todo el sistema */
.table thead th,
.table-light th,
thead.table-light th,
.table-header-soft th {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: none !important;
    border-bottom: 2px solid #cbd5e1 !important;
    padding: 0.85rem 1rem !important;
    vertical-align: middle;
    white-space: nowrap;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Scroll horizontal ergonómico con manito en contenedores de tabla */
.table-responsive {
    cursor: grab;
    -webkit-overflow-scrolling: touch;
}

/* Cuando se está arrastrando la tabla físicamente */
.table-responsive.table-dragging,
.table-responsive.table-dragging *,
body.table-dragging-active,
body.table-dragging-active * {
    cursor: grabbing !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* Celdas de datos: permiten selección natural de texto */
.table tbody td {
    user-select: text;
    -webkit-user-select: text;
}

.table tbody td span,
.table tbody td small,
.table tbody td strong,
.table tbody td p,
.table tbody td code,
.selectable-text,
.user-select-all,
[style*="user-select"] {
    cursor: text;
}

/* Elementos interactivos dentro de tablas */
.table tbody td a,
.table tbody td button,
.table tbody td .btn,
.table tbody td input,
.table tbody td select,
.table tbody td .form-check-input {
    cursor: pointer !important;
}

/* Utilidades generales de interfaz */
.cursor-pointer {
    cursor: pointer;
}

.user-select-all {
    user-select: all !important;
    -webkit-user-select: all !important;
    cursor: text !important;
}

@media (min-width: 768px) {
    .border-end-md {
        border-right: 1px solid #e9ecef !important;
    }
}

/* ==========================================================================
   Casillas de Códigos OTP y 2FA
   ========================================================================== */
.otp-box {
    width: 46px;
    height: 54px;
    padding: 0;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    background-color: #f8fafc;
    caret-color: var(--oc-blue, #0d6efd);
    font-weight: 700;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.otp-box:focus {
    border-color: var(--oc-blue, #0d6efd);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
    outline: none;
    transform: translateY(-2px);
}

.otp-box.filled,
.rec-box.filled {
    border-color: #94a3b8;
    background-color: #ffffff;
}

.rec-box {
    width: 32px;
    height: 44px;
    padding: 0;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background-color: #f8fafc;
    caret-color: var(--oc-blue, #0d6efd);
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.rec-box:focus {
    border-color: var(--oc-blue, #0d6efd);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
    outline: none;
    transform: translateY(-2px);
}

.otp-box.is-invalid,
.rec-box.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2) !important;
    animation: otpBoxShake 0.35s ease-in-out;
}

@keyframes otpBoxShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-4px);
    }

    40%,
    80% {
        transform: translateX(4px);
    }
}

@media (max-width: 420px) {
    .otp-box {
        width: 40px;
        height: 48px;
        font-size: 1.25rem !important;
    }

    .rec-box {
        width: 28px;
        height: 38px;
        font-size: 0.95rem !important;
    }
}

.spin-icon {
    animation: spinAnimation 0.8s linear infinite;
    display: inline-block;
}

@keyframes spinAnimation {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}