/**
 * SAM DESIGN SYSTEM 2026 - INSTITUCIONAL & MODULAR
 * Sistema Administrativo Municipal (SAM) - Grupo Satélite
 * 
 * Ámbito estricto y encapsulado:
 *  .sam-modern-scope, .uatm-modern, .utm-modern
 * 
 * Paleta Institucional Canónica:
 *  - Azul Navy Principal: #0f2238
 *  - Azul Institucional:  #1e3a8a
 *  - Azul de Acción:      #0284c7
 *  - Fondo General:       #f8fafc
 *  - Texto Principal:     #0f172a
 *  - Bordes Suaves:       #cbd5e1
 *  - Éxito Semántico:     #16a34a
 *  - Error Semántico:     #dc2626
 *  - Advertencia:         #d97706
 */

:root {
    --sam-navy-900: #0f2238;
    --sam-navy-800: #162c46;
    --sam-blue-900: #1e3a8a;
    --sam-blue-700: #1d4ed8;
    --sam-blue-600: #0284c7;
    --sam-blue-500: #0ea5e9;
    --sam-blue-100: #e0f2fe;
    --sam-blue-50:  #f0f9ff;
    
    --sam-slate-900: #0f172a;
    --sam-slate-800: #1e293b;
    --sam-slate-700: #334155;
    --sam-slate-600: #475569;
    --sam-slate-500: #64748b;
    --sam-slate-400: #94a3b8;
    --sam-slate-300: #cbd5e1;
    --sam-slate-200: #e2e8f0;
    --sam-slate-100: #f1f5f9;
    --sam-slate-50:  #f8fafc;
    
    --sam-success-600: #16a34a;
    --sam-success-50:  #f0fdf4;
    --sam-error-600:   #dc2626;
    --sam-error-50:    #fef2f2;
    --sam-warning-600: #d97706;
    --sam-warning-50:  #fffbeb;
    
    --sam-space-4:  4px;
    --sam-space-8:  8px;
    --sam-space-12: 12px;
    --sam-space-16: 16px;
    --sam-space-24: 24px;
    --sam-space-32: 32px;
    
    --sam-radius-sm: 6px;
    --sam-radius-md: 8px;
    --sam-radius-lg: 12px;
    --sam-radius-xl: 16px;
    
    --sam-input-height: 40px;
    --sam-input-height-lg: 44px;
    
    --sam-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --sam-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --sam-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
    --sam-shadow-navy: 0 4px 14px rgba(15, 34, 56, 0.22);
}

/* ==========================================================================
   0. ENCAPSULAMIENTO Y RESET CONTROLADO
   ========================================================================== */
.sam-modern-scope,
.uatm-modern,
.utm-modern,
.mercado-modern,
.cementerio-modern {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--sam-slate-900);
    background-color: transparent;
    line-height: 1.5;
    box-sizing: border-box;
    font-size: 13.5px;
}

.sam-modern-scope *,
.uatm-modern *,
.utm-modern *,
.mercado-modern *,
.cementerio-modern * {
    box-sizing: border-box;
}

/* Neutralización de botones heredados antiguos */
.content .sam-modern-scope button,
.sam-modern-scope button,
.content .uatm-modern button,
.uatm-modern button,
.content .utm-modern button,
.utm-modern button,
.content .mercado-modern button,
.mercado-modern button,
.content .cementerio-modern button,
.cementerio-modern button {
    line-height: normal;
    text-shadow: none;
    margin: 0;
    font-family: inherit;
    position: relative;
    border: none;
    cursor: pointer;
}

.content .sam-modern-scope button:after,
.sam-modern-scope button:after,
.content .uatm-modern button:after,
.uatm-modern button:after,
.content .utm-modern button:after,
.utm-modern button:after,
.content .mercado-modern button:after,
.mercado-modern button:after,
.content .cementerio-modern button:after,
.cementerio-modern button:after {
    display: none !important;
    content: none !important;
}

/* ==========================================================================
   1. ENCABEZADO INSTITUCIONAL (.sam-module-header)
   ========================================================================== */
.sam-modern-scope .sam-module-header,
.uatm-modern .sam-module-header,
.utm-modern .sam-module-header,
.mercado-modern .sam-module-header,
.cementerio-modern .sam-module-header {
    background: linear-gradient(135deg, var(--sam-navy-900) 0%, var(--sam-blue-900) 60%, var(--sam-blue-600) 100%);
    color: #ffffff;
    border-radius: var(--sam-radius-lg);
    padding: 16px 22px;
    margin-bottom: 20px;
    box-shadow: var(--sam-shadow-navy);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sam-modern-scope .sam-module-header .sam-header-left,
.uatm-modern .sam-module-header .sam-header-left,
.utm-modern .sam-module-header .sam-header-left,
.mercado-modern .sam-module-header .sam-header-left,
.cementerio-modern .sam-module-header .sam-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sam-modern-scope .sam-module-header .sam-header-icon,
.uatm-modern .sam-module-header .sam-header-icon,
.utm-modern .sam-module-header .sam-header-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--sam-radius-md);
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    color: #ffffff;
}

.sam-modern-scope .sam-module-header h1,
.uatm-modern .sam-module-header h1,
.utm-modern .sam-module-header h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.sam-modern-scope .sam-module-header p,
.uatm-modern .sam-module-header p,
.utm-modern .sam-module-header p {
    margin: 3px 0 0 0;
    font-size: 13px;
    color: var(--sam-blue-100);
    opacity: 0.95;
    line-height: 1.35;
}

.sam-modern-scope .sam-module-badge,
.uatm-modern .sam-module-badge,
.utm-modern .sam-module-badge {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* ==========================================================================
   2. TARJETAS DE CONSULTA Y PANELES (.sam-card, .sam-query-card)
   ========================================================================== */
.sam-modern-scope .sam-card,
.uatm-modern .sam-card,
.utm-modern .sam-card,
.sam-modern-scope .sam-query-card,
.uatm-modern .sam-query-card,
.utm-modern .sam-query-card {
    background: #ffffff;
    border: 1px solid var(--sam-slate-300);
    border-radius: var(--sam-radius-lg);
    box-shadow: var(--sam-shadow-sm);
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.sam-modern-scope .sam-card-header,
.uatm-modern .sam-card-header,
.utm-modern .sam-card-header {
    border-bottom: 1px solid var(--sam-slate-200);
    padding-bottom: 12px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sam-modern-scope .sam-card-title,
.uatm-modern .sam-card-title,
.utm-modern .sam-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--sam-navy-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   3. FORMULARIOS DE BÚSQUEDA Y FILTROS (.sam-filter-card, .sam-search-form)
   ========================================================================== */
.sam-modern-scope .sam-filter-card,
.uatm-modern .sam-filter-card,
.utm-modern .sam-filter-card {
    background: #ffffff;
    border: 1px solid var(--sam-slate-300);
    border-radius: var(--sam-radius-lg);
    padding: 18px 22px;
    margin-bottom: 20px;
    box-shadow: var(--sam-shadow-sm);
    position: relative;
    border-top: 3px solid var(--sam-blue-600);
}

.sam-modern-scope .sam-form-row,
.uatm-modern .sam-form-row,
.utm-modern .sam-form-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0;
}

.sam-modern-scope .sam-form-group,
.uatm-modern .sam-form-group,
.utm-modern .sam-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 200px;
    min-width: 180px;
}

.sam-modern-scope .sam-form-group label,
.uatm-modern .sam-form-group label,
.utm-modern .sam-form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--sam-slate-700);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0;
}

.sam-modern-scope .sam-form-group input[type="text"],
.sam-modern-scope .sam-form-group input[type="number"],
.sam-modern-scope .sam-form-group select,
.uatm-modern .sam-form-group input[type="text"],
.uatm-modern .sam-form-group input[type="number"],
.uatm-modern .sam-form-group select,
.utm-modern .sam-form-group input[type="text"],
.utm-modern .sam-form-group input[type="number"],
.utm-modern .sam-form-group select {
    height: 38px;
    padding: 6px 12px;
    border: 1px solid var(--sam-slate-300);
    border-radius: var(--sam-radius-md);
    background-color: #ffffff;
    font-size: 13.5px;
    color: var(--sam-slate-900);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    width: 100%;
}

.sam-modern-scope .sam-form-group input:focus,
.sam-modern-scope .sam-form-group select:focus,
.uatm-modern .sam-form-group input:focus,
.uatm-modern .sam-form-group select:focus,
.utm-modern .sam-form-group input:focus,
.utm-modern .sam-form-group select:focus {
    outline: none;
    border-color: var(--sam-blue-600);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* ==========================================================================
   4. BOTONES INSTITUCIONALES (.sam-btn, .sam-action-btn)
   ========================================================================== */
.sam-modern-scope .sam-btn,
.uatm-modern .sam-btn,
.utm-modern .sam-btn {
    height: 38px;
    padding: 0 18px;
    border-radius: var(--sam-radius-md);
    font-size: 13.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease-in-out;
    text-decoration: none !important;
}

.sam-modern-scope .sam-btn-primary,
.uatm-modern .sam-btn-primary,
.utm-modern .sam-btn-primary {
    background: var(--sam-blue-600);
    color: #ffffff !important;
    border: 1px solid var(--sam-blue-700);
}

.sam-modern-scope .sam-btn-primary:hover,
.uatm-modern .sam-btn-primary:hover,
.utm-modern .sam-btn-primary:hover {
    background: #0369a1;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.sam-modern-scope .sam-btn-secondary,
.uatm-modern .sam-btn-secondary,
.utm-modern .sam-btn-secondary {
    background: #ffffff;
    color: var(--sam-slate-700) !important;
    border: 1px solid var(--sam-slate-300);
}

.sam-modern-scope .sam-btn-secondary:hover,
.uatm-modern .sam-btn-secondary:hover,
.utm-modern .sam-btn-secondary:hover {
    background: var(--sam-slate-100);
    border-color: var(--sam-slate-400);
}

.sam-modern-scope .sam-action-btn,
.uatm-modern .sam-action-btn,
.utm-modern .sam-action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--sam-radius-md);
    background: #ffffff;
    border: 1px solid var(--sam-slate-300);
    color: var(--sam-slate-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    text-decoration: none !important;
    transition: all 0.15s ease-in-out;
    margin: 1px;
}

.sam-modern-scope .sam-action-btn:hover,
.uatm-modern .sam-action-btn:hover,
.utm-modern .sam-action-btn:hover {
    background: var(--sam-blue-50);
    color: var(--sam-blue-600);
    border-color: var(--sam-blue-600);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
}

/* ==========================================================================
   5. PESTAÑAS INSTITUCIONALES (.sam-tab-switcher)
   ========================================================================== */
.sam-modern-scope .sam-tab-switcher,
.uatm-modern .sam-tab-switcher,
.utm-modern .sam-tab-switcher {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--sam-slate-200);
    margin-bottom: 18px;
    padding-bottom: 0;
}

.sam-modern-scope .sam-tab-btn,
.uatm-modern .sam-tab-btn,
.utm-modern .sam-tab-btn {
    padding: 10px 18px;
    border-radius: var(--sam-radius-md) var(--sam-radius-md) 0 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--sam-slate-600);
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -2px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease-in-out;
}

.sam-modern-scope .sam-tab-btn.active,
.uatm-modern .sam-tab-btn.active,
.utm-modern .sam-tab-btn.active {
    color: var(--sam-blue-600);
    background: #ffffff;
    border-color: var(--sam-slate-300);
    border-bottom: 2px solid #ffffff;
}

/* ==========================================================================
   6. TABLAS PROFESIONALES (.sam-table-card, .data_table)
   ========================================================================== */
.sam-modern-scope .sam-table-card,
.uatm-modern .sam-table-card,
.utm-modern .sam-table-card {
    background: #ffffff;
    border: 1px solid var(--sam-slate-300);
    border-radius: var(--sam-radius-lg);
    box-shadow: var(--sam-shadow-sm);
    overflow: hidden;
    margin-bottom: 20px;
}

.sam-modern-scope table.data_table,
.uatm-modern table.data_table,
.utm-modern table.data_table,
.sam-modern-scope table.sam-table,
.uatm-modern table.sam-table,
.utm-modern table.sam-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 12.5px;
    margin: 0 !important;
    background: #ffffff;
}

.sam-modern-scope table.data_table thead th,
.uatm-modern table.data_table thead th,
.utm-modern table.data_table thead th,
.sam-modern-scope table.sam-table thead th,
.uatm-modern table.sam-table thead th,
.utm-modern table.sam-table thead th {
    background-color: var(--sam-navy-900) !important;
    color: #ffffff !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    padding: 10px 12px !important;
    border: none !important;
    text-align: left;
}

.sam-modern-scope table.data_table tbody td,
.uatm-modern table.data_table tbody td,
.utm-modern table.data_table tbody td,
.sam-modern-scope table.sam-table tbody td,
.uatm-modern table.sam-table tbody td,
.utm-modern table.sam-table tbody td {
    padding: 9px 12px !important;
    border-bottom: 1px solid var(--sam-slate-200) !important;
    color: var(--sam-slate-800);
    vertical-align: middle;
}

.sam-modern-scope table.data_table tbody tr:nth-child(even),
.uatm-modern table.data_table tbody tr:nth-child(even),
.utm-modern table.data_table tbody tr:nth-child(even),
.sam-modern-scope table.sam-table tbody tr:nth-child(even),
.uatm-modern table.sam-table tbody tr:nth-child(even),
.utm-modern table.sam-table tbody tr:nth-child(even) {
    background-color: var(--sam-slate-50);
}

.sam-modern-scope table.data_table tbody tr:hover,
.uatm-modern table.data_table tbody tr:hover,
.utm-modern table.data_table tbody tr:hover,
.sam-modern-scope table.sam-table tbody tr:hover,
.uatm-modern table.sam-table tbody tr:hover,
.utm-modern table.sam-table tbody tr:hover {
    background-color: var(--sam-blue-50) !important;
}

/* ==========================================================================
   7. ESTADOS VACÍOS (.sam-empty-state)
   ========================================================================== */
.sam-modern-scope .sam-empty-state,
.uatm-modern .sam-empty-state,
.utm-modern .sam-empty-state {
    padding: 40px 24px;
    text-align: center;
    background: #ffffff;
    border: 1px dashed var(--sam-slate-300);
    border-radius: var(--sam-radius-lg);
    margin: 16px 0;
}

.sam-modern-scope .sam-empty-icon,
.uatm-modern .sam-empty-icon,
.utm-modern .sam-empty-icon {
    font-size: 38px;
    color: var(--sam-slate-400);
    margin-bottom: 12px;
    display: inline-block;
}

.sam-modern-scope .sam-empty-title,
.uatm-modern .sam-empty-title,
.utm-modern .sam-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--sam-slate-800);
    margin: 0 0 6px 0;
}

.sam-modern-scope .sam-empty-desc,
.uatm-modern .sam-empty-desc,
.utm-modern .sam-empty-desc {
    font-size: 13px;
    color: var(--sam-slate-500);
    max-width: 440px;
    margin: 0 auto;
    line-height: 1.45;
}

/* ==========================================================================
   8. ALERTAS Y MENSAJES (.sam-alert)
   ========================================================================== */
.sam-modern-scope .sam-alert,
.uatm-modern .sam-alert,
.utm-modern .sam-alert {
    padding: 12px 16px;
    border-radius: var(--sam-radius-md);
    margin-bottom: 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}

.sam-modern-scope .sam-alert-success,
.uatm-modern .sam-alert-success,
.utm-modern .sam-alert-success {
    background-color: var(--sam-success-50);
    border-color: rgba(22, 163, 74, 0.25);
    color: #15803d;
}

.sam-modern-scope .sam-alert-error,
.uatm-modern .sam-alert-error,
.utm-modern .sam-alert-error {
    background-color: var(--sam-error-50);
    border-color: rgba(220, 38, 38, 0.25);
    color: #b91c1c;
}

.sam-modern-scope .sam-alert-warning,
.uatm-modern .sam-alert-warning,
.utm-modern .sam-alert-warning {
    background-color: var(--sam-warning-50);
    border-color: rgba(217, 119, 6, 0.25);
    color: #b45309;
}

.sam-modern-scope .sam-alert-info,
.uatm-modern .sam-alert-info,
.utm-modern .sam-alert-info {
    background-color: var(--sam-blue-50);
    border-color: rgba(2, 132, 199, 0.25);
    color: #0369a1;
}

/* ==========================================================================
   9. INTERRUPTORES Y SWITCHES (.sam-switch)
   ========================================================================== */
.sam-modern-scope .sam-switch,
.uatm-modern .sam-switch,
.utm-modern .sam-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    vertical-align: middle;
}

.sam-modern-scope .sam-switch input,
.uatm-modern .sam-switch input,
.utm-modern .sam-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.sam-modern-scope .sam-switch-slider,
.uatm-modern .sam-switch-slider,
.utm-modern .sam-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--sam-slate-300);
    transition: .2s;
    border-radius: 24px;
}

.sam-modern-scope .sam-switch-slider:before,
.uatm-modern .sam-switch-slider:before,
.utm-modern .sam-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .2s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.sam-modern-scope .sam-switch input:checked + .sam-switch-slider,
.uatm-modern .sam-switch input:checked + .sam-switch-slider,
.utm-modern .sam-switch input:checked + .sam-switch-slider {
    background-color: var(--sam-blue-600);
}

.sam-modern-scope .sam-switch input:checked + .sam-switch-slider:before,
.uatm-modern .sam-switch input:checked + .sam-switch-slider:before,
.utm-modern .sam-switch input:checked + .sam-switch-slider:before {
    transform: translateX(20px);
}

/* ==========================================================================
   10. CONTENEDORES DE REPORTE Y RESPONSIVE
   ========================================================================== */
.sam-modern-scope .sam-report-preview,
.uatm-modern .sam-report-preview,
.utm-modern .sam-report-preview {
    background: #ffffff;
    border: 1px solid var(--sam-slate-300);
    border-radius: var(--sam-radius-lg);
    padding: 16px;
    margin-top: 16px;
    min-height: 120px;
}

/* Responsividad para móviles y tabletas */
@media (max-width: 1024px) {
    .sam-modern-scope .sam-form-row,
    .uatm-modern .sam-form-row,
    .utm-modern .sam-form-row {
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .sam-modern-scope .sam-module-header,
    .uatm-modern .sam-module-header,
    .utm-modern .sam-module-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 18px;
    }
    
    .sam-modern-scope .sam-form-group,
    .uatm-modern .sam-form-group,
    .utm-modern .sam-form-group {
        flex: 1 1 100%;
        min-width: 100%;
    }
    
    .sam-modern-scope .sam-btn,
    .uatm-modern .sam-btn,
    .utm-modern .sam-btn {
        width: 100%;
    }
}

/* Accesibilidad: Reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
    .sam-modern-scope *,
    .uatm-modern *,
    .utm-modern * {
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
    }
}

/* ==========================================================================
   11. COMPONENTES CANÓNICOS DEL SISTEMA DE DISEÑO (FASE 3)
   ========================================================================== */

/* Contenedor de Página (.sam-page) */
.sam-modern-scope .sam-page,
.uatm-modern.sam-page,
.utm-modern.sam-page,
.uatm-modern .sam-page,
.utm-modern .sam-page {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--sam-space-12) var(--sam-space-16);
    box-sizing: border-box;
}

/* Encabezado de Página (.sam-page-header) */
.sam-modern-scope .sam-page-header,
.uatm-modern .sam-page-header,
.utm-modern .sam-page-header {
    background: linear-gradient(135deg, var(--sam-navy-900) 0%, var(--sam-blue-900) 60%, var(--sam-blue-600) 100%);
    color: #ffffff;
    border-radius: var(--sam-radius-lg);
    padding: var(--sam-space-16) var(--sam-space-24);
    margin-bottom: var(--sam-space-24);
    box-shadow: var(--sam-shadow-navy);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--sam-space-12);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sam-modern-scope .sam-page-header .sam-header-left,
.uatm-modern .sam-page-header .sam-header-left,
.utm-modern .sam-page-header .sam-header-left {
    display: flex;
    align-items: center;
    gap: var(--sam-space-12);
}

.sam-modern-scope .sam-page-header .sam-header-icon,
.uatm-modern .sam-page-header .sam-header-icon,
.utm-modern .sam-page-header .sam-header-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--sam-radius-md);
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    color: #ffffff;
}

.sam-modern-scope .sam-page-header h1,
.uatm-modern .sam-page-header h1,
.utm-modern .sam-page-header h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.sam-modern-scope .sam-page-header p,
.uatm-modern .sam-page-header p,
.utm-modern .sam-page-header p {
    margin: 3px 0 0 0;
    font-size: 13px;
    color: var(--sam-blue-100);
    opacity: 0.95;
    line-height: 1.35;
}

/* Cuadrículas de Formulario Responsivas (.sam-form-grid) */
.sam-modern-scope .sam-form-grid,
.uatm-modern .sam-form-grid,
.utm-modern .sam-form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--sam-space-16);
    margin-bottom: var(--sam-space-16);
    align-items: end;
}

.sam-modern-scope .sam-cols-1,
.uatm-modern .sam-cols-1,
.utm-modern .sam-cols-1 {
    grid-template-columns: 1fr;
}

.sam-modern-scope .sam-cols-2,
.uatm-modern .sam-cols-2,
.utm-modern .sam-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.sam-modern-scope .sam-cols-3,
.uatm-modern .sam-cols-3,
.utm-modern .sam-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.sam-modern-scope .sam-cols-4,
.uatm-modern .sam-cols-4,
.utm-modern .sam-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.sam-modern-scope .sam-col-span-12, .uatm-modern .sam-col-span-12, .utm-modern .sam-col-span-12 { grid-column: span 12; }
.sam-modern-scope .sam-col-span-8,  .uatm-modern .sam-col-span-8,  .utm-modern .sam-col-span-8  { grid-column: span 8; }
.sam-modern-scope .sam-col-span-6,  .uatm-modern .sam-col-span-6,  .utm-modern .sam-col-span-6  { grid-column: span 6; }
.sam-modern-scope .sam-col-span-4,  .uatm-modern .sam-col-span-4,  .utm-modern .sam-col-span-4  { grid-column: span 4; }
.sam-modern-scope .sam-col-span-3,  .uatm-modern .sam-col-span-3,  .utm-modern .sam-col-span-3  { grid-column: span 3; }
.sam-modern-scope .sam-col-span-2,  .uatm-modern .sam-col-span-2,  .utm-modern .sam-col-span-2  { grid-column: span 2; }

@media (max-width: 1024px) {
    .sam-modern-scope .sam-cols-4, .uatm-modern .sam-cols-4, .utm-modern .sam-cols-4,
    .sam-modern-scope .sam-cols-3, .uatm-modern .sam-cols-3, .utm-modern .sam-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .sam-modern-scope .sam-col-span-4, .uatm-modern .sam-col-span-4, .utm-modern .sam-col-span-4,
    .sam-modern-scope .sam-col-span-3, .uatm-modern .sam-col-span-3, .utm-modern .sam-col-span-3 {
        grid-column: span 6;
    }
}

@media (max-width: 768px) {
    .sam-modern-scope .sam-form-grid, .uatm-modern .sam-form-grid, .utm-modern .sam-form-grid,
    .sam-modern-scope .sam-cols-2, .uatm-modern .sam-cols-2, .utm-modern .sam-cols-2,
    .sam-modern-scope .sam-cols-3, .uatm-modern .sam-cols-3, .utm-modern .sam-cols-3,
    .sam-modern-scope .sam-cols-4, .uatm-modern .sam-cols-4, .utm-modern .sam-cols-4 {
        grid-template-columns: 1fr;
    }
    .sam-modern-scope .sam-col-span-12, .uatm-modern .sam-col-span-12, .utm-modern .sam-col-span-12,
    .sam-modern-scope .sam-col-span-8,  .uatm-modern .sam-col-span-8,  .utm-modern .sam-col-span-8,
    .sam-modern-scope .sam-col-span-6,  .uatm-modern .sam-col-span-6,  .utm-modern .sam-col-span-6,
    .sam-modern-scope .sam-col-span-4,  .uatm-modern .sam-col-span-4,  .utm-modern .sam-col-span-4,
    .sam-modern-scope .sam-col-span-3,  .uatm-modern .sam-col-span-3,  .utm-modern .sam-col-span-3,
    .sam-modern-scope .sam-col-span-2,  .uatm-modern .sam-col-span-2,  .utm-modern .sam-col-span-2 {
        grid-column: span 1;
    }
}

/* Campo Individual (.sam-field) */
.sam-modern-scope .sam-field,
.uatm-modern .sam-field,
.utm-modern .sam-field {
    display: flex;
    flex-direction: column;
    gap: var(--sam-space-4);
    width: 100%;
}

.sam-modern-scope .sam-field label,
.uatm-modern .sam-field label,
.utm-modern .sam-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--sam-slate-700);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sam-modern-scope .sam-field input[type="text"],
.sam-modern-scope .sam-field input[type="number"],
.sam-modern-scope .sam-field input[type="password"],
.sam-modern-scope .sam-field select,
.sam-modern-scope .sam-field textarea,
.uatm-modern .sam-field input[type="text"],
.uatm-modern .sam-field input[type="number"],
.uatm-modern .sam-field input[type="password"],
.uatm-modern .sam-field select,
.uatm-modern .sam-field textarea,
.utm-modern .sam-field input[type="text"],
.utm-modern .sam-field input[type="number"],
.utm-modern .sam-field input[type="password"],
.utm-modern .sam-field select,
.utm-modern .sam-field textarea {
    height: var(--sam-input-height);
    padding: var(--sam-space-8) var(--sam-space-12);
    border: 1px solid var(--sam-slate-300);
    border-radius: var(--sam-radius-md);
    background-color: #ffffff;
    font-size: 13.5px;
    color: var(--sam-slate-900);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    width: 100%;
    box-sizing: border-box;
}

.sam-modern-scope .sam-field textarea,
.uatm-modern .sam-field textarea,
.utm-modern .sam-field textarea {
    height: auto;
    min-height: 80px;
    resize: vertical;
}

.sam-modern-scope .sam-field input:focus,
.sam-modern-scope .sam-field select:focus,
.sam-modern-scope .sam-field textarea:focus,
.uatm-modern .sam-field input:focus,
.uatm-modern .sam-field select:focus,
.uatm-modern .sam-field textarea:focus,
.utm-modern .sam-field input:focus,
.utm-modern .sam-field select:focus,
.utm-modern .sam-field textarea:focus {
    outline: none;
    border-color: var(--sam-blue-600);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.sam-modern-scope .sam-field input:disabled,
.sam-modern-scope .sam-field select:disabled,
.uatm-modern .sam-field input:disabled,
.uatm-modern .sam-field select:disabled,
.utm-modern .sam-field input:disabled,
.utm-modern .sam-field select:disabled {
    background-color: var(--sam-slate-100);
    color: var(--sam-slate-400);
    cursor: not-allowed;
    border-color: var(--sam-slate-200);
}

.sam-modern-scope .sam-field-helper,
.uatm-modern .sam-field-helper,
.utm-modern .sam-field-helper {
    font-size: 11.5px;
    color: var(--sam-slate-500);
    margin-top: 2px;
}

.sam-modern-scope .sam-field-error,
.uatm-modern .sam-field-error,
.utm-modern .sam-field-error {
    font-size: 11.5px;
    color: var(--sam-error-600);
    margin-top: 2px;
    font-weight: 500;
}

/* Barra de Herramientas y Acciones (.sam-toolbar, .sam-action-group) */
.sam-modern-scope .sam-toolbar,
.uatm-modern .sam-toolbar,
.utm-modern .sam-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--sam-space-12);
    margin-bottom: var(--sam-space-16);
    padding: var(--sam-space-8) 0;
}

.sam-modern-scope .sam-action-group,
.uatm-modern .sam-action-group,
.utm-modern .sam-action-group {
    display: inline-flex;
    align-items: center;
    gap: var(--sam-space-8);
    flex-wrap: wrap;
}

/* Badges Institucionales (.sam-badge) */
.sam-modern-scope .sam-badge,
.uatm-modern .sam-badge,
.utm-modern .sam-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    border: 1px solid transparent;
}

.sam-modern-scope .sam-badge-success, .uatm-modern .sam-badge-success, .utm-modern .sam-badge-success {
    background-color: var(--sam-success-50);
    color: #15803d;
    border-color: rgba(22, 163, 74, 0.25);
}

.sam-modern-scope .sam-badge-warning, .uatm-modern .sam-badge-warning, .utm-modern .sam-badge-warning {
    background-color: var(--sam-warning-50);
    color: #b45309;
    border-color: rgba(217, 119, 6, 0.25);
}

.sam-modern-scope .sam-badge-danger, .uatm-modern .sam-badge-danger, .utm-modern .sam-badge-danger {
    background-color: var(--sam-error-50);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.25);
}

.sam-modern-scope .sam-badge-info, .uatm-modern .sam-badge-info, .utm-modern .sam-badge-info {
    background-color: var(--sam-blue-50);
    color: #0369a1;
    border-color: rgba(2, 132, 199, 0.25);
}

.sam-modern-scope .sam-badge-neutral, .uatm-modern .sam-badge-neutral, .utm-modern .sam-badge-neutral {
    background-color: var(--sam-slate-100);
    color: var(--sam-slate-700);
    border-color: var(--sam-slate-200);
}

/* Estado de Carga (.sam-loading-state) */
.sam-modern-scope .sam-loading-state,
.uatm-modern .sam-loading-state,
.utm-modern .sam-loading-state {
    padding: var(--sam-space-32) var(--sam-space-16);
    text-align: center;
    background: #ffffff;
    border: 1px solid var(--sam-slate-200);
    border-radius: var(--sam-radius-lg);
    margin: var(--sam-space-16) 0;
}

.sam-modern-scope .sam-loading-spinner,
.uatm-modern .sam-loading-spinner,
.utm-modern .sam-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--sam-slate-200);
    border-top-color: var(--sam-blue-600);
    border-radius: 50%;
    animation: sam-spin 0.8s linear infinite;
    margin: 0 auto var(--sam-space-12) auto;
}

@keyframes sam-spin {
    to { transform: rotate(360deg); }
}

.sam-modern-scope .sam-loading-text,
.uatm-modern .sam-loading-text,
.utm-modern .sam-loading-text {
    font-size: 13.5px;
    color: var(--sam-slate-600);
    font-weight: 500;
}

/* Estado de Error (.sam-error-state) */
.sam-modern-scope .sam-error-state,
.uatm-modern .sam-error-state,
.utm-modern .sam-error-state {
    padding: var(--sam-space-32) var(--sam-space-16);
    text-align: center;
    background: var(--sam-error-50);
    border: 1px solid rgba(220, 38, 38, 0.25);
    border-radius: var(--sam-radius-lg);
    margin: var(--sam-space-16) 0;
}

.sam-modern-scope .sam-error-icon,
.uatm-modern .sam-error-icon,
.utm-modern .sam-error-icon {
    font-size: 34px;
    color: var(--sam-error-600);
    margin-bottom: var(--sam-space-8);
}

.sam-modern-scope .sam-error-title,
.uatm-modern .sam-error-title,
.utm-modern .sam-error-title {
    font-size: 15px;
    font-weight: 600;
    color: #991b1b;
    margin: 0 0 4px 0;
}

.sam-modern-scope .sam-error-desc,
.uatm-modern .sam-error-desc,
.utm-modern .sam-error-desc {
    font-size: 13px;
    color: #7f1d1d;
    max-width: 440px;
    margin: 0 auto;
}

/* Panel de Detalle / Propiedades (.sam-detail-panel) */
.sam-modern-scope .sam-detail-panel,
.uatm-modern .sam-detail-panel,
.utm-modern .sam-detail-panel {
    background: #ffffff;
    border: 1px solid var(--sam-slate-200);
    border-radius: var(--sam-radius-lg);
    padding: var(--sam-space-16) var(--sam-space-24);
    margin-bottom: var(--sam-space-16);
}

.sam-modern-scope .sam-detail-grid,
.uatm-modern .sam-detail-grid,
.utm-modern .sam-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--sam-space-12) var(--sam-space-16);
}

.sam-modern-scope .sam-detail-item,
.uatm-modern .sam-detail-item,
.utm-modern .sam-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sam-modern-scope .sam-detail-label,
.uatm-modern .sam-detail-label,
.utm-modern .sam-detail-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--sam-slate-500);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.sam-modern-scope .sam-detail-value,
.uatm-modern .sam-detail-value,
.utm-modern .sam-detail-value {
    font-size: 13.5px;
    color: var(--sam-slate-900);
    font-weight: 600;
}

/* Pestañas Canónicas (.sam-tabs) */
.sam-modern-scope .sam-tabs,
.uatm-modern .sam-tabs,
.utm-modern .sam-tabs {
    display: flex;
    gap: var(--sam-space-8);
    border-bottom: 2px solid var(--sam-slate-200);
    margin-bottom: var(--sam-space-16);
    padding-bottom: 0;
}

.sam-modern-scope .sam-tab-item,
.uatm-modern .sam-tab-item,
.utm-modern .sam-tab-item {
    padding: var(--sam-space-8) var(--sam-space-16);
    font-size: 13px;
    font-weight: 600;
    color: var(--sam-slate-600);
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease-in-out;
}

.sam-modern-scope .sam-tab-item:hover,
.uatm-modern .sam-tab-item:hover,
.utm-modern .sam-tab-item:hover {
    color: var(--sam-blue-600);
}

.sam-modern-scope .sam-tab-item.active,
.uatm-modern .sam-tab-item.active,
.utm-modern .sam-tab-item.active {
    color: var(--sam-blue-600);
    border-bottom-color: var(--sam-blue-600);
    font-weight: 700;
}

/* Contenido de Modales (.sam-modal-content) */
.sam-modal-content {
    background: #ffffff;
    border-radius: var(--sam-radius-lg);
    box-shadow: var(--sam-shadow-lg);
    padding: 0;
    overflow: hidden;
    color: var(--sam-slate-900);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 13px;
}

.sam-modal-header {
    background: var(--sam-navy-900);
    color: #ffffff;
    padding: var(--sam-space-12) var(--sam-space-16);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sam-modal-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sam-modal-body {
    padding: var(--sam-space-24);
    max-height: 75vh;
    overflow-y: auto;
}

.sam-modal-footer {
    padding: var(--sam-space-12) var(--sam-space-16);
    background: var(--sam-slate-50);
    border-top: 1px solid var(--sam-slate-200);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sam-space-8);
}

/* ==========================================================================
   12. NAVEGACIÓN INSTITUCIONAL MODERNA (CANÓNICO SAM 2026)
   ========================================================================== */

/* Ocultar aviso intrusivo legacy del menú */
#mensaje_menu {
    display: none !important;
}

/* Sidebar Institucional */
#sidebar_div,
#sidebar_div #sidebar {
    background-color: var(--sam-navy-900) !important;
    border-right: 1px solid var(--sam-navy-800) !important;
    box-shadow: none !important;
}

#sidebar #sidebar_menu {
    background-color: var(--sam-navy-900) !important;
}

#sidebar #sidebar_menu .menu_item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: background-color 0.15s ease-in-out;
}

#sidebar #sidebar_menu .menu_item.menu,
#sidebar #sidebar_menu #dvBarraMenu {
    background: var(--sam-navy-800) !important;
    padding: 12px 14px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

#sidebar #sidebar_menu .menu_item.menu .title,
#sidebar #sidebar_menu #dvBarraMenu a .title {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
}

#sidebar #sidebar_menu .menu_item a.opcion_menu {
    color: #cbd5e1 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 10px 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: transparent !important;
    text-shadow: none !important;
    box-shadow: none !important;
    transition: color 0.15s ease, background-color 0.15s ease;
}

#sidebar #sidebar_menu .menu_item a.opcion_menu:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
}

#sidebar #sidebar_menu .menu_item.active a.opcion_menu {
    background-color: var(--sam-blue-600) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

#sidebar #sidebar_menu .menu_item .number {
    background: var(--sam-blue-600) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 2px 8px !important;
    border-radius: 9999px !important;
    border: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Submenús Flyout Modernos */
#sidebar #sidebar_menu .sub_menu,
#sidebar #sidebar_menu > ul.sub_menu {
    background-color: #0b192c !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
    padding: 6px 0 !important;
    list-style: none !important;
}

#sidebar #sidebar_menu .sub_menu li,
#sidebar #sidebar_menu > ul.sub_menu li {
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#sidebar #sidebar_menu .sub_menu li a,
#sidebar #sidebar_menu > ul.sub_menu li a {
    color: #cbd5e1 !important;
    font-size: 12.5px !important;
    padding: 8px 18px !important;
    display: block !important;
    background: transparent !important;
    text-shadow: none !important;
    transition: all 0.15s ease !important;
}

#sidebar #sidebar_menu .sub_menu li a:hover,
#sidebar #sidebar_menu > ul.sub_menu li a:hover {
    color: #ffffff !important;
    background-color: var(--sam-blue-600) !important;
    padding-left: 22px !important;
}

/* Cabecera Superior Institucional (Navy Canónico) */
#principal #header,
#header {
    background: var(--sam-navy-900) !important;
    background-image: none !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18) !important;
    min-height: 52px !important;
    height: 52px !important;
    position: relative !important;
}

#header::before,
#header::after {
    display: none !important;
}

#principal #header ul#header_menu,
#header ul#header_menu {
    margin: 0 !important;
    padding: 0 16px !important;
    display: flex !important;
    align-items: center !important;
    list-style: none !important;
    height: 100% !important;
    background: transparent !important;
}

#principal #header ul#header_menu > li,
#header ul#header_menu > li {
    float: none !important;
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

#principal #header ul#header_menu > li.left_item a,
#header ul#header_menu > li.left_item a {
    color: #94a3b8 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 8px 16px !important;
    margin: 0 2px !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    transition: all 0.15s ease-in-out !important;
    background: transparent !important;
    text-shadow: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

/* Ocultar permanentemente tituloHeader en todo el sistema para evitar cajas flotantes */
#tituloHeader,
.container .box > #tituloHeader,
.box > #tituloHeader,
div#tituloHeader.head,
.head.descripcion {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: hidden !important;
    visibility: hidden !important;
    position: absolute !important;
    top: -9999px !important;
}

#principal #header ul#header_menu > li.left_item:hover a,
#header ul#header_menu > li.left_item:hover a {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

#principal #header ul#header_menu > li.left_item.modulo_actual a,
#header ul#header_menu > li.left_item.modulo_actual a {
    color: #ffffff !important;
    background: var(--sam-blue-600) !important;
    border: none !important;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35) !important;
}

/* El logo de inicio nunca debe tener fondo ni borde de tab activo */
#principal #header ul#header_menu > li.left_item.inicio,
#header ul#header_menu > li.left_item.inicio,
#principal #header ul#header_menu > li.left_item.inicio.modulo_actual,
#header ul#header_menu > li.left_item.inicio.modulo_actual {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#principal #header ul#header_menu > li.left_item.inicio a,
#header ul#header_menu > li.left_item.inicio a,
#principal #header ul#header_menu > li.left_item.inicio.modulo_actual a,
#header ul#header_menu > li.left_item.inicio.modulo_actual a {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 14px 0 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
}

#principal #header ul#header_menu > li.left_item.inicio img,
#header ul#header_menu > li.left_item.inicio img {
    height: 38px !important;
    max-height: 38px !important;
    width: auto !important;
    max-width: 52px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

#principal #header ul#header_menu > li.right_item,
#header ul#header_menu > li.right_item {
    margin-left: auto !important;
    position: relative !important;
}

#principal #header ul#header_menu > li.right_item a.opcion_menu_salir,
#header ul#header_menu > li.right_item a.opcion_menu_salir {
    color: #e2e8f0 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 7px 14px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    text-shadow: none !important;
}

#principal #header ul#header_menu > li.right_item a.opcion_menu_salir:hover,
#header ul#header_menu > li.right_item a.opcion_menu_salir:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

/* Dropdown del usuario en la cabecera */
#principal #header ul#header_menu > li.right_item ul,
#header ul#header_menu > li.right_item ul {
    background-color: #0b192c !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
    padding: 6px 0 !important;
    top: 50px !important;
    right: 0 !important;
    left: auto !important;
    width: 200px !important;
}

#principal #header ul#header_menu > li.right_item ul li a,
#header ul#header_menu > li.right_item ul li a {
    color: #cbd5e1 !important;
    padding: 9px 16px !important;
    font-size: 13px !important;
    border: none !important;
    display: block !important;
    background: transparent !important;
    text-shadow: none !important;
    transition: all 0.15s ease !important;
}

#principal #header ul#header_menu > li.right_item ul li a:hover,
#header ul#header_menu > li.right_item ul li a:hover {
    background-color: var(--sam-blue-600) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   14. INTEGRACIÓN Y ARMONIZACIÓN GROCERYCRUD / FLEXIGRID (SAM 2026)
   ========================================================================== */
.sam-table-card .flexigrid,
.uatm-modern .flexigrid,
.utm-modern .flexigrid,
.mercado-modern .flexigrid,
.cementerio-modern .flexigrid {
    border: 1px solid var(--sam-slate-200) !important;
    border-radius: var(--sam-radius-md) !important;
    overflow: hidden !important;
    font-family: var(--sam-font-sans) !important;
    box-shadow: none !important;
    margin-top: 4px !important;
}

.sam-table-card .flexigrid div.mDiv,
.uatm-modern .flexigrid div.mDiv,
.utm-modern .flexigrid div.mDiv,
.mercado-modern .flexigrid div.mDiv,
.cementerio-modern .flexigrid div.mDiv {
    background: var(--sam-navy-900) !important;
    color: #ffffff !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border: none !important;
    letter-spacing: 0.02em !important;
}

.sam-table-card .flexigrid div.mDiv .ftitle,
.uatm-modern .flexigrid div.mDiv .ftitle,
.utm-modern .flexigrid div.mDiv .ftitle,
.mercado-modern .flexigrid div.mDiv .ftitle,
.cementerio-modern .flexigrid div.mDiv .ftitle {
    color: #ffffff !important;
    font-weight: 600 !important;
}

.sam-table-card .flexigrid div.tDiv,
.uatm-modern .flexigrid div.tDiv,
.utm-modern .flexigrid div.tDiv,
.mercado-modern .flexigrid div.tDiv,
.cementerio-modern .flexigrid div.tDiv {
    background: #ffffff !important;
    border-bottom: 1px solid var(--sam-slate-200) !important;
    padding: 10px 14px !important;
}

.sam-table-card .flexigrid div.tDiv a.fbutton,
.uatm-modern .flexigrid div.tDiv a.fbutton,
.utm-modern .flexigrid div.tDiv a.fbutton,
.mercado-modern .flexigrid div.tDiv a.fbutton,
.cementerio-modern .flexigrid div.tDiv a.fbutton {
    background: #ffffff !important;
    border: 1px solid var(--sam-slate-300) !important;
    border-radius: var(--sam-radius-sm) !important;
    padding: 6px 12px !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    color: var(--sam-slate-700) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.15s ease-in-out !important;
    cursor: pointer !important;
}

.sam-table-card .flexigrid div.tDiv a.fbutton:hover,
.uatm-modern .flexigrid div.tDiv a.fbutton:hover,
.utm-modern .flexigrid div.tDiv a.fbutton:hover,
.mercado-modern .flexigrid div.tDiv a.fbutton:hover,
.cementerio-modern .flexigrid div.tDiv a.fbutton:hover {
    background-color: var(--sam-slate-50) !important;
    border-color: var(--sam-blue-500) !important;
    color: var(--sam-blue-600) !important;
}

.sam-table-card .flexigrid div.hDiv,
.uatm-modern .flexigrid div.hDiv,
.utm-modern .flexigrid div.hDiv,
.mercado-modern .flexigrid div.hDiv,
.cementerio-modern .flexigrid div.hDiv {
    background: var(--sam-slate-100) !important;
    border-bottom: 2px solid var(--sam-slate-200) !important;
}

.sam-table-card .flexigrid div.hDiv th,
.uatm-modern .flexigrid div.hDiv th,
.utm-modern .flexigrid div.hDiv th,
.mercado-modern .flexigrid div.hDiv th,
.cementerio-modern .flexigrid div.hDiv th {
    font-size: 11.5px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    color: var(--sam-slate-700) !important;
    padding: 10px 12px !important;
}

.sam-table-card .flexigrid div.bDiv,
.uatm-modern .flexigrid div.bDiv,
.utm-modern .flexigrid div.bDiv,
.mercado-modern .flexigrid div.bDiv,
.cementerio-modern .flexigrid div.bDiv {
    overflow-x: auto !important;
    background: #ffffff !important;
}

.sam-table-card .flexigrid div.bDiv tr:hover td,
.uatm-modern .flexigrid div.bDiv tr:hover td,
.utm-modern .flexigrid div.bDiv tr:hover td,
.mercado-modern .flexigrid div.bDiv tr:hover td,
.cementerio-modern .flexigrid div.bDiv tr:hover td {
    background-color: var(--sam-blue-50) !important;
}

.sam-table-card .flexigrid div.pDiv,
.uatm-modern .flexigrid div.pDiv,
.utm-modern .flexigrid div.pDiv,
.mercado-modern .flexigrid div.pDiv,
.cementerio-modern .flexigrid div.pDiv {
    background: #ffffff !important;
    border-top: 1px solid var(--sam-slate-200) !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
    color: var(--sam-slate-600) !important;
}

