/* ==========================================================================
   Sistema de Gestión de Laboratorios FSH — hoja de estilos institucional
   Complementa a Bootstrap 5.3. Paleta seria y limpia, optimizada para móvil.
   ========================================================================== */

:root {
    --fsh-primary: #0d5b4c;      /* verde institucional salud */
    --fsh-primary-dark: #094035;
    --fsh-accent: #1f7a68;
    --fsh-sidebar-bg: #0f2f2a;
    --fsh-sidebar-link: #cfe3de;
    --fsh-navbar-bg: #0d5b4c;
    --fsh-content-bg: #f4f6f7;
    --fsh-sidebar-width: 260px;
}

/* Sobrescribe el primario de Bootstrap para botones/badges .btn-primary. */
.btn-primary {
    --bs-btn-bg: var(--fsh-primary);
    --bs-btn-border-color: var(--fsh-primary);
    --bs-btn-hover-bg: var(--fsh-primary-dark);
    --bs-btn-hover-border-color: var(--fsh-primary-dark);
    --bs-btn-active-bg: var(--fsh-primary-dark);
    --bs-btn-active-border-color: var(--fsh-primary-dark);
}
.text-bg-primary { background-color: var(--fsh-primary) !important; }
.badge.text-bg-secondary { background-color: var(--fsh-accent) !important; }

body { min-height: 100vh; }
.card { border-radius: .9rem; }

/* -------------------------------------------------------------------------
   Estructura general (shell)
   ------------------------------------------------------------------------- */
.app-body {
    background-color: var(--fsh-content-bg);
    min-height: 100vh;
}
.app-navbar {
    background-color: var(--fsh-navbar-bg);
    min-height: 56px;
}
.app-navbar .navbar-brand { letter-spacing: .01em; }

.app-shell {
    display: flex;
    align-items: stretch;
    min-height: calc(100vh - 56px);
}
.app-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.app-footer {
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, .06);
}

/* -------------------------------------------------------------------------
   Barra lateral
   ------------------------------------------------------------------------- */
.app-sidebar {
    background-color: var(--fsh-sidebar-bg);
    color: var(--fsh-sidebar-link);
    width: var(--fsh-sidebar-width);
}
@media (min-width: 992px) {
    .app-sidebar {
        flex: 0 0 var(--fsh-sidebar-width);
        display: flex;
    }
    /* offcanvas-lg deja de comportarse como offcanvas en >= lg */
    .app-sidebar .offcanvas-body { display: flex; }
}
.app-sidebar-nav { padding: .5rem 0; width: 100%; }
.sidebar-section-title {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .45);
    padding: 1rem 1.25rem .35rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1.25rem;
    color: var(--fsh-sidebar-link);
    text-decoration: none;
    font-size: .95rem;
    border-left: 3px solid transparent;
    transition: background-color .15s ease;
}
.sidebar-link i { font-size: 1.1rem; }
.sidebar-link:hover { background-color: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-link.active {
    background-color: rgba(255, 255, 255, .1);
    border-left-color: var(--fsh-accent);
    color: #fff;
    font-weight: 600;
}
.sidebar-link.disabled { opacity: .55; cursor: default; }
.sidebar-link.disabled:hover { background-color: transparent; color: var(--fsh-sidebar-link); }

/* -------------------------------------------------------------------------
   Tarjetas de módulos (dashboard)
   ------------------------------------------------------------------------- */
.module-card { transition: transform .15s ease, box-shadow .15s ease; }
.module-card:not(.module-card--soon):hover {
    transform: translateY(-3px);
    box-shadow: 0 .5rem 1.5rem rgba(13, 91, 76, .18) !important;
}
.module-icon {
    width: 48px; height: 48px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: .75rem;
    background-color: rgba(13, 91, 76, .1);
    color: var(--fsh-primary);
    font-size: 1.4rem;
}
.module-card--soon { opacity: .9; }

/* -------------------------------------------------------------------------
   Autenticación (login)
   ------------------------------------------------------------------------- */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--fsh-primary) 0%, var(--fsh-primary-dark) 100%);
    padding: 1.5rem;
}
.auth-wrapper { width: 100%; max-width: 420px; }
.auth-card {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem 1.75rem;
}
.auth-logo {
    width: 60px; height: 60px; margin: 0 auto;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background-color: rgba(13, 91, 76, .1);
    color: var(--fsh-primary);
    font-size: 1.8rem;
}

/* -------------------------------------------------------------------------
   Páginas de error
   ------------------------------------------------------------------------- */
.error-body {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background-color: var(--fsh-content-bg);
    padding: 1.5rem;
}
.error-wrapper { max-width: 480px; }
.error-code { font-size: 5rem; font-weight: 800; line-height: 1; }

/* -------------------------------------------------------------------------
   Indicador de carga AJAX
   ------------------------------------------------------------------------- */
.ajax-loader {
    position: fixed; inset: 0;
    background: rgba(255, 255, 255, .65);
    display: none;
    align-items: center; justify-content: center;
    z-index: 1080;
}
.ajax-loader.is-active { display: flex; }
.ajax-loader-box {
    background: #fff;
    border-radius: .75rem;
    padding: 1.25rem 1.75rem;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .15);
    display: flex; align-items: center; gap: .85rem;
}
.ajax-loader-text { font-weight: 500; color: #444; }

.messages-area { margin-bottom: .5rem; }
