/* ─── EUROSTILE ─── */
@font-face { font-family: 'Eurostile'; src: url('./fonts/Eurostile-Regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Eurostile'; src: url('./fonts/Eurostile-Medium.otf') format('opentype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Eurostile'; src: url('./fonts/Eurostile-Bold.otf') format('opentype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Eurostile'; src: url('./fonts/Eurostile-Heavy.otf') format('opentype'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Eurostile'; src: url('./fonts/Eurostile-Black.otf') format('opentype'); font-weight: 900; font-display: swap; }
/* ─── EUROSTILE EXTENDED ─── */
@font-face { font-family: 'Eurostile Extended'; src: url('./fonts/Eurostile-Extended.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Eurostile Extended'; src: url('./fonts/Eurostile-Extended-Medium.otf') format('opentype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Eurostile Extended'; src: url('./fonts/Eurostile-Extended-Black.otf') format('opentype'); font-weight: 900; font-display: swap; }
/* ─── AEONIK ─── */
@font-face { font-family: 'Aeonik'; src: url('./fonts/Aeonik-Light.ttf') format('truetype'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Aeonik'; src: url('./fonts/Aeonik-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Aeonik'; src: url('./fonts/Aeonik-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Aeonik'; src: url('./fonts/Aeonik-Black.ttf') format('truetype'); font-weight: 900; font-display: swap; }

:root {
  /* Aliases legados → consomem tokens.css (canônico) */
  --pine-400: var(--olive-600);
  --cream: var(--cream-50);
  --cream-dark: var(--cream-100);
  --text-primary: var(--pine-800);
  --text-secondary: var(--olive-600);
  --text-muted: var(--stone-500);
  --border: var(--border-default);
  --white: var(--paper);
  --gold: var(--warning);
  --red: var(--danger);
  --green: var(--success);
  --amber: var(--warning);

  --sidebar-bg: var(--pine-700);
  --sidebar-text: rgba(250,247,239,0.75);
  --sidebar-active: rgba(250,247,239,0.12);
  --sidebar-hover: rgba(250,247,239,0.06);
  --content-bg: var(--cream);
  --header-bg: var(--white);
  --card-bg: var(--white);
  --card-border: var(--border-default);
  --heading-color: var(--pine-700);
  --body-color: var(--text-primary);

  --font-heading: var(--font-display);
  --font-heading-extended: var(--font-display-ext);
  --font-body: var(--font-text);
  --radius: var(--radius-card);
  --sidebar-w: 280px;
  --header-h: 60px;
}

/* Foco: anel Olive, nunca o pontilhado do browser */
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }

[data-theme="dark"] {
  --content-bg: var(--pine-ink);
  --header-bg: var(--pine-surface);
  --card-bg: var(--pine-card);
  --card-border: var(--pine-line);
  --body-color: var(--ink-body);
  --text-secondary: var(--ink-secondary);
  --text-muted: var(--ink-muted);
  --border: var(--pine-line);
  --heading-color: var(--ink-heading);
  --white: var(--pine-card);
}

/* Dark mode: headings hardcoded fix */
[data-theme="dark"] .home-greeting { color: var(--ink-heading); }
[data-theme="dark"] .home-eyebrow { color: var(--ink-heading-soft); }
[data-theme="dark"] .home-section-title { color: var(--ink-heading-soft); }
[data-theme="dark"] .agent-card-info h3 { color: var(--ink-heading); }
[data-theme="dark"] .agent-role { color: var(--ink-heading-soft); }
[data-theme="dark"] .metric-val { color: var(--ink-heading); }
[data-theme="dark"] .metric-label { color: var(--ink-heading-soft); }
[data-theme="dark"] .profile-name { color: var(--ink-heading); }
[data-theme="dark"] .profile-role { color: var(--ink-heading-soft); }
[data-theme="dark"] .profile-card h4 { color: var(--ink-heading-soft); }
[data-theme="dark"] .stat-val { color: var(--ink-heading); }
[data-theme="dark"] .stat-label { color: var(--text-secondary); }
[data-theme="dark"] .kpi-val { color: var(--ink-heading); }
[data-theme="dark"] .ic-name { color: var(--ink-heading); }
[data-theme="dark"] .changelog-version { color: var(--ink-heading); }
[data-theme="dark"] .lb-score { color: var(--ink-heading); }
[data-theme="dark"] .cerebro-header h2 { color: var(--ink-heading); }
[data-theme="dark"] .chat-header-info h3 { color: var(--ink-heading); }
[data-theme="dark"] .header-title { color: var(--ink-heading-soft); }
[data-theme="dark"] .logo-text { color: var(--cream-50); }
[data-theme="dark"] .agent-card { border-left-color: transparent; }
[data-theme="dark"] .agent-card:hover { border-left-color: var(--ink-heading); }
[data-theme="dark"] .message.user .message-bubble { background: var(--ink-user-bubble); }
[data-theme="dark"] .message.assistant .message-bubble { background: var(--card-bg); }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--content-bg);
  color: var(--body-color);
  height: 100vh;
  overflow: hidden;
  transition: background 0.2s, color 0.2s;
}

/* #root é o mount point do React — o layout flex (sidebar + main-wrapper)
   precisa estar aqui, não em body, já que body só tem #root como filho. */
#root {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.2s ease;
  position: relative;
}

.sidebar-collapse-btn {
  position: absolute;
  top: 22px;
  right: 10px;
  background: rgba(250,248,243,0.08);
  border: none;
  color: var(--sidebar-text);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}

.sidebar:hover .sidebar-collapse-btn { opacity: 1; }
.sidebar.collapsed .sidebar-collapse-btn { opacity: 1; right: 50%; transform: translateX(50%); top: 14px; }

.sidebar.collapsed {
  width: 56px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .logo-sub,
.sidebar.collapsed .sidebar-section,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-name,
.sidebar.collapsed .user-role,
.sidebar.collapsed .sidebar-shortcut-hint {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
  margin: 1px 4px;
}

.sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 52px 0 12px;
}

.sidebar.collapsed .user-info {
  justify-content: center;
  padding: 8px 4px;
}

.sidebar.collapsed .nav-item svg { opacity: 1; }

/* Tooltips on collapsed nav items */
.sidebar.collapsed .nav-item {
  position: relative;
}

.sidebar.collapsed .nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--pine-700);
  color: var(--cream);
  font-family: var(--font-heading-extended);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  white-space: nowrap;
  padding: 5px 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
}

.sidebar.collapsed .nav-item:hover::after {
  opacity: 1;
}

.sidebar-logo {
  padding: 20px 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo svg { flex-shrink: 0; }

.logo-text {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
  line-height: 1;
}

.logo-sub {
  font-family: var(--font-heading-extended);
  font-size: 10px;
  font-weight: 500;
  color: rgba(250,247,239,0.45);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-section {
  padding: 12px 8px 4px;
  font-family: var(--font-heading-extended);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(250,247,239,0.3);
  padding-left: 16px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s;
  border-radius: var(--radius);
  margin: 1px 6px;
  user-select: none;
}

.nav-item:hover { background: var(--sidebar-hover); color: var(--cream); }
.nav-item.active { background: var(--sidebar-active); color: var(--cream); }

.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg, .nav-item:hover svg { opacity: 1; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 8px;
  border-top: 1px solid rgba(250,248,243,0.08);
}

.sidebar-shortcut-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  margin-bottom: 4px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s;
  font-size: 11px;
  color: var(--sidebar-text);
}

.sidebar-shortcut-hint:hover { opacity: 1; }

.sidebar-shortcut-hint kbd {
  font-family: var(--font-heading-extended);
  font-size: 9px;
  background: rgba(250,248,243,0.1);
  border: 1px solid rgba(250,248,243,0.15);
  padding: 2px 6px;
  letter-spacing: 0.05em;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  color: var(--sidebar-text);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--pine-500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--cream);
  flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; color: var(--cream); }
.user-role { font-size: 11px; color: rgba(250,248,243,0.45); }

/* MAIN WRAPPER */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* HEADER */
header {
  height: var(--header-h);
  background: var(--header-bg);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  flex-shrink: 0;
  transition: background 0.2s;
}

.header-title {
  font-family: var(--font-heading-extended);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex: 1;
}

.admin-badge {
  font-family: var(--font-heading-extended);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 4px 10px;
  background: var(--pine-700);
  color: var(--cream);
  cursor: pointer;
  transition: opacity 0.2s;
}

.admin-badge:hover { opacity: 0.8; }
.admin-badge.inactive { background: var(--border); color: var(--text-secondary); }

.header-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.15s, background 0.15s;
  position: relative;
}

.header-btn:hover { color: var(--body-color); background: var(--cream-dark); }

[data-theme="dark"] .header-btn:hover { background: rgba(255,255,255,0.06); }

.notif-dot {
  min-width: 16px;
  height: 16px;
  background: var(--red);
  border-radius: 8px;
  position: absolute;
  top: 3px;
  right: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading-extended);
  font-size: 9px;
  font-weight: 700;
  color: var(--on-brand);
  padding: 0 4px;
  line-height: 1;
}

.header-avatar {
  width: 32px;
  height: 32px;
  background: var(--pine-700);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--cream);
  cursor: pointer;
}

/* CONTENT */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  transition: background 0.2s;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.content > * {
  animation: fadeInUp 0.18s ease-out;
}

.content.fullscreen {
  padding: 0;
  overflow: hidden;
}

/* NOTIFICATIONS PANEL */
.notifications-panel {
  position: absolute;
  top: var(--header-h);
  right: 24px;
  width: 320px;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-stamp);
  border-radius: var(--radius-card);
  z-index: 100;
  display: none;
}

.notifications-panel.open { display: block; }

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
}

.notif-header h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 15px;
  color: var(--heading-color);
  letter-spacing: 0.5px;
}

.notif-mark-all {
  font-size: 11px;
  color: var(--pine-400);
  cursor: pointer;
  font-weight: 600;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--card-border);
  cursor: pointer;
  transition: background 0.15s;
}

.notif-item:hover { background: var(--cream-dark); }
[data-theme="dark"] .notif-item:hover { background: rgba(255,255,255,0.04); }
.notif-item.unread { background: rgba(45,59,45,0.04); }

.notif-dot-item {
  width: 7px;
  height: 7px;
  background: var(--pine-400);
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.notif-text { font-size: 13px; line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--pine-700);
  color: var(--cream);
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-stamp);
  border-radius: var(--radius-hero);
  z-index: 1000;
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
}

.toast.show { transform: translateY(0); opacity: 1; }

/* ─── SPOTLIGHT ─── */
.spotlight-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}

.spotlight-overlay.open { display: flex; }

.spotlight-panel {
  background: var(--content-bg);
  border: 1px solid var(--card-border);
  width: 560px;
  max-width: 90vw;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-stamp);
  border-radius: var(--radius-card);
  animation: modalIn 0.14s ease;
}

.spotlight-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
}

#spotlight-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--body-color);
}

#spotlight-input::placeholder { color: var(--text-muted); }

.spotlight-esc {
  font-family: var(--font-heading-extended);
  font-size: 9px;
  letter-spacing: 0.1em;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 3px 7px;
  cursor: pointer;
  flex-shrink: 0;
}

.spotlight-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 0;
}

.spotlight-section {
  font-family: var(--font-heading-extended);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  padding: 10px 18px 4px;
}

.spotlight-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.1s;
}

.spotlight-item:hover { background: var(--cream-dark); }
[data-theme="dark"] .spotlight-item:hover { background: rgba(255,255,255,0.05); }

.spotlight-item-icon {
  width: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.spotlight-item-label {
  flex: 1;
  font-size: 14px;
  color: var(--body-color);
}

.spotlight-item-type {
  font-family: var(--font-heading-extended);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.spotlight-empty {
  padding: 24px 18px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* ─── USER PROFILE MODAL ─── */
.user-profile-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.user-profile-modal.open { display: flex; }

.user-profile-panel {
  background: var(--content-bg);
  border: 1px solid var(--card-border);
  width: 360px;
  padding: 40px 32px 32px;
  position: relative;
  animation: modalIn 0.18s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.user-profile-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}

.user-profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
}

.user-profile-avatar {
  width: 64px;
  height: 64px;
  background: var(--pine-700);
  color: var(--cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 4px;
}

.user-profile-name {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 900;
  color: var(--heading-color);
  letter-spacing: 0.04em;
  text-align: center;
}

.user-profile-role {
  font-family: var(--font-heading-extended);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.user-profile-stats {
  display: flex;
  border: 1px solid var(--card-border);
  margin-bottom: 20px;
}

.user-profile-stat {
  flex: 1;
  padding: 16px;
  text-align: center;
}

.user-profile-stat-val {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 900;
  color: var(--heading-color);
}

.user-profile-stat-label {
  font-family: var(--font-heading-extended);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-top: 4px;
}

.user-profile-stat-div {
  width: 1px;
  background: var(--card-border);
  align-self: stretch;
}

.user-profile-email {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--card-border);
  padding-top: 16px;
}

[data-theme="dark"] .user-profile-name { color: var(--gold); }

/* ─── HOME VIEW ─── */
.home-hero {
  margin-bottom: 32px;
}

.home-greeting {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 52px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--pine-800);
  line-height: 0.98;
  margin-bottom: 6px;
}

.home-eyebrow {
  font-family: var(--font-heading-extended);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--olive-600);
  margin-bottom: 16px;
}

.home-sub {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
}

.home-kpi-strip {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
}

.home-kpi {
  flex: 1;
  padding: 16px 24px;
  text-align: center;
}

.home-kpi-val {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--heading-color);
  line-height: 1;
  margin-bottom: 4px;
}

.home-kpi-label {
  font-family: var(--font-heading-extended);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.home-kpi-divider {
  width: 1px;
  height: 40px;
  background: var(--card-border);
  flex-shrink: 0;
}

[data-theme="dark"] .home-kpi-val { color: var(--gold); }

.home-input-wrap {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 16px;
  margin-bottom: 32px;
}

.home-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.home-input-row input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--body-color);
  outline: none;
}

.home-input-row input::placeholder { color: var(--text-muted); }

.agent-selector {
  position: relative;
}

.agent-selector-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--pine-700);
  color: var(--cream);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.agent-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-stamp);
  border-radius: var(--radius-card);
  width: 200px;
  z-index: 50;
  display: none;
}

.agent-dropdown.open { display: block; }

.agent-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}

.agent-dropdown-item:hover { background: var(--cream-dark); }
[data-theme="dark"] .agent-dropdown-item:hover { background: rgba(255,255,255,0.06); }

.send-btn {
  width: 36px;
  height: 36px;
  background: var(--pine-700);
  color: var(--cream);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.send-btn:hover { opacity: 0.85; }

.home-section-title {
  font-family: var(--font-heading-extended);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 28px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: border-color var(--motion), transform var(--motion);
}

.activity-item:hover { border-color: var(--pine-700); transform: translateX(2px); }

.activity-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.activity-icon-success { background: var(--success-bg); color: var(--success); }
.activity-icon-alert { background: var(--warning-bg); color: var(--warning); }
.activity-icon-info { background: rgba(31,51,49,0.12); color: var(--pine-700); }
[data-theme="dark"] .activity-icon-info { background: rgba(250,247,239,0.08); color: var(--cream); }

.activity-body { flex: 1; min-width: 0; }
.activity-action { font-size: 13px; color: var(--heading-color); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-agent { font-weight: 600; }
.activity-detail { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.activity-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; font-family: var(--font-heading-extended); }

.activity-item.activity-alert { border-left: 3px solid var(--warning); }
.activity-item.activity-success { border-left: 3px solid var(--success); }

.conv-list { display: flex; flex-direction: column; gap: 8px; }

.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: border-color 0.15s;
}

.conv-item:hover { border-color: var(--pine-400); }

.conv-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--cream);
  flex-shrink: 0;
}

.conv-info { flex: 1; min-width: 0; }
.conv-agent { font-size: 13px; font-weight: 600; color: var(--body-color); }
.conv-preview { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.conv-unread { width: 8px; height: 8px; background: var(--pine-400); border-radius: 50%; flex-shrink: 0; }

.conv-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.conv-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  padding: 0;
  line-height: 1;
}

.conv-item:hover .conv-delete-btn { opacity: 1; }
.conv-delete-btn:hover { color: var(--danger) !important; }

.conv-msg-count {
  font-family: var(--font-heading-extended);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--pine-400);
  margin-left: 8px;
  background: rgba(74,124,89,0.12);
  padding: 1px 6px;
}

.conv-empty {
  padding: 24px 20px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  border: 1px dashed var(--card-border);
}

/* ─── AGENTS VIEW ─── */
.agents-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.agents-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: var(--border-w-control) solid var(--card-border);
  background: var(--card-bg);
  border-radius: var(--radius-control);
  font-family: var(--font-heading-extended);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.agents-filter-btn:hover { border-color: var(--pine-700); color: var(--body-color); }
.agents-filter-btn.active { background: var(--pine-700); color: var(--cream); border-color: var(--pine-700); }
[data-theme="dark"] .agents-filter-btn.active { background: var(--gold); color: var(--pine-ink); border-color: var(--gold); }

.agents-filter-count {
  background: rgba(0,0,0,0.12);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
}

.agents-filter-btn.active .agents-filter-count { background: rgba(255,255,255,0.2); }

.filter-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.filter-status-dot.status-online { background: var(--status-online); }
.filter-status-dot.status-busy { background: var(--status-busy); }
.filter-status-dot.status-away { background: var(--status-away); }

.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.agent-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-left: 3px solid transparent;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s, border-left-color 0.15s, box-shadow 0.15s;
  position: relative;
}

.agent-card:hover {
  border-color: var(--card-border);
  border-left-color: var(--pine-400);
  box-shadow: 2px 0 0 0 var(--pine-400);
}

.agent-card-actions {
  display: none;
  position: absolute;
  bottom: 16px;
  right: 16px;
}

.agent-card:hover .agent-card-actions { display: flex; }

.agent-card-btn {
  font-family: var(--font-heading-extended);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 6px 14px;
  background: var(--pine-700);
  color: var(--cream);
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}

.agent-card-btn:hover { opacity: 0.85; }

.agent-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.agent-initials {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--cream);
  flex-shrink: 0;
}

.agent-card-info h3 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--heading-color);
  line-height: 1;
}

.agent-role {
  font-family: var(--font-heading-extended);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 3px;
}

.agent-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 10px;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-online { color: var(--green); }
.status-online .status-dot { background: var(--green); }
.status-busy { color: var(--amber); }
.status-busy .status-dot { background: var(--amber); }
.status-away { color: var(--text-muted); }
.status-away .status-dot { background: var(--text-muted); }

.agent-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 52px; }

.agent-metrics {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--card-border);
}

.metric-item { text-align: center; }
.metric-val {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--heading-color);
  line-height: 1;
}
.metric-label {
  font-family: var(--font-heading-extended);
  font-size: 8px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
  white-space: nowrap;
}

/* ─── AGENT PROFILE VIEW ─── */
.profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--pine-700);
  padding: 28px 28px;
  margin-bottom: 16px;
}

.profile-hero-left { display: flex; align-items: center; gap: 20px; }
.profile-hero-info { display: flex; flex-direction: column; }

.profile-eyebrow {
  font-family: var(--font-heading-extended);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.profile-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 900;
  color: var(--cream);
  flex-shrink: 0;
}

.profile-metrics-row {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  margin-bottom: 16px;
}

.profile-metric-block {
  flex: 1;
  padding: 18px 24px;
  text-align: center;
}

.profile-metric-val {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 32px;
  color: var(--heading-color);
  line-height: 1;
  margin-bottom: 4px;
}

.profile-metric-label {
  font-family: var(--font-heading-extended);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.profile-metric-divider { width: 1px; height: 40px; background: var(--card-border); }

[data-theme="dark"] .profile-metric-val { color: var(--gold); }
[data-theme="dark"] .profile-hero { border-left-color: var(--gold); }

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--cream);
}

.profile-name {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 40px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--heading-color);
  line-height: 0.98;
}

.profile-role {
  font-family: var(--font-heading-extended);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}

.btn-primary { background: var(--pine-700); color: var(--cream); }
.btn-secondary { background: var(--card-border); color: var(--body-color); }
.btn:hover { opacity: 0.85; }

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 20px;
}

.profile-card h4 {
  font-family: var(--font-heading-extended);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.capability-list { list-style: none; }
.capability-list li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.capability-list li::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--pine-400);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── CHAT VIEW ─── */
.chat-layout {
  display: flex;
  height: 100%;
}

.chat-sidebar {
  width: 220px;
  border-right: 1px solid var(--card-border);
  background: var(--card-bg);
  overflow-y: auto;
  flex-shrink: 0;
}

.chat-sidebar-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--heading-color);
  padding: 16px;
  border-bottom: 1px solid var(--card-border);
}

.chat-agent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--card-border);
}

.chat-agent-item:hover { background: var(--cream-dark); }
[data-theme="dark"] .chat-agent-item:hover { background: rgba(255,255,255,0.04); }
.chat-agent-item.active { background: rgba(45,59,45,0.08); }
[data-theme="dark"] .chat-agent-item.active { background: var(--ink-wash); }

.chat-agent-name { font-size: 13px; font-weight: 600; color: var(--body-color); }
.chat-agent-role { font-size: 11px; color: var(--text-muted); }

.chat-agent-avatar-wrap { position: relative; flex-shrink: 0; }

.chat-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--content-bg);
}

.chat-status-dot.status-online { background: var(--status-online); }
.chat-status-dot.status-busy { background: var(--status-busy); }
.chat-status-dot.status-away { background: var(--status-away); }

.chat-agent-info { flex: 1; min-width: 0; }

.chat-agent-msg-count {
  background: var(--pine-700);
  color: var(--cream);
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex-shrink: 0;
  font-family: var(--font-heading-extended);
}

[data-theme="dark"] .chat-agent-msg-count { background: var(--gold); color: var(--pine-ink); }

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  flex-shrink: 0;
}

.chat-header-info h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.5px;
  color: var(--heading-color);
}

.chat-header-role { font-size: 12px; color: var(--text-secondary); }

.chat-clear-btn {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 10px;
  border: 1px solid var(--card-border);
  transition: color 0.15s;
  background: none;
  font-family: var(--font-body);
}

.chat-clear-btn:hover { color: var(--red); border-color: var(--red); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px 24px;
  text-align: center;
  gap: 8px;
}

.chat-empty-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 22px;
  color: var(--cream);
  margin-bottom: 8px;
}

.chat-empty-name {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 22px;
  color: var(--heading-color);
  letter-spacing: 0.02em;
}

.chat-empty-role {
  font-family: var(--font-heading-extended);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.chat-empty-desc {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 380px;
  line-height: 1.55;
  margin-bottom: 16px;
}

.chat-empty-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 380px;
}

.chat-suggestion {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--body-color);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  transition: border-color 0.15s, background 0.15s;
}

.chat-suggestion:hover {
  border-color: var(--pine-400);
  background: var(--cream-dark);
}

[data-theme="dark"] .chat-suggestion:hover { background: rgba(255,255,255,0.05); }
[data-theme="dark"] .chat-empty-name { color: var(--gold); }

.home-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.home-quick-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 8px 14px;
  font-size: 12px;
  color: var(--body-color);
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.home-quick-btn:hover {
  border-color: var(--pine-400);
  background: var(--cream-dark);
}

[data-theme="dark"] .home-quick-btn:hover { background: rgba(255,255,255,0.05); }

.message {
  display: flex;
  gap: 10px;
  max-width: 80%;
}

.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message.assistant { align-self: flex-start; }

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--cream);
  flex-shrink: 0;
}

.message.user .message-avatar { background: var(--pine-400); }

.message-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
}

.msg-copy-btn {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-heading-extended);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.message:hover .msg-copy-btn { opacity: 1; }
.msg-copy-btn:hover { color: var(--pine-700); }
[data-theme="dark"] .msg-copy-btn:hover { color: var(--gold); }

.msg-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
}

.msg-time {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s;
  font-family: var(--font-heading-extended);
  letter-spacing: 0.05em;
}

.message:hover .msg-time { opacity: 1; }

.message.user .msg-footer { justify-content: flex-end; }
.message.user .msg-time { opacity: 0.6; }
.message.user:hover .msg-time { opacity: 1; }

.message-bubble {
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 100%;
}

.message.user .message-bubble {
  background: var(--pine-700);
  color: var(--cream);
}

.message.assistant .message-bubble {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--body-color);
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  width: fit-content;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--card-border);
  background: var(--card-bg);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  border: 1px solid var(--card-border);
  background: var(--content-bg);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--body-color);
  outline: none;
  resize: none;
  min-height: 42px;
  max-height: 120px;
}

.chat-input:focus { border-color: var(--pine-400); }
.chat-input::placeholder { color: var(--text-muted); }

/* ─── MARKDOWN IN CHAT ─── */
.message-bubble .md-p { margin: 0 0 8px 0; line-height: 1.6; }
.message-bubble .md-p:last-child { margin-bottom: 0; }
.message-bubble .md-h2 { font-family: var(--font-heading); font-weight: 900; font-size: 15px; text-transform: uppercase; letter-spacing: -0.01em; margin: 12px 0 4px; color: var(--heading-color); }
.message-bubble .md-h3 { font-family: var(--font-heading); font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: -0.01em; margin: 10px 0 4px; color: var(--heading-color); }
.message-bubble .md-h4 { font-size: 12px; font-weight: 600; margin: 8px 0 2px; color: var(--body-color); }
.message-bubble .md-ul { padding-left: 16px; margin: 6px 0; }
.message-bubble .md-ul li { margin-bottom: 3px; line-height: 1.5; }
.message-bubble .md-code { background: rgba(0,0,0,0.06); border: 1px solid var(--card-border); border-radius: 0; padding: 10px 14px; margin: 8px 0; overflow-x: auto; font-size: 12px; font-family: 'SF Mono', Menlo, monospace; line-height: 1.5; white-space: pre; }
[data-theme="dark"] .message-bubble .md-code { background: rgba(0,0,0,0.3); }
.message-bubble .md-inline-code { background: rgba(0,0,0,0.06); padding: 1px 5px; font-size: 12px; font-family: 'SF Mono', Menlo, monospace; border-radius: 2px; }
[data-theme="dark"] .message-bubble .md-inline-code { background: rgba(255,255,255,0.08); }
.message-bubble .md-hr { border: none; border-top: 1px solid var(--card-border); margin: 10px 0; }

/* ─── CEREBRO VIEW ─── */
.cerebro-layout {
  display: flex;
  height: 100%;
}

.cerebro-sidebar {
  width: 200px;
  border-right: 1px solid var(--card-border);
  padding: 20px 0;
  background: var(--card-bg);
  flex-shrink: 0;
}

.cerebro-sidebar-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--heading-color);
  padding: 0 16px 14px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 8px;
}

.cerebro-cat {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s;
  font-weight: 500;
}

.cerebro-cat:hover { background: var(--cream-dark); color: var(--body-color); }
[data-theme="dark"] .cerebro-cat:hover { background: rgba(255,255,255,0.04); }
.cerebro-cat.active { color: var(--pine-700); background: rgba(45,59,45,0.08); font-weight: 600; }
[data-theme="dark"] .cerebro-cat.active { color: var(--gold); background: var(--ink-wash); }

.cerebro-main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.cerebro-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cerebro-header h2 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 22px;
  color: var(--heading-color);
  letter-spacing: 0.5px;
}

.search-input {
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--body-color);
  outline: none;
  width: 220px;
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--pine-400); }

.cerebro-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--card-border);
  overflow: hidden;
}

.view-toggle-btn {
  background: var(--card-bg);
  border: none;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: background 0.15s, color 0.15s;
}

.view-toggle-btn.active {
  background: var(--pine-700);
  color: var(--cream);
}

.view-toggle-btn:not(.active):hover {
  background: var(--cream-dark);
  color: var(--body-color);
}

.docs-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}

.docs-list .doc-card {
  display: flex;
  align-items: center;
  gap: 16px;
  border-left-width: 3px;
  border-bottom: 1px solid var(--card-border);
  border-top: none;
  border-right: none;
  padding: 12px 16px;
}

.docs-list .doc-card-top { margin-bottom: 0; flex-shrink: 0; }
.docs-list .doc-title { flex: 1; margin-bottom: 0; }
.docs-list .doc-category { margin-left: auto; flex-shrink: 0; }

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.doc-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.doc-card:hover { border-color: var(--pine-400); }

.doc-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.doc-icon {
  width: 30px;
  height: 30px;
  background: rgba(45,59,45,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pine-700);
}

[data-theme="dark"] .doc-icon { background: var(--ink-wash); color: var(--gold); }

.doc-title { font-size: 13px; font-weight: 600; color: var(--body-color); margin-bottom: 6px; line-height: 1.35; }
.doc-category { font-family: var(--font-heading-extended); font-size: 9px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }
.doc-date { font-size: 10px; color: var(--text-muted); }

/* ─── TIMES VIEW ─── */
.times-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.ic-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 20px;
}

.ic-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}

.ic-avatar {
  width: 44px;
  height: 44px;
  background: var(--pine-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--cream);
}

.ic-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 17px;
  color: var(--heading-color);
  letter-spacing: 0.5px;
}

.ic-header-info { display: flex; flex-direction: column; gap: 2px; }
.ic-area { font-family: var(--font-heading-extended); font-size: 8px; font-weight: 500; letter-spacing: 0.18em; }
.ic-lead { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.ic-kpis { display: flex; gap: 0; margin-bottom: 16px; border: 1px solid var(--card-border); }
.kpi-item { flex: 1; padding: 10px 12px; border-right: 1px solid var(--card-border); }
.kpi-item:last-child { border-right: none; }
.kpi-label { font-family: var(--font-heading-extended); font-size: 8px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 3px; }
.kpi-val { font-family: var(--font-heading); font-weight: 900; font-size: 15px; color: var(--heading-color); }
.kpi-accent { font-size: 13px; }

.ic-projects-section { margin-top: 4px; }
.ic-projects-title { font-family: var(--font-heading-extended); font-size: 8px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 8px; }
.ic-projects-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ic-project-tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(45,59,45,0.08);
  font-size: 12px;
  color: var(--pine-700);
  margin: 0 4px 6px 0;
  font-weight: 500;
}

[data-theme="dark"] .ic-project-tag { background: var(--ink-wash); color: var(--gold); }

/* ─── LEADERBOARD VIEW ─── */
.leaderboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 20px;
}

.stat-val {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 36px;
  color: var(--heading-color);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

.leaderboard-table {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}

.lb-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
  padding: 0 20px;
}

.lb-podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 140px;
}

.lb-podium-avatar {
  width: 48px;
  height: 48px;
  font-size: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 900;
  color: var(--cream);
}

.lb-podium-name {
  font-family: var(--font-heading-extended);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--heading-color);
  text-align: center;
}

.lb-podium-score {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 900;
  color: var(--heading-color);
}

.lb-podium-crown {
  font-size: 18px;
  color: var(--warning);
  line-height: 1;
}

.lb-podium-block {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border);
}

.lb-podium-block-1 { height: 64px; background: var(--pine-700); border-color: var(--pine-700); }
.lb-podium-block-2 { height: 48px; background: var(--card-bg); }
.lb-podium-block-3 { height: 36px; background: var(--card-bg); }

.lb-podium-rank {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 900;
  color: var(--text-muted);
}

.lb-podium-1 .lb-podium-rank { color: var(--cream-50); }

[data-theme="dark"] .lb-podium-block-1 { background: var(--pine-700); }

.lb-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--card-border);
  transition: background 0.15s;
}

.lb-row:hover { background: var(--cream-dark); }
[data-theme="dark"] .lb-row:hover { background: rgba(255,255,255,0.04); }

.lb-rank {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 22px;
  color: var(--text-muted);
  width: 32px;
  text-align: center;
}

.lb-rank.top1 { color: var(--rank-1); }
.lb-rank.top2 { color: var(--rank-2); }
.lb-rank.top3 { color: var(--rank-3); }

.lb-info { flex: 1; }
.lb-name { font-size: 14px; font-weight: 600; color: var(--body-color); }
.lb-role { font-size: 12px; color: var(--text-muted); }

.lb-score {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
  color: var(--heading-color);
}

.lb-bar { height: 4px; background: var(--card-border); flex: 1; max-width: 100px; }
.lb-bar-fill { height: 100%; background: var(--pine-400); transition: width 0.5s; }

/* ─── INTEGRACOES VIEW ─── */
.integrations-summary {
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.integrations-summary strong { color: var(--heading-color); font-weight: 700; }

.integrations-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }

.integration-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-left: 3px solid transparent;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.15s;
}

.integration-card.integration-active {
  border-left-color: var(--pine-400);
}

.integration-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--on-brand);
  flex-shrink: 0;
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
}

.integration-info { flex: 1; min-width: 0; }
.integration-name { font-size: 13px; font-weight: 600; color: var(--body-color); margin-bottom: 2px; }
.integration-desc { font-size: 11px; color: var(--text-muted); }

.integration-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.integration-status {
  font-family: var(--font-heading-extended);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.integration-card.integration-active .integration-status {
  color: var(--green);
}

.toggle {
  width: 40px;
  height: 22px;
  background: var(--card-border);
  border-radius: 11px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle.on { background: var(--pine-700); }

.toggle::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--white);
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
}

.toggle.on::after { transform: translateX(18px); }

/* ─── COMPUTADORES VIEW ─── */
.computers-summary {
  display: flex;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  margin-bottom: 24px;
}

.comp-stat {
  flex: 1;
  padding: 20px;
  text-align: center;
}

.comp-stat-val {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 900;
  color: var(--heading-color);
  line-height: 1;
  margin-bottom: 6px;
}

.comp-stat-label {
  font-family: var(--font-heading-extended);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.comp-stat-div {
  width: 1px;
  background: var(--card-border);
  align-self: stretch;
}

.computers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.computer-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 20px;
}

.computer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.computer-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--body-color);
}

.computer-ip { font-size: 12px; color: var(--text-muted); }

.resource-bar { margin-bottom: 12px; }
.resource-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.bar {
  height: 6px;
  background: var(--card-border);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--pine-400);
  transition: width 0.5s;
}

.bar-fill.warn { background: var(--amber); }
.bar-fill.danger { background: var(--red); }

/* ─── CHANGELOG VIEW ─── */
.changelog-timeline { max-width: 640px; }

.changelog-item { display: flex; gap: 20px; margin-bottom: 32px; }

.changelog-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.changelog-dot {
  width: 12px;
  height: 12px;
  background: var(--pine-700);
  border: 2px solid var(--content-bg);
  border-radius: 50%;
  margin-top: 4px;
}

.changelog-line { width: 2px; background: var(--card-border); flex: 1; margin-top: 4px; }

.changelog-content { flex: 1; }

.changelog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.changelog-version {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  color: var(--heading-color);
  letter-spacing: 0.5px;
}

.changelog-badge-latest {
  font-family: var(--font-heading-extended);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 3px 8px;
  background: var(--pine-700);
  color: var(--cream);
}

[data-theme="dark"] .changelog-badge-latest { background: var(--gold); color: var(--pine-ink); }

.changelog-dot-latest {
  background: var(--pine-700) !important;
  width: 12px !important;
  height: 12px !important;
  margin-top: -1px;
}

[data-theme="dark"] .changelog-dot-latest { background: var(--gold) !important; }

.changelog-type {
  font-family: var(--font-heading-extended);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 8px;
  background: rgba(45,59,45,0.1);
  color: var(--pine-700);
}

[data-theme="dark"] .changelog-type { background: var(--ink-wash-strong); color: var(--gold); }
.changelog-type-feature { background: rgba(45,59,45,0.12); color: var(--pine-700); }
.changelog-type-release { background: var(--warning-bg); color: var(--warning); }
.changelog-type-fix { background: var(--danger-bg); color: var(--danger); }
[data-theme="dark"] .changelog-type-feature { background: var(--ink-wash-strong); color: var(--gold); }
[data-theme="dark"] .changelog-type-release { background: rgba(201,168,76,0.2); color: var(--gold); }
[data-theme="dark"] .changelog-type-fix { background: rgba(200,60,60,0.2); color: var(--ink-danger); }

.changelog-date { font-size: 12px; color: var(--text-muted); margin-left: auto; }

.changelog-items { list-style: none; }
.changelog-items li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 5px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.changelog-items li::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--pine-400);
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

/* ─── AGENT COLOR CLASSES ─── */
.agent-pine { background: var(--agent-pine); }
.agent-sage { background: var(--agent-sage); }
.agent-moss { background: var(--agent-moss); }
.agent-forest { background: var(--agent-forest); }
.agent-olive { background: var(--agent-olive); }
.agent-earth { background: var(--agent-earth); }
.agent-stone { background: var(--agent-stone); }

/* ─── PAGE TITLE ─── */
.page-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 40px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--heading-color);
  line-height: 0.98;
  margin-bottom: 24px;
}

/* ─── BACK BUTTON ─── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 20px;
  padding: 0;
  background: none;
  border: none;
  font-family: var(--font-body);
  transition: color 0.15s;
}

.back-btn:hover { color: var(--body-color); }

/* ─── MOBILE RESPONSIVE ─── */
.hamburger-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  background: none;
  border: none;
  padding: 0;
  flex-shrink: 0;
}

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

@media (max-width: 768px) {
  .hamburger-btn { display: flex; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 260px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .main-wrapper {
    width: 100%;
  }

  header {
    padding: 0 12px;
    gap: 8px;
  }

  .content {
    padding: 20px 16px;
  }

  .home-greeting {
    font-size: 36px;
  }

  .home-kpi-strip {
    grid-template-columns: repeat(2, 1fr);
    display: grid;
  }

  .home-kpi-divider { display: none; }

  .home-kpi:nth-child(1),
  .home-kpi:nth-child(3) {
    border-right: 1px solid var(--card-border);
  }

  .home-kpi:nth-child(1),
  .home-kpi:nth-child(2) {
    border-bottom: 1px solid var(--card-border);
  }

  .agent-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .teams-grid {
    grid-template-columns: 1fr;
  }

  .cerebro-layout {
    flex-direction: column;
  }

  .cerebro-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 8px;
    gap: 4px;
  }

  .chat-layout {
    flex-direction: column;
  }

  .chat-sidebar {
    width: 100%;
    max-height: 80px;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--card-border);
  }

  .chat-sidebar-title { display: none; }

  .chat-agent-item {
    flex-shrink: 0;
    padding: 8px 12px;
    flex-direction: column;
    gap: 2px;
    min-width: 80px;
    text-align: center;
    align-items: center;
  }

  .chat-agent-role { display: none; }

  .page-title { font-size: 28px; }

  .profile-layout { flex-direction: column; }
  .profile-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--card-border); }
}

/* ═══════════════════════════════════════════════════════════════
   CONFORMIDADE · DESIGN SYSTEM DELTA (tokens.css é o canônico)
   ═══════════════════════════════════════════════════════════════ */

/* Cantos — cards 4px */
.agent-card, .doc-card, .ic-card, .stat-card, .computer-card,
.integration-card, .conv-item, .profile-card, .home-kpi-strip,
.home-input-wrap, .computers-summary, .leaderboard-table,
.profile-metrics-row, .profile-hero, .conv-empty, .user-profile-stats,
.user-profile-panel {
  border-radius: var(--radius-card);
}

/* Cantos — controles pequenos 2px */
.btn, .send-btn, .agent-card-btn, .chat-clear-btn, .chat-input,
.search-input, .chat-suggestion, .home-quick-btn, .view-toggle,
.admin-badge, .agent-selector-btn, .spotlight-esc {
  border-radius: var(--radius-control);
}

/* Cantos — hero, stamps, full bleed: 0 */
.sidebar, .lb-podium-block, .changelog-badge-latest, .changelog-type,
.message.user .message-bubble, .ic-avatar, .integration-icon, .toast {
  border-radius: var(--radius-hero);
}

/* Pílula: SÓ chips de tag */
.ic-project-tag { border-radius: var(--radius-pill); padding: 4px 12px; }

/* Inputs e botões: borda de carimbo 1.5px */
.chat-input, .search-input {
  border-width: var(--border-w-control);
}
.chat-input:focus, .search-input:focus {
  border-color: var(--olive-600);
  box-shadow: var(--focus-ring);
}

/* Labels de botão: Eurostile Bold, maiúsculas, tracking 0.08em */
.btn, .agent-card-btn, .chat-clear-btn {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--track-button);
}

/* Estados: hover desce um tom, press escurece + translada 1px */
.btn-primary:hover, .send-btn:hover, .agent-card-btn:hover,
.agent-selector-btn:hover {
  background: var(--pine-800);
  opacity: 1;
}
.btn-primary:active, .send-btn:active, .agent-card-btn:active {
  background: var(--pine-800);
  transform: translateY(1px);
}

/* Movimento: 140ms padrão */
.btn, .send-btn, .agent-card-btn, .nav-item, .agents-filter-btn,
.chat-suggestion, .home-quick-btn, .conv-item, .doc-card, .toggle {
  transition-duration: 140ms;
}

/* Números de destaque: Eurostile Black, nunca o sans padrão */
.home-kpi-val, .stat-val, .metric-val, .profile-metric-val,
.kpi-val, .comp-stat-val, .lb-score, .lb-rank, .lb-podium-score,
.user-profile-stat-val {
  font-family: var(--font-display);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

/* Eyebrows/stamps: Eurostile Extended tracked (reforço) */
.home-eyebrow, .profile-eyebrow, .sidebar-section, .home-section-title,
.home-kpi-label, .metric-label, .stat-label-sm, .comp-stat-label,
.kpi-label, .ic-projects-title {
  font-family: var(--font-display-ext);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
}
.changelog-badge-latest, .changelog-type, .admin-badge {
  font-family: var(--font-display-ext);
  font-weight: 900;
  letter-spacing: var(--track-stamp);
}

/* ── Propagação · Agentes & Chat ── */
.filter-status-dot.status-online, .chat-status-dot.status-online { background: var(--status-online); }
.filter-status-dot.status-busy,   .chat-status-dot.status-busy   { background: var(--status-busy); }
.filter-status-dot.status-away,   .chat-status-dot.status-away   { background: var(--status-away); }
.status-online { color: var(--status-online); }
.status-online .status-dot { background: var(--status-online); }
.status-busy { color: var(--status-busy); }
.status-busy .status-dot { background: var(--status-busy); }
.status-away { color: var(--status-away); }
.status-away .status-dot { background: var(--status-away); }

.message.assistant .message-bubble { border-radius: var(--radius-card); }
.chat-agent-msg-count { border-radius: var(--radius-control); font-family: var(--font-display-ext); }
.typing-indicator { border-radius: var(--radius-card); }
.chat-sidebar-title, .cerebro-sidebar-title { font-family: var(--font-display); font-weight: 900; }

/* ── Propagação · Leaderboard: bloco 1 em Pine full bleed ── */
.lb-podium-block-1 {
  background: var(--pine-700);
  border-color: var(--pine-700);
}
.lb-podium-1 .lb-podium-rank { color: var(--cream-50); }
.lb-bar-fill { background: var(--olive-600); }

/* ── Propagação · estruturais ── */
.toggle { border: var(--border-w-control) solid var(--border-default); }
.toggle.on { background: var(--pine-700); border-color: var(--pine-700); }
.bar { border-radius: var(--radius-hero); }
.integration-icon { font-family: var(--font-display); }

/* ── Logo oficial Delta (asa) na sidebar ── */
.sidebar-logo-mark { flex-shrink: 0; display: block; }
.sidebar-logo-mark path, .sidebar-logo-mark polygon { fill: var(--cream-50); }
.sidebar.collapsed .sidebar-logo-mark { width: 34px; height: auto; }

/* ── Meta da resposta: modelo + fontes do RAG ── */
.msg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--card-border);
  font-family: var(--font-heading-extended);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.msg-model, .msg-sources {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
}
.msg-model {
  color: var(--olive-600);
  font-weight: 500;
}
.msg-model svg, .msg-sources svg { opacity: 0.7; flex-shrink: 0; }
.msg-sources { flex-wrap: wrap; }
.msg-sources-label { color: var(--text-muted); }
.msg-src {
  background: var(--olive-50);
  color: var(--olive-600);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
}
[data-theme="dark"] .msg-model { color: var(--gold); }
[data-theme="dark"] .msg-src { background: var(--ink-wash); color: var(--gold); }

/* ─── AUTH / LOGIN ─── */
.auth-screen {
  position: fixed; inset: 0; z-index: 500;
  background: var(--pine-700);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  width: 380px; max-width: 100%;
  padding: 40px 32px 32px;
  display: flex; flex-direction: column; align-items: center;
  box-shadow: var(--shadow-stamp);
}
.auth-logo-mark { display: block; margin-bottom: 18px; }
.auth-logo-mark path, .auth-logo-mark polygon { fill: var(--pine-700); }
[data-theme="dark"] .auth-logo-mark path, [data-theme="dark"] .auth-logo-mark polygon { fill: var(--gold); }
.auth-title {
  font-family: var(--font-heading); font-weight: 900; font-size: 26px;
  letter-spacing: 0.06em; color: var(--heading-color); line-height: 1;
}
.auth-sub {
  font-family: var(--font-heading-extended); font-size: 10px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted);
  margin-top: 8px; margin-bottom: 28px;
}
.auth-form { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.auth-form input {
  border: var(--border-w-control) solid var(--card-border);
  background: var(--content-bg); color: var(--body-color);
  padding: 11px 14px; font-family: var(--font-body); font-size: 14px;
  border-radius: var(--radius-control); outline: none;
}
.auth-form input:focus { border-color: var(--olive-600); box-shadow: var(--focus-ring); }
.auth-btn {
  margin-top: 6px; padding: 12px; border: none; cursor: pointer;
  background: var(--pine-700); color: var(--cream);
  font-family: var(--font-heading); font-weight: 700; font-size: 13px;
  letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: var(--radius-control); transition: background var(--motion);
}
.auth-btn:hover { background: var(--pine-800); }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-error {
  color: var(--danger); font-size: 12px; text-align: center; min-height: 16px;
  margin-top: 4px;
}
.auth-logout-btn {
  margin-top: 16px; width: 100%; padding: 9px;
  background: none; border: 1px solid var(--card-border); color: var(--text-secondary);
  font-family: var(--font-body); font-size: 12px; cursor: pointer;
  border-radius: var(--radius-control); transition: color var(--motion), border-color var(--motion);
}
.auth-logout-btn:hover { color: var(--danger); border-color: var(--danger); }

/* ─── ADMIN PANEL ─── */
.admin-users { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--card-border); background: var(--card-bg); border-radius: var(--radius-card); overflow: hidden; }
.admin-user-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--card-border); }
.admin-user-row:last-child { border-bottom: none; }
.admin-user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--pine-500); color: var(--cream); display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-weight: 700; font-size: 12px; flex-shrink: 0; }
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name { font-size: 14px; font-weight: 600; color: var(--body-color); }
.admin-user-email { font-size: 12px; color: var(--text-muted); }
.admin-badge-tag { font-family: var(--font-heading-extended); font-size: 8px; font-weight: 900; letter-spacing: 0.2em; text-transform: uppercase; padding: 3px 8px; border-radius: var(--radius-control); }
.admin-badge-tag.is-admin { background: var(--pine-700); color: var(--cream); }
.admin-badge-tag.is-user { background: var(--olive-50); color: var(--olive-600); }
.admin-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.admin-toolbar .btn { flex-shrink: 0; white-space: nowrap; }

/* ─── Edição de perfil (modal do usuário) ─── */
.user-profile-avatar { cursor: pointer; }
.profile-edit { margin: 18px 0 4px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.profile-edit-title { font-family: var(--font-heading-extended); font-size: 9px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }
.profile-edit input { border: var(--border-w-control) solid var(--card-border); background: var(--content-bg); color: var(--body-color); padding: 9px 12px; font-family: var(--font-body); font-size: 13px; border-radius: var(--radius-control); outline: none; }
.profile-edit input:focus { border-color: var(--olive-600); box-shadow: var(--focus-ring); }

/* ─── Admin: gerenciar usuário ─── */
.admin-manage-btn { font-family: var(--font-heading-extended); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; padding: 6px 12px; background: none; border: 1px solid var(--card-border); color: var(--text-secondary); cursor: pointer; border-radius: var(--radius-control); transition: border-color var(--motion), color var(--motion); }
.admin-manage-btn:hover { border-color: var(--pine-700); color: var(--body-color); }
.admin-user-inactive { opacity: 0.55; }
.ae-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--body-color); padding: 5px 0; cursor: pointer; }
.ae-agents { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; border: 1px solid var(--card-border); border-radius: var(--radius-card); padding: 10px 12px; }
.ae-agents .ae-check { font-size: 12px; }

/* ─── Model Hub (seletor de modelo) ─── */
.home-model-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--card-border); }
.home-model-label { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-heading-extended); font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }
.home-model-label svg { opacity: 0.7; }
.model-select {
  font-family: var(--font-body); font-size: 13px; color: var(--body-color);
  background: var(--content-bg); border: var(--border-w-control) solid var(--card-border);
  border-radius: var(--radius-control); padding: 6px 10px; cursor: pointer; outline: none;
}
.model-select:focus { border-color: var(--olive-600); box-shadow: var(--focus-ring); }

/* ─── Chat multimodal (anexo, áudio, artifacts) ─── */
.chat-io-btn {
  width: 38px; height: 38px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--card-border); color: var(--text-secondary);
  cursor: pointer; border-radius: var(--radius-control); transition: color var(--motion), border-color var(--motion), background var(--motion);
}
.chat-io-btn:hover { color: var(--body-color); border-color: var(--pine-400); }
.chat-io-btn.recording { color: var(--danger); border-color: var(--danger); animation: pulse-rec 1.1s infinite; }
@keyframes pulse-rec { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.chat-attachment {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; margin: 0 20px;
  background: var(--olive-50); border: 1px solid var(--card-border); border-radius: var(--radius-card);
  font-size: 12px; color: var(--olive-600);
}
[data-theme="dark"] .chat-attachment { background: var(--ink-wash); color: var(--gold); }
.chat-attachment span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-attach-remove { background: none; border: none; color: inherit; cursor: pointer; font-size: 12px; opacity: 0.7; }
.chat-attach-remove:hover { opacity: 1; }
.msg-artifacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.artifact-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  background: var(--pine-700); color: var(--cream); border: none; cursor: pointer;
  border-radius: var(--radius-control); font-family: var(--font-heading-extended);
  font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  transition: background var(--motion);
}
.artifact-btn:hover { background: var(--pine-800); }
[data-theme="dark"] .artifact-btn { background: var(--gold); color: var(--pine-ink); }

/* ─── Agent Studio ─── */
.agent-gear-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px;
  background: none; border: 1px solid var(--card-border); color: var(--text-secondary);
  cursor: pointer; border-radius: var(--radius-control);
  font-family: var(--font-heading-extended); font-size: 10px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  transition: border-color 140ms, color 140ms;
}
.agent-gear-btn:hover { border-color: var(--olive-600); color: var(--olive-600); }
.as-textarea {
  width: 100%; border: var(--border-w-control) solid var(--card-border); background: var(--content-bg);
  color: var(--body-color); padding: 10px 12px; font-family: var(--font-body); font-size: 13px;
  line-height: 1.5; border-radius: var(--radius-control); outline: none; resize: vertical;
}
.as-textarea:focus { border-color: var(--olive-600); box-shadow: var(--focus-ring); }

/* ─── Botão Sincronizar (2º Cérebro) ─── */
.cerebro-sync-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
  background: var(--pine-700); color: var(--cream); border: none; cursor: pointer;
  border-radius: var(--radius-control); font-family: var(--font-heading-extended);
  font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  transition: background var(--motion); white-space: nowrap;
}
.cerebro-sync-btn:hover { background: var(--pine-800); }
.cerebro-sync-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.cerebro-sync-btn.syncing svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
[data-theme="dark"] .cerebro-sync-btn { background: var(--gold); color: var(--pine-ink); }

/* ─── Knowledge Center: status, kebab, upload ─── */
.doc-status {
  font-family: var(--font-heading-extended); font-size: 8px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 7px;
  border-radius: var(--radius-pill); white-space: nowrap;
}
.doc-status.processing { background: rgba(212,160,23,0.14); color: var(--warning); animation: pulse-rec 1.4s ease-in-out infinite; }
.doc-status.ready { display: none; }
.doc-status.failed { background: rgba(200,60,60,0.14); color: var(--danger); cursor: help; }

.doc-card-highlight { box-shadow: 0 0 0 2px var(--warning); }

.doc-card-menu-wrap { position: relative; }
.doc-card-menu-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 0 4px; opacity: 0;
  transition: opacity var(--motion), color var(--motion);
}
.doc-card:hover .doc-card-menu-btn { opacity: 1; }
.doc-card-menu-btn:hover { color: var(--body-color); }
.doc-card-menu {
  position: absolute; right: 0; top: 22px; z-index: 20; min-width: 130px;
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-control); box-shadow: var(--shadow-stamp);
  padding: 4px; display: flex; flex-direction: column;
}
.doc-card-menu-item {
  font-size: 12px; color: var(--body-color); padding: 7px 10px; cursor: pointer;
  border-radius: var(--radius-control); transition: background var(--motion);
}
.doc-card-menu-item:hover { background: var(--cream-dark); }
[data-theme="dark"] .doc-card-menu-item:hover { background: rgba(255,255,255,0.05); }
.doc-card-menu-item.danger { color: var(--danger); }

.doc-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; margin-top: 12px; padding: 24px 16px;
  border: 2px dashed var(--card-border); border-radius: var(--radius-card);
  color: var(--text-muted); font-size: 12px; cursor: pointer;
  transition: border-color var(--motion), background var(--motion);
}
.doc-dropzone:hover { border-color: var(--pine-400); }
.doc-dropzone.drag-active { border-color: var(--pine-700); background: var(--cream-dark); color: var(--body-color); }
[data-theme="dark"] .doc-dropzone.drag-active { background: rgba(255,255,255,0.04); }

.upload-progress-bar {
  height: 6px; background: var(--card-border); border-radius: var(--radius-pill); overflow: hidden;
}
.upload-progress-fill {
  height: 100%; background: var(--pine-700); border-radius: var(--radius-pill);
  transition: width 0.2s ease;
}
[data-theme="dark"] .upload-progress-fill { background: var(--gold); }
.upload-progress-fill.error { background: var(--danger); }

/* Inputs de modais fora do form .profile-edit (upload/edição/times) */
.profile-edit-inline {
  width: 100%; border: var(--border-w-control) solid var(--card-border); background: var(--content-bg);
  color: var(--body-color); padding: 9px 12px; font-family: var(--font-body); font-size: 13px;
  border-radius: var(--radius-control); outline: none;
}
.profile-edit-inline:focus { border-color: var(--olive-600); box-shadow: var(--focus-ring); }

/* Título de seção do Admin (ex.: TIMES) */
.admin-section-title {
  font-family: var(--font-heading-extended); font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-secondary);
  margin: 32px 0 14px;
}

/* Citações clicáveis no Perguntar (variante <a> de .msg-src) */
a.msg-src { text-decoration: none; cursor: pointer; }
a.msg-src:hover { opacity: 0.8; }
