/* MARS Beta 1.1 - INDUSTRIAL FUSION UI SYSTEM (PIXEL PERFECT MASTER) */
:root {
    --accent: #F35804; /* NARANJA AQUACHILE */
    --accent-glow: rgba(243, 88, 4, 0.3);
    --bg-main: #050507;
    --bg-sidebar: #050507;
    --bg-card: rgba(15, 15, 20, 0.9);
    --border-main: rgba(255, 255, 255, 0.08);
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --secondary: #2C3E50; /* AZUL PIZARRA */
    --success: #10B981;
    --danger: #EF4444;
    --nano-banana: #FACC15;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.light-theme {
    --bg-main: #FDF5EF; /* MARFIL AQUACHILE */
    --bg-sidebar: #FDF5EF;
    --bg-card: rgba(255, 255, 255, 0.9);
    --accent: #F35804; /* NARANJA AQUACHILE */
    --accent-glow: rgba(243, 88, 4, 0.1);
    --text-primary: #2C3E50;
    --text-secondary: #334155;
    --text-muted: #64748B;
    --border-main: rgba(44, 62, 80, 0.1);
    --secondary: #2C3E50; /* AZUL PIZARRA */
    --success: #059669;
    --danger: #DC2626;
    --nano-banana: #D97706;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, sans-serif;
    display: flex;
    height: 100vh;
    overflow: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}

/* SIDEBAR: ULTRA-COMPACT TECH LOOK */
.mars-sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-main);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 1000;
}

.sidebar-header {
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.sidebar-logo {
    width: 130px;
    height: auto;
    border-radius: 50%;
    transition: var(--transition);
}

/* ORGANIC LOGO INTEGRATION */
body.light-theme .sidebar-logo {
    mix-blend-mode: multiply;
}

body:not(.light-theme) .sidebar-logo {
    filter: invert(1) hue-rotate(180deg) brightness(1.1) contrast(1.1);
    mix-blend-mode: screen;
}

.mars-sidebar.collapsed {
    width: 70px;
}

.mars-sidebar.collapsed .sidebar-header {
    height: 70px;
    padding: 0.5rem;
}

.mars-sidebar.collapsed .sidebar-logo {
    width: 38px;
}

.mars-sidebar.collapsed .nav-label,
.mars-sidebar.collapsed .nav-section-title,
.mars-sidebar.collapsed .sidebar-footer {
    display: none;
}

.nav-section-title {
    padding: 1.2rem 1.5rem 0.4rem;
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.nav-menu {
    flex: 1;
    padding: 0.4rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1.2rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* WORKSPACE & WATERMARK */
.workspace-root {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.workspace-root::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 650px;
    height: 650px;
    background: none;
    opacity: 0.15;
    /* Técnica Maestra: Invertir + Screen para eliminar fondo blanco JPEG en Dark Mode */
    filter: invert(1) hue-rotate(180deg) brightness(1.2) contrast(1.2);
    mix-blend-mode: screen;
    /* Doble máscara para suavizar bordes y desaparecer el borde inferior de la foto */
    -webkit-mask-image: radial-gradient(circle, black 35%, transparent 75%),
        linear-gradient(to bottom, black 70%, transparent 95%);
    mask-image: radial-gradient(circle, black 35%, transparent 75%),
        linear-gradient(to bottom, black 70%, transparent 95%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
    pointer-events: none;
    z-index: 0;
    transition: all 0.5s ease;
}

body.light-theme .workspace-root::before {
    mix-blend-mode: multiply;
    opacity: 0.1;
    filter: grayscale(0.2) contrast(1.1);
}

.workspace-header {
    height: 64px;
    background: var(--bg-sidebar);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-main);
}

.page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.workspace-content {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
    z-index: 10;
}

/* DASHBOARD WIDGETS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 2.2rem;
    border-radius: 20px;
    border: 1px solid var(--border-main);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-value {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 12px 0;
    color: var(--text-primary);
}

.btn-report-mini {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
}

.btn-report-mini:hover {
    background: var(--accent);
    color: white;
}

.accent-border {
    border-left: 5px solid var(--accent);
}

/* SECTIONS */
.mars-section {
    display: none;
    animation: slideUp 0.4s ease-out;
}

.mars-section.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-enterprise {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    padding: 2.5rem;
    border-radius: 16px;
    margin-top: 2rem;
    box-shadow: var(--shadow-card);
}

/* NAVIERA GRID - PREMIUM RESTORED */
.naviera-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.naviera-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2.2rem;
    border: 1px solid var(--border-main);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    box-shadow: var(--shadow-card);
}

.naviera-card:hover {
    border-color: var(--accent);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

body:not(.light-theme) .naviera-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.carrier-logo {
    width: 100%;
    height: 60px;
    object-fit: contain;
    transition: var(--transition);
    /* OPTIMIZACIÓN HI-FI: Renderizado nítido por hardware */
    image-rendering: -webkit-optimize-contrast;
    filter: brightness(1.05) contrast(1.1);
}

.naviera-card:hover .carrier-logo {
    transform: scale(1.08);
}

/* Integración Orgánica: Light Mode */
body.light-theme .carrier-logo {
    mix-blend-mode: multiply;
}

/* Integración Orgánica: Dark Mode (Técnica Maestra para fondos blancos JPEG) */
body:not(.light-theme) .carrier-logo {
    /* Invertimos (blanco->negro), corregimos color (hue-rotate) y mezclamos (screen) */
    filter: invert(1) hue-rotate(180deg) brightness(1.2) contrast(1.2);
    mix-blend-mode: screen;
}

/* CASO ESPECIAL: MAERSK (Fondo oscuro nativo - Eliminación Quirúrgica de Recuadro) */
body:not(.light-theme) #logo-maersk {
    /* Forzamos el gris oscuro a negro absoluto (0,0,0) mediante contraste agresivo */
    filter: brightness(1.3) contrast(1.6) saturate(1.1);
    mix-blend-mode: screen;
    /* Difuminamos bordes para eliminar cualquier línea residual del recorte original */
    -webkit-mask-image: radial-gradient(circle, black 75%, transparent 100%);
    mask-image: radial-gradient(circle, black 75%, transparent 100%);
}

body.light-theme #logo-maersk {
    /* Invertimos en Light Mode para que el fondo negro pase a blanco y desaparezca con Multiply */
    filter: invert(1) hue-rotate(180deg) brightness(1.1) contrast(1.1);
    mix-blend-mode: multiply;
}

.btn-access-go {
    background: var(--bg-main);
    border: 1px solid var(--border-main);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-primary);
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.btn-access-go:hover {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
    box-shadow: 0 8px 20px var(--accent-glow);
}

/* MISC */
.btn-mars {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.9rem 2rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 800;
    text-transform: uppercase;
    transition: var(--transition);
}

#toast-container {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 2000;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-left: 4px solid var(--accent);
    padding: 1.2rem 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    animation: slideIn 0.3s ease-out;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle-minimal,
.btn-header-action {
    background: none;
    border: 1px solid var(--border-main);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle-minimal:hover,
.btn-header-action:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(219, 10, 64, 0.05);
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px var(--accent-glow);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border-main);
    height: 24px;
}

/* EMISIÓN DE SEGUROS 2.0: LOOK ENTERPRISE */
.module-header-unified {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-main);
}

.header-left-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left-info .accent-icon {
    color: var(--accent);
    width: 28px;
    height: 28px;
}

.analysis-grid-unified {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.analysis-grid-unified.single-center {
    display: flex;
    justify-content: center;
    grid-template-columns: none;
}

.drop-zone-master {
    height: 200px;
    border: 2px dashed var(--border-main);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition);
    cursor: pointer;
}

.drop-zone-master.compact-dz {
    height: 100px;
    width: 100%;
    max-width: 450px;
    flex-direction: row;
    padding: 0 2.5rem;
    gap: 1.5rem;
}

.drop-zone-master:hover {
    border-color: var(--accent);
    background: rgba(219, 10, 64, 0.03);
}

.compact-dz .dz-icon-wrapper {
    width: 48px;
    height: 48px;
}

.compact-dz .dz-text-content {
    text-align: left;
}

.dz-icon-wrapper {
    width: 60px;
    height: 60px;
    background: rgba(219, 10, 64, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.files-list {
    flex: 1;
    overflow-y: auto;
    max-height: 150px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-main);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-main);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.8rem;
}

.file-info i {
    width: 16px;
    color: var(--accent);
}

.btn-remove-file {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 4px;
}

.btn-remove-file:hover {
    color: var(--accent);
}

.operational-actions-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-op-action {
    background: var(--bg-surface);
    border: 1px solid var(--border-main);
    color: var(--text-primary);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition);
}

.btn-op-action:hover {
    border-color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
}

.btn-op-action.btn-emitir {
    background: #10B981;
    border-color: #10B981;
    color: white;
}

.btn-op-action.btn-emitir:hover {
    background: #059669;
    transform: translateY(-2px);
}

.results-audit-composite.tri-column {
    display: grid;
    grid-template-columns: 280px 320px 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
    align-items: start;
}

.audit-log-container.sidebar-log {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 8px;
    height: 450px;
    display: flex;
    flex-direction: column;
}

.audit-log-list.mini-log {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column-reverse;
}

.result-panel.mini {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 12px;
    padding: 1.2rem;
}

.analysis-results-content.mini {
    min-height: 180px;
    margin-top: 1rem;
}

.audit-log-container-full {
    background: #0a0a0c;
    border: 1px solid #1a1a1c;
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 500px;
    margin-top: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.audit-log-list.session-log {
    flex: 1;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column-reverse;
    /* Inyectar arriba */
    gap: 0.8rem;
    margin-top: 1.5rem;
    padding-right: 0.5rem;
}

.audit-log-list::-webkit-scrollbar {
    width: 4px;
}

.audit-log-list::-webkit-scrollbar-thumb {
    background: var(--border-main);
    border-radius: 10px;
}

.log-entry {
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border-left: 3px solid transparent;
    animation: fadeInLog 0.3s ease;
}

@keyframes fadeInLog {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-entry.success {
    border-left-color: #10B981;
    background: rgba(16, 185, 129, 0.05);
    color: #10B981;
}

.log-entry.system {
    border-left-color: #3B82F6;
    background: rgba(59, 130, 246, 0.05);
    color: #93C5FD;
}

.log-entry.warning {
    border-left-color: #F59E0B;
    background: rgba(245, 158, 11, 0.05);
    color: #FCD34D;
}

.log-time {
    color: var(--text-muted);
    font-weight: 800;
    margin-right: 1rem;
    font-size: 0.7rem;
    opacity: 0.6;
}

.engine-pills {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* MÓDULO DE LOGIN: SECURITY ALPHA */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #050505;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.login-card {
    background: #0a0a0c;
    border: 1px solid #1a1a1c;
    padding: 3rem;
    border-radius: 24px;
    width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.login-logo {
    width: 80px;
    border-radius: 50%;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 10px rgba(219, 10, 64, 0.3));
}

.login-form {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 1rem;
    width: 18px;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    background: #141416;
    border: 1px solid #252528;
    color: white;
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    border-radius: 12px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--accent);
}

.login-options {
    text-align: left;
    display: flex;
    align-items: center;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.btn-login {
    background: var(--accent);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 800;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(219, 10, 64, 0.2);
}

.login-footer {
    margin-top: 3rem;
    color: #333;
    font-size: 0.6rem;
    letter-spacing: 2px;
}

/* MODAL DE INTELIGENCIA: HIGH CONTRAST MASTER */
.intel-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.intel-content {
    background: #0d0d0f;
    width: 750px;
    border-radius: 12px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.03);
    color: white;
}

body.light-theme .intel-content {
    background: #ffffff;
    border-color: #e0e0e0;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    color: #1a1a1a;
}

.intel-header {
    padding: 1.5rem 2.5rem;
    border-bottom: 2px solid #1f1f22;
    background: #141417;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.light-theme .intel-header {
    background: #f8f9fa;
    border-bottom-color: #eee;
}

.intel-tabs {
    display: flex;
    background: #08080a;
    padding: 0.8rem;
    gap: 0.8rem;
    border-bottom: 1px solid #1f1f22;
}

body.light-theme .intel-tabs {
    background: #f1f3f5;
    border-bottom-color: #eee;
}

.tab-btn {
    flex: 1;
    background: #111;
    border: 1px solid #222;
    color: #666;
    padding: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

body.light-theme .tab-btn {
    background: #e9ecef;
    border-color: #dee2e6;
    color: #495057;
}

.tab-btn:hover {
    border-color: #444;
    color: #ddd;
}

body.light-theme .tab-btn:hover {
    border-color: #ced4da;
    color: #212529;
}

.tab-btn.active {
    background: #1a1a1d;
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(219, 10, 64, 0.15);
}

body.light-theme .tab-btn.active {
    background: #fff;
    color: var(--accent);
    border-color: var(--accent);
}

.intel-body {
    padding: 2.5rem;
    overflow-y: auto;
    flex: 1;
}

.intel-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.intel-table th {
    text-align: left;
    padding: 0 1.2rem 1.2rem;
    border-bottom: 2px solid #222;
    color: #555;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
}

body.light-theme .intel-table th {
    border-bottom-color: #eee;
    color: #adb5bd;
}

.intel-table td {
    padding: 0;
    background: #151518;
    border-top: 1px solid #2a2a2e;
    border-bottom: 1px solid #2a2a2e;
}

body.light-theme .intel-table td {
    background: #f8f9fa;
    border-color: #eee;
}

.intel-table td:first-child {
    border-left: 1px solid #2a2a2e;
    border-radius: 10px 0 0 10px;
}

.intel-table td:last-child {
    border-right: 1px solid #2a2a2e;
    border-radius: 0 10px 10px 0;
}

body.light-theme .intel-table td:first-child {
    border-left-color: #eee;
}

body.light-theme .intel-table td:last-child {
    border-right-color: #eee;
}

.intel-table input {
    width: 100%;
    background: #1a1a1d;
    border: none;
    color: #fff;
    padding: 15px 20px;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9rem;
    outline: none;
    transition: background 0.2s;
}

body.light-theme .intel-table input {
    background: #fff;
    color: #1a1a1a;
}

.intel-table input:focus {
    background: #222;
    color: var(--accent);
}

body.light-theme .intel-table input:focus {
    background: #f1f3f5;
    color: var(--accent);
}

.btn-add-row {
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed #222;
    color: #444;
    width: 100%;
    padding: 1.2rem;
    margin-top: 2rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

body.light-theme .btn-add-row {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #adb5bd;
}

.btn-add-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: #444;
    color: #888;
}

body.light-theme .btn-add-row:hover {
    background: #fff;
    border-color: #ced4da;
    color: #6c757d;
}

.intel-footer {
    padding: 2.5rem;
    border-top: 2px solid #1f1f22;
    background: #141417;
    border-radius: 0 0 12px 12px;
    text-align: right;
}

body.light-theme .intel-footer {
    background: #f8f9fa;
    border-top-color: #eee;
}

.btn-save-intel {
    background: #10B981;
    color: white;
    border: none;
    padding: 1.2rem 3rem;
    border-radius: 10px;
    font-weight: 900;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.25);
}

.btn-save-intel:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 35px rgba(16, 185, 129, 0.4);
}

/* PASSWORD TOGGLE EYE */
.eye-toggle {
    position: absolute;
    right: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    z-index: 10;
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 5px;
}

.eye-toggle:hover {
    color: var(--accent);
}

/* ANALIZADOR DE DOCUMENTOS */
.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.analysis-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-main);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.box-header {
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 1px;
    font-weight: 800;
}

.drop-zone {
    border: 2px dashed var(--border-main);
    border-radius: 15px;
    padding: 2.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(219, 10, 64, 0.03);
}

.drop-zone i {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
}

.drop-zone p {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.drop-zone span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.analysis-results {
    background: var(--bg-main);
    border-radius: 12px;
    padding: 1rem;
    min-height: 150px;
    border: 1px solid var(--border-main);
}

.empty-state {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.data-item {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
}

.data-label {
    color: var(--text-muted);
    font-weight: 600;
}

.data-value {
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* MÓDULO SEGUROS: SOUTHBRIDGE */
.card-insurance {
    background: var(--bg-surface);
    border: 1px solid var(--border-main);
    border-radius: 20px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    transition: var(--transition);
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
    border-top: 4px solid #005aab;
    /* Azul Corporativo Southbridge */
}

.insurance-logo-container {
    width: 280px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.insurance-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
}

body:not(.light-theme) .insurance-logo {
    filter: invert(1) hue-rotate(180deg) brightness(1.2);
    mix-blend-mode: screen;
}

.btn-insurance-access {
    background: #005aab;
    color: white !important;
    padding: 1.2rem 3rem;
    border-radius: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 10px 20px rgba(0, 90, 171, 0.2);
    border: none;
    cursor: pointer;
}

.btn-insurance-access:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 90, 171, 0.3);
    background: #004a8d;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* SEGUROS HUB v3.0: HIGH-DENSITY INTEGRATED DASHBOARD */
.seguros-hub-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: slideUp 0.5s ease;
}

.hub-main-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    align-items: start;
}

.hub-op-card {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 24px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    box-shadow: var(--shadow-card);
    position: sticky;
    top: 0;
}

.drop-zone-integrated {
    height: 180px;
    border: 2px dashed var(--border-main);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition);
    cursor: pointer;
    text-align: center;
}

.drop-zone-integrated:hover {
    border-color: var(--accent);
    background: rgba(219, 10, 64, 0.03);
    transform: scale(1.02);
}

.hub-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.btn-hub {
    width: 100%;
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--border-main);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: var(--transition);
}

.btn-hub:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.btn-hub.btn-success {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 10px 25px var(--accent-glow);
}

.btn-hub.btn-success:hover {
    transform: translateY(-3px);
    background: #FF0D4D;
}

.hub-analysis-card {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 24px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 600px;
    box-shadow: var(--shadow-card);
}

.analysis-header {
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    color: var(--text-muted);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
    animation: hubPulse 2s infinite;
}

@keyframes hubPulse {
    0% {
        transform: scale(0.95);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(0.95);
        opacity: 0.5;
    }
}

.analysis-stream {
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.2));
}

.data-hub-block {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-main);
    border-radius: 16px;
    padding: 1.5rem;
    animation: fadeInSlide 0.4s ease;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.data-item:last-child {
    border-bottom: none;
}

.data-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.data-value {
    font-size: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
}

.block-title {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hub-log-stream {
    flex: 1;
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border-main);
    max-height: 300px;
    overflow-y: auto;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}