/* SIS Informes — RIS Carabaya | Autores: Dennis S. Quispe M. y Wilber Choque C. */
/* ==========================================================================
   Tema SB Admin (mismo diseño que sisAlmacen): barra superior celeste,
   menú lateral oscuro con secciones, migas de pan y pie de página claro.
   Solo cambia la apariencia; los IDs, clases y funciones JS se conservan.
   ========================================================================== */

:root {
    --sb-topnav-h: 56px;
    --sb-sidenav-w: 225px;
    --sb-info: #0dcaf0;
    --sb-primary: #0d6efd;
    --sb-dark: #212529;
    --sb-dark-footer: #343a40;
    --sb-light: #f8f9fa;
    --sb-border: rgba(0, 0, 0, 0.125);
    --sb-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   PANEL ADMINISTRADOR (layouts/adminlte)
   -------------------------------------------------------------------------- */
body.adminlte-body {
    --sidebar-width: var(--sb-sidenav-w);
    font-family: var(--sb-font);
    font-size: 1rem;
    display: block;
}
body.adminlte-body:not(.dark-mode) { background-color: #ffffff !important; color: #212529 !important; }

/* Barra superior */
body.adminlte-body .sb-topnav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--sb-topnav-h) !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    z-index: 1039;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none !important;
    box-shadow: none !important;
}
body.adminlte-body:not(.dark-mode) .sb-topnav { background-color: var(--sb-info) !important; }

.sb-topnav .sb-brand {
    width: var(--sb-sidenav-w);
    flex-shrink: 0;
    padding-left: 1rem;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 400;
    color: #ffffff !important;
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sb-topnav .sb-toggle {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    margin-right: 1rem;
}
.sb-topnav .sb-toggle:hover { color: #ffffff; }
.sb-topnav .topbar-right {
    margin-left: auto;
    padding-right: 1.5rem;
    gap: 12px !important;
}
.sb-topnav .sb-top-link {
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.75) !important;
    background: transparent !important;
    border-radius: 0.25rem !important;
    padding: 0.3rem 0.65rem !important;
    font-size: 0.8rem !important;
    font-weight: 400 !important;
    box-shadow: none !important;
    text-decoration: none;
}
.sb-topnav .sb-top-link:hover { background: rgba(255, 255, 255, 0.15) !important; }
body.adminlte-body .sb-topnav .theme-toggle-btn {
    width: 34px !important; height: 34px !important;
    margin-right: 0 !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}
body.adminlte-body .sb-topnav .user-dropdown-btn { color: #ffffff; }
body.adminlte-body .sb-topnav .user-name,
body:not(.dark-mode) .main-header-admin.sb-topnav .user-name { color: #ffffff !important; font-size: 0.9rem; font-weight: 400; }
body.adminlte-body .sb-topnav .user-avatar {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}
body.adminlte-body .sb-topnav .dropdown-menu {
    top: calc(100% + 10px);
    border-radius: 0.25rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    animation: none;
}
body.adminlte-body .dropdown-link { font-size: 0.95rem; padding: 0.4rem 1rem; }
body.adminlte-body .dropdown-link:hover { background: #e9ecef; color: #1e2125; }

/* Menú lateral */
body.adminlte-body .sb-sidenav {
    top: var(--sb-topnav-h);
    height: calc(100vh - var(--sb-topnav-h));
    width: var(--sb-sidenav-w) !important;
    overflow: hidden;
    box-shadow: none;
    border-right: none !important;
    transform: translateX(0);
    transition: transform 0.15s ease-in-out;
}
body.adminlte-body:not(.dark-mode) .sb-sidenav { background-color: var(--sb-dark) !important; }

.sb-sidenav .sidebar-menu {
    padding: 0;
    gap: 0;
    flex: 1;
    overflow-y: auto;
}
.sb-sidenav .sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); }

.sb-sidenav .nav-header {
    padding: 1.75rem 1rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.25);
}
.sb-sidenav .nav-item-admin { border-radius: 0; }
.sb-sidenav .nav-link-admin {
    gap: 0;
    padding: 0.75rem 1rem;
    margin: 0;
    border-radius: 0;
    font-size: 1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    background: transparent !important;
}
.sb-sidenav .nav-link-admin i {
    width: auto;
    min-width: 1rem;
    margin-right: 0.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.25);
}
body.adminlte-body .sb-sidenav .nav-link-admin span { color: inherit !important; }
body.adminlte-body .sb-sidenav .nav-link-admin:hover,
body.adminlte-body .sb-sidenav .nav-link-admin.active {
    background: transparent !important;
    color: #ffffff !important;
    font-weight: 400;
}
body.adminlte-body .sb-sidenav .nav-link-admin:hover i,
body.adminlte-body .sb-sidenav .nav-link-admin.active i { color: #ffffff; }

.sb-sidenav .sidebar-copyright {
    margin-top: auto;
    padding: 1.25rem 1rem 0.75rem;
    border-top: none;
    color: rgba(255, 255, 255, 0.25);
}
.sb-sidenav .sb-sidenav-footer {
    padding: 0.75rem 1rem;
    background-color: var(--sb-dark-footer);
    color: #ffffff;
    font-size: 1rem;
    flex-shrink: 0;
}
.sb-sidenav .sb-sidenav-footer .small { font-size: 0.875em; color: rgba(255, 255, 255, 0.75); }

/* Contenido */
body.adminlte-body .content-wrapper-admin {
    padding-top: var(--sb-topnav-h);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body.adminlte-body:not(.dark-mode) .content-wrapper-admin,
body.adminlte-body:not(.dark-mode) .content-body-admin { background-color: #ffffff !important; }
body.adminlte-body .content-body-admin {
    padding: 0 1.5rem 1.5rem !important;
    min-height: auto !important;
}
body.adminlte-body .admin-page-title {
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: normal;
}
body.adminlte-body .admin-page-sub { font-weight: 400; color: #6c757d; }
.sb-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0.75rem 1rem;
    margin: 1.5rem 0;
    background-color: #e9ecef;
    border-radius: 0.25rem;
    font-size: 1rem;
}
.sb-breadcrumb li + li::before {
    content: "/";
    padding: 0 0.5rem;
    color: #6c757d;
}
.sb-breadcrumb a { color: var(--sb-primary); text-decoration: underline; }
.sb-breadcrumb .active { color: #6c757d; }
body.dark-mode .sb-breadcrumb { background-color: #1e293b; }
body.dark-mode .sb-breadcrumb .active { color: #94a3b8; }
body.dark-mode .sb-breadcrumb a { color: #7dd3fc; }

.sb-footer {
    margin-top: auto;
    padding: 1.5rem;
    background-color: var(--sb-light);
    font-size: 0.875em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    color: #6c757d;
}
.sb-footer a { color: var(--sb-primary); text-decoration: underline; }
body.dark-mode .sb-footer { background-color: #151c2c; color: #94a3b8; }

/* Tarjetas y botones al estilo Bootstrap / SB Admin */
body.adminlte-body .card-admin,
body.adminlte-body .card {
    border-radius: 0.25rem;
    box-shadow: none;
    border: 1px solid var(--sb-border);
}
body.adminlte-body:not(.dark-mode) .card-header-admin,
body.adminlte-body:not(.dark-mode) .card-header {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid var(--sb-border);
    padding: 0.75rem 1.25rem;
}
body.adminlte-body .btn { border-radius: 0.25rem; }
body.adminlte-body .btn-primary {
    background-color: var(--sb-primary);
    box-shadow: none;
}
body.adminlte-body .btn-primary:hover {
    background-color: #0b5ed7;
    transform: none;
    box-shadow: none;
}

/* Escritorio: el botón ☰ oculta/muestra el menú completo (como SB Admin) */
@media (min-width: 992px) {
    body.adminlte-body .content-wrapper-admin {
        margin-left: var(--sb-sidenav-w);
        width: calc(100% - var(--sb-sidenav-w));
        transition: margin-left 0.15s ease-in-out;
    }
    body.adminlte-body.sidebar-collapsed .sb-sidenav {
        width: var(--sb-sidenav-w) !important;
        transform: translateX(calc(-1 * var(--sb-sidenav-w)));
    }
    body.adminlte-body.sidebar-collapsed .content-wrapper-admin {
        margin-left: 0;
        width: 100%;
    }
    /* Anula el modo "solo íconos" del diseño anterior */
    body.adminlte-body.sidebar-collapsed .nav-link-admin span,
    body.adminlte-body.sidebar-collapsed .nav-header,
    body.adminlte-body.sidebar-collapsed .sidebar-copyright {
        opacity: 1; visibility: visible; width: auto; white-space: normal;
    }
    body.adminlte-body.sidebar-collapsed .nav-header { padding: 1.75rem 1rem 0.75rem; }
    body.adminlte-body.sidebar-collapsed .sidebar-copyright { padding: 1.25rem 1rem 0.75rem; }
    body.adminlte-body.sidebar-collapsed .nav-link-admin { justify-content: flex-start; padding: 0.75rem 1rem; }
    body.adminlte-body.sidebar-collapsed .nav-link-admin i { margin-right: 0.5rem; }
}

/* Móvil y tablet: menú fuera de pantalla hasta pulsar ☰ */
@media (max-width: 991.98px) {
    body.adminlte-body .sb-sidenav { transform: translateX(-100%); }
    body.adminlte-body.sidebar-open .sb-sidenav { transform: translateX(0); }
    body.adminlte-body .sidebar-overlay { top: var(--sb-topnav-h); }
    .sb-topnav .sb-brand { width: auto; padding-right: 0.5rem; font-size: 1.1rem; }
    .sb-topnav .topbar-right { padding-right: 0.75rem; }
    .sb-topnav .sb-top-link span { display: none; }
}
@media (max-width: 575.98px) {
    body.adminlte-body .admin-page-title { font-size: 1.4rem; }
    .sb-breadcrumb { margin: 1rem 0; font-size: 0.85rem; }
    body.adminlte-body .content-body-admin { padding: 0 12px 12px !important; }
    .sb-footer { padding: 1rem 12px; }
}

/* --------------------------------------------------------------------------
   PORTAL DE ENTREGA (layouts/app) — barra superior celeste
   -------------------------------------------------------------------------- */
body:not(.dark-mode) .navbar-premium.sb-topnav-app {
    background-color: var(--sb-info);
    border-bottom: none;
}
.navbar-premium.sb-topnav-app {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--sb-topnav-h);
    padding: 0 1.5rem 0 0;
    z-index: 1039;
    font-family: var(--sb-font);
    flex-wrap: nowrap;
}
.sb-topnav-app .navbar-left { gap: 0; height: 100%; width: auto; flex-wrap: nowrap; }
.sb-topnav-app .brand-logo {
    width: var(--sb-sidenav-w);
    padding-left: 1rem;
    color: #ffffff;
    font-weight: 400;
    font-size: 1.25rem;
    white-space: nowrap;
}
.sb-topnav-app .sb-app-toggle {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
}
.sb-topnav-app .sb-app-toggle:hover { color: #ffffff; }
.sb-topnav-app .navbar-right { width: auto; flex-wrap: nowrap; }
.sb-topnav-app .icon-btn { color: rgba(255, 255, 255, 0.85); }
.sb-topnav-app .icon-btn:hover { background-color: rgba(255, 255, 255, 0.15); color: #ffffff; }
.sb-topnav-app .badge-dot { background-color: #dc3545; border-color: var(--sb-info); }
.sb-topnav-app .divider-vertical { background-color: rgba(255, 255, 255, 0.4); }
.sb-topnav-app .user-profile:hover { background-color: rgba(255, 255, 255, 0.15); }
body:not(.dark-mode) .sb-topnav-app .user-name { color: #ffffff; font-weight: 500; }
body:not(.dark-mode) .sb-topnav-app .user-role { color: rgba(255, 255, 255, 0.8); }
.sb-topnav-app .user-profile > .fa-chevron-down { color: rgba(255, 255, 255, 0.8) !important; }
.sb-topnav-app .dropdown-menu { border-radius: 0.25rem; }
.sb-topnav-app .dropdown-menu .user-name { color: inherit; }

/* Menú lateral oscuro */
.sb-app-sidenav {
    position: fixed;
    top: var(--sb-topnav-h);
    left: 0;
    width: var(--sb-sidenav-w);
    height: calc(100vh - var(--sb-topnav-h));
    background-color: var(--sb-dark);
    display: flex;
    flex-direction: column;
    z-index: 1038;
    font-family: var(--sb-font);
    transition: transform 0.15s ease-in-out;
}
body.dark-mode .sb-app-sidenav { background-color: #151c2c; }
.sb-app-menu { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.sb-app-heading {
    padding: 1.75rem 1rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.25);
}
.sb-app-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 1rem;
    text-decoration: none;
}
.sb-app-link i { margin-right: 0.5rem; font-size: 0.9rem; min-width: 1rem; color: rgba(255, 255, 255, 0.25); }
.sb-app-link:hover,
.sb-app-link.active { color: #ffffff !important; }
.sb-app-link:hover i,
.sb-app-link.active i { color: #ffffff; }
.sb-app-sidenav-footer {
    padding: 0.75rem 1rem;
    background-color: var(--sb-dark-footer);
    color: #ffffff;
    flex-shrink: 0;
}
.sb-app-sidenav-footer .small { font-size: 0.875em; color: rgba(255, 255, 255, 0.75); }
/* Derechos de autor al pie de la barra del menú (igual que .sidebar-copyright del panel) */
.sb-app-copyright {
    margin-top: auto;
    padding: 1.25rem 1rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.25);
}
.sb-app-overlay { display: none; }

/* Contenido a la derecha del menú */
.sb-app-content {
    padding-top: var(--sb-topnav-h);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.15s ease-in-out;
}
body:not(.app-medico):not(.dark-mode) { background-color: #ffffff; }
.sb-app-content .main-content { flex: 1; font-family: var(--sb-font); padding: 0 1.5rem 1.5rem; }
.sb-app-breadcrumb { margin: 1.5rem 0 0; }
.sb-app-content .app-body { max-width: none; padding: 0; }

.sb-footer-app {
    padding: 1.5rem;
    background-color: var(--sb-light);
    color: #6c757d;
    font-size: 0.875em;
    font-family: var(--sb-font);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
body.dark-mode .sb-footer-app { background-color: #1e293b; color: #94a3b8; }

@media (min-width: 992px) {
    .sb-app-content { margin-left: var(--sb-sidenav-w); }
    body.sb-app-collapsed .sb-app-sidenav { transform: translateX(-100%); }
    body.sb-app-collapsed .sb-app-content { margin-left: 0; }
}
@media (max-width: 991.98px) {
    .sb-app-sidenav { transform: translateX(-100%); }
    body.sb-app-open .sb-app-sidenav { transform: translateX(0); }
    body.sb-app-open .sb-app-overlay {
        display: block;
        position: fixed;
        inset: var(--sb-topnav-h) 0 0 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1037;
    }
    .sb-topnav-app .brand-logo { width: auto; padding-right: 0.5rem; font-size: 1.1rem; }
    .navbar-premium.sb-topnav-app { padding-right: 0.75rem; }
    .sb-topnav-app .navbar-right { gap: 4px; }
    .sb-topnav-app .divider-vertical { display: none; }
    .sb-app-breadcrumb { margin: 1rem 0 0; font-size: 0.85rem; }
    .sb-app-content .main-content { padding: 0 12px 12px; }
}

/* App del médico en el celular: conserva su barra superior e inferior propias */
@media (max-width: 900px) {
    body.app-medico .sb-app-sidenav,
    body.app-medico .sb-app-overlay,
    body.app-medico .sb-app-breadcrumb,
    body.app-medico .sb-footer-app { display: none !important; }
    body.app-medico .sb-app-content {
        padding-top: 0;
        margin-left: 0;
        min-height: 0;
        flex: 1;
        overflow: hidden;
    }
}

/* --------------------------------------------------------------------------
   LOGIN — paisaje a pantalla completa y tarjeta de acceso a la derecha
   -------------------------------------------------------------------------- */
html:has(body.sb-login-body) {
    height: 100%;
}
body.sb-login-body {
    margin: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #e6f1f2;
    font-family: var(--sb-font);
    line-height: 1.4;
    color: #1e293b;
}
.sb-login-stage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Colores del logo: turquesa del aro (#1f9c9a) y azul marino del texto (#1c3d5a). */
    background: linear-gradient(160deg, #f3f9f9 0%, #e4f0f1 55%, #d6e7ea 100%);
}
.sb-login-bg {
    position: absolute;
    left: 0;
    top: 0;
    width: calc(100% - 390px);
    height: 100%;
    object-fit: cover;
    object-position: center 22%;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 68%, rgba(0, 0, 0, 0.55) 84%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 68%, rgba(0, 0, 0, 0.55) 84%, transparent 100%);
}
.sb-login-veil {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(243, 249, 249, 0) 0%, rgba(243, 249, 249, 0) 46%, rgba(228, 240, 241, 0.28) 64%, rgba(220, 235, 237, 0.72) 82%, rgba(214, 231, 234, 0.9) 100%),
        linear-gradient(180deg, rgba(28, 61, 90, 0) 70%, rgba(28, 61, 90, 0.12) 100%);
    pointer-events: none;
}
.sb-login-geo {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 220px;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}
.sb-login-geo span {
    position: absolute;
    display: block;
    background: linear-gradient(160deg, #6cc8c3 0%, #1f9c9a 100%);
    opacity: 0.9;
}
.sb-login-geo span:nth-child(1) {
    width: 150px;
    height: 280px;
    right: -48px;
    top: -20px;
    transform: rotate(32deg);
    border-radius: 18px;
}
.sb-login-geo span:nth-child(2) {
    width: 90px;
    height: 210px;
    right: 18px;
    top: 38%;
    transform: rotate(28deg);
    background: linear-gradient(180deg, #2f6d9a 0%, #1c3d5a 100%);
    border-radius: 14px;
    opacity: 0.8;
}
.sb-login-geo span:nth-child(3) {
    width: 120px;
    height: 180px;
    right: -30px;
    bottom: -30px;
    transform: rotate(24deg);
    background: linear-gradient(180deg, #4fb8b3 0%, #17707a 100%);
    border-radius: 16px;
}
.sb-login-points {
    position: absolute;
    z-index: 2;
    left: 8%;
    top: 50%;
    width: min(594px, 44%);
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    color: #0f2f5c;
}
.sb-login-points li {
    position: relative;
    flex: 1 1 0;
    text-align: center;
    padding: 0 15px;
}
.sb-login-points li + li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 1px;
    background: rgba(30, 75, 143, 0.4);
}
.sb-login-points i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin: 0 auto 9px;
    border: 2px solid #1e4b8f;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 47, 92, 0.25);
    font-size: 15.5px;
    color: #1e4b8f;
    text-shadow: none;
}
.sb-login-points strong,
.sb-login-points span {
    display: block;
    font-size: 14.3px;
    font-weight: 700;
    line-height: 1.25;
    text-shadow:
        -1px -1px 0 #ffffff,
        1px -1px 0 #ffffff,
        -1px 1px 0 #ffffff,
        1px 1px 0 #ffffff,
        0 0 8px #ffffff,
        0 0 16px rgba(255, 255, 255, 0.95);
}
.sb-login-points span { font-weight: 600; }
.sb-login-ribbon {
    position: absolute;
    z-index: 2;
    left: 0;
    bottom: 8%;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 460px;
    padding: 14px 48px 14px 22px;
    color: #ffffff;
    background: linear-gradient(90deg, #1d4e9a 0%, #2563eb 100%);
    clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}
.sb-login-ribbon > i {
    font-size: 22px;
}
.sb-login-ribbon strong,
.sb-login-ribbon span {
    display: block;
    line-height: 1.25;
}
.sb-login-ribbon strong { font-size: 14px; font-weight: 700; }
.sb-login-ribbon span { font-size: 12.5px; font-weight: 500; opacity: 0.95; }
.sb-login-card {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: 64px;
    transform: translateY(-50%);
    width: 400px;
    max-height: calc(100% - 40px);
    overflow: auto;
    box-sizing: border-box;
    padding: 28px 28px 22px;
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.06);
}
.sb-login-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}
.sb-login-lock {
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e7f1ff;
    color: #3b82f6;
    font-size: 20px;
}
.sb-login-card-head h1 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.1;
}
.sb-login-card-head p {
    margin: 2px 0 0;
    color: #64748b;
    font-size: 0.92rem;
}
.sb-login-org { font-size: 0.82rem !important; color: #94a3b8 !important; }
.sb-field { display: flex; flex-direction: column; margin-bottom: 14px; position: relative; }
.sb-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}
.sb-field label i { color: #94a3b8; width: 16px; text-align: center; }
.sb-field input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d7e0ea;
    border-radius: 8px;
    outline: none;
    background: #ffffff;
    color: #0f172a;
    padding: 11px 14px;
    font-size: 0.95rem;
    font-family: inherit;
}
.sb-field input::placeholder { color: #94a3b8; }
.sb-field input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
.sb-field-pass input { padding-right: 42px; }
.sb-field input[type="password"]::-ms-reveal,
.sb-field input[type="password"]::-ms-clear { display: none; }
.sb-field .password-toggle {
    position: absolute;
    right: 6px;
    bottom: 4px;
    height: 36px;
    width: 36px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
}
.sb-login-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin: 2px 0 16px;
    font-size: 0.82rem;
}
.sb-login-forgot {
    border: none;
    background: transparent;
    padding: 0;
    color: #3b82f6;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}
.sb-login-forgot:hover { text-decoration: underline; }
.sb-login-forgot-note {
    margin: -8px 0 14px;
    color: #64748b;
    font-size: 0.82rem;
    text-align: right;
}
.sb-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: #1d74f5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.sb-login-btn:hover { background: #1565d8; }
.sb-login-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 14px;
    color: #94a3b8;
    font-size: 0.85rem;
}
.sb-login-or::before,
.sb-login-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}
.sb-login-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 14px;
    border: 1px solid #d7e0ea;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.95rem;
    background: #ffffff;
}
.sb-login-secure i { color: #64748b; }
.sb-login-card-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
    color: #64748b;
}
.sb-login-card-foot > i {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eef4ff;
    color: #3b82f6;
    font-size: 14px;
}
.sb-login-card-foot strong,
.sb-login-card-foot span { display: block; line-height: 1.25; }
.sb-login-card-foot strong { font-size: 0.82rem; font-weight: 600; color: #334155; }
.sb-login-card-foot span { font-size: 0.75rem; color: #94a3b8; }
.sb-login-card .login-alert {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 14px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.sb-login-card .login-alert-error { background: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }
.sb-login-card .login-alert-info { background: #cff4fc; color: #055160; border: 1px solid #b6effb; }

/* Tablet horizontal: la foto queda angosta; se ancla a la izquierda para no
   recortar el logo. */
@media (max-width: 1100px) {
    .sb-login-points { display: none; }
    .sb-login-bg { object-position: left top; }
    .sb-login-card { right: 28px; width: 380px; }
}

/* Tablet vertical y teléfono: la foto pasa a ser una cabecera y la tarjeta
   se monta encima, centrada y con un ancho máximo cómodo. También aplica a
   teléfonos en horizontal, que son anchos pero muy bajos. */
@media (max-width: 860px), (max-width: 960px) and (max-height: 500px) {
    body.sb-login-body {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: auto;
    }
    .sb-login-stage {
        --sb-login-head: clamp(210px, 38vh, 420px);
        min-height: 100vh;
        min-height: 100dvh;
        height: auto;
        padding-bottom: max(24px, env(safe-area-inset-bottom));
        box-sizing: border-box;
    }
    .sb-login-bg {
        width: 100%;
        height: var(--sb-login-head);
        object-position: left top;
        -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
        mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
    }
    .sb-login-veil, .sb-login-geo, .sb-login-ribbon { display: none; }
    .sb-login-card {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        width: calc(100% - 32px);
        max-width: 460px;
        max-height: none;
        margin: calc(var(--sb-login-head) - 48px) auto 0;
    }
    /* 16px evita que iOS haga zoom al tocar los campos. */
    .sb-field input { font-size: 16px; }
}

/* Teléfono: tarjeta más compacta para que todo entre sin apretarse. */
@media (max-width: 480px) {
    .sb-login-stage { --sb-login-head: clamp(190px, 32vh, 260px); }
    .sb-login-card {
        width: calc(100% - 24px);
        padding: 22px 18px 18px;
        border-radius: 18px;
    }
    .sb-login-card-head { gap: 12px; margin-bottom: 18px; }
    .sb-login-lock { flex-basis: 46px; width: 46px; height: 46px; font-size: 18px; }
    .sb-login-card-head h1 { font-size: 1.45rem; }
    .sb-login-org { font-size: 0.78rem !important; }
    .sb-field input { padding: 12px 14px; }
    .sb-login-btn { padding: 13px 16px; }
    .sb-login-or { margin: 14px 0 12px; }
    .sb-login-card-foot { margin-top: 16px; }
}

/* Teléfono en horizontal: poca altura, cabecera baja. */
@media (max-width: 960px) and (max-height: 500px) {
    .sb-login-stage { --sb-login-head: 175px; }
    /* La tarjeta va centrada y taparía el logo: casi sin solaparse. */
    .sb-login-card { margin-top: calc(var(--sb-login-head) - 16px); }
}

/* --------------------------------------------------------------------------
   TARJETAS DE RESUMEN (small-box) — como las tarjetas de color de sisAlmacen:
   color sólido, texto blanco, cuerpo arriba y franja inferior.
   -------------------------------------------------------------------------- */
body.adminlte-body .small-boxes-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem !important;
}
body.adminlte-body .small-box {
    padding: 0;
    border-radius: 0.25rem;
    border: 1px solid rgba(0, 0, 0, 0.125);
    box-shadow: none;
    color: #ffffff;
    transition: none;
}
body.adminlte-body .small-box:hover { box-shadow: none; }
body.adminlte-body .small-box.bg-info    { background: #0d6efd; }
body.adminlte-body .small-box.bg-warning { background: #ffc107; }
body.adminlte-body .small-box.bg-success { background: #198754; }
body.adminlte-body .small-box.bg-danger  { background: #dc3545; }
body.adminlte-body .small-box .inner { display: flex; flex-direction: column; }
body.adminlte-body .small-box h3 {
    padding: 1rem 1rem 0.75rem;
    margin: 0;
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: normal;
    color: #ffffff !important;
}
body.adminlte-body .small-box p {
    padding: 0.75rem 3rem 0.75rem 1rem;
    margin: 0;
    font-size: 0.875em;
    font-weight: 400;
    opacity: 1;
    color: #ffffff !important;
    background-color: rgba(0, 0, 0, 0.03);
    border-top: 1px solid rgba(0, 0, 0, 0.125);
}
body.adminlte-body .small-box .icon,
body.adminlte-body .small-box:hover .icon {
    top: auto;
    bottom: 0.85rem;
    right: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
    transform: none;
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   TARJETAS DE CATÁLOGO / CONTENIDO — card de Bootstrap con cabecera gris
   -------------------------------------------------------------------------- */
body.adminlte-body .catalog-card,
body.adminlte-body .sis-card {
    border-radius: 0.25rem;
    border: 1px solid var(--sb-border);
    box-shadow: none;
    padding: 1rem;
}
body.adminlte-body .catalog-header-container {
    margin: -1rem -1rem 1rem !important;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--sb-border);
}
body.adminlte-body:not(.dark-mode) .catalog-header-container { background-color: rgba(0, 0, 0, 0.03); }
body.adminlte-body .catalog-header-title { font-size: 1rem; font-weight: 400; }
body.adminlte-body .catalog-header-title i { color: inherit !important; }
body.adminlte-body .catalog-header-icon { background: transparent; color: inherit; width: auto; height: auto; }

/* Botones como los de sisAlmacen: Agregar (azul), Editar (celeste), Eliminar (rojo) */
body.adminlte-body .catalog-btn-create {
    height: auto;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 400;
    background: var(--sb-primary);
}
body.adminlte-body .catalog-btn-create:hover { background: #0b5ed7; }
body.adminlte-body .catalog-btn-action {
    width: auto; height: auto;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
}
body.adminlte-body .catalog-btn-edit     { background: #0dcaf0; color: #000000; border: 1px solid #0dcaf0; }
body.adminlte-body .catalog-btn-edit:hover { background: #31d2f2; }
body.adminlte-body .catalog-btn-delete   { background: #dc3545; color: #ffffff; border: 1px solid #dc3545; }
body.adminlte-body .catalog-btn-delete:hover { background: #bb2d3b; }
body.adminlte-body .catalog-btn-ghost { border-radius: 0.25rem; font-weight: 400; }

/* --------------------------------------------------------------------------
   TABLAS — como la DataTable de sisAlmacen: "Mostrar N" a la izquierda,
   buscador a la derecha, filas con línea gris y paginación simple.
   -------------------------------------------------------------------------- */
body.adminlte-body .catalog-toolbar { margin-bottom: 1rem; }
body.adminlte-body .catalog-toolbar-text { font-weight: 400; font-size: 1rem; }
body.adminlte-body .catalog-toolbar-text i { display: none; }
body.adminlte-body .catalog-select,
body.adminlte-body .catalog-filter-select,
body.adminlte-body .catalog-filters .form-control {
    border-radius: 0.25rem;
    font-weight: 400;
    height: 38px;
    border: 1px solid #ced4da;
}
body.adminlte-body .catalog-search-container { width: 240px; }
body.adminlte-body .catalog-search-icon { display: none; }
body.adminlte-body .catalog-search-input {
    padding: 0.375rem 0.75rem;
    height: 38px;
    border-radius: 0.25rem;
    border: 1px solid #ced4da;
    font-size: 1rem;
    font-weight: 400;
}
body.adminlte-body:not(.dark-mode) .catalog-search-input { background: #ffffff; }
body.adminlte-body .catalog-search-input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

body.adminlte-body .catalog-table-container,
body.adminlte-body .table-responsive {
    border: none !important;
    border-radius: 0 !important;
    margin-bottom: 1rem;
}
body.adminlte-body .table-admin,
body.adminlte-body .catalog-table,
body.adminlte-body .audit-table {
    border-collapse: collapse;
    font-size: 1rem;
}
body.adminlte-body .table-admin th,
body.adminlte-body .catalog-table th,
body.adminlte-body .audit-table thead th {
    padding: 8px 10px;
    font-size: 1rem;
    font-weight: 700 !important;
    text-transform: none;
    letter-spacing: normal;
    vertical-align: bottom;
    text-align: left;
    border-bottom: 1px solid #d9d9d9 !important;
}
body.adminlte-body:not(.dark-mode) .table-admin th,
body.adminlte-body:not(.dark-mode) .catalog-table th,
body.adminlte-body:not(.dark-mode) .audit-table thead th,
body.adminlte-body:not(.dark-mode) .catalog-table thead tr {
    background: #ffffff !important;
    color: #212529 !important;
}
body.adminlte-body .table-admin th.text-right,
body.adminlte-body .catalog-table th.text-right { text-align: right; }
body.adminlte-body .table-admin td,
body.adminlte-body .catalog-table td,
body.adminlte-body .audit-table tbody td {
    padding: 8px 10px;
    font-size: 1rem;
    border-bottom: 1px solid #d9d9d9 !important;
}
body.adminlte-body:not(.dark-mode) .table-admin td,
body.adminlte-body:not(.dark-mode) .catalog-table td,
body.adminlte-body:not(.dark-mode) .audit-table tbody td { color: #212529 !important; }
body.adminlte-body:not(.dark-mode) .table-admin td strong { color: #212529 !important; }
body.adminlte-body:not(.dark-mode) .table-admin tbody tr:hover td,
body.adminlte-body:not(.dark-mode) .catalog-table tbody tr:hover td { background-color: rgba(0, 0, 0, 0.03) !important; }
body.adminlte-body .catalog-td-name { font-weight: 400; font-size: 1rem; }
body.adminlte-body .catalog-td-desc,
body.adminlte-body .catalog-td-id { font-size: 1rem; white-space: nowrap; }
body.adminlte-body .catalog-perm-badge { border-radius: 0.25rem; font-weight: 500; }
body.adminlte-body .badge-admin { border-radius: 0.25rem; }
body.dark-mode.adminlte-body .table-admin th,
body.dark-mode.adminlte-body .table-admin td,
body.dark-mode.adminlte-body .catalog-table th,
body.dark-mode.adminlte-body .catalog-table td,
body.dark-mode.adminlte-body .audit-table th,
body.dark-mode.adminlte-body .audit-table td { border-bottom-color: #334155 !important; }

/* Pie de tabla: "Mostrando 1 a 10 de N" + paginación de botones planos */
body.adminlte-body .catalog-footer { font-weight: 400; font-size: 1rem; color: #212529; }
body.dark-mode .catalog-footer { color: #cbd5e1; }
body.adminlte-body .catalog-footer strong { font-weight: 400; color: inherit !important; }
body.adminlte-body .catalog-pagination { gap: 0; }
body.adminlte-body .catalog-pagination button,
body.adminlte-body .catalog-pager .page-link,
body.adminlte-body .catalog-pager a,
body.adminlte-body .catalog-pager span {
    min-width: 34px;
    height: 34px;
    padding: 6px 12px !important;
    border: 1px solid transparent !important;
    border-radius: 4px !important;
    background: transparent !important;
    color: #333333 !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    box-shadow: none !important;
}
body.adminlte-body .catalog-pagination button:hover:not(:disabled),
body.adminlte-body .catalog-pager a:hover { background: #d9d9d9 !important; }
body.adminlte-body .catalog-pagination button.btn-primary,
body.adminlte-body .catalog-pager .page-item.active .page-link,
body.adminlte-body .catalog-pager .active span,
body.adminlte-body .catalog-pager .active a {
    background: #d9d9d9 !important;
    color: #333333 !important;
    cursor: default;
}
body.adminlte-body .catalog-pagination button:disabled { opacity: 0.4; }
body.dark-mode.adminlte-body .catalog-pagination button,
body.dark-mode.adminlte-body .catalog-pager .page-link,
body.dark-mode.adminlte-body .catalog-pager a,
body.dark-mode.adminlte-body .catalog-pager span { color: #e2e8f0 !important; }
body.dark-mode.adminlte-body .catalog-pagination button.btn-primary,
body.dark-mode.adminlte-body .catalog-pager .active span,
body.dark-mode.adminlte-body .catalog-pager .active a { background: #334155 !important; }

/* --------------------------------------------------------------------------
   PORTAL DE ENTREGA — tarjetas con borde fino y esquinas de Bootstrap
   -------------------------------------------------------------------------- */
/* En escritorio aplica a todos; en el celular la app del médico mantiene su estilo propio */
@media (min-width: 901px) {
    .sb-app-content .premium-card,
    .sb-app-content .action-card {
        border-radius: 0.25rem !important;
        border: 1px solid var(--sb-border) !important;
        box-shadow: none !important;
    }
    .sb-app-content .med-page-head h1 { font-size: 1.75rem; font-weight: 500; letter-spacing: normal; }
    .sb-app-content .med-page-head {
        padding-bottom: 0.75rem;
        border-bottom: 1px solid #0dcaf0 !important;
    }
    .sb-app-content .med-lock-card,
    .sb-app-content .bg-white-inner,
    .sb-app-content .med-dropzone {
        border-radius: 0.25rem !important;
        box-shadow: none !important;
    }
    .sb-app-content .premium-btn,
    .sb-app-content .premium-btn-primary {
        border-radius: 0.25rem !important;
        box-shadow: none !important;
        font-weight: 400;
    }
    .sb-app-content .premium-btn-primary { background-color: #0d6efd; }
    .sb-app-content .premium-btn-primary:hover { background-color: #0b5ed7; transform: none; }
    .sb-app-content .month-dropdown-btn,
    .sb-app-content .month-dropdown-menu { border-radius: 0.25rem !important; }
    .sb-app-content .month-dropdown-item { border-radius: 0.25rem !important; }
    .sb-app-content .month-dropdown-item.active { background-color: #0d6efd !important; color: #ffffff !important; }
    .sb-app-content .progress-bar-bg { border-radius: 0.25rem; background-color: #e9ecef; }
    .sb-app-content .progress-bar-fill { border-radius: 0.25rem; background-color: #0d6efd; }
    .sb-app-content .pill { border-radius: 0.25rem; }
    .sb-app-content .form-control,
    .sb-app-content input[type="text"],
    .sb-app-content input[type="email"],
    .sb-app-content input[type="password"],
    .sb-app-content select,
    .sb-app-content textarea {
        border-radius: 0.25rem;
        border-color: #ced4da;
    }
}
@media (max-width: 900px) {
    body:not(.app-medico) .sb-app-content .premium-card,
    body:not(.app-medico) .sb-app-content .action-card {
        border-radius: 0.25rem !important;
        border: 1px solid var(--sb-border) !important;
        box-shadow: none !important;
    }
}

/* --------------------------------------------------------------------------
   MODALES — como los formularios de sisAlmacen: título con línea celeste,
   botón rojo de cerrar (X), etiquetas en negrita, campos Bootstrap y
   botones Guardar (azul) / Cancelar (rojo).
   -------------------------------------------------------------------------- */
body.adminlte-body .modal-backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: none;
}
body.adminlte-body .modal-card {
    border-radius: 0.3rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    animation: none;
}
body.adminlte-body:not(.dark-mode) .modal-card,
body.adminlte-body:not(.dark-mode) .modal-card.catalog-modal-card {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
}
body.adminlte-body .modal-header {
    padding: 1rem 1rem 0.75rem !important;
    border-bottom: 2px solid #0dcaf0 !important;
    align-items: center;
}
body.adminlte-body:not(.dark-mode) .modal-header { background: #ffffff !important; }
body.adminlte-body .modal-header h3,
body.adminlte-body .catalog-modal-title {
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: normal;
    line-height: 1.2;
}
body.adminlte-body:not(.dark-mode) .modal-header h3,
body.adminlte-body:not(.dark-mode) .catalog-modal-title { color: #212529 !important; }
body.adminlte-body .catalog-modal-icon { display: none; }
body.adminlte-body .catalog-modal-subtitle { font-weight: 400; color: #6c757d; }

/* Botón cerrar: rojo como el "X" de sisAlmacen */
body.adminlte-body .modal-header .close-btn,
body.adminlte-body .catalog-modal-close {
    width: 38px; height: 38px;
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #dc3545 !important;
    border-radius: 0.25rem;
    background: #dc3545 !important;
    color: #ffffff !important;
    font-size: 1.4rem;
    line-height: 1;
}
body.adminlte-body .modal-header .close-btn:hover,
body.adminlte-body .catalog-modal-close:hover { background: #bb2d3b !important; border-color: #b02a37 !important; }

body.adminlte-body .modal-body { padding: 1rem !important; }
body.adminlte-body:not(.dark-mode) .catalog-modal-body,
body.adminlte-body:not(.dark-mode) .modal-body { background: #ffffff; }
body.adminlte-body .viewer-modal-body { padding: 0 !important; }

/* Secciones dentro del modal: bloques simples con borde fino */
body.adminlte-body .catalog-modal-grid { gap: 1rem; }
body.adminlte-body .catalog-modal-section,
body.adminlte-body .user-form-card {
    border-radius: 0.25rem !important;
    padding: 1rem !important;
    box-shadow: none !important;
}
body.adminlte-body:not(.dark-mode) .catalog-modal-section,
body.adminlte-body:not(.dark-mode) .user-form-card {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.125) !important;
}
body.adminlte-body .catalog-modal-section-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}
body.adminlte-body:not(.dark-mode) .catalog-modal-section-title { color: #212529; }
body.adminlte-body .catalog-modal-section-title i { color: inherit; }
body.adminlte-body .user-form-card-icon { display: none; }

body.adminlte-body .modal-footer {
    padding: 0.75rem 1rem !important;
    border-top: 1px solid #dee2e6 !important;
    gap: 0.5rem;
}
body.adminlte-body:not(.dark-mode) .modal-footer { background: #ffffff !important; }

/* --------------------------------------------------------------------------
   FORMULARIOS — etiquetas en negrita y campos de Bootstrap 5
   -------------------------------------------------------------------------- */
body.adminlte-body .catalog-label,
body.adminlte-body .modal-body label:not([class*="perm"]):not(.user-checkbox-item),
body.adminlte-body .form-group > label {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
body.adminlte-body:not(.dark-mode) .catalog-label { color: #212529; }
body.adminlte-body .catalog-label-req::after { color: #dc3545; font-weight: 700; }
body.adminlte-body .catalog-form-group,
body.adminlte-body .form-group { margin-bottom: 1rem; }
body.adminlte-body .catalog-form-group-last { margin-bottom: 0; }

body.adminlte-body .form-control,
body.adminlte-body .catalog-input,
body.adminlte-body .catalog-textarea,
body.adminlte-body .modal-body select,
body.adminlte-body .modal-body input[type="text"],
body.adminlte-body .modal-body input[type="email"],
body.adminlte-body .modal-body input[type="password"],
body.adminlte-body .modal-body input[type="number"],
body.adminlte-body .modal-body input[type="date"],
body.adminlte-body .modal-body input[type="month"],
body.adminlte-body .modal-body textarea {
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-shadow: none;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
body.adminlte-body:not(.dark-mode) .form-control,
body.adminlte-body:not(.dark-mode) .catalog-input,
body.adminlte-body:not(.dark-mode) .catalog-textarea {
    border-color: #ced4da !important;
    color: #212529 !important;
}
body.adminlte-body .form-control:focus,
body.adminlte-body .catalog-input:focus,
body.adminlte-body .catalog-textarea:focus,
body.adminlte-body .modal-body select:focus,
body.adminlte-body .modal-body input:focus,
body.adminlte-body .modal-body textarea:focus {
    outline: 0;
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

/* Casillas de permisos / programas: lista simple con check */
body.adminlte-body .catalog-perm-item,
body.adminlte-body .user-checkbox-item {
    border-radius: 0.25rem !important;
    font-weight: 400 !important;
    padding: 0.5rem 0.75rem !important;
}
body.adminlte-body:not(.dark-mode) .catalog-perm-item { background: #ffffff; border: 1px solid #dee2e6; color: #212529; }
body.adminlte-body .catalog-perm-chk { accent-color: #0d6efd; }

/* Botones del formulario: Guardar (btn-primary) y Cancelar (btn-danger) */
body.adminlte-body .catalog-btn-save {
    background: #0d6efd;
    border: 1px solid #0d6efd !important;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    color: #ffffff;
}
body.adminlte-body .catalog-btn-save:hover { background: #0b5ed7; }
body.adminlte-body .catalog-btn-cancel,
body.adminlte-body .modal-footer .btn[style*="background:#e2e8f0"] {
    background: #dc3545 !important;
    border: 1px solid #dc3545 !important;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    color: #ffffff !important;
}
body.adminlte-body .catalog-btn-cancel:hover,
body.adminlte-body .modal-footer .btn[style*="background:#e2e8f0"]:hover { background: #bb2d3b !important; transform: none; box-shadow: none; }
body.adminlte-body .modal-footer .btn-primary { border-radius: 0.25rem; font-weight: 400; }

/* Los select con la misma altura que los campos de texto */
body.adminlte-body select.form-control,
body.adminlte-body .modal-body select {
    height: calc(1.5em + 0.75rem + 2px);
    padding-right: 2rem;
}

/* Encabezado de página de formulario (ej. Mi Perfil, Ciclo): línea celeste bajo el título */
body.adminlte-body .admin-page-head {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #0dcaf0;
    margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   MI PERFIL — formulario al estilo de "Editar usuario" de sisAlmacen
   -------------------------------------------------------------------------- */
.sb-perfil { font-family: var(--sb-font); color: #212529; }
.sb-form-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #0dcaf0;
}
.sb-form-head h2 { margin: 0; font-size: 2rem; font-weight: 500; line-height: 1.2; }
body:not(.dark-mode) .sb-form-head h2 { color: #212529 !important; }

.sb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    cursor: pointer;
    text-decoration: none;
    color: #ffffff !important;
}
.sb-btn-primary { background: #0d6efd; border-color: #0d6efd; }
.sb-btn-primary:hover { background: #0b5ed7; }
.sb-btn-danger { background: #dc3545; border-color: #dc3545; }
.sb-btn-danger:hover { background: #bb2d3b; }

.sb-alert { padding: 1rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: 0.25rem; }
.sb-alert-success { color: #0f5132; background: #d1e7dd; border-color: #badbcc; }
.sb-alert-danger { color: #842029; background: #f8d7da; border-color: #f5c2c7; }

.sb-card {
    background: #ffffff;
    border: 1px solid var(--sb-border);
    border-radius: 0.25rem;
    margin-bottom: 1.5rem;
}
.sb-card-header {
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid var(--sb-border);
}
.sb-card-header i { margin-right: 4px; }
.sb-card-body { padding: 1.25rem; }
.sb-form-hint { margin: 0 0 1rem; color: #6c757d; font-size: 0.95rem; }

/* Etiqueta en negrita a la izquierda y campo a la derecha, dos columnas */
.sb-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
.sb-form-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    align-items: start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.sb-form-label { font-weight: 700; padding-top: 0.4rem; margin: 0; }
.sb-perfil .form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}
body:not(.dark-mode) .sb-perfil .form-control[readonly] { background: #e9ecef !important; }
.sb-perfil .form-control:focus {
    outline: 0;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}
.sb-perfil-img {
    display: block;
    height: 56px;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 4px;
    background: #ffffff;
}
.sb-form-actions { display: flex; gap: 0.5rem; }

body.dark-mode .sb-perfil { color: #e2e8f0; }
body.dark-mode .sb-card { background: #151c2c; border-color: #334155; }
body.dark-mode .sb-card-header { background: #0f172a; border-color: #334155; }
body.dark-mode .sb-perfil .form-control { background: #0f172a; border-color: #334155; color: #f8fafc; }
body.dark-mode .sb-perfil .form-control[readonly] { background: #1e293b !important; }

@media (max-width: 767.98px) {
    .sb-form-grid { grid-template-columns: 1fr; }
    .sb-form-row-empty { display: none; }
    .sb-form-row { grid-template-columns: 1fr; gap: 0.25rem; }
    .sb-form-label { padding-top: 0; }
    .sb-form-head h2 { font-size: 1.5rem; }
}
/* En la app del médico (celular) el título y la X ya los da la barra de la app */
@media (max-width: 900px) {
    body.app-medico .sb-form-head { display: none; }
}

/* Los enlaces con forma de botón no llevan subrayado */
body.adminlte-body a.btn,
body.adminlte-body a.btn:hover { text-decoration: none; }

/* --------------------------------------------------------------------------
   DASHBOARDS DE COORDINACIÓN Y ESTADÍSTICA — tarjetas de color con pie
   "Ver detalles" y botones sólidos (como sisAlmacen)
   -------------------------------------------------------------------------- */
.est-status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
/* Botones de acción sólidos, como los de sisAlmacen (btn-info / btn-success / btn-secondary) */
.est-icon-btn,
.est-view-btn {
    height: 34px; border-radius: 0.25rem; border: 1px solid transparent;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 0 10px; font-size: 0.875rem; font-weight: 400; cursor: pointer;
    white-space: nowrap; text-decoration: none; flex-shrink: 0;
}
.est-view-btn { background: #0dcaf0; border-color: #0dcaf0; color: #000000; }
.est-view-btn:hover:not(:disabled) { background: #31d2f2; }
.est-view-btn-his { background: #198754; border-color: #198754; color: #ffffff; }
.est-view-btn-his:hover:not(:disabled) { background: #157347; }
.est-view-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.est-icon-btn { width: 34px; padding: 0; background: #6c757d; border-color: #6c757d; color: #ffffff; }
.est-icon-btn:hover { background: #5c636a; color: #ffffff; }
.est-row-highlight-danger td { background: #fef2f2 !important; }
.est-row-highlight-amber td { background: #fffbeb !important; }
.est-row-highlight-success td { background: #f0fdf4 !important; }
body.dark-mode .est-row-highlight-danger td { background: #2a1414 !important; }
body.dark-mode .est-row-highlight-amber td { background: #2a2210 !important; }
body.dark-mode .est-row-highlight-success td { background: #0f2a1e !important; }

/* Tarjetas de color con pie "Ver detalles", como el Inicio de sisAlmacen */
.sb-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 1.5rem; }
.sb-stat-card { border-radius: 0.25rem; border: 1px solid rgba(0,0,0,0.125); color: #ffffff; display: flex; flex-direction: column; }
.sb-stat-card .sb-stat-body { padding: 1rem; }
.sb-stat-card .sb-stat-num { font-size: 2rem; font-weight: 500; line-height: 1.1; }
.sb-stat-card .sb-stat-label { font-size: 1rem; margin-top: 2px; }
.sb-stat-card .sb-stat-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; margin-top: auto;
    background: rgba(0,0,0,0.03); border-top: 1px solid rgba(0,0,0,0.125);
    color: #ffffff; font-size: 0.875em; text-decoration: none; cursor: pointer;
    border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left;
}
.sb-stat-card .sb-stat-footer:hover { background: rgba(0,0,0,0.08); }
.sb-stat-primary { background: #0d6efd; }
.sb-stat-warning { background: #ffc107; }
.sb-stat-success { background: #198754; }
.sb-stat-danger  { background: #dc3545; }

.sb-panel { background: #ffffff; border: 1px solid rgba(0,0,0,0.125); border-radius: 0.25rem; }
.sb-panel-header { padding: 0.75rem 1.25rem; background: rgba(0,0,0,0.03); border-bottom: 1px solid rgba(0,0,0,0.125); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sb-panel-header i { margin-right: 4px; }
.sb-panel-body { padding: 1rem 1.25rem; }
body.dark-mode .sb-panel { background: #151c2c; border-color: #1e293b; }
body.dark-mode .sb-panel-header { background: #0f172a; border-color: #1e293b; color: #f8fafc; }

/* Barra de filtros de la tabla */
.sb-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 1rem; flex-wrap: wrap; }
.sb-toolbar .form-control { height: 38px; border-radius: 0.25rem; }
.sb-toolbar-show { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.sb-toolbar-search { margin-left: auto; width: 260px; max-width: 100%; }
.sb-dash-table .badge-admin { white-space: nowrap; }
.sb-closed { text-align: center; padding: 2rem 1rem; }
.sb-closed-icon { font-size: 2.5rem; color: #198754; margin-bottom: 0.75rem; }

@media (max-width: 1199.98px) {
    .sb-stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767.98px) {
    .sb-stat-grid { grid-template-columns: 1fr; }
    .sb-toolbar-search { margin-left: 0; width: 100%; }
}
.est-btn-warning { background: #ffc107; border-color: #ffc107; color: #000000; }
.est-btn-warning:hover:not(:disabled) { background: #ffca2c; }
.est-btn-danger { background: #dc3545; border-color: #dc3545; color: #ffffff; }
.est-btn-danger:hover:not(:disabled) { background: #bb2d3b; }
/* Rechazos del expediente: etiqueta bajo el estado y detalle en ventana (partials/rechazos-*) */
.rechazos-chip {
    display: flex; width: fit-content; align-items: center; gap: 4px; margin-top: 4px;
    padding: 1px 8px; border: 1px solid #f5c2c7; border-radius: 999px;
    background: #fff5f5; color: #b02a37; font-size: 0.72rem; font-weight: 600;
    cursor: pointer; white-space: nowrap;
}
.rechazos-chip:hover { background: #f8d7da; }
.rechazos-ayuda { margin: 0 0 12px; color: #6c757d; font-size: 0.85rem; }
.rechazos-lista { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.rechazo-item { border: 1px solid #dee2e6; border-left: 4px solid #dc3545; border-radius: 0.375rem; padding: 10px 12px; }
.rechazo-cabecera { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-size: 0.9rem; }
.rechazo-area { padding: 0 8px; border-radius: 999px; background: #e7f1ff; color: #0a58ca; font-size: 0.72rem; font-weight: 600; }
.rechazo-fecha { margin-left: auto; color: #6c757d; font-size: 0.8rem; }
.rechazo-motivo { margin: 6px 0 8px; white-space: pre-line; color: #212529; }
.rechazo-pie { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.8rem; }
.rechazo-adjunto { color: #0d6efd; text-decoration: none; }
.rechazo-estado.ok { color: #198754; font-weight: 600; }
.rechazo-estado.pendiente { color: #b45309; font-weight: 600; }
body.dark-mode .rechazos-chip { background: #3b0d12; border-color: #842029; color: #f1aeb5; }
body.dark-mode .rechazo-item { border-color: #334155; border-left-color: #dc3545; }
body.dark-mode .rechazo-motivo { color: #e2e8f0; }
body.dark-mode .rechazo-area { background: #172554; color: #93c5fd; }

/* Acciones de la tabla de expedientes: consulta (solo íconos) | decisiones (ícono + palabra) */
.acciones-exp { display: inline-flex; align-items: center; gap: 6px; }
.acciones-consulta,
.acciones-decision { display: inline-flex; align-items: center; gap: 5px; }
.acciones-decision { padding-left: 6px; border-left: 1px solid #dee2e6; min-height: 34px; }
.acciones-decision .est-view-btn:not(.acc-icono) { padding: 0 8px; }
.acc-icono { width: 34px; padding: 0; }
.td-fecha { white-space: nowrap; line-height: 1.3; }
.td-fecha .td-hora { color: #6c757d; font-size: 0.85em; }
.acc-espera {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 0.25rem;
    background: #f1f3f5; color: #6c757d; cursor: help;
}
.acc-espera-ok { background: #d1e7dd; color: #198754; }
body.dark-mode .acciones-decision { border-left-color: #334155; }
body.dark-mode .acc-espera { background: #1e293b; color: #94a3b8; }
body.dark-mode .acc-espera-ok { background: #064e3b; color: #6ee7b7; }

/* Firmar / Visto bueno: mismo botón que Rechazar, en azul */
.est-btn-primary { background: #0d6efd; border-color: #0d6efd; color: #ffffff; }
.est-btn-primary:hover:not(:disabled) { background: #0b5ed7; }

/* --------------------------------------------------------------------------
   EXPEDIENTES — como "Lista Materiales" de sisAlmacen
   -------------------------------------------------------------------------- */
body.adminlte-body .exp-table .exp-code {
    font-weight: 400;
    font-size: 0.9rem;
    border-radius: 0.25rem;
    background: transparent;
    border: none;
    padding: 0;
    white-space: nowrap;
}
body.adminlte-body .exp-est { font-weight: 700; font-size: 1rem; }
body.adminlte-body .exp-est-sub { font-size: 0.85rem; color: #6c757d; font-weight: 400; }
body.adminlte-body .exp-file { font-weight: 400; font-size: 0.95rem; }
body.adminlte-body .exp-file i { color: #dc3545; }
body.adminlte-body .exp-date { font-weight: 400; font-size: 0.95rem; white-space: nowrap; }
body.adminlte-body .exp-table tr.exp-his td { background: #ffffff; }
body.dark-mode.adminlte-body .exp-table tr.exp-his td { background: #151c2c; }

/* Tipo de documento y estado: etiquetas de Bootstrap (badge) */
.exp-tipo {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 0.35em 0.65em;
    font-size: 0.8rem; font-weight: 700; line-height: 1;
    border-radius: 0.25rem;
    white-space: nowrap;
    background: #6c757d; color: #ffffff;
}
.exp-tipo-informe { background: #0d6efd; }
.exp-tipo-his { background: #ffc107; color: #000000; }
body.adminlte-body .exp-estado {
    padding: 0.35em 0.65em;
    font-size: 0.8rem; font-weight: 700; letter-spacing: normal;
    border-radius: 0.25rem;
    background: #6c757d; color: #ffffff;
    white-space: nowrap;
}
body.adminlte-body .exp-estado.es-cerrado { background: #198754; color: #ffffff; }
body.adminlte-body .exp-estado.es-revision { background: #0dcaf0; color: #000000; }
body.adminlte-body .exp-estado.es-observado { background: #dc3545; color: #ffffff; }

body.adminlte-body .exp-actions .est-view-btn,
body.adminlte-body .exp-actions .est-icon-btn { height: 34px; }

.sb-alert-info {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    color: #055160;
    background: #cff4fc;
    border: 1px solid #b6effb;
    border-radius: 0.25rem;
}
body.dark-mode .sb-alert-info { color: #7dd3fc; background: #0c4a6e; border-color: #0284c7; }

/* La paginación también puede tener enlaces <a> (Expedientes pagina en el servidor) */
body.adminlte-body .catalog-pagination a {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px;
    padding: 6px 12px !important;
    border: 1px solid transparent !important;
    border-radius: 4px !important;
    background: transparent !important;
    color: #333333 !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    box-shadow: none !important;
}
body.adminlte-body .catalog-pagination a:hover { background: #d9d9d9 !important; }
body.dark-mode.adminlte-body .catalog-pagination a { color: #e2e8f0 !important; }
body.adminlte-body .catalog-select { width: 90px; padding-right: 1.75rem; }
body.adminlte-body .catalog-filters .catalog-filter-select { max-width: 280px; flex: 1 1 200px; }

/* Los modales de catálogo ya separan sus campos con margen; sin el gap extra del cuerpo */
body.adminlte-body .catalog-modal-body { gap: 0; }

/* --------------------------------------------------------------------------
   AUDITORÍA — lista como la de sisAlmacen, etiquetas sólidas de Bootstrap
   -------------------------------------------------------------------------- */
body.adminlte-body .audit-wrap { padding-bottom: 0; }
body.adminlte-body .audit-table { font-size: 0.95rem; }
body.adminlte-body .audit-code {
    background: transparent; border: none; padding: 0;
    font-weight: 400; font-size: 0.9rem;
}
body.adminlte-body .audit-user { font-weight: 700; font-size: 0.95rem; }
body.adminlte-body .audit-role {
    border-radius: 0.25rem; font-weight: 400; font-size: 0.8rem;
    background: #e9ecef; color: #495057;
}
body.adminlte-body .audit-badge {
    border-radius: 0.25rem;
    padding: 0.35em 0.65em;
    font-size: 0.8rem;
    line-height: 1.1;
}
body.adminlte-body .audit-badge-ok     { background: #198754; color: #ffffff; }
body.adminlte-body .audit-badge-info   { background: #0d6efd; color: #ffffff; }
body.adminlte-body .audit-badge-warn   { background: #ffc107; color: #000000; }
body.adminlte-body .audit-badge-danger { background: #dc3545; color: #ffffff; }
body.adminlte-body .audit-badge-violet { background: #6f42c1; color: #ffffff; }
body.adminlte-body .audit-badge-muted  { background: #6c757d; color: #ffffff; }
body.adminlte-body .audit-state { font-weight: 400; font-size: 0.8rem; }
body.adminlte-body .audit-state span {
    border-radius: 0.25rem; border-color: #ced4da; background: #ffffff; color: #212529;
}
body.adminlte-body .audit-state i { color: #6c757d; font-size: 0.65rem; }
body.adminlte-body .audit-est { font-weight: 700; font-size: 0.95rem; }
body.adminlte-body .audit-est-sub { font-size: 0.85rem; color: #6c757d; }
body.adminlte-body .audit-detail { font-size: 0.9rem; color: #212529; }
body.adminlte-body .audit-date { font-weight: 400; font-size: 0.9rem; color: #212529; }
body.dark-mode.adminlte-body .audit-detail,
body.dark-mode.adminlte-body .audit-date { color: #cbd5e1; }
body.dark-mode.adminlte-body .audit-state span { background: #0f172a; border-color: #334155; color: #cbd5e1; }
body.dark-mode.adminlte-body .audit-role { background: #1e293b; color: #cbd5e1; }

/* Paginación de Laravel (bootstrap-4) dentro de .catalog-pager */
body.adminlte-body .catalog-pager .pagination { gap: 0; }
body.adminlte-body .catalog-pager .page-item.disabled .page-link { opacity: 0.4; }

/* Usuarios: estado como badge sólido de Bootstrap */
.usr-estado {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.8rem; font-weight: 700; line-height: 1;
    color: #ffffff; background: #198754;
    border-radius: 0.25rem; white-space: nowrap;
}
/* Usuarios: que la tabla quepa sin scroll en pantallas de escritorio */
#tablaUsuariosGeneral th,
#tablaUsuariosGeneral td { padding: 8px 6px; font-size: 0.9rem; }
#tablaUsuariosGeneral .usr-correo { overflow-wrap: anywhere; min-width: 130px; }
#tablaUsuariosGeneral .catalog-btn-action { padding: 0.3rem 0.55rem; }
/* Los encabezados de las listas pueden partirse en dos líneas (como en sisAlmacen) */
body.adminlte-body .catalog-table th { white-space: normal; }

/* Roles: permisos como etiquetas grises de Bootstrap y grupos del modal */
.rol-permiso {
    display: inline-block;
    padding: 0.3em 0.6em;
    font-size: 0.78rem; font-weight: 400; line-height: 1.2;
    color: #212529; background: #e9ecef;
    border: 1px solid #dee2e6; border-radius: 0.25rem;
    white-space: nowrap;
}
body.dark-mode .rol-permiso { color: #e2e8f0; background: #1e293b; border-color: #334155; }
.rol-perm-grupo {
    margin: 0.75rem 0 0.35rem;
    font-size: 0.85rem; font-weight: 700; color: #6c757d;
}
.rol-perm-grupo:first-child { margin-top: 0; }
#tablaRolesGeneral { table-layout: fixed; }
#tablaRolesGeneral .catalog-td-desc { overflow-wrap: break-word; }
#tablaRolesGeneral td { white-space: normal !important; }

/* Profesiones: cantidad de usuarios como badge sólido (bg-primary) */
.prof-usuarios {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.8rem; font-weight: 700; line-height: 1;
    color: #ffffff; background: #0d6efd;
    border-radius: 0.25rem; white-space: nowrap;
}
/* Celdas con .text-right (columna Acciones) alineadas a la derecha, como su encabezado */
body.adminlte-body .table-admin td.text-right,
body.adminlte-body .catalog-table td.text-right { text-align: right; }

/* Establecimientos: categoría como badge sólido (bg-success) */
.est-categoria {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.8rem; font-weight: 700; line-height: 1;
    color: #ffffff; background: #198754;
    border-radius: 0.25rem; white-space: nowrap;
}
#tablaEstratGeneral { table-layout: fixed; }
#tablaEstratGeneral td { white-space: normal !important; overflow-wrap: break-word; }
#tablaEstratGeneral .est-categoria { white-space: normal; line-height: 1.3; }
#tablaEstratGeneral .catalog-td-id { white-space: nowrap !important; }

/* Paginador compacto: "…" entre la primera/última página y la ventana de 3 */
.sb-pag-ellipsis {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; height: 34px; padding: 0 4px;
    color: #6c757d; user-select: none;
}
body.dark-mode .sb-pag-ellipsis { color: #94a3b8; }
.catalog-pagination { align-items: center; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   PAGINACIÓN ESTILO ADMINLTE (Bootstrap .pagination): botones unidos en un
   bloque con borde, texto azul, página actual azul con letra blanca y
   "Anterior" / "Siguiente" en los extremos. Reemplaza el estilo plano anterior.
   -------------------------------------------------------------------------- */
body.adminlte-body .catalog-pagination {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0 !important;
    border-radius: 0.25rem;
}
body.adminlte-body .catalog-pagination > button,
body.adminlte-body .catalog-pagination > a {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 0 0 -1px !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    line-height: 1.25 !important;
    color: #007bff !important;
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    transform: none !important;
    cursor: pointer;
}
body.adminlte-body .catalog-pagination > :first-child {
    margin-left: 0 !important;
    border-top-left-radius: 0.25rem !important;
    border-bottom-left-radius: 0.25rem !important;
}
body.adminlte-body .catalog-pagination > :last-child {
    border-top-right-radius: 0.25rem !important;
    border-bottom-right-radius: 0.25rem !important;
}
body.adminlte-body .catalog-pagination > button:hover:not(:disabled):not(.btn-primary),
body.adminlte-body .catalog-pagination > a:hover {
    z-index: 2;
    color: #0056b3 !important;
    background: #e9ecef !important;
    border-color: #dee2e6 !important;
}
body.adminlte-body .catalog-pagination > button.btn-primary,
body.adminlte-body .catalog-pagination > a.btn-primary {
    z-index: 3;
    color: #ffffff !important;
    background: #007bff !important;
    border-color: #007bff !important;
    cursor: default;
}
body.adminlte-body .catalog-pagination > button:disabled:not(.btn-primary) {
    opacity: 1 !important;
    color: #6c757d !important;
    background: #ffffff !important;
    border-color: #dee2e6 !important;
    cursor: default;
}
body.dark-mode.adminlte-body .catalog-pagination > button,
body.dark-mode.adminlte-body .catalog-pagination > a {
    color: #7dd3fc !important;
    background: #151c2c !important;
    border-color: #334155 !important;
}
body.dark-mode.adminlte-body .catalog-pagination > button.btn-primary {
    color: #ffffff !important;
    background: #007bff !important;
    border-color: #007bff !important;
}
body.dark-mode.adminlte-body .catalog-pagination > button:disabled:not(.btn-primary) { color: #64748b !important; }

/* Portal del Profesional de Salud: sin menú lateral, el contenido ocupa todo el ancho */
@media (min-width: 992px) {
    body.sb-app-sin-menu .sb-app-content { margin-left: 0; }
}

/* Usuarios: establecimientos adicionales bajo el principal */
.usr-est-adicional { font-size: 0.8rem; color: #0d6efd; }

/* Programas: documentos que se entregan */
.entrega-badge {
    display: inline-block; padding: 0.35em 0.65em;
    font-size: 0.8rem; font-weight: 700; line-height: 1;
    border-radius: 0.25rem; white-space: nowrap;
}
.entrega-ambos { color: #ffffff; background: #0d6efd; }
.entrega-solo { color: #000000; background: #ffc107; }
.entrega-solo-his { color: #ffffff; background: #198754; }
/* Botones "Informe y Hojas HIS" / "Solo informe" del formulario de Programas */
.entrega-opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.entrega-opcion {
    position: relative; display: flex; align-items: center; gap: 10px; margin: 0;
    padding: 0.65rem 0.75rem; border: 1px solid #ced4da; border-radius: 0.375rem;
    background: #ffffff; color: #212529; cursor: pointer; font-weight: 400;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.entrega-opcion input { position: absolute; opacity: 0; pointer-events: none; }
.entrega-opcion > i { font-size: 1.1rem; color: #6c757d; width: 20px; text-align: center; }
.entrega-opcion strong { display: block; font-size: 0.9rem; }
.entrega-opcion small { display: block; color: #6c757d; font-size: 0.78rem; }
.entrega-opcion:hover { border-color: #86b7fe; }
.entrega-opcion:has(input:focus-visible) { box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25); }
.entrega-opcion:has(input:checked) { border-color: #0d6efd; background: #e7f1ff; }
.entrega-opcion:has(input:checked) > i { color: #0d6efd; }
body.dark-mode .entrega-opcion { background: #18191c; border-color: #334155; color: #e2e8f0; }
body.dark-mode .entrega-opcion small { color: #94a3b8; }
body.dark-mode .entrega-opcion:has(input:checked) { border-color: #60a5fa; background: #172554; }
body.dark-mode .entrega-opcion:has(input:checked) > i { color: #60a5fa; }
@media (max-width: 575.98px) {
    .entrega-opciones { grid-template-columns: 1fr; }
}

/* Programas: quiénes firman el expediente (Coordinación 1 o 2, Estadística sí/no) */
.firmas-programa { grid-column: 1 / -1; }
.firmas-programa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem; }
.firmas-programa-resumen { margin: 0.75rem 0 0; font-weight: 600; color: #0d6efd; }
body.dark-mode .firmas-programa-resumen { color: #60a5fa; }
.firmas-badges { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.firma-badge-coord { color: #ffffff; background: #6f42c1; }
.firma-badge-est { color: #ffffff; background: #198754; }
.firma-badge-sin { color: #495057; background: #e9ecef; }
@media (max-width: 767.98px) {
    .firmas-programa-grid { grid-template-columns: 1fr; }
}
