/* ═══════════════════════════════════════════════════════════════
   Skein CEO Agent — Executive Design System
   Dark glass + aurora · Inter / Fira Code · #6cc4a5 brand
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-0: #070b0a;
  --bg-1: #0b100f;
  --bg-2: #101716;
  --bg-3: #16201e;
  --glass: rgba(18, 26, 24, 0.72);
  --glass-soft: rgba(22, 32, 30, 0.55);
  --line: rgba(108, 196, 165, 0.14);
  --line-strong: rgba(108, 196, 165, 0.32);
  --green: #6cc4a5;
  --green-soft: rgba(108, 196, 165, 0.16);
  --green-glow: rgba(108, 196, 165, 0.45);
  --blue: #5090d0;
  --amber: #f0a030;
  --red: #e05252;
  --text-1: #eef5f2;
  --text-2: #a8bcb5;
  --text-3: #647a73;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'Fira Code', monospace;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --tr: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text-1);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; color: inherit; }
[hidden] { display: none !important; }
kbd {
  font-family: var(--mono); font-size: 10px; padding: 2px 6px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line);
  border-radius: 5px; color: var(--text-3);
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(108,196,165,0.18); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(108,196,165,0.34); }
::selection { background: var(--green-soft); }

.glass {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  border: 1px solid var(--line);
}

/* ═══ Aurora background ═══ */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora-blob {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.75;
  will-change: transform;
}
.a1 { width: 78vmax; height: 78vmax; top: -32vmax; left: -22vmax;
  background: radial-gradient(circle, rgba(108,196,165,0.38), transparent 65%);
  animation: drift1 26s ease-in-out infinite alternate; }
.a2 { width: 64vmax; height: 64vmax; bottom: -26vmax; right: -16vmax;
  background: radial-gradient(circle, rgba(80,144,208,0.28), transparent 65%);
  animation: drift2 32s ease-in-out infinite alternate; }
.a3 { width: 50vmax; height: 50vmax; top: 35%; left: 45%;
  background: radial-gradient(circle, rgba(108,196,165,0.18), transparent 70%);
  animation: drift3 40s ease-in-out infinite alternate; }
.a4 { width: 42vmax; height: 42vmax; top: 10%; right: 8%;
  background: radial-gradient(circle, rgba(80,144,208,0.14), transparent 70%);
  animation: drift1 50s ease-in-out infinite alternate-reverse; }
.aurora-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(108,196,165,0.038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108,196,165,0.038) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 100%);
}
@keyframes drift1 { to { transform: translate(8vmax, 6vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-7vmax, -5vmax) scale(1.1); } }
@keyframes drift3 { to { transform: translate(-10vmax, 4vmax); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ═══ Avatars ═══ */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #07110d;
  background: var(--green);
}

/* ═══ Buttons ═══ */
.ghost-btn {
  width: 30px; height: 30px; border-radius: 8px; font-size: 14px;
  color: var(--text-3); display: inline-flex; align-items: center; justify-content: center;
  transition: var(--tr);
}
.ghost-btn:hover { background: rgba(255,255,255,0.07); color: var(--text-1); }
.primary-btn {
  width: 100%; padding: 13px; border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--green), #4da888);
  color: #06120d; font-weight: 700; font-size: 15px;
  transition: var(--tr); box-shadow: 0 6px 22px rgba(108,196,165,0.25);
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(108,196,165,0.4); }
.kbd-hint { opacity: 0.55; font-size: 12px; margin-left: 6px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); border: 1px solid var(--line);
  background: rgba(255,255,255,0.03); transition: var(--tr);
}
.chip-btn:hover { border-color: var(--line-strong); color: var(--text-1); background: var(--green-soft); }
.chip-btn.on { background: var(--green-soft); border-color: var(--line-strong); color: var(--green); }
.voice-cta { border-color: var(--line-strong); color: var(--green); }
.voice-cta:hover { box-shadow: 0 0 18px rgba(108,196,165,0.3); }

/* ═══════════════ TTS PILL ═══════════════ */
.tts-pill {
  position: relative;
  display: inline-flex; align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  transition: var(--tr);
}
.tts-pill:hover { border-color: var(--line-strong); }
.tts-main {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; border-radius: 999px 0 0 999px;
  color: var(--text-3); transition: var(--tr); padding-left: 6px;
}
.tts-main.on { color: var(--green); }
.tts-main:hover { color: var(--text-1); }
.tts-caret {
  padding: 0 8px 0 2px; height: 32px; font-size: 9px; color: var(--text-3);
  display: inline-flex; align-items: center; border-radius: 0 999px 999px 0;
  transition: var(--tr);
}
.tts-caret:hover { color: var(--text-1); }
.voice-popover {
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%);
  width: 220px; background: var(--bg-2); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); padding: 8px; box-shadow: var(--shadow); z-index: 200;
  animation: pop-up 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes pop-up {
  from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)   scale(1);    }
}
.vp-label {
  font-size: 10.5px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.08em; padding: 4px 8px 8px;
}
.vp-opt {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-sm); text-align: left;
  transition: var(--tr);
}
.vp-opt:hover { background: var(--green-soft); }
.vp-opt.active { background: rgba(108,196,165,0.12); }
.vp-check { width: 16px; text-align: center; font-size: 13px; color: var(--green); flex-shrink: 0; }
.vp-info { display: flex; flex-direction: column; gap: 1px; }
.vp-name { font-size: 13px; font-weight: 600; color: var(--text-1); }
.vp-tag  { font-size: 11px; color: var(--text-3); }

/* ═══════════════ LOGIN (Landing Page) ═══════════════ */
.login-screen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card {
  width: 100%; max-width: 448px; border-radius: 28px;
  padding: 52px 44px 40px;
  box-shadow: 0 40px 120px rgba(0,0,0,0.72), 0 0 0 1px rgba(108,196,165,0.13);
  animation: rise 0.65s cubic-bezier(0.2, 0.9, 0.3, 1);
  text-align: center;
  position: relative; overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(108,196,165,0.75), transparent);
}
@keyframes rise { from { opacity: 0; transform: translateY(28px) scale(0.97); } }

/* logo + glow */
.login-brand { margin-bottom: 0; }
.login-logo-wrap {
  position: relative; display: inline-block;
  margin-bottom: 24px; margin-top: 4px;
}
.login-logo-glow {
  position: absolute; inset: -18px;
  background: radial-gradient(circle, rgba(108,196,165,0.32), transparent 68%);
  border-radius: 50%; z-index: 0;
  animation: pulse-glow 3.5s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}
.login-logo {
  width: 80px; height: 80px; border-radius: 22px;
  box-shadow: 0 0 28px rgba(108,196,165,0.28), 0 12px 32px rgba(0,0,0,0.5);
  position: relative; z-index: 1; display: block;
}

/* title */
.login-title-text {
  font-size: 38px; font-weight: 800; letter-spacing: -1.5px;
  line-height: 1.05; margin-bottom: 10px;
  background: linear-gradient(140deg, #f0f8f4 0%, #a8e8cc 45%, var(--green) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.login-subtitle {
  color: var(--text-2); font-size: 14.5px; font-weight: 500;
  letter-spacing: -0.1px; margin-bottom: 8px;
}
.login-desc {
  color: var(--text-3); font-size: 13px; line-height: 1.65; margin-bottom: 0;
}

/* divider */
.login-divider {
  height: 1px; margin: 28px -44px 26px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

/* inputs */
#local-login-section { text-align: left; }
#login-username, #login-password {
  width: 100%; padding: 14px 16px;
  background: rgba(0,0,0,0.32); border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 15px; outline: none; transition: var(--tr); color: var(--text-1);
}
#login-username { margin-bottom: 10px; }
#login-password { margin-bottom: 18px; }
#login-username::placeholder, #login-password::placeholder { color: var(--text-3); }
#login-username:focus, #login-password:focus {
  border-color: var(--green); box-shadow: 0 0 0 3px rgba(108,196,165,0.15);
}

.login-error { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 8px; text-align: center; }
.login-footer {
  margin-top: 28px; color: var(--text-3); font-size: 11px; letter-spacing: 0.05em;
}

/* Microsoft SSO button — dark glass theme */
.sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 14px 22px; margin-top: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--r-md);
  color: var(--text-1); font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background 0.22s, border-color 0.22s, transform 0.22s, box-shadow 0.22s;
}
.sso-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(108,196,165,0.55);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35), 0 0 0 1px rgba(108,196,165,0.18);
}
.sso-btn:active { transform: translateY(0); }

/* Switch account hint */
.sso-switch-link {
  display: block; text-align: center; margin-top: 13px;
  color: var(--text-3); font-size: 12.5px;
  text-decoration: none; transition: color 0.2s;
}
.sso-switch-link:hover { color: var(--green); text-decoration: underline; }

/* SSO error box */
.sso-error-box:not(:empty) {
  background: rgba(224,82,82,0.1);
  border: 1px solid rgba(224,82,82,0.3);
  border-radius: var(--r-sm);
  padding: 10px 14px; margin-top: 14px;
  text-align: left; color: var(--red); font-size: 13px;
}

/* Feature pills */
.login-features {
  display: flex; flex-wrap: wrap; gap: 7px; justify-content: center;
  margin-top: 16px;
}
.lf-pill {
  font-size: 11.5px; padding: 4px 11px;
  background: var(--green-soft); color: var(--green);
  border-radius: 100px; border: 1px solid rgba(108,196,165,0.22);
  font-weight: 500; letter-spacing: 0.02em;
}

/* ═══════════════ APP LAYOUT ═══════════════ */
.app { position: relative; z-index: 1; display: flex; height: 100vh; height: 100dvh; }

/* ─── Sidebar ─── */
.sidebar {
  width: 290px; flex-shrink: 0; display: flex; flex-direction: column;
  border-right: 1px solid var(--line); border-top: none; border-bottom: none; border-left: none;
  transition: margin var(--tr);
}
.sidebar.collapsed { margin-left: -290px; }
.sb-head { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; }
.sb-logo { width: 26px; height: 26px; border-radius: 7px; }
.sb-brand { font-weight: 800; font-size: 15px; letter-spacing: -0.3px; flex: 1; }
.new-chat-btn {
  margin: 6px 14px 12px; padding: 11px 14px; border-radius: var(--r-sm);
  display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600;
  color: var(--text-1); border: 1px solid var(--line-strong);
  background: var(--green-soft); transition: var(--tr);
}
.new-chat-btn:hover { box-shadow: 0 0 16px rgba(108,196,165,0.22); transform: translateY(-1px); }
.new-chat-btn kbd { margin-left: auto; }
.sb-search { padding: 0 14px 10px; }
.sb-search input {
  width: 100%; padding: 9px 12px; font-size: 13px;
  background: rgba(0,0,0,0.3); border: 1px solid var(--line); border-radius: var(--r-sm);
  outline: none; transition: var(--tr);
}
.sb-search input:focus { border-color: var(--green); }
.history-list { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.h-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-3); padding: 12px 8px 6px; }
.h-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 10px; border-radius: var(--r-sm); font-size: 13px; text-align: left;
  color: var(--text-2); transition: var(--tr); position: relative;
}
.h-item:hover { background: rgba(255,255,255,0.05); color: var(--text-1); }
.h-item.current { background: var(--green-soft); color: var(--text-1); border-left: 2px solid var(--green); }
.h-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-del { opacity: 0; font-size: 12px; color: var(--text-3); transition: var(--tr); flex-shrink: 0; }
.h-item:hover .h-del { opacity: 1; }
.h-del:hover { color: var(--red); }
.h-empty { color: var(--text-3); font-size: 12.5px; text-align: center; padding: 26px 12px; }
.sb-foot { border-top: 1px solid var(--line); padding: 12px 14px; }
.sb-user { display: flex; align-items: center; gap: 11px; }
.sb-user-meta { flex: 1; min-width: 0; }
.sb-username { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-userrole { font-size: 11.5px; color: var(--text-3); }

/* ─── Sidebar tools nav ─── */
.sb-section-header {
  font-size: 10px; font-weight: 700; letter-spacing: 1.4px;
  color: var(--text-3); padding: 16px 18px 6px;
}
.sb-nav-links { display: flex; flex-direction: column; gap: 2px; padding: 0 10px 10px; }
.sb-nav-btn {
  display: flex; align-items: center; width: 100%;
  padding: 9px 12px; border-radius: var(--r-sm); font-size: 13px; text-align: left;
  color: var(--text-2); transition: var(--tr);
}
.sb-nav-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-1); }
.sb-nav-btn.active { background: var(--green-soft); color: var(--text-1); border-left: 2px solid var(--green); padding-left: 10px; }
.sb-nav-btn--soon { opacity: 0.4; cursor: default; pointer-events: none; }
.sb-nav-btn--soon::after { content: ' · pronto'; font-size: 10px; color: var(--text-3); letter-spacing: 0.5px; }

/* ─── Main column ─── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px; border-left: none; border-right: none; border-top: none;
}
.topbar-menu { display: inline-flex; } /* Antes estaba en none on desktop, ahora lo mostramos siempre si hace falta o lo gestionamos por CSS. Lo mejor es siempre visible si esta collapsed, pero para no liarnos, inline-flex siempre y via clase en JS o simplemente que quede ahí como un menu hamburguesa */
.topbar-title { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; flex: 1; min-width: 0; }
#topbar-conv-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 8px var(--green-glow); flex-shrink: 0;
}
.status-dot.busy { background: var(--amber); box-shadow: 0 0 8px rgba(240,160,48,0.5); animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
.topbar-actions { display: flex; gap: 8px; }
.chip-label { display: inline; }

/* ─── Chat scroll ─── */
.chat-scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; padding: 0 20px; }
.chat-messages { max-width: 860px; margin: 0 auto; padding: 22px 0 10px; display: flex; flex-direction: column; gap: 22px; }

/* ─── Welcome ─── */
.welcome { max-width: 760px; margin: 7vh auto 0; text-align: center; padding: 0 10px 30px; }
.w-orb {
  width: 86px; height: 86px; margin: 0 auto 26px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(180,240,215,0.9), var(--green) 45%, #1d5c46 100%);
  box-shadow: 0 0 60px rgba(108,196,165,0.45), inset 0 0 24px rgba(255,255,255,0.25);
  animation: breathe 4.5s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.07); box-shadow: 0 0 90px rgba(108,196,165,0.6), inset 0 0 24px rgba(255,255,255,0.25); } }
.welcome h2 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(120deg, var(--text-1) 30%, var(--green)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.w-sub { color: var(--text-2); font-size: 15px; margin: 12px auto 30px; max-width: 540px; line-height: 1.6; }
.suggest-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; text-align: left; }
.suggest-card {
  padding: 16px 18px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--glass-soft); transition: var(--tr); cursor: pointer;
}
.suggest-card:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,0.4); background: var(--green-soft); }
.suggest-cat { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; color: var(--green); margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.suggest-q { font-size: 13.5px; color: var(--text-1); line-height: 1.45; }

/* ─── Messages ─── */
.msg { display: flex; gap: 14px; animation: msgIn 0.3s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } }
.msg.user { flex-direction: row-reverse; }
.msg-avatar { flex-shrink: 0; margin-top: 2px; }
.msg-body { max-width: 78%; min-width: 0; }
.msg.user .msg-body {
  background: linear-gradient(135deg, rgba(108,196,165,0.16), rgba(108,196,165,0.07));
  border: 1px solid var(--line); border-radius: var(--r-md) var(--r-md) 4px var(--r-md);
  padding: 13px 17px; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
.msg.agent .msg-body { width: 100%; max-width: 100%; }
.agent-card {
  background: var(--glass-soft); border: 1px solid var(--line);
  border-radius: 4px var(--r-md) var(--r-md) var(--r-md);
  padding: 16px 20px; backdrop-filter: blur(14px);
}

/* tool timeline inside agent message */
.tool-timeline { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.tool-step {
  display: flex; align-items: center; gap: 9px; font-size: 12.5px;
  color: var(--text-2); font-family: var(--mono);
}
.tool-step .ts-icon { width: 17px; text-align: center; }
.tool-step.calling .ts-icon { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.tool-step.done { color: var(--green); }
.tool-step .ts-time { margin-left: auto; color: var(--text-3); font-size: 11px; }

/* thinking shimmer */
.thinking { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13.5px; }
.thinking-dots { display: inline-flex; gap: 4px; }
.thinking-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: bounce 1.2s infinite; }
.thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 30% { transform: translateY(-5px); opacity: 0.5; } }

/* markdown content */
.md { font-size: 14.5px; line-height: 1.65; color: var(--text-1); word-break: break-word; }
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }
.md p { margin: 10px 0; }
.md h1, .md h2, .md h3 { margin: 18px 0 8px; font-weight: 700; letter-spacing: -0.2px; }
.md h1 { font-size: 19px; } .md h2 { font-size: 17px; } .md h3 { font-size: 15px; color: var(--green); }
.md ul, .md ol { margin: 10px 0; padding-left: 24px; }
.md li { margin: 4px 0; }
.md strong { color: var(--green); font-weight: 700; }
.md a { color: var(--blue); }
.md img, .md svg, .md canvas { max-width: 100%; height: auto; border-radius: var(--r-md); margin: 12px 0; }
.md code { font-family: var(--mono); font-size: 12.5px; background: rgba(108,196,165,0.1); padding: 2px 6px; border-radius: 5px; }
.md pre { background: rgba(0,0,0,0.45); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; overflow-x: auto; margin: 12px 0; }
.md pre code { background: none; padding: 0; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.md blockquote { border-left: 3px solid var(--green); padding: 4px 14px; margin: 10px 0; color: var(--text-2); }
.md table {
  width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; display: block; overflow-x: auto;
}
.md-table-wrap { overflow-x: auto; margin: 14px 0; border-radius: var(--r-sm); border: 1px solid rgba(108,196,165,0.18); }
.md-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0; border: none; display: table; }
.md th { background: rgba(108,196,165,0.12); color: var(--green); font-weight: 700; text-align: left; padding: 9px 13px; white-space: nowrap; }
.md td { padding: 8px 13px; border-top: 1px solid rgba(108,196,165,0.08); }
.md tr:nth-child(even) td { background: rgba(255,255,255,0.018); }

/* streaming caret */
.caret { display: inline-block; width: 8px; height: 16px; background: var(--green); margin-left: 2px; vertical-align: text-bottom; animation: caret 0.9s steps(2) infinite; border-radius: 2px; }
@keyframes caret { 50% { opacity: 0; } }

/* message actions */
.msg-actions { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; opacity: 0; transition: opacity var(--tr); pointer-events: none; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; pointer-events: auto; }
.act-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--text-3); border: 1px solid transparent; transition: var(--tr);
}
.act-btn:hover { color: var(--text-1); background: rgba(255,255,255,0.06); border-color: var(--line); }
.act-btn.on-up { color: var(--green); background: var(--green-soft); }
.act-btn.on-down { color: var(--red); background: rgba(224,82,82,0.12); }
.act-btn.report { color: var(--green); border-color: var(--line); }
.act-btn:disabled { opacity: 0.45; cursor: default; }

/* strategic perspective block */
.md .strategic { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; }

/* ─── Scroll-down button ─── */
.scroll-down {
  position: absolute; bottom: 130px; right: 28px; z-index: 5;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--line-strong); color: var(--green);
  font-size: 16px; box-shadow: var(--shadow); transition: var(--tr);
}
.scroll-down:hover { transform: translateY(-2px); }

/* ─── Composer ─── */
.composer-wrap { position: relative; padding: 8px 20px calc(14px + env(safe-area-inset-bottom)); max-width: 900px; margin: 0 auto; width: 100%; }
.tool-strip {
  display: flex; gap: 8px; flex-wrap: wrap; padding: 0 4px 8px;
  font-family: var(--mono); font-size: 11.5px; color: var(--text-2);
}
.tool-strip .tchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--glass-soft);
}
.tool-strip .tchip.calling { border-color: var(--amber); color: var(--amber); animation: pulse 1.2s infinite; }
.tool-strip .tchip.done { border-color: var(--line-strong); color: var(--green); }
.composer {
  display: flex; align-items: flex-end; gap: 8px;
  border-radius: var(--r-lg); padding: 10px 12px 10px 18px;
  transition: var(--tr); box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}
.composer:focus-within { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(108,196,165,0.1), 0 10px 40px rgba(0,0,0,0.4); }
#chat-input {
  flex: 1; background: none; border: none; outline: none; resize: none;
  font-size: 14.5px; line-height: 1.5; max-height: 180px; padding: 7px 0;
}
#chat-input::placeholder { color: var(--text-3); }

.composer-actions {
  display: flex; align-items: center; gap: 8px; margin-bottom: 2px;
}
.act-icon-btn {
  width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--text-3); transition: var(--tr);
}
.act-icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-1); border-color: var(--line); }
.act-icon-btn.on { color: var(--green); background: var(--green-soft); border-color: var(--line-strong); }
.act-icon-btn.voice { color: var(--green); }
.act-icon-btn.voice:hover { background: var(--green-soft); border-color: var(--line-strong); box-shadow: 0 0 16px var(--green-glow); }

.send-btn, .stop-btn {
  width: 40px; height: 40px; border-radius: 50%; font-size: 16px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; transition: var(--tr);
}
.send-btn { background: linear-gradient(135deg, var(--green), #4da888); color: #06120d; }
.send-btn:disabled { background: var(--bg-3); color: var(--text-3); cursor: default; }
.send-btn:not(:disabled):hover { transform: scale(1.07); box-shadow: 0 0 18px rgba(108,196,165,0.4); }
.stop-btn { background: rgba(224,82,82,0.15); color: var(--red); border: 1px solid rgba(224,82,82,0.35); }
.stop-btn:hover { background: rgba(224,82,82,0.28); }
.composer-hint { text-align: center; color: var(--text-3); font-size: 11px; margin-top: 9px; }

/* ═══════════════ COMMAND PALETTE ═══════════════ */
.palette-overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(4,8,7,0.6);
  backdrop-filter: blur(6px); display: flex; justify-content: center; padding-top: 14vh;
}
.palette {
  width: 100%; max-width: 580px; height: fit-content; max-height: 62vh;
  border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column; animation: rise 0.22s ease;
}
#palette-input {
  width: 100%; padding: 17px 20px; background: none; border: none; outline: none;
  font-size: 16px; border-bottom: 1px solid var(--line);
}
.palette-list { overflow-y: auto; padding: 8px; }
.p-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 13px; border-radius: var(--r-sm); font-size: 13.5px; text-align: left;
  color: var(--text-2); transition: background 0.12s;
}
.p-item .pi-icon { width: 22px; text-align: center; font-size: 15px; }
.p-item .pi-label { flex: 1; }
.p-item .pi-hint { font-size: 11px; color: var(--text-3); }
.p-item.sel, .p-item:hover { background: var(--green-soft); color: var(--text-1); }
.p-cat { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.3px; color: var(--text-3); padding: 10px 13px 4px; }
.palette-foot { padding: 9px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--text-3); display: flex; gap: 12px; }

/* ═══════════════ VOICE OVERLAY ═══════════════ */
.voice-overlay {
  position: absolute; bottom: calc(100% + 12px); left: 18px; right: 180px; margin-inline: auto; z-index: 70;
  background: rgba(18, 26, 24, 0.55); backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); box-shadow: 0 18px 48px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  width: min(340px, calc(100vw - 40px)); padding: 22px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  animation: popIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes popIn { from { opacity: 0; transform: translateY(20px) scale(0.95); } }
.vo-stage { position: relative; width: 140px; height: 140px; display: flex; align-items: center; justify-content: center; }
#vo-canvas { width: 100%; height: 100%; }
.vo-orb-label {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  font-size: 12.5px; color: var(--text-2); letter-spacing: 0.4px; white-space: nowrap;
}
.vo-transcript {
  width: 100%; max-height: 120px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 7px; font-size: 13px;
}
.vt-line { padding: 7px 12px; border-radius: var(--r-md); line-height: 1.45; animation: msgIn 0.25s ease; }
.vt-line.user { align-self: flex-end; background: var(--green-soft); border: 1px solid var(--line); max-width: 88%; }
.vt-line.agent { align-self: flex-start; background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.07); color: var(--text-2); max-width: 88%; }
.vt-line.partial { opacity: 0.65; font-style: italic; }
.vo-tool {
  font-family: var(--mono); font-size: 11.5px; color: var(--amber);
  padding: 5px 12px; border: 1px solid rgba(240,160,48,0.35); border-radius: 999px;
  background: rgba(240,160,48,0.08); animation: pulse 1.2s infinite; text-align: center;
}
.vo-controls { display: flex; gap: 14px; margin-top: 4px; }
.vo-btn {
  width: 44px; height: 44px; border-radius: 50%; font-size: 17px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line);
  transition: var(--tr); display: inline-flex; align-items: center; justify-content: center;
}
.vo-btn:hover { background: var(--green-soft); border-color: var(--line-strong); transform: scale(1.06); }
.vo-btn.muted { background: rgba(224,82,82,0.18); border-color: rgba(224,82,82,0.4); }
.vo-end { background: rgba(224,82,82,0.15); border-color: rgba(224,82,82,0.35); color: var(--red); }
.vo-end:hover { background: rgba(224,82,82,0.3); border-color: var(--red); }

/* ═══════════════ TOASTS ═══════════════ */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  padding: 13px 17px; border-radius: var(--r-md); font-size: 13.5px; line-height: 1.45;
  background: var(--glass); backdrop-filter: blur(18px); border: 1px solid var(--line);
  box-shadow: var(--shadow); animation: toastIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  display: flex; align-items: flex-start; gap: 10px;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } }
.toast.error { border-color: rgba(224,82,82,0.45); }
.toast.success { border-color: var(--line-strong); }
.toast.out { animation: toastOut 0.25s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ═══ RIGHT PANEL DASHBOARD ═══ */
.right-panel {
  width: 320px; border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: width 0.3s ease, opacity 0.3s ease;
  flex-shrink: 0;
  background: rgba(6, 16, 12, 0.92);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  z-index: 100; overflow: hidden;
}
.right-panel.collapsed { width: 0; opacity: 0; border-left: none; }
.rp-inner { width: 320px; display: flex; flex-direction: column; height: 100%; }
.rp-header {
  padding: 16px 14px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.rp-title { font-weight: 700; font-size: 13.5px; letter-spacing: 0.3px; color: var(--green); }
.rp-widgets { padding: 12px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; flex: 1; }


/* ═══════════════ FUTURE RELEASES ═══════════════ */
.future-row { margin-top: 34px; text-align: left; }
.future-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.6px;
  color: var(--text-3); margin-bottom: 12px; text-align: center;
}
.future-chips { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }
.future-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); border: 1px dashed var(--line-strong);
  background: rgba(108,196,165,0.05); transition: var(--tr);
}
.future-chip:hover {
  color: var(--text-1); background: var(--green-soft); border-style: solid;
  transform: translateY(-2px); box-shadow: 0 6px 20px rgba(108,196,165,0.18);
}
.fc-icon { font-size: 14px; }
.fc-badge {
  font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: 1px;
  padding: 2px 7px; border-radius: 999px;
  background: linear-gradient(135deg, var(--green), #4da888); color: #06120d;
}
.future-modal { max-width: 440px; }
.fm-body { padding: 36px 34px 28px; text-align: center; }
.fm-icon { font-size: 46px; margin-bottom: 14px; animation: breathe 3.5s ease-in-out infinite; }
.fm-badge {
  display: inline-block; font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 2.5px; padding: 5px 14px; border-radius: 999px; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--green), #4da888); color: #06120d;
}
.fm-body h3 { font-size: 21px; font-weight: 800; letter-spacing: -0.4px; margin-bottom: 12px; }
.fm-body p { color: var(--text-2); font-size: 14px; line-height: 1.65; margin-bottom: 16px; }
.fm-phase {
  font-family: var(--mono); font-size: 11.5px; color: var(--green);
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  display: inline-block; margin-bottom: 24px; background: rgba(108,196,165,0.06);
}
.fm-actions { display: flex; gap: 12px; justify-content: center; align-items: center; }

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 40;
    transform: translateX(-100%); margin: 0 !important; transition: transform var(--tr);
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .topbar-menu { display: inline-flex; }
  .chip-label { display: none; }
  .suggest-grid { grid-template-columns: 1fr; }
  .msg-body { max-width: 92%; }
  .login-users { grid-template-columns: repeat(2, 1fr); }
  .chat-scroll { padding: 0 12px; }
  .composer-wrap { padding-left: 12px; padding-right: 12px; }
}

.tip-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tip-chips .tchip { cursor: default; background: rgba(30, 215, 96, 0.05); border-color: rgba(30, 215, 96, 0.2); }

/* ─── Greeting chips ───────────────────────────────────────────── */
.greeting-chips { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.gchip-group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-3); margin-top: 8px; margin-bottom: 2px; }
.gchip-group-label:first-child { margin-top: 0; }
.gchip {
  display: block; width: fit-content; max-width: 100%;
  background: rgba(108,196,165,0.07); border: 1px solid rgba(108,196,165,0.22);
  color: var(--text-1); font-size: 13px; line-height: 1.45;
  padding: 7px 13px; border-radius: var(--r-sm);
  text-align: left; cursor: pointer; transition: background 0.15s, border-color 0.15s;
  white-space: normal; word-break: break-word;
}
.gchip:hover { background: rgba(108,196,165,0.15); border-color: rgba(108,196,165,0.45); }
.gchip-resume { border-color: rgba(108,196,165,0.4); font-weight: 600; }
.gchip-resume:hover { background: rgba(108,196,165,0.2); }
.gchip-kbd-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════════════════════════
   KPI LIVE DASHBOARD — Executive Design System v2
   Dark glass · aurora accent · Inter · micro-animations
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Panel header ───────────────────────────────────────────────────────────── */
.rp-header {
  display: flex; align-items: center; padding: 16px 16px 12px; gap: 8px;
  border-bottom: 1px solid var(--line);
}
.rp-title {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--green); flex: 1;
}
.rp-header-actions { display: flex; align-items: center; gap: 4px; }
.rp-footer {
  display: flex; align-items: center; padding: 8px 16px;
  border-top: 1px solid var(--line); min-height: 34px;
}
.rp-refresh-info { font-size: 11px; color: var(--text-3); }

/* ── Widget list: single column, full-width ─────────────────────────────────── */
.rp-widgets {
  display: flex; flex-direction: column;
  gap: 7px;
  padding: 10px 10px 18px;
  overflow-y: auto;
  flex: 1;
}

/* chip-btn */
.chip-btn {
  font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: var(--r-sm);
  background: rgba(108,196,165,0.10); border: 1px solid rgba(108,196,165,0.28);
  color: var(--green); cursor: pointer; transition: all 0.15s; line-height: 1.4;
  white-space: nowrap;
}
.chip-btn:hover { background: rgba(108,196,165,0.22); border-color: var(--green); }
.chip-btn--danger { background: rgba(224,82,82,0.08); border-color: rgba(224,82,82,0.28); color: var(--red); }
.chip-btn--danger:hover { background: rgba(224,82,82,0.18); border-color: var(--red); }

/* ═══ Widget Card ═══════════════════════════════════════════════════════════════ */
.widget-card {
  position: relative;
  background: rgba(9,16,14,0.97);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid var(--w-accent, rgba(108,196,165,0.35));
  border-radius: 10px;
  padding: 12px 14px 11px;
  cursor: grab; overflow: hidden; user-select: none;
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
  animation: widgetIn 0.26s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes widgetIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}
.widget-card:hover {
  transform: translateX(2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), -2px 0 0 var(--w-accent, var(--green));
  border-color: rgba(255,255,255,0.10);
}
.widget-card:active { cursor: grabbing; transform: scale(0.99); }

/* Status theming */
.widget-card[data-status="ok"]      { --w-accent: var(--green); }
.widget-card[data-status="warn"]    { --w-accent: var(--amber); }
.widget-card[data-status="crit"]    {
  --w-accent: var(--red);
  animation: widgetIn 0.26s both, critPulse 2.4s ease-in-out 0.3s infinite;
}
.widget-card[data-status="error"]   { --w-accent: rgba(224,82,82,0.55); }
.widget-card[data-status="loading"] { --w-accent: rgba(108,196,165,0.18); }

@keyframes critPulse {
  0%,100% { box-shadow: none; }
  50%     { box-shadow: 0 0 18px rgba(224,82,82,0.18), -3px 0 10px rgba(224,82,82,0.25); }
}

/* Loading shimmer on the value */
.widget-card[data-status="loading"] .w-val {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.09) 50%,
    rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: shimmerSlide 1.5s linear infinite;
  border-radius: 6px; color: transparent;
  min-width: 80px; min-height: 24px; display: inline-block;
}
@keyframes shimmerSlide {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Drag */
.widget-card.dragging  { opacity: 0.3; transform: scale(0.97) rotate(0.4deg); }
.widget-card.drag-over { border-left-width: 4px; border-color: rgba(255,255,255,0.12); transform: translateX(4px); }

/* ── Widget head ────────────────────────────────────────────────────────────── */
.w-head {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 9px;
}
.w-title {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-3);
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.w-actions { display: flex; gap: 1px; opacity: 0; transition: opacity 0.14s; }
.widget-card:hover .w-actions { opacity: 1; }
.ghost-btn {
  font-size: 13px; padding: 3px 6px; border-radius: 7px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-3); cursor: pointer; transition: all 0.14s; line-height: 1;
}
.ghost-btn:hover { background: rgba(255,255,255,0.09); color: var(--text-1); border-color: var(--line); }

/* Status dot */
.kpi-status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.kpi-status-dot.ok      { background: var(--green); box-shadow: 0 0 6px rgba(108,196,165,0.7); }
.kpi-status-dot.warn    { background: var(--amber); box-shadow: 0 0 6px rgba(240,160,48,0.7); }
.kpi-status-dot.crit    { background: var(--red);   box-shadow: 0 0 10px rgba(224,82,82,0.9); animation: dotPulse 1.4s ease-in-out infinite; }
.kpi-status-dot.error   { background: rgba(224,82,82,0.55); }
.kpi-status-dot.loading { background: var(--text-3); opacity: 0.35; }
@keyframes dotPulse {
  0%,100% { box-shadow: 0 0 6px rgba(224,82,82,0.9); }
  50%     { box-shadow: 0 0 14px rgba(224,82,82,1); }
}

/* ═══ METRIC body — value + badge on one baseline line ═══════════════════════ */
.w-body { display: flex; align-items: baseline; gap: 9px; flex-wrap: nowrap; min-width: 0; }

.w-val {
  font-size: 28px; font-weight: 800; line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-1);
}
.widget-card[data-status="ok"]   .w-val { color: #e8f7f2; }
.widget-card[data-status="warn"] .w-val { color: #fdf3e0; }
.widget-card[data-status="crit"] .w-val { color: #fde8e8; }

/* Change badge — pill, inline with value */
.w-sub {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 99px;
  white-space: nowrap; flex-shrink: 0;
  align-self: flex-end; margin-bottom: 1px;
}
.w-sub.positive { color: var(--green); background: rgba(108,196,165,0.13); }
.w-sub.negative { color: var(--amber); background: rgba(240,160,48,0.13); }
.w-sub.critical { color: var(--red);   background: rgba(224,82,82,0.13); }

/* ═══ SPARKLINE ══════════════════════════════════════════════════════════════ */
.w-sparkline {
  display: block; width: 100%; height: 30px;
  margin-top: 7px; overflow: visible;
}
.w-sparkline path { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.w-sparkline .spark-area { stroke: none; }
.w-sparkline .spark-dot  { r: 2.8; }

/* ═══ TREND chart ════════════════════════════════════════════════════════════ */
.w-trend-chart {
  display: block; width: 100%; height: 56px;
  margin-top: 8px; overflow: visible;
}
.w-trend-chart path        { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.w-trend-chart .trend-area { stroke: none; }
.w-trend-chart .trend-axis { stroke: rgba(255,255,255,0.05); stroke-width: 1; }
.w-trend-chart .trend-dot  { r: 3; }
.w-trend-chart .trend-label { font-size: 8px; fill: var(--text-3); font-family: Inter, sans-serif; }

/* ═══ GAUGE ══════════════════════════════════════════════════════════════════ */
.w-gauge-wrap { display: flex; align-items: center; gap: 14px; padding: 2px 0; }
.w-gauge { width: 84px; height: 70px; display: block; overflow: visible; flex-shrink: 0; }
.w-gauge-track { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 9; }
.w-gauge-arc   { fill: none; stroke-width: 9; stroke-linecap: round;
                 filter: drop-shadow(0 0 5px var(--w-accent, var(--green))); }
.w-gauge-val   { font-size: 14px; font-weight: 800; fill: var(--text-1); font-variant-numeric: tabular-nums; }

/* ═══ BAR chart ══════════════════════════════════════════════════════════════ */
.w-bar-wrap  { margin-top: 5px; }
.w-bar-chart { display: block; width: 100%; overflow: visible; }
.bar-label   { font-family: var(--font); font-size: 10.5px; fill: var(--text-3); dominant-baseline: middle; }
.bar-bg      { fill: rgba(255,255,255,0.04); }
.bar-fill    { filter: drop-shadow(0 0 3px rgba(108,196,165,0.18)); }
.bar-val     { font-family: var(--font); font-size: 10.5px; font-weight: 600; fill: var(--text-2); dominant-baseline: middle; }

/* ═══ Empty state ════════════════════════════════════════════════════════════ */
.kpi-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 48px 20px; text-align: center; gap: 10px;
}
.kpi-empty-icon  { font-size: 32px; opacity: 0.28; }
.kpi-empty-title { font-size: 13px; font-weight: 700; color: var(--text-2); }
.kpi-empty-sub   { font-size: 12px; color: var(--text-3); line-height: 1.6; max-width: 220px; }

/* ═══ KPI Add Dialog ═════════════════════════════════════════════════════════ */
.kpi-dialog-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(4,8,7,0.70);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.kpi-dialog-overlay[hidden] { display: none; }
.kpi-dialog {
  width: 420px; max-width: 95vw; border-radius: var(--r-lg);
  padding: 0; overflow: hidden;
  box-shadow: 0 32px 96px rgba(0,0,0,0.65), 0 0 0 1px rgba(108,196,165,0.18);
  background: rgba(12,20,18,0.97);
  animation: dialogIn 0.22s cubic-bezier(.4,0,.2,1);
}
@keyframes dialogIn {
  from { opacity: 0; transform: scale(0.94) translateY(-12px); }
  to   { opacity: 1; transform: none; }
}
.kpi-dialog-header {
  display: flex; align-items: center; padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(108,196,165,0.04), transparent);
}
.kpi-dialog-title { font-size: 15px; font-weight: 700; flex: 1; }
#kpi-add-form { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.kpi-form-row { display: flex; flex-direction: column; gap: 5px; }
.kpi-form-row label { font-size: 11.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-form-row input,
.kpi-form-row select {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(108,196,165,0.16);
  color: var(--text-1); border-radius: 10px; padding: 9px 12px; font-size: 13px;
  outline: none; transition: border-color 0.15s, background 0.15s;
}
.kpi-form-row input:focus,
.kpi-form-row select:focus {
  border-color: rgba(108,196,165,0.5);
  background: rgba(108,196,165,0.04);
}
.kpi-form-row select option { background: #0d1a15; }
.kpi-form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }
.cta-btn {
  padding: 10px 22px; border-radius: var(--r-sm); font-size: 13px; font-weight: 700;
  background: var(--green); color: #040907; border: none; cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(108,196,165,0.3);
}
.cta-btn:hover   { background: #7ed4b5; box-shadow: 0 6px 22px rgba(108,196,165,0.4); }
.cta-btn:active  { transform: scale(0.97); }

/* ── Widget order controls ──────────────────────────────────────────────────── */
.w-order-btns { display: flex; gap: 2px; opacity: 0; transition: opacity 0.18s; }
.widget-card:hover .w-order-btns { opacity: 1; }
.w-order-btn {
  font-size: 12px; padding: 2px 5px; line-height: 1; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 5px;
  color: var(--text-3); transition: all 0.15s;
}
.w-order-btn:hover { background: rgba(255,255,255,0.09); color: var(--text-1); border-color: var(--line); }


/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE (Sprint 4 #240) — mobile-first breakpoints
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Voice selector pill ───────────────────────────────────────────────────── */
.tts-pill {
  display: flex; align-items: center; border-radius: 999px;
  border: 1px solid var(--line); overflow: visible; position: relative;
}
.tts-pill .tts-main {
  padding: 6px 8px; background: transparent; border: none;
  color: var(--text-2); cursor: pointer; border-radius: 999px 0 0 999px;
  transition: color 0.2s, background 0.2s;
  min-width: 36px; min-height: 36px;
}
.tts-pill .tts-main.on { color: var(--green); }
.tts-pill .tts-main:hover { background: rgba(108,196,165,0.12); color: var(--green); }
.tts-pill .tts-caret {
  padding: 6px 6px; background: transparent; border: none;
  border-left: 1px solid var(--line); color: var(--text-3);
  cursor: pointer; border-radius: 0 999px 999px 0;
  font-size: 11px; transition: color 0.15s;
  min-width: 24px; min-height: 36px;
}
.tts-pill .tts-caret:hover { color: var(--text-1); }

/* ── Voice popover ─────────────────────────────────────────────────────────── */
.voice-popover {
  position: absolute; bottom: calc(100% + 8px); left: 0;
  background: var(--glass); backdrop-filter: blur(24px);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 8px; min-width: 240px; z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.vp-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; padding: 4px 8px 8px; }
.vp-opt {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; background: transparent; border: none;
  color: var(--text-1); cursor: pointer; border-radius: 8px;
  transition: background 0.15s;
}
.vp-opt:hover { background: rgba(255,255,255,0.07); }
.vp-opt.active { background: rgba(108,196,165,0.12); }
.vp-check { width: 16px; color: var(--green); font-size: 13px; flex-shrink: 0; }
.vp-name { font-size: 14px; font-weight: 500; }
.vp-tag  { font-size: 11px; color: var(--text-3); }
.vp-info { display: flex; flex-direction: column; gap: 1px; text-align: left; }

/* ── Sidebar nav extensions ────────────────────────────────────────────────── */
.sb-section-header {
  font-size: 10px; letter-spacing: 0.1em;
  color: var(--text-3); padding: 14px 14px 4px; margin-top: 8px;
  border-top: 1px solid var(--line);
}
.sb-nav-links { display: flex; flex-direction: column; gap: 2px; padding: 0 6px 6px; }
.sb-nav-btn {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: transparent; border: none; border-radius: 8px;
  color: var(--text-2); font-size: 13px; cursor: pointer;
  text-align: left; transition: background 0.15s, color 0.15s;
  min-height: 44px;
}
.sb-nav-btn:hover { background: rgba(255,255,255,0.07); color: var(--text-1); }
.sb-nav-btn.active { background: rgba(108,196,165,0.12); color: var(--green); }

/* ── Side Panel (Mis Documentos, Mis Prompts, Calendario, Conexiones…) ──────── */
/* Matches right-panel dashboard look: same width, same dark glass, same header style */
.side-panel {
  width: 320px; border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: width 0.3s ease, opacity 0.3s ease;
  flex-shrink: 0;
  background: var(--glass-heavy, rgba(6, 18, 13, 0.92));
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: -8px 0 40px rgba(0,0,0,0.45);
  z-index: 110; overflow: hidden;
}
.side-panel.collapsed { width: 0; opacity: 0; border-left: none; box-shadow: none; }
/* Prevent inner content from squishing during width animation */
.side-panel-header,
.side-panel-info { min-width: 320px; }
.docs-list, .prompts-list, .connections-list,
.cal-content, #iq-content, .ws-list { min-width: 320px; }
.side-panel.open { transform: none; }
.side-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.side-panel-title {
  font-weight: 700; font-size: 13.5px;
  letter-spacing: 0.2px; color: var(--green);
}
.side-panel-actions { display: flex; gap: 6px; align-items: center; }
.side-panel-info {
  padding: 10px 14px; font-size: 12px; color: var(--text-3);
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}

/* ── Upload label as button ────────────────────────────────────────────────── */
.upload-label {
  cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  min-height: 36px;
}

/* ── Docs list ─────────────────────────────────────────────────────────────── */
.docs-list {
  flex: 1; overflow-y: auto; padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.doc-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  transition: background 0.15s;
}
.doc-item:hover { background: rgba(255,255,255,0.07); }
.doc-icon { font-size: 20px; flex-shrink: 0; }
.doc-meta { flex: 1; min-width: 0; }
.doc-name { font-size: 13px; font-weight: 500; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-detail { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.doc-status { font-size: 11px; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.doc-status.indexed  { background: rgba(108,196,165,0.15); color: var(--green); }
.doc-status.processing { background: rgba(240,160,48,0.15); color: var(--amber); animation: doc-pulse 1.4s ease-in-out infinite; }
.doc-status.error    { background: rgba(224,82,82,0.15); color: var(--red); }
@keyframes doc-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.doc-delete { background: transparent; border: none; color: var(--text-3); cursor: pointer; padding: 4px; border-radius: 6px; font-size: 15px; }
.doc-delete:hover { color: var(--red); background: rgba(224,82,82,0.1); }

/* ── Upload progress bar ───────────────────────────────────────────────────── */
.upload-progress {
  padding: 10px 12px; border-radius: 10px;
  background: rgba(108,196,165,0.08); border: 1px solid rgba(108,196,165,0.25);
}
.upload-progress-bar {
  height: 4px; border-radius: 2px; background: rgba(255,255,255,0.1);
  margin-top: 8px; overflow: hidden;
}
.upload-progress-fill {
  height: 100%; border-radius: 2px; background: var(--green);
  transition: width 0.3s;
}

/* ── Prompts list ──────────────────────────────────────────────────────────── */
.prompts-list {
  flex: 1; overflow-y: auto; padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.prompt-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px; border-radius: 10px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  transition: background 0.15s; cursor: pointer;
}
.prompt-item:hover { background: rgba(255,255,255,0.07); }
.prompt-shortcut {
  font-size: 12px; font-family: var(--font-mono);
  color: var(--green); background: rgba(108,196,165,0.1);
  border-radius: 6px; padding: 2px 8px; flex-shrink: 0; margin-top: 2px;
}
.prompt-meta { flex: 1; min-width: 0; }
.prompt-name { font-size: 13px; font-weight: 500; color: var(--text-1); }
.prompt-desc { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.prompt-actions { display: flex; gap: 4px; flex-shrink: 0; }
.prompt-btn {
  background: transparent; border: none; color: var(--text-3);
  cursor: pointer; padding: 4px 6px; border-radius: 6px; font-size: 13px;
  min-width: 32px; min-height: 32px;
}
.prompt-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-1); }

/* ── Form hint ──────────────────────────────────────────────────────────────── */
.form-hint { font-size: 11px; color: var(--text-3); font-weight: 400; margin-left: 6px; }

/* ── Slash command menu ─────────────────────────────────────────────────────── */
.slash-menu {
  position: absolute; bottom: calc(100% + 4px); left: 0; right: 0;
  background: var(--glass); backdrop-filter: blur(24px);
  border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; z-index: 300; max-height: 240px; overflow-y: auto;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
}
.slash-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; transition: background 0.12s;
}
.slash-item:hover, .slash-item.active { background: rgba(108,196,165,0.1); }
.slash-item-shortcut { font-size: 12px; font-family: var(--font-mono); color: var(--green); }
.slash-item-name { font-size: 13px; color: var(--text-1); }
.slash-item-desc { font-size: 11px; color: var(--text-3); }

/* ── Mobile bottom navigation ───────────────────────────────────────────────── */
.mobile-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 58px; z-index: 130;
  background: var(--glass); backdrop-filter: blur(24px);
  border-top: 1px solid var(--line);
  display: none; /* shown via media query */
  grid-template-columns: repeat(4, 1fr);
}
.mbn-btn {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; background: transparent; border: none;
  color: var(--text-3); cursor: pointer; padding: 6px;
  font-size: 20px; transition: color 0.15s;
  min-height: 44px;
}
.mbn-btn span { font-size: 10px; color: inherit; }
.mbn-btn.active, .mbn-btn:active { color: var(--green); }

/* ═══════════════════════════════════════════════════════════════════════════
   TABLET BREAKPOINTS (max-width: 1024px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .right-panel { display: none; }
  .sidebar { width: 240px; }
  .app { grid-template-columns: 240px 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHONE BREAKPOINTS (max-width: 768px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Show mobile bottom nav, hide sidebar initially */
  .mobile-bottom-nav { display: grid; }

  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    padding-bottom: 58px; /* bottom nav height */
  }

  /* Sidebar becomes overlay drawer */
  .sidebar {
    position: fixed; left: -280px; top: 0; bottom: 0;
    width: 280px; z-index: 120;
    transition: left 0.3s cubic-bezier(0.4,0,0.2,1);
    border-right: 1px solid var(--line);
  }
  .sidebar.open { left: 0; }
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 119; display: none;
  }
  .sidebar-backdrop.show { display: block; }

  /* Top bar adjustments */
  .topbar { padding: 0 12px; height: 52px; }
  .topbar-actions .chip-btn .chip-label { display: none; }
  #btn-palette { gap: 0; }

  /* Chat area full-height */
  .main { min-height: 0; }
  .chat-scroll { padding: 8px; }

  /* Composer touch-optimized */
  .composer { padding: 8px 10px; }
  .composer textarea { font-size: 16px; /* prevent iOS zoom */ }
  .composer-actions { gap: 6px; }

  /* All touch targets ≥44px */
  button, .chip-btn, .ghost-btn, .send-btn, .stop-btn,
  .act-icon-btn, .sb-nav-btn, .mbn-btn { min-height: 44px; min-width: 44px; }

  /* History search */
  .sb-search input { font-size: 16px; } /* prevent iOS zoom */

  /* KPI dialog full-screen on mobile */
  .kpi-dialog-overlay { padding: 0; align-items: flex-end; }
  .kpi-dialog { border-radius: var(--r-md) var(--r-md) 0 0; max-height: 92vh; overflow-y: auto; }

  /* Side panels full-screen on mobile */
  .side-panel { width: 100vw; }

  /* Voice overlay */
  .voice-overlay { border-radius: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SMALL PHONE (max-width: 390px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 390px) {
  .topbar-title { font-size: 14px; }
  .sb-username { max-width: 100px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ONBOARDING WIZARD (Sprint 5 #299-301)
   ═══════════════════════════════════════════════════════════════════════════ */
.onboarding-overlay {
  position: fixed; inset: 0; background: rgba(7,11,10,0.9);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.onboarding-card {
  width: min(540px, 100%); max-height: 90vh; overflow-y: auto;
  padding: 32px; border-radius: var(--r-md);
}
.onboarding-progress {
  display: flex; gap: 4px; margin-bottom: 24px;
}
.onboarding-step-dot {
  flex: 1; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.1); transition: background 0.3s;
}
.onboarding-step-dot.done  { background: var(--green); }
.onboarding-step-dot.active { background: rgba(108,196,165,0.5); }
.onboarding-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.onboarding-subtitle { font-size: 14px; color: var(--text-3); margin-bottom: 24px; }
.onboarding-field { margin-bottom: 16px; }
.onboarding-field label { display: block; font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.onboarding-field input, .onboarding-field select {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line);
  color: var(--text-1); font-size: 14px; font-family: var(--font);
}
.onboarding-field input:focus, .onboarding-field select:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 2px rgba(108,196,165,0.2);
}
.onboarding-nav { display: flex; gap: 10px; margin-top: 24px; }
.onboarding-nav .cta-btn { flex: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   ONBOARDING WIZARD v2 — Full Wizard (Sprint 7)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Overlay ─────────────────────────────────────────────────────────────────── */
#ob-overlay {
  position: fixed; inset: 0; z-index: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(4,7,6,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0; transition: opacity 0.35s ease;
}
#ob-overlay.ob-visible { opacity: 1; }
.ob-backdrop {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(108,196,165,0.07), transparent 70%);
}

/* ── Card ─────────────────────────────────────────────────────────────────────── */
.ob-card {
  position: relative; z-index: 1;
  width: min(560px, 100%); max-height: 90dvh; overflow-y: auto;
  background: rgba(11,17,15,0.97);
  border: 1px solid rgba(108,196,165,0.22);
  border-radius: 24px;
  box-shadow: 0 40px 120px rgba(0,0,0,0.75), 0 0 0 1px rgba(108,196,165,0.06) inset;
  display: flex; flex-direction: column;
  animation: obCardIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes obCardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* ── Header ───────────────────────────────────────────────────────────────────── */
.ob-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px 14px; flex-shrink: 0;
  border-bottom: 1px solid rgba(108,196,165,0.1);
}
.ob-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--text-2); letter-spacing: -0.2px;
}
.ob-logo img { border-radius: 6px; }
.ob-btn-later-x {
  font-size: 12px; color: var(--text-3); padding: 5px 12px;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 999px;
  background: transparent; cursor: pointer; transition: all 0.2s;
}
.ob-btn-later-x:hover { color: var(--text-1); border-color: var(--line); }

/* ── Progress ─────────────────────────────────────────────────────────────────── */
.ob-progress-wrap { padding: 14px 24px 0; flex-shrink: 0; }
.ob-steps-track {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 4px; margin-bottom: 10px;
}
.ob-step-dot {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  flex: 1; cursor: default;
}
.ob-step-node {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-3);
  transition: all 0.3s;
}
.ob-step-label {
  font-size: 10px; color: var(--text-3); text-align: center;
  white-space: nowrap; transition: color 0.3s;
  display: none;
}
.ob-step-dot.ob-step-done .ob-step-node { background: var(--green); border-color: var(--green); color: #06120d; }
.ob-step-dot.ob-step-active .ob-step-node { background: rgba(108,196,165,0.18); border-color: var(--green); color: var(--green); }
.ob-step-dot.ob-step-active .ob-step-label { color: var(--green); }
@media (min-width: 480px) { .ob-step-label { display: block; } }
.ob-progress-bar-wrap {
  height: 3px; background: rgba(255,255,255,0.07); border-radius: 2px; overflow: hidden; margin-bottom: 2px;
}
.ob-progress-bar {
  height: 100%; width: 0%; border-radius: 2px;
  background: linear-gradient(90deg, var(--green), #4da888);
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Body ─────────────────────────────────────────────────────────────────────── */
.ob-body { padding: 24px; flex: 1; overflow-y: auto; }
.ob-body.ob-body-enter { animation: obBodyIn 0.3s ease; }
@keyframes obBodyIn {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: none; }
}

/* ── Footer ───────────────────────────────────────────────────────────────────── */
.ob-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px 20px; flex-shrink: 0;
  border-top: 1px solid rgba(108,196,165,0.08); gap: 10px;
}
.ob-btn-ghost {
  padding: 10px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  color: var(--text-2); border: 1px solid var(--line);
  background: transparent; cursor: pointer; transition: all 0.2s;
}
.ob-btn-ghost:hover { color: var(--text-1); border-color: var(--line-strong); }
.ob-btn-primary {
  padding: 11px 28px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: linear-gradient(135deg, var(--green), #4da888); color: #05100c;
  border: none; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 6px 20px rgba(108,196,165,0.3);
  margin-left: auto;
}
.ob-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(108,196,165,0.45); }
.ob-btn-primary:disabled { background: var(--bg-3); color: var(--text-3); box-shadow: none; cursor: default; transform: none; }

/* ── Welcome step ─────────────────────────────────────────────────────────────── */
.ob-step-welcome { text-align: center; padding: 8px 0 16px; }
.ob-welcome-orb { position: relative; width: 80px; height: 80px; margin: 0 auto 28px; }
.ob-orb-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(108,196,165,0.3);
  animation: obRingPulse 3s ease-in-out infinite;
}
.ob-orb-ring-1 { inset: -10px; animation-delay: 0s; opacity: 0.4; }
.ob-orb-ring-2 { inset: -20px; animation-delay: 0.5s; opacity: 0.25; }
.ob-orb-ring-3 { inset: -32px; animation-delay: 1s; opacity: 0.12; }
@keyframes obRingPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.ob-orb-icon {
  position: relative; z-index: 1;
  width: 80px; height: 80px; border-radius: 22px;
  box-shadow: 0 0 40px rgba(108,196,165,0.3), 0 12px 28px rgba(0,0,0,0.5);
}
.ob-title {
  font-size: 26px; font-weight: 800; letter-spacing: -0.8px;
  background: linear-gradient(130deg, var(--text-1) 30%, var(--green));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}
.ob-subtitle {
  font-size: 14.5px; color: var(--text-2); line-height: 1.65;
  margin-bottom: 28px; max-width: 380px; margin-inline: auto;
}
.ob-feature-list { display: flex; flex-direction: column; gap: 12px; text-align: left; max-width: 360px; margin: 0 auto 24px; }
.ob-feature { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; color: var(--text-1); line-height: 1.5; }
.ob-feat-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.ob-time-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-3); padding: 6px 14px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.03);
}

/* ── Form common ──────────────────────────────────────────────────────────────── */
.ob-step-title { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; color: var(--text-1); margin-bottom: 6px; }
.ob-step-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.55; margin-bottom: 22px; }
.ob-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.ob-label { font-size: 11.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.07em; }
.ob-required { color: var(--red); margin-left: 2px; }
.ob-hint-label { font-size: 11px; color: var(--text-3); text-transform: none; font-weight: 400; letter-spacing: 0; }
.ob-input {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line);
  color: var(--text-1); font-size: 14.5px; font-family: var(--font);
  outline: none; transition: border-color 0.18s, box-shadow 0.18s;
}
.ob-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(108,196,165,0.15); }
.ob-input::placeholder { color: var(--text-3); }
.ob-input-mono { font-family: var(--mono); font-size: 13px; }
.ob-select {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line);
  color: var(--text-1); font-size: 14px; font-family: var(--font);
  outline: none; cursor: pointer;
}
.ob-select:focus { border-color: var(--green); outline: none; }
.ob-select option { background: #0d1a15; }
.ob-row { display: flex; gap: 12px; }
.ob-row .ob-field { flex: 1; }
.ob-field-error {
  font-size: 12px; color: var(--red); padding: 8px 12px; border-radius: 8px;
  background: rgba(224,82,82,0.1); border: 1px solid rgba(224,82,82,0.2); margin-top: 4px;
}

/* ── Sector chips ─────────────────────────────────────────────────────────────── */
.ob-sector-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-sector-chip {
  padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  color: var(--text-2); border: 1px solid var(--line);
  background: rgba(255,255,255,0.04); cursor: pointer; transition: all 0.18s;
}
.ob-sector-chip:hover { border-color: var(--green); color: var(--text-1); background: rgba(108,196,165,0.08); }
.ob-sector-chip.ob-chip-sel { background: var(--green-soft); border-color: var(--green); color: var(--green); font-weight: 700; }

/* ── Microsoft banner ─────────────────────────────────────────────────────────── */
.ob-ms-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  font-size: 13px; color: var(--text-2); line-height: 1.45; margin-bottom: 18px;
}

/* ── Help details ─────────────────────────────────────────────────────────────── */
.ob-help-details {
  font-size: 13px; color: var(--text-2); margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,0.025);
}
.ob-help-details summary { padding: 10px 14px; cursor: pointer; font-weight: 500; color: var(--green); list-style: none; }
.ob-help-details summary::-webkit-details-marker { display: none; }
.ob-help-details summary::before { content: '+ '; }
.ob-help-details[open] summary::before { content: '− '; }
.ob-help-body { padding: 0 14px 12px; }
.ob-help-body p { margin-bottom: 6px; line-height: 1.5; font-size: 12.5px; color: var(--text-2); }
.ob-help-body strong { color: var(--text-1); }

/* ── Skip button ──────────────────────────────────────────────────────────────── */
.ob-btn-skip {
  font-size: 12.5px; color: var(--text-3); padding: 6px 0; cursor: pointer;
  background: transparent; border: none; text-decoration: underline;
  text-underline-offset: 3px; transition: color 0.15s; text-align: left;
}
.ob-btn-skip:hover { color: var(--text-1); }

/* ── Connection cards ─────────────────────────────────────────────────────────── */
.ob-conn-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.ob-conn-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  cursor: pointer; transition: all 0.2s; user-select: none;
}
.ob-conn-card:hover { border-color: rgba(108,196,165,0.35); background: rgba(108,196,165,0.05); }
.ob-conn-card.ob-conn-on { border-color: var(--green); background: rgba(108,196,165,0.08); }
.ob-conn-icon { font-size: 22px; flex-shrink: 0; width: 36px; text-align: center; }
.ob-conn-info { flex: 1; min-width: 0; }
.ob-conn-name { font-size: 14px; font-weight: 600; color: var(--text-1); }
.ob-conn-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.ob-toggle-track {
  width: 40px; height: 22px; border-radius: 11px;
  background: rgba(255,255,255,0.1); border: 1px solid var(--line);
  position: relative; transition: all 0.2s; flex-shrink: 0;
}
.ob-conn-on .ob-toggle-track { background: var(--green); border-color: var(--green); }
.ob-toggle-thumb {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-3); transition: left 0.2s, background 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.ob-conn-on .ob-toggle-thumb { left: 20px; background: white; }
.ob-conn-note {
  font-size: 11.5px; color: var(--text-3); line-height: 1.5; padding: 8px 12px; border-radius: 8px;
  background: rgba(240,160,48,0.08); border: 1px solid rgba(240,160,48,0.2);
}

/* ── PBI license selector ─────────────────────────────────────────────────────── */
.ob-pbi-license { padding: 12px 14px; border-radius: 10px; background: rgba(108,196,165,0.06);
  border: 1px solid rgba(108,196,165,0.18); margin-bottom: 4px; }
.ob-hidden { display: none !important; }
.ob-label-sm { font-size: 11.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase;
  letter-spacing: .04em; display: block; margin-bottom: 8px; }
.ob-radio-group { display: flex; flex-direction: column; gap: 7px; }
.ob-radio-opt { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08); cursor: pointer; transition: all 0.15s; }
.ob-radio-opt:hover { background: rgba(255,255,255,0.04); }
.ob-radio-sel { border-color: var(--green) !important; background: rgba(108,196,165,0.08); }
.ob-radio-opt input[type="radio"] { display: none; }
.ob-radio-mark { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.25);
  flex-shrink: 0; margin-top: 1px; transition: all 0.15s; position: relative; }
.ob-radio-sel .ob-radio-mark { border-color: var(--green); }
.ob-radio-sel .ob-radio-mark::after { content: ''; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%); width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.ob-radio-opt strong { font-size: 13px; color: var(--text-1); display: block; }
.ob-radio-hint { font-size: 11.5px; color: var(--text-3); display: block; }

/* ── PBI auth widget ──────────────────────────────────────────────────────────── */
.ob-pbi-auth-row { margin-top: 10px; }
.ob-btn-auth-pbi { background: rgba(0,114,198,0.15); border: 1px solid rgba(0,114,198,0.35);
  color: #5ab4f5; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; }
.ob-btn-auth-pbi:hover { background: rgba(0,114,198,0.25); }
.ob-btn-auth-pbi:disabled { opacity: 0.5; cursor: not-allowed; }
.ob-pbi-auth-widget { padding: 12px; background: rgba(0,0,0,0.2); border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08); }
.ob-device-code-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.ob-device-link { color: var(--green); text-decoration: underline; }
.ob-device-code { font-family: monospace; font-size: 18px; font-weight: 700; letter-spacing: .1em;
  color: #fff; background: rgba(108,196,165,0.15); padding: 4px 10px; border-radius: 6px; }
.ob-auth-status { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.ob-auth-status:has(.ob-spinner-sm) { color: var(--text-2); }
.ob-spinner-sm { width: 12px; height: 12px; border: 2px solid rgba(108,196,165,0.2);
  border-top-color: var(--green); border-radius: 50%; animation: ob-spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes ob-spin { to { transform: rotate(360deg); } }
.ob-conn-auth-ok { display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: rgba(108,196,165,0.1); border: 1px solid rgba(108,196,165,0.3); border-radius: 8px;
  font-size: 13px; color: var(--green); font-weight: 500; margin-top: 8px; }
.ob-auth-check { font-size: 16px; }

/* ── BC MCP URL field ─────────────────────────────────────────────────────────── */
.ob-bc-url-row { padding: 12px 14px; border-radius: 10px; background: rgba(108,196,165,0.04);
  border: 1px solid rgba(108,196,165,0.14); margin-top: 4px; margin-bottom: 4px; }
.ob-input-sm { font-size: 12.5px; padding: 7px 10px; }
.ob-opt-tag { font-size: 10px; font-weight: 500; color: var(--text-3); background: rgba(255,255,255,0.06);
  padding: 1px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: .04em; margin-left: 4px; }

/* ── Sector multi-select chips (override single-select) ───────────────────────── */
.ob-sector-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ob-sector-chip { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-2); padding: 5px 11px; border-radius: 20px; font-size: 12.5px; cursor: pointer;
  transition: all 0.15s; white-space: nowrap; }
.ob-sector-chip:hover { border-color: rgba(108,196,165,0.4); color: var(--text-1); }
.ob-sector-chip.ob-chip-sel { background: rgba(108,196,165,0.15); border-color: var(--green);
  color: var(--green); font-weight: 500; }

/* ── Upload zone ──────────────────────────────────────────────────────────────── */
.ob-upload-zone {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 28px 20px; border-radius: 14px; border: 2px dashed rgba(108,196,165,0.25);
  background: rgba(108,196,165,0.04); transition: all 0.2s; text-align: center; margin-bottom: 14px;
  cursor: pointer;
}
.ob-upload-zone:hover, .ob-upload-zone.ob-drag-over { border-color: rgba(108,196,165,0.5); background: rgba(108,196,165,0.07); }
.ob-upload-zone.ob-upload-done { border-color: var(--green); border-style: solid; }
.ob-upload-icon { font-size: 32px; opacity: 0.7; }
.ob-upload-text { font-size: 14px; font-weight: 600; color: var(--text-1); }
.ob-upload-hint { font-size: 12px; color: var(--text-3); }
.ob-btn-upload {
  padding: 8px 18px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(108,196,165,0.15); border: 1px solid rgba(108,196,165,0.35);
  color: var(--green); cursor: pointer; transition: all 0.18s; margin-top: 4px;
}
.ob-btn-upload:hover { background: rgba(108,196,165,0.25); border-color: var(--green); }
.ob-upload-status { margin-bottom: 12px; }
.ob-upload-progress { font-size: 13px; color: var(--text-2); }
.ob-upload-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.08); margin-top: 8px; overflow: hidden; }
.ob-upload-fill { height: 100%; border-radius: 2px; background: var(--green); transition: width 0.4s; }
.ob-upload-ok { font-size: 13px; color: var(--green); padding: 8px 12px; border-radius: 8px; background: rgba(108,196,165,0.1); }
.ob-upload-err { font-size: 13px; color: var(--red); padding: 8px 12px; border-radius: 8px; background: rgba(224,82,82,0.1); }
.ob-catalog-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ob-example-tag {
  font-size: 11.5px; padding: 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--text-3);
}

/* ── Done step ────────────────────────────────────────────────────────────────── */
.ob-step-done { text-align: center; padding: 8px 0; }
.ob-check-wrap { display: flex; justify-content: center; margin-bottom: 24px; }
.ob-check-circle {
  width: 72px; height: 72px; background: rgba(108,196,165,0.1); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ob-check-svg { width: 72px; height: 72px; }
.ob-check-ring {
  stroke: rgba(108,196,165,0.3); stroke-width: 2;
  stroke-dasharray: 157; stroke-dashoffset: 157;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4,0,0.2,1);
}
.ob-check-tick {
  stroke: var(--green); stroke-width: 3;
  stroke-dasharray: 40; stroke-dashoffset: 40;
  transition: stroke-dashoffset 0.5s 0.4s cubic-bezier(0.4,0,0.2,1);
}
.ob-check-circle.ob-check-animate .ob-check-ring { stroke-dashoffset: 0; }
.ob-check-circle.ob-check-animate .ob-check-tick { stroke-dashoffset: 0; }
.ob-title-done {
  font-size: 24px; font-weight: 800;
  background: linear-gradient(130deg, var(--text-1) 30%, var(--green));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}
.ob-summary { display: flex; flex-direction: column; gap: 10px; max-width: 340px; margin: 20px auto 28px; text-align: left; }
.ob-sum-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text-1); line-height: 1.45; }
.ob-sum-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.ob-btn-go {
  padding: 13px 36px; border-radius: 999px; font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, var(--green), #4da888); color: #05100c;
  border: none; cursor: pointer;
  box-shadow: 0 8px 26px rgba(108,196,165,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.ob-btn-go:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(108,196,165,0.55); }

/* ── Resume banner ────────────────────────────────────────────────────────────── */
.ob-resume-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 18px; border-bottom: 1px solid rgba(240,160,48,0.3);
  background: rgba(240,160,48,0.08); font-size: 13px; flex-shrink: 0;
}
.ob-resume-text { flex: 1; color: var(--amber); min-width: 200px; }
.ob-resume-btn {
  padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: rgba(240,160,48,0.2); border: 1px solid rgba(240,160,48,0.4);
  color: var(--amber); cursor: pointer; transition: all 0.18s;
}
.ob-resume-btn:hover { background: rgba(240,160,48,0.35); }
.ob-resume-close {
  background: transparent; border: none; color: var(--text-3);
  cursor: pointer; font-size: 14px; padding: 4px; line-height: 1;
}
.ob-resume-close:hover { color: var(--text-1); }

/* ── Mobile onboarding ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .ob-card { border-radius: 18px; }
  .ob-header { padding: 14px 18px 12px; }
  .ob-progress-wrap { padding: 10px 18px 0; }
  .ob-body { padding: 18px; }
  .ob-footer { padding: 12px 18px 16px; }
  .ob-row { flex-direction: column; gap: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SPRINT 8 — Mi Calendario
   ═══════════════════════════════════════════════════════════════════════════ */

.cal-view-btn { font-size: 12px; padding: 4px 10px; min-height: 28px; min-width: auto; }
.cal-view-btn--active {
  background: rgba(108,196,165,0.15); color: var(--green);
  border-color: rgba(108,196,165,0.4);
}

.cal-content {
  flex: 1; overflow-y: auto; padding: 8px 12px;
  display: flex; flex-direction: column; gap: 10px;
}

.cal-loading { display: flex; justify-content: center; padding: 32px; }

.cal-day-group {
  border-radius: 10px; overflow: hidden;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
}

.cal-day-group--today { border-color: rgba(108,196,165,0.3); }
.cal-day-group--today .cal-day-header { color: var(--green); }

.cal-day-header {
  font-size: 11.5px; font-weight: 600; color: var(--text-3);
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: 0.05em;
}

.cal-ev {
  padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.12s;
}
.cal-ev:last-child { border-bottom: none; }
.cal-ev:hover { background: rgba(255,255,255,0.04); }
.cal-ev--cancelled { opacity: 0.45; }

.cal-ev-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }

.cal-ev-time { font-size: 11.5px; font-family: var(--font-mono); color: var(--text-3); }
.cal-ev-allday { font-size: 11px; color: var(--text-3); font-style: italic; }

.cal-ev-tag {
  font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.cal-ev-tag--teams { background: rgba(100,130,220,0.15); color: #7da4f0; }

.cal-ev-title {
  font-size: 13px; font-weight: 500; color: var(--text-1);
  margin-bottom: 4px; line-height: 1.3;
}

.cal-ev-join-btn {
  display: inline-block; font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 6px;
  background: rgba(100,130,220,0.12); color: #7da4f0;
  border: 1px solid rgba(100,130,220,0.25);
  text-decoration: none; margin: 4px 0;
  transition: background 0.15s;
}
.cal-ev-join-btn:hover { background: rgba(100,130,220,0.22); }

.cal-ev-loc, .cal-ev-org {
  font-size: 11px; color: var(--text-3); margin-top: 2px;
}

.cal-empty, .cal-error {
  font-size: 13px; color: var(--text-3); text-align: center; padding: 24px;
}
.cal-error { color: var(--red); }

.side-panel-info--action {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SPRINT 8 — Mis Conexiones
   ═══════════════════════════════════════════════════════════════════════════ */

.connections-list {
  flex: 1; overflow-y: auto; padding: 8px 12px;
  display: flex; flex-direction: column; gap: 8px;
}

.conn-card {
  padding: 14px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
}

.conn-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.conn-info { flex: 1; }
.conn-label { font-size: 13.5px; font-weight: 600; color: var(--text-1); margin-bottom: 4px; }
.conn-status { font-size: 11.5px; font-weight: 600; }
.conn-status--ok  { color: var(--green); }
.conn-status--off { color: var(--text-3); }
.conn-at { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.conn-scopes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.conn-scope {
  font-size: 10px; padding: 2px 7px; border-radius: 4px;
  background: rgba(255,255,255,0.06); color: var(--text-3); border: 1px solid var(--line);
}
.conn-actions { flex-shrink: 0; }

/* Device-code flow */
#graph-auth-flow { flex: 1; overflow-y: auto; min-width: 320px; }
.conn-auth-step { padding: 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.conn-auth-title { font-size: 14px; font-weight: 600; color: var(--text-1); }
.conn-auth-instruction { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.conn-verify-link { color: var(--green); font-family: var(--font-mono); font-size: 12px; word-break: break-all; }
.conn-auth-code {
  font-size: 28px; font-weight: 700; font-family: var(--font-mono);
  color: var(--green); letter-spacing: 0.12em; text-align: center;
  padding: 16px; border-radius: 10px;
  background: rgba(108,196,165,0.08); border: 1px solid rgba(108,196,165,0.25);
}
.conn-auth-hint { font-size: 12px; color: var(--text-3); text-align: center; }

.chip-btn--danger {
  background: rgba(224,82,82,0.1); color: var(--red);
  border-color: rgba(224,82,82,0.3);
}
.chip-btn--danger:hover { background: rgba(224,82,82,0.2); }

/* MCP badge (Power BI connected via MCP Server) */
.conn-mcp-badge {
  display: inline-block; margin-top: 4px; padding: 2px 7px;
  border-radius: 20px; font-size: 10.5px; font-weight: 700;
  background: rgba(108,196,165,0.12); color: var(--green);
  border: 1px solid rgba(108,196,165,0.3); letter-spacing: 0.03em;
}

/* Discovery indicator — inline dot (kept for legacy, hidden in favour of overlay) */
.conn-discovering {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px; padding: 6px 8px; border-radius: 7px;
  background: rgba(108,196,165,0.06); border: 1px solid rgba(108,196,165,0.2);
  font-size: 11.5px; color: var(--green);
}
.conn-discovering-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--green);
  animation: discovering-pulse 1.2s ease-in-out infinite;
}
@keyframes discovering-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.3; transform: scale(0.65); }
}

/* ── PBI Discover full-screen blocking overlay ────────────────────────────── */
.pbi-discover-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(4,8,7,0.72); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  animation: pdi-fadein 0.22s ease;
}
@keyframes pdi-fadein { from { opacity: 0; } to { opacity: 1; } }
.pbi-discover-card {
  width: min(360px, calc(100vw - 32px));
  background: rgba(18,26,24,0.96); border: 1px solid rgba(108,196,165,0.3);
  border-radius: 16px; padding: 28px 24px 22px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  animation: pdi-rise 0.28s cubic-bezier(0.2,0.9,0.3,1.1);
}
@keyframes pdi-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.pbi-discover-icon { font-size: 36px; line-height: 1; }
.pbi-discover-title {
  font-size: 15px; font-weight: 700; color: var(--text-1);
  text-align: center; line-height: 1.35;
}
.pbi-discover-sub {
  font-size: 12.5px; color: var(--text-3); text-align: center; line-height: 1.5;
  margin-top: -8px;
}
.pbi-discover-bar {
  width: 100%; height: 5px; border-radius: 3px;
  background: rgba(255,255,255,0.1); overflow: hidden;
}
.pbi-discover-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--green) 40%, #9be4cc 60%, transparent 100%);
  background-size: 200% 100%;
  animation: pdi-sweep 1.6s linear infinite;
}
@keyframes pdi-sweep {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
.pbi-discover-hint {
  font-size: 11px; color: var(--text-3); text-align: center;
}

/* Connection error banner — shown when /api/pbi/test fails */
.conn-pbi-error {
  display: flex; align-items: flex-start; gap: 6px;
  margin-top: 8px; padding: 8px 10px; border-radius: 7px;
  background: rgba(224,82,82,0.08); border: 1px solid rgba(224,82,82,0.3);
  font-size: 11.5px; color: var(--red, #e05252);
}
.conn-pbi-error-icon { flex-shrink: 0; font-size: 13px; }
.conn-pbi-error-msg  { flex: 1; line-height: 1.4; }
.conn-pbi-error-code {
  flex-shrink: 0; font-family: var(--font-mono); font-size: 10px;
  color: var(--text-3); margin-top: 1px; white-space: nowrap;
}

/* Token expired reconnect banner (injected by ConnectionsPanel.promptReconnect) */
.conn-expired-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 8px 0 0;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(255,165,0,0.10); border: 1px solid rgba(255,165,0,0.35);
  font-size: 12px; color: var(--orange, #f59e0b);
  animation: pulse-warn 1.5s ease-in-out 3;
}
.chip-btn--warn {
  background: rgba(255,165,0,0.18); color: var(--orange, #f59e0b);
  border: 1px solid rgba(255,165,0,0.4);
}
.chip-btn--warn:hover { background: rgba(255,165,0,0.30); }

/* PBI normas section button */
.conn-normas-section { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }

/* PBI Normas Modal */
.normas-modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4, 8, 7, 0.72); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.normas-modal {
  width: 100%; max-width: 640px; border-radius: var(--r-lg); padding: 28px 28px 22px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6), 0 0 0 1px rgba(108,196,165,0.15);
  display: flex; flex-direction: column; gap: 14px;
  animation: rise 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.normas-modal-header {
  display: flex; align-items: center; gap: 12px;
}
.normas-modal-icon { font-size: 22px; }
.normas-modal-title {
  flex: 1; font-size: 16px; font-weight: 700; color: var(--text-1);
}
.normas-modal-close {
  color: var(--text-3); font-size: 16px; transition: var(--tr);
}
.normas-modal-close:hover { color: var(--text-1); }
.normas-modal-hint {
  font-size: 12.5px; color: var(--text-2); line-height: 1.55; margin: 0;
}
.normas-modal-textarea {
  width: 100%; min-height: 220px; resize: vertical;
  background: rgba(0,0,0,0.32); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px; font-size: 12.5px; font-family: var(--mono);
  color: var(--text-1); line-height: 1.6; outline: none; transition: border-color var(--tr);
}
.normas-modal-textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(108,196,165,0.1); }
.normas-modal-textarea::placeholder { color: var(--text-3); }
.normas-modal-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 4px;
}
.normas-modal-chars { font-size: 11px; color: var(--text-3); font-family: var(--mono); }
.normas-modal-actions { display: flex; gap: 10px; }

/* Bar chart widget */
.w-bar-wrap { padding: 4px 0 2px; }
.w-bar-chart { width: 100%; display: block; overflow: visible; }
.bar-label { font-size: 10.5px; fill: var(--text-2); font-family: var(--font, 'Inter', sans-serif); }
.bar-bg { fill: rgba(255,255,255,0.05); }
.bar-fill { opacity: 0.85; transition: opacity 0.2s; }
.bar-val { font-size: 10.5px; fill: var(--text-3); font-family: var(--mono, 'Fira Code', monospace); }

.chip-btn--primary {
  background: rgba(108,196,165,0.15); color: var(--green);
  border: 1px solid rgba(108,196,165,0.4);
}
.chip-btn--primary:hover { background: rgba(108,196,165,0.28); }
@keyframes pulse-warn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,165,0,0); }
  50%       { box-shadow: 0 0 0 4px rgba(255,165,0,0.25); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mi Configuración panel (Sprint 8)
   ═══════════════════════════════════════════════════════════════════════════ */

.cfg-section {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--line);
}
.cfg-section:last-child { border-bottom: none; }
.cfg-section-title {
  font-size: 13px; font-weight: 700; color: var(--text-1);
  margin-bottom: 6px;
}
.cfg-section-info {
  font-size: 12px; color: var(--text-3); line-height: 1.5;
  margin-bottom: 10px;
}
.cfg-loading { font-size: 12px; color: var(--text-3); padding: 8px 0; }
.cfg-error   { font-size: 12px; color: var(--red);    padding: 8px 0; }
.cfg-empty {
  font-size: 12px; color: var(--text-3); line-height: 1.6;
  padding: 8px; border-radius: 8px;
  background: var(--surface-1);
}

/* KPI list in config panel */
.cfg-kpi-list { display: flex; flex-direction: column; gap: 6px; }
.cfg-kpi-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 10px; border-radius: 8px;
  background: var(--surface-1); border: 1px solid var(--line);
}
.cfg-kpi-meta { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.cfg-kpi-icon { font-size: 16px; flex-shrink: 0; }
.cfg-kpi-info { min-width: 0; }
.cfg-kpi-title {
  font-size: 12.5px; font-weight: 600; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cfg-kpi-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.cfg-kpi-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cfg-freq-select {
  font-size: 11px; padding: 3px 6px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-1);
}
.cfg-del-btn { font-size: 12px; color: var(--text-3); padding: 3px 6px; }
.cfg-del-btn:hover { color: var(--red); }

/* PBI normas editor */
.cfg-textarea {
  width: 100%; box-sizing: border-box; padding: 10px;
  font-size: 12px; font-family: var(--font-mono);
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: 8px; color: var(--text-1); resize: vertical;
  line-height: 1.6;
}
.cfg-textarea:focus { outline: none; border-color: var(--green); }
.cfg-normas-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px;
}
.cfg-char-count { font-size: 11px; color: var(--text-3); }

/* ═══════════════════════════════════════════════════════════════════════════
   SPRINT 9 — Mis Fuentes Web / Búsqueda Web
   ═══════════════════════════════════════════════════════════════════════════ */

/* Real-time search box */
.ws-search-box {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.ws-search-title {
  font-size: 13px; font-weight: 600; margin-bottom: 4px;
}
.ws-search-info {
  font-size: 11px; color: var(--text-3); margin-bottom: 10px; line-height: 1.4;
}
.ws-search-row {
  display: flex; gap: 6px; margin-bottom: 10px;
}
.ws-query-input {
  flex: 1; background: rgba(255,255,255,0.06); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; color: var(--text-1); font-size: 13px;
  outline: none; transition: border-color 0.15s;
}
.ws-query-input:focus { border-color: var(--accent); }
.ws-quick-queries {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.ws-quick-label { font-size: 10px; color: var(--text-3); flex-shrink: 0; }
.ws-quick-btn {
  font-size: 10px; padding: 3px 8px; background: rgba(255,255,255,0.06);
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  color: var(--text-2); transition: all 0.12s;
}
.ws-quick-btn:hover { background: rgba(255,255,255,0.12); color: var(--text-1); }

/* Section divider between search and sources */
.ws-section-divider {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-3);
}
.ws-add-link {
  font-size: 11px; padding: 2px 8px;
}

.ws-list {
  flex: 1; overflow-y: auto; padding: 8px 12px;
  display: flex; flex-direction: column; gap: 6px;
}

.ws-source {
  border-radius: 10px; padding: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  transition: background 0.12s;
}
.ws-source:hover { background: rgba(255,255,255,0.07); }
.ws-source--inactive { opacity: 0.55; }

.ws-source-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.ws-source-info { flex: 1; min-width: 0; }

.ws-source-label {
  font-size: 13.5px; font-weight: 600; color: var(--text-1);
  margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-source-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px;
}
.ws-cat-tag {
  font-size: 10.5px; padding: 2px 8px; border-radius: 4px;
  background: rgba(255,255,255,0.07); border: 1px solid var(--line); color: var(--text-2);
  white-space: nowrap;
}
.ws-status {
  font-size: 11px; font-weight: 500;
}
.ws-status--ok    { color: var(--green); }
.ws-status--error { color: var(--red); }
.ws-status--pending { color: var(--text-3); }
.ws-inactive-tag {
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  background: rgba(240,160,48,0.1); color: var(--amber);
  border: 1px solid rgba(240,160,48,0.25);
}
.ws-url {
  font-size: 11px; font-family: var(--font-mono); color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px;
}
.ws-preview {
  font-size: 11.5px; color: var(--text-3); line-height: 1.45;
  margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.ws-source-actions {
  display: flex; flex-direction: column; gap: 2px; flex-shrink: 0;
}
.ws-source-actions .ghost-btn {
  min-height: 28px; min-width: 28px; padding: 3px 6px; font-size: 14px;
}
.ws-delete-btn:hover { color: var(--red) !important; }

/* ═══════════════════════════════════════════════════════════════
   SKEIN AGENT SCORE — Quality Dashboard (Sprint 10)
   ═══════════════════════════════════════════════════════════════ */
.iq-score-card {
  display: flex; align-items: center; gap: 20px;
  padding: 20px 16px; border-bottom: 1px solid var(--line);
}
.iq-score-ring {
  flex-shrink: 0; width: 80px; height: 80px; border-radius: 50%;
  border: 4px solid var(--score-color, var(--accent));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04);
}
.iq-score-num { font-size: 22px; font-weight: 700; line-height: 1; }
.iq-score-label { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); margin-top: 2px; }
.iq-score-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.iq-score-hint { font-size: 12px; color: var(--text-3); line-height: 1.4; margin-bottom: 6px; }
.iq-score-updated { font-size: 10px; color: var(--text-3); }

.iq-kpi-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border-bottom: 1px solid var(--line);
}
.iq-kpi {
  padding: 14px 16px; background: var(--surface);
}
.iq-kpi-value { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.iq-kpi-label { font-size: 11px; font-weight: 600; color: var(--text-2); margin-bottom: 2px; }
.iq-kpi-sub { font-size: 10px; color: var(--text-3); }

.iq-section { padding: 16px; border-bottom: 1px solid var(--line); }
.iq-section-title { font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-3); margin-bottom: 12px; }

/* Sparkline (CSAT bar chart) */
.iq-sparkline {
  display: flex; align-items: flex-end; gap: 4px; height: 56px;
}
.iq-spark-col {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: default;
}
.iq-spark-bar-wrap {
  flex: 1; width: 100%; background: rgba(255,60,60,0.15); border-radius: 3px;
  display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
}
.iq-spark-pos { width: 100%; background: var(--green); border-radius: 2px; transition: height .3s; }
.iq-spark-label { font-size: 9px; color: var(--text-3); }

/* Tool breakdown */
.iq-tools-list { display: flex; flex-direction: column; gap: 8px; }
.iq-tool-row { display: flex; align-items: center; gap: 8px; }
.iq-tool-rank { width: 16px; text-align: right; font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.iq-tool-info { flex: 1; min-width: 0; }
.iq-tool-name { font-size: 12px; font-weight: 500; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iq-tool-bar-wrap { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.iq-tool-bar { height: 100%; background: var(--accent); border-radius: 2px; transition: width .4s; }
.iq-tool-count { font-size: 12px; font-weight: 600; color: var(--text-2); flex-shrink: 0; }

.iq-refresh-btn { margin: 16px; font-size: 12px; }

