/* ═══════════════════════════════════════════════════════════════
   layout.css — Estructura principal del desktop
   Estilo: dark neutral / Claude / Open WebUI
   ═══════════════════════════════════════════════════════════════ */

/* ── Topbar ──────────────────────────────────────────────────── */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 44px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px 0 0;
  gap: 8px;
  z-index: var(--z-topbar);
  user-select: none;
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  width: 44px; /* alineado con sidebar */
  flex-shrink: 0;
}
.logo-text {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
}
.logo-text span { color: var(--text2); }
.project-badge {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  font-size: 11px;
  color: var(--text2);
  font-family: var(--font-mono);
}
.env-badge {
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.env-dev  { background: rgba(210,153,34,0.12); color: var(--yellow); border: 1px solid rgba(210,153,34,0.25); }
.env-prod { background: rgba(248,81,73,0.12);  color: var(--red);    border: 1px solid rgba(248,81,73,0.25); }
.topbar-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.icon-btn {
  width: 30px; height: 30px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text3);
  transition: background 0.1s, color 0.1s;
}
.icon-btn:hover { background: var(--surface2); color: var(--text2); }
.icon-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; }

/* ── Sidebar izquierda — 44px, solo iconos ───────────────────── */
#sidebar {
  position: fixed;
  top: 44px; left: 0; bottom: 22px;
  width: 44px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
  gap: 2px;
  z-index: var(--z-toolbar);
}
.sidebar-btn {
  width: 32px; height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text3);
  transition: background 0.1s, color 0.1s;
  position: relative;
}
.sidebar-btn:hover {
  background: var(--surface2);
  color: var(--text2);
}
.sidebar-btn.active {
  background: var(--surface2);
  color: var(--text);
}
.sidebar-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.sidebar-sep { width: 20px; height: 1px; background: var(--border); margin: 3px 0; }

/* Tooltip */
.sidebar-btn[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface3);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  z-index: 9999;
}

/* ── Panel lateral secundario (280px) ────────────────────────── */
.side-panel {
  position: fixed;
  top: 44px; left: 44px; bottom: 22px;
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: calc(var(--z-toolbar) - 1);
  display: flex;
  flex-direction: column;
  transform: translateX(-110%);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.side-panel.open { transform: translateX(0); }
#desktop { transition: left 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
#desktop.panel-open { left: 304px; }

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  height: 44px;
}
.side-panel-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.side-panel-close {
  width: 22px; height: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text3);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.1s, color 0.1s;
}
.side-panel-close:hover { background: var(--surface2); color: var(--text2); }
.side-panel-close svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }

.side-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.side-panel-body::-webkit-scrollbar { width: 3px; }
.side-panel-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.side-panel-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Nav items del panel secundario ──────────────────────────── */
.panel-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  cursor: pointer;
  border-radius: 0;
  color: var(--text2);
  font-size: 13px;
  transition: background 0.1s, color 0.1s;
  position: relative;
}
.panel-nav-item:hover { background: var(--surface2); color: var(--text); }
.panel-nav-item.active { background: var(--surface2); color: var(--text); }
.panel-nav-item svg {
  width: 15px; height: 15px;
  stroke: currentColor; fill: none; stroke-width: 1.6;
  flex-shrink: 0;
  opacity: 0.7;
}
.panel-nav-item.active svg { opacity: 1; }
.panel-nav-item .item-badge {
  margin-left: auto;
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text3);
  background: var(--surface3);
  padding: 1px 5px;
  border-radius: 3px;
}
.panel-section-label {
  padding: 14px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ── Workspace items ─────────────────────────────────────────── */
.ws-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.1s;
}
.ws-item:hover { background: var(--surface2); }
.ws-item.active { background: var(--surface2); }
.ws-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--border2);
}
.ws-dot.running { background: var(--green); }
.ws-dot.stopped { background: var(--border2); }
.ws-dot.paused  { background: var(--yellow); }
.ws-dot.unknown { background: var(--text3); }
.ws-info { flex: 1; min-width: 0; }
.ws-name {
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-sub {
  font-size: 10px;
  color: var(--text3);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-badge {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}
.ws-badge.running { background: rgba(63,185,80,0.1); color: var(--green); }
.ws-badge.stopped { background: var(--surface3); color: var(--text3); }
.ws-badge.paused  { background: rgba(210,153,34,0.1); color: var(--yellow); }
.ws-group-label {
  padding: 12px 12px 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ── Admin / Config items ────────────────────────────────────── */
.admin-section {
  padding: 4px 0 6px;
  border-bottom: 1px solid var(--border);
}
.admin-section:last-child { border-bottom: none; }
.admin-section-title {
  padding: 10px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 12px;
  gap: 8px;
}
.admin-label { font-size: 12px; color: var(--text2); flex-shrink: 0; }
.admin-value { font-size: 12px; color: var(--text); text-align: right; min-width: 0; }
.admin-link {
  color: var(--text2);
  text-decoration: none;
  font-size: 10px;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
  display: inline-block;
}
.admin-link:hover { color: var(--text); text-decoration: underline; }

/* ── Config rows con toggle ──────────────────────────────────── */
.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  gap: 12px;
  transition: background 0.1s;
}
.config-row:hover { background: var(--surface2); }
.config-row-info { flex: 1; min-width: 0; }
.config-row-label { font-size: 13px; color: var(--text); }
.config-row-desc  { font-size: 11px; color: var(--text3); margin-top: 1px; }

/* Toggle switch */
.toggle {
  position: relative;
  width: 36px; height: 20px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--toggle-off);
  border-radius: 10px;
  transition: background 0.15s;
}
.toggle input:checked + .toggle-track { background: var(--toggle-on); }
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.15s;
  pointer-events: none;
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(16px); }

/* ── SuperAdmin items ────────────────────────────────────────── */
.sa-project {
  margin: 2px 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.sa-project:last-child { border-bottom: none; }
.sa-project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 2px;
}
.sa-project-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
}
.sa-project-count { font-size: 10px; font-family: var(--font-mono); color: var(--text3); }
.sa-container {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 12px 3px 20px;
}
.sa-container-name { flex: 1; font-size: 11px; color: var(--text2); font-family: var(--font-mono); }
.sa-container-status { font-size: 10px; color: var(--text3); font-family: var(--font-mono); white-space: nowrap; }

/* ── Desktop area ─────────────────────────────────────────────── */
#desktop {
  position: fixed;
  top: 44px; left: 44px; right: 0; bottom: 22px;
  overflow: hidden;
  background-color: var(--bg);
  /* grid gestionado por Grid.js en theme.js */
}

/* ── Statusbar ───────────────────────────────────────────────── */
#statusbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 22px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 14px;
  z-index: var(--z-statusbar);
  font-size: 10px;
  color: var(--text3);
  font-family: var(--font-mono);
  user-select: none;
}
.statusbar-item { display: flex; align-items: center; gap: 5px; }
.statusbar-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border2); }
.statusbar-dot.ok   { background: var(--green); }
.statusbar-dot.warn { background: var(--yellow); }
.statusbar-dot.err  { background: var(--red); }
.statusbar-spacer { flex: 1; }

/* ── Tool feed windows ───────────────────────────────────────── */
.tool-window {
  padding: 12px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tool-header-row { display: flex; align-items: center; gap: 8px; }
.tool-name { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--text); }
.tool-badge {
  font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px;
  padding: 1px 5px; border-radius: 3px;
}
.tool-ok      { background: rgba(63,185,80,0.12);  color: var(--green); }
.tool-err     { background: rgba(248,81,73,0.12);  color: var(--red); }
.tool-blocked { background: rgba(210,153,34,0.12); color: var(--yellow); }
.tool-pending { background: var(--surface3); color: var(--text3); }
.tool-meta { font-size: 10px; color: var(--text3); font-family: var(--font-mono); }
.tool-section { display: flex; flex-direction: column; gap: 3px; }
.tool-label {
  font-size: 10px; font-weight: 600;
  color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px;
}
.tool-pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text2);
  white-space: pre-wrap; word-break: break-all;
  max-height: 100px; overflow-y: auto; margin: 0;
}
.tool-error {
  background: rgba(248,81,73,0.06);
  border: 1px solid rgba(248,81,73,0.18);
  border-radius: var(--radius-sm);
  padding: 7px 9px; font-size: 11px;
  color: var(--red); font-family: var(--font-mono);
}

/* ── Desktop watermark (logo centrado, apagado) ──────────────── */
#desktop-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
}
.wm-svg {
  width: 320px;
  height: 100px;
  color: var(--text3);
  opacity: 0.06;
}

/* ── Panel Ajustes — estilo Perplexity ───────────────────────── */
.pref-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}
.pref-item:hover { background: var(--surface2); }
.pref-item.has-submenu::after {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px;
  border-right: 1.5px solid var(--text3);
  border-top: 1.5px solid var(--text3);
  transform: translateY(-50%) rotate(45deg);
}
.pref-icon {
  width: 28px; height: 28px;
  background: var(--surface3);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--text2);
}
.pref-icon svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.pref-info { flex: 1; min-width: 0; }
.pref-label { font-size: 13px; color: var(--text); }
.pref-value { font-size: 11px; color: var(--text3); margin-top: 1px; }
.pref-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Submenu inline (Perplexity style) ───────────────────────── */
.pref-submenu {
  display: none;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4px 0;
}
.pref-submenu.open { display: block; }
.pref-subitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 52px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  position: relative;
}
.pref-subitem:hover { background: var(--surface3); color: var(--text); }
.pref-subitem svg { stroke: currentColor; fill: none; stroke-width: 1.7; flex-shrink: 0; opacity: 0.7; }
.pref-subitem.selected { color: var(--text); }
.pref-subitem.selected::after {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  width: 5px; height: 9px;
  border-right: 1.5px solid var(--text);
  border-bottom: 1.5px solid var(--text);
  transform: translateY(-60%) rotate(45deg);
}

/* ── Sidebar bottom zone (superadmin + avatar) ───────────────── */
.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
}
.sidebar-sa-btn {
  color: var(--text3);
  opacity: 0.7;
}
.sidebar-sa-btn:hover { opacity: 1; }

/* Avatar circular */
.sidebar-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface3);
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  transition: border-color 0.1s, color 0.1s;
  user-select: none;
  flex-shrink: 0;
}
.sidebar-avatar:hover {
  border-color: var(--text3);
  color: var(--text);
}

/* ── Menú bocadillo usuario (Perplexity style) ───────────────── */
.user-menu {
  position: fixed;
  left: 52px;
  bottom: 28px;
  width: 240px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
  z-index: var(--z-modal);
  overflow: hidden;
  animation: um-in 0.12s cubic-bezier(0.2,0,0.2,1);
}
@keyframes um-in {
  from { opacity:0; transform: translateY(10px) scale(0.94); transform-origin: bottom left; }
  to   { opacity:1; transform: translateY(0) scale(1); transform-origin: bottom left; }
}

/* Cabecera */
.um-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.um-avatar-lg {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface3);
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--text2);
  flex-shrink: 0;
}
.um-user-info { flex: 1; min-width: 0; }
.um-name  { font-size: 13px; font-weight: 500; color: var(--text); }
.um-email { font-size: 11px; color: var(--text3); margin-top: 1px; }

/* Divider */
.um-divider { height: 1px; background: var(--border); margin: 3px 0; }

/* Items */
.um-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.um-item:hover { background: var(--surface3); color: var(--text); }
.um-item svg {
  width: 15px; height: 15px;
  stroke: currentColor; fill: none; stroke-width: 1.7;
  flex-shrink: 0; opacity: 0.7;
}
.um-item:hover svg { opacity: 1; }
.um-item-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 6px;
}
.um-item-value { font-size: 11px; color: var(--text3); }
.um-chevron {
  width: 12px; height: 12px;
  stroke: currentColor; fill: none; stroke-width: 2;
  opacity: 0.4;
  transition: transform 0.15s;
}
.um-has-sub.open .um-chevron { transform: rotate(90deg); }
.um-superadmin-item { color: var(--text3); }
.um-logout-sa { color: var(--red); opacity: 0.8; }
.um-logout-sa:hover { background: rgba(248,81,73,0.06); color: var(--red); opacity: 1; }

/* Submenu inline */
.um-submenu {
  display: none;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.um-submenu.open { display: block; }
.um-subitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 38px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  position: relative;
  transition: background 0.1s, color 0.1s;
}
.um-subitem:hover { background: var(--surface2); color: var(--text); }
.um-subitem svg {
  width: 13px; height: 13px;
  stroke: currentColor; fill: none; stroke-width: 1.7; opacity: 0.6;
}
.um-subitem.selected { color: var(--text); }
.um-subitem.selected::after {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  width: 5px; height: 9px;
  border-right: 1.5px solid var(--text2);
  border-bottom: 1.5px solid var(--text2);
  transform: translateY(-62%) rotate(45deg);
}

/* ── Flyout submenu derecha (Apariencia) ─────────────────────── */
.um-has-sub-right {
  position: relative;
}
.um-has-sub-right:hover,
.um-has-sub-right.active { background: var(--surface3); color: var(--text); }
.um-chevron-right {
  width: 12px; height: 12px;
  stroke: currentColor; fill: none; stroke-width: 2;
  opacity: 0.4;
}

.um-flyout {
  display: none;
  position: fixed;
  left: 296px;   /* user-menu (52+240) + 4px gap */
  bottom: 28px;  /* anclado sobre statusbar, igual que user-menu */
  width: 220px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
  z-index: calc(var(--z-modal) + 1);
  animation: um-in 0.1s cubic-bezier(0.2,0,0.2,1);
  transform-origin: bottom left;
}
.um-flyout::-webkit-scrollbar { width: 3px; }
.um-flyout::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.um-flyout.open { display: block; }

.um-flyout-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  position: relative;
}
.um-flyout-item:hover { background: var(--surface3); color: var(--text); }
.um-flyout-item svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none; stroke-width: 1.7;
  flex-shrink: 0; opacity: 0.7;
}
.um-flyout-item:hover svg { opacity: 1; }
.um-flyout-item.selected { color: var(--text); }
.um-flyout-item.selected::after {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  width: 5px; height: 9px;
  border-right: 1.5px solid var(--text2);
  border-bottom: 1.5px solid var(--text2);
  transform: translateY(-62%) rotate(45deg);
}

/* Row con toggle/select alineado a la derecha */
.um-flyout-row { justify-content: space-between; }
.um-flyout-row .toggle { margin-left: auto; }

.um-flyout-divider { height: 1px; background: var(--border); margin: 3px 0; }

/* Toggle pequeño para el flyout */
.toggle-sm { width: 30px; height: 17px; }
.toggle-sm .toggle-thumb { width: 13px; height: 13px; }
.toggle-sm input:checked ~ .toggle-thumb { transform: translateX(13px); }

/* ── Logo mini animado en topbar — colores del proyecto ─────── */
.logo-mini {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}
.logo-mini-icon {
  position: relative;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
/* box-1: azul sky — ventana frontal */
.logo-mini-box1 {
  position: absolute;
  width: 12px; height: 12px;
  top: 0; left: 0;
  border: 1.8px solid #38bdf8;
  border-radius: 2px;
  background: rgba(56,189,248,0.12);
}
/* box-2: púrpura — ventana trasera */
.logo-mini-box2 {
  position: absolute;
  width: 14px; height: 14px;
  bottom: 0; right: 0;
  border: 1.5px solid #818cf8;
  border-radius: 2px;
  background: rgba(129,140,248,0.06);
}
/* línea diagonal azul→púrpura */
.logo-mini-line {
  position: absolute;
  width: 130%; height: 1.5px;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  top: 50%; left: -15%;
  transform: translateY(-50%) rotate(-42deg);
  opacity: 0.4;
}
/* punto de pulso azul sky */
.logo-mini-pulse {
  position: absolute;
  width: 4px; height: 4px;
  background: #38bdf8;
  border-radius: 50%;
  top: 0; left: 0;
  animation: logo-pulse 3s infinite linear;
  box-shadow: 0 0 4px rgba(56,189,248,0.8);
}
@keyframes logo-pulse {
  0%   { top: 0;   left: 0; }
  25%  { top: 0;   left: 7px; }
  50%  { top: 7px; left: 7px; }
  75%  { top: 7px; left: 0; }
  100% { top: 0;   left: 0; }
}
/* texto: Shell bold blanco, Desktop azul sky */
.logo-mini-text {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.4px;
  color: var(--text);
  line-height: 1;
}
.logo-mini-text strong {
  font-weight: 800;
  color: var(--text);
}
.logo-mini-text span {
  font-weight: 700;
  color: #38bdf8;
  text-shadow: 0 0 12px rgba(56,189,248,0.3);
}

/* ── Segundo sidebar — Ajustes (Open WebUI style) ────────────── */

/* Nav horizontal de secciones */
.ajustes-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.ajustes-nav .panel-nav-item {
  border-radius: 0;
  padding: 8px 14px;
}

/* Contenido sección */
.ajustes-content {
  padding: 8px 0 16px;
  overflow-y: auto;
  flex: 1;
}
.ajustes-section-title {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Fila info (label + valor) */
.config-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  gap: 8px;
}
.config-info-label { font-size: 12px; color: var(--text2); flex-shrink: 0; }
.config-info-value { font-size: 12px; color: var(--text); text-align: right; }
.mono-val { font-family: var(--font-mono); font-size: 11px; }

/* Fila config-block (label + pill on/off) — estilo Open WebUI */
.config-block-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.config-block-row:last-child { border-bottom: none; }
.config-block-row:hover { background: var(--surface2); }
.config-block-info { flex: 1; min-width: 0; }
.config-block-label { font-size: 13px; color: var(--text); }
.config-block-desc  { font-size: 11px; color: var(--text3); margin-top: 1px; }

/* Pills de estado */
.status-pill {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}
.pill-on  { background: rgba(63,185,80,0.12); color: var(--green); border: 1px solid rgba(63,185,80,0.2); }
.pill-off { background: var(--surface3); color: var(--text3); border: 1px solid var(--border2); }

/* ── Selector de paleta en flyout ────────────────────────────── */
.um-flyout-palette-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  gap: 10px;
}
.um-flyout-palette-label {
  font-size: 12px;
  color: var(--text3);
  flex-shrink: 0;
}
.um-palette-swatches {
  display: flex;
  gap: 6px;
  align-items: center;
}
.palette-swatch {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.12s;
  padding: 0;
  flex-shrink: 0;
}
.palette-swatch:hover { transform: scale(1.15); }
.palette-swatch.active {
  border-color: var(--text2);
  transform: scale(1.1);
}

/* ── Modal Auth SuperAdmin ────────────────────────────────────── */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: calc(var(--z-modal) + 10);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-bg-in 0.15s ease;
}
@keyframes modal-bg-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.auth-modal-box {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  width: 360px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: modal-box-in 0.18s cubic-bezier(0.2,0,0.2,1);
  transform-origin: center bottom;
}
@keyframes modal-box-in {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.auth-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.auth-modal-icon {
  width: 36px; height: 36px;
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--text2);
}
.auth-modal-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.auth-modal-title    { font-size: 14px; font-weight: 600; color: var(--text); }
.auth-modal-subtitle { font-size: 12px; color: var(--text3); margin-top: 2px; }

.auth-modal-body { padding: 16px 20px; }
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input {
  width: 100%;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0 36px 0 12px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: border-color 0.1s;
}
.auth-input:focus { border-color: var(--text3); }
.auth-input.error  { border-color: var(--red); }
.auth-show-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text3);
  display: flex; align-items: center;
  padding: 0;
  transition: color 0.1s;
}
.auth-show-btn:hover { color: var(--text2); }
.auth-show-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.auth-error {
  margin-top: 8px;
  font-size: 12px;
  color: var(--red);
  background: rgba(248,81,73,0.08);
  border: 1px solid rgba(248,81,73,0.2);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

.auth-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
}

/* ── Workspace panel con acciones ────────────────────────────── */
.ws-project { border-bottom: 1px solid var(--border); }
.ws-project:last-child { border-bottom: none; }

.ws-project-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
}
.ws-project-header:hover { background: var(--surface2); }

.ws-project-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.ws-project-count {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text3);
}

/* Botones de acción */
.ws-project-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.1s;
}
.ws-project-header:hover .ws-project-actions { opacity: 1; }

.ws-act-btn {
  width: 22px; height: 22px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: var(--text3);
  transition: background 0.1s, color 0.1s;
  padding: 0;
}
.ws-act-btn:hover { background: var(--surface3); color: var(--text); }
.ws-act-disabled { opacity: 0.25; cursor: default; pointer-events: none; }
.ws-act-busy     { opacity: 0.5;  cursor: wait; }

/* Spinner inline */
.ws-spinner {
  display: inline-block;
  width: 8px; height: 8px;
  border: 1.5px solid var(--text3);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Servicios colapsables */
.ws-services { overflow: hidden; }
.ws-services.ws-collapsed { display: none; }

/* Toast de feedback */
.ws-toast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: var(--z-modal);
  pointer-events: none;
  white-space: nowrap;
}
.ws-toast.ws-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ws-toast.ws-toast-err  { border-color: rgba(248,81,73,0.3); color: var(--red); }

/* ── SuperAdmin btn — override hidden cuando autorizado ─────── */
#btn-superadmin:not([hidden]) { display: flex !important; }
