@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --surface-bg: #12141c;         /* Gris oscuro pizarra glacial */
    --surface-card: #1e2230;       /* Tarjetas en pizarra oscuro */
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;     /* Gris plateado de soporte */
    --text-muted: #64748b;          /* Gris medio */
    
    --color-primary: #10b981;      /* Verde Novua de acción digital */
    --brand-primary: #10b981;
    --color-success: #10b981;
    --color-tertiary: #0ea5e9;
    --warning-color: #f59e0b;
    --shadow-premium: 0 4px 20px rgba(0, 0, 0, 0.4);

    /* Mapeo/compatibilidad para variables existentes en la app */
    --bg-main: var(--surface-bg);
    --bg-card: rgba(30, 34, 48, 0.7);
    --bg-card-hover: rgba(40, 45, 62, 0.85);
    --border-color-active: rgba(16, 185, 129, 0.4);
    --color-primary-rgb: 16, 185, 129;
    --color-success-rgb: 16, 185, 129;
    --color-warning-rgb: 245, 158, 11;
    --color-warning: var(--warning-color);
    --color-danger: #ef4444;
    --color-danger-rgb: 239, 68, 68;
    --color-primary-hover: #059669;
    
    --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.8);
    
    --glass-blur: blur(12px);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   SISTEMA DE DISEÑO TERRA - CONFIGURACIÓN MÓDULO CLARO (MINIMALISTA)
   ========================================================================== */
/* REINGENIERÍA CROMÁTICA MODO CLARO - INSPIRACIÓN SPL LOGISTICS */
body.light-mode, html.light-mode, body.light-theme, html.light-theme {
    /* Estructuras y Fondos Glaciales */
    --surface-bg: #f4f7fa;         /* Fondo mineral frío ultra-limpio, característico de SPL */
    --surface-card: #ffffff;       /* Blanco puro nítido para destacar las tarjetas de trabajo */
    --border-color: #e2e8f0;       /* Líneas divisorias de seda fina */
    
    /* Tipografías con Peso Corporativo Marítimo */
    --text-primary: #002a54;       /* Azul Marino Profundo (SPL) para títulos, inputs y datos duros */
    --text-secondary: #475569;     /* Gris pizarra para etiquetas secundarias */
    --text-muted: #94a3b8;          /* Gris suave para textos de soporte y leyendas */
    
    /* Identidad Cruzada y Acentuación 4.0 */
    --color-primary: #10b981;      /* Verde Novua calibrado para convivir con el azul oceánico */
    --brand-primary: #002a54;      /* Estructuras principales gobernadas por el Azul Marino */
    --color-success: #166534;      /* Verde bosque para aprobación de proformas */
    --color-tertiary: #0ea5e9;     /* Azul Cian Glacial (SPL) para el tracking, DAE y alertas */
    --warning-color: #f59e0b;      /* Ámbar corporativo para estados pendientes */
    
    /* Sombras Flotantes Tecnológicas */
    --shadow-premium: 0 4px 12px -2px rgba(0, 42, 84, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);

    /* Mapeo/compatibilidad para variables existentes en la app */
    --bg-main: var(--surface-bg);
    --surface-sidebar: var(--surface-card);
    --color-primary-hover: #001a33;
    --color-brand-green: var(--color-primary);
    --color-brand-green-hover: #059669;
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-card-hover: rgba(255, 255, 255, 0.9);
    --border-color-active: rgba(0, 42, 84, 0.4);
    --color-warning: var(--warning-color);
    --color-danger: #a4161a;
    
    --shadow-sm: 0 2px 8px -2px rgba(0, 42, 84, 0.05);
    --shadow-md: 0 8px 24px -4px rgba(0, 42, 84, 0.08);
    --shadow-lg: 0 16px 40px -8px rgba(0, 42, 84, 0.12);
    
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Nunito Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Aplicación de Reglas Tipográficas Jerárquicas */
body.light-theme h1, 
body.light-theme h2, 
body.light-theme h3, 
body.light-theme h4, 
body.light-theme .card-title,
body.light-theme .stepper-title {
    font-family: 'Literata', serif !important;
    font-weight: 700;
    color: var(--text-primary);
}

/* Ajustes Estructurales Minimalistas (Tarjetas y Elementos) */
body.light-theme .card {
    background: var(--surface-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-premium) !important;
    padding: 24px !important;
}

body.light-theme .sidebar {
    background: var(--surface-sidebar) !important;
    border-right: 1px solid var(--border-color) !important;
}

body.light-theme .app-header {
    background: rgba(255, 255, 255, 0.85) !important;
    border-bottom: 1px solid var(--border-color) !important;
    backdrop-filter: var(--glass-blur);
}

body.light-theme .form-control,
body.light-theme .role-selector,
body.light-theme .stepper-order-selector {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-primary) !important;
    font-family: 'Nunito Sans', sans-serif;
}

body.light-theme .form-control:focus,
body.light-theme .role-selector:focus,
body.light-theme .stepper-order-selector:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 42, 84, 0.15) !important;
    background: #ffffff !important;
}

body.light-theme .simulator-panel {
    background: rgba(14, 165, 233, 0.06) !important;
    border: 1px solid rgba(14, 165, 233, 0.2) !important;
}

body.light-theme .btn-theme,
body.light-theme .btn-lang {
    background: rgba(0, 42, 84, 0.04) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
}

body.light-theme .btn-theme:hover,
body.light-theme .btn-lang:hover {
    background: rgba(0, 42, 84, 0.08) !important;
}

body.light-theme .table-premium th {
    background: rgba(0, 42, 84, 0.04) !important;
    color: var(--text-primary) !important;
}

body.light-theme .table-premium td {
    border-bottom: 1px solid var(--border-color) !important;
}

body.light-theme .table-premium tr:hover td {
    background: #f8fafc !important;
}

body.light-theme .file-upload-area {
    background: rgba(0, 42, 84, 0.02) !important;
    border: 1.5px dashed var(--border-color) !important;
}

body.light-theme .file-upload-area:hover {
    background: rgba(16, 185, 129, 0.04) !important;
    border-color: var(--color-primary) !important;
}

body.light-theme .modal-content {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-premium) !important;
    color: var(--text-primary) !important;
}

/* Ajustes de Botones e Interacciones */
body.light-theme .btn-primary, 
body.light-theme .btn-success {
    background: var(--color-primary) !important;
    color: #ffffff !important;
    border-radius: var(--radius-md) !important;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    border: none;
    transition: all 0.2s ease;
}

body.light-theme .btn-primary:hover, 
body.light-theme .btn-success:hover {
    background: var(--color-primary-hover) !important;
    transform: translateY(-1px);
}

body.light-theme .btn-secondary {
    background: var(--surface-sidebar) !important;
    color: var(--color-primary) !important;
    border: 1px solid var(--color-primary) !important;
    border-radius: var(--radius-md) !important;
}

body.light-theme .tab-link.active {
    color: var(--color-primary) !important;
    border-bottom-color: var(--color-primary) !important;
}

/* ==========================================================================
   OPTIMIZACIÓN DE COMPONENTES EN MODO CLARO
   ========================================================================== */
body.light-theme::-webkit-scrollbar-thumb {
    background: rgba(0, 42, 84, 0.12) !important;
}
body.light-theme::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 42, 84, 0.25) !important;
}

/* Navegación de Sidebar */
body.light-theme .nav-item:hover, 
body.light-theme .nav-item.active {
    background: rgba(0, 42, 84, 0.05) !important;
    color: var(--text-primary) !important;
}
body.light-theme .nav-item.active {
    background: linear-gradient(90deg, rgba(0, 42, 84, 0.08), transparent) !important;
    border-left-color: var(--color-primary) !important;
}

/* Stepper de Progreso */
body.light-theme .step-number {
    background: #ffffff !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}
body.light-theme .step-node.active .step-number {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: #ffffff !important;
}
body.light-theme .step-node.completed .step-number {
    background: var(--color-success) !important;
    border-color: var(--color-success) !important;
    color: #ffffff !important;
}

/* Badges e Iconos Semánticos */
body.light-theme .badge-info {
    background: rgba(14, 165, 233, 0.08) !important;
    color: var(--color-tertiary) !important;
    border: 1px solid rgba(14, 165, 233, 0.15) !important;
}
body.light-theme .badge-success {
    background: rgba(22, 163, 74, 0.08) !important;
    color: var(--color-success) !important;
    border: 1px solid rgba(22, 163, 74, 0.15) !important;
}
body.light-theme .badge-warning {
    background: rgba(245, 158, 11, 0.08) !important;
    color: var(--color-warning) !important;
    border: 1px solid rgba(245, 158, 11, 0.15) !important;
}
body.light-theme .badge-danger {
    background: rgba(220, 38, 38, 0.08) !important;
    color: var(--color-danger) !important;
    border: 1px solid rgba(220, 38, 38, 0.15) !important;
}

body.light-theme .stat-icon.primary { background: rgba(14, 165, 233, 0.08) !important; color: var(--color-tertiary) !important; }
body.light-theme .stat-icon.success { background: rgba(22, 163, 74, 0.08) !important; color: var(--color-success) !important; }
body.light-theme .stat-icon.warning { background: rgba(245, 158, 11, 0.08) !important; color: var(--color-warning) !important; }
body.light-theme .stat-icon.danger { background: rgba(220, 38, 38, 0.08) !important; color: var(--color-danger) !important; }

/* Contenedor de Documento Bloqueado */
body.light-theme .doc-locked-container {
    border: 1px solid rgba(220, 38, 38, 0.15) !important;
    background: rgba(220, 38, 38, 0.03) !important;
}
body.light-theme .doc-locked-icon {
    background: rgba(220, 38, 38, 0.08) !important;
    color: var(--color-danger) !important;
}
body.light-theme .doc-locked-details h4 {
    color: var(--color-danger) !important;
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(14, 165, 233, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.04) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Scrollbar customization - Diseño Redondeado Global */
*::-webkit-scrollbar {
    width: 10px; /* Un poco más ancho para el efecto de borde transparente */
    height: 10px;
}
*::-webkit-scrollbar-track {
    background: transparent; /* Fondo transparente */
}
*::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.3); /* Gris suave (text-secondary/muted) */
    border-radius: 10px; /* Bordes bastante redondeados */
    border: 3px solid transparent; /* Truco mágico para que el scrollbar parezca más delgado y flotante */
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
    background-color: rgba(148, 163, 184, 0.6); /* Más notorio al pasar el mouse */
    border: 3px solid transparent;
    background-clip: padding-box;
}

/* App Layout */
.app-container {
    display: grid;
    grid-template-rows: 72px 1fr;
    height: 100vh;
}

/* Header */
.app-header {
    background: rgba(6, 9, 19, 0.8);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-success));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-main);
    font-weight: 700;
    font-size: 20px;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.3);
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-subtitle {
    font-size: 10px;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: -4px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Simulator Bar */
.simulator-panel {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.simulator-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-primary);
}

.role-selector {
    background: rgba(6, 9, 19, 0.9);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.role-selector:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.btn-lang {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-lang:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

/* Main Content Area */
.main-wrapper {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: calc(100vh - 72px);
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    min-width: 260px;
    max-width: 260px;
    height: 100%;
    background: var(--surface-card, rgba(13, 20, 38, 0.4));
    border-right: 1px solid var(--border-color);
    padding: 20px 14px 8px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    border: none;
    text-align: left;
    width: 100%;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.15), transparent);
    border-left: 3px solid var(--color-primary);
    padding-left: 13px;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
}

/* Dashboards Content */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
}

/* ═══ Sticky Guidance Banner ═══ */
#novua-persistent-banner {
    flex-shrink: 0;
    z-index: 50;
    margin: 0;
    padding: 0;
}

/* ═══ v9.9.34: Chat Full Height in Right Column ═══ */
.novua-chat-fullheight {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    /* Override .novua-chat-section constraints */
    max-height: none !important;
    flex-shrink: 1 !important;
    margin-top: 0 !important;
    transition: none !important;
    border-top: none !important;
}

.novua-chat-fullheight .novua-chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.novua-chat-fullheight .novua-chat-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* ═══ v9.9.34: Audit Section in Left Sidebar ═══ */
.v-audit-sidebar-left {
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    max-height: 260px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.v-audit-sidebar-left .v-audit-section__title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
}

.v-audit-sidebar-left .v-audit-section__title:hover {
    color: var(--text-primary);
}

.v-audit-sidebar-left.collapsed .v-audit-sidebar-body {
    display: none;
}

.v-audit-sidebar-left.collapsed .v-audit-chevron {
    transform: rotate(-90deg);
}

.v-audit-sidebar-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 0 12px 10px;
}

.v-audit-sidebar-left .v-audit-order-ref {
    font-size: 10px;
    color: var(--text-secondary);
    padding: 4px 4px 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 6px;
}

.v-audit-sidebar-left .v-audit-feed {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ═══ Orders Search & Filter Bar ═══ */
.novua-orders-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    flex-wrap: wrap;
}

.novua-orders-filter-bar .novua-search-input {
    flex: 1;
    min-width: 200px;
    padding: 9px 14px 9px 36px;
    background: var(--surface-card, #1a2235);
    border: 1px solid var(--border-color, #2a3a52);
    border-radius: 8px;
    color: var(--text-primary, #e2e8f0);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.novua-orders-filter-bar .novua-search-input:focus {
    border-color: var(--color-primary, #0ea5e9);
}
.novua-orders-filter-bar .novua-search-input::placeholder {
    color: var(--text-muted, #64748b);
}

.novua-orders-filter-bar .novua-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.novua-orders-filter-bar .novua-search-wrapper svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted, #64748b);
}

.novua-orders-filter-bar .novua-filter-select {
    padding: 9px 32px 9px 12px;
    background: var(--surface-card, #1a2235);
    border: 1px solid var(--border-color, #2a3a52);
    border-radius: 8px;
    color: var(--text-primary, #e2e8f0);
    font-size: 12px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    white-space: nowrap;
    transition: border-color 0.2s;
}
.novua-orders-filter-bar .novua-filter-select:focus {
    border-color: var(--color-primary, #0ea5e9);
}


/* Stepper (Ecuadorian Export Lifecycle Progress) */
.progress-stepper {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.stepper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stepper-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stepper-title span {
    color: var(--color-primary);
}

.stepper-order-selector {
    background: rgba(6, 9, 19, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.stepper-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 0 10px;
}

.stepper-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 1;
}

.stepper-line-progress {
    position: absolute;
    top: 20px;
    left: 40px;
    width: 0%; /* Dynamic */
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-success));
    z-index: 2;
    transition: var(--transition);
}

.step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 3;
    width: 120px;
    cursor: pointer;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0d1426;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
}

.step-node:hover .step-number {
    border-color: rgba(255, 255, 255, 0.3);
}

.step-node.active .step-number {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--bg-main);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.4);
}

.step-node.completed .step-number {
    background: var(--color-success);
    border-color: var(--color-success);
    color: var(--bg-main);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.step-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.step-node.active .step-label {
    color: var(--color-primary);
}

.step-node.completed .step-label {
    color: var(--color-success);
}

.step-detail {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 400;
}

/* Dashboard Views (Hide/Show) */
.dashboard-view {
    display: none;
    animation: fadeIn 0.4s ease-out;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.dashboard-view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Grid Layouts */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-active);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.stat-icon.primary { background: rgba(14, 165, 233, 0.1); color: var(--color-primary); }
.stat-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--color-success); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--color-warning); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.1); color: var(--color-danger); }

.stat-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Sections & Panels */
.panel-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .panel-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title svg {
    width: 18px;
    height: 18px;
    color: var(--color-primary);
}

/* Forms styling */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    background: rgba(6, 9, 19, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    text-decoration: none;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #0284c7);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success), #059669);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, var(--color-warning), #d97706);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger), #dc2626);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-info { background: rgba(14, 165, 233, 0.1); color: var(--color-primary); border: 1px solid rgba(14, 165, 233, 0.2); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--color-success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--color-warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--color-danger); border: 1px solid rgba(239, 68, 68, 0.2); }

/* Tables */
.table-container {
    overflow-x: auto;
}

.table-premium {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table-premium th {
    background: rgba(255, 255, 255, 0.02);
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
}

.table-premium td {
    padding: 16px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.table-premium tr:last-child td {
    border-bottom: none;
}

.table-premium tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Product Catalog in Grid */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.product-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    transition: var(--transition);
}

.product-card:hover {
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}

.product-image-placeholder {
    height: 120px;
    background: linear-gradient(135deg, rgba(6, 9, 19, 0.6), rgba(13, 20, 38, 0.6));
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 11px;
    border: 1px dashed var(--border-color);
}

.product-image-placeholder svg {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.product-title {
    font-size: 14px;
    font-weight: 700;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-success);
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.01);
}

.upload-zone:hover {
    border-color: var(--color-primary);
    background: rgba(14, 165, 233, 0.03);
}

.upload-zone svg {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.upload-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.upload-text {
    font-size: 11px;
    color: var(--text-muted);
}

/* Document Lock Overlay */
.doc-locked-container {
    border: 1px solid rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.03);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.doc-locked-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-locked-icon svg {
    width: 24px;
    height: 24px;
}

.doc-locked-details h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-danger);
    margin-bottom: 4px;
}

.doc-locked-details p {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Activity Logger */
.activity-log {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.log-item {
    display: flex;
    gap: 12px;
    font-size: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.log-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.log-time {
    color: var(--color-primary);
    font-weight: 600;
    white-space: nowrap;
}

.log-text {
    color: var(--text-secondary);
}

/* Document Item Lists */
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.doc-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.doc-item:hover {
    border-color: var(--border-color-active);
}

.doc-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-icon {
    color: var(--color-primary);
}

.doc-name {
    font-size: 13px;
    font-weight: 600;
}

.doc-meta {
    font-size: 10px;
    color: var(--text-muted);
}

/* Onboarding view Specific */
.onboarding-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .onboarding-split {
        grid-template-columns: 1fr;
    }
}

/* Customizer Form Preview */
.customizer-preview {
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.01);
}

.customizer-preview-header {
    width: 100%;
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0d1426;
    border: 1px solid var(--border-color);
}

/* Gallery view in acopio */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.gallery-item {
    aspect-ratio: 4/3;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    background: #060913;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px;
    font-size: 10px;
    text-align: center;
}

/* Custom UI Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #0d1426;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 500px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}

/* Language styling helpers */
body[lang="es"] .lang-en { display: none !important; }
body[lang="en"] .lang-es { display: none !important; }

/* Custom Brand Styles applied dynamically */
.brand-color-accent {
    color: var(--brand-primary, var(--color-primary));
}

.brand-bg-accent {
    background-color: var(--brand-primary, var(--color-primary));
}

.brand-border-accent {
    border-color: var(--brand-primary, var(--color-primary));
}

/* Login Page Specific Styling */
.login-screen-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    width: 100vw;
    padding: 40px 20px;
    background: radial-gradient(circle at 50% 50%, #0c152b 0%, var(--bg-main) 100%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    overflow-y: auto;
    box-sizing: border-box;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: scaleIn 0.4s ease-out;
    margin: auto;
}

.register-card-wide {
    max-width: 900px !important;
}

.login-logo {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(to right, #ffffff, var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.social-login-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 24px;
}

.social-login-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
}

.social-login-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-secondary);
}

.social-login-btn svg {
    width: 20px;
    height: 20px;
}

.separator-text {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin: 20px 0;
}

.separator-text::before, .separator-text::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.separator-text:not(:empty)::before {
    margin-right: .5em;
}

.separator-text:not(:empty)::after {
    margin-left: .5em;
}

/* Quick Login Simulator bar */
.quick-login-panel {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.quick-login-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.quick-login-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.quick-login-btn {
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.2);
    color: var(--color-primary);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.quick-login-btn:hover {
    background: var(--color-primary);
    color: var(--bg-main);
}

/* Compatibility banner alert */
.compatibility-widget {
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
}

/* Form registration columns */
.register-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    text-align: left;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .register-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.register-column-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

/* ──────────────────────────────────────────────
   ESTILOS NUEVOS: FORMULARIO DE REGISTRO COMPLETO
   ────────────────────────────────────────────── */

/* Títulos de sección numerados */
.reg-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 28px 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    flex-wrap: wrap;
}

.reg-section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    min-width: 26px;
    background: var(--color-primary);
    color: #000;
    font-size: 13px;
    font-weight: 800;
    border-radius: 50%;
}

.reg-section-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    color: var(--color-warning);
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

/* Área de carga de archivos */
/* ================================================================
   UPLOAD BOX — Componente Unificado de Subida de Archivos
   Estados: vacío → hover → subido (verde)
   Variantes: documento (default) | foto (--photo)
   ================================================================ */

/* ── Base: Estado Vacío ─────────────────────────────────────────── */
.upload-box,
.file-upload-area {
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: rgba(255,255,255,0.02);
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
}

/* ── Hover: Borde cian + fondo sutil ────────────────────────────── */
.upload-box:hover,
.file-upload-area:hover {
    border-color: var(--color-primary);
    background: rgba(16, 185, 129, 0.08);
}
.upload-box:hover .upload-box__icon,
.upload-box:hover .file-upload-icon {
    color: var(--color-primary);
    transform: scale(1.08);
}

/* ── Estado "no subido" ────────────────────────────────────────── */
.upload-box__status--empty,
.file-name-label.upload-box__status--empty {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.65;
    font-style: italic;
    margin-top: 4px;
    letter-spacing: 0.01em;
}
/* ── Estado "subido": verde permanente con checkmark ─────────── */
.file-name-label:not(.upload-box__status--empty),
.upload-box__status:not(.upload-box__status--empty) {
    font-size: 10px;
    color: var(--color-success);
    font-weight: 600;
    margin-top: 4px;
}

/* ── Subido: Verde permanente ───────────────────────────────────── */
.upload-box--uploaded,
.file-upload-area.upload-box--uploaded {
    border: 1.5px solid var(--color-success) !important;
    background: rgba(16, 185, 129, 0.06) !important;
}
.upload-box--uploaded:hover,
.file-upload-area.upload-box--uploaded:hover {
    background: rgba(16, 185, 129, 0.10) !important;
    border-color: var(--color-success) !important;
}
.upload-box--uploaded .upload-box__icon,
.upload-box--uploaded .file-upload-icon {
    color: var(--color-success) !important;
}
.upload-box--uploaded .upload-box__label,
.upload-box--uploaded .file-upload-text {
    color: var(--color-success) !important;
}

/* ── Icono SVG (documento o cámara) ─────────────────────────────── */
.upload-box__icon,
.file-upload-icon {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.upload-box__icon svg,
.file-upload-icon svg {
    width: 100%;
    height: 100%;
}
/* Legacy emoji fallback — hide emoji if SVG exists inside */
.file-upload-icon:has(svg) {
    font-size: 0;
}
.file-upload-icon:not(:has(svg)) {
    font-size: 28px;
}

/* ── Texto principal: "Subir RUC PDF" ───────────────────────────── */
.upload-box__label,
.file-upload-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.25s ease;
}

/* ── Hint/formato: "PDF, JPG, PNG" ──────────────────────────────── */
.upload-box__hint,
.file-upload-hint {
    font-size: 10px;
    color: var(--text-muted);
}

/* ── Estado: nombre archivo + "(Subido)" ────────────────────────── */
.upload-box__status,
.file-name-label {
    font-size: 11px;
    color: var(--color-success);
    font-weight: 600;
    margin-top: 4px;
    word-break: break-all;
    max-width: 100%;
    transition: color 0.25s ease;
}
/* Estado vacío: "no subido" en gris */
.upload-box__status--empty {
    color: var(--text-muted) !important;
    font-weight: 400;
}

/* ── Variante Foto (icono cámara) ───────────────────────────────── */
.upload-box--photo .upload-box__icon {
    color: var(--text-muted);
}
.upload-box--photo:hover .upload-box__icon {
    color: var(--color-primary);
}
.upload-box--photo.upload-box--uploaded .upload-box__icon {
    color: var(--color-success) !important;
}

/* ── Input oculto ───────────────────────────────────────────────── */
.upload-box input[type="file"],
.file-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* ════════════════════════════════════════════════════════════════════
   OPERADOR DE ACOPIO — Grid 3×3 de Evidencia Fotográfica
   ════════════════════════════════════════════════════════════════════ */

/* ── Barra de progreso ──────────────────────────────────────────── */
.op-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(209,213,219,0.4);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 6px;
}
.op-progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    width: 0%;
}
.op-progress-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: right;
    margin-bottom: 14px;
}
.op-progress-text span {
    color: #10b981;
    font-weight: 900;
}

/* ── Grid container ─────────────────────────────────────────────── */
.op-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

/* ── Celda individual ───────────────────────────────────────────── */
.op-photo-cell {
    position: relative;
    aspect-ratio: 1;
    border-radius: 16px;
    border: 2.5px solid #d1d5db;
    background: linear-gradient(145deg, #f3f4f6, #e5e7eb);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: all 0.35s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 8px 6px;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.op-photo-cell:active {
    transform: scale(0.95);
}

/* ── Badge de número de paso ────────────────────────────────────── */
.op-photo-cell__badge {
    position: absolute;
    top: -1px;
    left: -1px;
    width: 22px;
    height: 22px;
    border-radius: 0 0 10px 0;
    font-size: 10px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background: #9ca3af;
    color: #fff;
    line-height: 1;
    transition: all 0.3s ease;
}

/* ── Icono SVG ──────────────────────────────────────────────────── */
.op-photo-cell__icon {
    width: 30px;
    height: 30px;
    color: #9ca3af;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.op-photo-cell__icon svg {
    width: 100%;
    height: 100%;
}

/* ── Nombre del paso ────────────────────────────────────────────── */
.op-photo-cell__name {
    font-size: 8.5px;
    font-weight: 800;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.15;
    text-align: center;
    transition: color 0.3s ease;
}

/* ── Micro-instrucción (siempre visible) ────────────────────────── */
.op-photo-cell__hint {
    font-size: 7px;
    font-weight: 500;
    color: #9ca3af;
    line-height: 1.2;
    text-align: center;
    font-style: italic;
    max-width: 100%;
    transition: all 0.3s ease;
    padding: 0 2px;
}

/* ════════════════════════════════════════════════════════════════════
   ESTADOS DE LAS CELDAS
   ════════════════════════════════════════════════════════════════════ */

/* ── Estado: DESHABILITADO (gris tenue, no clickeable) ──────────── */
.op-photo-cell--disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
}

/* ── Estado: PENDIENTE (gris normal, clickeable pero no activo) ── */
.op-photo-cell--pending {
    border-color: #d1d5db;
    background: linear-gradient(145deg, #f3f4f6, #e5e7eb);
}

/* ── Estado: SIGUIENTE (azul pulsante, indica "toque aquí") ────── */
.op-photo-cell--next {
    border-color: #3b82f6;
    background: linear-gradient(145deg, #eff6ff, #dbeafe);
    box-shadow: 0 0 0 0 rgba(59,130,246,0.4), 0 4px 14px rgba(59,130,246,0.15);
    animation: op-pulse-next 2s ease-in-out infinite;
    opacity: 1;
}
.op-photo-cell--next .op-photo-cell__badge {
    background: #3b82f6;
    animation: op-badge-bounce 2s ease-in-out infinite;
}
.op-photo-cell--next .op-photo-cell__icon {
    color: #2563eb;
}
.op-photo-cell--next .op-photo-cell__name {
    color: #1d4ed8;
}
.op-photo-cell--next .op-photo-cell__hint {
    color: #3b82f6;
    font-weight: 700;
    font-style: normal;
    font-size: 7.5px;
}

/* ── Estado: COMPLETADO (verde permanente) ──────────────────────── */
.op-photo-cell--done {
    border-color: #10b981;
    background: linear-gradient(145deg, #d1fae5, #a7f3d0);
    box-shadow: 0 4px 14px rgba(16,185,129,0.2);
    pointer-events: none;
}
.op-photo-cell--done .op-photo-cell__badge {
    background: #059669;
}
.op-photo-cell--done .op-photo-cell__icon {
    color: #065f46;
}
.op-photo-cell--done .op-photo-cell__name {
    color: #065f46;
    font-weight: 900;
}
.op-photo-cell--done .op-photo-cell__hint {
    color: #059669;
    font-weight: 600;
    font-style: normal;
}

/* ── Animaciones ────────────────────────────────────────────────── */
@keyframes op-pulse-next {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.4), 0 4px 14px rgba(59,130,246,0.15); }
    50% { box-shadow: 0 0 0 10px rgba(59,130,246,0), 0 4px 14px rgba(59,130,246,0.25); }
}
@keyframes op-badge-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ── CTA "TOQUE AQUÍ" badge para paso siguiente ────────────────── */
.op-photo-cell__cta {
    display: none;
    font-size: 7px;
    font-weight: 900;
    color: #fff;
    background: #3b82f6;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: op-cta-blink 1.5s ease-in-out infinite;
}
.op-photo-cell--next .op-photo-cell__cta {
    display: block;
}
@keyframes op-cta-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ════════════════════════════════════════════════════════════════════
   MODAL DE CONFIRMACIÓN DE FOTO
   ════════════════════════════════════════════════════════════════════ */
.op-photo-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}
.op-photo-confirm-modal {
    background: var(--card-bg, #fff);
    border-radius: 20px;
    max-width: 360px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.op-photo-confirm-modal__preview {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    background: #000;
}
.op-photo-confirm-modal__body {
    padding: 16px 20px;
    text-align: center;
}
.op-photo-confirm-modal__title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.op-photo-confirm-modal__subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.op-photo-confirm-modal__actions {
    display: flex;
    gap: 10px;
}
.op-photo-confirm-modal__btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}
.op-photo-confirm-modal__btn--retry {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}
.op-photo-confirm-modal__btn--retry:active {
    background: rgba(239,68,68,0.2);
}
.op-photo-confirm-modal__btn--accept {
    background: #10b981;
    color: #fff;
}
.op-photo-confirm-modal__btn--accept:active {
    background: #059669;
}

/* ── Light theme overrides ──────────────────────────────────────── */
body.light-theme .op-photo-cell--pending {
    background: linear-gradient(145deg, #f9fafb, #f3f4f6);
}
body.light-theme .op-photo-cell--next {
    background: linear-gradient(145deg, #eff6ff, #dbeafe);
}
body.light-theme .op-photo-cell--done {
    background: linear-gradient(145deg, #ecfdf5, #d1fae5);
}

/* Aviso ECUAPASS */
.ecuapass-notice {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-left: 3px solid var(--color-warning);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: left;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Tarjetas de marca */
.marcas-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
    margin-bottom: 8px;
}

.marca-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    background: rgba(255,255,255,0.02);
    position: relative;
    transition: var(--transition);
}

.marca-card:hover {
    border-color: rgba(14, 165, 233, 0.4);
    background: rgba(14, 165, 233, 0.03);
}

.marca-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.marca-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary);
}

.marca-remove-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-danger);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.marca-remove-btn:hover {
    background: var(--color-danger);
    color: white;
}

.marca-type-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.marca-type-btn {
    flex: 1;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.marca-type-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #000;
}

.marca-terceros-notice {
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

/* ancho max del formulario de registro */
.register-card-wide {
    max-width: 960px !important;
}

/* ──────────────────────────────────────────────
   ESTILOS ADICIONALES PARA LOGIN Y ONBOARDING
   ────────────────────────────────────────────── */

:root {
    --color-brand-green: #437655;
    --color-brand-green-hover: #355e43;
}

/* Rediseño del Login */
.login-card .capsule-input {
    border-radius: 24px !important;
    height: 46px !important;
    padding-left: 46px !important;
    border: 1px solid var(--border-color) !important;
    font-size: 14px !important;
    transition: var(--transition);
}

body.light-theme .login-screen-container {
    background-color: var(--bg-main) !important;
    background-image: none !important;
}

body.light-theme .login-card {
    background: var(--surface-card) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-premium) !important;
}

body.light-theme .login-card h2,
body.light-theme .login-card p,
body.light-theme .login-card label,
body.light-theme .login-card .separator-text {
    color: var(--text-primary) !important;
}

body.light-theme .login-card .separator-text::before,
body.light-theme .login-card .separator-text::after {
    border-bottom-color: var(--border-color) !important;
}

body.light-theme .login-card .form-control {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

body.light-theme .login-card .form-control:focus {
    background: #ffffff !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 42, 84, 0.15) !important;
}

/* Botones Sociales */
.social-login-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 24px;
}

.capsule-social-btn {
    border-radius: 24px !important;
    height: 42px !important;
    font-weight: 600 !important;
    border: 1px solid var(--border-color) !important;
    background: rgba(255, 255, 255, 0.02) !important;
    color: var(--text-primary) !important;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

body.light-theme .capsule-social-btn {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.capsule-social-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--text-secondary) !important;
}

body.light-theme .capsule-social-btn:hover {
    background: #f1f5f9 !important;
    border-color: rgba(0, 42, 84, 0.15) !important;
}

/* Botón Verde Corporativo */
.btn-brand-green {
    background: var(--color-brand-green) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 24px !important;
    height: 46px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-brand-green:hover {
    background: var(--color-brand-green-hover) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
}

/* Contenedor de solicitud de Onboarding */
.onboarding-request-box {
    background: rgba(16, 185, 129, 0.04) !important;
    border: 1px solid rgba(16, 185, 129, 0.1) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    margin-bottom: 24px !important;
    text-align: center;
}

body.light-theme .onboarding-request-box {
    background: #f8fafc !important;
    border: 1px solid var(--border-color) !important;
}

/* Sistema de Grillas para el Onboarding */
.onboarding-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
    text-align: left;
}

.onboarding-row .form-group {
    margin-bottom: 0;
}

.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }

@media (max-width: 768px) {
    .onboarding-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .span-1, .span-2, .span-3, .span-4 {
        grid-column: span 1;
    }
}

/* Estilización premium de upload-box / file-upload-area en modo claro */
body.light-theme .upload-box,
body.light-theme .file-upload-area {
    background: #ffffff !important;
    border: 1.5px dashed var(--border-color) !important;
    color: var(--text-secondary) !important;
}

body.light-theme .upload-box:hover,
body.light-theme .file-upload-area:hover {
    border-color: var(--color-primary) !important;
    background: rgba(16, 185, 129, 0.08) !important;
    color: var(--text-primary) !important;
}

body.light-theme .upload-box--uploaded,
body.light-theme .file-upload-area.upload-box--uploaded {
    border: 1.5px solid var(--color-success) !important;
    background: rgba(16, 185, 129, 0.05) !important;
}

body.light-theme .upload-box--uploaded:hover,
body.light-theme .file-upload-area.upload-box--uploaded:hover {
    background: rgba(16, 185, 129, 0.08) !important;
}

body.light-theme .file-name-label,
body.light-theme .upload-box__status {
    color: var(--color-success) !important;
}

/* Aviso ECUAPASS en modo claro */
body.light-theme .ecuapass-notice {
    background: #fffbeb !important;
    border: 1px solid rgba(245, 158, 11, 0.2) !important;
    border-left: 4px solid #f59e0b !important;
    color: #78350f !important;
}

/* Tarjeta de marcas premium */
.marca-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    background: rgba(255, 255, 255, 0.01);
    margin-bottom: 20px;
    transition: var(--transition);
}

body.light-theme .marca-card {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
}

body.light-theme .marca-card:hover {
    border-color: var(--color-primary) !important;
    box-shadow: 0 4px 15px rgba(0, 42, 84, 0.02) !important;
}

/* ==========================================
   4. FLOATING AI MODEL CONTROL CENTER & ADVISOR
   ========================================== */
.ai-console-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99999;
    font-family: 'Nunito Sans', sans-serif;
}

.ai-console-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 25px -5px rgba(13, 148, 136, 0.4), 0 8px 10px -6px rgba(13, 148, 136, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    padding: 0;
}

.ai-console-bubble:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 30px -5px rgba(13, 148, 136, 0.6);
}

.ai-console-bubble .bubble-icon {
    font-size: 28px;
}

.ai-console-bubble .bubble-badge {
    position: absolute;
    top: -5px;
    right: -15px;
    background: #e11d48;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 10px;
    border: 1.5px solid rgba(13, 20, 38, 1);
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.ai-console-panel {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 360px;
    height: 480px;
    background: rgba(13, 20, 38, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: panel-fade-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 3px solid var(--brand-primary);
    transition: all 0.3s ease;
}

@keyframes panel-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-panel-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.ai-panel-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    outline: none;
    transition: color 0.2s ease;
}

.ai-panel-close:hover {
    color: var(--text-primary);
}

.ai-panel-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* AI Chat bubbles */
.chat-msg {
    word-break: break-word;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-msg.ai {
    align-self: flex-start;
    background: rgba(14, 165, 233, 0.08);
    border-left: 3px solid #0ea5e9;
    color: var(--text-primary);
}

.chat-msg.user {
    align-self: flex-end;
    background: rgba(67, 118, 85, 0.15);
    border-right: 3px solid var(--color-success);
    color: var(--text-primary);
    max-width: 85%;
}

/* Light Theme overrides */
body.light-theme .ai-console-panel {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 42, 84, 0.05), 0 10px 10px -5px rgba(0, 42, 84, 0.02) !important;
}

body.light-theme .ai-panel-header {
    background: rgba(0, 42, 84, 0.02) !important;
    border-bottom-color: var(--border-color) !important;
}

body.light-theme .ai-stat-item {
    background: #f8fafc !important;
    border-color: var(--border-color) !important;
}

body.light-theme .chat-msg.ai {
    background: rgba(14, 165, 233, 0.05) !important;
}

body.light-theme .chat-msg.user {
    background: rgba(0, 42, 84, 0.05) !important;
}

body.light-theme .ai-console-bubble .bubble-badge {
    border-color: #ffffff !important;
}

/* ==========================================================================
   SOLUCIÓN RADICAL PARA MENÚS DESPLEGABLES (SELECT Y OPTION) Y CAMPOS DE TEXTO
   ========================================================================== */

/* Selector Premium Unificado */
select.form-control, 
select.role-selector, 
select.stepper-order-select,
select.stepper-order-selector,
#select-final-incoterm,
#onboard-geo-region,
#onboard-geo-province,
#onboard-geo-city {
    background-color: var(--surface-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    padding: 10px 36px 10px 12px !important;
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
    transition: all 0.2s ease;
    
    /* Eliminar diseño nativo del navegador */
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    
    /* Icono de flecha premium personalizado en SVG (Color Verde Oliva de la marca) */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234a7c59' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 14px !important;
}

/* Efecto de Enfoque / Focus */
select.form-control:focus,
select.role-selector:focus,
select.stepper-order-selector:focus,
select.stepper-order-select:focus {
    border-color: var(--color-primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.15) !important;
}

/* OBLIGAR A LAS OPCIONES DESPLEGADAS A SER HERMOSAS Y LEGIBLES */
select.form-control option,
select.role-selector option,
select option {
    background-color: var(--surface-card) !important;
    color: var(--text-primary) !important;
    font-weight: 500;
    padding: 12px !important;
}

/* Corrección complementaria para campos deshabilitados (disabled) */
select:disabled, input:disabled {
    background-color: rgba(0, 0, 0, 0.15) !important;
    color: var(--text-muted) !important;
    border-color: var(--border-color) !important;
    cursor: not-allowed;
    opacity: 0.6;
}
body.light-mode select:disabled, body.light-mode input:disabled,
body.light-theme select:disabled, body.light-theme input:disabled {
    background-color: #e2e8f0 !important;
}

/* COMPLEMENTO DE ARMONÍA VISUAL PARA CONTENEDORES EN MODO CLARO */
body.light-mode .card, body.light-theme .card, 
body.light-mode .sidebar, body.light-theme .sidebar, 
body.light-mode .vertical-timeline-sidebar, body.light-theme .vertical-timeline-sidebar {
    background-color: var(--surface-card) !important;
    border-color: var(--border-color) !important;
    box-shadow: var(--shadow-premium) !important;
}

/* BLINDAJE DE ARMONÍA EN LOS MENÚS DESPLEGABLES PARA MODO CLARO */
body.light-mode select.form-control, body.light-theme select.form-control,
body.light-mode #stepper-order-select, body.light-theme #stepper-order-select,
body.light-mode #select-final-incoterm, body.light-theme #select-final-incoterm {
    background-color: #ffffff !important;
    color: #002a54 !important; /* Texto en Azul Marino Profundo */
    border: 1px solid #e2e8f0 !important;
    /* Flecha estilizada en Azul Cian Glacial de SPL */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230ea5e9' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

body.light-mode select.form-control option, body.light-theme select.form-control option {
    background-color: #ffffff !important;
    color: #002a54 !important;
}

/* COMPLEMENTO DE TABLAS PREMIUM EN MODO CLARO */
body.light-mode .table-premium thead th, body.light-theme .table-premium thead th {
    background-color: #edf2f7 !important;
    color: #002a54 !important; /* Cabeceras de tabla en Azul Marino */
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0 !important;
}

body.light-mode .table-premium tbody tr:hover, body.light-theme .table-premium tbody tr:hover {
    background-color: #f8fafc !important;
}

/* Ajuste del Historial de Auditoría Derecho en Modo Claro */
body.light-mode .timeline-sidebar-notifications, body.light-theme .timeline-sidebar-notifications {
    background: #edf2f7 !important;
}
body.light-mode #timeline-live-alerts > div, body.light-theme #timeline-live-alerts > div {
    background: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 42, 84, 0.03) !important;
}
body.light-mode #timeline-live-alerts div, body.light-theme #timeline-live-alerts div {
    color: #0f172a !important;
}


/* ============================================
   NOVUA TOOLTIP SYSTEM — Contextual Help
   ============================================ */
.novua-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(14,165,233,0.15);
    color: var(--color-primary);
    font-size: 9px;
    font-weight: 800;
    font-style: normal;
    cursor: help;
    margin-left: 5px;
    position: relative;
    vertical-align: middle;
    border: 1px solid rgba(14,165,233,0.3);
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
    user-select: none;
}
.novua-help:hover {
    background: rgba(14,165,233,0.3);
    transform: scale(1.15);
}
.novua-help .novua-tip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    border: 1px solid rgba(14,165,233,0.4);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 11px;
    line-height: 1.55;
    color: #e2e8f0;
    width: 240px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transform: translateX(-50%) translateY(4px);
    z-index: 9999;
    text-align: left;
    font-weight: 400;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    white-space: normal;
}
.novua-help .novua-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(14,165,233,0.4);
}
.novua-help:hover .novua-tip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   STEPPER IMPROVEMENTS — Narrative Steps
   ============================================ */
.stepper-step-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: center;
    max-width: 80px;
    line-height: 1.3;
}
.stepper-step.active .stepper-step-label {
    color: var(--color-primary);
    font-weight: 600;
}
.stepper-step.completed .stepper-step-label {
    color: var(--color-success, #4ade80);
}

/* ============================================
   MISSION CARD — Active Step Highlight
   ============================================ */
.novua-mission-card {
    background: linear-gradient(135deg, rgba(14,165,233,0.08) 0%, rgba(139,92,246,0.08) 100%);
    border: 2px solid var(--color-primary);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
    animation: missionPulse 3s ease-in-out infinite;
}
@keyframes missionPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(14,165,233,0); }
    50% { box-shadow: 0 0 0 6px rgba(14,165,233,0.08); }
}
.novua-mission-card .mission-step {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}
.novua-mission-card .mission-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.novua-mission-card .mission-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   MINIMALIST BADGE CHIPS
   ============================================ */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
}
.chip-success { background: rgba(74,222,128,0.1); color: #4ade80; border-color: rgba(74,222,128,0.3); }
.chip-warning { background: rgba(251,191,36,0.1); color: #fbbf24; border-color: rgba(251,191,36,0.3); }
.chip-danger  { background: rgba(248,113,113,0.1); color: #f87171; border-color: rgba(248,113,113,0.3); }
.chip-info    { background: rgba(14,165,233,0.1);  color: var(--color-primary); border-color: rgba(14,165,233,0.3); }
.chip-muted   { background: rgba(148,163,184,0.1); color: var(--text-muted); border-color: rgba(148,163,184,0.2); }

/* ==========================================================================
   MEJORAS NOVUA 9 — Iconos Circulares + Tema Verde Activo en Sidebar
   ========================================================================== */

/* Contenedor de ícono circular para la navegación */
.nav-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.nav-item-icon svg {
    width: 16px !important;
    height: 16px !important;
}

/* Estado hover de la navegación: verde sutil */
.nav-item:hover {
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.06) !important;
}

.nav-item:hover .nav-item-icon {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
}

/* Estado ACTIVO de la navegación: gradiente verde + borde izquierdo verde */
.nav-item.active {
    color: #10b981 !important;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.18), transparent) !important;
    border-left: 3px solid #10b981 !important;
    padding-left: 13px !important;
}

.nav-item.active .nav-item-icon {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* Modo claro: mismo comportamiento verde activo */
body.light-theme .nav-item:hover {
    color: #059669 !important;
    background: rgba(5, 150, 105, 0.06) !important;
}

body.light-theme .nav-item.active {
    color: #059669 !important;
    background: linear-gradient(90deg, rgba(5, 150, 105, 0.10), transparent) !important;
    border-left-color: #059669 !important;
}

/* =====================================================================
   FASE 3 — COLUMNA DERECHA: Accordion Stepper + Sub-hitos + Audit V3
   ===================================================================== */

/* ── Sidebar Column ─────────────────────────────────────────────────── */
.v-timeline-sidebar {
    width: 320px;
    min-width: 320px;
    background: var(--surface-card);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.v-timeline-header {
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
}

.v-timeline-header__top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.v-timeline-header__top-row svg {
    opacity: 0.5;
}

.v-timeline-header__pct {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}

.v-timeline-header__select {
    width: 100%;
    font-size: 11px;
    font-weight: 600;
    padding: 7px 10px;
    border-radius: var(--radius-md);
    background: var(--surface-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    outline: none;
    transition: border-color 0.2s;
}

.v-timeline-header__select:focus {
    border-color: var(--color-primary);
}

.v-timeline-header__bar {
    position: relative;
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.v-timeline-header__bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), #34d399);
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Scrollable Body ────────────────────────────────────────────────── */
.v-timeline-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* ═══ v9.9.34: Stepper styles commented out — progress now in banner ═══
/* ── Stepper Vertical Line (decorative) ──────────────────────────── * /
.v-stepper-track {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 20px;
}

.v-stepper-track::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 15px;
    width: 2px;
    bottom: 20px;
    background: var(--border-color);
    z-index: 1;
}

/* ── Step Accordion ─────────────────────────────────────────────────── * /
.step-accordion {
    position: relative;
    z-index: 2;
}

.step-accordion-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background 0.2s;
    user-select: none;
}

.step-accordion-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.step-accordion__icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.step-accordion__icon svg {
    width: 15px;
    height: 15px;
    stroke: var(--text-muted);
    transition: stroke 0.3s;
}

.step-accordion__text {
    flex: 1;
    min-width: 0;
}

.step-accordion__label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    line-height: 1.2;
    transition: color 0.3s;
}

.step-accordion__detail {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
    opacity: 0.7;
}

.step-accordion__chevron {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.4;
}

.step-accordion__chevron svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-muted);
}

/* ── Step States ────────────────────────────────────────────────────── * /
/* Completed * /
.step-accordion.completed .step-accordion__icon {
    background: var(--color-primary);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.step-accordion.completed .step-accordion__icon svg {
    stroke: #ffffff;
}

.step-accordion.completed .step-accordion__label {
    color: var(--color-primary);
}

/* Active * /
.step-accordion.active .step-accordion__icon {
    background: transparent;
    border: 2px solid var(--color-primary);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
}

.step-accordion.active .step-accordion__icon svg {
    stroke: var(--color-primary);
}

.step-accordion.active .step-accordion__label {
    color: var(--text-primary);
    font-weight: 800;
}

/* ── Accordion Body (Sub-milestones) ─────────────────────────────── * /
.step-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                padding 0.3s ease;
    opacity: 0;
    padding: 0 8px 0 52px;
}

.step-accordion.expanded .step-accordion-body {
    max-height: 300px;
    opacity: 1;
    padding: 4px 8px 10px 52px;
}

.step-accordion.expanded .step-accordion__chevron {
    transform: rotate(90deg);
}
═══ End stepper styles ═══ */

/* ── Sub-step Item ──────────────────────────────────────────────────── */
.sub-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}

.sub-step__check {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sub-step__check svg {
    width: 16px;
    height: 16px;
}

/* Pending sub-step */
.sub-step .sub-step__check svg {
    stroke: var(--text-muted);
    opacity: 0.4;
}

.sub-step__label {
    flex: 1;
}

/* Completed sub-step */
.sub-step.done .sub-step__check svg {
    stroke: var(--color-primary);
    opacity: 1;
}

.sub-step.done .sub-step__label {
    color: var(--color-primary);
    opacity: 0.85;
}

/* ── Audit Section ─────────────────────────────────────────────────── */
.v-audit-section {
    border-top: 1px dashed var(--border-color);
    padding-top: 16px;
    margin-top: 8px;
}

.v-audit-section__title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.v-audit-section__title svg {
    opacity: 0.5;
}

.v-audit-order-ref {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
}

.v-audit-order-ref strong {
    color: var(--color-primary);
}

/* ── Audit Entry V3 ─────────────────────────────────────────────────── */
.audit-entry-v3 {
    display: flex;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 4px;
    border-left: 3px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    transition: background 0.2s, transform 0.15s;
}

.audit-entry-v3:hover {
    background: rgba(255, 255, 255, 0.04);
}

.audit-entry-v3__icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.audit-entry-v3__icon svg {
    width: 13px;
    height: 13px;
}

.audit-entry-v3__content {
    flex: 1;
    min-width: 0;
}

.audit-entry-v3__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 2px;
}

.audit-entry-v3__role {
    display: flex;
    align-items: center;
    gap: 4px;
}

.audit-entry-v3__time {
    opacity: 0.7;
    font-weight: 600;
}

.audit-entry-v3__msg {
    font-size: 11px;
    color: var(--text-primary);
    line-height: 1.35;
}

/* ── Audit Feed Container ──────────────────────────────────────────── */
.v-audit-feed {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* ── Show All Toggle Button ─────────────────────────────────────── */
.audit-show-all-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-primary);
    background: rgba(16, 185, 129, 0.06);
    border: 1px dashed rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.audit-show-all-btn:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.4);
}

.audit-show-all-btn svg {
    stroke: var(--color-primary);
    transition: transform 0.2s;
}

/* ── Hidden Audit Entry (animated reveal) ───────────────────────── */
.audit-entry--hidden {
    animation: auditFadeIn 0.3s ease forwards;
}

@keyframes auditFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Light Mode Overrides ──────────────────────────────────────────── */
body.light-theme .v-timeline-header,
body.light-mode .v-timeline-header {
    background: #f1f5f9 !important;
}

body.light-theme .v-timeline-header__select,
body.light-mode .v-timeline-header__select {
    background: #ffffff;
    color: #0f172a;
    border-color: #e2e8f0;
}

/* ═══ v9.9.34: Stepper styles commented out — progress now in banner ═══ */
/*
body.light-theme .step-accordion-header:hover,
body.light-mode .step-accordion-header:hover {
    background: rgba(0, 0, 0, 0.03);
}

body.light-theme .step-accordion__label,
body.light-mode .step-accordion__label {
    color: #334155;
}

body.light-theme .step-accordion.active .step-accordion__label,
body.light-mode .step-accordion.active .step-accordion__label {
    color: #0f172a;
}

body.light-theme .step-accordion.completed .step-accordion__label,
body.light-mode .step-accordion.completed .step-accordion__label {
    color: #059669;
}
═══ End stepper styles ═══ */

body.light-theme .audit-entry-v3,
body.light-mode .audit-entry-v3 {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

body.light-theme .audit-entry-v3__msg,
body.light-mode .audit-entry-v3__msg {
    color: #1e293b;
}

body.light-theme .audit-entry-v3__icon,
body.light-mode .audit-entry-v3__icon {
    background: #f1f5f9;
}

body.light-theme .v-audit-order-ref,
body.light-mode .v-audit-order-ref {
    background: #f8fafc;
}

body.light-theme .sub-step,
body.light-mode .sub-step {
    color: #475569;
}

/* ================================================================
   PWA — MOBILE RESPONSIVE (Sub-fase 4B)
   ================================================================ */

/* Hamburger button — hidden by default on desktop */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.hamburger-btn:hover { background: rgba(255,255,255,0.08); }
.hamburger-btn svg { display: block; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Bottom Navigation Bar */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100000;
    background: var(--surface-card);
    border-top: 1px solid var(--border-color);
    padding: 4px 0 max(4px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    pointer-events: auto;
}

.bottom-nav__items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 8px;
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
    min-width: 52px;
}
.bottom-nav__item svg { width: 22px; height: 22px; }
.bottom-nav__item.active {
    color: var(--color-primary);
    font-weight: 700;
}
.bottom-nav__item.active svg { stroke-width: 2.5; }
.bottom-nav__item:active { transform: scale(0.9); }

/* Mobile-only FAB (Floating Action Button) for main action */
.mobile-fab {
    display: none;
    position: fixed;
    bottom: calc(68px + env(safe-area-inset-bottom));
    right: 16px;
    z-index: 997;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #0ea5e9);
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    align-items: center;
    justify-content: center;
}
.mobile-fab:active { transform: scale(0.9); }
.mobile-fab svg { width: 24px; height: 24px; }

/* ================================================================
   MEDIA QUERIES — Breakpoint 768px (Tablet & Mobile)
   ================================================================ */
@media (max-width: 768px) {

    /* ── HAMBURGER ── */
    .hamburger-btn { display: flex; }

    /* ── APP CONTAINER ── smaller header row on mobile */
    .app-container {
        grid-template-rows: 52px 1fr !important;
    }

    /* ── HEADER ── compact, balanced layout */
    .app-header {
        padding: 0 10px !important;
        gap: 6px !important;
        height: 52px !important;
        min-height: 52px !important;
    }
    .logo-container {
        flex: 0 0 auto !important;
    }
    .logo-container img {
        max-height: 28px !important;
    }
    .logo-subtitle { display: none !important; }

    /* Hide desktop-only header elements */
    .simulator-panel { display: none !important; }
    .user-profile-badge { display: none !important; }
    #real-user-badge { padding: 2px 6px 2px 2px !important; }
    #real-user-badge > div:last-child { display: none !important; }
    .header-controls { gap: 6px !important; }
    .btn-lang { padding: 4px 8px !important; font-size: 11px !important; }
    #novua-theme-toggle { padding: 4px 8px !important; }
    #novua-theme-toggle svg { width: 16px; height: 16px; }

    /* ── MAIN LAYOUT ── full-width single column */
    .main-wrapper {
        display: block !important;
        height: calc(100vh - 52px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    /* ── SIDEBAR ── off-canvas drawer from left */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        min-width: 280px !important;
        max-width: 280px !important;
        z-index: 100001 !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(.4,0,.2,1);
        box-shadow: 4px 0 24px rgba(0,0,0,0.4);
        background: rgba(13, 20, 38, 0.98) !important;
        display: flex !important;
        overflow-y: auto !important;
    }
    .sidebar.open {
        transform: translateX(0);
    }

    /* ── CONTENT AREA ── flex column, no scroll (scroll on panel-grid) */
    .content-area {
        padding: 0 !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    .panel-grid {
        padding: 14px 12px calc(72px + env(safe-area-inset-bottom)) 12px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* ── BOTTOM NAV ── always visible */
    .bottom-nav { display: block !important; }
    .mobile-fab { display: none !important; }

    /* ── AI WIDGET ── repositioned above bottom nav */
    .ai-console-container {
        bottom: calc(64px + env(safe-area-inset-bottom)) !important;
        right: 10px !important;
        z-index: 99999 !important;
    }
    .ai-console-bubble {
        width: 44px !important;
        height: 44px !important;
    }

    /* ── STAT CARDS ── responsive grid */
    .grid-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 16px !important;
    }
    .stat-card {
        padding: 12px !important;
        gap: 10px !important;
    }
    .stat-icon {
        width: 36px !important;
        height: 36px !important;
    }
    .stat-icon svg {
        width: 18px !important;
        height: 18px !important;
    }
    .stat-value {
        font-size: 18px !important;
    }
    .stat-label {
        font-size: 11px !important;
    }

    /* ── CARDS ── full width */
    .card {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* ── DASHBOARD VIEW ── prevent overflow */
    .dashboard-view {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* ── WELCOME/HERO CARDS ── fix text overflow */
    .dashboard-view .card h2 {
        font-size: 17px !important;
        line-height: 1.3 !important;
    }
    .dashboard-view .card p {
        font-size: 12px !important;
        line-height: 1.5 !important;
    }

    /* ── QUICK ACTION GRIDS ── 2 columns */
    .dashboard-view [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .dashboard-view [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    /* ── PROGRESS STEPPER ── compact */
    .progress-stepper {
        padding: 14px 12px !important;
        margin-bottom: 14px !important;
    }
    .stepper-header h3 {
        font-size: 14px !important;
    }

    /* ── PHOTO GRID ── 2 columns */
    .op-photo-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    /* ── TIMELINE SIDEBAR ── inline flow (not fixed overlay) */
    .vertical-timeline-sidebar {
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        border-left: none !important;
        border-top: 1px solid var(--border-color) !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        padding-bottom: 16px !important;
    }

    /* ── TAB CONTENT PANELS ── ensure proper sizing */
    .tab-content-panel {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* ── TABLES ── horizontal scroll wrapper */
    .card table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 12px !important;
    }

    /* ── FORMS ── full width inputs */
    .form-control,
    .form-select,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important; /* prevents iOS zoom on focus */
    }

    /* ── MODALS ── full screen on mobile */
    .modal-content,
    .swal2-popup {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: 10px auto !important;
    }

    /* ── ORDER SELECTOR DROPDOWN ── */
    .order-select,
    [id*="order-select"] {
        font-size: 13px !important;
        padding: 8px 10px !important;
    }

    /* ── ACTIVITY LOG ENTRIES ── */
    .audit-entry,
    [class*="audit-entry"],
    [class*="activity-entry"] {
        padding: 10px 12px !important;
        font-size: 12px !important;
    }

    /* ── SECTION HEADERS ── */
    .card-header h3,
    .card-title {
        font-size: 14px !important;
    }

    /* ── BUTTONS ── touch-friendly size */
    .btn {
        min-height: 40px !important;
        padding: 8px 14px !important;
        font-size: 13px !important;
    }
}

/* ================================================================
   MEDIA QUERIES — Breakpoint 480px (Small Phones)
   ================================================================ */
@media (max-width: 480px) {
    .app-header {
        padding: 0 8px !important;
        height: 48px !important;
        min-height: 48px !important;
    }
    .logo-container img {
        max-height: 24px !important;
    }
    .header-controls { gap: 4px !important; }

    .main-wrapper {
        height: calc(100vh - 48px) !important;
    }

    .content-area {
        padding: 0 !important;
    }
    .panel-grid {
        padding: 8px 8px calc(68px + env(safe-area-inset-bottom)) 8px !important;
    }

    /* Stat cards: single column on tiny screens */
    .grid-stats {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .card-header h3 { font-size: 13px !important; }
    .card-title { font-size: 13px !important; }

    /* Photo grid: 1 column on tiny screens */
    .op-photo-grid {
        grid-template-columns: 1fr !important;
    }

    /* Quick action grid: single column */
    .dashboard-view [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* ================================================================
   LIGHT MODE — Bottom Nav & Sidebar Overlay
   ================================================================ */
body.light-mode .bottom-nav,
body.light-theme .bottom-nav {
    background: #ffffff;
    border-top-color: #e2e8f0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
body.light-mode .bottom-nav__item,
body.light-theme .bottom-nav__item {
    color: #94a3b8;
}
body.light-mode .bottom-nav__item.active,
body.light-theme .bottom-nav__item.active {
    color: var(--color-primary);
}
body.light-mode .sidebar-overlay,
body.light-theme .sidebar-overlay {
    background: rgba(0, 0, 0, 0.3);
}

/* ============================================================
   NOVUA CHAT MODULE — Sidebar Compact Chat
   ============================================================ */

/* ---- Container ---- */
.novua-chat-section {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
    max-height: 45vh;
    min-height: 36px;               /* collapsed = header only */
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    flex-shrink: 0;
}

.novua-chat-section.collapsed {
    max-height: 36px;
}

/* ---- Header (click to expand / collapse) ---- */
.novua-chat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
    transition: background 0.2s ease;
}
.novua-chat-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.novua-chat-header__icon {
    width: 16px;
    height: 16px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.novua-chat-header__title {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    flex: 1;
}

.novua-chat-header__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--color-danger, #ef4444);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    animation: novua-badge-pulse 2s ease-in-out infinite;
}
.novua-chat-header__badge:empty { display: none; }

@keyframes novua-badge-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.12); }
}

.novua-chat-header__chevron {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.novua-chat-section.collapsed .novua-chat-header__chevron {
    transform: rotate(-90deg);
}

/* ---- Mode Selector (Soporte | Por Orden) ---- */
.novua-chat-modes {
    display: flex;
    gap: 2px;
    padding: 0 10px 6px;
    flex-shrink: 0;
}

.novua-chat-mode-btn {
    flex: 1;
    padding: 5px 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}
.novua-chat-mode-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 60%;
    height: 2px;
    background: transparent;
    border-radius: 1px;
    transition: background 0.25s ease;
}
.novua-chat-mode-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}
.novua-chat-mode-btn.active {
    color: var(--color-primary);
}
.novua-chat-mode-btn.active::after {
    background: var(--color-primary);
}

/* ---- Context Bar (Order + Counterpart) ---- */
.novua-chat-context {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px 6px;
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.novua-chat-context strong {
    color: var(--text-primary);
    font-weight: 600;
}
.novua-chat-context .dot-sep {
    color: var(--text-muted);
    margin: 0 2px;
}

/* ---- Room / Sala Tabs — Estilos controlados por novua-chat.js ---- */
/* (Eliminados de styles.css para evitar conflictos con el módulo JS) */


/* ---- Messages Area ---- */
.novua-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
    min-height: 100px;
    max-height: 300px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scroll-behavior: smooth;
}

/* Scrollbar */
.novua-chat-messages::-webkit-scrollbar { width: 4px; }
.novua-chat-messages::-webkit-scrollbar-track { background: transparent; }
.novua-chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
.novua-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ---- Message Bubbles ---- */
.novua-chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 88%;
    animation: novua-msg-in 0.25s ease-out;
}
@keyframes novua-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.novua-chat-msg--out { align-self: flex-end; }
.novua-chat-msg--in  { align-self: flex-start; }

.novua-chat-msg__sender {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 2px;
    padding-left: 4px;
}

.novua-chat-msg__bubble {
    padding: 7px 10px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-primary);
    word-break: break-word;
    position: relative;
}

/* Outgoing bubble — subtle primary tint */
.novua-chat-msg--out .novua-chat-msg__bubble {
    background: rgba(var(--color-primary-rgb), 0.15);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    border-bottom-right-radius: 4px;
}

/* Incoming bubble — surface color */
.novua-chat-msg--in .novua-chat-msg__bubble {
    background: var(--bg-card, rgba(30, 34, 48, 0.7));
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.novua-chat-msg__text { margin: 0; }

.novua-chat-msg__meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 3px;
}

.novua-chat-msg__time {
    font-size: 10px;
    color: var(--text-muted);
}

.novua-chat-msg__status {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1;
}
.novua-chat-msg__status.read {
    color: var(--color-primary);
}

/* Audio message */
.novua-chat-msg__audio {
    width: 100%;
    height: 32px;
    margin-top: 4px;
    border-radius: 6px;
    outline: none;
}
.novua-chat-msg__audio::-webkit-media-controls-panel {
    background: rgba(255, 255, 255, 0.06);
}

/* Image thumbnail */
.novua-chat-msg__img {
    max-width: 100%;
    max-height: 160px;
    border-radius: 8px;
    margin-top: 4px;
    cursor: pointer;
    object-fit: cover;
    transition: opacity 0.2s ease;
}
.novua-chat-msg__img:hover { opacity: 0.85; }

/* File attachment card */
.novua-chat-msg__file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin-top: 4px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.novua-chat-msg__file:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(var(--color-primary-rgb), 0.3);
    color: var(--text-primary);
}
.novua-chat-msg__file-icon {
    width: 16px;
    height: 16px;
    color: var(--color-primary);
    flex-shrink: 0;
}
.novua-chat-msg__file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Input Bar ---- */
.novua-chat-input {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.novua-chat-input__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    padding: 0;
}
.novua-chat-input__btn svg {
    width: 16px;
    height: 16px;
}
.novua-chat-input__btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}
.novua-chat-input__btn.recording {
    color: var(--color-danger, #ef4444);
    animation: novua-recording-pulse 1s ease-in-out infinite;
}
@keyframes novua-recording-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

.novua-chat-input__field {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}
.novua-chat-input__field::placeholder {
    color: var(--text-muted);
}
.novua-chat-input__field:focus {
    border-color: rgba(var(--color-primary-rgb), 0.5);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.1);
}

.novua-chat-input__send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    padding: 0;
}
.novua-chat-input__send svg {
    width: 14px;
    height: 14px;
}
.novua-chat-input__send:hover {
    background: var(--color-primary-hover);
    transform: scale(1.08);
}
.novua-chat-input__send:active {
    transform: scale(0.95);
}
.novua-chat-input__send:disabled {
    opacity: 0.4;
    cursor: default;
    transform: none;
}

/* ---- Toast Notification ---- */
.novua-chat-toast {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: var(--surface-card);
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    animation: novua-toast-in 0.35s ease-out;
    pointer-events: auto;
    cursor: pointer;
    max-width: 320px;
}

.novua-chat-toast.hiding {
    animation: novua-toast-out 0.3s ease-in forwards;
}

@keyframes novua-toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes novua-toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}

.novua-chat-toast__icon {
    width: 18px;
    height: 18px;
    color: var(--color-primary);
    flex-shrink: 0;
}
.novua-chat-toast__text { flex: 1; }
.novua-chat-toast__close {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s ease;
}
.novua-chat-toast__close:hover {
    color: var(--text-primary);
}

/* ---- Light Mode Overrides ---- */
body.light-mode .novua-chat-header:hover,
body.light-theme .novua-chat-header:hover {
    background: rgba(0, 0, 0, 0.03);
}

body.light-mode .novua-chat-mode-btn:hover,
body.light-theme .novua-chat-mode-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}

body.light-mode .novua-chat-msg--out .novua-chat-msg__bubble,
body.light-theme .novua-chat-msg--out .novua-chat-msg__bubble {
    background: rgba(var(--color-primary-rgb), 0.1);
    border-color: rgba(var(--color-primary-rgb), 0.18);
}

body.light-mode .novua-chat-msg--in .novua-chat-msg__bubble,
body.light-theme .novua-chat-msg--in .novua-chat-msg__bubble {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: var(--text-primary);
}

body.light-mode .novua-chat-input__field,
body.light-theme .novua-chat-input__field {
    background: rgba(0, 0, 0, 0.03);
    border-color: #e2e8f0;
}
body.light-mode .novua-chat-input__field:focus,
body.light-theme .novua-chat-input__field:focus {
    background: #fff;
    border-color: rgba(var(--color-primary-rgb), 0.4);
}

body.light-mode .novua-chat-input__btn:hover,
body.light-theme .novua-chat-input__btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .novua-chat-msg__file,
body.light-theme .novua-chat-msg__file {
    background: rgba(0, 0, 0, 0.03);
    border-color: #e2e8f0;
}
body.light-mode .novua-chat-msg__file:hover,
body.light-theme .novua-chat-msg__file:hover {
    background: rgba(0, 0, 0, 0.06);
}

body.light-mode .novua-chat-toast,
body.light-theme .novua-chat-toast {
    background: #fff;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.12);
    border-color: rgba(var(--color-primary-rgb), 0.2);
}

