/* ============================================================
   VitroBoard v3.0 — Estilos Adicionales (Override + Extras)
   Marca: invitro AGENCIA
   Paleta: #3333CC #30CEB3 #F2A933 #ffffff #000000
   ============================================================
   Este archivo se carga DESPUÉS de style.css y aplica el
   rebrand y los componentes nuevos sin tocar la base original.
   Cambios soportados:
   - Variables de marca (modo oscuro y claro)
   - Topbar de mensajes (anim. scroll/static)
   - Switch de tema, indicadores activos, badge de notif
   - Panel de Settings, Performance, Master Popup
   - Date range pickers, multi-area, multi-collab chips
   - Bitácora con marcas de "editable hasta"
   ============================================================ */

/* ── Tokens base ─────────────────────────────────────────── */
:root {
  --vb-brand-1: #3333CC;
  --vb-brand-2: #30CEB3;
  --vb-brand-3: #F2A933;
  --vb-brand-w: #ffffff;
  --vb-brand-k: #000000;
}

/* Modo oscuro (default — sustituye los tokens originales) */
:root, html[data-theme="dark"] {
  --bg:     #0d0d12;
  --bg2:    #14141b;
  --bg3:    #1c1c26;
  --bg4:    #262633;
  --border: #2c2c3a;
  --border2:#3a3a48;
  --text:   #ececf3;
  --text2:  #9595ad;
  --accent: #3333CC;
  --accent2:#5757e6;
  --accent-soft: #21214a;
  --green:  #30CEB3;
  --teal:   #30CEB3;
  --amber:  #F2A933;
  --blue:   #4a9eff;
  --pink:   #ff6eb3;
  --red:    #ff5560;
  --shadow: 0 4px 18px rgba(0,0,0,.35);
}

/* Modo claro */
html[data-theme="light"] {
  --bg:     #f6f7fb;
  --bg2:    #ffffff;
  --bg3:    #eef0f6;
  --bg4:    #e2e6f0;
  --border: #d8dde7;
  --border2:#c4c9d6;
  --text:   #0d0d18;
  --text2:  #5a6079;
  --accent: #3333CC;
  --accent2:#2424a0;
  --accent-soft: #e5e7ff;
  --green:  #1ba585;
  --teal:   #30CEB3;
  --amber:  #d18c12;
  --blue:   #2c7be0;
  --pink:   #ff6eb3;
  --red:    #e23b46;
  --shadow: 0 4px 18px rgba(15, 24, 60, .08);
}

html[data-theme="light"] body {
  background: var(--bg);
  color: var(--text);
}

/* Transición global suave para cambio de tema */
html[data-theme] body, html[data-theme] .sidebar, html[data-theme] .topbar,
html[data-theme] .content, html[data-theme] .modal-overlay, html[data-theme] .kcol,
html[data-theme] .tcard, html[data-theme] .login-card {
  transition: background-color .22s ease, color .22s ease, border-color .22s ease;
}

/* ── Sidebar logo (sin degradados) ─────────────────────── */
.sidebar-logo {
  letter-spacing: -.4px;
  font-weight: 700;
}
/* Por defecto (oscuro): nombre en blanco. En claro: brand color. */
.sidebar-logo span {
  color: #ffffff;
  font-weight: 700;
}
html[data-theme="light"] .sidebar-logo span {
  color: var(--vb-brand-1);
}

/* Login: isotipo + footer */
.vb-login-iso {
  width: 64px; height: 64px;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
}
.vb-login-iso svg { width: 100%; height: 100%; }
.vb-login-iso img { width: 100%; height: 100%; object-fit: contain; }

.login-logo span {
  color: #ffffff;
}
html[data-theme="light"] .login-logo span {
  color: var(--vb-brand-1);
}

/* Pie de página de marca (sidebar) */
.vb-poweredby {
  padding: 10px 12px;
  text-align: center;
  font-size: 9.5px;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.vb-poweredby svg, .vb-poweredby img { width: 14px; height: 14px; opacity: .9; }

.vb-login-foot {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; margin-top: 14px; font-size: 11px;
}
.vb-link-muted {
  color: var(--text2); text-decoration: none;
  border-bottom: 1px dashed var(--border2);
}
.vb-link-muted:hover { color: var(--accent); }
.vb-mini-brand {
  color: var(--text2);
  font-size: 10px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* ── Topbar de mensajes (CEO/Coordinador) ─────────────── */
.vb-msgbar {
  width: 100%;
  min-height: 30px;
  padding: 6px 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; font-weight: 500;
  color: #fff;
  background: var(--vb-brand-1);  /* color sólido por defecto */
  position: relative;
  overflow: hidden;
  z-index: 50;
}
.vb-msgbar .vb-msg-text { flex: 1; min-width: 0; }
.vb-msgbar .vb-msg-edit, .vb-msgbar .vb-msg-close {
  background: rgba(0,0,0,.22); color: inherit; border: 0;
  border-radius: 4px; padding: 2px 8px; font-size: 11px; cursor: pointer;
}
.vb-msgbar .vb-msg-edit:hover, .vb-msgbar .vb-msg-close:hover { background: rgba(0,0,0,.38); }

/* Animación scroll (marquee) */
.vb-msgbar.is-anim .vb-msg-text {
  white-space: nowrap;
  display: inline-block;
  padding-left: 100%;
  animation: vb-marquee 22s linear infinite;
}
@keyframes vb-marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-200%); }
}

/* Selector de color (paleta de marca) */
.vb-palette {
  display: inline-flex; gap: 6px; flex-wrap: wrap;
}
.vb-palette label {
  cursor: pointer;
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 2px solid var(--border);
  position: relative;
  transition: transform .15s, border-color .15s;
}
.vb-palette label:hover { transform: scale(1.08); }
.vb-palette input { display: none; }
.vb-palette input:checked + .vb-palette-tip {
  position: absolute; inset: -2px;
  border: 2px solid var(--text);
  border-radius: 7px;
  pointer-events: none;
}
.vb-palette label[data-c="brand1"] { background: var(--vb-brand-1); }
.vb-palette label[data-c="brand2"] { background: var(--vb-brand-2); }
.vb-palette label[data-c="brand3"] { background: var(--vb-brand-3); }
.vb-palette label[data-c="black"]  { background: var(--vb-brand-k); }
.vb-palette label[data-c="white"]  { background: var(--vb-brand-w); border-color: var(--border2); }

/* ── Iconos del topbar (theme/notif) ──────────────────── */
.vb-icon-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 30px; height: 30px;
  border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  transition: all .15s;
}
.vb-icon-btn:hover { background: var(--bg4); color: var(--text); border-color: var(--border2); }
.vb-icon-btn .vb-icon-badge {
  position: absolute; top: 4px; right: 4px;
  width: 7px; height: 7px;
  background: var(--vb-brand-3);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--bg3);
}

/* Indicador de usuarios activos — compacto, sin scroll ni superposición */
.vb-active-users {
  display: inline-flex; align-items: center;
  gap: 2px; padding: 0 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 18px;
  height: 30px;
  overflow: hidden;
}
.vb-au-pill {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.vb-au-more { flex-shrink: 0; }
.vb-au-pill .ua {
  border: 1.5px solid var(--bg2);
}
.vb-au-pill .vb-au-dot {
  position: absolute;
  bottom: 0; right: 0;
  width: 7px; height: 7px;
  background: var(--vb-brand-2);
  border: 1.5px solid var(--bg2);
  border-radius: 50%;
}
.vb-au-more { font-size: 10px; color: var(--text2); margin-left: 2px; }

/* ── Botones: refuerzos brand ──────────────────────────── */
.btn-primary {
  background: var(--vb-brand-1) !important;
  color: #fff !important;
}
.btn-primary:hover { background: var(--accent2) !important; }
.btn-success { background: var(--vb-brand-2); color: #00342a; border: 0; }
.btn-warning { background: var(--vb-brand-3); color: #1c1300; border: 0; }

/* ── Settings panel ───────────────────────────────────── */
.vb-settings {
  padding: 22px;
  max-width: 940px;
  margin: 0 auto;
}
.vb-settings h2 { font-size: 18px; margin-bottom: 4px; }
.vb-settings .vb-sub { color: var(--text2); font-size: 12px; margin-bottom: 18px; }

.vb-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
}
.vb-card h3 {
  font-size: 14px; font-weight: 600; margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.vb-card .vb-hint { color: var(--text2); font-size: 11.5px; margin-bottom: 14px; }

/* ── Tabs de Configuración ─────────────────────────────── */
.vb-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.vb-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 14px;
  margin-bottom: -1px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: color .15s, background .15s, border-color .15s;
}
.vb-tab:hover { color: var(--text); background: var(--bg2); }
.vb-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
/* Solo se muestran las tarjetas del tab activo */
.vb-settings .vb-card[data-tab] { display: none; }
.vb-settings.tab-branding       .vb-card[data-tab="branding"],
.vb-settings.tab-mensajes       .vb-card[data-tab="mensajes"],
.vb-settings.tab-notificaciones .vb-card[data-tab="notificaciones"],
.vb-settings.tab-bloqueos       .vb-card[data-tab="bloqueos"] { display: block; }

.vb-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.vb-row > label { min-width: 130px; font-size: 12px; color: var(--text2); }
.vb-row > input[type="text"], .vb-row > input[type="url"], .vb-row > select, .vb-row > textarea {
  flex: 1; min-width: 180px;
}

.vb-pill-group { display: inline-flex; gap: 4px; background: var(--bg3); padding: 3px; border-radius: 999px; border: 1px solid var(--border); }
.vb-pill-group input[type="radio"] { display: none; }
.vb-pill-group label {
  padding: 5px 12px; font-size: 11.5px; font-weight: 500;
  cursor: pointer; border-radius: 999px; color: var(--text2);
  display: inline-flex; align-items: center; gap: 5px;
}
.vb-pill-group input:checked + label {
  background: var(--vb-brand-1); color: #fff;
}

.vb-color-swatch {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 2px solid var(--border);
  cursor: pointer;
}
.vb-color-swatch.active { border-color: var(--text); transform: scale(1.08); }

.vb-toggle {
  position: relative; display: inline-block;
  width: 40px; height: 22px;
}
.vb-toggle input { opacity: 0; width: 0; height: 0; }
.vb-toggle-slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg4);
  border-radius: 22px;
  transition: .25s;
}
.vb-toggle-slider:before {
  position: absolute; content: "";
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .25s;
}
.vb-toggle input:checked + .vb-toggle-slider { background: var(--vb-brand-1); }
.vb-toggle input:checked + .vb-toggle-slider:before { transform: translateX(18px); }

/* ── Date Range Picker ────────────────────────────────── */
.vb-range {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg3); border: 1px solid var(--border);
  padding: 4px 6px; border-radius: 8px;
}
.vb-range input[type="date"] {
  background: transparent; color: var(--text);
  border: 0; font-size: 12px; padding: 3px 4px;
  font-family: 'DM Mono', monospace;
}
.vb-range input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.7); cursor: pointer; }
html[data-theme="light"] .vb-range input[type="date"]::-webkit-calendar-picker-indicator { filter: none; }
.vb-range .vb-range-presets {
  display: inline-flex; gap: 3px; margin-left: 4px; padding-left: 8px;
  border-left: 1px solid var(--border);
}
.vb-range .vb-range-presets button {
  background: transparent; border: 0;
  font-size: 10.5px; color: var(--text2);
  padding: 3px 7px; border-radius: 5px; cursor: pointer;
}
.vb-range .vb-range-presets button:hover { background: var(--bg4); color: var(--text); }
.vb-range .vb-range-presets button.active { background: var(--vb-brand-1); color: #fff; }

/* ── Performance panel ─────────────────────────────────── */
.vb-perf {
  padding: 22px;
}
.vb-perf-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.vb-perf-head h2 { font-size: 18px; }

.vb-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.vb-kpi {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
}
.vb-kpi .vb-kpi-lbl { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: .8px; }
.vb-kpi .vb-kpi-val { font-size: 24px; font-weight: 700; margin-top: 6px; }
.vb-kpi .vb-kpi-sub { font-size: 11px; color: var(--text2); margin-top: 2px; }
.vb-kpi.is-brand .vb-kpi-val { color: var(--vb-brand-1); }
.vb-kpi.is-teal  .vb-kpi-val { color: var(--vb-brand-2); }
.vb-kpi.is-amber .vb-kpi-val { color: var(--vb-brand-3); }

.vb-perf-table {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.vb-perf-table th, .vb-perf-table td {
  padding: 10px 12px; text-align: left; font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}
.vb-perf-table th { background: var(--bg3); color: var(--text2); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
.vb-perf-table tr:last-child td { border-bottom: 0; }
.vb-perf-bar {
  display: inline-block; height: 6px;
  background: var(--bg4); border-radius: 4px;
  width: 100px; vertical-align: middle; margin-right: 6px;
  position: relative; overflow: hidden;
}
.vb-perf-bar > span {
  position: absolute; top: 0; left: 0; height: 100%;
  background: var(--vb-brand-1);
  border-radius: 4px;
}

/* ── Master Popup (imagen + enlace) ───────────────────── */
.vb-popup {
  position: fixed;
  bottom: 18px; right: 18px;
  width: 220px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 900;
  animation: vbpop-in .35s ease;
}
@keyframes vbpop-in {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.vb-popup img { width: 100%; display: block; max-height: 220px; object-fit: cover; }
.vb-popup-body { padding: 10px 12px; }
.vb-popup-body p { font-size: 12px; color: var(--text); margin: 0 0 8px; }
.vb-popup-body a {
  display: inline-block;
  background: var(--vb-brand-1); color: #fff; text-decoration: none;
  padding: 6px 12px; border-radius: 6px; font-size: 11.5px; font-weight: 500;
}
.vb-popup-close {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px;
  border-radius: 50%; border: 0;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 11px; cursor: pointer; line-height: 22px;
}

/* ── Multi-area chips, multi-collab ───────────────────── */
.vb-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.vb-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px; color: var(--text);
}
.vb-chip .vb-chip-x {
  cursor: pointer; opacity: .6;
  background: transparent; border: 0; padding: 0; color: inherit;
}
.vb-chip .vb-chip-x:hover { opacity: 1; }
.vb-chip-area  { background: var(--accent-soft); border-color: transparent; }
.vb-chip-collab .ua { width: 16px; height: 16px; font-size: 8px; }

/* Selector multi (checkbox lista) */
.vb-multi-list {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 160px; overflow-y: auto;
  padding: 6px;
}
.vb-multi-list label {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 5px; cursor: pointer;
  font-size: 12px;
}
.vb-multi-list label:hover { background: var(--bg4); }
.vb-multi-list input[type="checkbox"] { accent-color: var(--vb-brand-1); }

/* ── Bitácora / nota con marca de "editable hasta" ──── */
.vb-note-edit-window {
  display: inline-block; margin-left: 6px;
  font-size: 10px; color: var(--vb-brand-3);
  background: rgba(242,169,51,.12);
  border: 1px solid rgba(242,169,51,.35);
  padding: 1px 6px; border-radius: 4px;
}
.vb-note-locked {
  display: inline-block; margin-left: 6px;
  font-size: 10px; color: var(--text2);
  background: var(--bg4);
  padding: 1px 6px; border-radius: 4px;
}
.vb-note-auto {
  border-left: 3px solid var(--vb-brand-1);
  background: var(--accent-soft);
}
html[data-theme="light"] .vb-note-auto { background: #f0f1ff; }

/* ── Foto de perfil / Empresa ─────────────────────────── */
.vb-photo-upload {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0;
}
.vb-photo-edit {
  position: relative;
  width: 96px; height: 96px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg3); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 600; color: var(--text2);
  flex-shrink: 0;
}
.vb-photo-edit img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.vb-photo-edit > span { z-index: 1; position: relative; }
.vb-photo-edit:hover .vb-photo-overlay { opacity: 1; }
.vb-photo-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; opacity: 0; transition: .2s;
  z-index: 2;
}
.vb-photo-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vb-company-photo {
  width: 56px; height: 56px;
  border-radius: 10px;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  border: 1px solid var(--border);
  cursor: pointer;
}
.vb-company-photo img { width: 100%; height: 100%; object-fit: cover; }

/* Logo previews en Settings */
.vb-logo-slot {
  width: 100%;
  min-height: 80px;
  border: 1px dashed var(--border2);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  cursor: pointer;
}
.vb-logo-slot img {
  max-width: 100%;
  max-height: 70px;
  object-fit: contain;
}
.vb-logo-slot.is-light { background: #ffffff; border-color: var(--border2); }
.vb-logo-slot.is-light .vb-logo-empty { color: #888; }
.vb-logo-empty { color: var(--text2); font-size: 12px; }
.vb-logo-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Modal de password forzado ────────────────────────── */
.vb-pw-modal {
  position: fixed; inset: 0;
  background: rgba(5,5,15,.86);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000; padding: 18px;
}
.vb-pw-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px; width: 100%; max-width: 380px;
  box-shadow: var(--shadow);
}
.vb-pw-rule {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text2);
  margin: 3px 0;
}
.vb-pw-rule.ok { color: var(--vb-brand-2); }
.vb-pw-rule .vb-pw-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border2);
}
.vb-pw-rule.ok .vb-pw-dot { background: var(--vb-brand-2); }

/* ── Light theme tweaks (parches selectivos) ──────────── */
html[data-theme="light"] .sidebar { background: #ffffff; }
html[data-theme="light"] .topbar  { background: #ffffff; border-bottom: 1px solid var(--border); }
html[data-theme="light"] .kcol    { background: #ffffff; border: 1px solid var(--border); }
html[data-theme="light"] .tcard   { background: #ffffff; border: 1px solid var(--border); }
html[data-theme="light"] .modal   { background: #ffffff; }
html[data-theme="light"] .modal-overlay { background: rgba(15, 24, 60, .35); }
html[data-theme="light"] .login-card { background: #ffffff; box-shadow: var(--shadow); }
html[data-theme="light"] .login-wrap { background: #eef0f6; }
html[data-theme="light"] .btn-ghost { color: var(--text); }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c7ccdb; }
html[data-theme="light"] .toast { color: #fff; }

/* ── Notificaciones banner (fallback in-app) ───────────── */
.vb-inapp-notif {
  position: fixed;
  top: 70px; right: 18px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--vb-brand-1);
  border-radius: 10px;
  padding: 12px 14px;
  width: 290px;
  box-shadow: var(--shadow);
  z-index: 800;
  animation: vbpop-in .3s ease;
}
.vb-inapp-notif h4 { font-size: 13px; margin-bottom: 4px; color: var(--text); }
.vb-inapp-notif p  { font-size: 11.5px; color: var(--text2); margin: 0; }

/* ── Pequeñas mejoras de accesibilidad ───────────────── */
*:focus-visible {
  outline: 2px solid var(--vb-brand-2);
  outline-offset: 2px;
}

/* ── Toggle ojito en campos de contraseña ─────────────── */
.vb-pw-wrap {
  position: relative;
  display: block;
}
.vb-pw-wrap input {
  width: 100%;
  padding-right: 36px !important;
}
.vb-pw-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text2);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vb-pw-eye:hover { color: var(--text); }
.vb-pw-eye::before {
  /* Ícono ojo cerrado por defecto (SVG inline en background) */
  content: '';
  width: 18px; height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/><circle cx='12' cy='12' r='3'/></svg>") no-repeat center;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/><circle cx='12' cy='12' r='3'/></svg>") no-repeat center;
  -webkit-mask-size: contain;
          mask-size: contain;
}
.vb-pw-eye.is-on::before {
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94'/><path d='M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19'/><path d='M14.12 14.12a3 3 0 1 1-4.24-4.24'/><line x1='1' y1='1' x2='23' y2='23'/></svg>") no-repeat center;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94'/><path d='M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19'/><path d='M14.12 14.12a3 3 0 1 1-4.24-4.24'/><line x1='1' y1='1' x2='23' y2='23'/></svg>") no-repeat center;
  -webkit-mask-size: contain;
          mask-size: contain;
}

/* ── Dropdown de notificaciones ──────────────────────── */
.vb-notif-wrap { position: relative; }
.vb-notif-dd {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 600;
  padding: 8px 0;
}
.vb-notif-dd-hdr {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 12px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: .6px;
}
.vb-notif-dd-hdr a { color: var(--vb-brand-1); text-decoration: none; font-size: 11px; cursor: pointer; }
.vb-notif-list { max-height: 360px; overflow-y: auto; }
.vb-notif-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  position: relative;
}
.vb-notif-item:last-child { border-bottom: 0; }
.vb-notif-item:hover { background: var(--bg3); }
.vb-notif-item-ico { font-size: 16px; flex-shrink: 0; }
.vb-notif-item-body { flex: 1; min-width: 0; }
.vb-notif-item-body h5 { font-size: 12.5px; font-weight: 500; margin: 0 0 2px; color: var(--text); }
.vb-notif-item-body p  { font-size: 11px; color: var(--text2); margin: 0; }
.vb-notif-item-time { font-size: 10px; color: var(--text2); margin-top: 3px; }
.vb-notif-item-x {
  background: transparent; border: 0; color: var(--text2);
  cursor: pointer; padding: 0 4px; font-size: 13px; align-self: flex-start;
}
.vb-notif-item-x:hover { color: var(--red); }
.vb-notif-empty { padding: 18px 12px; text-align: center; color: var(--text2); font-size: 12px; }

/* Badge en bell */
.vb-icon-btn .vb-icon-badge {
  background: var(--vb-brand-3);
}
.vb-icon-btn .vb-icon-badge.is-num {
  width: auto; height: auto;
  min-width: 14px;
  padding: 1px 4px;
  font-size: 9px; font-weight: 600; color: #1c1300;
  display: flex; align-items: center; justify-content: center;
  top: 2px; right: 2px;
  border-radius: 8px;
}

/* ── Carrusel (master popup + center popup) ──────────── */
.vb-carousel { position: relative; }
.vb-carousel-track {
  display: flex; align-items: center;
  overflow: hidden;
  position: relative;
}
.vb-carousel-slide {
  flex: 0 0 100%;
  display: none;
}
.vb-carousel-slide.is-active { display: block; }
.vb-carousel-slide img { width: 100%; display: block; max-height: 100%; object-fit: cover; }
.vb-carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff; border: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 2;
  font-size: 14px; font-weight: 600;
}
.vb-carousel-arrow:hover { background: rgba(0,0,0,.8); }
.vb-carousel-prev { left: 6px; }
.vb-carousel-next { right: 6px; }
.vb-carousel-dots {
  display: flex; justify-content: center; gap: 5px;
  position: absolute; bottom: 8px; left: 0; right: 0; z-index: 2;
}
.vb-carousel-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.45);
  cursor: pointer; border: 0; padding: 0;
}
.vb-carousel-dot.is-active { background: #fff; }

/* Popup centro (anuncios / updates) */
.vb-update-popup {
  position: fixed; inset: 0;
  background: rgba(5,5,15,.78);
  display: flex; align-items: center; justify-content: center;
  z-index: 950; padding: 18px;
  animation: vbpop-fade .25s ease;
}
@keyframes vbpop-fade { from { opacity: 0; } to { opacity: 1; } }
.vb-update-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.vb-update-card .vb-carousel-track { aspect-ratio: 16/10; max-height: 360px; }
.vb-update-body {
  padding: 18px 20px;
}
.vb-update-body h3 { font-size: 16px; margin-bottom: 4px; }
.vb-update-body p  { font-size: 13px; color: var(--text2); margin-bottom: 10px; }
.vb-update-body .btn { display: inline-block; }
.vb-update-close {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px;
  border-radius: 50%; border: 0;
  background: rgba(0,0,0,.55); color: #fff;
  cursor: pointer; font-size: 13px; line-height: 28px;
  z-index: 5;
}

/* Lista de thumbnails en Settings (carruseles) */
.vb-img-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 60px;
}
.vb-img-thumb {
  position: relative;
  width: 72px; height: 72px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border2);
  background: var(--bg2);
}
.vb-img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vb-img-thumb-x {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,.7); color: #fff;
  border: 0; cursor: pointer; padding: 0;
  font-size: 9px; line-height: 18px;
}
.vb-img-thumb-x:hover { background: var(--red); }

/* ── Menú de usuario en topbar ─────────────────────── */
.vb-user-menu { position: relative; }
.vb-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
  color: var(--text);
  height: 30px;
  font-size: 12.5px;
  transition: background .15s, border-color .15s;
}
.vb-user-trigger:hover { background: var(--bg4); border-color: var(--border2); }
.vb-user-hello { color: var(--text2); }
.vb-user-hello b { color: var(--text); font-weight: 600; }

.vb-user-dd {
  position: fixed;
  width: 280px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 700;
  overflow: hidden;
}
.vb-user-dd-tenant {
  padding: 8px 14px;
  font-size: 11px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}
.vb-user-dd-tenant svg { width: 12px; height: 12px; }
.vb-user-dd-card {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.vb-user-dd-photo {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg3);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600; color: var(--text2);
  border: 1px solid var(--border);
}
.vb-user-dd-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.vb-user-dd-info {
  flex: 1;
  min-width: 0;
}
.vb-user-dd-info .vb-user-dd-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.vb-user-dd-info .vb-user-dd-email {
  font-size: 11.5px;
  color: var(--text2);
  word-break: break-all;
  margin-top: 2px;
}
.vb-user-dd-info .vb-user-dd-role {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--vb-brand-1);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.vb-user-dd-action {
  display: block;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.vb-user-dd-action:hover { background: var(--bg3); }
.vb-user-dd-action:last-child { border-bottom: 0; }
.vb-user-dd-action.is-danger { color: var(--red); }
.vb-user-dd-action.is-danger:hover { background: rgba(255,85,96,.08); }

/* ── Combobox con búsqueda incremental (AJAX) ─────────── */
.vb-combo {
  position: relative;
  display: flex;
  align-items: stretch;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: visible;
}
.vb-combo input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.vb-combo input::placeholder { color: var(--text2); opacity: .8; }
.vb-combo:focus-within {
  border-color: var(--vb-brand-1);
}
.vb-combo-toggle {
  background: transparent;
  border: 0;
  color: var(--text2);
  padding: 0 12px;
  cursor: pointer;
  font-size: 11px;
  border-left: 1px solid var(--border);
}
.vb-combo-toggle:hover { background: var(--bg4); color: var(--text); }
.vb-combo-list {
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow-y: auto;
  z-index: 9999;
  padding: 4px;
}
.vb-combo-item {
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text);
}
.vb-combo-item:hover, .vb-combo-item.is-active {
  background: var(--bg3);
}
.vb-combo-item-content {
  display: flex; align-items: center; gap: 8px;
}
.vb-combo-item-text {
  flex: 1; min-width: 0;
}
.vb-combo-item-text > div:first-child {
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vb-combo-sub { font-size: 10.5px; color: var(--text2); margin-top: 1px; }
.vb-combo-empty {
  padding: 10px;
  color: var(--text2);
  font-size: 12px;
  text-align: center;
}
.vb-combo-create {
  padding: 7px 10px;
  background: var(--accent-soft);
  border-radius: 6px;
  cursor: pointer;
  margin: 4px 0;
  font-size: 12px;
  color: var(--vb-brand-1);
  font-weight: 500;
}
.vb-combo-create:hover { background: var(--vb-brand-1); color: #fff; }
