/* ==========================================================================
   tabla_pocket.css - BIONUTRICIONAL PRO
   Diseño Clínico Ultra-Premium · Mobile-First · Cero Inline Styles
   Estética Médica Ejecutiva · SaaS Moderno · Tipografía Inter
   ========================================================================== */

/* -------------------------------------------------------------
   1. VARIABLES DE SISTEMA & PALETA CLÍNICA HARMONIOSA
   ------------------------------------------------------------- */
:root {
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-soft: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border-subtle: #e2e8f0;
    --border-strong: #cbd5e1;
    
    /* Acentos Médicos */
    --brand-primary: #047857;
    --brand-primary-hover: #065f46;
    --brand-light: #ecfdf5;
    --brand-border: #a7f3d0;
    
    --sidebar-width: 280px;
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    --shadow-subtle: 0 1px 3px 0 rgba(15, 23, 42, 0.05);
    --shadow-card: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-elevated: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
    --shadow-sidebar: 4px 0 24px rgba(15, 23, 42, 0.08);
}

/* -------------------------------------------------------------
   2. RESET Y FUNDAMENTOS
   ------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

body.pocket-body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    transition: padding-left 0.25s ease;
}

/* Modo Acoplado de Sidebar en Desktop */
@media (min-width: 1024px) {
    body.pocket-body.body-sidebar-docked {
        padding-left: var(--sidebar-width);
    }
}

/* -------------------------------------------------------------
   3. BARRA SUPERIOR (TOPBAR)
   ------------------------------------------------------------- */
.pocket-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.25rem;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.8125rem;
    position: sticky;
    top: 0;
    z-index: 50;
    height: 48px;
}

.pocket-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Selector Rápido de Baremo en Barra Superior */
.baremo-selector-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.baremo-selector-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background-color: #f1f5f9;
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.baremo-selector-btn:hover {
    background-color: #e2e8f0;
    border-color: var(--border-strong);
    color: var(--brand-primary);
}

.selector-chevron {
    font-size: 0.6875rem;
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

.baremo-selector-btn[aria-expanded="true"] .selector-chevron {
    transform: rotate(180deg);
}

.baremo-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    width: 280px;
    background-color: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
    padding: 0.5rem;
    z-index: 100;
    display: none;
}

.baremo-dropdown-menu.is-open {
    display: block;
    animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-group-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    padding: 0.375rem 0.5rem 0.25rem 0.5rem;
}

.dropdown-item {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: background-color 0.15s ease;
}

.dropdown-item:hover {
    background-color: var(--bg-surface-soft);
}

.dropdown-item.is-active {
    background-color: var(--brand-light);
    color: var(--brand-primary);
}

.dropdown-item-title {
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.25;
}

.dropdown-item-sub {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.dropdown-item.is-active .dropdown-item-sub {
    color: var(--brand-primary);
    opacity: 0.85;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-subtle);
    margin: 0.375rem 0;
}

.dropdown-item-all {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--brand-primary);
    text-align: center;
    padding: 0.4rem 0.625rem;
}

.pocket-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    color: var(--brand-primary);
    text-decoration: none;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
}

.pocket-brand-dot {
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--brand-primary);
    border-radius: var(--radius-full);
}

.pocket-topbar-links {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.pocket-back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-md);
    transition: background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.pocket-back-link:hover {
    background-color: var(--bg-surface-soft);
    color: var(--brand-primary);
}

@media (max-width: 640px) {
    .pocket-topbar {
        padding: 0.35rem 0.75rem;
    }
    .pocket-topbar-left {
        gap: 0.4rem;
        min-width: 0;
    }
    .pocket-brand-link {
        font-size: 0.75rem;
        white-space: nowrap;
    }
    .baremo-selector-btn {
        padding: 0.2rem 0.45rem;
        font-size: 0.75rem;
        max-width: 150px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .pocket-topbar-links {
        gap: 0.25rem;
    }
    .pocket-back-link {
        font-size: 0.6875rem;
        padding: 0.2rem 0.35rem;
        white-space: nowrap;
    }
}

.pocket-breadcrumb {
    color: var(--text-muted);
    font-size: 0.75rem;
    display: none;
}

@media (min-width: 640px) {
    .pocket-breadcrumb {
        display: inline-block;
    }
}

/* -------------------------------------------------------------
   4. SIDEBAR CON ACORDEÓN DE TABLAS (DESPLEGABLE / ACOPLABLE)
   ------------------------------------------------------------- */
.portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background-color: #ffffff;
    border-right: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sidebar);
    z-index: 60;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-sidebar.is-open {
    transform: translateX(0);
}

/* Modo Acoplado Permanente en Desktop */
@media (min-width: 1024px) {
    body.pocket-body.body-sidebar-docked .portal-sidebar {
        top: 48px;
        transform: translateX(0);
        box-shadow: none;
    }
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    background-color: #ffffff;
}

.sidebar-title-row {
    display: flex;
    flex-direction: column;
}

.sidebar-badge {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-primary);
}

.sidebar-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--text-primary);
}

.sidebar-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.sidebar-action-btn {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle);
    background-color: #ffffff;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sidebar-action-btn:hover {
    background-color: var(--bg-surface-soft);
    color: var(--text-primary);
}

.sidebar-search-box {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    background-color: #fafbfc;
}

.sidebar-search-field {
    width: 100%;
    height: 2.25rem;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
    background-color: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.15s ease;
}

.sidebar-search-field:focus {
    border-color: var(--brand-primary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

/* Grupos en Acordeón */
.sidebar-group {
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-group-header:hover {
    background-color: var(--bg-surface-soft);
    color: var(--text-primary);
}

.group-chevron {
    font-size: 0.6875rem;
    transition: transform 0.2s ease;
}

.sidebar-group.is-open .group-chevron {
    transform: rotate(180deg);
}

.sidebar-group-list {
    list-style: none;
    margin: 0;
    padding: 0 0.5rem 0.375rem 0.5rem;
    display: none;
}

.sidebar-group.is-open .sidebar-group-list {
    display: block;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4375rem 0.625rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s ease;
}

.sidebar-nav-item:hover {
    background-color: var(--bg-surface-soft);
    color: var(--brand-primary);
}

.sidebar-nav-item.is-active {
    background-color: var(--brand-light);
    color: var(--brand-primary);
    font-weight: 700;
}

.nav-indicator {
    color: var(--brand-primary);
    font-size: 0.625rem;
}

.nav-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-badge-live {
    font-size: 0.625rem;
    font-weight: 700;
    color: #15803d;
    background-color: #dcfce7;
    padding: 0.1rem 0.375rem;
    border-radius: var(--radius-sm);
}

.nav-badge-soon {
    font-size: 0.625rem;
    color: var(--text-light);
}

.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-subtle);
    background-color: #ffffff;
}

.sidebar-footer-link {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.sidebar-footer-link:hover {
    text-decoration: underline;
}

/* Telón de Fondo Oscuro (Backdrop) para Móvil */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 55;
    display: none;
}

.sidebar-backdrop.is-active {
    display: block;
}

/* Utilidad Universal de Visibilidad (Cero Inline Styles) */
.is-hidden {
    display: none !important;
}

@media (min-width: 1024px) {
    body.pocket-body.body-sidebar-docked .sidebar-backdrop {
        display: none !important;
    }
}

/* -------------------------------------------------------------
   5. CONTENEDOR PRINCIPAL
   ------------------------------------------------------------- */
.pocket-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3.5rem 1rem;
}

@media (min-width: 640px) {
    .pocket-container {
        padding: 1.75rem 1.25rem 4rem 1.25rem;
    }
}

/* -------------------------------------------------------------
   6. CABECERA LIMPIA DE LA HERRAMIENTA
   ------------------------------------------------------------- */
.tool-header-card {
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0.25rem 0.25rem 0.75rem 0.25rem;
    box-shadow: none;
    margin-bottom: 0.5rem;
}

.tool-badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.tool-official-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background-color: #fdf2f8;
    color: #9d174d;
    border: 1px solid #fbcfe8;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

.tool-tag-pill {
    background-color: var(--bg-surface-soft);
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.15rem 0.375rem;
    border-radius: var(--radius-sm);
}

.tool-title {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.015em;
    line-height: 1.25;
}

@media (min-width: 640px) {
    .tool-title {
        font-size: 1.5rem;
    }
}

/* -------------------------------------------------------------
   7. BARRA COMPACTA DE CONSULTA (PROPORCIONADA, NO ESTIRADA)
   ------------------------------------------------------------- */
.tool-query-bar {
    background-color: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-subtle);
    margin-bottom: 1rem;
}

.query-fields-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1.25rem;
}

.query-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: auto;
}

.query-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.query-optional {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.query-input-wrap {
    position: relative;
    width: 135px;
    box-sizing: border-box;
}

.query-input {
    width: 100%;
    height: 2.75rem;
    padding: 0 2.25rem 0 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    background-color: #f8fafc;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
    -moz-appearance: textfield;
}

.query-input::-webkit-outer-spin-button,
.query-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


.query-input:focus {
    background-color: #ffffff;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.15);
}

.query-unit {
    position: absolute;
    right: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    pointer-events: none;
}

/* Select de Unidad Compacto dentro del Input Wrap */
.query-input-wrap:has(.query-unit-select) {
    width: 165px;
}

.query-input-wrap:has(.query-unit-select) .query-input {
    padding-right: 4.5rem;
}

.query-unit-select {
    position: absolute;
    right: 0.375rem;
    top: 50%;
    transform: translateY(-50%);
    height: 1.875rem;
    border: 1px solid var(--border-subtle);
    background-color: #f1f5f9;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 0 0.25rem;
    cursor: pointer;
    outline: none;
    transition: all 0.15s ease;
}

.query-unit-select:hover {
    background-color: #e2e8f0;
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* Checkbox Compacto Integrado en Fila de Consulta */
.query-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.75rem;
    padding: 0 0.875rem;
    background-color: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    user-select: none;
}

.query-checkbox-label:hover {
    border-color: var(--border-strong);
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.query-checkbox {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--brand-primary);
    cursor: pointer;
    margin: 0;
}

.query-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-left: auto;
    padding-top: 0.5rem;
}

@media (max-width: 639px) {
    .query-presets {
        width: 100%;
        margin-left: 0;
        padding-top: 0.5rem;
        border-top: 1px dashed var(--border-subtle);
    }
}

.presets-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.preset-chip {
    background-color: var(--bg-surface-soft);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.preset-chip:hover {
    background-color: var(--brand-light);
    border-color: var(--brand-border);
    color: var(--brand-primary);
}

/* Grupo Segmentado de Sexo (Niña / Niño) */
.query-segment-group {
    display: inline-flex;
    align-items: center;
    background-color: #f1f5f9;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 2px;
    height: 2.75rem;
}

.segment-btn {
    border: none;
    background: transparent;
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.segment-btn:hover {
    color: var(--text-primary);
}

.segment-btn.is-active {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.segment-btn[data-sexo="ninas"].is-active {
    color: #047857;
}

.segment-btn[data-sexo="ninos"].is-active {
    color: #0284c7;
}

/* -------------------------------------------------------------
   8. DASHBOARD MULTI-CARA CRED (AMBAS CARAS DEL CARNÉ CLINICO)
   ------------------------------------------------------------- */
.cred-faces-bar {
    margin-bottom: 1.25rem;
}

.cred-faces-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .cred-faces-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.cred-face-card {
    background-color: #ffffff;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 0.875rem 1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.03);
}

.cred-face-card:hover {
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

.cred-face-card.is-active-face {
    border-color: #10b981;
    background-color: #f0fdf4;
    box-shadow: 0 4px 14px -2px rgba(16, 185, 129, 0.18);
}

.cred-face-card[data-face="te"].is-active-face {
    border-color: #3b82f6;
    background-color: #eff6ff;
    box-shadow: 0 4px 14px -2px rgba(59, 130, 246, 0.18);
}

.cred-face-card[data-face="pe"].is-active-face {
    border-color: #8b5cf6;
    background-color: #faf5ff;
    box-shadow: 0 4px 14px -2px rgba(139, 92, 246, 0.18);
}

.cred-face-card[data-face="atalah"].is-active-face {
    border-color: #0d9488;
    background-color: #f0fdfa;
    box-shadow: 0 4px 14px -2px rgba(13, 148, 136, 0.18);
}

.cred-face-card[data-face="iom"].is-active-face {
    border-color: #0284c7;
    background-color: #f0f9ff;
    box-shadow: 0 4px 14px -2px rgba(2, 132, 199, 0.18);
}

.face-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.375rem;
    margin-bottom: 0.375rem;
}

.face-tag-badge {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
}

.tag-pt {
    background-color: #ecfdf5;
    color: #047857;
}

.tag-imc {
    background-color: #ecfdf5;
    color: #047857;
}

.tag-te {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.tag-pe {
    background-color: #faf5ff;
    color: #7e22ce;
}

.tag-atalah {
    background-color: #ccfbf1;
    color: #0f766e;
}

.tag-iom {
    background-color: #e0f2fe;
    color: #0369a1;
}

.tag-nts2024 {
    background-color: #fee2e2;
    color: #991b1b;
}

.tag-rm2017 {
    background-color: #e0e7ff;
    color: #3730a3;
}

.cred-face-card[data-face="nts2024"].is-active-face {
    border-color: #991b1b;
    background-color: #fef2f2;
    box-shadow: 0 4px 14px -2px rgba(153, 27, 27, 0.18);
}

.cred-face-card[data-face="rm2017"].is-active-face {
    border-color: #4338ca;
    background-color: #eef2ff;
    box-shadow: 0 4px 14px -2px rgba(67, 56, 202, 0.18);
}

.cred-faces-grid-2cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .cred-faces-grid-2cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

.query-dual-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.query-input-compact {
    position: relative;
    width: 5.25rem !important;
    max-width: 5.5rem !important;
    box-sizing: border-box;
}

.query-input-compact .query-input {
    padding: 0 1.5rem 0 0.5rem !important;
    font-size: 1.0625rem;
    font-weight: 700;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.query-badge-pill {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--brand-primary);
    background-color: var(--brand-light);
    border: 1px solid var(--brand-border);
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.query-calculated-box {
    position: relative !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 0 2.4rem 0 0.75rem;
    height: 2.75rem;
    width: 135px;
    box-sizing: border-box;
}

.query-calculated-val {
    color: var(--brand-primary);
    font-size: 1.125rem;
    font-weight: 800;
}

.query-calculated-box .query-unit {
    position: absolute;
    right: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    pointer-events: none;
}



.face-status-indicator {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-light);
}

.is-active-face .face-status-indicator {
    color: #047857;
    font-weight: 700;
}

.cred-face-card[data-face="te"].is-active-face .face-status-indicator {
    color: #1d4ed8;
}

.cred-face-card[data-face="pe"].is-active-face .face-status-indicator {
    color: #7e22ce;
}

.face-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    letter-spacing: -0.01em;
}

.face-card-dx {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.375rem;
    line-height: 1.25;
}

.face-card-sub {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* -------------------------------------------------------------
   9. FILA ACTIVA INMEDIATA ARRIBA (HERO LIVE ROW)
   ------------------------------------------------------------- */
.live-result-row-card {
    background-color: #ffffff;
    border: 1.5px solid #10b981;
    border-radius: var(--radius-xl);
    padding: 1.125rem 1.25rem;
    box-shadow: 0 6px 20px -3px rgba(16, 185, 129, 0.1), 0 2px 4px -2px rgba(16, 185, 129, 0.05);
    margin-bottom: 1.25rem;
}

.live-row-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid #f1f5f9;
}

.live-row-eyebrow {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #047857;
}

.live-row-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.live-diagnosis-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    background-color: var(--bg-surface-soft);
    color: var(--text-secondary);
}

.badge-normal {
    background-color: #dcfce7;
    color: #15803d;
}

.badge-warning {
    background-color: #fef3c7;
    color: #b45309;
}

.badge-danger {
    background-color: #fee2e2;
    color: #b91c1c;
}

.badge-delgadez {
    background-color: #ffedd5;
    color: #c2410c;
}

.badge-sobrepeso {
    background-color: #fef9c3;
    color: #a16207;
}

.badge-obesidad {
    background-color: #fee2e2;
    color: #b91c1c;
}

.badge-anemia-normal {
    background-color: #dcfce7;
    color: #15803d;
}

.badge-anemia-leve {
    background-color: #fef9c3;
    color: #a16207;
}

.badge-anemia-mod {
    background-color: #ffedd5;
    color: #c2410c;
}

.badge-anemia-sev {
    background-color: #fee2e2;
    color: #991b1b;
}

.live-row-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0.875rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.live-row-table-wrap::-webkit-scrollbar {
    height: 4px;
}

.live-row-table-wrap::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

.live-row-table {
    width: 100%;
    min-width: 580px;
    border-collapse: separate;
    border-spacing: 0;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.live-row-table thead th {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.375rem 0.5rem;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.live-row-table thead th .col-sub {
    display: block;
    font-size: 0.625rem;
    font-weight: 500;
    opacity: 0.85;
}

.live-row-table tbody td {
    padding: 0.75rem 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    background-color: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

.live-row-table td.live-cell-median {
    background-color: #d1fae5;
    color: #065f46;
    font-weight: 900;
    font-size: 1.375rem;
    border-radius: var(--radius-md);
}

.live-row-table td.live-cell-active-dx {
    background-color: #ecfdf5;
    color: #065f46;
    font-weight: 800;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 2px #10b981;
}

.live-row-table td.live-cell-active-delgadez {
    background-color: #fff7ed;
    color: #c2410c;
    font-weight: 800;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 2px #ea580c;
}

.live-row-table td.live-cell-active-sobrepeso {
    background-color: #fefce8;
    color: #a16207;
    font-weight: 800;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 2px #eab308;
}

.live-row-table td.live-cell-active-obesidad {
    background-color: #fef2f2;
    color: #b91c1c;
    font-weight: 800;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 2px #ef4444;
}

.live-row-table td.live-cell-active-anemia-normal {
    background-color: #ecfdf5;
    color: #065f46;
    font-weight: 800;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 2px #10b981;
}

.live-row-table td.live-cell-active-anemia-leve {
    background-color: #fefce8;
    color: #a16207;
    font-weight: 800;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 2px #eab308;
}

.live-row-table td.live-cell-active-anemia-mod {
    background-color: #fff7ed;
    color: #c2410c;
    font-weight: 800;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 2px #ea580c;
}

.live-row-table td.live-cell-active-anemia-sev {
    background-color: #fef2f2;
    color: #991b1b;
    font-weight: 800;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 2px #ef4444;
}

.live-row-summary-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.8125rem;
    background-color: #f8fafc;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-md);
}

.live-summary-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.summary-label {
    color: var(--text-muted);
}

.summary-value {
    color: #047857;
    font-weight: 600;
}

/* -------------------------------------------------------------
   9. TABLA COMPLETA DE REFERENCIA INFERIOR
   ------------------------------------------------------------- */
.table-card-container {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-subtle);
    overflow: hidden;
    margin-bottom: 1.75rem;
}

.table-card-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.75rem;
}

.table-toolbar-info {
    font-weight: 600;
    color: var(--text-secondary);
}

.table-toolbar-hint {
    color: var(--text-muted);
}

.table-scroll-frame {
    max-height: 480px;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    position: relative;
}

.medical-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-variant-numeric: tabular-nums;
    font-size: 0.8125rem;
    text-align: center;
}

.medical-data-table thead th {
    position: sticky;
    top: 0;
    background-color: #f1f5f9;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.6875rem;
    padding: 0.625rem 0.5rem;
    border-bottom: 2px solid var(--border-strong);
    z-index: 20;
    white-space: nowrap;
}

.th-badge {
    display: block;
    font-size: 0.625rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 0.1rem 0.25rem;
    margin-top: 0.15rem;
}

.th-badge-severe { background-color: #fee2e2; color: #991b1b; }
.th-badge-risk { background-color: #fef3c7; color: #92400e; }
.th-badge-median { background-color: #d1fae5; color: #065f46; font-weight: 600; }
.th-badge-delgadez { background-color: #ffedd5; color: #c2410c; }
.th-badge-normal { background-color: #dcfce7; color: #15803d; }
.th-badge-sobrepeso { background-color: #fef9c3; color: #a16207; }
.th-badge-obesidad { background-color: #fee2e2; color: #b91c1c; }
.th-badge-anemia-normal { background-color: #dcfce7; color: #15803d; }
.th-badge-anemia-leve { background-color: #fef9c3; color: #a16207; }
.th-badge-anemia-mod { background-color: #ffedd5; color: #c2410c; }
.th-badge-anemia-sev { background-color: #fee2e2; color: #991b1b; }

.medical-data-table tbody tr {
    transition: background-color 0.1s ease;
    cursor: default;
}

.medical-data-table tbody tr:nth-child(even) td {
    background-color: #fafbfc;
}

.medical-data-table tbody td {
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-primary);
    white-space: nowrap;
}

.th-sticky-col,
.td-sticky-col {
    position: sticky;
    left: 0;
    z-index: 10;
    font-weight: 600 !important;
    text-align: center;
    border-right: 2px solid var(--border-subtle) !important;
}

.th-sticky-col {
    background-color: #e2e8f0 !important;
    color: var(--text-primary);
    z-index: 30;
}

.td-sticky-col {
    background-color: #f8fafc !important;
    color: var(--text-primary);
}

.td-median-col {
    background-color: #f0fdf4 !important;
    color: #15803d !important;
    font-weight: 600;
}

/* Foco de la Fila Seleccionada */
.medical-data-table tbody tr.pocket-row-focus td {
    background-color: #ecfdf5 !important;
    color: #065f46 !important;
    font-weight: 600 !important;
    border-top: 1.5px solid #10b981 !important;
    border-bottom: 1.5px solid #10b981 !important;
}

.medical-data-table tbody tr.pocket-row-focus .td-sticky-col {
    background-color: #d1fae5 !important;
    color: #047857 !important;
    border-left: 4px solid #059669 !important;
    font-weight: 700 !important;
}

.medical-data-table tbody tr.pocket-row-dimmed {
    opacity: 0.45;
}

/* Barra de Acciones */
.table-actions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-subtle);
}

.actions-social-group {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--border-subtle);
    background-color: #ffffff;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.action-btn:hover {
    background-color: var(--bg-surface-soft);
    color: var(--text-primary);
}

.action-btn-whatsapp {
    background-color: #25d366;
    border-color: #25d366;
    color: #ffffff;
}

.action-btn-whatsapp:hover {
    background-color: #20bd5a;
    color: #ffffff;
}

/* -------------------------------------------------------------
   10. BANNER ARMONIOSO DE CONVERSIÓN (PORTAL-CTA-BANNER)
   ------------------------------------------------------------- */
.portal-cta-banner {
    background-color: #ffffff;
    border: 1px solid var(--border-subtle);
    border-top: 3px solid var(--brand-primary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: var(--shadow-card);
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .portal-cta-banner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 1.75rem 2rem;
    }
}

.portal-cta-badge {
    display: inline-block;
    background-color: var(--brand-light);
    color: var(--brand-primary);
    border: 1px solid var(--brand-border);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.375rem;
}

.portal-cta-title {
    margin: 0;
    font-size: 1.1875rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-primary);
    letter-spacing: -0.015em;
}

@media (min-width: 640px) {
    .portal-cta-title {
        font-size: 1.375rem;
    }
}

.portal-cta-desc {
    margin: 0.375rem 0 0 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.45;
    max-width: 540px;
}

.portal-cta-action {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex-shrink: 0;
}

.portal-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--brand-primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.875rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(4, 120, 87, 0.25);
    transition: background-color 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
}

.portal-cta-btn:hover {
    background-color: var(--brand-primary-hover);
}

.portal-cta-btn:active {
    transform: scale(0.98);
}

.portal-cta-subtext {
    font-size: 0.6875rem;
    color: var(--text-light);
    text-align: center;
}

/* -------------------------------------------------------------
   11. GRÁFICA DE CURVAS OMS EN VIVO (VECTORIAL SVG, CERO INLINE)
   ------------------------------------------------------------- */
.who-curve-card {
    background-color: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.125rem 1.25rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.who-curve-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.who-curve-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.who-curve-title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.who-curve-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    background-color: #ecfdf5;
    color: #047857;
}

.who-curve-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.875rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.who-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.who-legend-swatch {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 2px;
}

.swatch-median {
    background-color: #047857;
    height: 3px;
    width: 14px;
}

.swatch-normal-zone {
    background-color: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.swatch-sd3 {
    background-color: #ef4444;
    height: 2px;
    width: 12px;
}

.swatch-patient {
    background-color: #0284c7;
    border-radius: 50%;
    width: 8px;
    height: 8px;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.3);
}

.swatch-atalah-zone-delgadez {
    background-color: rgba(234, 88, 12, 0.25);
    border: 1px solid #ea580c;
    border-radius: 3px;
    width: 12px;
    height: 12px;
}

.swatch-atalah-zone-normal {
    background-color: rgba(22, 163, 74, 0.25);
    border: 1px solid #16a34a;
    border-radius: 3px;
    width: 12px;
    height: 12px;
}

.swatch-atalah-zone-sobre {
    background-color: rgba(234, 179, 8, 0.25);
    border: 1px solid #d97706;
    border-radius: 3px;
    width: 12px;
    height: 12px;
}

.swatch-atalah-zone-obesidad {
    background-color: rgba(220, 38, 38, 0.25);
    border: 1px solid #dc2626;
    border-radius: 3px;
    width: 12px;
    height: 12px;
}

.swatch-anemia-normal {
    background-color: rgba(22, 163, 74, 0.25);
    border: 1px solid #16a34a;
    border-radius: 3px;
    width: 12px;
    height: 12px;
}

.swatch-anemia-leve {
    background-color: rgba(234, 179, 8, 0.25);
    border: 1px solid #d97706;
    border-radius: 3px;
    width: 12px;
    height: 12px;
}

.swatch-anemia-mod {
    background-color: rgba(234, 88, 12, 0.25);
    border: 1px solid #ea580c;
    border-radius: 3px;
    width: 12px;
    height: 12px;
}

.swatch-anemia-sev {
    background-color: rgba(220, 38, 38, 0.25);
    border: 1px solid #dc2626;
    border-radius: 3px;
    width: 12px;
    height: 12px;
}

.who-curve-canvas-wrap {
    width: 100%;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.02);
    cursor: default;
}

.who-curve-svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 400px;
    overflow: visible;
}

/* Clases de elementos SVG puros (CERO estilos en línea) */
.curve-grid-line {
    stroke: #e2e8f0;
    stroke-width: 1;
    stroke-dasharray: 2 3;
}

.curve-axis-line {
    stroke: #94a3b8;
    stroke-width: 1.5;
}

.curve-axis-text {
    fill: #64748b;
    font-size: 11px;
    font-family: inherit;
    font-weight: 600;
}

.curve-axis-label {
    fill: #334155;
    font-size: 12px;
    font-family: inherit;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.curve-zone-normal {
    fill: rgba(16, 185, 129, 0.12);
}

.curve-zone-delgadez {
    fill: rgba(234, 88, 12, 0.12);
}

.curve-zone-atalah-normal {
    fill: rgba(22, 163, 74, 0.12);
}

.curve-zone-sobrepeso {
    fill: rgba(234, 179, 8, 0.14);
}

.curve-zone-obesidad {
    fill: rgba(220, 38, 38, 0.10);
}

.curve-zone-anemia-sev {
    fill: rgba(220, 38, 38, 0.14);
}

.curve-zone-anemia-mod {
    fill: rgba(234, 88, 12, 0.12);
}

.curve-zone-anemia-leve {
    fill: rgba(234, 179, 8, 0.12);
}

.curve-zone-anemia-normal {
    fill: rgba(22, 163, 74, 0.12);
}

.curve-line-hb-obs {
    stroke: #64748b;
    stroke-width: 1.75;
    stroke-dasharray: 4 3;
}

.curve-line-hb-adj {
    stroke: #991b1b;
    stroke-width: 2.5;
}

.curve-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.curve-line-median {
    stroke: #047857;
    stroke-width: 2.75;
}

.curve-line-sd1 {
    stroke: #10b981;
    stroke-width: 1.25;
    stroke-opacity: 0.6;
}

.curve-line-sd2 {
    stroke: #f59e0b;
    stroke-width: 1.5;
}

.curve-line-sd3 {
    stroke: #ef4444;
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
}

.curve-line-atalah-bajo {
    stroke: #ea580c;
    stroke-width: 2;
}

.curve-line-atalah-normal {
    stroke: #16a34a;
    stroke-width: 2.25;
}

.curve-line-atalah-sobre {
    stroke: #d97706;
    stroke-width: 2;
}

.curve-line-label {
    font-size: 10px;
    font-family: inherit;
    font-weight: 700;
}

.curve-label-median {
    fill: #047857;
}

.curve-label-sd2 {
    fill: #d97706;
}

.curve-label-sd3 {
    fill: #dc2626;
}

.curve-label-atalah-bajo {
    fill: #ea580c;
}

.curve-label-atalah-normal {
    fill: #16a34a;
}

.curve-label-atalah-sobre {
    fill: #d97706;
}

.curve-crosshair {
    stroke: #0284c7;
    stroke-width: 1.25;
    stroke-dasharray: 3 3;
    stroke-opacity: 0.7;
}

.curve-point-pulse {
    fill: rgba(2, 132, 199, 0.2);
    stroke: rgba(2, 132, 199, 0.6);
    stroke-width: 1.5;
    animation: curvePointPulse 2s infinite ease-in-out;
}

@keyframes curvePointPulse {
    0% { r: 6px; opacity: 1; }
    50% { r: 14px; opacity: 0.4; }
    100% { r: 6px; opacity: 1; }
}

.curve-point-core {
    fill: #0284c7;
    stroke: #ffffff;
    stroke-width: 2;
}

.curve-callout-bg {
    fill: #0f172a;
    rx: 6;
    ry: 6;
    filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.25));
}

.curve-callout-title {
    fill: #ffffff;
    font-size: 11px;
    font-family: inherit;
    font-weight: 600;
}

/* -------------------------------------------------------------
   11.5. CATÁLOGO CENTRAL DE TABLAS & BAREMOS (HUB / PORTAL)
   ------------------------------------------------------------- */
.hub-header {
    text-align: center;
    max-width: 720px;
    margin: 1.5rem auto 2.25rem auto;
}

.hub-hero-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-primary);
    background-color: var(--brand-light);
    border: 1px solid var(--brand-border);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.75rem;
}

.hub-title {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: 1.25;
    margin: 0 0 0.5rem 0;
}

.hub-subtitle {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 1.25rem 0;
}

/* Buscador en Vivo del Hub */
.hub-search-wrapper {
    position: relative;
    max-width: 480px;
    margin: 0 auto 1.25rem auto;
}

.hub-search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    color: var(--text-light);
    pointer-events: none;
}

.hub-search-input {
    width: 100%;
    height: 2.875rem;
    padding: 0 1rem 0 2.5rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    background-color: #ffffff;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-full);
    outline: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    transition: all 0.15s ease;
}

.hub-search-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.15);
}

/* Filtros por Categoría */
.hub-filter-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.hub-filter-pill {
    background-color: #ffffff;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s ease;
}

.hub-filter-pill:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.hub-filter-pill.is-active {
    background-color: var(--text-primary);
    color: #ffffff;
    border-color: var(--text-primary);
}

/* Cuadrícula de Tarjetas (Grid) */
.hub-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

@media (min-width: 640px) {
    .hub-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .hub-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tarjeta Individual del Catálogo */
.hub-item-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #ffffff;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.04);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

a.hub-item-card {
    cursor: pointer;
}

a.hub-item-card:hover {
    border-color: var(--brand-border);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px -4px rgba(4, 120, 87, 0.12);
}

div.hub-item-card {
    background-color: #fafbfc;
    cursor: default;
    opacity: 0.94;
}

.hub-card-header {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.hub-card-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.hub-badge-pill {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

.badge-pink {
    background-color: #fdf2f8;
    color: #db2777;
}

.badge-blue {
    background-color: #eff6ff;
    color: #2563eb;
}

.badge-green {
    background-color: #ecfdf5;
    color: #047857;
}

.badge-teal {
    background-color: #f0fdfa;
    color: #0d9488;
}

.badge-purple {
    background-color: #faf5ff;
    color: #9333ea;
}

.hub-status-tag {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #059669;
    background-color: #ecfdf5;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

.hub-status-tag-soon {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-light);
}

.hub-card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    margin: 0 0 0.5rem 0;
}

.hub-card-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.hub-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-subtle);
    margin-top: 1rem;
    padding-top: 0.75rem;
    font-size: 0.75rem;
}

.hub-card-source {
    color: var(--text-light);
    font-weight: 500;
}

.hub-card-action {
    color: var(--brand-primary);
    font-weight: 700;
}

.hub-item-card.is-hidden {
    display: none !important;
}

/* -------------------------------------------------------------
   11.B. COMPONENTES UNIFICADOS MULTI-TABLA & COMPATIBILIDAD INTEGRAL
   ------------------------------------------------------------- */

/* Grid de Métricas / KPI en Hero Live Row */
.live-row-columns-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}

@media (min-width: 640px) {
    .live-row-columns-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.live-col-cell {
    background-color: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    transition: all 0.15s ease;
}

.live-col-cell:hover {
    border-color: var(--border-strong);
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.live-col-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.live-col-value {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.live-col-hint {
    font-size: 0.6875rem;
    color: var(--text-light);
    line-height: 1.2;
}

/* Resumen Inferior en Fila Live */
.live-row-footer-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.8125rem;
    background-color: #f8fafc;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--brand-primary);
}

.summary-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
}

.summary-item strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* Compatibilidad de Badges de Consulta (query-metric-badge) */
.query-metric-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 0 0.75rem;
    height: 2.75rem;
    min-width: 135px;
    box-sizing: border-box;
}

.query-metric-badge.badge-accent {
    background-color: #ecfdf5;
    border-color: #10b981;
}

.query-metric-badge .metric-num {
    color: var(--brand-primary);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.query-metric-badge.badge-accent .metric-num {
    color: #047857;
}

/* Compatibilidad de Tarjetas Face (Adultos, HOMA, Hierro) */
.cred-face-card.is-active {
    border-color: #10b981;
    background-color: #f0fdf4;
    box-shadow: 0 4px 14px -2px rgba(16, 185, 129, 0.18);
}

.cred-face-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.375rem;
    margin-bottom: 0.375rem;
}

.cred-face-tag {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    background-color: #ecfdf5;
    color: #047857;
}

.cred-face-status {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #047857;
}

.cred-face-card:not(.is-active):not(.is-active-face) .cred-face-status {
    color: var(--text-muted);
}

.cred-face-title {
    margin: 0 0 0.375rem 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
}

.cred-face-diagnosis {
    margin-bottom: 0.25rem;
}

.cred-face-subinfo {
    margin: 0;
    font-size: 0.6875rem;
    color: var(--text-muted);
}

/* Badges de Diagnóstico Dx */
.dx-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
}

.dx-emerald {
    background-color: #dcfce7;
    color: #15803d;
}

.dx-amber {
    background-color: #fef3c7;
    color: #b45309;
}

.dx-rose {
    background-color: #fee2e2;
    color: #b91c1c;
}

.dx-blue {
    background-color: #e0f2fe;
    color: #0369a1;
}

.dx-purple {
    background-color: #f3e8ff;
    color: #7e22ce;
}

/* Compatibilidad de Cabecera de Nomograma / Gráfica Vectorial */
.curve-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    background-color: #fafbfc;
}

.curve-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.curve-card-badge {
    align-self: flex-start;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    background-color: #ecfdf5;
    color: #047857;
}

.curve-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.curve-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.875rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-normal {
    background-color: #10b981;
}

.dot-limit {
    background-color: #f59e0b;
}

.dot-severe {
    background-color: #ef4444;
}

.dot-patient {
    background-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.3);
}

/* Compatibilidad de Secciones de Tabla Digitalizada */
.pocket-table-section {
    background-color: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.pocket-table-header,
.table-header-flex {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    background-color: #ffffff;
}

.table-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.table-official-seal {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #047857;
}

.table-section-title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
}

.table-section-sub {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.table-count-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    background-color: #f1f5f9;
    color: var(--text-secondary);
}

.print-clean-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background-color: #ffffff;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.print-clean-btn:hover {
    background-color: #f8fafc;
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.table-scroll-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-subtle);
}

.scroll-hint-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Notas Clínicas / Ficha Metodológica */
.pocket-clinical-notes {
    background-color: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-subtle);
}

.notes-title {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
}

@media (min-width: 640px) {
    .notes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.note-box {
    background-color: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
}

.note-box-title {
    margin: 0 0 0.35rem 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.note-box-text {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

/* Banner Contextual Inbound (inbound-promo-card) */
.inbound-promo-card {
    background: linear-gradient(135deg, #064e3b 0%, #047857 50%, #0f766e 100%);
    border-radius: var(--radius-xl);
    padding: 1.5rem 1.75rem;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(6, 78, 59, 0.25);
}

@media (min-width: 768px) {
    .inbound-promo-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.inbound-promo-content {
    flex: 1;
}

.inbound-badge {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.2);
    color: #a7f3d0;
    margin-bottom: 0.5rem;
}

.inbound-title {
    margin: 0 0 0.375rem 0;
    font-size: 1.125rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
}

.inbound-text {
    margin: 0;
    font-size: 0.8125rem;
    color: #d1fae5;
    line-height: 1.4;
    max-width: 600px;
}

.inbound-promo-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
}

.inbound-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    background-color: #ffffff;
    color: #065f46;
    text-decoration: none;
    transition: all 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.inbound-cta-btn:hover {
    background-color: #ecfdf5;
    transform: translateY(-1px);
}

.inbound-secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.15s ease;
}

.inbound-secondary-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

/* Footer Limpio */
.pocket-footer {
    text-align: center;
    padding: 1.5rem 1rem 2rem 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    margin-top: 2rem;
}

.pocket-footer-text {
    margin: 0;
}

/* -------------------------------------------------------------
   12. ESTILOS Y COMPONENTES PARA NUEVAS SUITES CLÍNICAS
   ------------------------------------------------------------- */
.table-header-card {
    background-color: transparent;
    border: none;
    padding: 0.25rem 0.25rem 0.75rem 0.25rem;
    margin-bottom: 0.75rem;
}

.table-badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.pocket-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
}

.pocket-badge.badge-green {
    background-color: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.pocket-badge-outline {
    background-color: var(--bg-surface-soft);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

.table-main-title {
    margin: 0 0 0.35rem 0;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.table-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* Panel de Cálculo Card */
.calc-panel-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
}

.calc-panel-card input[type="number"],
.calc-panel-card input[type="text"],
.calc-panel-card select {
    width: 100%;
    height: 2.5rem;
    padding: 0 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    background-color: #f8fafc;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    outline: none;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.calc-panel-card input:focus,
.calc-panel-card select:focus {
    background-color: #ffffff;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.15);
}

.calc-panel-card label.block {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

/* Tiles de Resultado */
.result-tile {
    background-color: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Utilidades Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .grid-cols-2:not(.p-2-exempt), 
    .grid-cols-3, 
    .grid-cols-4 { 
        grid-template-columns: 1fr; 
    }
}

/* Utilidades de Espaciado y Flex */
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.block { display: block; }
.inline-block { display: inline-block; }

.w-full { width: 100%; }
.h-10 { height: 2.5rem; }
.h-11 { height: 2.75rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }

.rounded-lg { border-radius: var(--radius-md); }
.rounded-xl { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.border { border-width: 1px; border-style: solid; }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-300 { border-color: #cbd5e1; }
.border-emerald-300 { border-color: #a7f3d0; }

.bg-white { background-color: #ffffff; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-emerald-100 { background-color: #d1fae5; }
.bg-amber-100 { background-color: #fef3c7; }
.bg-rose-100 { background-color: #ffe4e6; }
.bg-blue-100 { background-color: #dbeafe; }

.hover\:bg-slate-50:hover { background-color: #f8fafc; }
.cursor-pointer { cursor: pointer; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }

/* Tipografía */
.text-2xs { font-size: 0.6875rem; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.tracking-wider { letter-spacing: 0.05em; }
.uppercase { text-transform: uppercase; }

.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-900 { color: #0f172a; }
.text-emerald-600 { color: #059669; }
.text-emerald-700 { color: #047857; }
.text-emerald-800 { color: #065f46; }
.text-amber-800 { color: #92400e; }
.text-rose-800 { color: #9f1239; }
.text-blue-800 { color: #1e40af; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

/* Notas Clínicas Card */
.table-notes-card {
    background-color: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
}

.table-notes-title {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.table-notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.note-item strong {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.note-item p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Tablas nativas en cards */
.card-minimal {
    background-color: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
}

.card-minimal table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.card-minimal th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 700;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-strong);
}

.card-minimal td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.card-minimal tr:hover td {
    background-color: #f8fafc;
}

.card-minimal tr.bg-emerald-50 td {
    background-color: #ecfdf5;
}

.overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.md\:col-span-2 { grid-column: span 2 / span 2; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.border-b { border-bottom: 1px solid var(--border-subtle); }
.border-t { border-top: 1px solid var(--border-subtle); }
.border-l-4 { border-left-width: 4px; border-left-style: solid; }
.border-emerald-600 { border-color: #059669; }
.border-rose-300 { border-color: #fecdd3; }
.pb-1 { padding-bottom: 0.25rem; }
.pt-1 { padding-top: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.font-black { font-weight: 900; }
.text-rose-700 { color: #be123c; }
.text-rose-800 { color: #9f1239; }
.text-amber-800 { color: #92400e; }

/* -------------------------------------------------------------
   13. ESTILOS DE IMPRESIÓN (@media print)
   ------------------------------------------------------------- */
@media print {
    .pocket-topbar,
    .portal-sidebar,
    .sidebar-backdrop,
    .tool-query-bar,
    .table-actions-bar,
    .portal-cta-banner,
    button {
        display: none !important;
    }

    body.pocket-body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 9pt;
        padding-left: 0 !important;
    }

    .pocket-container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .tool-header-card,
    .live-result-row-card,
    .who-curve-card,
    .table-card-container {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .who-curve-card {
        page-break-inside: avoid;
        margin-bottom: 1.5rem !important;
    }

    .table-scroll-frame {
        max-height: none !important;
        overflow: visible !important;
    }

    .th-sticky-col,
    .td-sticky-col {
        position: static !important;
        box-shadow: none !important;
    }

    .table-card-container::after {
        content: "BIONUTRICIONAL PRO · Software Clínico Cifrado para Nutricionistas · https://nutricionista.red";
        display: block;
        margin-top: 2rem;
        padding-top: 0.5rem;
        border-top: 1px solid #cbd5e1;
        font-size: 8pt;
        color: #64748b;
        text-align: center;
    }
}

/* ==========================================================================
   PORTAL HOME & CONSULTORIO ACCESS (ZERO INLINE STYLES)
   ========================================================================== */
.pocket-btn-consultorio {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background-color: var(--brand-primary);
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.pocket-btn-consultorio:hover {
    background-color: var(--brand-hover);
    color: #ffffff;
    transform: translateY(-1px);
}

.pocket-btn-consultorio-active {
    background-color: #047857;
}

.portal-consultorio-banner {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--radius-xl);
    padding: 2rem 1.5rem;
    color: #ffffff;
    margin-bottom: 3rem;
    border: 1px solid #334155;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.25);
}

@media (min-width: 768px) {
    .portal-consultorio-banner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 2.5rem 2rem;
    }
}

.portal-consultorio-info {
    max-width: 650px;
}

.portal-consultorio-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #34d399;
    margin-bottom: 0.5rem;
}

.portal-consultorio-title {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: #ffffff;
}

.portal-consultorio-desc {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #94a3b8;
    margin-bottom: 1.25rem;
}

.portal-consultorio-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    font-size: 0.8125rem;
    color: #cbd5e1;
}

.portal-consultorio-feat-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.portal-consultorio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--brand-primary);
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 700;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    transition: all 0.2s ease;
}

.portal-consultorio-btn:hover {
    background-color: var(--brand-primary-hover);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* -------------------------------------------------------------
   24. ESTILOS DE LA PORTADA DEL ECOSISTEMA (NUTRICIONISTA.RED)
   ------------------------------------------------------------- */
.portal-hero-container {
    text-align: center;
    max-width: 860px;
    margin: 2rem auto 3rem;
}

.portal-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.875rem;
    margin-top: 1.75rem;
}

.portal-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--brand-primary);
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 700;
    padding: 0.8125rem 1.5rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.25);
    transition: all 0.2s ease;
}

.portal-btn-primary:hover {
    background-color: var(--brand-primary-hover);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(4, 120, 87, 0.35);
}

.portal-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: #ffffff;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 0.8125rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border-strong);
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    transition: all 0.2s ease;
}

.portal-btn-secondary:hover {
    background-color: var(--bg-surface-soft);
    border-color: var(--text-secondary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.portal-section-block {
    margin-bottom: 3.5rem;
}

.portal-section-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .portal-section-header {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

.portal-section-title-wrap {
    max-width: 650px;
}

.portal-section-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-primary);
    margin-bottom: 0.375rem;
}

.portal-section-title {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.375rem 0;
    line-height: 1.25;
}

.portal-section-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.portal-section-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--brand-primary);
    text-decoration: none;
    margin-top: 0.75rem;
    transition: color 0.15s ease;
}

.portal-section-cta-link:hover {
    color: var(--brand-primary-hover);
    text-decoration: underline;
}

.portal-banner-cta-row {
    text-align: center;
    margin-top: 1.75rem;
}

.portal-btn-view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: #ffffff;
    color: var(--brand-primary);
    font-size: 0.9375rem;
    font-weight: 700;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--brand-primary);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(4, 120, 87, 0.08);
    transition: all 0.2s ease;
}

.portal-btn-view-all:hover {
    background-color: var(--brand-primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(4, 120, 87, 0.2);
}

.portal-feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.25rem;
}

@media (min-width: 640px) {
    .portal-feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .portal-feature-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.portal-feature-item {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.portal-feature-icon {
    font-size: 1.25rem;
    margin-bottom: 0.375rem;
}

.portal-feature-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.portal-feature-text {
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.4;
    margin: 0;
}

/* Pilar 3: Calculadoras Metabólicas & Fórmulas Predictivas */
.portal-calc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 640px) {
    .portal-calc-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .portal-calc-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.portal-calc-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.portal-calc-card:hover {
    border-color: var(--brand-primary);
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.1);
    transform: translateY(-2px);
}

.portal-calc-badge {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
}

.portal-calc-badge-emerald {
    background-color: #ecfdf5;
    color: #047857;
}

.portal-calc-badge-blue {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.portal-calc-badge-purple {
    background-color: #faf5ff;
    color: #7e22ce;
}

.portal-calc-badge-amber {
    background-color: #fffbeb;
    color: #b45309;
}

.portal-calc-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.portal-calc-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0 0 1rem 0;
    flex-grow: 1;
}

.portal-calc-formulas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.portal-calc-formula-tag {
    font-size: 0.6875rem;
    font-weight: 600;
    background-color: var(--bg-surface-soft);
    color: var(--text-secondary);
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.portal-calc-action {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--brand-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: auto;
}

.portal-calc-action:hover {
    color: var(--brand-primary-hover);
    text-decoration: underline;
}

/* Pilar 4: Banner Convocatorias & Bolsa Laboral */
.portal-job-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--radius-xl);
    padding: 2rem 1.75rem;
    color: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3.5rem;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .portal-job-banner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 2.5rem 2.25rem;
    }
}

.portal-job-info {
    max-width: 650px;
}

.portal-job-tag {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.portal-job-title {
    font-size: 1.375rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
    line-height: 1.25;
}

.portal-job-desc {
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0;
}

.portal-job-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: #38bdf8;
    color: #0f172a;
    font-size: 0.9375rem;
    font-weight: 700;
    padding: 0.8125rem 1.5rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.portal-job-btn:hover {
    background-color: #7dd3fc;
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}


