* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f0f5; height: 100vh; overflow: hidden; }

/* LOGIN */
.login-screen { display: flex; align-items: center; justify-content: center; height: 100vh; background: linear-gradient(135deg, #1a1a5e 0%, #5b2c85 100%); }
.login-box { background: white; border-radius: 20px; padding: 40px 30px; width: 90%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); text-align: center; }
.login-logo { font-size: 28px; font-weight: 800; color: #242581; margin-bottom: 5px; }
.login-sub { font-size: 13px; color: #888; margin-bottom: 30px; }
.login-input { width: 100%; border: 2px solid #e0e0e0; border-radius: 12px; padding: 14px 18px; font-size: 15px; margin-bottom: 15px; outline: none; transition: border-color 0.3s; }
.login-input:focus { border-color: #5b2c85; }
.login-btn { width: 100%; padding: 14px; border: none; border-radius: 12px; background: linear-gradient(135deg, #242581, #5b2c85); color: white; font-size: 16px; font-weight: 600; cursor: pointer; transition: transform 0.2s; }
.login-btn:hover { transform: scale(1.02); }
.login-btn:disabled { opacity: 0.6; }
.login-error { color: #c62828; font-size: 13px; margin-top: 10px; min-height: 20px; }

/* SELECTOR CLIENTE */
.client-screen { display: flex; flex-direction: column; height: 100vh; background: #f0f0f5; }
.client-header { background: linear-gradient(135deg, #242581, #5b2c85); color: white; padding: 20px; text-align: center; }
.client-header h2 { font-size: 18px; margin-bottom: 4px; }
.client-header span { font-size: 13px; opacity: 0.8; }
.client-list { flex: 1; overflow-y: auto; padding: 15px; }
.client-item { background: white; border-radius: 12px; padding: 16px 20px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); cursor: pointer; display: flex; align-items: center; gap: 15px; transition: transform 0.2s; }
.client-item:hover { transform: scale(1.01); }
.client-item:active { transform: scale(0.98); }
.client-icon { width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(135deg, #242581, #5b2c85); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.client-info { flex: 1; }
.client-name { font-weight: 600; font-size: 15px; color: #333; }
.client-domain { font-size: 12px; color: #999; margin-top: 2px; }
.client-logout { padding: 15px; text-align: center; }
.client-logout a { color: #c62828; font-size: 14px; cursor: pointer; text-decoration: none; }
.client-search { margin: 15px 15px 0; }
.client-search input { width: 100%; padding: 12px 16px; border: 2px solid #e0e0e0; border-radius: 12px; font-size: 14px; outline: none; }
.client-search input:focus { border-color: #5b2c85; }

/* CHAT */
.chat-screen { display: flex; flex-direction: row; height: 100vh; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; }

/* SIDEBAR conversaciones */
.sidebar { width: 270px; background: #f7f7fb; border-right: 1px solid #e1e1ea; display: flex; flex-direction: column; flex-shrink: 0; height: 100vh; }
.sidebar-top { padding: 12px; border-bottom: 1px solid #e8e8f0; }
.sidebar-new { width: 100%; padding: 10px 14px; border: none; border-radius: 10px; background: linear-gradient(135deg, #242581, #5b2c85); color: white; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform 0.15s; }
.sidebar-new:hover { transform: scale(1.02); }
.sidebar-search { padding: 10px 12px 8px; }
.sidebar-search input { width: 100%; padding: 8px 12px; border: 1px solid #d8d8e4; border-radius: 8px; font-size: 13px; outline: none; background: white; }
.sidebar-search input:focus { border-color: #5b2c85; }
.sidebar-lista { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.sidebar-foot { padding: 10px 14px; border-top: 1px solid #e8e8f0; font-size: 11px; color: #888; text-align: center; }
.conv-item { position: relative; padding: 10px 34px 10px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; color: #333; margin-bottom: 2px; transition: background 0.15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item:hover { background: #ececf3; }
.conv-item.active { background: #e1dff0; color: #242581; font-weight: 600; }
.conv-item .conv-titulo { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item .conv-fecha { display: block; font-size: 10px; color: #999; font-weight: 400; margin-top: 2px; }
.conv-item .conv-fijada { color: #c1993d; margin-right: 4px; }
.conv-actions { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: none; gap: 2px; }
.conv-item:hover .conv-actions { display: flex; }
.conv-actions button { background: none; border: none; color: #666; font-size: 13px; cursor: pointer; padding: 3px 5px; border-radius: 4px; }
.conv-actions button:hover { background: #d4d3dc; color: #242581; }
.conv-empty { padding: 20px 12px; text-align: center; font-size: 12px; color: #999; }

.sidebar-toggle { display: none !important; }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 99; }

@media (max-width: 768px) {
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 100; transform: translateX(-100%); transition: transform 0.25s; box-shadow: 2px 0 12px rgba(0,0,0,0.2); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: block !important; }
}

.puto-amo .sidebar { background: #1a0000; border-right-color: #550000; }
.puto-amo .sidebar-new { background: linear-gradient(135deg, #660000, #aa0000); }
.puto-amo .sidebar-search input { background: #2a0000; border-color: #550000; color: #ff9999; }
.puto-amo .conv-item { color: #ff9999; }
.puto-amo .conv-item:hover { background: #2a0000; }
.puto-amo .conv-item.active { background: #3a0000; color: #ffcccc; }
.puto-amo .sidebar-foot { color: #aa6666; border-top-color: #550000; }

.modo-operador .sidebar { background: #050505; border-right-color: #003300; }
.modo-operador .sidebar-new { background: linear-gradient(135deg, #003300, #005500); font-family: 'Courier New', monospace; }
.modo-operador .sidebar-search input { background: #0a0a0a; border-color: #1a3a1a; color: #33ff33; font-family: 'Courier New', monospace; }
.modo-operador .conv-item { color: #33ff33; font-family: 'Courier New', monospace; }
.modo-operador .conv-item:hover { background: #0d1a0d; }
.modo-operador .conv-item.active { background: #001a00; color: #66ff66; }
.modo-operador .sidebar-foot { color: #1a6a1a; border-top-color: #003300; }
.chat-header { background: linear-gradient(135deg, #242581, #5b2c85); color: white; padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.chat-back { background: none; border: none; color: white; font-size: 22px; cursor: pointer; padding: 4px 8px; }
.chat-header-info { flex: 1; }
.chat-header-title { font-size: 16px; font-weight: 600; }
.chat-header-client { font-size: 12px; opacity: 0.8; }
.chat-header-usage { font-family: "Courier New", Consolas, monospace; font-size: 10px; color: #c1993d; margin-top: 2px; letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70vw; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f0f0f5; }
.msg { max-width: 85%; padding: 12px 16px 18px; border-radius: 16px; font-size: 14px; line-height: 1.5; word-wrap: break-word; animation: msgIn 0.3s ease; position: relative; }
.msg-hora { display: block; font-size: 10px; text-align: right; margin-top: 4px; opacity: 0.55; line-height: 1; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.msg-user { align-self: flex-end; background: #242581; color: white; border-bottom-right-radius: 4px; }
.msg-bot { align-self: flex-start; background: white; color: #333; border-bottom-left-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.msg-bot b, .msg-bot strong { color: #242581; }
.msg-bot pre, .msg-bot code { font-family: "Courier New", monospace; font-size: 13px; white-space: pre; overflow-x: auto; }
.msg-bot .tabla-mono { font-family: "Courier New", monospace; font-size: 12px; line-height: 1.4; white-space: pre; display: block; background: #f8f8f8; padding: 8px 10px; border-radius: 8px; margin: 6px 0; overflow-x: auto; letter-spacing: 0; }
.msg-bot-wrap { align-self: flex-start; max-width: 85%; display: flex; flex-direction: column; gap: 4px; }
.btn-leer { align-self: flex-start; background: none; border: 1px solid #ccc; border-radius: 16px; padding: 3px 10px; font-size: 12px; color: #666; cursor: pointer; transition: all 0.2s; }
.btn-leer:hover { border-color: #242581; color: #242581; }
.btn-leer.leyendo { border-color: #c62828; color: #c62828; }
.btn-csv { align-self: flex-start; background: none; border: 1px solid #ccc; border-radius: 16px; padding: 3px 10px; font-size: 12px; color: #666; cursor: pointer; transition: all 0.2s; margin-left: 5px; }
.btn-csv:hover { border-color: #2E7D32; color: #2E7D32; }
.msg-error { align-self: center; background: #ffebee; color: #c62828; font-size: 13px; text-align: center; border-radius: 12px; }
.msg-typing { align-self: flex-start; background: white; color: #999; font-style: italic; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.msg-voice-indicator { align-self: center; background: rgba(36,37,129,0.1); color: #242581; font-size: 13px; border-radius: 20px; padding: 6px 16px; }

/* INPUT AREA */
.chat-input-area { display: flex; gap: 8px; padding: 12px 16px; background: white; border-top: 1px solid #e8e8e8; align-items: center; flex-shrink: 0; }
.chat-input { flex: 1; border: 2px solid #e0e0e0; border-radius: 24px; padding: 12px 18px; font-size: 15px; outline: none; transition: border-color 0.3s; }
.chat-input:focus { border-color: #5b2c85; }
.btn-circle { width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.2s; flex-shrink: 0; }
.btn-send { background: linear-gradient(135deg, #242581, #5b2c85); color: white; font-size: 20px; }
.btn-mic { background: #f0f0f5; color: #242581; font-size: 22px; }
.btn-mic.recording { background: #c62828; color: white; animation: pulse 1s infinite; }
.btn-pdf { background: #f0f0f5; color: #c1993d; font-size: 20px; }
.btn-pdf.loading { background: #ffb74d; color: white; animation: pulse 1s infinite; }
.btn-pdf.activo { background: #c1993d; color: white; }
.btn-img { background: #f0f0f5; color: #5b2c85; font-size: 20px; }
.btn-img.loading { background: #9c27b0; color: white; animation: pulse 1s infinite; }
.btn-img.activo { background: #5b2c85; color: white; }
.pdf-badge { display: inline-block; background: #c1993d; color: white; border-radius: 10px; padding: 2px 8px; font-size: 11px; margin-left: 6px; font-weight: 600; }
.pdf-info { background: #fff8e1; border: 1px solid #c1993d; border-left: 4px solid #c1993d; color: #6b5120; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin: 4px 0; }
.pdf-info b { color: #c1993d; }
.pdf-info .pdf-close { float: right; background: none; border: none; color: #c1993d; font-size: 16px; cursor: pointer; padding: 0 4px; }
.btn-circle:hover { transform: scale(1.08); }
.btn-circle:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(198,40,40,0.4); } 50% { box-shadow: 0 0 0 12px rgba(198,40,40,0); } }

/* SPEAKING INDICATOR */
.speaking-bar { display: none; align-items: center; gap: 8px; padding: 8px 16px; background: rgba(36,37,129,0.05); border-top: 1px solid #e8e8e8; }
.speaking-bar.active { display: flex; }
.speaking-waves { display: flex; gap: 3px; align-items: center; }
.speaking-waves span { width: 4px; background: #242581; border-radius: 2px; animation: wave 0.8s infinite; }
.speaking-waves span:nth-child(1) { height: 12px; animation-delay: 0s; }
.speaking-waves span:nth-child(2) { height: 18px; animation-delay: 0.1s; }
.speaking-waves span:nth-child(3) { height: 14px; animation-delay: 0.2s; }
.speaking-waves span:nth-child(4) { height: 20px; animation-delay: 0.3s; }
.speaking-waves span:nth-child(5) { height: 10px; animation-delay: 0.4s; }
@keyframes wave { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1); } }
.speaking-text { font-size: 13px; color: #242581; flex: 1; }
.speaking-stop { background: none; border: 1px solid #c62828; color: #c62828; border-radius: 16px; padding: 4px 12px; font-size: 12px; cursor: pointer; }

/* DOTS */
.dots span { animation: dotPulse 1.4s infinite; font-size: 18px; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse { 0%,80%,100% { opacity: 0.3; } 40% { opacity: 1; } }

/* PUTO AMO MODE */
.puto-amo .msg-bot { background: white; color: #333; border: 1px solid #e0e0e0; }
.puto-amo .msg-bot b, .puto-amo .msg-bot strong { color: #CC0000; }
.puto-amo .msg-user { background: #CC0000; }
.puto-amo .chat-input { background: white; color: #333; border-color: #ccc; }
.puto-amo .chat-input:focus { border-color: #CC0000; }
.puto-amo .chat-input-area { background: #f5f5f5; border-color: #ddd; }

/* MODO OPERADOR - Terminal verde retro */
.modo-operador .chat-header { background: linear-gradient(135deg, #003300, #005500) !important; }
.modo-operador .chat-messages { background: #0a0a0a; }
.modo-operador .msg-bot { background: #1a1a1a; color: #33ff33; border: 1px solid #2a2a2a; font-family: "Courier New", monospace; }
.modo-operador .msg-bot b, .modo-operador .msg-bot strong { color: #66ff66; }
.modo-operador .msg-bot table { color: #33ff33; background: #1a1a1a; }
.modo-operador .msg-bot th { background: #003300; color: #33ff33; }
.modo-operador .msg-bot td { border-bottom-color: #1a3a1a; color: #33ff33; }
.modo-operador .msg-bot tr:nth-child(even) { background: #222222; }
.modo-operador .msg-bot tr:hover { background: #2a2a2a; }
.modo-operador .msg-bot pre, .modo-operador .msg-bot code { background: #111111; color: #33ff33; }
.modo-operador .msg-bot .tabla-mono { background: #111111; color: #33ff33; }
.modo-operador .msg-user { background: #005500; color: #33ff33; }
.modo-operador .chat-input { background: #0a0a0a; color: #33ff33; border-color: #1a3a1a; font-family: "Courier New", monospace; }
.modo-operador .chat-input::placeholder { color: #1a6a1a; }
.modo-operador .chat-input:focus { border-color: #33ff33; }
.modo-operador .chat-input-area { background: #050505; border-color: #1a3a1a; }
.modo-operador .btn-leer, .modo-operador .btn-csv { color: #33ff33; border-color: #1a3a1a; }
.modo-operador .btn-leer:hover, .modo-operador .btn-csv:hover { border-color: #33ff33; }
.modo-operador .msg-error { background: #1a0000; color: #ff3333; }
.modo-operador .msg-typing { background: #0d1a0d; color: #1a6a1a; }

/* STAR WARS CRAWL */
.sw-container { overflow: hidden; height: 400px; position: relative; background: #000; border-radius: 12px; display: flex; align-items: flex-start; justify-content: center; }
.sw-crawl { position: relative; width: 90%; text-align: center; font-family: "Franklin Gothic", "Arial Narrow", sans-serif; color: #FFD700; font-size: 17px; line-height: 1.8; font-weight: bold; letter-spacing: 2px; padding: 20px; animation: swCrawl 30s linear forwards; }
@keyframes swCrawl { 0% { margin-top: 400px; opacity: 1; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { margin-top: -800px; opacity: 0; } }
.sw-title { color: #FFD700; font-size: 28px; text-align: center; font-family: "Franklin Gothic", "Arial Narrow", sans-serif; letter-spacing: 6px; margin-bottom: 20px; }

/* WAR GAMES TYPEWRITER */
.wargames-typing { font-family: "Courier New", monospace !important; }
.wg-cursor { animation: blink 0.7s infinite; font-weight: bold; }
@keyframes blink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }

/* HIDDEN */
.hidden { display: none !important; }

/* SAFE AREAS (mobile) */
@supports (padding-top: env(safe-area-inset-top)) {
    .chat-header { padding-top: calc(12px + env(safe-area-inset-top)); }
    .login-screen { padding-top: env(safe-area-inset-top); }
    .chat-input-area { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* MENU DESPLEGABLE */
.chat-menu { position: absolute; top: 100%; right: 0; background: white; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); min-width: 220px; z-index: 100; overflow: hidden; }
.chat-menu.hidden { display: none; }
.chat-menu-item { padding: 12px 16px; cursor: pointer; font-size: 14px; color: #333; border-bottom: 1px solid #eee; transition: background 0.2s; }
.chat-menu-item:last-child { border-bottom: none; }
.chat-menu-item:hover { background: #f0f0f5; }
.puto-amo .chat-menu { background: #1a0000; border: 1px solid #550000; }
.puto-amo .chat-menu-item { color: #ff9999; border-color: #330000; }
.puto-amo .chat-menu-item:hover { background: #2a0000; }
.modo-operador .chat-menu { background: #0a0a0a; border: 1px solid #005500; }
.modo-operador .chat-menu-item { color: #33ff33; border-color: #003300; font-family: 'Courier New', monospace; }
.modo-operador .chat-menu-item:hover { background: #001a00; }
/* HISTORIAL DIAS */
.historial-dia { padding: 10px 16px; cursor: pointer; border-bottom: 1px solid #eee; font-size: 14px; }
.historial-dia:hover { background: #f0f0f5; }
.historial-dia .fecha { font-weight: bold; color: #242581; }
.historial-dia .count { color: #999; font-size: 12px; }
.chat-menu-separator { height: 1px; background: #ddd; margin: 4px 0; }
.puto-amo .chat-menu-separator { background: #550000; }
.modo-operador .chat-menu-separator { background: #005500; }

/* MODO NEXUS — panel de alertas y vigilancias */
.modo-nexus { background: #0a0a0a; }
.modo-nexus .chat-header { background: linear-gradient(135deg, #0d0d0d, #1a0a00, #2d1200) !important; border-bottom: 1px solid #ff6a00; }
.modo-nexus .chat-header-title { font-size: 18px; font-weight: 900; letter-spacing: 2px; color: #fff; }
.modo-nexus .chat-header-client { color: #ff6a00; opacity: 1; }
.modo-nexus .chat-messages { background: #0a0a0a !important; padding: 0 !important; display: flex; flex-direction: column; overflow: hidden; }
.modo-nexus .chat-input-area { background: #0f0f0f; border-top: 2px solid #ff6a00; }
.modo-nexus .chat-input { background: #141414; color: #f0f0f0; border: 1px solid #2a1500; caret-color: #ff6a00; }
.modo-nexus .chat-input:focus { border-color: #ff6a00; box-shadow: 0 0 0 2px rgba(255,106,0,.25); }
.modo-nexus .chat-menu { background: #141414; border-color: #2a1500; }
.modo-nexus .chat-menu-item { color: #d0d0d0; }
.modo-nexus .chat-menu-item:hover { background: #2d1200; color: #ff6a00; }
.modo-nexus .chat-menu-separator { background: #2a1500; }
.modo-nexus .speaking-bar { background: #141414; border-top-color: #ff6a00; color: #ff6a00; }
.modo-nexus .sidebar-overlay { background: rgba(0,0,0,0.7); }

/* Sidebar NEXUS — panel vigilancias */
.modo-nexus .sidebar, .nexus-sidebar-open { background: #0d0d0d !important; border-right: 1px solid #2a1500 !important; }
.nexus-sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px; border-bottom: 1px solid #2a1500; }
.nexus-sidebar-title { color: #ff6a00; font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.nexus-sidebar-btn { background: none; border: 1px solid #ff6a00; color: #ff6a00; border-radius: 6px; padding: 3px 8px; font-size: 11px; cursor: pointer; }
.nexus-sidebar-btn:hover { background: rgba(255,106,0,.15); }
.nexus-vig-list { flex: 1; overflow-y: auto; padding: 8px; }
.nexus-vig-empty { color: #888; font-size: 12px; text-align: center; padding: 20px 10px; }
.nexus-vig-item { background: #0d0d0d; border: 1px solid #1e1e1e; border-radius: 6px; margin-bottom: 6px; transition: opacity .2s; overflow: hidden; }
.nexus-vig-header { display: flex; align-items: flex-start; gap: 8px; padding: 8px 6px; }
.nexus-vig-header:hover { background: #151515; }
.nexus-vig-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.nexus-vig-txt { font-size: 12px; color: #999; line-height: 1.4; }
.nexus-vig-meta { font-size: 10px; color: #555; margin-top: 2px; }
.nexus-vig-action-btn { background: none; border: none; color: #555; font-size: 12px; cursor: pointer; padding: 2px 4px; flex-shrink: 0; line-height: 1; transition: color .15s; }
.nexus-vig-action-btn:hover { color: #ccc; }
.nexus-vig-log { padding: 6px 10px 8px; background: #080808; border-top: 1px solid #1a1a1a; max-height: 180px; overflow-y: auto; }

/* Feed de alertas */
.nexus-feed-header { background: #0f0f0f; border-bottom: 1px solid #1e1000; padding: 10px 16px; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nexus-filtros { background: #0a0a0a; border-bottom: 1px solid #1a1a1a; padding: 6px 12px; display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }
.nexus-filtro-btn { background: transparent; border: 1px solid #333; color: #555; border-radius: 20px; padding: 3px 12px; font-size: 11px; font-weight: 700; cursor: pointer; transition: all .2s; letter-spacing: .3px; }
.nexus-filtro-btn:hover { border-color: #888; color: #ccc; }
.nexus-filtro-btn.activo { background: #ff6a00; border-color: #ff6a00; color: #111; }
.nexus-feed { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.nexus-analizando { display: flex; align-items: center; gap: 10px; background: #141414; border: 1px dashed #2a1500; border-radius: 10px; padding: 12px 16px; font-size: 13px; color: #666; }

/* Card de alerta */
.nexus-alerta { background: #111; border: 1px solid #2a1500; border-radius: 10px; animation: alertaIn .3s ease; transition: opacity .3s, transform .3s, border-color .3s, box-shadow .3s; }
@keyframes alertaIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
.nexus-alerta-top { display: flex; align-items: center; gap: 8px; padding: 9px 12px 8px; border-bottom: 1px solid #1e1000; background: #0d0d0d; }
.nexus-alerta-icono { font-size: 14px; }
.nexus-alerta-nivel { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; flex: 1; }
.nexus-alerta-ts { font-size: 11px; color: #444; }
.nexus-alerta-close { background: none; border: none; color: #444; cursor: pointer; font-size: 14px; padding: 0 2px; line-height: 1; }
.nexus-alerta-close:hover { color: #ff6a00; }
.nexus-alerta-sec { padding: 8px 12px; font-size: 13px; color: #bbb; line-height: 1.5; border-bottom: 1px solid #1a1a1a; }
.nexus-alerta-sec:last-of-type { border-bottom: none; }
.nexus-sec-lbl { display: inline-block; font-size: 10px; font-weight: 700; color: #555; letter-spacing: 1px; text-transform: uppercase; margin-right: 6px; margin-bottom: 3px; }
.nexus-propuesta { background: #0f0a00; }
.nexus-propuesta .nexus-sec-lbl { color: #ff6a00; }
.nexus-impacto .nexus-sec-lbl { color: #888; }
.nexus-accion { background: #0a0f00; }
.nexus-accion .nexus-sec-lbl { color: #88cc00; }
.nexus-alerta-btns { display: flex; gap: 8px; padding: 8px 12px; background: #0d0d0d; border-top: 1px solid #1e1000; flex-wrap: wrap; align-items: center; }
.nexus-btn-confirm { background: #0f1a00; border: 1px solid #88cc00; color: #88cc00; border-radius: 6px; padding: 5px 14px; font-size: 12px; font-weight: 700; cursor: pointer; transition: all .2s; }
.nexus-btn-confirm:hover { background: #88cc00; color: #0a0a0a; }
.nexus-btn-watch { background: transparent; border: 1px solid #555; color: #888; border-radius: 6px; padding: 5px 14px; font-size: 12px; font-weight: 700; cursor: pointer; transition: all .2s; margin-left: auto; }
.nexus-btn-watch:hover { border-color: #ff6a00; color: #ff6a00; }
.nexus-btn-dismiss { background: none; border: 1px solid #2a1500; color: #555; border-radius: 6px; padding: 5px 14px; font-size: 12px; cursor: pointer; transition: all .2s; }
.nexus-btn-dismiss:hover { border-color: #ff3300; color: #ff3300; }

/* Pulso NEXUS */
.nexus-pulse { width: 8px; height: 8px; background: #ff6a00; border-radius: 50%; display: inline-block; animation: nexusPulse 1.5s infinite; flex-shrink: 0; }
@keyframes nexusPulse { 0%,100%{box-shadow:0 0 0 0 rgba(255,106,0,.6)} 50%{box-shadow:0 0 0 5px rgba(255,106,0,0)} }

/* NEXUS: ocultar controles URPLANIA, mostrar los de NEXUS */
#wrapMenuNexus { display: none; }
.modo-nexus #wrapModelo,
.modo-nexus #wrapMenu,
.modo-nexus .sidebar-toggle { display: none !important; }
.modo-nexus #wrapMenuNexus { display: block; }
.modo-nexus .chat-menu { background: #141414 !important; border: 1px solid #2a1500 !important; }
.modo-nexus #chatMenuNexus .chat-menu-item { color: #d0d0d0; }
.modo-nexus #chatMenuNexus .chat-menu-item:hover { background: #2d1200; color: #ff6a00; }
.modo-nexus #chatMenuNexus .chat-menu-separator { background: #2a1500; }
/* Ocultar botones PDF/IMG en NEXUS (no aplican) */
.modo-nexus #btnPdf,
.modo-nexus #btnImg { display: none; }
