:root {
  --fundo: #1a1245;
  --fundo-sutil: #14103a;
  --painel: rgba(30, 22, 68, .90);
  --painel-hover: rgba(42, 32, 85, .92);
  --painel-solid: #221a52;
  --borda: rgba(140, 100, 240, .18);
  --borda-hover: rgba(140, 100, 240, .35);
  --texto: #f0eef5;
  --texto-secundario: #c4bce0;
  --apagado: #8e82b0;
  --acento: #a78bfa;
  --acento-forte: #8b5cf6;
  --acento-dim: rgba(167, 139, 250, .18);
  --acento-glow: rgba(139, 92, 246, .30);
  --ok: #34d399;
  --ok-dim: rgba(52, 211, 153, .15);
  --atencao: #fbbf24;
  --atencao-dim: rgba(251, 191, 36, .15);
  --alerta: #f87171;
  --alerta-dim: rgba(248, 113, 113, .15);
  --glass: rgba(28, 20, 62, .75);
  --glass-border: rgba(139, 92, 246, .22);
  --glass-hover: rgba(38, 28, 78, .88);
  --sombra: 0 2px 8px rgba(10,5,30,.5), 0 0 1px rgba(139,92,246,.15);
  --sombra-lg: 0 4px 24px rgba(10,5,30,.5), 0 0 50px rgba(139,92,246,.10);
  --radius: 16px;
  --radius-sm: 12px;
  --sidebar-w: 240px;
  --rsb-w: 260px;
  --grad-hero: linear-gradient(135deg, #7c3aed 0%, #a855f7 30%, #c084fc 60%, #e879a8 100%);
  --grad-sidebar: linear-gradient(180deg, #1c1548 0%, #150f38 100%);
  --grad-card: linear-gradient(160deg, rgba(139,92,246,.12), rgba(59,38,120,.06));
}

* { box-sizing: border-box; }
*:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
::selection { background: rgba(139, 92, 246, .30); color: #fff; }

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font: 14px/1.6 'Inter', ui-sans-serif, system-ui, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════
   ANIMATION SYSTEM
   5 camadas: state machine, ambiente, micro,
   orquestração, mundo vivo
   ═══════════════════════════════════════════════ */

/* --- Base keyframes --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- 1. AGENT STATE MACHINE --- */

/* Idle: respiração orgânica com micro-flutuação */
@keyframes agentIdle {
  0%, 100% { transform: scale(1) translateY(0); opacity: .75; }
  25% { transform: scale(1.02) translateY(-1px); opacity: .85; }
  50% { transform: scale(1.04) translateY(-2px); opacity: 1; }
  75% { transform: scale(1.02) translateY(-1px); opacity: .9; }
}

/* Running: pulso energético com anel expansivo */
@keyframes agentRunSpin {
  to { transform: rotate(360deg); }
}
@keyframes agentRunPulse {
  0% { box-shadow: 0 0 0 0 rgba(52,211,153,.4), 0 0 12px rgba(52,211,153,.2); }
  50% { box-shadow: 0 0 0 8px rgba(52,211,153,0), 0 0 20px rgba(52,211,153,.3); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,.4), 0 0 12px rgba(52,211,153,.2); }
}
@keyframes agentRunGlow {
  0%, 100% { border-color: rgba(52,211,153,.35); box-shadow: 0 0 20px rgba(52,211,153,.12), 0 0 60px rgba(52,211,153,.06); }
  50% { border-color: rgba(52,211,153,.55); box-shadow: 0 0 30px rgba(52,211,153,.2), 0 0 80px rgba(52,211,153,.1); }
}

/* Waiting: bounce suave com atenção */
@keyframes agentWaitBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-4px) scale(1.02); }
  50% { transform: translateY(-2px) scale(1.01); }
}
@keyframes agentWaitPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251,191,36,.3); }
  50% { box-shadow: 0 0 0 6px rgba(251,191,36,0); }
}

/* Error: shake + flash vermelho */
@keyframes agentErrorShake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-2px); }
  30%, 70% { transform: translateX(2px); }
}
@keyframes agentErrorFlash {
  0%, 100% { border-color: rgba(248,113,113,.3); }
  50% { border-color: rgba(248,113,113,.6); }
}

/* Success: bounce celebratório */
@keyframes agentSuccess {
  0% { transform: scale(1); }
  20% { transform: scale(1.15); }
  40% { transform: scale(.95); }
  60% { transform: scale(1.05); }
  80% { transform: scale(.98); }
  100% { transform: scale(1); }
}

/* --- 2. AMBIENTE VIVO --- */

/* Hero gradient shift contínuo */
@keyframes heroGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Orbs flutuantes de fundo */
@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: .08; }
  33% { transform: translate(40px, -30px) scale(1.2); opacity: .12; }
  66% { transform: translate(-20px, 20px) scale(.9); opacity: .06; }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: .06; }
  40% { transform: translate(-30px, 40px) scale(1.1); opacity: .1; }
  70% { transform: translate(25px, -15px) scale(.95); opacity: .04; }
}

/* Status dot ring expanding */
@keyframes dotRing {
  0% { box-shadow: 0 0 0 0 currentColor; }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Glow de card running */
@keyframes cardRunGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(52,211,153,.08), 0 0 60px rgba(52,211,153,.04), var(--sombra); }
  50% { box-shadow: 0 0 30px rgba(52,211,153,.15), 0 0 80px rgba(52,211,153,.08), var(--sombra-lg); }
}

/* --- 3. MICRO-INTERAÇÕES --- */

/* Métrica counter roll */
@keyframes countUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Card entrance stagger (aplicado via JS com --stagger) */
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- 4. ORQUESTRAÇÃO DE ENTRADA --- */
@keyframes sectionSlideIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sidebar nav cascade */
@keyframes navCascade {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- 5. MUNDO VIVO --- */

/* Neural path flow (hero brain) */
@keyframes neuroFlow { to { stroke-dashoffset: -36; } }
@keyframes neuroPulse { 0%,100% { opacity: .4; r: 3; } 50% { opacity: 1; r: 5.5; } }

/* Timeline dot pulse sutil */
@keyframes timelineDotPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* Sparkline bar grow */
@keyframes sparkGrow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

/* Hero badge dot com ring */
@keyframes liveRing {
  0% { box-shadow: 0 0 0 0 rgba(52,211,153,.5), 0 0 8px #34d399; }
  70% { box-shadow: 0 0 0 8px rgba(52,211,153,0), 0 0 8px #34d399; }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0), 0 0 8px #34d399; }
}

/* ═══════ prefers-reduced-motion ═══════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════
   LAYOUT: 3-panel
   ═══════════════════════════════════════════════ */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--rsb-w);
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  background: var(--grad-sidebar);
  border-right: 1px solid var(--borda);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-logo {
  padding: 24px 20px 16px;
}
.sidebar-logo h1 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -.3px;
  color: #fff;
}
.sidebar-logo .sub {
  color: var(--apagado);
  font-size: 11px;
  margin: 3px 0 0;
}
.nav-section {
  padding: 14px 14px 0;
}
.nav-cat {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--apagado);
  margin: 0 0 8px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 10px;
  color: var(--texto-secundario);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 2px;
  text-decoration: none;
  animation: navCascade .4s cubic-bezier(.22, 1, .36, 1) backwards;
  animation-delay: var(--nav-delay, 0s);
}
.nav-item:hover {
  background: rgba(139, 92, 246, .10);
  color: var(--texto);
}
.nav-item.active {
  background: rgba(139, 92, 246, .18);
  color: #fff;
  font-weight: 600;
}

/* Nav icons: colored circles */
.nav-icon-letter {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
  transition: all .2s;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.nav-icon-letter[data-color="green"] { background: linear-gradient(135deg, #34d399, #059669); }
.nav-icon-letter[data-color="blue"] { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.nav-icon-letter[data-color="orange"] { background: linear-gradient(135deg, #fb923c, #ea580c); }
.nav-icon-letter[data-color="pink"] { background: linear-gradient(135deg, #f472b6, #db2777); }
.nav-icon-letter[data-color="cyan"] { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.nav-icon-letter[data-color="purple"] { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.nav-icon-letter[data-color="rose"] { background: linear-gradient(135deg, #fb7185, #e11d48); }
.nav-icon-letter[data-color="violet"] { background: linear-gradient(135deg, #c084fc, #9333ea); }
.nav-icon-letter[data-color="amber"] { background: linear-gradient(135deg, #fbbf24, #d97706); }

.nav-badge {
  margin-left: auto;
  background: var(--alerta);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--borda);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s;
}
.sidebar-user:hover { background: rgba(139, 92, 246, .10); }
.sidebar-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--acento-forte), var(--acento));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .3), 0 0 15px rgba(139, 92, 246, .15);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-user-status { font-size: 11px; color: var(--apagado); }

/* Scrollbars */
.main::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.rsb::-webkit-scrollbar { width: 5px; }
.main::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
.rsb::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.rsb::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, .2);
  border-radius: 3px;
}
.main::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover,
.rsb::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, .35);
}

/* ── Main area ── */
.main {
  padding: 24px 28px 100px;
  overflow-y: auto;
  animation: fadeUp .4s ease-out;
  background: radial-gradient(ellipse at 50% 0%, rgba(139,92,246,.10) 0%, rgba(100,60,200,.04) 50%, transparent 80%);
  position: relative;
}
.main::before,
.main::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}
.main::before {
  width: 300px;
  height: 300px;
  background: rgba(139, 92, 246, .06);
  top: 10%;
  right: 15%;
  animation: orbFloat1 20s ease-in-out infinite;
}
.main::after {
  width: 250px;
  height: 250px;
  background: rgba(168, 85, 247, .05);
  bottom: 20%;
  left: 10%;
  animation: orbFloat2 25s ease-in-out infinite;
}
.main > * { position: relative; z-index: 1; }

/* Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-greeting {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: #fff;
}
.page-sub {
  font-size: 11px;
  color: var(--apagado);
  margin-top: 2px;
  letter-spacing: .2px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(139, 92, 246, .12);
  border: 1px solid rgba(139, 92, 246, .18);
  border-radius: 12px;
  padding: 9px 16px;
  color: var(--apagado);
  font-size: 13px;
  cursor: pointer;
  transition: all .25s;
  min-width: 260px;
}
.search-box:hover {
  border-color: rgba(139, 92, 246, .35);
  background: rgba(139, 92, 246, .18);
  box-shadow: 0 0 20px rgba(139, 92, 246, .08);
}
.search-kbd {
  font-size: 10px;
  background: rgba(139, 92, 246, .12);
  border: 1px solid var(--borda);
  border-radius: 5px;
  padding: 2px 6px;
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
}
.avatar-brain {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139,92,246,.3), rgba(168,85,247,.2));
  border: 2px solid rgba(139,92,246,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ── Hero Banner ── */
.hero {
  background: linear-gradient(180deg, #1c1548 0%, #150f38 40%, #0f0a28 100%);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--sombra-lg), 0 0 80px rgba(139,92,246,.15);
}
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(180deg, rgba(124,58,237,.15) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}
.hero-content {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}
.lab-scene {
  position: relative;
  width: 100%;
  height: 520px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  --px: 0px;
  --py: 0px;
}
.lab-floor {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 18%;
  background: linear-gradient(180deg, rgba(20,12,50,0) 0%, rgba(12,6,30,.7) 50%, rgba(8,4,20,.9) 100%);
}
.lab-grid {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 14%;
  background:
    repeating-linear-gradient(90deg, rgba(100,120,255,.04) 0px, rgba(100,120,255,.04) 1px, transparent 1px, transparent 60px),
    repeating-linear-gradient(0deg, rgba(100,120,255,.04) 0px, rgba(100,120,255,.04) 1px, transparent 1px, transparent 30px);
  mask-image: linear-gradient(to top, rgba(0,0,0,.5) 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.5) 0%, transparent 100%);
  pointer-events: none;
}
.lab-monitor-glow {
  position: absolute;
  left: 18%;
  bottom: 22%;
  width: 80px;
  height: 60px;
  background: radial-gradient(ellipse, rgba(100,180,255,.15) 0%, transparent 70%);
  filter: blur(12px);
  animation: monitor-flicker 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes monitor-flicker {
  0%, 100% { opacity: .6; }
  30% { opacity: .8; }
  50% { opacity: .5; }
  70% { opacity: .9; }
  90% { opacity: .6; }
}
.lab-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.lab-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(140, 160, 255, .4);
  animation: particle-float linear infinite;
}
@keyframes particle-float {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: .6; }
  90%  { opacity: .3; }
  100% { transform: translateY(-300px) translateX(30px); opacity: 0; }
}
.lab-glow {
  position: absolute;
  bottom: 4%;
  width: 200px;
  height: 100px;
  border-radius: 50%;
  filter: blur(45px);
  opacity: .2;
  pointer-events: none;
}
.lab-glow-cerebro {
  left: 15%;
  background: rgba(80, 140, 255, .5);
  animation: glow-pulse 4s ease-in-out infinite;
}
.lab-glow-pinky {
  right: 15%;
  background: rgba(255, 100, 140, .4);
  animation: glow-pulse 4s ease-in-out infinite 2s;
}
@keyframes glow-pulse {
  0%, 100% { opacity: .15; transform: scale(1); }
  50%      { opacity: .3; transform: scale(1.08); }
}
.lab-character {
  position: absolute;
  bottom: 8%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(var(--px), var(--py));
  will-change: transform;
  transition: transform .3s ease-out;
  cursor: default;
}
#char-cerebro { left: 10%; }
#char-pinky   { right: 8%; }

.char-sprite {
  background-repeat: no-repeat;
  image-rendering: auto;
  animation: sprite-cycle 1.8s steps(12) infinite;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,.35));
}
.char-sprite-cerebro {
  width: 260px;
  height: 336px;
  background-size: 3120px 336px;
  background-image: url('/personagens/sprite-cerebro-typing-smooth.png');
  animation-name: sprite-cerebro;
}
.char-sprite-pinky {
  width: 240px;
  height: 382px;
  background-size: 2880px 382px;
  background-image: url('/personagens/sprite-pinky-creating-smooth.png');
  animation-name: sprite-pinky;
}
@keyframes sprite-cerebro {
  to { background-position: -3120px 0; }
}
@keyframes sprite-pinky {
  to { background-position: -2880px 0; }
}

.char-name {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.45);
  letter-spacing: .5px;
  text-transform: uppercase;
}

.lab-character {
  animation: char-breathe 5s ease-in-out infinite;
}
#char-cerebro { animation-delay: 0s; }
#char-pinky   { animation-delay: -2s; }

@keyframes char-breathe {
  0%, 100% { transform: translate(var(--px), var(--py)) translateY(0); }
  50%      { transform: translate(var(--px), var(--py)) translateY(-3px); }
}

.lab-character:hover .char-sprite {
  filter: drop-shadow(0 8px 28px rgba(100,120,255,.25)) drop-shadow(0 4px 12px rgba(0,0,0,.35));
  transition: filter .3s ease;
}
.lab-character:hover .char-name {
  color: rgba(255,255,255,.75);
  transition: color .3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .char-sprite { animation: none; }
  .lab-character { animation: none; }
  .lab-glow { animation: none; }
}
.lab-overlay {
  position: absolute;
  top: 12px; left: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.lab-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(255,255,255,.85);
  background: rgba(20,16,56,.7);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 20px;
}
.lab-title {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255,255,255,.8);
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.12);
  padding: 4px 10px;
  border-radius: 20px;
  width: fit-content;
  backdrop-filter: blur(8px);
}
.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: liveRing 2s ease-out infinite;
}
.hero-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.3px;
  color: #fff;
  margin: 0;
  white-space: nowrap;
}
.hero-desc {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255,255,255,.5);
  margin: 0;
}
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ── ESCRITÓRIO VIVO: lab canvas ── */

.hero-stats {
  display: flex;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,.12);
  position: relative;
  z-index: 1;
}
.hero-stat {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 0;
  border-right: 1px solid rgba(255,255,255,.08);
}
.hero-stat:last-child { border-right: none; }
.hero-stat-n {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}
.hero-stat-r {
  font-size: 11px;
  color: rgba(255,255,255,.6);
  text-transform: uppercase;
  letter-spacing: .5px;
}
/* ── Featured Cards (Salas) ── */
.featured-section { margin-bottom: 8px; }
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.featured-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.22, 1, .36, 1), box-shadow .25s;
  box-shadow: var(--sombra-lg);
}
.featured-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 12px 48px rgba(10,5,30,.6), 0 0 80px rgba(139,92,246,.18);
}
.featured-cerebro {
  background: linear-gradient(160deg, #1a1060 0%, #2d1b6e 40%, #0e2547 100%);
}
.featured-pinky {
  background: linear-gradient(160deg, #2d1040 0%, #4a1950 40%, #1a1060 100%);
}
.featured-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.featured-bg svg {
  position: absolute;
  right: -20px;
  top: -20px;
  width: 110%;
  height: 110%;
  opacity: .8;
}
.featured-content {
  position: relative;
  z-index: 1;
  padding: 24px 22px 0;
}
.featured-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 5px;
  letter-spacing: -.3px;
}
.featured-desc {
  font-size: 11.5px;
  color: rgba(255,255,255,.55);
  margin: 0 0 10px;
  line-height: 1.4;
}
.featured-meta {
  display: flex;
  gap: 16px;
  font-size: 11px;
}
.featured-online {
  color: var(--ok);
  font-weight: 600;
}
.featured-online::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 5px;
  box-shadow: 0 0 6px var(--ok);
  vertical-align: middle;
}
.featured-members {
  color: rgba(255,255,255,.5);
}
.featured-avatars {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 14px 22px 18px;
}
.featured-avatars .sala-agente {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.featured-avatars .sala-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 2px solid rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  font-weight: 600;
  transition: all .25s;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.featured-avatars .sala-avatar:hover {
  transform: scale(1.2) translateY(-2px);
  border-color: rgba(255,255,255,.5);
  box-shadow: 0 6px 20px rgba(139,92,246,.35), 0 0 30px rgba(139,92,246,.15);
}
.featured-avatars .sala-avatar.working {
  border-color: var(--ok);
  background: rgba(52,211,153,.2);
  animation: agentIdle 4s ease-in-out infinite;
  animation-delay: var(--agent-delay, 0s);
}
.featured-avatars .sala-avatar.idle { border-color: rgba(255,255,255,.15); }
.featured-avatars .sala-agente-nome {
  font-size: 9px;
  color: rgba(255,255,255,.55);
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  transition: color .2s;
}
.featured-avatars .sala-agente:hover .sala-agente-nome {
  color: rgba(255,255,255,.9);
}
@media (max-width: 900px) {
  .hero-content { flex-direction: column; }
  .hero-text { padding: 16px 16px 0; flex-direction: row; gap: 8px; }
  .hero-title { font-size: 16px; }
  .hero-desc { font-size: 11px; }
  .featured-grid { grid-template-columns: 1fr; }
  .lab-scene { height: 380px; }
  .char-sprite-cerebro { width: 170px; height: 220px; background-size: 2040px 220px; }
  .char-sprite-pinky { width: 155px; height: 246px; background-size: 1860px 246px; }
  @keyframes sprite-cerebro { to { background-position: -2040px 0; } }
  @keyframes sprite-pinky { to { background-position: -1860px 0; } }
  #char-cerebro { left: 2%; }
  #char-pinky { right: 2%; left: auto; }
}
.rive-badge {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(52, 211, 153, .2);
  color: var(--ok);
  font-weight: 600;
  letter-spacing: .5px;
}

/* ── Section headers ── */
.sec-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--apagado);
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.escritorio + .sec-header { margin-top: 32px; }

/* ── Mesa do Bruno ── */
.mesa { display: grid; gap: 10px; margin-bottom: 4px; }
.mesa-card {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  cursor: pointer;
  transition: all .2s;
  box-shadow: var(--sombra);
}
.mesa-card:hover {
  background: var(--glass-hover);
  border-color: var(--borda-hover);
  transform: translateY(-1px);
}
.mesa-card.urgente {
  border-color: rgba(248, 113, 113, .3);
  box-shadow: var(--sombra), 0 0 20px rgba(248, 113, 113, .08);
}
.mesa-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139,92,246,.2), rgba(168,85,247,.1));
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--acento);
  font-weight: 600;
}
.mesa-body { flex: 1; min-width: 0; }
.mesa-titulo { font-weight: 600; font-size: 14px; color: #fff; }
.mesa-resumo { color: var(--texto-secundario); font-size: 13px; margin-top: 3px; line-height: 1.5; }
.mesa-meta { color: var(--apagado); font-size: 11px; margin-top: 6px; }

/* ── Agentes grid ── */
.agentes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.agente-card {
  background: linear-gradient(160deg, rgba(40, 28, 85, .80), rgba(25, 18, 58, .75));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 16px 12px;
  position: relative;
  transition: all .25s cubic-bezier(.22, 1, .36, 1);
  cursor: pointer;
  box-shadow: var(--sombra);
  overflow: hidden;
}
.agente-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: .15;
  pointer-events: none;
}
.agente-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--sombra-lg), 0 0 40px rgba(139,92,246,.12);
}
.agente-card:hover .agente-avatar {
  box-shadow: 0 0 24px rgba(139,92,246,.35), 0 4px 16px rgba(139,92,246,.2);
  transform: scale(1.08);
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s;
}
.agente-card:nth-child(1) { background: linear-gradient(145deg, rgba(52, 211, 153, .30) 0%, rgba(16,12,40,.9) 70%); border-color: rgba(52,211,153,.25); }
.agente-card:nth-child(1)::before { background: radial-gradient(circle, #34d399 0%, transparent 70%); }
.agente-card:nth-child(2) { background: linear-gradient(145deg, rgba(139, 92, 246, .32) 0%, rgba(16,12,40,.9) 70%); border-color: rgba(139,92,246,.25); }
.agente-card:nth-child(2)::before { background: radial-gradient(circle, #8b5cf6 0%, transparent 70%); }
.agente-card:nth-child(3) { background: linear-gradient(145deg, rgba(251, 191, 36, .28) 0%, rgba(16,12,40,.9) 70%); border-color: rgba(251,191,36,.25); }
.agente-card:nth-child(3)::before { background: radial-gradient(circle, #fbbf24 0%, transparent 70%); }
.agente-card:nth-child(4) { background: linear-gradient(145deg, rgba(96, 165, 250, .28) 0%, rgba(16,12,40,.9) 70%); border-color: rgba(96,165,250,.25); }
.agente-card:nth-child(4)::before { background: radial-gradient(circle, #60a5fa 0%, transparent 70%); }
.agente-card:nth-child(5) { background: linear-gradient(145deg, rgba(244, 114, 182, .28) 0%, rgba(16,12,40,.9) 70%); border-color: rgba(244,114,182,.25); }
.agente-card:nth-child(5)::before { background: radial-gradient(circle, #f472b6 0%, transparent 70%); }
.agente-card:nth-child(6) { background: linear-gradient(145deg, rgba(34, 211, 238, .28) 0%, rgba(16,12,40,.9) 70%); border-color: rgba(34,211,238,.25); }
.agente-card:nth-child(6)::before { background: radial-gradient(circle, #22d3ee 0%, transparent 70%); }
.agente-card.has-running {
  animation: cardRunGlow 3s ease-in-out infinite;
  border-color: rgba(52,211,153,.25);
}
.agente-card.has-waiting {
  border-color: rgba(251,191,36,.35);
}
.agente-card-top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.agente-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139,92,246,.25), rgba(168,85,247,.12));
  border: 1.5px solid rgba(139,92,246,.3);
  box-shadow: 0 4px 12px rgba(139,92,246,.12);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--acento);
  font-weight: 600;
  animation: agentIdle 5s ease-in-out infinite;
  animation-delay: var(--agent-delay, 0s);
}
.agente-avatar.running {
  border-color: var(--ok);
  background: rgba(52,211,153,.15);
  color: var(--ok);
  animation: agentRunPulse 2s ease-in-out infinite;
  box-shadow: 0 0 16px rgba(52,211,153,.25), 0 4px 16px rgba(139,92,246,.15);
}
.agente-avatar.running svg {
  animation: agentRunSpin 2.5s linear infinite;
}
.agente-avatar.waiting {
  border-color: var(--atencao);
  background: rgba(251,191,36,.12);
  color: var(--atencao);
  animation: agentWaitBounce 2s ease-in-out infinite, agentWaitPulse 2s ease-out infinite;
}
.agente-avatar.error {
  border-color: var(--alerta);
  background: rgba(248,113,113,.12);
  color: var(--alerta);
  animation: agentErrorShake .5s ease-in-out, agentErrorFlash 1.5s ease-in-out infinite;
}
.agente-avatar.success {
  border-color: var(--ok);
  background: rgba(52,211,153,.15);
  color: var(--ok);
  animation: agentSuccess .8s cubic-bezier(.36, 1.5, .64, 1);
}
.agente-info { flex: 1; min-width: 0; }
.agente-nome { font-size: 13px; font-weight: 600; color: #fff; }
.agente-status { font-size: 11px; color: var(--apagado); }
.agente-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: absolute;
  top: 14px;
  right: 14px;
}
.agente-dot.running { background: var(--ok); animation: dotRing 1.5s ease-out infinite; color: var(--ok); }
.agente-dot.waiting { background: var(--atencao); animation: dotRing 2.5s ease-out infinite; color: var(--atencao); }
.agente-dot.idle { background: rgba(122, 112, 152, .4); }
.agente-terminal {
  background: rgba(0, 0, 0, .30);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(142, 130, 176, .75);
  line-height: 1.5;
  min-height: 38px;
  max-height: 54px;
  overflow: hidden;
  white-space: pre-wrap;
  border: 1px solid rgba(139, 92, 246, .06);
}
.agentes-mais {
  font-size: 12px;
  color: var(--acento);
  text-align: right;
  margin-top: 8px;
  cursor: pointer;
  opacity: .7;
}
.agentes-mais:hover { opacity: 1; }
.empty-state {
  color: var(--apagado);
  font-size: 13px;
  padding: 12px 0;
}

/* ── Metricas ── */
.metricas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
}
.metrica {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(40, 28, 85, .80), rgba(25, 18, 58, .75));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: all .25s cubic-bezier(.22, 1, .36, 1);
  box-shadow: var(--sombra);
}
.metrica::before {
  content: '';
  position: absolute;
  top: -10px;
  right: -10px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, .08) 0%, transparent 70%);
  pointer-events: none;
}
.metrica:hover {
  transform: translateY(-2px);
  box-shadow: var(--sombra-lg);
  border-color: var(--borda-hover);
  background: linear-gradient(160deg, rgba(50, 35, 100, .88), rgba(30, 22, 68, .82));
}
.metrica .n {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.5px;
  line-height: 1.1;
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.metrica::after {
  content: '';
  position: absolute;
  top: -15px;
  right: -15px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, .10) 0%, transparent 70%);
  pointer-events: none;
}
.metrica .r {
  color: var(--apagado);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-top: 6px;
}
.metrica.destaque { border-color: rgba(251, 191, 36, .3); box-shadow: var(--sombra), 0 0 15px rgba(251,191,36,.06); }
.metrica.destaque .n { color: var(--atencao); }
.metrica.alerta { border-color: rgba(248, 113, 113, .3); box-shadow: var(--sombra), 0 0 15px rgba(248,113,113,.06); }
.metrica.alerta .n { color: var(--alerta); }
.metrica .n.ok { color: var(--ok); }

/* ── Consumo ── */
.consumo {
  background: linear-gradient(160deg, rgba(35, 25, 75, .78), rgba(22, 16, 52, .72));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--sombra);
}
.consumo-titulo {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--apagado);
  margin-bottom: 14px;
}
.consumo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.consumo-row:last-of-type { margin-bottom: 0; }
.consumo-label {
  font-size: 13px;
  font-weight: 600;
  min-width: 68px;
  color: var(--texto);
}
.consumo-track {
  flex: 1;
  height: 6px;
  background: rgba(139, 92, 246, .20);
  border-radius: 3px;
  overflow: hidden;
}
.consumo-fill {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--acento-forte), var(--acento), var(--acento-forte));
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
  transform: scaleX(var(--pct, 0));
  transform-origin: left;
  transition: transform .8s cubic-bezier(.22, 1, .36, 1);
}
.consumo-fill.atencao { background: linear-gradient(90deg, #d97706, var(--atencao)); }
.consumo-fill.critico { background: linear-gradient(90deg, #dc2626, var(--alerta)); }
.consumo-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--apagado);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
}
.consumo-reset {
  font-size: 11px;
  color: var(--apagado);
  margin-top: 10px;
}
.consumo-extra {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 11px;
  color: var(--apagado);
}

/* ── Projetos (grid visual) ── */
.projetos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.projeto {
  background: linear-gradient(160deg, rgba(35, 25, 75, .78), rgba(22, 16, 52, .72));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  transition: all .25s;
  box-shadow: var(--sombra);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.projeto-corpo { flex: 1; min-width: 0; padding: 16px 18px; }
.projeto-thumb {
  width: 100%;
  height: 72px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 26px;
  color: rgba(255,255,255,.9);
  flex-shrink: 0;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.projeto:hover {
  background: linear-gradient(160deg, rgba(45, 32, 90, .85), rgba(28, 20, 62, .80));
  border-color: var(--borda-hover);
  transform: translateY(-2px);
  box-shadow: var(--sombra-lg);
}
.projeto.aberto { border-color: var(--acento); background: var(--glass-hover); }
.projeto .linha { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.projeto .nome {
  font-weight: 600;
  font-size: 14px;
  text-transform: capitalize;
  letter-spacing: -.1px;
  color: #fff;
}
.projeto .resumo {
  color: var(--texto-secundario);
  font-size: 13px;
  margin-top: 5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.projeto .meta {
  color: var(--apagado);
  font-size: 11px;
  margin-top: 8px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.projeto .seta {
  margin-left: auto;
  color: var(--apagado);
  font-size: 16px;
  transition: all .2s;
  opacity: .5;
}
.projeto:hover .seta { opacity: .8; color: var(--acento); }
.projeto.aberto .seta { transform: rotate(90deg); opacity: 1; color: var(--acento); }
.selo {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.selo.ativo { color: var(--ok); border-color: rgba(52,211,153,.3); background: var(--ok-dim); }
.selo.pausado { color: var(--atencao); border-color: rgba(251,191,36,.3); background: var(--atencao-dim); }
.selo.concluido { color: var(--apagado); border-color: var(--borda); }
.selo.indefinido { color: var(--alerta); border-color: rgba(248,113,113,.3); background: var(--alerta-dim); }

/* ── Detalhe (entregas) ── */
.detalhe {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--borda);
  font-size: 13px;
}
.detalhe-titulo {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--apagado);
  margin-bottom: 8px;
}
.detalhe-item {
  color: var(--texto);
  padding: 4px 0;
  text-transform: capitalize;
  border-bottom: 1px solid rgba(139,92,246,.06);
}
.detalhe-item:last-child { border-bottom: 0; }

/* ── Atividade timeline ── */
.atividade {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 22px;
  background: linear-gradient(160deg, rgba(35, 25, 75, .50), rgba(22, 16, 52, .40));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px 14px 30px;
}
.atividade::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 22px;
  bottom: 22px;
  width: 2px;
  background: linear-gradient(180deg, rgba(139,92,246,.40), rgba(139,92,246,.10));
  border-radius: 1px;
}
.atividade-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(139,92,246,.06);
  position: relative;
}
.atividade-item:last-child { border-bottom: 0; }
.atividade-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  margin-left: -20px;
  box-shadow: 0 0 8px currentColor;
  border: 2px solid var(--fundo-sutil);
  animation: timelineDotPulse 3s ease-in-out infinite;
  animation-delay: var(--dot-delay, 0s);
}
.atividade-texto {
  font-size: 13px;
  color: var(--texto-secundario);
  line-height: 1.5;
}
.atividade-texto strong { color: #fff; font-weight: 600; }
.atividade-hora {
  color: var(--apagado);
  font-size: 10px;
  margin-left: auto;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Composer ── */
.composer {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, var(--fundo) 35%);
  padding: 16px 0 8px;
  margin-top: 24px;
}
.composer-input {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  transition: border-color .2s;
}
.composer-input:focus-within { border-color: var(--acento); box-shadow: 0 0 20px rgba(139,92,246,.1); }
.composer-input input {
  flex: 1;
  background: none;
  border: none;
  color: var(--texto);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.composer-input input::placeholder { color: var(--apagado); }
.composer-btn {
  background: linear-gradient(135deg, var(--acento-forte), var(--acento));
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 18px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: opacity .2s;
}
.composer-btn:hover { opacity: .9; }

/* ═══════════════════════════════════════════════
   RIGHT SIDEBAR
   ═══════════════════════════════════════════════ */
.rsb {
  background: var(--grad-sidebar);
  border-left: 1px solid var(--borda);
  padding: 0;
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100vh;
}
.rsb-section {
  padding: 16px 14px;
  border-bottom: 1px solid var(--borda);
}
.rsb-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--apagado);
  margin-bottom: 12px;
}

/* Health score */
.health {
  background: linear-gradient(160deg, rgba(139,92,246,.20), rgba(168,85,247,.08));
  border: 1px solid rgba(139,92,246,.25);
  border-radius: var(--radius-sm);
  padding: 18px 14px;
  text-align: center;
  box-shadow: var(--sombra);
}
.health-score {
  font-size: 32px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.health-score.ok { color: var(--ok); text-shadow: 0 0 20px rgba(52,211,153,.3); }
.health-score.warn { color: var(--atencao); text-shadow: 0 0 20px rgba(251,191,36,.3); }
.health-score.danger { color: var(--alerta); text-shadow: 0 0 20px rgba(248,113,113,.3); }
.health-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--apagado);
  margin-top: 4px;
}
.health-sub {
  font-size: 11px;
  color: var(--apagado);
  margin-top: 8px;
}

/* RSB Quick Stats */
.rsb-quick-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.rsb-quick-stat {
  background: rgba(139, 92, 246, .15);
  border: 1px solid rgba(139, 92, 246, .22);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
}
.rsb-quick-stat .n,
.rsb-quick-stat-value {
  font-size: 18px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: #fff;
}
.rsb-quick-stat .r,
.rsb-quick-stat-label {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--apagado);
  margin-top: 4px;
  display: block;
}

/* Automacoes */
.rsb-auto {
  font-size: 12px;
  color: var(--texto-secundario);
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rsb-auto::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(52, 211, 153, .4);
}
.rsb-auto-freq { color: var(--apagado); font-size: 10px; }

/* ═══════════════════════════════════════════════
   EMPTY STATES + SKELETON
   ═══════════════════════════════════════════════ */
.vazio-estado {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: var(--apagado);
  font-size: 13px;
  text-align: center;
}
.skeleton {
  background: linear-gradient(90deg, var(--painel-solid) 0%, rgba(35,28,65,.6) 50%, var(--painel-solid) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-loading {
  position: relative;
  overflow: hidden;
}
.skeleton-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(139,92,246,.06) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: inherit;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════ */
button {
  font: inherit;
  background: linear-gradient(135deg, var(--acento-forte), var(--acento));
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: opacity .2s;
}
button:hover { opacity: .9; }
button.discreto {
  background: rgba(139, 92, 246, .10);
  color: var(--texto-secundario);
  border: 1px solid var(--borda);
  padding: 7px 14px;
  font-size: 12px;
}
button.discreto:hover { border-color: var(--borda-hover); color: #fff; }

input[type="password"] {
  font: inherit;
  width: 100%;
  background: rgba(0, 0, 0, .25);
  color: var(--texto);
  border: 1px solid var(--borda);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 14px;
  transition: all .2s;
}
input[type="password"]:focus {
  outline: none;
  border-color: var(--acento);
  box-shadow: 0 0 20px rgba(139, 92, 246, .15);
}
.caixa-login {
  max-width: 400px;
  margin: 12vh auto 0;
  background: linear-gradient(160deg, rgba(26,20,50,.95), rgba(13,10,24,.98));
  border: 1px solid var(--borda);
  border-radius: 20px;
  padding: 44px 36px 40px;
  box-shadow: var(--sombra-lg), 0 0 80px rgba(139, 92, 246, .08);
  animation: fadeUp .5s ease-out;
  backdrop-filter: blur(20px);
}
.caixa-login .icone { font-size: 52px; text-align: center; margin-bottom: 14px; }
.caixa-login h1 {
  margin: 0 0 4px;
  text-align: center;
  font-size: 28px;
  color: #fff;
}
.caixa-login .sub { text-align: center; margin-bottom: 0; font-size: 13px; color: var(--apagado); }
.caixa-login form { display: grid; gap: 18px; margin-top: 32px; }

/* Utilities */
.erro { color: var(--alerta); font-size: 13px; min-height: 18px; }
.vazio { color: var(--apagado); font-size: 13px; }

/* ── Dock (macOS-style, always visible) ── */
.dock {
  display: flex;
  align-items: flex-end;
  position: fixed;
  bottom: 16px;
  left: calc(var(--sidebar-w) + (100% - var(--sidebar-w) - var(--rsb-w)) / 2);
  transform: translateX(-50%);
  background: rgba(22, 16, 52, .75);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border: 1px solid rgba(139, 92, 246, .24);
  border-radius: 20px;
  padding: 8px 14px;
  gap: 2px;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(10, 5, 30, .6), 0 0 60px rgba(139, 92, 246, .1), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: padding .25s cubic-bezier(.34, 1.56, .64, 1);
}
.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: rgba(142, 130, 176, .8);
  font-size: 9px;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 12px;
  transition: color .2s ease, background .2s ease;
  position: relative;
  will-change: transform;
  transform-origin: bottom center;
}
.dock-item:hover {
  color: #fff;
}
.dock-item.active {
  color: var(--acento);
}
.dock-item.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--acento);
  box-shadow: 0 0 6px var(--acento);
}
.dock-item .nav-icon-letter {
  width: 36px;
  height: 36px;
  font-size: 14px;
  border-radius: 10px;
  transition: box-shadow .2s ease;
}
.dock-item:hover .nav-icon-letter {
  box-shadow: 0 0 16px rgba(139, 92, 246, .45), 0 4px 10px rgba(0, 0, 0, .35);
}
.dock-item::before {
  content: attr(data-label);
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(20, 14, 42, .95);
  border: 1px solid rgba(139, 92, 246, .25);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
}
.dock-item:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.dock-sep {
  width: 1px;
  align-self: stretch;
  margin: 6px 4px;
  background: rgba(139, 92, 246, .18);
}
@media (hover: none) {
  .dock-item::before { display: none; }
}

/* ── Command Palette (⌘K) ── */
.cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 5, 25, .65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
  animation: fadeIn .15s ease-out;
}
.cmd-overlay[hidden] { display: none; }
.cmd-palette {
  width: 560px;
  max-width: 90vw;
  background: linear-gradient(180deg, rgba(30, 22, 65, .97), rgba(18, 13, 42, .98));
  border: 1px solid rgba(139, 92, 246, .25);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6), 0 0 100px rgba(139, 92, 246, .08);
  overflow: hidden;
  animation: slideDown .2s cubic-bezier(.16, 1, .3, 1);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.cmd-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(139, 92, 246, .15);
}
.cmd-search-icon {
  color: var(--apagado);
  font-size: 16px;
  flex-shrink: 0;
}
.cmd-search input {
  flex: 1;
  background: none;
  border: none;
  color: var(--texto);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.cmd-search input::placeholder { color: var(--apagado); }
.cmd-search-kbd {
  font-size: 10px;
  color: var(--apagado);
  background: rgba(139, 92, 246, .10);
  border: 1px solid rgba(139, 92, 246, .15);
  border-radius: 5px;
  padding: 2px 6px;
  font-family: 'JetBrains Mono', monospace;
}
.cmd-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--apagado);
  padding: 12px 20px 6px;
}
.cmd-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 4px 8px 8px;
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
  color: var(--texto-secundario);
  font-size: 13px;
}
.cmd-item:hover, .cmd-item.selected {
  background: rgba(139, 92, 246, .15);
  color: #fff;
}
.cmd-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.cmd-item-text { flex: 1; }
.cmd-item-shortcut {
  font-size: 10px;
  color: var(--apagado);
  font-family: 'JetBrains Mono', monospace;
}
.cmd-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid rgba(139, 92, 246, .10);
  font-size: 10px;
  color: var(--apagado);
}
.cmd-footer kbd {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(139, 92, 246, .10);
  border: 1px solid rgba(139, 92, 246, .12);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
}

/* ── Animated Status Badge ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 3px 10px;
  border-radius: 99px;
  position: relative;
}
.status-badge.running {
  color: var(--ok);
  background: var(--ok-dim);
  border: 1px solid rgba(52, 211, 153, .25);
}
.status-badge.waiting {
  color: var(--atencao);
  background: var(--atencao-dim);
  border: 1px solid rgba(251, 191, 36, .25);
}
.status-badge.idle {
  color: var(--apagado);
  background: rgba(122, 112, 152, .10);
  border: 1px solid rgba(122, 112, 152, .15);
}
.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-badge.running::before {
  animation: dotRing 1.5s ease-out infinite;
  box-shadow: 0 0 6px currentColor;
}
.status-badge.waiting::before {
  animation: dotRing 2.5s ease-out infinite;
}

/* ── Project card accent ── */
.projeto { transition: all .25s; }

/* ── Sparkline in metrics ── */
.metrica-spark {
  margin-top: 8px;
  height: 24px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}
.metrica-spark-bar {
  flex: 1;
  background: rgba(139, 92, 246, .20);
  border-radius: 2px 2px 0 0;
  min-height: 3px;
  transition: height .4s cubic-bezier(.22, 1, .36, 1), background .3s;
  transform-origin: bottom;
  animation: sparkGrow .6s cubic-bezier(.22, 1, .36, 1) backwards;
  animation-delay: var(--spark-delay, 0s);
}
.metrica:hover .metrica-spark-bar { background: rgba(139, 92, 246, .35); }
.metrica-spark-bar.accent { background: var(--acento); }
.metrica:hover .metrica-spark-bar.accent { background: var(--acento-forte); }

/* ── Health breakdown items ── */
.health-breakdown {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.health-factor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--texto-secundario);
}
.health-factor-bar {
  width: 60px;
  height: 4px;
  background: rgba(139, 92, 246, .15);
  border-radius: 2px;
  overflow: hidden;
}
.health-factor-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--ok);
  transition: width .6s cubic-bezier(.22, 1, .36, 1);
}
.health-factor-fill.warn { background: var(--atencao); }
.health-factor-fill.danger { background: var(--alerta); }

/* ── Theme toggle pill ── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: rgba(139, 92, 246, .10);
  border: 1px solid rgba(139, 92, 246, .18);
  border-radius: 99px;
  padding: 3px;
  cursor: pointer;
}
.theme-toggle-opt {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 99px;
  color: var(--apagado);
  transition: all .2s;
  font-weight: 500;
}
.theme-toggle-opt.active {
  background: rgba(139, 92, 246, .25);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 92, 246, .15);
}

/* ═══════════════════════════════════════════════
   MOBILE HEALTH
   ═══════════════════════════════════════════════ */
.mobile-health { display: none; }

/* ═══════════════════════════════════════════════
   MOBILE (< 768px)
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .rsb { display: none; }
  .main { padding: 16px 14px 100px; }
  .page-greeting { font-size: 20px; }
  .search-box { display: none; }
  .salas { grid-template-columns: 1fr; }
  .agentes-grid { grid-template-columns: 1fr; }
  .metricas { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .metrica .n { font-size: 24px; }
  .escritorio { min-height: 140px; padding: 20px; }

  .mobile-health {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 14px;
    box-shadow: var(--sombra);
  }
  .mobile-health-score {
    font-size: 24px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    min-width: 48px;
  }
  .mobile-health-score.ok { color: var(--ok); }
  .mobile-health-score.warn { color: var(--atencao); }
  .mobile-health-score.danger { color: var(--alerta); }
  .mobile-health-status {
    font-size: 11px;
    color: var(--apagado);
  }
  .mobile-health-consumo {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .dock {
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 8px 12px env(safe-area-inset-bottom, 8px);
    justify-content: space-around;
  }
  .main { padding-bottom: 100px; }
}
@media (min-width: 769px) and (max-width: 1100px) {
  .shell { grid-template-columns: var(--sidebar-w) 1fr; }
  .rsb { display: none; }
}
