body {
    background-color: #f4f6f9;
}

.sidebar {
    width: 260px;
    min-height: 100vh;
    background: #0f172a;
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    padding: 20px 15px;
}

.sidebar .brand {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 30px;
    text-align: center;
}

.sidebar a {
    color: #cbd5e1;
    text-decoration: none;
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 6px;
}

.sidebar a:hover,
.sidebar a.active {
    background: var(--pit-primary, #2563eb);
    color: white;
}

.content {
    margin-left: 260px;
    padding: 25px;
}

.topbar {
    background: white;
    border-radius: 16px;
    padding: 18px 22px;
    margin-bottom: 25px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.card-stat,
.card-custom {
    border: none;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
}

.module-card {
    border: none;
    border-radius: 18px;
    transition: all 0.2s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.10);
}

@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
    }

    .content {
        margin-left: 0;
    }
}

/* ==============================
   FORMATO DE IMPRESIÓN / PDF
   ============================== */

@media print {

    @page {
        size: landscape;
        margin: 12mm;
    }

    body {
        background: white !important;
        font-size: 11px;
        color: #000;
    }

    .sidebar,
    .btn,
    .no-print,
    form,
    .topbar .btn,
    .navbar,
    .print-hide {
        display: none !important;
    }

    .content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .topbar {
        box-shadow: none !important;
        border: none !important;
        padding: 0 0 10px 0 !important;
        margin-bottom: 10px !important;
    }

    .card,
    .card-custom,
    .card-stat {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        border-radius: 0 !important;
    }

    .icon-box {
        display: none !important;
    }

    .row {
        display: flex !important;
        flex-wrap: wrap !important;
    }

    .col-md-3 {
        width: 25% !important;
    }

    .col-md-4 {
        width: 33.3333% !important;
    }

    table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 10px;
    }

    th,
    td {
        border: 1px solid #999 !important;
        padding: 5px !important;
        vertical-align: top !important;
    }

    thead {
        display: table-header-group;
    }

    tr {
        page-break-inside: avoid;
    }

    .table-responsive {
        overflow: visible !important;
    }

    .badge {
        border: 1px solid #555 !important;
        color: #000 !important;
        background: white !important;
        font-weight: normal !important;
    }

    .reporte-print-header {
        display: block !important;
    }
}

.reporte-print-header {
    display: none;
}

/* ==============================
LOGIN - PORTAL IT
============================== */

.btn-login {
border-radius: 10px;
padding: 10px;
font-weight: 600;
}


/* ==========================================================
   Portal IT v1.5.3 - Capa visual premium estable
   Enfoque: presentación, perfil, configuración, tarjetas y móvil
   ========================================================== */

/* PIT152261_DS10_TOKENS: los tokens base viven en assets/css/tokens.css. */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background:
        radial-gradient(circle at 18% 8%, rgba(var(--pit-primary-rgb, 37,99,235),.06), transparent 26%),
        radial-gradient(circle at 82% 0%, rgba(56,189,248,.08), transparent 28%),
        var(--pit-bg) !important;
    color: var(--pit-text);
}

/* Base premium para contenedores */
.content {
    background: transparent !important;
}

.topbar,
.card-custom,
.card-stat,
.module-card,
.profile-hero {
    background: var(--pit-surface) !important;
    border: 1px solid var(--pit-border) !important;
    border-radius: var(--pit-radius-xl) !important;
    box-shadow: var(--pit-shadow) !important;
}

.topbar {
    padding: 24px 28px !important;
    margin-bottom: 24px !important;
}

.topbar h1,
.topbar h2,
.topbar h3,
.topbar h4 {
    color: var(--pit-text) !important;
    font-weight: 950 !important;
    letter-spacing: -0.045em;
}

.topbar p {
    color: var(--pit-muted) !important;
    font-size: .98rem;
}

.card-custom > .card-header,
.card > .card-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(226,232,240,.72) !important;
    padding: 20px 24px !important;
}

.card-custom > .card-header h5,
.card > .card-header h5 {
    font-weight: 900 !important;
    letter-spacing: -0.025em;
}

.card-body {
    padding: 24px !important;
}

/* Botones premium */
.btn {
    border-radius: 14px !important;
    font-weight: 800;
}

.btn-primary {
    background: linear-gradient(135deg, #3169f4, #2554d9) !important;
    border-color: transparent !important;
    box-shadow: 0 12px 26px rgba(var(--pit-primary-rgb, 37,99,235),.22);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(var(--pit-primary-rgb, 37,99,235),.28);
}

.btn-secondary {
    background: #6b7280 !important;
    border-color: #6b7280 !important;
}

.btn-success {
    background: #2f855a !important;
    border-color: #2f855a !important;
}

.btn-danger {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
}

/* Formularios */
.form-control,
.form-select {
    border-radius: 14px !important;
    border-color: #dbe3ef !important;
    min-height: 46px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--pit-primary-300, #93c5fd) !important;
    box-shadow: 0 0 0 .22rem rgba(var(--pit-primary-rgb, 37,99,235),.13) !important;
}

/* Métricas */
.card-stat {
    transition: transform .18s ease, box-shadow .18s ease;
}

.card-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 50px rgba(15,23,42,.09) !important;
}

.metric-label {
    color: var(--pit-muted) !important;
    margin-bottom: 4px !important;
    font-size: .95rem;
}

.metric-value {
    color: var(--pit-text) !important;
    font-weight: 950 !important;
    letter-spacing: -0.04em;
}

.icon-box {
    border-radius: 17px !important;
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-shadow: 0 12px 28px rgba(15,23,42,.08);
}

.icon-box i {
    font-size: 1.65rem;
}

/* ==========================================================
   PERFIL PREMIUM
   ========================================================== */

.profile-premium .profile-hero {
    overflow: hidden;
    position: relative;
}

.profile-premium .profile-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 8% 15%, rgba(var(--pit-primary-rgb, 37,99,235),.12), transparent 28%),
        radial-gradient(circle at 92% 20%, rgba(56,189,248,.12), transparent 30%);
    pointer-events: none;
}

.profile-premium .profile-hero .card-body {
    position: relative;
    z-index: 1;
}

.profile-avatar-xl {
    width: 132px;
    height: 132px;
    border-radius: 34px;
    background: linear-gradient(135deg, var(--pit-primary, #2563eb), #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    font-size: 2.6rem;
    font-weight: 950;
    box-shadow: 0 20px 45px rgba(var(--pit-primary-rgb, 37,99,235),.25);
    border: 6px solid rgba(255,255,255,.95);
}

.profile-avatar-xl img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.profile-info-grid > div {
    background: rgba(248,250,252,.92);
    border: 1px solid rgba(226,232,240,.9);
    border-radius: 16px;
    padding: 13px 15px;
}

.profile-info-grid span {
    display: block;
    color: var(--pit-muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}

.profile-info-grid strong {
    display: block;
    color: var(--pit-text);
    font-size: .95rem;
    overflow-wrap: anywhere;
}

.role-card-premium {
    background: linear-gradient(135deg, #f8fafc, #eef4ff);
    border: 1px solid rgba(191,219,254,.95);
    border-radius: 22px;
    padding: 20px;
    box-shadow: var(--pit-shadow-soft);
}

.quick-grid .quick-card,
.quick-card {
    min-height: 135px;
    background: #ffffff;
    border: 1px solid rgba(226,232,240,.92);
    border-radius: 22px;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    color: var(--pit-text);
    text-align: center;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.quick-card:hover {
    transform: translateY(-3px);
    border-color: rgba(var(--pit-primary-rgb, 37,99,235),.35);
    box-shadow: 0 22px 45px rgba(15,23,42,.10);
    color: var(--pit-primary);
}

.quick-card i {
    font-size: 2rem;
    line-height: 1;
}

.quick-card strong {
    font-weight: 900;
}

.quick-card span {
    color: var(--pit-muted);
    font-size: .87rem;
}

/* ==========================================================
   CONFIGURACIÓN PREMIUM Y FIX DEFINITIVO DE SISTEMA
   ========================================================== */

.settings-nav,
.nav-tabs {
    border-bottom: 0 !important;
}

.settings-nav .nav-link,
.nav-tabs .nav-link {
    border-radius: 15px !important;
    border: 0 !important;
    color: #1f2937 !important;
    font-weight: 850 !important;
    padding: 12px 16px !important;
}

.settings-nav .nav-link:hover,
.nav-tabs .nav-link:hover {
    background: #eef4ff !important;
    color: var(--pit-primary) !important;
}

.settings-nav .nav-link.active,
.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #3169f4, #2554d9) !important;
    color: #fff !important;
    box-shadow: 0 14px 30px rgba(var(--pit-primary-rgb, 37,99,235),.20);
}

/* ESTA ES LA CORRECCIÓN IMPORTANTE:
   config-system-grid es una row de Bootstrap. Debe ser flex, no grid. */
#sistema .config-system-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    gap: 0 !important;
    margin-right: calc(-.5 * var(--bs-gutter-x)) !important;
    margin-left: calc(-.5 * var(--bs-gutter-x)) !important;
}

#sistema .config-system-grid > [class*="col-"] {
    display: block !important;
    flex-shrink: 0 !important;
    max-width: 100% !important;
    padding-right: calc(var(--bs-gutter-x) * .5) !important;
    padding-left: calc(var(--bs-gutter-x) * .5) !important;
    margin-top: var(--bs-gutter-y) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
}

@media (min-width: 768px) {
    #sistema .config-system-grid > .col-md-3 {
        flex: 0 0 auto !important;
        width: 25% !important;
    }

    #sistema .config-system-grid > .col-md-4 {
        flex: 0 0 auto !important;
        width: 33.33333333% !important;
    }

    #sistema .config-system-grid > .col-md-6 {
        flex: 0 0 auto !important;
        width: 50% !important;
    }

    #sistema .config-system-grid > .col-md-12 {
        flex: 0 0 auto !important;
        width: 100% !important;
    }
}

#sistema .system-readonly-box {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 86px !important;
    height: 100% !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 17px !important;
    padding: 16px 18px !important;
    overflow: hidden !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
}

#sistema .system-readonly-box strong {
    display: block !important;
    color: var(--pit-text) !important;
    font-weight: 950 !important;
    line-height: 1.2 !important;
    margin-bottom: 5px !important;
    word-break: normal !important;
}

#sistema .system-readonly-box span,
#sistema .system-readonly-box .text-muted {
    display: block !important;
    color: var(--pit-muted) !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere !important;
}

#sistema .system-readonly-box,
#sistema .system-readonly-box * {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
}

/* Carpetas de carga */
#sistema .row.g-2:not(.config-system-grid) > [class*="col-"] > .system-readonly-box {
    min-height: 104px !important;
}

/* ==========================================================
   SIDEBAR PREMIUM ESTABLE
   ========================================================== */

@media (min-width: 992px) {
    .sidebar {
        width: 260px !important;
        background: linear-gradient(180deg, #0f172a 0%, #111827 100%) !important;
        color: #fff !important;
        padding: 24px 16px 16px !important;
        border-right: 1px solid rgba(255,255,255,.05);
        overflow: hidden !important;
        box-shadow: none !important;
    }

    .sidebar .brand {
        font-size: 25px !important;
        font-weight: 950 !important;
        padding: 8px 10px !important;
        margin-bottom: 24px !important;
        color: #fff !important;
        letter-spacing: -0.04em;
    }

    .sidebar-nav {
        scrollbar-width: none;
    }

    .sidebar-nav::-webkit-scrollbar {
        width: 0 !important;
        height: 0 !important;
    }

    .sidebar-section-title {
        color: rgba(203,213,225,.70) !important;
        font-size: .72rem !important;
        letter-spacing: .09em !important;
        font-weight: 950 !important;
        margin: 18px 8px 8px !important;
    }

    .sidebar a {
        border-radius: 13px !important;
        padding: 12px 14px !important;
        margin-bottom: 6px !important;
        color: #cbd5e1 !important;
        transition: background .16s ease, color .16s ease;
    }

    .sidebar a:hover {
        background: rgba(var(--pit-primary-rgb, 37,99,235),.18) !important;
        color: #fff !important;
    }

    .sidebar a.active {
        background: var(--pit-primary, #2563eb) !important;
        color: #fff !important;
        box-shadow: 0 12px 30px rgba(var(--pit-primary-rgb, 37,99,235),.22);
    }

    .sidebar-user-panel {
        background: rgba(255,255,255,.08) !important;
        border: 1px solid rgba(255,255,255,.10) !important;
        border-radius: 18px !important;
    }

    .content {
        margin-left: 260px !important;
        padding: 25px !important;
    }
}

/* ==========================================================
   RESPONSIVE MÓVIL GENERAL
   ========================================================== */

.mobile-menu-toggle {
    display: none;
}

.mobile-sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    body {
        padding-top: 72px !important;
        overflow-x: hidden !important;
    }

    .content {
        margin-left: 0 !important;
        padding: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .mobile-menu-toggle {
        display: inline-flex !important;
        position: fixed !important;
        top: calc(env(safe-area-inset-top, 0px) + 12px) !important;
        left: 14px !important;
        z-index: 99999 !important;
        width: 50px !important;
        height: 50px !important;
        border: 0 !important;
        border-radius: 16px !important;
        background: var(--pit-primary, #2563eb) !important;
        color: #fff !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 12px 30px rgba(var(--pit-primary-rgb, 37,99,235),.38) !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-menu-toggle i {
        font-size: 1.7rem !important;
        pointer-events: none;
    }

    .mobile-sidebar-backdrop {
        display: block !important;
        position: fixed !important;
        inset: 0 !important;
        background: rgba(15,23,42,.58) !important;
        backdrop-filter: blur(3px) !important;
        z-index: 99997 !important;
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    body.sidebar-open .mobile-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: min(88vw, 330px) !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        transform: translateX(-115%) !important;
        transition: transform .24s ease !important;
        z-index: 99998 !important;
        padding: calc(env(safe-area-inset-top, 0px) + 72px) 14px calc(env(safe-area-inset-bottom, 0px) + 14px) !important;
        background: #0f172a !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        box-shadow: 24px 0 60px rgba(15,23,42,.38) !important;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0) !important;
    }

    .sidebar-nav {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .sidebar-nav::-webkit-scrollbar {
        width: 0 !important;
    }

    .sidebar-user-panel {
        flex: 0 0 auto !important;
    }

    .topbar {
        padding: 18px !important;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    .topbar h1,
    .topbar h2,
    .topbar h3,
    .topbar h4 {
        font-size: 1.35rem !important;
    }

    .card-body {
        padding: 18px !important;
    }

    .table-responsive {
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .form-control,
    .form-select {
        font-size: 16px;
    }

    #sistema .config-system-grid > [class*="col-"] {
        width: 100% !important;
        flex: 0 0 auto !important;
    }

    .profile-info-grid {
        grid-template-columns: 1fr;
    }

    .quick-card {
        min-height: 110px;
    }
}

@media (max-width: 575.98px) {
    .content {
        padding: 10px !important;
    }

    .card-body {
        padding: 16px !important;
    }

    .profile-avatar-xl {
        width: 112px;
        height: 112px;
        border-radius: 28px;
    }
}


/* ==========================================================
   Portal IT v1.5.3.1 - FIX usuario y logout en sidebar
   ========================================================== */

.sidebar {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.sidebar .brand {
    flex: 0 0 auto !important;
}

.sidebar-nav {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 12px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
}

.sidebar-user-panel {
    flex: 0 0 auto !important;
    display: block !important;
    margin-top: 12px !important;
    padding: 12px !important;
    border-radius: 18px !important;
    background: rgba(255,255,255,.085) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    box-shadow: 0 -10px 28px rgba(0,0,0,.08);
}

.sidebar-user-card {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    overflow: hidden !important;
    color: #fff !important;
}

.sidebar-avatar,
.sidebar-user-card img {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block !important;
}

.sidebar-user-text {
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.sidebar-user-name,
.sidebar-user-role {
    display: block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.sidebar-user-name {
    color: #fff !important;
    font-size: .87rem !important;
    font-weight: 950 !important;
    line-height: 1.1 !important;
}

.sidebar-user-role {
    color: rgba(255,255,255,.72) !important;
    font-size: .74rem !important;
    margin-top: 2px !important;
}

.sidebar-logout-btn {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 10px 0 0 !important;
    padding: 12px 14px !important;
    background: #dc2626 !important;
    color: #fff !important;
    border-radius: 14px !important;
    font-weight: 950 !important;
    text-align: center !important;
    text-decoration: none !important;
}

.sidebar-logout-btn:hover {
    background: #b91c1c !important;
    color: #fff !important;
}

@media (max-width: 991.98px) {
    .sidebar-user-panel {
        margin-top: 10px !important;
    }
}



/* ==========================================================
   Portal IT v1.5.4.6 - FIX definitivo sidebar + móvil + runtime
   ========================================================== */

html,
body {
    max-width: 100%;
    overflow-x: hidden !important;
}

.pit-runtime {
    --bs-primary: var(--pit-primary);
}

.pit-runtime a:not(.btn):not(.sidebar a):not(.sidebar-logout-btn):not(.nav-link) {
    color: var(--pit-primary);
}

.pit-runtime .btn {
    text-decoration: none !important;
}

.pit-runtime .btn-primary,
.pit-runtime .settings-nav .nav-link.active,
.pit-runtime .nav-tabs .nav-link.active {
    background: linear-gradient(135deg, var(--pit-primary), var(--pit-primary-dark)) !important;
    border-color: transparent !important;
    color: #ffffff !important;
}

.pit-runtime .btn-secondary {
    background: #6b7280 !important;
    border-color: #6b7280 !important;
    color: #ffffff !important;
}

.pit-runtime .btn-success {
    background: #2f855a !important;
    border-color: #2f855a !important;
    color: #ffffff !important;
}

/* Sidebar desktop */
.sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: 260px !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 24px 16px 16px !important;
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%) !important;
    color: #ffffff !important;
    z-index: 1000 !important;
    border-right: 1px solid rgba(255,255,255,.06);
}

.sidebar .brand {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 10px !important;
    margin: 0 0 18px 0 !important;
    color: #ffffff !important;
    font-size: 25px !important;
    font-weight: 950 !important;
    letter-spacing: -0.04em !important;
}

.sidebar-nav {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0 2px 12px 0 !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
}

.sidebar-nav::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
}

.sidebar-section-title {
    color: rgba(203,213,225,.72) !important;
    font-size: .72rem !important;
    text-transform: uppercase !important;
    letter-spacing: .09em !important;
    font-weight: 950 !important;
    margin: 16px 8px 8px !important;
}

.sidebar a {
    color: #cbd5e1 !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-height: 45px !important;
    padding: 11px 14px !important;
    border-radius: 13px !important;
    margin-bottom: 6px !important;
    line-height: 1.2 !important;
}

.sidebar a:hover {
    background: rgba(var(--pit-primary-rgb, 37,99,235), .20) !important;
    color: #ffffff !important;
}

.sidebar a.active {
    background: var(--pit-primary, #2563eb) !important;
    color: #ffffff !important;
    box-shadow: 0 12px 30px rgba(var(--pit-primary-rgb, 37,99,235), .24) !important;
}

.sidebar a i {
    width: 18px !important;
    min-width: 18px !important;
    text-align: center !important;
}

/* Footer del usuario SIEMPRE visible en PC */
.sidebar-user-panel {
    flex: 0 0 auto !important;
    display: block !important;
    position: relative !important;
    z-index: 5 !important;
    margin: 12px 0 0 !important;
    padding: 12px !important;
    border-radius: 18px !important;
    background: rgba(255,255,255,.09) !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    box-shadow: 0 -10px 28px rgba(0,0,0,.10) !important;
}

.sidebar-user-card {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    overflow: hidden !important;
    color: #ffffff !important;
}

.sidebar-avatar,
.sidebar-user-card img,
.sidebar-avatar-initials {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

.sidebar-avatar-initials {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, var(--pit-primary, #2563eb), var(--pit-primary-dark, #1d4ed8)) !important;
    color: #ffffff !important;
    font-size: .82rem !important;
    font-weight: 950 !important;
    letter-spacing: .02em !important;
}

.sidebar-avatar-initials.sidebar-fallback-hidden {
    display: none !important;
}

.sidebar-user-text {
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.sidebar-user-name,
.sidebar-user-role {
    display: block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.sidebar-user-name {
    color: #ffffff !important;
    font-size: .88rem !important;
    font-weight: 950 !important;
    line-height: 1.1 !important;
}

.sidebar-user-role {
    color: rgba(255,255,255,.72) !important;
    font-size: .74rem !important;
    margin-top: 2px !important;
}

.sidebar-logout-btn {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 10px 0 0 0 !important;
    padding: 12px 14px !important;
    min-height: 46px !important;
    background: #dc2626 !important;
    color: #ffffff !important;
    border-radius: 14px !important;
    font-weight: 950 !important;
    text-align: center !important;
    text-decoration: none !important;
}

.sidebar-logout-btn:hover {
    background: #b91c1c !important;
    color: #ffffff !important;
}

body.sidebar-avatar-off .sidebar-avatar,
body.sidebar-avatar-off .sidebar-avatar-initials {
    display: none !important;
}

.content {
    margin-left: 260px !important;
}

/* Toggle móvil */
.mobile-menu-toggle {
    display: none !important;
}

.mobile-sidebar-backdrop {
    display: none !important;
}

/* Tema oscuro básico funcional */
body.theme-oscuro {
    --pit-bg: #0b1220;
    --pit-surface: #111827;
    --pit-surface-soft: #0f172a;
    --pit-border: rgba(51,65,85,.92);
    --pit-text: #f8fafc;
    --pit-muted: #cbd5e1;
    background: #0b1220 !important;
    color: #f8fafc !important;
}

body.theme-oscuro .content {
    background: transparent !important;
}

body.theme-oscuro .topbar,
body.theme-oscuro .card,
body.theme-oscuro .card-custom,
body.theme-oscuro .card-stat,
body.theme-oscuro .module-card,
body.theme-oscuro .profile-hero,
body.theme-oscuro .quick-card {
    background: #111827 !important;
    border-color: rgba(51,65,85,.92) !important;
    color: #f8fafc !important;
}

body.theme-oscuro h1,
body.theme-oscuro h2,
body.theme-oscuro h3,
body.theme-oscuro h4,
body.theme-oscuro h5,
body.theme-oscuro h6,
body.theme-oscuro label,
body.theme-oscuro strong {
    color: #f8fafc !important;
}

body.theme-oscuro p,
body.theme-oscuro small,
body.theme-oscuro .text-muted,
body.theme-oscuro .metric-label {
    color: #cbd5e1 !important;
}

body.theme-oscuro .form-control,
body.theme-oscuro .form-select,
body.theme-oscuro textarea {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.theme-oscuro .table,
body.theme-oscuro .table td,
body.theme-oscuro .table th {
    background: #111827 !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

/* Responsive móvil */
@media (max-width: 991.98px) {
    body {
        padding-top: calc(env(safe-area-inset-top, 0px) + 72px) !important;
        overflow-x: hidden !important;
    }

    .content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px !important;
    }

    .mobile-menu-toggle {
        display: inline-flex !important;
        position: fixed !important;
        top: calc(env(safe-area-inset-top, 0px) + 12px) !important;
        left: 14px !important;
        z-index: 2147483647 !important;
        width: 52px !important;
        height: 52px !important;
        border: 0 !important;
        border-radius: 16px !important;
        background: var(--pit-primary, #2563eb) !important;
        color: #ffffff !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 12px 30px rgba(var(--pit-primary-rgb, 37,99,235), .38) !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .mobile-menu-toggle i {
        font-size: 1.75rem !important;
        pointer-events: none !important;
    }

    .mobile-sidebar-backdrop {
        display: block !important;
        position: fixed !important;
        inset: 0 !important;
        background: rgba(15,23,42,.58) !important;
        backdrop-filter: blur(3px) !important;
        z-index: 99997 !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity .2s ease !important;
    }

    body.sidebar-open .mobile-sidebar-backdrop {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .sidebar {
        width: min(88vw, 330px) !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        transform: translateX(-115%) !important;
        transition: transform .24s ease !important;
        z-index: 99998 !important;
        padding: calc(env(safe-area-inset-top, 0px) + 72px) 14px calc(env(safe-area-inset-bottom, 0px) + 14px) !important;
        box-shadow: 24px 0 60px rgba(15,23,42,.38) !important;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0) !important;
    }
}

/* FIX color texto badges en Estado de carpetas de carga */
#sistema .system-readonly-box .badge {
    color: #ffffff !important;
}

#sistema .system-readonly-box .badge.bg-warning,
#sistema .system-readonly-box .badge.text-dark {
    color: #111827 !important;
}

/* ==========================================================
   Portal IT v1.6.0 - Módulos operativos premium
   ========================================================== */
.mod-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(245px,1fr));gap:18px;margin-bottom:24px}.mod-card{background:var(--pit-surface,#fff);border:1px solid var(--pit-border,#e5e7eb);border-radius:22px;padding:22px;box-shadow:0 14px 35px rgba(15,23,42,.08);transition:.18s ease}.mod-card:hover{transform:translateY(-2px);box-shadow:0 18px 42px rgba(15,23,42,.12)}.mod-card .icon-box{width:54px;height:54px;border-radius:16px;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-size:1.35rem;margin-bottom:14px}.mod-kpi{background:var(--pit-surface,#fff);border:1px solid var(--pit-border,#e5e7eb);border-radius:18px;padding:16px;min-height:96px}.mod-kpi small{color:var(--pit-muted,#64748b);font-weight:700}.mod-kpi strong{display:block;font-size:1.8rem;line-height:1;margin-top:8px}.timeline{position:relative;padding-left:20px}.timeline:before{content:"";position:absolute;left:5px;top:0;bottom:0;width:2px;background:#e5e7eb}.timeline-item{position:relative;margin-bottom:18px;padding:14px 16px;border-radius:16px;background:var(--pit-surface,#fff);border:1px solid var(--pit-border,#e5e7eb)}.timeline-item:before{content:"";position:absolute;left:-20px;top:18px;width:12px;height:12px;background:var(--pit-primary,#2563eb);border-radius:50%}.checklist-box{border:1px solid var(--pit-border,#e5e7eb);border-radius:18px;padding:16px;background:var(--pit-surface,#fff)}.signature-line{height:60px;border-bottom:1px solid #111;margin-top:22px}body.theme-oscuro .mod-card,body.theme-oscuro .mod-kpi,body.theme-oscuro .timeline-item,body.theme-oscuro .checklist-box{background:#111827!important;border-color:#334155!important;color:#f8fafc!important}body.theme-oscuro .timeline:before{background:#334155}@media(max-width:991.98px){.mod-grid{grid-template-columns:1fr}.table-responsive{border-radius:18px}}


/* Portal IT v1.6.1 - Formularios públicos y ajustes operativos */
.public-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 10%, rgba(var(--pit-primary-rgb, 37,99,235),.18), transparent 30%),
        linear-gradient(135deg, #f8fafc, #e2e8f0);
}

.public-shell {
    width: 100%;
    min-height: 100vh;
    padding: 32px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.public-card {
    width: 100%;
    max-width: 980px;
    background: #ffffff;
    border: 1px solid rgba(226,232,240,.9);
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(15,23,42,.14);
    padding: 32px;
}

.public-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--pit-primary, #2563eb), var(--pit-primary-dark, #1d4ed8));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex: 0 0 auto;
}

.public-hp {
    position: absolute !important;
    left: -99999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

.timeline-item {
    border-left: 4px solid rgba(var(--pit-primary-rgb, 37,99,235),.25);
    padding: 14px 16px;
    margin-bottom: 14px;
    background: rgba(248,250,252,.85);
    border-radius: 16px;
}

@media (max-width: 768px) {
    .public-card {
        padding: 22px;
        border-radius: 22px;
    }
}


/* Portal IT v1.6.3 - Solicitudes archivadas/canceladas */
.table-secondary td {
    opacity: .86;
}

.btn-outline-warning {
    border-color: #f59e0b !important;
    color: #b45309 !important;
}

.btn-outline-warning:hover {
    background: #f59e0b !important;
    color: #111827 !important;
}


/* Portal IT v1.6.4 - Formularios públicos con logo, tema y acento */
.public-page {
    --public-card-bg: #ffffff;
    --public-text: #0f172a;
    --public-muted: #64748b;
    --public-border: #e2e8f0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 10%, rgba(var(--pit-primary-rgb,37,99,235),.16), transparent 28%),
        linear-gradient(135deg, #f8fafc, #e2e8f0);
    color: var(--public-text);
}

.public-theme-oscuro {
    --public-card-bg: #111827;
    --public-text: #f8fafc;
    --public-muted: #cbd5e1;
    --public-border: #334155;
    background:
        radial-gradient(circle at 12% 10%, rgba(var(--pit-primary-rgb,37,99,235),.26), transparent 30%),
        linear-gradient(135deg, #020617, #0f172a);
}

@media (prefers-color-scheme: dark) {
    .public-theme-auto {
        --public-card-bg: #111827;
        --public-text: #f8fafc;
        --public-muted: #cbd5e1;
        --public-border: #334155;
        background:
            radial-gradient(circle at 12% 10%, rgba(var(--pit-primary-rgb,37,99,235),.26), transparent 30%),
            linear-gradient(135deg, #020617, #0f172a);
    }
}

.public-card {
    background: var(--public-card-bg) !important;
    color: var(--public-text) !important;
    border-color: var(--public-border) !important;
}

.public-card .text-muted,
.public-brand span,
.public-card small {
    color: var(--public-muted) !important;
}

.public-card .form-control,
.public-card .form-select,
.public-card textarea {
    background: color-mix(in srgb, var(--public-card-bg) 94%, white 6%) !important;
    color: var(--public-text) !important;
    border-color: var(--public-border) !important;
}

.public-card .form-control::placeholder {
    color: var(--public-muted) !important;
}

.public-icon {
    background: linear-gradient(135deg, var(--pit-primary,#2563eb), var(--pit-primary-dark,#1d4ed8)) !important;
}

.public-card .btn-primary {
    background: linear-gradient(135deg, var(--pit-primary,#2563eb), var(--pit-primary-dark,#1d4ed8)) !important;
    border-color: transparent !important;
    color: #ffffff !important;
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--public-border);
}

.public-logo {
    width: 72px;
    height: 52px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255,255,255,.72);
    padding: 6px;
}

.public-brand strong,
.public-brand span {
    display: block;
}

.public-brand strong {
    font-weight: 950;
    font-size: 1.05rem;
    color: var(--public-text);
}



/* Portal IT v1.6.6 - Botón eliminar backups programados */
.btn-outline-danger {
    border-color: #dc2626 !important;
    color: #dc2626 !important;
}

.btn-outline-danger:hover {
    background: #dc2626 !important;
    color: #ffffff !important;
}


/* Portal IT v1.6.7 - Calendario con tareas y notificaciones */
.notification-unread {
    border-left: 5px solid var(--pit-primary, #2563eb) !important;
    box-shadow: 0 14px 35px rgba(var(--pit-primary-rgb, 37,99,235),.12) !important;
}

.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 22px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--pit-primary, #2563eb);
    box-shadow: 0 0 0 4px rgba(var(--pit-primary-rgb, 37,99,235),.15);
}


/* Portal IT v1.6.7.1 - Notificaciones unificadas */
.notification-unread {
    border-left: 5px solid var(--pit-primary, #2563eb) !important;
}
.card-stat h3 {
    font-weight: 950;
}


/* Portal IT v1.6.9 - Gestión operativa de tickets */
.ticket-timeline {
    border-left: 3px solid rgba(var(--pit-primary-rgb, 37,99,235),.18);
    padding-left: 1rem;
}


/* Portal IT v1.7.0 - Seguridad formularios públicos */
.public-hp {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    pointer-events: none !important;
}
.public-submit-btn:disabled {
    cursor: wait;
    opacity: .78;
}


/* Portal IT v1.7.5 - Reportes premium */
.report-card-premium{
    transition: transform .18s ease, box-shadow .18s ease;
    border: 1px solid rgba(148,163,184,.22);
}
.report-card-premium:hover{
    transform: translateY(-4px);
    box-shadow: 0 20px 45px rgba(15,23,42,.12);
}
.reporte-table tbody tr:hover{
    background: rgba(var(--pit-primary-rgb,37,99,235),.06);
}
.reporte-print-header{
    color:#111827;
}


/* Portal IT v1.7.6 - Reportes configurados */
.reporte-header-premium{
    display:none;
    background:#fff;
    border:1px solid #d1d5db;
    border-radius:16px;
    padding:18px 22px;
    margin-bottom:16px;
    text-align:center;
}
.reporte-header-premium .reporte-logo{
    max-height:70px;
    max-width:180px;
    object-fit:contain;
    margin-bottom:8px;
}
.reporte-header-premium h2{
    margin:0;
    font-size:22px;
    font-weight:800;
    color:#111827;
}
.reporte-header-premium .reporte-subtitle{
    color:#374151;
    font-size:13px;
    margin-top:4px;
}
.reporte-header-premium .reporte-meta,
.reporte-header-premium .reporte-filtros{
    display:flex;
    justify-content:center;
    gap:14px;
    flex-wrap:wrap;
    font-size:12px;
    margin-top:8px;
    color:#111827;
}
.reporte-header-premium .reporte-pie{
    margin-top:8px;
    font-size:11px;
    color:#6b7280;
}
@media print{
    .reporte-header-premium{display:block!important;}
    .no-print{display:none!important;}
    .report-card-premium{box-shadow:none!important;}
    .card-custom{break-inside:avoid;}
}


/* Portal IT v1.7.6.1 - Fix reportes logo/panel */
.reporte-logo{
    display:inline-block;
}
@media print{
    .reporte-header-premium{
        display:block!important;
        break-inside:avoid;
        page-break-inside:avoid;
        padding:10px 14px!important;
        margin-bottom:8px!important;
    }
    .reporte-header-premium .reporte-logo{
        max-height:55px!important;
        max-width:150px!important;
    }
    .reporte-header-premium h2{
        font-size:18px!important;
    }
    .reporte-header-premium .reporte-meta,
    .reporte-header-premium .reporte-filtros{
        font-size:10px!important;
        gap:8px!important;
    }
    .reporte-kpis.no-print{
        display:none!important;
    }
    .reporte-table{
        width:100%!important;
        table-layout:auto!important;
    }
    .reporte-table td{
        max-width:220px;
        overflow-wrap:anywhere;
        word-break:normal;
    }
}


/* Portal IT v1.7.6.2 - Reportes PDF limpio y ayuda versión vigente */
.reporte-pdf-content{
    margin-left:0!important;
    padding:20px!important;
}
@media print{
    html, body{
        background:#fff!important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .reporte-pdf-content{
        margin:0!important;
        padding:0!important;
    }
    .content{
        max-width:none!important;
    }
    .card-custom:has(.reporte-table),
    .card-custom:has(.table-responsive),
    .table-responsive{
        break-inside:auto!important;
        page-break-inside:auto!important;
        overflow:visible!important;
    }
    .reporte-table{
        page-break-inside:auto!important;
    }
    .reporte-table tr{
        break-inside:avoid!important;
        page-break-inside:avoid!important;
    }
    .reporte-table th,
    .reporte-table td{
        font-size:8.5px!important;
        line-height:1.2!important;
        padding:3px 4px!important;
    }
}


/* ==========================================================
   Portal IT v1.7.8 - Login / Logout premium institucional
   ========================================================== */

/* PIT152261_DS10_TOKENS: los tokens --pit-auth-* viven en assets/css/tokens.css. */

body.auth-page {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 8% 12%, rgba(241, 169, 35, 0.12), transparent 26%),
        radial-gradient(circle at 82% 10%, rgba(5, 60, 116, 0.16), transparent 22%),
        radial-gradient(circle at 86% 76%, rgba(58, 118, 64, 0.14), transparent 26%),
        linear-gradient(135deg, #250a17 0%, #4d0124 34%, #860038 60%, #2a1530 100%) !important;
    color: #fff;
    overflow-x: hidden;
}

.auth-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 16px;
    overflow: hidden;
}

.auth-backdrop-shape {
    position: absolute;
    border-radius: 999px;
    filter: blur(8px);
    opacity: 0.38;
    pointer-events: none;
}

.auth-shape-1 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(241,169,35,.45), rgba(241,169,35,0));
    top: -110px;
    left: -80px;
}

.auth-shape-2 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(5,60,116,.44), rgba(5,60,116,0));
    right: -140px;
    top: 12%;
}

.auth-shape-3 {
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(58,118,64,.32), rgba(58,118,64,0));
    bottom: -110px;
    left: 38%;
}

.auth-container {
    position: relative;
    z-index: 2;
    max-width: 1240px;
}

.auth-panel {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--pit-auth-radius-xl);
    box-shadow: var(--pit-auth-shadow-xl);
    backdrop-filter: blur(16px);
    overflow: hidden;
}

.auth-brand-side {
    position: relative;
    padding: 42px 38px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.04)),
        linear-gradient(145deg, rgba(0,0,0,0.15), rgba(0,0,0,0.02));
    border-right: 1px solid rgba(255,255,255,0.10);
}

.auth-brand-wrap {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.auth-brand-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 28px;
}

.auth-brand-logo-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-brand-logo {
    max-width: 220px;
    max-height: 88px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,0.18));
}

.auth-brand-fallback {
    width: 82px;
    height: 82px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--pit-auth-primary), var(--pit-auth-primary-dark));
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    box-shadow: var(--pit-auth-shadow-md);
}

.auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}

.auth-chip-primary {
    background: linear-gradient(135deg, var(--pit-auth-primary), var(--pit-auth-primary-dark));
    color: #fff;
    box-shadow: 0 10px 24px rgba(114,12,19,.26);
}

.auth-brand-copy {
    margin-bottom: 30px;
}

.auth-eyebrow {
    margin: 0 0 10px;
    font-size: 12px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.74);
    font-weight: 700;
}

.auth-brand-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 1;
    font-weight: 900;
    letter-spacing: -.045em;
    color: #fff;
}

.auth-brand-subtitle {
    margin: 10px 0 10px;
    font-size: 1.08rem;
    font-weight: 600;
    color: rgba(255,255,255,0.90);
}

.auth-brand-description {
    max-width: 560px;
    margin: 0;
    color: rgba(255,255,255,0.76);
    line-height: 1.7;
    font-size: 15px;
}

.auth-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.auth-form-card,
.auth-logout-card {
    width: 100%;
    background: var(--pit-auth-surface-strong);
    border: 1px solid rgba(255,255,255,0.7);
    border-radius: 30px;
    box-shadow: var(--pit-auth-shadow-md);
    padding: 34px 34px 28px;
    color: var(--pit-auth-ink);
}

.auth-form-head {
    margin-bottom: 22px;
}

.auth-form-head h2,
.auth-logout-card h1 {
    margin: 16px 0 6px;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -.04em;
    color: #1b1520;
}

.auth-form-head p,
.auth-logout-card p {
    margin: 0;
    color: var(--pit-auth-muted);
    line-height: 1.65;
}

.auth-alert-stack {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.auth-alert-box {
    border: 0 !important;
    border-radius: 18px !important;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    padding: 14px 16px !important;
    margin-bottom: 0;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.auth-alert-box > i {
    font-size: 18px;
    margin-top: 1px;
}

.auth-form-premium {
    display: grid;
    gap: 18px;
}

.auth-field-group {
    display: grid;
    gap: 8px;
}

.auth-label {
    font-size: 13px;
    font-weight: 800;
    color: #372b38;
    margin: 0;
}

.auth-input-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    border-radius: 18px;
    border: 1px solid rgba(134, 0, 56, 0.14);
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.95);
    overflow: hidden;
    transition: all .2s ease;
}

.auth-input-wrap:focus-within {
    border-color: rgba(134, 0, 56, 0.42);
    box-shadow: 0 0 0 4px rgba(134, 0, 56, 0.08), 0 14px 25px rgba(114,12,19,0.08);
    transform: translateY(-1px);
}

.auth-input-icon {
    width: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--pit-auth-primary);
    font-size: 18px;
}

.auth-control {
    border: 0 !important;
    border-radius: 0 !important;
    min-height: 58px;
    font-size: 15px;
    box-shadow: none !important;
    padding-left: 0 !important;
    color: #281f27;
}

.auth-control::placeholder {
    color: #9b96a0;
}

.auth-password-toggle {
    width: 56px;
    height: 58px;
    border: 0;
    background: transparent;
    color: var(--pit-auth-blue);
    font-size: 18px;
}

.auth-submit-btn {
    min-height: 58px;
    border: 0 !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, var(--pit-auth-primary), var(--pit-auth-primary-dark)) !important;
    color: #fff !important;
    font-weight: 800 !important;
    font-size: 15px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 18px 34px rgba(134, 0, 56, 0.26);
    transition: transform .2s ease, box-shadow .2s ease;
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 38px rgba(134, 0, 56, 0.34);
}

.auth-submit-btn-secondary {
    background: linear-gradient(135deg, var(--pit-auth-blue), #0a5cab) !important;
    box-shadow: 0 18px 34px rgba(5, 60, 116, 0.25);
    text-decoration: none;
}

.auth-submit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(255,255,255,0.16);
}

.auth-footer-note {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(134, 0, 56, 0.10);
}

.auth-footer-note strong {
    display: block;
    color: #24171e;
    font-size: 13px;
}

.auth-footer-note span {
    display: block;
    color: var(--pit-auth-muted);
    font-size: 12px;
}

.auth-shell-logout {
    padding-top: 60px;
    padding-bottom: 60px;
}

.auth-logout-container {
    position: relative;
    z-index: 2;
    max-width: 620px;
}

.auth-logout-card {
    text-align: center;
    padding-top: 42px;
    padding-bottom: 34px;
}

.auth-logout-badge {
    width: 82px;
    height: 82px;
    border-radius: 28px;
    background: linear-gradient(135deg, var(--pit-auth-green), var(--pit-auth-green-dark));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    box-shadow: 0 18px 34px rgba(38,78,42,0.24);
    margin-bottom: 18px;
}

.auth-logout-logo-wrap {
    margin-bottom: 12px;
}

.auth-logout-logo {
    max-width: 220px;
    max-height: 84px;
    object-fit: contain;
}

.auth-logout-chip {
    margin-bottom: 6px;
}

.auth-logout-status {
    margin-top: 22px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 16px;
    background: rgba(63,108,93,0.08);
    color: #315347;
    font-weight: 600;
}

.auth-logout-loader {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(134,0,56,0.20);
    border-top-color: var(--pit-auth-primary);
    animation: authSpin .9s linear infinite;
}

.auth-logout-actions {
    margin-top: 26px;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 991.98px) {
    .auth-panel {
        grid-template-columns: 1fr;
    }

    .auth-brand-side {
        border-right: 0;
        border-bottom: 1px solid rgba(255,255,255,0.10);
    }
}

@media (max-width: 767.98px) {
    .auth-shell {
        padding: 18px 10px;
    }

    .auth-brand-side,
    .auth-form-side {
        padding: 22px;
    }

    .auth-form-card,
    .auth-logout-card {
        padding: 24px 18px 22px;
        border-radius: 24px;
    }

    .auth-brand-title {
        font-size: 2.2rem;
    }

    .auth-form-head h2,
    .auth-logout-card h1 {
        font-size: 1.7rem;
    }

    .auth-brand-top {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 575.98px) {
    .auth-footer-note {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-submit-btn,
    .auth-submit-btn-secondary {
        width: 100%;
    }
}


/* Portal IT v1.7.9 - Monitoreo de usuarios */
.pit-monitor-kpi .card-body{
    display:flex;
    align-items:center;
    gap:16px;
}
.pit-monitor-kpi small{
    display:block;
    color:var(--pit-muted, #64748b);
    font-weight:600;
}
.pit-monitor-kpi h3{
    margin:0;
    font-weight:950;
    letter-spacing:-.04em;
}
.pit-monitor-icon{
    width:56px;
    height:56px;
    border-radius:18px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    color:#fff;
    font-size:24px;
    box-shadow:0 14px 30px rgba(15,23,42,.12);
}
.pit-session-list{
    display:grid;
    gap:14px;
    max-height:720px;
    overflow:auto;
    padding-right:4px;
}
.pit-session-item{
    display:grid;
    grid-template-columns:auto 1fr;
    gap:14px;
    padding:16px;
    border:1px solid rgba(226,232,240,.9);
    border-radius:22px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,250,252,.9));
    box-shadow:0 10px 24px rgba(15,23,42,.045);
}
.pit-session-avatar{
    width:46px;
    height:46px;
    border-radius:16px;
    background:linear-gradient(135deg,#860038,#720C13);
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:900;
    box-shadow:0 10px 22px rgba(134,0,56,.18);
}
.pit-session-main{
    min-width:0;
}
.pit-session-meta{
    display:flex;
    flex-wrap:wrap;
    gap:8px 14px;
    margin:8px 0;
    color:#64748b;
    font-size:12.5px;
}
.pit-session-meta span{
    display:inline-flex;
    align-items:center;
    gap:5px;
}
.pit-monitor-table th{
    white-space:nowrap;
}
.pit-monitor-table td{
    vertical-align:top;
}
@media (max-width: 768px){
    .pit-session-list{max-height:none;}
    .pit-session-item{grid-template-columns:1fr;}
}


/* ==========================================================
   Portal IT 1.9.7.143 - Login institucional refinado
   Consolidación de 1.8.1 / 1.8.2 / 1.8.3.
   Mantiene el login simple, accesible y rápido.
   ========================================================== */

body.auth-page.auth-refined-login {
    min-height: 100vh;
    padding: 0 !important;
    background:
        radial-gradient(circle at 8% 10%, rgba(241,169,35,.10), transparent 26%),
        radial-gradient(circle at 86% 8%, rgba(5,60,116,.14), transparent 24%),
        radial-gradient(circle at 84% 82%, rgba(58,118,64,.11), transparent 28%),
        linear-gradient(135deg, #260a18 0%, #4e0125 34%, #830037 60%, #28142e 100%) !important;
}

.auth-refined-login .auth-shell {
    min-height: 100vh;
    padding: 34px 16px;
}

.auth-refined-login .auth-container {
    max-width: 1120px;
}

.auth-refined-login .auth-panel {
    grid-template-columns: 1.04fr .96fr;
    border-radius: 30px;
    background: rgba(255,255,255,.075);
    border-color: rgba(255,255,255,.13);
    box-shadow:
        0 24px 64px rgba(12,5,14,.30),
        inset 0 1px 0 rgba(255,255,255,.08);
    animation: pitAuth143PanelIn .34s cubic-bezier(.2,.8,.2,1) both;
}

.auth-refined-login .auth-brand-side {
    padding: 48px 42px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.035)),
        linear-gradient(145deg, rgba(0,0,0,.12), rgba(0,0,0,.02));
}

.auth-refined-login .auth-brand-wrap {
    min-height: 390px;
}

.auth-refined-login .auth-brand-top {
    justify-content: flex-start;
    margin-bottom: 36px;
}

.auth-refined-login .auth-brand-logo-wrap {
    width: fit-content;
    max-width: 100%;
    padding: 12px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(255,255,255,.72);
    box-shadow: 0 14px 30px rgba(24,7,17,.16);
}

.auth-refined-login .auth-brand-logo {
    display: block;
    max-width: 210px;
    max-height: 74px;
    filter: none;
}

.auth-refined-login .auth-brand-copy {
    max-width: 540px;
    margin-bottom: 34px;
}

.auth-refined-login .auth-eyebrow {
    margin-bottom: 12px;
    color: rgba(255,255,255,.74);
    font-size: 11px;
    letter-spacing: .19em;
}

.auth-refined-login .auth-brand-title {
    font-size: clamp(2.55rem, 4vw, 3.55rem);
}

.auth-refined-login .auth-brand-subtitle {
    margin-top: 12px;
    margin-bottom: 8px;
}

.auth-refined-login .auth-brand-description {
    font-size: 15px;
    line-height: 1.6;
}

.auth-refined-login .auth-form-side {
    padding: 30px;
}

.auth-refined-login .auth-form-card {
    padding: 38px 34px 26px;
    border-radius: 28px;
    box-shadow:
        0 20px 46px rgba(12,5,14,.18),
        inset 0 1px 0 rgba(255,255,255,.92);
    animation: pitAuth143CardIn .38s cubic-bezier(.2,.8,.2,1) .03s both;
}

.auth-refined-login .auth-mobile-brand {
    display: none;
}

.auth-refined-login .auth-form-head {
    margin-bottom: 22px;
}

.auth-refined-login .auth-form-head h2 {
    margin: 0 0 8px;
    font-size: clamp(1.85rem, 3vw, 2.25rem);
    line-height: 1.08;
}

.auth-refined-login .auth-form-head p {
    font-size: .96rem;
    line-height: 1.55;
}

.auth-refined-login .auth-alert-stack {
    gap: 10px;
    margin-bottom: 18px;
}

.auth-refined-login .auth-alert-box {
    border-radius: 15px !important;
    padding: 12px 14px !important;
    box-shadow: none;
}

.auth-refined-login .auth-sso-block {
    display: grid;
    gap: 9px;
    margin-bottom: 18px;
}

.auth-refined-login .auth-google-btn {
    width: 100%;
    min-height: 56px;
    background: linear-gradient(135deg, var(--pit-auth-primary), var(--pit-auth-primary-dark)) !important;
    color: #fff !important;
    border: 0 !important;
    box-shadow: 0 16px 30px rgba(134,0,56,.23);
}

.auth-refined-login .auth-google-btn:hover {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 20px 34px rgba(134,0,56,.30);
}

.auth-refined-login .auth-google-icon {
    background: #fff !important;
    color: #db4437 !important;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}

.auth-refined-login .auth-sso-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #77727a;
    font-size: 12.5px;
}

.auth-refined-login .auth-sso-hint i {
    color: var(--pit-auth-primary);
}

.auth-refined-login .auth-sso-unavailable {
    margin-bottom: 18px;
}

.auth-refined-login .auth-form-premium {
    gap: 16px;
}

.auth-refined-login .auth-local-divider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2px 0 0;
    color: #8a838d;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.auth-refined-login .auth-local-divider::before,
.auth-refined-login .auth-local-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: rgba(134,0,56,.11);
}

.auth-refined-login .auth-local-divider span {
    padding: 0 12px;
}

.auth-refined-login .auth-local-heading {
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(5,60,116,.055);
    border: 1px solid rgba(5,60,116,.10);
}

.auth-refined-login .auth-local-heading strong {
    color: #251b22;
    font-size: 13px;
}

.auth-refined-login .auth-local-heading small {
    color: #716a74;
    font-size: 12px;
}

.auth-refined-login .auth-field-group {
    gap: 7px;
}

.auth-refined-login .auth-label {
    font-size: 12.5px;
}

.auth-refined-login .auth-input-wrap {
    min-height: 54px;
    border-radius: 16px;
    transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.auth-refined-login .auth-input-wrap:focus-within {
    transform: translateY(-.5px);
}

.auth-refined-login .auth-control {
    min-height: 54px;
}

.auth-refined-login .auth-password-toggle {
    height: 54px;
}

.auth-refined-login .auth-submit-btn {
    min-height: 56px;
    border-radius: 16px !important;
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}

.auth-refined-login .auth-submit-btn:active {
    transform: translateY(0);
}

.auth-refined-login .auth-alternate-access {
    display: flex;
    justify-content: center;
    margin: 6px 0 0;
    text-align: center;
}

.auth-refined-login .auth-alternate-access a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #716a74;
    font-size: 12.5px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-refined-login .auth-alternate-access a:hover {
    color: var(--pit-auth-primary);
}

.auth-refined-login .auth-footer-note {
    align-items: center;
    margin-top: 22px;
    padding-top: 16px;
}

.auth-refined-login .auth-footer-security {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    color: #746c75 !important;
    font-size: 11.5px !important;
    white-space: nowrap;
}

.auth-refined-login .auth-footer-security i {
    color: var(--pit-auth-green);
}

.auth-refined-login a:focus-visible,
.auth-refined-login button:focus-visible,
.auth-refined-login input:focus-visible {
    outline: 3px solid rgba(5,60,116,.34) !important;
    outline-offset: 3px;
}

.auth-refined-login .auth-shape-1,
.auth-refined-login .auth-shape-2,
.auth-refined-login .auth-shape-3 {
    filter: blur(20px);
    opacity: .24;
    animation: pitAuth143Glow 8s ease-in-out infinite alternate;
}

.auth-refined-login .auth-shape-2 { animation-delay: .8s; }
.auth-refined-login .auth-shape-3 { animation-delay: 1.4s; }

@keyframes pitAuth143PanelIn {
    from { opacity: 0; transform: translateY(9px) scale(.994); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pitAuth143CardIn {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pitAuth143Glow {
    from { transform: translate3d(0,0,0) scale(1); opacity: .20; }
    to { transform: translate3d(10px,-7px,0) scale(1.02); opacity: .29; }
}

@media (max-width: 991.98px) {
    body.auth-page.auth-refined-login {
        padding-top: 0 !important;
    }

    .auth-refined-login .auth-shell {
        min-height: 100svh;
        padding: 20px 14px 28px;
    }

    .auth-refined-login .auth-container {
        max-width: 760px;
    }

    .auth-refined-login .auth-panel {
        grid-template-columns: 1fr;
    }

    .auth-refined-login .auth-form-side {
        order: 1;
        padding: 22px;
    }

    .auth-refined-login .auth-brand-side {
        order: 2;
        padding: 24px;
        border-right: 0;
        border-top: 1px solid rgba(255,255,255,.10);
        border-bottom: 0;
    }

    .auth-refined-login .auth-brand-wrap {
        min-height: 0;
    }

    .auth-refined-login .auth-brand-top {
        margin-bottom: 22px;
    }
}

@media (max-width: 767.98px) {
    body.auth-page.auth-refined-login {
        overflow-x: hidden;
    }

    .auth-refined-login .auth-shell {
        padding: max(12px, env(safe-area-inset-top)) 10px max(18px, env(safe-area-inset-bottom));
    }

    .auth-refined-login .auth-panel {
        display: block;
        border-radius: 24px;
        overflow: hidden;
    }

    .auth-refined-login .auth-brand-side {
        display: none;
    }

    .auth-refined-login .auth-form-side {
        padding: 12px;
    }

    .auth-refined-login .auth-form-card {
        padding: 20px 17px 18px;
        border-radius: 21px;
    }

    .auth-refined-login .auth-mobile-brand {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 22px;
        padding-bottom: 16px;
        border-bottom: 1px solid rgba(134,0,56,.10);
    }

    .auth-refined-login .auth-mobile-brand img {
        width: 96px;
        max-height: 48px;
        object-fit: contain;
    }

    .auth-refined-login .auth-mobile-brand div {
        min-width: 0;
    }

    .auth-refined-login .auth-mobile-brand strong,
    .auth-refined-login .auth-mobile-brand span {
        display: block;
    }

    .auth-refined-login .auth-mobile-brand strong {
        color: #21161d;
        font-size: 14px;
        font-weight: 900;
    }

    .auth-refined-login .auth-mobile-brand span {
        margin-top: 2px;
        color: #777079;
        font-size: 11px;
        line-height: 1.2;
    }

    .auth-refined-login .auth-form-head h2 {
        font-size: 1.85rem;
    }

    .auth-refined-login .auth-form-head p {
        font-size: .93rem;
    }

    .auth-refined-login .auth-control {
        font-size: 16px !important;
    }

    .auth-refined-login .auth-footer-note {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .auth-refined-login .auth-footer-security {
        white-space: normal;
    }
}

@media (max-width: 399.98px) {
    .auth-refined-login .auth-form-card {
        padding-left: 14px;
        padding-right: 14px;
    }

    .auth-refined-login .auth-form-head h2 {
        font-size: 1.68rem;
    }

    .auth-refined-login .auth-mobile-brand img {
        width: 82px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-refined-login,
    .auth-refined-login *,
    .auth-refined-login *::before,
    .auth-refined-login *::after {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

/* Portal IT 1.9.5.8 - QR, calidad de datos y línea de tiempo de activos */
.asset-detail-image {
    width: 100%;
    max-width: 290px;
    height: 230px;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    padding: 10px;
}

.qr-label-preview,
.qr-batch-label {
    background: #fff;
    border: 2px solid #0f172a;
    border-radius: 14px;
    padding: 12px;
    color: #0f172a;
    break-inside: avoid;
}

.qr-label-preview {
    width: min(100%, 460px);
}

.qr-label-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #cbd5e1;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.qr-label-brand img {
    max-width: 110px;
    height: 32px;
    object-fit: contain;
}

.qr-label-body {
    display: flex;
    align-items: center;
    gap: 14px;
}

.qr-render {
    flex: 0 0 auto;
    line-height: 0;
}

.qr-render svg {
    display: block;
}

.qr-label-info {
    min-width: 0;
}

.qr-label-code {
    font-weight: 900;
    font-size: 1.25rem;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.qr-label-name {
    font-weight: 750;
    margin: 5px 0;
    line-height: 1.15;
}

.qr-label-meta {
    color: #475569;
    font-size: .82rem;
    line-height: 1.2;
}

.qr-sheet {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.qr-batch-label .qr-label-body {
    gap: 9px;
}

.qr-batch-label .qr-label-code {
    font-size: 1rem;
}

.qr-batch-label .qr-label-name {
    font-size: .88rem;
}

.asset-timeline {
    position: relative;
}

.asset-timeline::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 22px;
    width: 2px;
    background: #e2e8f0;
}

.asset-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    padding-bottom: 22px;
}

.asset-timeline-item:last-child {
    padding-bottom: 0;
}

.asset-timeline-marker {
    position: relative;
    z-index: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 0 0 5px #fff;
}

.asset-timeline-content {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 15px 17px;
}

.asset-timeline-compact .asset-timeline-item {
    padding-bottom: 12px;
}

.asset-timeline-compact .asset-timeline-content {
    padding: 11px 14px;
}

.asset-timeline-compact .asset-timeline-marker {
    width: 38px;
    height: 38px;
}

.asset-timeline-compact::before {
    left: 19px;
}

@media (max-width: 767.98px) {
    .qr-sheet {
        grid-template-columns: 1fr;
    }

    .qr-label-body {
        align-items: flex-start;
    }

    .asset-timeline-item {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 10px;
    }

    .asset-timeline-marker {
        width: 36px;
        height: 36px;
    }

    .asset-timeline::before {
        left: 18px;
    }
}

@media print {
    .no-print,
    .sidebar,
    .mobile-menu-toggle,
    .mobile-sidebar-backdrop {
        display: none !important;
    }

    body {
        background: #fff !important;
    }

    .content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .qr-label-preview {
        width: 92mm;
        margin: 0 auto;
        box-shadow: none;
    }

    .qr-sheet {
        grid-template-columns: repeat(2, 92mm);
        gap: 5mm;
        justify-content: center;
    }

    .qr-batch-label {
        min-height: 48mm;
        border-radius: 4mm;
        box-shadow: none;
    }

    @page {
        size: letter;
        margin: 10mm;
    }
}


/* Portal IT 1.9.5.9 - Inventario físico, escaneo QR y conciliación */
.inventory-scan-content .card-custom { overflow: visible; }
.inventory-camera {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: #0f172a;
    min-height: 260px;
}
.inventory-camera video {
    width: 100%;
    min-height: 260px;
    object-fit: cover;
    display: block;
}
.inventory-camera-guide {
    position: absolute;
    inset: 50% auto auto 50%;
    width: min(68%, 280px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255,255,255,.9);
    border-radius: 22px;
    box-shadow: 0 0 0 999px rgba(15,23,42,.35);
    pointer-events: none;
}
.inventory-camera-stop {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}
.inventory-event-list .inventory-event-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    background: rgba(var(--pit-primary-rgb, 37,99,235), .12);
    color: var(--pit-primary, #2563eb);
    display: grid;
    place-items: center;
    font-size: 22px;
}
@media (max-width: 767px) {
    .inventory-scan-content { padding-left: 12px; padding-right: 12px; }
    .inventory-camera, .inventory-camera video { min-height: 230px; }
}

/* ==========================================================
   Portal IT v1.9.7.7 - Corrección tema oscuro + tema institucional OTEIMA
   ========================================================== */

/* ---------- Tema oscuro reforzado ---------- */
body.theme-oscuro {
    --pit-bg: #0b1220;
    --pit-surface: #111827;
    --pit-surface-elevated: #162033;
    --pit-surface-soft: #0f172a;
    --pit-border: rgba(71, 85, 105, .78);
    --pit-text: #f8fafc;
    --pit-muted: #cbd5e1;
    --bs-body-bg: #0b1220;
    --bs-body-color: #f8fafc;
    --bs-border-color: rgba(71, 85, 105, .78);
    background:
        radial-gradient(circle at 12% 5%, rgba(var(--pit-primary-rgb,37,99,235), .12), transparent 28%),
        radial-gradient(circle at 88% 0%, rgba(14, 165, 233, .10), transparent 30%),
        #0b1220 !important;
    color: #f8fafc !important;
}

body.theme-oscuro .topbar,
body.theme-oscuro .card,
body.theme-oscuro .card-custom,
body.theme-oscuro .card-stat,
body.theme-oscuro .module-card,
body.theme-oscuro .profile-hero,
body.theme-oscuro .quick-card,
body.theme-oscuro .mod-card,
body.theme-oscuro .mod-kpi,
body.theme-oscuro .timeline-item,
body.theme-oscuro .checklist-box,
body.theme-oscuro .dashboard-filter,
body.theme-oscuro .dashboard-smart .dash-card,
body.theme-oscuro .dashboard-smart .priority-panel,
body.theme-oscuro .dashboard-smart .quick-action,
body.theme-oscuro .dashboard-smart .activity-row,
body.theme-oscuro .tech-search-card,
body.theme-oscuro .tech-kpi-strip > div,
body.theme-oscuro .tech-action-btn,
body.theme-oscuro .tech-task-card,
body.theme-oscuro .tech-list-item,
body.theme-oscuro .tech-bottom-nav,
body.theme-oscuro .profile-info-grid > div,
body.theme-oscuro .role-card-premium,
body.theme-oscuro .system-readonly-box,
body.theme-oscuro .settings-summary-item,
body.theme-oscuro .list-group-item,
body.theme-oscuro .dropdown-menu,
body.theme-oscuro .modal-content,
body.theme-oscuro .bg-white,
body.theme-oscuro .bg-light {
    background: var(--pit-surface) !important;
    border-color: var(--pit-border) !important;
    color: var(--pit-text) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .24) !important;
}

body.theme-oscuro .card-header,
body.theme-oscuro .card-footer,
body.theme-oscuro .table-light,
body.theme-oscuro .table thead th,
body.theme-oscuro .modal-header,
body.theme-oscuro .modal-footer,
body.theme-oscuro .dropdown-divider {
    background: var(--pit-surface-soft) !important;
    border-color: var(--pit-border) !important;
    color: var(--pit-text) !important;
}

body.theme-oscuro .dashboard-smart .section-heading,
body.theme-oscuro .dashboard-smart .dash-value,
body.theme-oscuro .dashboard-smart .priority-title,
body.theme-oscuro .dashboard-smart .priority-number,
body.theme-oscuro .dashboard-smart .table-clean th,
body.theme-oscuro .tech-kpi-strip span,
body.theme-oscuro .tech-action-btn,
body.theme-oscuro .tech-action-btn:hover,
body.theme-oscuro .tech-action-btn strong,
body.theme-oscuro .tech-list-item,
body.theme-oscuro .tech-list-item:hover,
body.theme-oscuro .tech-list-item strong,
body.theme-oscuro .quick-card,
body.theme-oscuro .quick-card:hover,
body.theme-oscuro .profile-info-grid strong,
body.theme-oscuro .role-card-premium,
body.theme-oscuro .system-readonly-box strong,
body.theme-oscuro .table,
body.theme-oscuro .table th,
body.theme-oscuro .table td,
body.theme-oscuro .list-group-item h5,
body.theme-oscuro .list-group-item p,
body.theme-oscuro .dropdown-item {
    color: var(--pit-text) !important;
}

body.theme-oscuro .text-muted,
body.theme-oscuro small,
body.theme-oscuro .metric-label,
body.theme-oscuro .dash-label,
body.theme-oscuro .dash-subtitle,
body.theme-oscuro .dashboard-smart .section-heading small,
body.theme-oscuro .dashboard-smart .priority-sub,
body.theme-oscuro .tech-kpi-strip small,
body.theme-oscuro .tech-action-btn small,
body.theme-oscuro .tech-list-item small,
body.theme-oscuro .quick-card span,
body.theme-oscuro .profile-info-grid span,
body.theme-oscuro .system-readonly-box span,
body.theme-oscuro .system-readonly-box .text-muted {
    color: var(--pit-muted) !important;
}

body.theme-oscuro .form-control,
body.theme-oscuro .form-select,
body.theme-oscuro textarea,
body.theme-oscuro .input-group-text {
    background: var(--pit-surface-soft) !important;
    border-color: var(--pit-border) !important;
    color: var(--pit-text) !important;
}

body.theme-oscuro .form-control::placeholder,
body.theme-oscuro textarea::placeholder {
    color: rgba(203, 213, 225, .62) !important;
}

body.theme-oscuro .table-responsive,
body.theme-oscuro .table,
body.theme-oscuro .table td,
body.theme-oscuro .table th,
body.theme-oscuro .border,
body.theme-oscuro .border-bottom,
body.theme-oscuro .border-top {
    border-color: var(--pit-border) !important;
}

body.theme-oscuro .dashboard-smart .hero-status,
body.theme-oscuro .tech-hero {
    background: linear-gradient(135deg, #0f172a, var(--pit-primary-dark, #1d4ed8)) !important;
    color: #fff !important;
    border-color: rgba(148, 163, 184, .20) !important;
}

body.theme-oscuro .dashboard-smart .quick-action:hover,
body.theme-oscuro .tech-list-item:hover,
body.theme-oscuro .dropdown-item:hover {
    background: var(--pit-surface-elevated) !important;
}

body.theme-oscuro .tech-action-primary,
body.theme-oscuro .tech-action-dark,
body.theme-oscuro .tech-action-danger,
body.theme-oscuro .tech-action-success {
    background: var(--pit-surface) !important;
}

body.theme-oscuro .badge.bg-light,
body.theme-oscuro .badge.text-dark {
    color: #111827 !important;
}

body.theme-oscuro .btn-outline-dark {
    color: #f8fafc !important;
    border-color: #94a3b8 !important;
}

body.theme-oscuro .btn-outline-dark:hover {
    background: #f8fafc !important;
    color: #111827 !important;
}

/* ---------- Tema Institucional OTEIMA ---------- */
body.theme-institucional {
    --pit-bg: #f8f3f5;
    --pit-surface: #ffffff;
    --pit-surface-elevated: #fff8fb;
    --pit-surface-soft: #fdf2f6;
    --pit-border: rgba(134, 0, 56, .16);
    --pit-text: #23171f;
    --pit-muted: #6d5c67;
    --pit-primary: #860038;
    --pit-primary-dark: #720C13;
    --pit-primary-rgb: 134, 0, 56;
    --pit-blue: #053C74;
    --pit-blue-rgb: 5, 60, 116;
    --pit-gold: #F1A923;
    --bs-primary: #860038;
    --bs-primary-rgb: 134, 0, 56;
    --bs-body-bg: #f8f3f5;
    --bs-body-color: #23171f;
    background:
        radial-gradient(circle at 14% 4%, rgba(134, 0, 56, .10), transparent 28%),
        radial-gradient(circle at 86% 0%, rgba(5, 60, 116, .11), transparent 30%),
        linear-gradient(135deg, #fffafb 0%, #f3f7fb 100%) !important;
    color: var(--pit-text) !important;
}

body.theme-institucional .sidebar {
    background:
        linear-gradient(180deg, rgba(114, 12, 19, .98) 0%, rgba(134, 0, 56, .96) 45%, rgba(5, 60, 116, .98) 100%) !important;
    border-right-color: rgba(255, 255, 255, .12) !important;
}

body.theme-institucional .sidebar a.active,
body.theme-institucional .mobile-menu-toggle {
    background: linear-gradient(135deg, #F1A923, #d58a00) !important;
    color: #2b1900 !important;
    box-shadow: 0 14px 30px rgba(241, 169, 35, .26) !important;
}

body.theme-institucional .sidebar a:hover {
    background: rgba(255, 255, 255, .14) !important;
    color: #ffffff !important;
}

body.theme-institucional .topbar,
body.theme-institucional .card,
body.theme-institucional .card-custom,
body.theme-institucional .card-stat,
body.theme-institucional .module-card,
body.theme-institucional .profile-hero,
body.theme-institucional .quick-card,
body.theme-institucional .mod-card,
body.theme-institucional .mod-kpi,
body.theme-institucional .dashboard-filter,
body.theme-institucional .dashboard-smart .dash-card,
body.theme-institucional .dashboard-smart .priority-panel,
body.theme-institucional .dashboard-smart .quick-action,
body.theme-institucional .tech-search-card,
body.theme-institucional .tech-kpi-strip > div,
body.theme-institucional .tech-action-btn,
body.theme-institucional .tech-task-card,
body.theme-institucional .tech-list-item,
body.theme-institucional .profile-info-grid > div,
body.theme-institucional .role-card-premium,
body.theme-institucional .system-readonly-box,
body.theme-institucional .settings-summary-item,
body.theme-institucional .list-group-item,
body.theme-institucional .bg-white,
body.theme-institucional .bg-light {
    background: var(--pit-surface) !important;
    border-color: var(--pit-border) !important;
    color: var(--pit-text) !important;
    box-shadow: 0 16px 38px rgba(64, 21, 38, .08) !important;
}

body.theme-institucional .topbar,
body.theme-institucional .profile-hero {
    background:
        radial-gradient(circle at 6% 10%, rgba(134, 0, 56, .08), transparent 30%),
        radial-gradient(circle at 92% 0%, rgba(5, 60, 116, .08), transparent 32%),
        #ffffff !important;
}

body.theme-institucional .dashboard-smart .hero-status,
body.theme-institucional .tech-hero {
    background: linear-gradient(135deg, #720C13 0%, #860038 45%, #053C74 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255,255,255,.12) !important;
}

body.theme-institucional .btn-primary,
body.theme-institucional .settings-nav .nav-link.active,
body.theme-institucional .nav-tabs .nav-link.active,
body.theme-institucional .tech-scan-main {
    background: linear-gradient(135deg, #860038, #720C13) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 14px 30px rgba(134, 0, 56, .24) !important;
}

body.theme-institucional .btn-outline-primary {
    color: #860038 !important;
    border-color: rgba(134, 0, 56, .55) !important;
}

body.theme-institucional .btn-outline-primary:hover {
    background: #860038 !important;
    color: #ffffff !important;
}

body.theme-institucional .btn-success {
    background: #3A7640 !important;
    border-color: #3A7640 !important;
}

body.theme-institucional .btn-warning,
body.theme-institucional .badge.bg-warning {
    background: #F1A923 !important;
    border-color: #F1A923 !important;
    color: #2b1900 !important;
}

body.theme-institucional .form-control,
body.theme-institucional .form-select,
body.theme-institucional textarea,
body.theme-institucional .input-group-text {
    background: #ffffff !important;
    border-color: rgba(134, 0, 56, .18) !important;
    color: var(--pit-text) !important;
}

body.theme-institucional .form-control:focus,
body.theme-institucional .form-select:focus,
body.theme-institucional textarea:focus {
    border-color: rgba(134, 0, 56, .46) !important;
    box-shadow: 0 0 0 .22rem rgba(134, 0, 56, .10) !important;
}

body.theme-institucional .text-muted,
body.theme-institucional small,
body.theme-institucional .metric-label,
body.theme-institucional .dash-label,
body.theme-institucional .dash-subtitle,
body.theme-institucional .profile-info-grid span,
body.theme-institucional .system-readonly-box span,
body.theme-institucional .tech-kpi-strip small,
body.theme-institucional .tech-action-btn small,
body.theme-institucional .tech-list-item small {
    color: var(--pit-muted) !important;
}

body.theme-institucional .metric-value,
body.theme-institucional .dash-value,
body.theme-institucional .dashboard-smart .priority-title,
body.theme-institucional .dashboard-smart .priority-number,
body.theme-institucional .tech-kpi-strip span,
body.theme-institucional .profile-info-grid strong,
body.theme-institucional .system-readonly-box strong {
    color: var(--pit-text) !important;
}

body.theme-institucional .dashboard-smart .section-heading i,
body.theme-institucional a:not(.btn):not(.sidebar a):not(.sidebar-logout-btn):not(.nav-link),
body.theme-institucional .quick-card:hover,
body.theme-institucional .dashboard-smart .quick-action:hover {
    color: #860038 !important;
}

body.theme-institucional .dashboard-smart .activity-icon,
body.theme-institucional .pill-soft {
    background: rgba(134, 0, 56, .08) !important;
    color: #860038 !important;
}

body.theme-institucional .icon-box,
body.theme-institucional .sidebar-avatar-initials {
    background: linear-gradient(135deg, #860038, #053C74) !important;
}

body.theme-institucional .tech-action-primary,
body.theme-institucional .quick-primary {
    border-color: rgba(134, 0, 56, .22) !important;
    background: #fff8fb !important;
    color: #860038 !important;
}

body.theme-institucional .tech-action-dark,
body.theme-institucional .quick-dark {
    border-color: rgba(5, 60, 116, .20) !important;
    background: #f3f7fb !important;
    color: #053C74 !important;
}

body.theme-institucional .tech-action-danger {
    border-color: rgba(134, 0, 56, .20) !important;
    background: #fff2f6 !important;
}

body.theme-institucional .tech-action-success {
    border-color: rgba(58, 118, 64, .22) !important;
    background: #f2fbf4 !important;
}

/* Tema automático: conserva claro, pero usa oscuro cuando el sistema operativo esté en oscuro. */
@media (prefers-color-scheme: dark) {
    body.theme-auto {
        --pit-bg: #0b1220;
        --pit-surface: #111827;
        --pit-surface-soft: #0f172a;
        --pit-border: rgba(71, 85, 105, .78);
        --pit-text: #f8fafc;
        --pit-muted: #cbd5e1;
        background: #0b1220 !important;
        color: #f8fafc !important;
    }

    body.theme-auto .card,
    body.theme-auto .card-custom,
    body.theme-auto .card-stat,
    body.theme-auto .module-card,
    body.theme-auto .topbar,
    body.theme-auto .bg-white,
    body.theme-auto .list-group-item {
        background: var(--pit-surface) !important;
        color: var(--pit-text) !important;
        border-color: var(--pit-border) !important;
    }
}

/* ==========================================================================
   PIT152115_UI1_INSTITUCIONAL_V2
   Tema institucional OTEIMA v2 + densidad equilibrada para zoom 100%.
   Solo presentación. No modifica impresión/PDF ni lógica funcional.
   ========================================================================== */
@media screen {
    body.theme-institucional {
        --pit-bg: #f7f5f6;
        --pit-surface: #ffffff;
        --pit-surface-elevated: #fffafb;
        --pit-surface-soft: #f9f1f4;
        --pit-border: rgba(134, 0, 56, .14);
        --pit-text: #24171e;
        --pit-muted: #74646d;
        --pit-primary: #860038;
        --pit-primary-dark: #6f002f;
        --pit-primary-rgb: 134, 0, 56;
        --pit-radius-xl: 16px;
        --pit-radius-lg: 13px;
        --pit-shadow: 0 12px 30px rgba(76, 17, 42, .07);
        --pit-shadow-soft: 0 7px 20px rgba(76, 17, 42, .055);
        --bs-primary: #860038;
        --bs-primary-rgb: 134, 0, 56;
        --bs-body-bg: #f7f5f6;
        --bs-body-color: #24171e;
        background:
            radial-gradient(circle at 12% 4%, rgba(134, 0, 56, .055), transparent 25%),
            linear-gradient(180deg, #fbfafb 0%, #f4f2f3 100%) !important;
    }

    body.theme-institucional .sidebar {
        background: linear-gradient(180deg, #72002f 0%, #860038 52%, #5f0028 100%) !important;
        border-right: 1px solid rgba(255,255,255,.10) !important;
        box-shadow: 10px 0 32px rgba(73, 0, 31, .10) !important;
    }

    body.theme-institucional .sidebar a.active {
        background: #ffffff !important;
        color: #860038 !important;
        box-shadow: 0 8px 22px rgba(58, 0, 25, .20) !important;
    }

    body.theme-institucional .sidebar a.active i {
        color: #860038 !important;
    }

    body.theme-institucional .sidebar a:hover:not(.active) {
        background: rgba(255,255,255,.12) !important;
        color: #ffffff !important;
    }

    body.theme-institucional .sidebar-section-title {
        color: rgba(255,255,255,.66) !important;
    }

    body.theme-institucional .sidebar-user-panel {
        background: rgba(255,255,255,.09) !important;
        border-color: rgba(255,255,255,.14) !important;
        box-shadow: none !important;
    }

    body.theme-institucional .sidebar-logout-btn {
        background: #ffffff !important;
        color: #860038 !important;
        border: 1px solid rgba(255,255,255,.72) !important;
        box-shadow: none !important;
    }

    body.theme-institucional .sidebar-logout-btn:hover {
        background: #f9eef3 !important;
        color: #6f002f !important;
    }

    body.theme-institucional .topbar,
    body.theme-institucional .card,
    body.theme-institucional .card-custom,
    body.theme-institucional .card-stat,
    body.theme-institucional .module-card,
    body.theme-institucional .profile-hero,
    body.theme-institucional .quick-card,
    body.theme-institucional .mod-card,
    body.theme-institucional .mod-kpi,
    body.theme-institucional .dashboard-filter,
    body.theme-institucional .dashboard-smart .dash-card,
    body.theme-institucional .dashboard-smart .priority-panel,
    body.theme-institucional .dashboard-smart .quick-action,
    body.theme-institucional .tech-search-card,
    body.theme-institucional .tech-kpi-strip > div,
    body.theme-institucional .tech-action-btn,
    body.theme-institucional .tech-task-card,
    body.theme-institucional .tech-list-item,
    body.theme-institucional .profile-info-grid > div,
    body.theme-institucional .role-card-premium,
    body.theme-institucional .system-readonly-box,
    body.theme-institucional .settings-summary-item,
    body.theme-institucional .list-group-item,
    body.theme-institucional .bg-white,
    body.theme-institucional .bg-light {
        background: #ffffff !important;
        border-color: rgba(134, 0, 56, .12) !important;
        color: var(--pit-text) !important;
        box-shadow: var(--pit-shadow-soft) !important;
    }

    body.theme-institucional .topbar,
    body.theme-institucional .profile-hero {
        background:
            linear-gradient(90deg, rgba(134,0,56,.045), transparent 28%),
            #ffffff !important;
        border-top: 3px solid #860038 !important;
    }

    body.theme-institucional .dashboard-smart .hero-status,
    body.theme-institucional .tech-hero {
        background: linear-gradient(135deg, #68002b 0%, #860038 54%, #a31350 100%) !important;
        color: #ffffff !important;
        border: 1px solid rgba(255,255,255,.14) !important;
        box-shadow: 0 14px 34px rgba(92, 0, 38, .20) !important;
    }

    body.theme-institucional .btn-primary,
    body.theme-institucional .settings-nav .nav-link.active,
    body.theme-institucional .nav-tabs .nav-link.active,
    body.theme-institucional .tech-scan-main {
        background: #860038 !important;
        border-color: #860038 !important;
        color: #ffffff !important;
        box-shadow: 0 8px 18px rgba(134, 0, 56, .18) !important;
    }

    body.theme-institucional .btn-primary:hover,
    body.theme-institucional .settings-nav .nav-link.active:hover,
    body.theme-institucional .tech-scan-main:hover {
        background: #6f002f !important;
        border-color: #6f002f !important;
        transform: translateY(-1px);
        box-shadow: 0 10px 22px rgba(134, 0, 56, .22) !important;
    }

    body.theme-institucional .btn-outline-primary {
        color: #860038 !important;
        border-color: rgba(134,0,56,.48) !important;
        background: #ffffff !important;
    }

    body.theme-institucional .btn-outline-primary:hover {
        color: #ffffff !important;
        background: #860038 !important;
        border-color: #860038 !important;
    }

    body.theme-institucional .form-control,
    body.theme-institucional .form-select,
    body.theme-institucional textarea,
    body.theme-institucional .input-group-text {
        background: #ffffff !important;
        border-color: rgba(134, 0, 56, .16) !important;
        color: var(--pit-text) !important;
    }

    body.theme-institucional .form-control:focus,
    body.theme-institucional .form-select:focus,
    body.theme-institucional textarea:focus {
        border-color: rgba(134, 0, 56, .48) !important;
        box-shadow: 0 0 0 .18rem rgba(134, 0, 56, .09) !important;
    }

    body.theme-institucional .dashboard-smart .section-heading i,
    body.theme-institucional a:not(.btn):not(.sidebar a):not(.sidebar-logout-btn):not(.nav-link),
    body.theme-institucional .quick-card:hover,
    body.theme-institucional .dashboard-smart .quick-action:hover {
        color: #860038 !important;
    }

    body.theme-institucional .dashboard-smart .activity-icon,
    body.theme-institucional .pill-soft {
        background: rgba(134, 0, 56, .07) !important;
        color: #860038 !important;
    }

    body.theme-institucional .icon-box,
    body.theme-institucional .sidebar-avatar-initials {
        background: linear-gradient(135deg, #a31350, #860038) !important;
    }

    /* Densidad equilibrada: diseñada para navegador al 100%. */
    body.density-compacta .content {
        padding: 18px 20px !important;
    }

    body.density-compacta .topbar {
        padding: 17px 20px !important;
        margin-bottom: 16px !important;
    }

    body.density-compacta .topbar h1,
    body.density-compacta .topbar h2,
    body.density-compacta .topbar h3 {
        font-size: clamp(1.35rem, 1.8vw, 1.75rem) !important;
        letter-spacing: -.035em !important;
    }

    body.density-compacta .topbar p {
        font-size: .88rem !important;
        margin-bottom: 0 !important;
    }

    body.density-compacta .card-body {
        padding: 18px !important;
    }

    body.density-compacta .card-custom > .card-header,
    body.density-compacta .card > .card-header {
        padding: 14px 18px !important;
    }

    body.density-compacta .btn {
        border-radius: 10px !important;
        padding: .44rem .82rem !important;
        font-size: .88rem;
        line-height: 1.2;
    }

    body.density-compacta .form-control,
    body.density-compacta .form-select {
        min-height: 40px !important;
        border-radius: 10px !important;
        font-size: .91rem;
    }

    body.density-compacta .icon-box {
        width: 48px !important;
        height: 48px !important;
        border-radius: 13px !important;
        font-size: 1.35rem !important;
    }

    body.density-compacta.cards-compactas .card-stat,
    body.density-compacta.cards-compactas .module-card {
        border-radius: 15px !important;
    }

    body.density-compacta .metric-label {
        font-size: .82rem !important;
    }

    body.density-compacta .metric-value {
        font-size: 1.45rem !important;
    }
}

@media screen and (min-width: 992px) {
    body.theme-institucional.density-compacta .sidebar {
        width: 238px !important;
        padding: 17px 12px 12px !important;
    }

    body.theme-institucional.density-compacta .content {
        margin-left: 238px !important;
    }

    body.theme-institucional.density-compacta .sidebar .brand {
        font-size: 22px !important;
        margin-bottom: 12px !important;
        padding: 6px 9px !important;
    }

    body.theme-institucional.density-compacta .sidebar-section-title {
        font-size: .66rem !important;
        margin: 11px 7px 6px !important;
    }

    body.theme-institucional.density-compacta .sidebar a {
        min-height: 39px !important;
        padding: 8px 11px !important;
        margin-bottom: 4px !important;
        border-radius: 10px !important;
        gap: 8px !important;
        font-size: .86rem !important;
    }

    body.theme-institucional.density-compacta .sidebar-user-panel {
        margin-top: 8px !important;
        padding: 9px !important;
        border-radius: 14px !important;
    }

    body.theme-institucional.density-compacta .sidebar-avatar,
    body.theme-institucional.density-compacta .sidebar-user-card img,
    body.theme-institucional.density-compacta .sidebar-avatar-initials {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
    }

    body.theme-institucional.density-compacta .sidebar-user-name {
        font-size: .82rem !important;
    }

    body.theme-institucional.density-compacta .sidebar-user-role {
        font-size: .68rem !important;
    }

    body.theme-institucional.density-compacta .sidebar-logout-btn {
        min-height: 40px !important;
        padding: 9px 11px !important;
        margin-top: 8px !important;
        border-radius: 10px !important;
        font-size: .84rem !important;
    }
}

/* Dashboard institucional compacto. Se usa !important porque el facelift se carga
   después del CSS global en dashboard.php. */
@media screen {
    body.theme-institucional.density-compacta .dashboard-facelift-19739 {
        --pit-bg-1: #faf8f9;
        --pit-bg-2: #f5f1f3;
        --pit-ink: #24171e;
        --pit-muted: #74646d;
        --pit-border: rgba(134,0,56,.14);
        --pit-card: rgba(255,255,255,.97);
        --pit-card-strong: #ffffff;
        --pit-primary: #860038;
        --pit-primary-2: #6f002f;
        --pit-shadow-sm: 0 6px 18px rgba(76,17,42,.055);
        --pit-shadow-md: 0 11px 28px rgba(76,17,42,.085);
        --pit-shadow-lg: 0 15px 38px rgba(76,17,42,.17);
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739::before {
        background:
            radial-gradient(circle at 14% 8%, rgba(134,0,56,.055), transparent 28%),
            radial-gradient(circle at 88% 16%, rgba(134,0,56,.035), transparent 30%) !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .hero-status {
        border-radius: 18px !important;
        padding: 18px 20px !important;
        background: linear-gradient(135deg, #68002b 0%, #860038 58%, #a31350 100%) !important;
        box-shadow: 0 14px 34px rgba(92,0,38,.20) !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .hero-status::before {
        width: 270px !important;
        height: 270px !important;
        right: -90px !important;
        top: -115px !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .hero-status::after {
        background: radial-gradient(circle, rgba(255,255,255,.10), transparent 68%) !important;
        width: 210px !important;
        height: 210px !important;
        bottom: -150px !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .hero-status h3 {
        font-size: clamp(1.45rem, 2vw, 1.85rem) !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .hero-status .badge {
        padding: .38rem .72rem !important;
        font-size: .76rem !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .hero-status .rounded-4 {
        padding: .72rem !important;
        border-radius: 13px !important;
        box-shadow: inset 0 1px 0 rgba(255,255,255,.12) !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .dashboard-filter,
    body.theme-institucional.density-compacta .dashboard-facelift-19739 .priority-panel,
    body.theme-institucional.density-compacta .dashboard-facelift-19739 .card-custom {
        border-radius: 15px !important;
        box-shadow: var(--pit-shadow-sm) !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .section-heading {
        margin-top: 18px !important;
        margin-bottom: 9px !important;
        font-size: .94rem !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .section-heading small {
        padding: 3px 8px !important;
        font-size: .72rem !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .dash-card {
        min-height: 92px !important;
        border-radius: 15px !important;
        padding: 13px 14px !important;
        box-shadow: var(--pit-shadow-sm) !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .dash-card::after {
        width: 72px !important;
        height: 72px !important;
        background: rgba(134,0,56,.045) !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .dash-icon {
        width: 46px !important;
        height: 46px !important;
        border-radius: 13px !important;
        font-size: 1.25rem !important;
        box-shadow: inset 0 1px 0 rgba(255,255,255,.20), 0 8px 16px rgba(15,23,42,.09) !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .dash-label {
        font-size: .79rem !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .dash-value {
        font-size: clamp(1.35rem, 1.8vw, 1.6rem) !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .dash-subtitle {
        font-size: .72rem !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .quick-action {
        min-height: 39px !important;
        border-radius: 11px !important;
        padding: 8px 10px !important;
        box-shadow: none !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .priority-item {
        padding: 10px 0 !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .activity-row {
        padding: 9px 11px !important;
        border-radius: 11px !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .progress-bar {
        background: linear-gradient(90deg, #860038, #b01758) !important;
    }

    body.theme-institucional.density-compacta .dashboard-facelift-19739 .bg-primary {
        background: linear-gradient(135deg, #860038, #a31350) !important;
    }
}



/* ========================================================================== 
   PIT152116_UI11_INDEPENDENT_THEMES
   Temas estándar restaurados y contrastados. Institucional queda aislado.
   No modifica estilos de impresión/PDF.
   ========================================================================== */
@media screen {
    /* Base clara para Claro y Auto cuando el SO no solicita modo oscuro. */
    body.theme-claro,
    body.theme-auto {
        --pit-bg: #f4f6f8;
        --pit-surface: #ffffff;
        --pit-surface-elevated: #ffffff;
        --pit-surface-soft: #f8fafc;
        --pit-border: #d7dee8;
        --pit-text: #172033;
        --pit-muted: #5f6f82;
        --bs-body-bg: #f4f6f8;
        --bs-body-color: #172033;
        --bs-border-color: #d7dee8;
        color-scheme: light;
        background: linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%) !important;
        color: var(--pit-text) !important;
    }

    body.theme-claro .sidebar,
    body.theme-auto .sidebar {
        background: linear-gradient(180deg, #111827 0%, #0f172a 100%) !important;
        border-right: 1px solid #1f2937 !important;
        box-shadow: 8px 0 28px rgba(15,23,42,.08) !important;
    }

    body.theme-claro .sidebar a,
    body.theme-auto .sidebar a { color: #d7e0ea !important; }
    body.theme-claro .sidebar .sidebar-section-title,
    body.theme-auto .sidebar .sidebar-section-title { color: #94a3b8 !important; }
    body.theme-claro .sidebar a.active,
    body.theme-auto .sidebar a.active,
    body.theme-claro .mobile-menu-toggle,
    body.theme-auto .mobile-menu-toggle {
        background: var(--pit-primary-dark) !important;
        color: #ffffff !important;
        box-shadow: 0 8px 20px rgba(var(--pit-primary-rgb), .22) !important;
    }
    body.theme-claro .sidebar a:hover:not(.active),
    body.theme-auto .sidebar a:hover:not(.active) {
        background: rgba(255,255,255,.09) !important;
        color: #ffffff !important;
    }

    body.theme-claro .topbar,
    body.theme-claro .card,
    body.theme-claro .card-custom,
    body.theme-claro .card-stat,
    body.theme-claro .module-card,
    body.theme-claro .profile-hero,
    body.theme-claro .quick-card,
    body.theme-claro .mod-card,
    body.theme-claro .mod-kpi,
    body.theme-claro .dashboard-filter,
    body.theme-claro .dashboard-smart .dash-card,
    body.theme-claro .dashboard-smart .priority-panel,
    body.theme-claro .dashboard-smart .quick-action,
    body.theme-claro .tech-search-card,
    body.theme-claro .tech-kpi-strip > div,
    body.theme-claro .tech-action-btn,
    body.theme-claro .tech-task-card,
    body.theme-claro .tech-list-item,
    body.theme-claro .profile-info-grid > div,
    body.theme-claro .role-card-premium,
    body.theme-claro .system-readonly-box,
    body.theme-claro .settings-summary-item,
    body.theme-claro .list-group-item,
    body.theme-auto .topbar,
    body.theme-auto .card,
    body.theme-auto .card-custom,
    body.theme-auto .card-stat,
    body.theme-auto .module-card,
    body.theme-auto .profile-hero,
    body.theme-auto .quick-card,
    body.theme-auto .mod-card,
    body.theme-auto .mod-kpi,
    body.theme-auto .dashboard-filter,
    body.theme-auto .dashboard-smart .dash-card,
    body.theme-auto .dashboard-smart .priority-panel,
    body.theme-auto .dashboard-smart .quick-action,
    body.theme-auto .tech-search-card,
    body.theme-auto .tech-kpi-strip > div,
    body.theme-auto .tech-action-btn,
    body.theme-auto .tech-task-card,
    body.theme-auto .tech-list-item,
    body.theme-auto .profile-info-grid > div,
    body.theme-auto .role-card-premium,
    body.theme-auto .system-readonly-box,
    body.theme-auto .settings-summary-item,
    body.theme-auto .list-group-item {
        background: var(--pit-surface) !important;
        border-color: var(--pit-border) !important;
        color: var(--pit-text) !important;
        box-shadow: 0 8px 24px rgba(15,23,42,.065) !important;
    }

    body.theme-claro .form-control,
    body.theme-claro .form-select,
    body.theme-claro textarea,
    body.theme-claro .input-group-text,
    body.theme-auto .form-control,
    body.theme-auto .form-select,
    body.theme-auto textarea,
    body.theme-auto .input-group-text {
        background: #ffffff !important;
        border-color: #cbd5e1 !important;
        color: var(--pit-text) !important;
    }
    body.theme-claro .text-muted,
    body.theme-claro small,
    body.theme-auto .text-muted,
    body.theme-auto small { color: var(--pit-muted) !important; }

    /* Oscuro: superficies y textos separados para evitar grises de poco contraste. */
    body.theme-oscuro {
        --pit-bg: #080d16;
        --pit-surface: #111827;
        --pit-surface-elevated: #182235;
        --pit-surface-soft: #0d1524;
        --pit-border: #334155;
        --pit-text: #f8fafc;
        --pit-muted: #cbd5e1;
        --bs-body-bg: #080d16;
        --bs-body-color: #f8fafc;
        --bs-border-color: #334155;
        color-scheme: dark;
        background: linear-gradient(180deg, #0b1220 0%, #080d16 100%) !important;
        color: #f8fafc !important;
    }
    body.theme-oscuro .sidebar {
        background: linear-gradient(180deg, #050914 0%, #0b1220 100%) !important;
        border-right: 1px solid #263244 !important;
        box-shadow: 10px 0 30px rgba(0,0,0,.25) !important;
    }
    body.theme-oscuro .sidebar a { color: #d9e2ec !important; }
    body.theme-oscuro .sidebar .sidebar-section-title { color: #9fb0c3 !important; }
    body.theme-oscuro .sidebar a.active,
    body.theme-oscuro .mobile-menu-toggle {
        background: var(--pit-primary-dark) !important;
        color: #ffffff !important;
        box-shadow: 0 8px 22px rgba(var(--pit-primary-rgb), .20) !important;
    }
    body.theme-oscuro .sidebar a:hover:not(.active) {
        background: rgba(255,255,255,.08) !important;
        color: #ffffff !important;
    }
    body.theme-oscuro .table > :not(caption) > * > * {
        background-color: transparent !important;
        color: var(--pit-text) !important;
        border-color: var(--pit-border) !important;
    }
    body.theme-oscuro .table-striped > tbody > tr:nth-of-type(odd) > * {
        background-color: rgba(255,255,255,.025) !important;
    }
    body.theme-oscuro .form-control,
    body.theme-oscuro .form-select,
    body.theme-oscuro textarea,
    body.theme-oscuro .input-group-text {
        background: #0d1524 !important;
        border-color: #475569 !important;
        color: #f8fafc !important;
    }
    body.theme-oscuro .form-control:focus,
    body.theme-oscuro .form-select:focus,
    body.theme-oscuro textarea:focus {
        border-color: var(--pit-primary) !important;
        box-shadow: 0 0 0 .2rem rgba(var(--pit-primary-rgb), .18) !important;
    }
    body.theme-oscuro .form-select option { background: #111827; color: #f8fafc; }
    body.theme-oscuro .text-muted,
    body.theme-oscuro small { color: #cbd5e1 !important; }

    /* Gestor de temas: interfaz neutra, no hereda la paleta institucional como opción genérica. */
    .theme-manager-section,
    .theme-layout-manager,
    .theme-institutional-manager {
        border: 1px solid var(--pit-border, #d7dee8);
        border-radius: 14px;
        padding: 18px;
        background: var(--pit-surface-soft, #f8fafc);
    }
    .theme-choice-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
    .theme-choice {
        position: relative;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px;
        border: 1px solid var(--pit-border, #d7dee8);
        border-radius: 13px;
        background: var(--pit-surface, #fff);
        cursor: pointer;
        transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
    }
    .theme-choice:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15,23,42,.07); }
    .theme-choice input { position: absolute; opacity: 0; pointer-events: none; }
    .theme-choice:has(input:checked) {
        border-color: var(--pit-primary, #2563eb);
        box-shadow: 0 0 0 3px rgba(var(--pit-primary-rgb,37,99,235), .10);
    }
    .theme-choice-preview {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        display: grid;
        place-items: center;
        flex: 0 0 42px;
        font-size: 1.15rem;
        border: 1px solid #cbd5e1;
        background: #fff;
        color: #172033;
    }
    .theme-choice-oscuro .theme-choice-preview { background: #111827; color: #f8fafc; border-color: #334155; }
    .theme-choice-auto .theme-choice-preview { background: linear-gradient(135deg, #fff 50%, #111827 50%); color: var(--pit-primary,#2563eb); }
    .theme-choice-copy { display: flex; flex-direction: column; min-width: 0; }
    .theme-choice-copy small { line-height: 1.3; margin-top: 3px; }

    .theme-institutional-manager {
        background: linear-gradient(135deg, #fff 0%, #fbf3f6 100%);
        border-color: rgba(134,0,56,.22);
    }
    body.theme-oscuro .theme-institutional-manager { background: #111827; }
    .theme-institutional-toggle {
        display: inline-flex;
        align-items: center;
        cursor: pointer;
    }
    .theme-institutional-toggle input { position: absolute; opacity: 0; }
    .theme-institutional-toggle span {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        padding: 9px 13px;
        border: 1px solid rgba(134,0,56,.40);
        border-radius: 999px;
        color: #860038;
        background: #fff;
        font-weight: 700;
    }
    .theme-institutional-toggle input:checked + span { background: #860038; color: #fff; border-color: #860038; }
    .theme-palette { display: flex; gap: 7px; }
    .theme-palette span {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: var(--swatch);
        border: 1px solid rgba(15,23,42,.18);
        box-shadow: 0 2px 6px rgba(15,23,42,.08);
    }
    .theme-options-disabled { opacity: .48; }

    @media (max-width: 767.98px) {
        .theme-choice-grid { grid-template-columns: 1fr; }
    }
}

/* Automático adopta la misma capa oscura reforzada cuando el dispositivo lo solicita. */
@media screen and (prefers-color-scheme: dark) {
    body.theme-auto {
        --pit-bg: #080d16;
        --pit-surface: #111827;
        --pit-surface-elevated: #182235;
        --pit-surface-soft: #0d1524;
        --pit-border: #334155;
        --pit-text: #f8fafc;
        --pit-muted: #cbd5e1;
        --bs-body-bg: #080d16;
        --bs-body-color: #f8fafc;
        --bs-border-color: #334155;
        color-scheme: dark;
        background: linear-gradient(180deg, #0b1220 0%, #080d16 100%) !important;
        color: #f8fafc !important;
    }
    body.theme-auto .sidebar {
        background: linear-gradient(180deg, #050914 0%, #0b1220 100%) !important;
        border-right-color: #263244 !important;
    }
    body.theme-auto .topbar,
    body.theme-auto .card,
    body.theme-auto .card-custom,
    body.theme-auto .card-stat,
    body.theme-auto .module-card,
    body.theme-auto .profile-hero,
    body.theme-auto .quick-card,
    body.theme-auto .mod-card,
    body.theme-auto .mod-kpi,
    body.theme-auto .dashboard-filter,
    body.theme-auto .dashboard-smart .dash-card,
    body.theme-auto .dashboard-smart .priority-panel,
    body.theme-auto .dashboard-smart .quick-action,
    body.theme-auto .tech-search-card,
    body.theme-auto .tech-kpi-strip > div,
    body.theme-auto .tech-action-btn,
    body.theme-auto .tech-task-card,
    body.theme-auto .tech-list-item,
    body.theme-auto .profile-info-grid > div,
    body.theme-auto .role-card-premium,
    body.theme-auto .system-readonly-box,
    body.theme-auto .settings-summary-item,
    body.theme-auto .list-group-item,
    body.theme-auto .dropdown-menu,
    body.theme-auto .modal-content {
        background: var(--pit-surface) !important;
        border-color: var(--pit-border) !important;
        color: var(--pit-text) !important;
        box-shadow: 0 14px 34px rgba(0,0,0,.24) !important;
    }
    body.theme-auto .form-control,
    body.theme-auto .form-select,
    body.theme-auto textarea,
    body.theme-auto .input-group-text {
        background: #0d1524 !important;
        border-color: #475569 !important;
        color: #f8fafc !important;
    }
    body.theme-auto .form-select option { background: #111827; color: #f8fafc; }
    body.theme-auto .text-muted,
    body.theme-auto small { color: #cbd5e1 !important; }
    body.theme-auto .table > :not(caption) > * > * {
        background-color: transparent !important;
        color: var(--pit-text) !important;
        border-color: var(--pit-border) !important;
    }
}


/* ==========================================================================
   PIT152117_UI12_THEME_CONTRAST_FIX
   Corrección final de estados Claro/Oscuro/Auto.
   Cada tema redefine superficies completas para evitar residuos visuales del
   tema anterior. Institucional se mantiene deliberadamente fuera de este bloque.
   ========================================================================== */
@media screen {
  body.theme-claro,
  body.theme-auto {
    --pit-bg: #f3f6fa;
    --pit-surface: #ffffff;
    --pit-surface-elevated: #f8fafc;
    --pit-surface-soft: #f1f5f9;
    --pit-border: #d8e0ea;
    --pit-text: #172033;
    --pit-muted: #64748b;
    --bs-body-bg: #f3f6fa;
    --bs-body-color: #172033;
    --bs-border-color: #d8e0ea;
    color-scheme: light;
    background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%) !important;
    color: #172033 !important;
  }

  /* Claro debe verse inequívocamente claro: sidebar blanco y navegación oscura. */
  body.theme-claro .sidebar,
  body.theme-auto .sidebar {
    background: #ffffff !important;
    color: #172033 !important;
    border-right: 1px solid #dbe3ed !important;
    box-shadow: 8px 0 24px rgba(15,23,42,.055) !important;
  }
  body.theme-claro .sidebar .brand,
  body.theme-auto .sidebar .brand,
  body.theme-claro .sidebar-user-name,
  body.theme-auto .sidebar-user-name {
    color: #0f172a !important;
  }
  body.theme-claro .sidebar-section-title,
  body.theme-auto .sidebar-section-title,
  body.theme-claro .sidebar-user-role,
  body.theme-auto .sidebar-user-role {
    color: #64748b !important;
  }
  body.theme-claro .sidebar a,
  body.theme-auto .sidebar a {
    color: #334155 !important;
  }
  body.theme-claro .sidebar a i,
  body.theme-auto .sidebar a i {
    color: #64748b !important;
  }
  body.theme-claro .sidebar a:hover:not(.active),
  body.theme-auto .sidebar a:hover:not(.active) {
    background: #f1f5f9 !important;
    color: #0f172a !important;
  }
  body.theme-claro .sidebar a.active,
  body.theme-auto .sidebar a.active {
    background: rgba(var(--pit-primary-rgb), .10) !important;
    color: var(--pit-primary-dark) !important;
    border: 1px solid rgba(var(--pit-primary-rgb), .18) !important;
    box-shadow: none !important;
  }
  body.theme-claro .sidebar a.active i,
  body.theme-auto .sidebar a.active i {
    color: var(--pit-primary) !important;
  }
  body.theme-claro .sidebar-user-panel,
  body.theme-auto .sidebar-user-panel {
    background: #f8fafc !important;
    border: 1px solid #dbe3ed !important;
    box-shadow: none !important;
  }
  body.theme-claro .sidebar-logout-btn,
  body.theme-auto .sidebar-logout-btn {
    background: #ffffff !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
    box-shadow: none !important;
  }
  body.theme-claro .sidebar-logout-btn:hover,
  body.theme-auto .sidebar-logout-btn:hover {
    background: #fef2f2 !important;
    color: #991b1b !important;
  }

  body.theme-claro .topbar,
  body.theme-auto .topbar {
    background: #ffffff !important;
    color: #172033 !important;
    border: 1px solid #dbe3ed !important;
    border-top: 3px solid var(--pit-primary) !important;
    box-shadow: 0 8px 22px rgba(15,23,42,.055) !important;
  }
  body.theme-claro .card,
  body.theme-claro .card-custom,
  body.theme-claro .card-stat,
  body.theme-claro .module-card,
  body.theme-claro .profile-hero,
  body.theme-claro .quick-card,
  body.theme-claro .mod-card,
  body.theme-claro .mod-kpi,
  body.theme-claro .dashboard-filter,
  body.theme-claro .tech-search-card,
  body.theme-claro .tech-kpi-strip > div,
  body.theme-claro .tech-action-btn,
  body.theme-claro .tech-task-card,
  body.theme-claro .tech-list-item,
  body.theme-claro .profile-info-grid > div,
  body.theme-claro .role-card-premium,
  body.theme-claro .system-readonly-box,
  body.theme-claro .settings-summary-item,
  body.theme-claro .list-group-item,
  body.theme-auto .card,
  body.theme-auto .card-custom,
  body.theme-auto .card-stat,
  body.theme-auto .module-card,
  body.theme-auto .profile-hero,
  body.theme-auto .quick-card,
  body.theme-auto .mod-card,
  body.theme-auto .mod-kpi,
  body.theme-auto .dashboard-filter,
  body.theme-auto .tech-search-card,
  body.theme-auto .tech-kpi-strip > div,
  body.theme-auto .tech-action-btn,
  body.theme-auto .tech-task-card,
  body.theme-auto .tech-list-item,
  body.theme-auto .profile-info-grid > div,
  body.theme-auto .role-card-premium,
  body.theme-auto .system-readonly-box,
  body.theme-auto .settings-summary-item,
  body.theme-auto .list-group-item {
    background: #ffffff !important;
    color: #172033 !important;
    border-color: #dbe3ed !important;
    box-shadow: 0 7px 20px rgba(15,23,42,.05) !important;
  }
  body.theme-claro .card-header,
  body.theme-claro .card-footer,
  body.theme-claro .table-light,
  body.theme-claro .table thead th,
  body.theme-auto .card-header,
  body.theme-auto .card-footer,
  body.theme-auto .table-light,
  body.theme-auto .table thead th {
    background: #f8fafc !important;
    color: #172033 !important;
    border-color: #dbe3ed !important;
  }
  body.theme-claro .table > :not(caption) > * > *,
  body.theme-auto .table > :not(caption) > * > * {
    color: #172033 !important;
    border-color: #e2e8f0 !important;
  }
  body.theme-claro .form-control,
  body.theme-claro .form-select,
  body.theme-claro textarea,
  body.theme-claro .input-group-text,
  body.theme-auto .form-control,
  body.theme-auto .form-select,
  body.theme-auto textarea,
  body.theme-auto .input-group-text {
    background: #ffffff !important;
    color: #172033 !important;
    border-color: #cbd5e1 !important;
  }
  body.theme-claro .form-control:focus,
  body.theme-claro .form-select:focus,
  body.theme-claro textarea:focus,
  body.theme-auto .form-control:focus,
  body.theme-auto .form-select:focus,
  body.theme-auto textarea:focus {
    border-color: var(--pit-primary) !important;
    box-shadow: 0 0 0 .18rem rgba(var(--pit-primary-rgb), .12) !important;
  }
  body.theme-claro .text-muted,
  body.theme-claro small,
  body.theme-auto .text-muted,
  body.theme-auto small { color: #64748b !important; }

  /* Oscuro: contraste alto real en navegación, tarjetas, tablas y formularios. */
  body.theme-oscuro {
    --pit-bg: #080d16;
    --pit-surface: #111827;
    --pit-surface-elevated: #182235;
    --pit-surface-soft: #0d1524;
    --pit-border: #334155;
    --pit-text: #f8fafc;
    --pit-muted: #cbd5e1;
    --bs-body-bg: #080d16;
    --bs-body-color: #f8fafc;
    --bs-border-color: #334155;
    color-scheme: dark;
    background: linear-gradient(180deg, #0b1220 0%, #080d16 100%) !important;
    color: #f8fafc !important;
  }
  body.theme-oscuro .sidebar {
    background: #070c15 !important;
    color: #f8fafc !important;
    border-right: 1px solid #263244 !important;
    box-shadow: 10px 0 30px rgba(0,0,0,.26) !important;
  }
  body.theme-oscuro .sidebar .brand,
  body.theme-oscuro .sidebar-user-name { color: #ffffff !important; }
  body.theme-oscuro .sidebar-section-title,
  body.theme-oscuro .sidebar-user-role { color: #9fb0c3 !important; }
  body.theme-oscuro .sidebar a { color: #d9e2ec !important; }
  body.theme-oscuro .sidebar a i { color: #aab8c8 !important; }
  body.theme-oscuro .sidebar a:hover:not(.active) {
    background: #111827 !important;
    color: #ffffff !important;
  }
  body.theme-oscuro .sidebar a.active {
    background: var(--pit-primary-dark) !important;
    color: #ffffff !important;
    border: 1px solid rgba(var(--pit-primary-rgb), .45) !important;
    box-shadow: 0 8px 20px rgba(var(--pit-primary-rgb), .18) !important;
  }
  body.theme-oscuro .sidebar-user-panel {
    background: #0d1524 !important;
    border: 1px solid #334155 !important;
    box-shadow: none !important;
  }
  body.theme-oscuro .sidebar-logout-btn {
    background: #3a1118 !important;
    color: #fecaca !important;
    border: 1px solid #7f1d1d !important;
  }
  body.theme-oscuro .sidebar-logout-btn:hover {
    background: #7f1d1d !important;
    color: #ffffff !important;
  }
  body.theme-oscuro .topbar {
    background: #111827 !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
    border-top: 3px solid var(--pit-primary) !important;
    box-shadow: 0 10px 28px rgba(0,0,0,.20) !important;
  }
  body.theme-oscuro .card,
  body.theme-oscuro .card-custom,
  body.theme-oscuro .card-stat,
  body.theme-oscuro .module-card,
  body.theme-oscuro .profile-hero,
  body.theme-oscuro .quick-card,
  body.theme-oscuro .mod-card,
  body.theme-oscuro .mod-kpi,
  body.theme-oscuro .dashboard-filter,
  body.theme-oscuro .tech-search-card,
  body.theme-oscuro .tech-kpi-strip > div,
  body.theme-oscuro .tech-action-btn,
  body.theme-oscuro .tech-task-card,
  body.theme-oscuro .tech-list-item,
  body.theme-oscuro .profile-info-grid > div,
  body.theme-oscuro .role-card-premium,
  body.theme-oscuro .system-readonly-box,
  body.theme-oscuro .settings-summary-item,
  body.theme-oscuro .list-group-item,
  body.theme-oscuro .dropdown-menu,
  body.theme-oscuro .modal-content {
    background: #111827 !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
    box-shadow: 0 10px 28px rgba(0,0,0,.20) !important;
  }
  body.theme-oscuro .card-header,
  body.theme-oscuro .card-footer,
  body.theme-oscuro .table-light,
  body.theme-oscuro .table thead th,
  body.theme-oscuro .modal-header,
  body.theme-oscuro .modal-footer {
    background: #0d1524 !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
  }
  body.theme-oscuro .table > :not(caption) > * > * {
    background-color: transparent !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
  }
  body.theme-oscuro .form-control,
  body.theme-oscuro .form-select,
  body.theme-oscuro textarea,
  body.theme-oscuro .input-group-text {
    background: #0d1524 !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
  }
  body.theme-oscuro .form-control::placeholder,
  body.theme-oscuro textarea::placeholder { color: #94a3b8 !important; }
  body.theme-oscuro .form-select option { background: #111827; color: #f8fafc; }
  body.theme-oscuro .text-muted,
  body.theme-oscuro small { color: #cbd5e1 !important; }
  body.theme-oscuro hr { border-color: #334155 !important; opacity: 1; }

  body.theme-oscuro .alert-success {
    background: #0d2f23 !important;
    color: #d1fae5 !important;
    border-color: #166534 !important;
  }
  body.theme-oscuro .alert-info {
    background: #0c2637 !important;
    color: #dbeafe !important;
    border-color: #075985 !important;
  }
  body.theme-oscuro .alert-warning {
    background: #33260b !important;
    color: #fef3c7 !important;
    border-color: #92400e !important;
  }
  body.theme-oscuro .alert-danger {
    background: #351218 !important;
    color: #fee2e2 !important;
    border-color: #991b1b !important;
  }
}

/* Auto oscuro se declara al final para que gane frente a la base clara. */
@media screen and (prefers-color-scheme: dark) {
  body.theme-auto {
    --pit-bg: #080d16;
    --pit-surface: #111827;
    --pit-surface-elevated: #182235;
    --pit-surface-soft: #0d1524;
    --pit-border: #334155;
    --pit-text: #f8fafc;
    --pit-muted: #cbd5e1;
    --bs-body-bg: #080d16;
    --bs-body-color: #f8fafc;
    --bs-border-color: #334155;
    color-scheme: dark;
    background: linear-gradient(180deg, #0b1220 0%, #080d16 100%) !important;
    color: #f8fafc !important;
  }
  body.theme-auto .sidebar {
    background: #070c15 !important;
    color: #f8fafc !important;
    border-right: 1px solid #263244 !important;
    box-shadow: 10px 0 30px rgba(0,0,0,.26) !important;
  }
  body.theme-auto .sidebar .brand,
  body.theme-auto .sidebar-user-name { color: #ffffff !important; }
  body.theme-auto .sidebar-section-title,
  body.theme-auto .sidebar-user-role { color: #9fb0c3 !important; }
  body.theme-auto .sidebar a { color: #d9e2ec !important; }
  body.theme-auto .sidebar a i { color: #aab8c8 !important; }
  body.theme-auto .sidebar a:hover:not(.active) { background: #111827 !important; color: #ffffff !important; }
  body.theme-auto .sidebar a.active {
    background: var(--pit-primary-dark) !important;
    color: #ffffff !important;
    border: 1px solid rgba(var(--pit-primary-rgb), .45) !important;
    box-shadow: 0 8px 20px rgba(var(--pit-primary-rgb), .18) !important;
  }
  body.theme-auto .sidebar-user-panel {
    background: #0d1524 !important;
    border: 1px solid #334155 !important;
    box-shadow: none !important;
  }
  body.theme-auto .sidebar-logout-btn {
    background: #3a1118 !important;
    color: #fecaca !important;
    border: 1px solid #7f1d1d !important;
  }
  body.theme-auto .topbar,
  body.theme-auto .card,
  body.theme-auto .card-custom,
  body.theme-auto .card-stat,
  body.theme-auto .module-card,
  body.theme-auto .profile-hero,
  body.theme-auto .quick-card,
  body.theme-auto .mod-card,
  body.theme-auto .mod-kpi,
  body.theme-auto .dashboard-filter,
  body.theme-auto .tech-search-card,
  body.theme-auto .tech-kpi-strip > div,
  body.theme-auto .tech-action-btn,
  body.theme-auto .tech-task-card,
  body.theme-auto .tech-list-item,
  body.theme-auto .profile-info-grid > div,
  body.theme-auto .role-card-premium,
  body.theme-auto .system-readonly-box,
  body.theme-auto .settings-summary-item,
  body.theme-auto .list-group-item,
  body.theme-auto .dropdown-menu,
  body.theme-auto .modal-content {
    background: #111827 !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
    box-shadow: 0 10px 28px rgba(0,0,0,.20) !important;
  }
  body.theme-auto .topbar { border-top: 3px solid var(--pit-primary) !important; }
  body.theme-auto .card-header,
  body.theme-auto .card-footer,
  body.theme-auto .table-light,
  body.theme-auto .table thead th,
  body.theme-auto .modal-header,
  body.theme-auto .modal-footer {
    background: #0d1524 !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
  }
  body.theme-auto .table > :not(caption) > * > * {
    background-color: transparent !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
  }
  body.theme-auto .form-control,
  body.theme-auto .form-select,
  body.theme-auto textarea,
  body.theme-auto .input-group-text {
    background: #0d1524 !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
  }
  body.theme-auto .form-control::placeholder,
  body.theme-auto textarea::placeholder { color: #94a3b8 !important; }
  body.theme-auto .form-select option { background: #111827; color: #f8fafc; }
  body.theme-auto .text-muted,
  body.theme-auto small { color: #cbd5e1 !important; }
  body.theme-auto hr { border-color: #334155 !important; opacity: 1; }
}


/* ==========================================================================
   PIT152118_UI13_SIDEBAR_CONTRAST_POLISH
   Pulido de contraste para Claro/Oscuro/Auto con selectores suficientes para
   superar la presentación embebida del sidebar. Institucional no se modifica.
   ========================================================================== */
@media screen {
  /* CLARO / AUTO EN SO CLARO ------------------------------------------------ */
  body.theme-claro #portalSidebar .sidebar-section-title.pit-sidebar-toggle,
  body.theme-auto #portalSidebar .sidebar-section-title.pit-sidebar-toggle {
    color: #475569 !important;
    background: transparent !important;
    opacity: 1 !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-title-icon,
  body.theme-auto #portalSidebar .pit-sidebar-title-icon {
    background: #eef2f7 !important;
    color: #64748b !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-chevron,
  body.theme-auto #portalSidebar .pit-sidebar-chevron {
    color: #64748b !important;
    opacity: .9 !important;
  }
  body.theme-claro #portalSidebar .sidebar-section-title.pit-sidebar-toggle:hover,
  body.theme-auto #portalSidebar .sidebar-section-title.pit-sidebar-toggle:hover {
    background: #f1f5f9 !important;
    color: #172033 !important;
  }
  body.theme-claro #portalSidebar .sidebar-section-title.pit-sidebar-toggle:hover .pit-sidebar-title-icon,
  body.theme-auto #portalSidebar .sidebar-section-title.pit-sidebar-toggle:hover .pit-sidebar-title-icon {
    background: #e2e8f0 !important;
    color: #334155 !important;
  }
  body.theme-claro #portalSidebar .sidebar-section-title.pit-sidebar-toggle.pit-sidebar-current,
  body.theme-auto #portalSidebar .sidebar-section-title.pit-sidebar-toggle.pit-sidebar-current {
    background: rgba(var(--pit-primary-rgb), .11) !important;
    color: var(--pit-primary-dark) !important;
    box-shadow: inset 3px 0 0 var(--pit-primary), inset 0 0 0 1px rgba(var(--pit-primary-rgb), .15) !important;
  }
  body.theme-claro #portalSidebar .sidebar-section-title.pit-sidebar-toggle.pit-sidebar-current .pit-sidebar-title-icon,
  body.theme-auto #portalSidebar .sidebar-section-title.pit-sidebar-toggle.pit-sidebar-current .pit-sidebar-title-icon {
    background: rgba(var(--pit-primary-rgb), .14) !important;
    color: var(--pit-primary-dark) !important;
  }
  body.theme-claro #portalSidebar .sidebar-section-title.pit-sidebar-toggle.pit-sidebar-current .pit-sidebar-chevron,
  body.theme-auto #portalSidebar .sidebar-section-title.pit-sidebar-toggle.pit-sidebar-current .pit-sidebar-chevron {
    color: var(--pit-primary-dark) !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-group,
  body.theme-auto #portalSidebar .pit-sidebar-group {
    border-left-color: #dbe3ed !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-group a,
  body.theme-auto #portalSidebar .pit-sidebar-group a {
    color: #334155 !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-group a:hover:not(.active),
  body.theme-auto #portalSidebar .pit-sidebar-group a:hover:not(.active) {
    background: #f1f5f9 !important;
    color: #0f172a !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-group a.active,
  body.theme-auto #portalSidebar .pit-sidebar-group a.active {
    background: var(--pit-primary) !important;
    color: #ffffff !important;
    border-color: var(--pit-primary) !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-group a.active i,
  body.theme-auto #portalSidebar .pit-sidebar-group a.active i,
  body.theme-claro #portalSidebar .pit-sidebar-group a.active span,
  body.theme-auto #portalSidebar .pit-sidebar-group a.active span {
    color: #ffffff !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-help,
  body.theme-auto #portalSidebar .pit-sidebar-help {
    background: #f8fafc !important;
    border-color: #dbe3ed !important;
    color: #334155 !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-help:hover,
  body.theme-auto #portalSidebar .pit-sidebar-help:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-help-icon,
  body.theme-auto #portalSidebar .pit-sidebar-help-icon {
    background: #eef2f7 !important;
    color: #64748b !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-help-text small,
  body.theme-auto #portalSidebar .pit-sidebar-help-text small,
  body.theme-claro #portalSidebar .pit-sidebar-help-arrow,
  body.theme-auto #portalSidebar .pit-sidebar-help-arrow {
    color: #64748b !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-help.active,
  body.theme-auto #portalSidebar .pit-sidebar-help.active {
    background: rgba(var(--pit-primary-rgb), .09) !important;
    border-color: rgba(var(--pit-primary-rgb), .20) !important;
    color: var(--pit-primary-dark) !important;
  }

  /* OSCURO ------------------------------------------------------------------ */
  body.theme-oscuro #portalSidebar .sidebar-section-title.pit-sidebar-toggle {
    color: #cbd5e1 !important;
    background: transparent !important;
    opacity: 1 !important;
  }
  body.theme-oscuro #portalSidebar .pit-sidebar-title-icon {
    background: #172033 !important;
    color: #cbd5e1 !important;
  }
  body.theme-oscuro #portalSidebar .pit-sidebar-chevron {
    color: #aebdce !important;
    opacity: .95 !important;
  }
  body.theme-oscuro #portalSidebar .sidebar-section-title.pit-sidebar-toggle:hover {
    background: #111827 !important;
    color: #ffffff !important;
  }
  body.theme-oscuro #portalSidebar .sidebar-section-title.pit-sidebar-toggle.pit-sidebar-current {
    background: rgba(var(--pit-primary-rgb), .26) !important;
    color: #ffffff !important;
    box-shadow: inset 3px 0 0 var(--pit-primary), inset 0 0 0 1px rgba(var(--pit-primary-rgb), .34) !important;
  }
  body.theme-oscuro #portalSidebar .sidebar-section-title.pit-sidebar-toggle.pit-sidebar-current .pit-sidebar-title-icon {
    background: rgba(var(--pit-primary-rgb), .30) !important;
    color: #ffffff !important;
  }
  body.theme-oscuro #portalSidebar .pit-sidebar-group {
    border-left-color: #334155 !important;
  }
  body.theme-oscuro #portalSidebar .pit-sidebar-group a {
    color: #dbe5ef !important;
  }
  body.theme-oscuro #portalSidebar .pit-sidebar-group a:hover:not(.active) {
    background: #172033 !important;
    color: #ffffff !important;
  }
  body.theme-oscuro #portalSidebar .pit-sidebar-group a.active {
    background: var(--pit-primary-dark) !important;
    color: #ffffff !important;
    border-color: rgba(var(--pit-primary-rgb), .50) !important;
  }
  body.theme-oscuro #portalSidebar .pit-sidebar-help {
    background: #0d1524 !important;
    border-color: #334155 !important;
    color: #dbe5ef !important;
  }
  body.theme-oscuro #portalSidebar .pit-sidebar-help:hover {
    background: #172033 !important;
    color: #ffffff !important;
  }
  body.theme-oscuro #portalSidebar .pit-sidebar-help-icon {
    background: #172033 !important;
    color: #cbd5e1 !important;
  }
  body.theme-oscuro #portalSidebar .pit-sidebar-help-text small,
  body.theme-oscuro #portalSidebar .pit-sidebar-help-arrow {
    color: #aebdce !important;
  }
}

/* AUTO EN SO OSCURO: debe ejecutarse después de la base clara anterior. */
@media screen and (prefers-color-scheme: dark) {
  body.theme-auto #portalSidebar .sidebar-section-title.pit-sidebar-toggle {
    color: #cbd5e1 !important;
    background: transparent !important;
  }
  body.theme-auto #portalSidebar .pit-sidebar-title-icon {
    background: #172033 !important;
    color: #cbd5e1 !important;
  }
  body.theme-auto #portalSidebar .pit-sidebar-chevron { color: #aebdce !important; }
  body.theme-auto #portalSidebar .sidebar-section-title.pit-sidebar-toggle:hover {
    background: #111827 !important;
    color: #ffffff !important;
  }
  body.theme-auto #portalSidebar .sidebar-section-title.pit-sidebar-toggle.pit-sidebar-current {
    background: rgba(var(--pit-primary-rgb), .26) !important;
    color: #ffffff !important;
    box-shadow: inset 3px 0 0 var(--pit-primary), inset 0 0 0 1px rgba(var(--pit-primary-rgb), .34) !important;
  }
  body.theme-auto #portalSidebar .sidebar-section-title.pit-sidebar-toggle.pit-sidebar-current .pit-sidebar-title-icon {
    background: rgba(var(--pit-primary-rgb), .30) !important;
    color: #ffffff !important;
  }
  body.theme-auto #portalSidebar .pit-sidebar-group { border-left-color: #334155 !important; }
  body.theme-auto #portalSidebar .pit-sidebar-group a { color: #dbe5ef !important; }
  body.theme-auto #portalSidebar .pit-sidebar-group a:hover:not(.active) { background: #172033 !important; color: #ffffff !important; }
  body.theme-auto #portalSidebar .pit-sidebar-group a.active { background: var(--pit-primary-dark) !important; color: #ffffff !important; }
  body.theme-auto #portalSidebar .pit-sidebar-help {
    background: #0d1524 !important;
    border-color: #334155 !important;
    color: #dbe5ef !important;
  }
  body.theme-auto #portalSidebar .pit-sidebar-help:hover { background: #172033 !important; color: #ffffff !important; }
  body.theme-auto #portalSidebar .pit-sidebar-help-icon { background: #172033 !important; color: #cbd5e1 !important; }
  body.theme-auto #portalSidebar .pit-sidebar-help-text small,
  body.theme-auto #portalSidebar .pit-sidebar-help-arrow { color: #aebdce !important; }
}


/* ========================================================================== 
   PIT152119_UI14_SIDEBAR_THEME_IDENTITY
   Devuelve identidad cromática al sidebar sin mezclar temas:
   - Claro/Auto claro: sidebar azul marino con contenido claro y acento estándar.
   - Oscuro/Auto oscuro: sidebar casi negro, integrado al modo oscuro.
   - Institucional: NO se toca; conserva exclusivamente su paleta #860038.
   No modifica impresión/PDF.
   ========================================================================== */
@media screen {
  /* CLARO: página clara + sidebar azul marino para separar navegación/contenido. */
  body.theme-claro #portalSidebar,
  body.theme-auto #portalSidebar {
    background: linear-gradient(180deg, #0f172a 0%, #111827 58%, #0b1220 100%) !important;
    color: #ffffff !important;
    border-right: 1px solid #1e293b !important;
    box-shadow: 9px 0 26px rgba(15, 23, 42, .10) !important;
  }

  body.theme-claro #portalSidebar .brand,
  body.theme-auto #portalSidebar .brand,
  body.theme-claro #portalSidebar .sidebar-user-name,
  body.theme-auto #portalSidebar .sidebar-user-name {
    color: #ffffff !important;
  }

  body.theme-claro #portalSidebar .sidebar-section-title.pit-sidebar-toggle,
  body.theme-auto #portalSidebar .sidebar-section-title.pit-sidebar-toggle {
    color: #cbd5e1 !important;
    background: transparent !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-title-icon,
  body.theme-auto #portalSidebar .pit-sidebar-title-icon {
    background: rgba(255,255,255,.08) !important;
    color: #dbe5ef !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-chevron,
  body.theme-auto #portalSidebar .pit-sidebar-chevron {
    color: #94a3b8 !important;
  }
  body.theme-claro #portalSidebar .sidebar-section-title.pit-sidebar-toggle:hover,
  body.theme-auto #portalSidebar .sidebar-section-title.pit-sidebar-toggle:hover {
    background: rgba(255,255,255,.07) !important;
    color: #ffffff !important;
  }
  body.theme-claro #portalSidebar .sidebar-section-title.pit-sidebar-toggle:hover .pit-sidebar-title-icon,
  body.theme-auto #portalSidebar .sidebar-section-title.pit-sidebar-toggle:hover .pit-sidebar-title-icon {
    background: rgba(255,255,255,.12) !important;
    color: #ffffff !important;
  }
  body.theme-claro #portalSidebar .sidebar-section-title.pit-sidebar-toggle.pit-sidebar-current,
  body.theme-auto #portalSidebar .sidebar-section-title.pit-sidebar-toggle.pit-sidebar-current {
    background: rgba(var(--pit-primary-rgb), .22) !important;
    color: #ffffff !important;
    box-shadow: inset 3px 0 0 var(--pit-primary), inset 0 0 0 1px rgba(var(--pit-primary-rgb), .30) !important;
  }
  body.theme-claro #portalSidebar .sidebar-section-title.pit-sidebar-toggle.pit-sidebar-current .pit-sidebar-title-icon,
  body.theme-auto #portalSidebar .sidebar-section-title.pit-sidebar-toggle.pit-sidebar-current .pit-sidebar-title-icon {
    background: rgba(var(--pit-primary-rgb), .28) !important;
    color: #ffffff !important;
  }
  body.theme-claro #portalSidebar .sidebar-section-title.pit-sidebar-toggle.pit-sidebar-current .pit-sidebar-chevron,
  body.theme-auto #portalSidebar .sidebar-section-title.pit-sidebar-toggle.pit-sidebar-current .pit-sidebar-chevron {
    color: var(--pit-primary-100, #dbeafe) !important;
  }

  body.theme-claro #portalSidebar .pit-sidebar-group,
  body.theme-auto #portalSidebar .pit-sidebar-group {
    border-left-color: #334155 !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-group a,
  body.theme-auto #portalSidebar .pit-sidebar-group a {
    color: #dbe5ef !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-group a i,
  body.theme-auto #portalSidebar .pit-sidebar-group a i {
    color: #aebdce !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-group a:hover:not(.active),
  body.theme-auto #portalSidebar .pit-sidebar-group a:hover:not(.active) {
    background: rgba(255,255,255,.08) !important;
    color: #ffffff !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-group a:hover:not(.active) i,
  body.theme-auto #portalSidebar .pit-sidebar-group a:hover:not(.active) i {
    color: #ffffff !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-group a.active,
  body.theme-auto #portalSidebar .pit-sidebar-group a.active {
    background: var(--pit-primary) !important;
    color: #ffffff !important;
    border-color: var(--pit-primary) !important;
    box-shadow: 0 8px 20px rgba(var(--pit-primary-rgb), .22) !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-group a.active i,
  body.theme-auto #portalSidebar .pit-sidebar-group a.active i,
  body.theme-claro #portalSidebar .pit-sidebar-group a.active span,
  body.theme-auto #portalSidebar .pit-sidebar-group a.active span {
    color: #ffffff !important;
  }

  body.theme-claro #portalSidebar .pit-sidebar-help,
  body.theme-auto #portalSidebar .pit-sidebar-help {
    background: rgba(255,255,255,.055) !important;
    border-color: rgba(255,255,255,.10) !important;
    color: #e2e8f0 !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-help:hover,
  body.theme-auto #portalSidebar .pit-sidebar-help:hover {
    background: rgba(255,255,255,.09) !important;
    color: #ffffff !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-help-icon,
  body.theme-auto #portalSidebar .pit-sidebar-help-icon {
    background: rgba(255,255,255,.08) !important;
    color: #cbd5e1 !important;
  }
  body.theme-claro #portalSidebar .pit-sidebar-help-text small,
  body.theme-auto #portalSidebar .pit-sidebar-help-text small,
  body.theme-claro #portalSidebar .pit-sidebar-help-arrow,
  body.theme-auto #portalSidebar .pit-sidebar-help-arrow,
  body.theme-claro #portalSidebar .sidebar-user-role,
  body.theme-auto #portalSidebar .sidebar-user-role {
    color: #94a3b8 !important;
  }

  body.theme-claro #portalSidebar .sidebar-user-panel,
  body.theme-auto #portalSidebar .sidebar-user-panel {
    background: rgba(255,255,255,.07) !important;
    border: 1px solid rgba(255,255,255,.11) !important;
    box-shadow: none !important;
  }
  body.theme-claro #portalSidebar .sidebar-logout-btn,
  body.theme-auto #portalSidebar .sidebar-logout-btn {
    background: #ffffff !important;
    color: #b91c1c !important;
    border: 1px solid rgba(255,255,255,.75) !important;
    box-shadow: none !important;
  }
  body.theme-claro #portalSidebar .sidebar-logout-btn:hover,
  body.theme-auto #portalSidebar .sidebar-logout-btn:hover {
    background: #fef2f2 !important;
    color: #991b1b !important;
  }

  /* OSCURO: más profundo que Claro para que ambos modos sean distinguibles. */
  body.theme-oscuro #portalSidebar {
    background: linear-gradient(180deg, #040812 0%, #070c15 58%, #050914 100%) !important;
    color: #f8fafc !important;
    border-right: 1px solid #263244 !important;
    box-shadow: 10px 0 30px rgba(0,0,0,.30) !important;
  }
}

/* AUTO OSCURO: se aplica al final y reemplaza explícitamente el sidebar claro. */
@media screen and (prefers-color-scheme: dark) {
  body.theme-auto #portalSidebar {
    background: linear-gradient(180deg, #040812 0%, #070c15 58%, #050914 100%) !important;
    color: #f8fafc !important;
    border-right: 1px solid #263244 !important;
    box-shadow: 10px 0 30px rgba(0,0,0,.30) !important;
  }
}

/* ==========================================================================
   PIT152120_UI15_LOGIN_RESPONSIVE_POLISH
   Login/logout compacto inspirado en el acceso académico institucional.
   Mantiene toda la lógica de autenticación existente: solo modifica pantalla.
   ========================================================================== */
@media screen {
  body.auth-page.auth-refined-login {
    min-height: 100svh !important;
    overflow-x: hidden;
    background:
      radial-gradient(circle at 20% 8%, rgba(255,255,255,.07), transparent 26%),
      linear-gradient(145deg, #5f0028 0%, #860038 48%, #4b172f 100%) !important;
  }

  .auth-refined-login .auth-shell {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px !important;
  }

  .auth-refined-login .auth-container {
    width: 100%;
    max-width: 460px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .auth-refined-login .auth-panel {
    display: block !important;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    overflow: visible;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .auth-refined-login .auth-brand-side {
    display: none !important;
  }

  .auth-refined-login .auth-form-side {
    width: 100%;
    padding: 0 !important;
  }

  .auth-refined-login .auth-form-card {
    width: 100%;
    padding: 28px 30px 22px !important;
    border: 1px solid rgba(255,255,255,.72) !important;
    border-radius: 18px !important;
    background: rgba(255,255,255,.985) !important;
    box-shadow: 0 22px 60px rgba(28,7,18,.28) !important;
  }

  .auth-refined-login .auth-mobile-brand {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 20px !important;
    padding: 0 0 18px !important;
    text-align: center;
    border-bottom: 1px solid rgba(134,0,56,.10);
  }

  .auth-refined-login .auth-mobile-brand img {
    width: min(180px, 58vw) !important;
    height: auto !important;
    max-height: 72px !important;
    object-fit: contain;
  }

  .auth-refined-login .auth-mobile-brand div {
    display: none !important;
  }

  .auth-refined-login .auth-form-head {
    margin-bottom: 18px !important;
    text-align: center;
  }

  .auth-refined-login .auth-form-head h2 {
    margin-bottom: 6px !important;
    font-size: clamp(1.55rem, 4vw, 1.9rem) !important;
    line-height: 1.12;
    color: #21161d !important;
  }

  .auth-refined-login .auth-form-head p {
    margin-bottom: 0;
    font-size: .88rem !important;
    color: #6b6570 !important;
  }

  .auth-refined-login .auth-alert-stack {
    gap: 8px !important;
    margin-bottom: 14px !important;
  }

  .auth-refined-login .auth-alert-box {
    padding: 10px 12px !important;
    border-radius: 12px !important;
    font-size: .84rem;
  }

  .auth-refined-login .auth-form-premium {
    gap: 13px !important;
  }

  .auth-refined-login .auth-field-group {
    gap: 5px !important;
  }

  .auth-refined-login .auth-label {
    font-size: .78rem !important;
  }

  .auth-refined-login .auth-input-wrap,
  .auth-refined-login .auth-control,
  .auth-refined-login .auth-password-toggle {
    min-height: 46px !important;
    height: 46px !important;
  }

  .auth-refined-login .auth-input-wrap {
    border-radius: 11px !important;
  }

  .auth-refined-login .auth-control {
    font-size: .91rem !important;
  }

  .auth-refined-login .auth-submit-btn,
  .auth-refined-login .auth-google-btn {
    min-height: 47px !important;
    border-radius: 11px !important;
    font-size: .90rem !important;
    box-shadow: 0 10px 24px rgba(134,0,56,.18) !important;
  }

  .auth-refined-login .auth-sso-block {
    gap: 7px !important;
    margin-bottom: 14px !important;
  }

  .auth-refined-login .auth-sso-hint,
  .auth-refined-login .auth-alternate-access a {
    font-size: .75rem !important;
  }

  .auth-refined-login .auth-local-heading {
    padding: 9px 11px !important;
    border-radius: 10px !important;
  }

  .auth-refined-login .auth-footer-note {
    margin-top: 17px !important;
    padding-top: 13px !important;
    gap: 7px !important;
    font-size: .75rem;
  }

  .auth-refined-login .auth-shape-1,
  .auth-refined-login .auth-shape-2,
  .auth-refined-login .auth-shape-3 {
    opacity: .12 !important;
  }
}

/* PIT152120_UI15_LOGOUT_DANGER_IDENTITY
   Cerrar sesión vuelve a ser una acción roja inequívoca en todos los temas. */
@media screen {
  body.pit-runtime #portalSidebar .sidebar-logout-btn,
  #portalSidebar .sidebar-logout-btn {
    min-height: 44px !important;
    background: linear-gradient(135deg, #ef2f2f, #dc2626) !important;
    color: #ffffff !important;
    border: 1px solid rgba(220,38,38,.85) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 22px rgba(220,38,38,.18) !important;
    font-weight: 800 !important;
  }
  body.pit-runtime #portalSidebar .sidebar-logout-btn:hover,
  #portalSidebar .sidebar-logout-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
  }
  body.pit-runtime #portalSidebar .sidebar-logout-btn:focus-visible,
  #portalSidebar .sidebar-logout-btn:focus-visible {
    outline: 3px solid rgba(239,68,68,.28) !important;
    outline-offset: 2px;
  }
}

/* PIT152120_UI15_GLOBAL_RESPONSIVE_SHELL
   Ajustes finales de densidad y respiración sin tocar impresión/PDF. */
@media screen {
  @media (min-width: 992px) {
    body.density-compacta .content {
      padding: 16px 18px !important;
    }
  }

  @media (max-width: 991.98px) {
    .content {
      margin-left: 0 !important;
      width: 100% !important;
      padding: 14px !important;
    }
    .topbar {
      margin-bottom: 14px !important;
      padding: 15px 16px !important;
    }
  }

  @media (max-width: 575.98px) {
    .content { padding: 10px !important; }
    .topbar {
      padding: 13px 14px !important;
      border-radius: 13px !important;
    }
    .topbar h1, .topbar h2, .topbar h3 {
      font-size: 1.28rem !important;
      line-height: 1.18 !important;
    }
    .card-body { padding: 14px !important; }
  }
}



/* ==========================================================================
   PIT152121_UI16_DESKTOP_DENSITY
   Escala visual equilibrada para trabajar a 100% de zoom del navegador.
   Solo afecta pantalla: compacta shell, navegación, formularios, tarjetas y
   tablas sin cambiar colores, temas, impresión ni PDF.
   ========================================================================== */
@media screen {
  @media (min-width: 1200px) {
    html {
      font-size: 15px;
    }

    body.pit-runtime {
      font-size: 1rem;
    }

    #portalSidebar.sidebar,
    .sidebar {
      width: 238px !important;
      padding: 16px 12px 12px !important;
    }

    #portalSidebar .brand,
    .sidebar .brand {
      font-size: 21px !important;
      margin-bottom: 12px !important;
      padding: 6px 8px !important;
    }

    #portalSidebar .sidebar-section-title,
    .sidebar .sidebar-section-title {
      margin: 12px 7px 6px !important;
      font-size: .66rem !important;
    }

    #portalSidebar a,
    .sidebar a {
      min-height: 40px !important;
      padding: 8px 11px !important;
      margin-bottom: 4px !important;
      border-radius: 11px !important;
      gap: 9px !important;
      font-size: .91rem;
    }

    #portalSidebar .sidebar-user-panel,
    .sidebar .sidebar-user-panel {
      margin-top: 8px !important;
      padding: 9px !important;
      border-radius: 15px !important;
    }

    #portalSidebar .sidebar-avatar,
    #portalSidebar .sidebar-user-card img,
    #portalSidebar .sidebar-avatar-initials,
    .sidebar .sidebar-avatar,
    .sidebar .sidebar-user-card img,
    .sidebar .sidebar-avatar-initials {
      width: 38px !important;
      min-width: 38px !important;
      max-width: 38px !important;
      height: 38px !important;
      min-height: 38px !important;
      max-height: 38px !important;
    }

    #portalSidebar .sidebar-user-name,
    .sidebar .sidebar-user-name {
      font-size: .82rem !important;
    }

    #portalSidebar .sidebar-user-role,
    .sidebar .sidebar-user-role {
      font-size: .68rem !important;
    }

    #portalSidebar .sidebar-logout-btn,
    .sidebar .sidebar-logout-btn {
      min-height: 40px !important;
      margin-top: 8px !important;
      padding: 9px 11px !important;
      font-size: .87rem !important;
    }

    body.pit-runtime .content,
    .content {
      margin-left: 238px !important;
      padding: 12px 14px !important;
    }

    body.pit-runtime .topbar,
    .topbar {
      padding: 14px 16px !important;
      margin-bottom: 14px !important;
      border-radius: 14px !important;
    }

    body.pit-runtime .topbar h1,
    body.pit-runtime .topbar h2,
    body.pit-runtime .topbar h3 {
      line-height: 1.16 !important;
    }

    body.pit-runtime .card-body {
      padding: 14px 15px;
    }

    body.pit-runtime .form-control,
    body.pit-runtime .form-select {
      min-height: 38px;
      padding-top: .42rem;
      padding-bottom: .42rem;
      font-size: .91rem;
    }

    body.pit-runtime .btn {
      --bs-btn-padding-y: .42rem;
      --bs-btn-padding-x: .72rem;
      --bs-btn-font-size: .90rem;
    }

    body.pit-runtime .table {
      font-size: .89rem;
    }

    body.pit-runtime .table > :not(caption) > * > * {
      padding: .48rem .52rem;
      vertical-align: middle;
    }

    body.pit-runtime .card-stat,
    body.pit-runtime .card-custom,
    body.pit-runtime .module-card {
      border-radius: 15px;
    }
  }

  /* Escritorios compactos: conserva el ancho útil sin forzar escalado del navegador. */
  @media (min-width: 992px) and (max-width: 1199.98px) {
    #portalSidebar.sidebar,
    .sidebar {
      width: 228px !important;
    }

    body.pit-runtime .content,
    .content {
      margin-left: 228px !important;
      padding: 12px !important;
    }
  }
}


/* ==========================================================================
   PIT152122_UI17_MOBILE_SHELL
   Refinamiento móvil de shell/sidebar para 100% de zoom. Conserva la identidad
   propia de Claro/Oscuro/Auto/Institucional y no altera impresión/PDF.
   ========================================================================== */
@media screen and (max-width: 991.98px) {
  body.pit-runtime,
  body {
    padding-top: calc(env(safe-area-inset-top, 0px) + 64px) !important;
    overflow-x: hidden !important;
  }

  body.pit-runtime .content,
  .content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 10px 18px !important;
  }

  .mobile-menu-toggle {
    top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
    left: 10px !important;
    width: 46px !important;
    height: 46px !important;
    border-radius: 14px !important;
  }

  .mobile-menu-toggle i {
    font-size: 1.55rem !important;
  }

  #portalSidebar.sidebar,
  .sidebar {
    width: min(84vw, 320px) !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    padding: calc(env(safe-area-inset-top, 0px) + 62px) 12px calc(env(safe-area-inset-bottom, 0px) + 12px) !important;
    overflow-x: hidden !important;
  }

  #portalSidebar .brand,
  .sidebar .brand {
    margin-bottom: 10px !important;
    padding: 4px 7px !important;
    font-size: 20px !important;
  }

  #portalSidebar .sidebar-section-title,
  .sidebar .sidebar-section-title {
    margin: 10px 6px 5px !important;
  }

  #portalSidebar a,
  .sidebar a {
    min-height: 40px !important;
    padding: 8px 10px !important;
    margin-bottom: 4px !important;
    border-radius: 11px !important;
  }

  #portalSidebar .sidebar-user-panel,
  .sidebar .sidebar-user-panel {
    margin-top: 8px !important;
    padding: 9px !important;
    border-radius: 14px !important;
  }

  #portalSidebar .sidebar-logout-btn,
  .sidebar .sidebar-logout-btn {
    min-height: 42px !important;
    padding: 9px 11px !important;
    margin-top: 8px !important;
  }

  body.sidebar-open {
    overflow: hidden !important;
  }
}

@media screen and (max-width: 575.98px) {
  body.pit-runtime,
  body {
    padding-top: calc(env(safe-area-inset-top, 0px) + 60px) !important;
  }

  body.pit-runtime .content,
  .content {
    padding: 8px 8px 16px !important;
  }

  .mobile-menu-toggle {
    top: calc(env(safe-area-inset-top, 0px) + 9px) !important;
    left: 9px !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 13px !important;
  }

  #portalSidebar.sidebar,
  .sidebar {
    width: min(84vw, 306px) !important;
    padding-top: calc(env(safe-area-inset-top, 0px) + 58px) !important;
  }
}

/* ==========================================================================
   PIT152123_UI18_MOBILE_MENU_EDGE_DOCK
   Menú móvil refinado: botón más pequeño, pegado al borde izquierdo y con
   sombra discreta. Aprovecha la franja superior ya reservada por UI1.7 y
   evita cubrir títulos/tarjetas al desplazarse. No cambia el sidebar ni PC.
   ========================================================================== */
@media screen and (max-width: 991.98px) {
  .mobile-menu-toggle {
    top: calc(env(safe-area-inset-top, 0px) + 8px) !important;
    left: 0 !important;
    width: 40px !important;
    height: 44px !important;
    border-radius: 0 12px 12px 0 !important;
    box-shadow: 0 5px 14px rgba(var(--pit-primary-rgb, 37,99,235), .24) !important;
    opacity: .96 !important;
  }

  .mobile-menu-toggle i {
    font-size: 1.34rem !important;
  }

  /* La franja superior de UI1.7 queda reservada para el control flotante. */
  body.pit-runtime,
  body {
    scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 58px) !important;
  }

  body.sidebar-open .mobile-menu-toggle {
    box-shadow: 0 4px 12px rgba(15,23,42,.20) !important;
  }
}

@media screen and (max-width: 575.98px) {
  .mobile-menu-toggle {
    top: calc(env(safe-area-inset-top, 0px) + 7px) !important;
    width: 38px !important;
    height: 42px !important;
    border-radius: 0 11px 11px 0 !important;
  }

  .mobile-menu-toggle i {
    font-size: 1.26rem !important;
  }
}



/* ==========================================================================
   PIT152124_UI19_MOBILE_NAV_HEADER
   Barra superior móvil real: el control del sidebar deja de flotar sobre el
   contenido y vive dentro de una cabecera fija, opaca y temática. La barra
   respeta safe-area, Claro/Oscuro/Auto/Institucional y no afecta escritorio,
   impresión ni el comportamiento del sidebar.
   ========================================================================== */
.mobile-app-bar {
  display: none;
}

@media screen and (max-width: 991.98px) {
  body.pit-runtime,
  body {
    padding-top: calc(env(safe-area-inset-top, 0px) + 56px) !important;
    scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 60px) !important;
  }

  .mobile-app-bar {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: calc(env(safe-area-inset-top, 0px) + 54px) !important;
    padding: env(safe-area-inset-top, 0px) 12px 0 !important;
    align-items: center !important;
    gap: 10px !important;
    background: rgba(255,255,255,.97) !important;
    border-bottom: 1px solid var(--pit-border, #d7dee8) !important;
    box-shadow: 0 3px 14px rgba(15,23,42,.08) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    backdrop-filter: blur(12px) !important;
    z-index: 99996 !important;
  }

  .mobile-app-bar .mobile-menu-toggle {
    display: inline-flex !important;
    position: static !important;
    inset: auto !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    flex: 0 0 40px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(var(--pit-primary-rgb, 37,99,235), .18) !important;
    opacity: 1 !important;
    z-index: auto !important;
  }

  .mobile-app-bar .mobile-menu-toggle i {
    font-size: 1.28rem !important;
    line-height: 1 !important;
  }

  .mobile-app-bar-brand {
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: var(--pit-text, #172033) !important;
    font-size: .96rem !important;
    font-weight: 800 !important;
    letter-spacing: -.01em !important;
    white-space: nowrap !important;
  }

  .mobile-app-bar-brand i {
    color: var(--pit-primary, #2563eb) !important;
    font-size: 1rem !important;
  }

  /* El backdrop y el sidebar quedan por encima de la barra al abrir el menú. */
  body.sidebar-open .mobile-app-bar {
    pointer-events: none !important;
  }

  body.sidebar-open .mobile-app-bar .mobile-menu-toggle {
    box-shadow: 0 4px 12px rgba(15,23,42,.12) !important;
  }

  body.theme-claro .mobile-app-bar,
  body.theme-auto .mobile-app-bar {
    background: rgba(255,255,255,.97) !important;
    border-bottom-color: #d7dee8 !important;
  }

  body.theme-oscuro .mobile-app-bar {
    background: rgba(8,13,22,.97) !important;
    border-bottom-color: #334155 !important;
    box-shadow: 0 3px 16px rgba(0,0,0,.24) !important;
  }

  body.theme-oscuro .mobile-app-bar-brand {
    color: #f8fafc !important;
  }

  body.theme-oscuro .mobile-app-bar-brand i {
    color: #93c5fd !important;
  }

  body.theme-institucional .mobile-app-bar {
    background: linear-gradient(90deg, #720C13 0%, #860038 58%, #053C74 100%) !important;
    border-bottom-color: rgba(255,255,255,.14) !important;
    box-shadow: 0 3px 16px rgba(134,0,56,.22) !important;
  }

  body.theme-institucional .mobile-app-bar-brand,
  body.theme-institucional .mobile-app-bar-brand i {
    color: #ffffff !important;
  }

  body.theme-institucional .mobile-app-bar .mobile-menu-toggle {
    background: #F1A923 !important;
    color: #2b1900 !important;
    border: 1px solid rgba(255,255,255,.18) !important;
    box-shadow: 0 4px 12px rgba(241,169,35,.22) !important;
  }
}

@media screen and (max-width: 575.98px) {
  body.pit-runtime,
  body {
    padding-top: calc(env(safe-area-inset-top, 0px) + 54px) !important;
    scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 58px) !important;
  }

  .mobile-app-bar {
    height: calc(env(safe-area-inset-top, 0px) + 52px) !important;
    padding-left: 9px !important;
    padding-right: 10px !important;
    gap: 8px !important;
  }

  .mobile-app-bar .mobile-menu-toggle {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    flex-basis: 38px !important;
    border-radius: 11px !important;
  }

  .mobile-app-bar .mobile-menu-toggle i {
    font-size: 1.20rem !important;
  }

  .mobile-app-bar-brand {
    font-size: .92rem !important;
  }
}

/* ==========================================================
   Portal IT 1.9.7.152.192 - AUTH-UX1.0
   Refresh visual de login/logout sin alterar autenticación.
   ========================================================== */

body.auth-page.auth-access-refresh {
    --pit-auth-gold-soft: rgba(241,169,35,.16);
    --pit-auth-maroon-soft: rgba(134,0,56,.12);
    --pit-auth-border-soft: rgba(134,0,56,.10);
    background:
        radial-gradient(circle at 10% 12%, rgba(241,169,35,.14), transparent 28%),
        radial-gradient(circle at 86% 14%, rgba(5,60,116,.16), transparent 28%),
        radial-gradient(circle at 82% 84%, rgba(58,118,64,.12), transparent 30%),
        linear-gradient(135deg, #210812 0%, #46001f 34%, #760032 66%, #24152c 100%) !important;
}

.auth-access-refresh .auth-panel {
    max-width: 1180px;
    margin: 0 auto;
    grid-template-columns: 1.08fr .92fr;
    border-radius: 34px;
    overflow: hidden;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 34px 90px rgba(12,5,14,.34), inset 0 1px 0 rgba(255,255,255,.10);
}

.auth-access-refresh .auth-brand-side {
    position: relative;
    overflow: hidden;
    padding: 52px 48px;
    background:
        linear-gradient(150deg, rgba(255,255,255,.075), rgba(255,255,255,.02)),
        radial-gradient(circle at 15% 0%, rgba(241,169,35,.16), transparent 34%);
}

.auth-access-refresh .auth-brand-side::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -110px;
    bottom: -110px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 0 0 42px rgba(255,255,255,.022), 0 0 0 92px rgba(255,255,255,.016);
    pointer-events: none;
}

.auth-access-refresh .auth-brand-wrap {
    position: relative;
    z-index: 1;
    min-height: 470px;
    display: flex;
    flex-direction: column;
}

.auth-access-refresh .auth-brand-logo-wrap {
    padding: 13px 17px;
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(24,7,17,.20);
}

.auth-access-refresh .auth-brand-logo {
    max-width: 220px;
    max-height: 76px;
}

.auth-access-refresh .auth-brand-copy {
    margin-top: auto;
    margin-bottom: 26px;
}

.auth-access-refresh .auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: rgba(255,255,255,.76);
    letter-spacing: .14em;
}

.auth-access-refresh .auth-eyebrow i {
    color: #f1a923;
    font-size: 13px;
}

.auth-access-refresh .auth-brand-title {
    margin-bottom: 8px;
    font-size: clamp(3rem, 4.5vw, 4.15rem);
    letter-spacing: -.055em;
}

.auth-access-refresh .auth-brand-subtitle {
    max-width: 520px;
    font-size: 1.02rem;
    color: rgba(255,255,255,.90);
}

.auth-access-refresh .auth-brand-description {
    max-width: 520px;
    margin-top: 14px;
    color: rgba(255,255,255,.72);
    font-size: .98rem;
    line-height: 1.7;
}

.auth-access-refresh .auth-trust-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.auth-access-refresh .auth-trust-item {
    min-width: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    padding: 13px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.075);
    border: 1px solid rgba(255,255,255,.10);
    backdrop-filter: blur(8px);
}

.auth-access-refresh .auth-trust-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 16px;
}

.auth-access-refresh .auth-trust-item strong,
.auth-access-refresh .auth-trust-item small {
    display: block;
}

.auth-access-refresh .auth-trust-item strong {
    color: #fff;
    font-size: 12.5px;
    font-weight: 850;
}

.auth-access-refresh .auth-trust-item small {
    margin-top: 2px;
    color: rgba(255,255,255,.62);
    font-size: 10.5px;
    line-height: 1.25;
}

.auth-access-refresh .auth-brand-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    color: rgba(255,255,255,.66);
    font-size: 11.5px;
}

.auth-access-refresh .auth-brand-meta > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.auth-access-refresh .auth-version-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.76);
    font-weight: 750;
    white-space: nowrap;
}

.auth-access-refresh .auth-form-side {
    padding: 28px;
    background: rgba(255,255,255,.035);
}

.auth-access-refresh .auth-form-card {
    max-width: 475px;
    padding: 36px 34px 28px;
    border-radius: 28px;
    background: rgba(255,255,255,.985);
    border: 1px solid rgba(255,255,255,.82);
    box-shadow: 0 24px 64px rgba(12,5,14,.20), inset 0 1px 0 rgba(255,255,255,.96);
}

.auth-access-refresh .auth-access-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: rgba(58,118,64,.08);
    border: 1px solid rgba(58,118,64,.12);
    color: #315f37;
    font-size: 11.5px;
    font-weight: 800;
}

.auth-access-refresh .auth-form-head {
    margin-bottom: 20px;
}

.auth-access-refresh .auth-form-head h2 {
    margin-top: 0;
    font-size: clamp(2rem, 3vw, 2.45rem);
}

.auth-access-refresh .auth-form-head p {
    max-width: 390px;
    color: #706872;
}

.auth-access-refresh .auth-google-btn {
    position: relative;
    min-height: 58px;
    padding: 0 54px 0 14px !important;
    justify-content: flex-start !important;
    background: #fff !important;
    color: #2a2028 !important;
    border: 1px solid rgba(134,0,56,.16) !important;
    box-shadow: 0 12px 28px rgba(35,20,28,.08) !important;
}

.auth-access-refresh .auth-google-btn:hover {
    color: #2a2028 !important;
    border-color: rgba(134,0,56,.28) !important;
    box-shadow: 0 16px 34px rgba(35,20,28,.12) !important;
    transform: translateY(-1px);
}

.auth-access-refresh .auth-google-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    background: rgba(219,68,55,.07) !important;
    color: #db4437 !important;
    border-radius: 12px;
}

.auth-access-refresh .auth-google-label {
    margin-left: 10px;
    font-weight: 800;
}

.auth-access-refresh .auth-google-arrow {
    position: absolute;
    right: 18px;
    color: var(--pit-auth-primary);
    font-size: 18px;
}

.auth-access-refresh .auth-google-btn.is-loading .auth-google-arrow {
    animation: pitAuth192Arrow 1s ease-in-out infinite alternate;
}

.auth-access-refresh .auth-sso-hint {
    margin-top: 1px;
    color: #7a737c;
}

.auth-access-refresh .auth-sso-hint strong {
    color: #4e424a;
}

.auth-access-refresh .auth-local-divider {
    margin-top: 4px;
}

.auth-access-refresh .auth-input-wrap {
    background: #fcfbfc;
    border-color: rgba(134,0,56,.12);
}

.auth-access-refresh .auth-input-wrap:focus-within {
    background: #fff;
    border-color: rgba(134,0,56,.38);
    box-shadow: 0 0 0 4px rgba(134,0,56,.07), 0 12px 24px rgba(114,12,19,.06);
}

.auth-access-refresh .auth-submit-btn:not(.auth-google-btn) {
    background: linear-gradient(135deg, #92003e, #6f0b2e) !important;
    box-shadow: 0 16px 30px rgba(134,0,56,.22);
}

.auth-access-refresh .auth-submit-btn:disabled {
    cursor: wait;
    opacity: .78;
    transform: none !important;
}

.auth-access-refresh .auth-alternate-access a {
    padding: 7px 10px;
    border-radius: 10px;
    text-decoration: none;
    background: rgba(5,60,116,.045);
    color: #665f68;
}

.auth-access-refresh .auth-alternate-access a:hover {
    background: rgba(5,60,116,.075);
    color: #053c74;
}

.auth-access-refresh .auth-footer-note {
    margin-top: 20px;
    padding-top: 15px;
}

.auth-access-refresh .auth-form-version {
    margin-top: 12px;
    color: #918a93;
    font-size: 10.5px;
    text-align: center;
}

@keyframes pitAuth192Arrow {
    from { transform: translateX(0); }
    to { transform: translateX(4px); }
}

/* Logout AUTH-UX1.0 */
body.auth-page.auth-logout-refresh {
    background:
        radial-gradient(circle at 12% 10%, rgba(241,169,35,.10), transparent 28%),
        radial-gradient(circle at 88% 12%, rgba(5,60,116,.13), transparent 28%),
        linear-gradient(135deg, #210812 0%, #520024 48%, #25142d 100%) !important;
}

.auth-logout-refresh .auth-shell-logout {
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: 36px 14px;
}

.auth-logout-refresh .auth-logout-container {
    max-width: 610px;
}

.auth-logout-refresh .auth-logout-card {
    position: relative;
    overflow: hidden;
    padding: 28px 32px 30px;
    border-radius: 30px;
    background: rgba(255,255,255,.985);
    border: 1px solid rgba(255,255,255,.82);
    box-shadow: 0 32px 80px rgba(12,5,14,.28);
}

.auth-logout-refresh .auth-logout-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, #860038, #f1a923, #053c74);
}

.auth-logout-refresh .auth-logout-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(134,0,56,.09);
    text-align: left;
}

.auth-logout-refresh .auth-logout-brand > div:last-child {
    min-width: 0;
}

.auth-logout-refresh .auth-logout-brand strong,
.auth-logout-refresh .auth-logout-brand span {
    display: block;
}

.auth-logout-refresh .auth-logout-brand strong {
    color: #24171e;
    font-size: 14px;
    font-weight: 900;
}

.auth-logout-refresh .auth-logout-brand span {
    margin-top: 2px;
    color: #7c747d;
    font-size: 11px;
}

.auth-logout-refresh .auth-logout-logo-wrap {
    width: 104px;
    margin: 0;
}

.auth-logout-refresh .auth-logout-logo {
    display: block;
    width: 100%;
    max-height: 48px;
    object-fit: contain;
}

.auth-logout-refresh .auth-logout-badge {
    width: 74px;
    height: 74px;
    margin-bottom: 16px;
    border-radius: 24px;
    background: linear-gradient(135deg, #860038, #68002b);
    box-shadow: 0 16px 32px rgba(134,0,56,.22);
}

.auth-logout-refresh .auth-logout-badge.is-success {
    background: linear-gradient(135deg, var(--pit-auth-green), var(--pit-auth-green-dark));
    box-shadow: 0 16px 32px rgba(38,78,42,.22);
}

.auth-logout-refresh .auth-logout-card h1 {
    margin-top: 12px;
    font-size: clamp(1.9rem, 4vw, 2.35rem);
}

.auth-logout-refresh .auth-logout-lead {
    max-width: 430px;
    margin: 0 auto 18px;
}

.auth-logout-refresh .auth-logout-identity {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    max-width: 450px;
    margin: 20px auto 0;
    padding: 13px 14px;
    border-radius: 18px;
    border: 1px solid rgba(134,0,56,.10);
    background: #fbf9fa;
    text-align: left;
}

.auth-logout-refresh .auth-logout-avatar {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #860038, #720c13);
    color: #fff;
    font-weight: 900;
    font-size: 18px;
    box-shadow: 0 10px 22px rgba(134,0,56,.16);
}

.auth-logout-refresh .auth-logout-identity strong,
.auth-logout-refresh .auth-logout-identity span {
    display: block;
}

.auth-logout-refresh .auth-logout-identity strong {
    color: #2a2027;
    font-size: 13.5px;
}

.auth-logout-refresh .auth-logout-identity > div span {
    margin-top: 2px;
    color: #7b747d;
    font-size: 11.5px;
}

.auth-logout-refresh .auth-logout-identity-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #3a7040;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.auth-logout-refresh .auth-logout-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    max-width: 450px;
    margin: 12px auto 0;
    padding: 11px 13px;
    border-radius: 14px;
    background: rgba(5,60,116,.05);
    border: 1px solid rgba(5,60,116,.08);
    color: #5e6570;
    font-size: 11.5px;
    line-height: 1.45;
    text-align: left;
}

.auth-logout-refresh .auth-logout-note i {
    color: #4285f4;
    margin-top: 1px;
}

.auth-logout-refresh .auth-logout-actions {
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.auth-logout-refresh .auth-submit-btn-secondary {
    background: #fff !important;
    color: #4f4650 !important;
    border: 1px solid rgba(134,0,56,.14) !important;
    box-shadow: none;
}

.auth-logout-refresh .auth-submit-btn-secondary:hover {
    color: #860038 !important;
    background: #fbf7f9 !important;
    border-color: rgba(134,0,56,.24) !important;
    box-shadow: none;
}

.auth-logout-refresh .auth-logout-status {
    background: rgba(58,118,64,.07);
    border: 1px solid rgba(58,118,64,.10);
}

.auth-logout-refresh a:focus-visible,
.auth-logout-refresh button:focus-visible {
    outline: 3px solid rgba(5,60,116,.34) !important;
    outline-offset: 3px;
}

@media (max-width: 991.98px) {
    .auth-access-refresh .auth-panel {
        grid-template-columns: 1fr;
    }

    .auth-access-refresh .auth-form-side {
        order: 1;
    }

    .auth-access-refresh .auth-brand-side {
        order: 2;
        padding: 30px;
    }

    .auth-access-refresh .auth-brand-wrap {
        min-height: 0;
    }

    .auth-access-refresh .auth-brand-copy {
        margin-top: 12px;
    }

    .auth-access-refresh .auth-trust-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .auth-access-refresh .auth-form-side {
        padding: 10px;
    }

    .auth-access-refresh .auth-form-card {
        max-width: none;
        padding: 22px 18px 20px;
        border-radius: 22px;
    }

    .auth-access-refresh .auth-access-kicker {
        margin-bottom: 12px;
    }

    .auth-access-refresh .auth-google-btn {
        min-height: 56px;
        padding-right: 48px !important;
    }

    .auth-logout-refresh .auth-shell-logout {
        padding: max(14px, env(safe-area-inset-top)) 10px max(18px, env(safe-area-inset-bottom));
    }

    .auth-logout-refresh .auth-logout-card {
        padding: 24px 18px 22px;
        border-radius: 24px;
    }

    .auth-logout-refresh .auth-logout-brand {
        justify-content: flex-start;
    }

    .auth-logout-refresh .auth-logout-identity {
        grid-template-columns: auto 1fr;
    }

    .auth-logout-refresh .auth-logout-identity-status {
        grid-column: 2;
    }
}

@media (max-width: 399.98px) {
    .auth-access-refresh .auth-google-label {
        font-size: 13px;
    }

    .auth-logout-refresh .auth-logout-brand span {
        font-size: 10.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-access-refresh *,
    .auth-logout-refresh * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* PIT152264_DS11_BOOTSTRAP_ACCENT
 * Los componentes de Bootstrap que traen el azul #0d6efd escrito (casillas, interruptores,
 * barras de progreso, paginación, listas, píldoras, acordeón, alertas, fondos y textos
 * "primary" y botones de contorno) toman el acento del tema. Las reglas de componente usan
 * :where(.pit-runtime) para pesar exactamente lo mismo que las de Bootstrap: le ganan por
 * orden de carga, y cualquier regla de una pantalla que ya le ganaba a Bootstrap le sigue
 * ganando. El tema Institucional conserva sus variables (body.theme-institucional pesa más).
 */
.pit-runtime {
    --bs-primary-rgb: var(--pit-primary-rgb);
    --bs-primary-text-emphasis: var(--pit-primary-dark);
    --bs-primary-bg-subtle: var(--pit-primary-100);
    --bs-primary-border-subtle: var(--pit-primary-200);
    --bs-link-color: var(--pit-primary);
    --bs-link-hover-color: var(--pit-primary-dark);
    --bs-focus-ring-color: rgba(var(--pit-primary-rgb), .25);
}

:where(.pit-runtime) .btn-primary {
    --bs-btn-focus-shadow-rgb: var(--pit-primary-rgb);
}

:where(.pit-runtime) .btn-outline-primary {
    --bs-btn-color: var(--pit-primary);
    --bs-btn-border-color: var(--pit-primary);
    --bs-btn-hover-bg: var(--pit-primary);
    --bs-btn-hover-border-color: var(--pit-primary);
    --bs-btn-focus-shadow-rgb: var(--pit-primary-rgb);
    --bs-btn-active-bg: var(--pit-primary);
    --bs-btn-active-border-color: var(--pit-primary);
    --bs-btn-disabled-color: var(--pit-primary);
    --bs-btn-disabled-border-color: var(--pit-primary);
}

:where(.pit-runtime) .progress,
:where(.pit-runtime) .progress-stacked {
    --bs-progress-bar-bg: var(--pit-primary);
}

:where(.pit-runtime) .nav-pills {
    --bs-nav-pills-link-active-bg: var(--pit-primary);
}

:where(.pit-runtime) .pagination {
    --bs-pagination-focus-box-shadow: 0 0 0 .25rem rgba(var(--pit-primary-rgb), .25);
    --bs-pagination-active-bg: var(--pit-primary);
    --bs-pagination-active-border-color: var(--pit-primary);
}

:where(.pit-runtime) .list-group {
    --bs-list-group-active-bg: var(--pit-primary);
    --bs-list-group-active-border-color: var(--pit-primary);
}

:where(.pit-runtime) .accordion {
    --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem rgba(var(--pit-primary-rgb), .25);
}

:where(.pit-runtime) .dropdown-menu {
    --bs-dropdown-link-active-bg: var(--pit-primary);
}

:where(.pit-runtime) .form-check-input:checked,
:where(.pit-runtime) .form-check-input[type=checkbox]:indeterminate {
    background-color: var(--pit-primary);
    border-color: var(--pit-primary);
}

:where(.pit-runtime) .form-check-input:focus {
    border-color: var(--pit-primary-300);
    box-shadow: 0 0 0 .25rem rgba(var(--pit-primary-rgb), .25);
}
