/* ═══════════════════════════════════════════════════════════
   EMMY v3 — Identidade visual TransAlfa (Claude-clean)
   Background branco · bolha user lilás + texto azul · Emmy sem bolha
   Design integrado 28/04/2026
   ═══════════════════════════════════════════════════════════ */

:root {
  /* CORES PRINCIPAIS — ainda mais claras (28/04 ajuste Luke) */
  --bg-app: #FFFEFB;          /* branco quase imperceptivelmente quente — mais leve que branco puro */
  --bg-sutil: #FCFAF6;
  --texto: #1A1A1A;
  --texto-suave: #6B6B6B;
  --texto-mais-suave: #9B9B9B;
  --borda-sutil: #F0EDE6;
  --borda: #E5E0D6;

  /* USER bubble — verde-oliva pastel CLAREADO + texto verde escuro (TransAlfa) */
  --user-bg: #F0F5EA;
  --user-bg-hover: #E5EDD8;
  --user-texto: #2F3E1F;
  --user-strong: #1F2C12;

  /* TransAlfa — accents discretos nas laterais/header (bege mais claro) */
  --cafe: #4A3728;
  --cafe-claro: #6B5440;
  --cafe-escuro: #2E2118;
  --creme: #FAF6EE;            /* + claro */
  --creme-quente: #F4EEE0;     /* + claro */
  --creme-fundo: #FDFBF6;
  --oliva: #5C6B45;

  /* Durazno (rosa-pêssego) — destaque widget Emmy fala (28/04) */
  --durazno: #F5E5DC;
  --durazno-borda: #E8D0C0;
  --durazno-texto: #5E3825;
  --durazno-faixa: #C9805C;

  /* Estados */
  --erro: #C73E1D;
  --erro-bg: #FDF0EE;
  --ok: #5C6B45;

  /* Tabela */
  --tabela-header-bg: #F5F5F7;
  --tabela-borda: #E5E5E8;

  /* Code */
  --code-bg: #F5F5F7;
  --code-texto: #2C3E50;

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --raio: 12px;
  --raio-bolha: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg-app);
  color: var(--texto);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

/* ═══════════ HEADER (3 colunas: brand-esq | center | status-dir) ═══════════ */
.topbar {
  background: rgba(255, 254, 251, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--creme-quente);
  padding: 14px 20px 14px 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 96px;        /* + alto pra acomodar avatar 112px que sobrepoe borda */
  overflow: visible;
}
.topbar-center {
  text-align: center;
  line-height: 1.15;
}
.topbar-center .empresa-nome {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--cafe-escuro);
  letter-spacing: 0.5px;
}
.topbar-center .empresa-sub {
  font-size: 11px;
  color: var(--texto-mais-suave);
  font-style: italic;
  margin-top: 2px;
  letter-spacing: 0.3px;
}
.status {
  justify-self: end;
}
.topbar::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--creme) 20%, var(--creme) 80%, transparent 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  transition: transform 0.15s;
  position: relative;
}
.brand:hover .logo-avatar,
.brand:hover .logo-fallback {
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(74, 55, 40, 0.28);
}
/* Avatar 2x maior (112px) — sobrepõe a borda inferior do topbar (28/04) */
.logo-avatar,
.logo-fallback {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 3px solid var(--bg-app);
  box-shadow: 0 4px 14px rgba(74, 55, 40, 0.20);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  position: relative;
  z-index: 11;          /* acima do ::after da topbar */
  margin-bottom: -32px; /* desce metade pra fora da barra */
}
.logo-avatar { object-fit: cover; }
.logo-fallback {
  background: var(--avatar-bg, var(--cafe));
  color: var(--creme);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 52px;
  letter-spacing: 0.5px;
}
.brand-text { line-height: 1.15; }
.brand-text h1 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--cafe-escuro);
  letter-spacing: -0.3px;
}
.subtitle {
  font-size: 12px;
  color: var(--texto-suave);
  font-weight: 400;
  letter-spacing: 0.4px;
  font-style: italic;
}

.status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--texto-suave);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--texto-mais-suave);
  transition: all 0.3s;
}
.dot.online {
  background: var(--ok);
  box-shadow: 0 0 0 2px rgba(92, 107, 69, 0.15);
}
.dot.offline { background: var(--erro); }
.status-meta { color: var(--cafe-claro); font-weight: 500; }

/* ═══════════ CHAT — formato Claude (espaçoso, respiro, tipografia confortável) ═══════════ */
.chat {
  flex: 1;
  overflow-y: auto;
  width: 100%;
  background: linear-gradient(180deg, var(--bg-app) 0%, #FCFAF6 100%);
}
.chat-inner {
  max-width: 760px;                /* largura Claude desktop */
  margin: 0 auto;                  /* CENTRALIZADO de novo (sem 8 ou 80) */
  padding: 38px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* === WELCOME === */
.welcome {
  text-align: center;
  padding: 30px 20px 10px;
  color: var(--texto-suave);
}
.welcome-icon {
  font-size: 36px;
  margin-bottom: 10px;
}
.welcome h2 {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--texto);
  margin-bottom: 8px;
  font-weight: 600;
}
.welcome p {
  font-size: 14.5px;
  margin-bottom: 6px;
  line-height: 1.6;
}
.welcome .hint {
  font-size: 13px;
  color: var(--texto-mais-suave);
  margin-top: 8px;
}
.welcome .hint strong {
  color: var(--texto-suave);
  font-weight: 600;
}

/* === USER (Sandra) — bolha verde-pastel recuada à direita (com indent) === */
.msg.user {
  align-self: flex-end;
  max-width: 75%;
  margin-left: 15%;
  background: var(--user-bg);
  color: var(--user-texto);
  padding: 14px 18px;
  border-radius: var(--raio-bolha);
  border-bottom-right-radius: 6px;
  font-size: 16px;
  line-height: 1.6;
  word-wrap: break-word;
  font-weight: 500;
}
.msg.user strong { color: var(--user-strong); font-weight: 700; }
.msg.user em { color: var(--user-strong); font-style: italic; }

/* === EMMY — texto puro com respiro Claude (Luke 28/04 v3) === */
.msg.emmy {
  align-self: stretch;
  color: var(--texto);
  font-size: 16px;                 /* + 0.5px pra respirar */
  line-height: 1.78;               /* respiro generoso entre linhas */
  letter-spacing: -0.005em;
  background: transparent;
  padding: 0;
  max-width: 100%;
}
.msg.emmy strong { color: var(--cafe-escuro); font-weight: 700; }
.msg.emmy em { font-style: italic; color: var(--cafe-claro); }
.msg.emmy p { margin: 0 0 16px 0; }     /* parágrafos com respiro real (era 10) */
.msg.emmy p:last-child { margin-bottom: 0; }
.msg.emmy > *:first-child { margin-top: 0; }
.msg.emmy h1, .msg.emmy h2, .msg.emmy h3 {
  font-family: var(--serif);
  color: var(--cafe-escuro);
  margin: 12px 0 6px;
}
.msg.emmy h1 { font-size: 19px; }
.msg.emmy h2 { font-size: 17px; }
.msg.emmy h3 { font-size: 15px; }
.msg.emmy hr {
  border: none;
  border-top: 1px solid var(--borda-sutil);
  margin: 12px 0;
}
.msg.emmy a {
  color: var(--cafe);
  text-decoration: underline;
  text-decoration-color: var(--cafe-claro);
}
.msg.emmy a:hover { color: var(--cafe-escuro); }
.msg.emmy blockquote {
  border-left: 3px solid var(--cafe-claro);
  padding: 4px 12px;
  margin: 10px 0;
  background: var(--creme);
  border-radius: 0 6px 6px 0;
  color: var(--texto-suave);
  font-style: italic;
}

/* Listas dentro de Emmy (se backend mandar markdown literal) */
.msg.emmy ol, .msg.emmy ul {
  margin: 10px 0 10px 22px;
  padding: 0;
}
.msg.emmy li {
  margin: 5px 0;
  line-height: 1.65;
}

/* Tabela */
.msg.emmy table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  background: var(--bg-sutil);
  border: 1px solid var(--tabela-borda);
  border-radius: 10px;
  overflow: hidden;
  font-size: 14px;
}
.msg.emmy th {
  background: var(--tabela-header-bg);
  color: var(--texto);
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--tabela-borda);
}
.msg.emmy td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--tabela-borda);
}
.msg.emmy tr:last-child td { border-bottom: none; }

/* Code */
.msg.emmy code {
  background: var(--code-bg);
  color: var(--code-texto);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 13.5px;
}
.msg.emmy pre {
  background: var(--code-bg);
  padding: 14px 18px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid var(--tabela-borda);
}
.msg.emmy pre code {
  background: transparent;
  padding: 0;
  font-size: 13.5px;
}

/* Imagem em mensagem */
.msg-image {
  display: block;
  max-width: 320px;
  border-radius: 8px;
  margin-top: 8px;
  border: 1px solid var(--borda);
}
.msg.user .msg-image { border-color: rgba(61, 79, 176, 0.2); }

.msg-attachment {
  font-size: 12px;
  font-style: italic;
  margin-top: 4px;
  opacity: 0.85;
}

/* === SYSTEM (erro inline) === */
.msg.system {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--erro);
  background: var(--erro-bg);
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 500;
  border-left: 2px solid var(--erro);
  font-style: normal;
  max-width: 90%;
}
.msg.system::before {
  content: "⚠";
  font-size: 13px;
}

/* === THINKING === */
.msg.thinking {
  font-size: 0;
}
.msg.emmy.thinking::after {
  content: "";
  display: inline-block;
  width: 36px;
  height: 12px;
  background-image:
    radial-gradient(circle, var(--cafe-claro) 2.5px, transparent 3px),
    radial-gradient(circle, var(--cafe-claro) 2.5px, transparent 3px),
    radial-gradient(circle, var(--cafe-claro) 2.5px, transparent 3px);
  background-size: 12px 12px;
  background-position: 0 50%, 12px 50%, 24px 50%;
  background-repeat: no-repeat;
  animation: thinking 1.2s infinite;
}
@keyframes thinking {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ═══════════ DROP OVERLAY ═══════════ */
.drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 55, 40, 0.85);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.drop-overlay.active { display: flex; }
.drop-overlay-inner {
  background: white;
  border: 3px dashed var(--cafe);
  border-radius: 24px;
  padding: 48px 64px;
  text-align: center;
  max-width: 90vw;
  animation: dropPulse 1s ease-in-out infinite;
}
@keyframes dropPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
.drop-icon { font-size: 56px; margin-bottom: 14px; }
.drop-text {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--cafe);
  font-weight: 600;
  margin-bottom: 6px;
}
.drop-sub {
  font-size: 13px;
  color: var(--texto-suave);
}

/* ═══════════ COMPOSER ═══════════ */
/* Rodapé global em GRID 3-col (alinhado com layout-grid acima) */
.composer-wrap {
  background: var(--bg-app);
  border-top: 1px solid var(--creme-quente);
  padding: 14px 0 18px;
  display: grid;
  grid-template-columns: 280px 1fr 240px;   /* mesma proporção das sidebars */
  align-items: start;
  gap: 0;
  transition: grid-template-columns 0.28s ease;
}
.layout-grid.sidebar-right-collapsed ~ .composer-wrap,
.composer-wrap.sidebar-right-collapsed {
  grid-template-columns: 280px 1fr 0;
}
.composer-wrap.sidebar-right-collapsed .footer-right {
  opacity: 0;
  pointer-events: none;
}

.footer-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px 4px;
  background: transparent;
  align-items: stretch;
  transition: opacity 0.2s ease;
}

.composer {
  max-width: 740px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}
.composer-wrap::before {
  display: none;        /* removida — borda superior do composer-wrap já separa */
}

.status-pill,
.dica-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-app);
  border: 1px solid var(--borda-sutil);
  border-radius: 14px;
  font-size: 11.5px;
  color: var(--cafe);
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
  transition: all 0.18s;
  width: 100%;
  box-shadow: 0 1px 3px rgba(74, 55, 40, 0.04);
}
.status-pill .status-icon,
.dica-pill .dica-icon { font-size: 13px; line-height: 1; flex-shrink: 0; }
.status-pill .status-texto {
  display: flex;
  align-items: center;
  gap: 5px;
}
.status-pill .status-sep { color: var(--texto-mais-suave); }

.status-pill.status-rdc {
  background: var(--durazno);
  border-color: var(--durazno-borda);
  color: var(--durazno-texto);
}
.status-pill.status-rdc.feito {
  background: #E8F0E0;
  border-color: #C8D8B5;
  color: #2F4A1F;
}

.dica-pill {
  background: linear-gradient(135deg, #FCFAF6 0%, var(--creme) 100%);
  font-style: italic;
  cursor: default;
  white-space: normal;
  line-height: 1.4;
  text-align: left;
  align-items: flex-start;
}
.dica-pill .dica-texto {
  font-size: 11.5px;
  color: var(--cafe);
}
.dica-pill:hover {
  border-color: var(--cafe-claro);
  box-shadow: 0 2px 6px rgba(74, 55, 40, 0.08);
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--user-bg);
  border: 1px solid #DCD3F0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--user-texto);
}
.file-preview.hidden { display: none; }
.file-preview-icon { font-size: 16px; }
.file-preview-name { flex: 1; font-weight: 500; }
.file-preview-remove {
  background: none;
  border: none;
  color: var(--erro);
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.file-preview-remove:hover { background: rgba(199, 62, 29, 0.12); }

.composer-box {
  background: white;
  border: 1px solid var(--borda);
  border-radius: 16px;
  padding: 12px 14px 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.composer-box:focus-within {
  border-color: var(--cafe-claro);
  box-shadow: 0 1px 6px rgba(74, 55, 40, 0.06);
}

textarea#input {
  width: 100%;
  font-family: inherit;
  font-size: 15.5px;
  border: none;
  background: transparent;
  color: var(--texto);
  resize: none;
  outline: none;
  min-height: 24px;
  max-height: 140px;
  line-height: 1.5;
  padding: 0;
}
textarea#input::placeholder { color: var(--texto-mais-suave); }

.composer-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: space-between;
}
.tools-left { display: flex; gap: 2px; }

.btn-tool {
  background: transparent;
  border: none;
  color: var(--texto-suave);
  cursor: pointer;
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  transition: all 0.15s;
}
.btn-tool:hover {
  background: var(--creme);
  color: var(--cafe);
}
.btn-tool .icon { font-size: 14px; }
.btn-tool .tool-label { display: inline; }

.btn-send {
  background: var(--accent, var(--cafe));
  color: white;
  border: none;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-send:hover:not(:disabled) {
  background: var(--accent-escuro, var(--cafe-escuro));
}
.btn-send:disabled {
  background: var(--borda);
  cursor: not-allowed;
  color: var(--texto-mais-suave);
}

/* ═══════════ SANDWICH: sidebar esq (histórico) + chat + sidebar dir (widgets) ═══════════ */
.layout-grid {
  display: grid;
  grid-template-columns: 280px 1fr 240px;  /* esq histórico (larga), centro chat, dir widgets (estreita) */
  flex: 1;
  min-height: 0;
  position: relative;
  transition: grid-template-columns 0.28s ease;
}
.layout-grid.sidebar-right-collapsed {
  grid-template-columns: 280px 1fr 0;
}
.layout-grid.sidebar-right-collapsed .sidebar-right {
  width: 0;
  padding: 0;
  border-left: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
.sidebar-left {
  background: linear-gradient(180deg, var(--creme-quente) 0%, var(--creme) 100%);
  border-right: 1px solid var(--borda-sutil);
  padding: 16px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-right {
  background: linear-gradient(180deg, var(--creme) 0%, var(--creme-quente) 100%);
  border-left: 1px solid var(--borda-sutil);
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: width 0.28s ease, padding 0.28s ease, opacity 0.2s ease;
}

/* Botão toggle sidebar direita — SEMPRE visível (recolher e expandir) */
.btn-toggle-sidebar {
  position: absolute;
  top: 50%;
  right: 240px;             /* exatamente na borda esq da sidebar dir (expandida) */
  transform: translateY(-50%);
  z-index: 5;
  width: 28px;
  height: 56px;
  border: 1px solid var(--borda);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: var(--bg-app);
  color: var(--cafe);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -2px 2px 8px rgba(74, 55, 40, 0.10);
  transition: right 0.28s ease, background 0.15s, color 0.15s, box-shadow 0.18s;
}
.btn-toggle-sidebar:hover {
  background: var(--creme);
  color: var(--cafe-escuro);
  box-shadow: -3px 3px 10px rgba(74, 55, 40, 0.16);
}
.btn-toggle-sidebar svg {
  transition: transform 0.28s ease;
}
.layout-grid.sidebar-right-collapsed .btn-toggle-sidebar {
  right: 0;                /* cola na borda direita da janela mas continua VISIVEL */
}
.layout-grid.sidebar-right-collapsed .btn-toggle-sidebar svg {
  transform: rotate(180deg);
}

/* Widget proativa quando está na sidebar esquerda (topo, próximo ao avatar) */
.widget.proativa-esq {
  margin-bottom: 4px;
}

/* ===== Sidebar esq HISTÓRICO ===== */
.sidebar-titulo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 10px;
  border-bottom: 1px solid var(--borda-sutil);
  margin-bottom: 6px;
}
.sidebar-titulo .serif {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--cafe-escuro);
  font-weight: 600;
  letter-spacing: 0.3px;
}
.btn-search {
  background: transparent;
  border: 1px solid var(--borda);
  border-radius: 8px;
  padding: 5px 7px;
  cursor: pointer;
  color: var(--cafe);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-search:hover { background: white; border-color: var(--cafe); }

.historico-busca {
  padding: 6px 0;
}
.historico-busca.hidden { display: none; }
.historico-busca input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--borda);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: white;
  outline: none;
}
.historico-busca input:focus { border-color: var(--cafe); }

.historico-lista {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.historico-loading {
  padding: 20px 10px;
  text-align: center;
  color: var(--texto-mais-suave);
  font-size: 12px;
  font-style: italic;
}
.historico-grupo-titulo {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--texto-mais-suave);
  font-weight: 600;
  padding: 8px 6px 4px;
}
.historico-item {
  background: white;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  font-size: 12px;
}
.historico-item:hover {
  border-color: var(--cafe-claro);
  box-shadow: 0 1px 4px rgba(74, 55, 40, 0.08);
}
.historico-item.ativo {
  background: var(--cafe);
  color: var(--creme);
  border-color: var(--cafe);
}
.historico-item.ativo .historico-titulo,
.historico-item.ativo .historico-snippet { color: var(--creme); }
.historico-item.ativo .historico-data { color: var(--creme-quente); }
.historico-titulo {
  font-weight: 600;
  color: var(--texto);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.historico-snippet {
  color: var(--texto-suave);
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.historico-data {
  color: var(--texto-mais-suave);
  font-size: 10px;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.sidebar-footer {
  padding: 10px 4px 4px;
  border-top: 1px solid var(--borda-sutil);
  margin-top: auto;
}

/* Botão "Conheça a Emmy" — pílula elegante creme com ícone (28/04 v3) */
.btn-onboard {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-app);
  border: 1px solid var(--borda-sutil);
  border-radius: 14px;
  cursor: pointer;
  color: var(--cafe);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: all 0.18s;
  box-shadow: 0 1px 3px rgba(74, 55, 40, 0.04);
  white-space: nowrap;
}
.btn-onboard:hover {
  background: white;
  border-color: var(--cafe-claro);
  color: var(--cafe-escuro);
  box-shadow: 0 2px 6px rgba(74, 55, 40, 0.10);
  transform: translateY(-1px);
}
.btn-onboard svg {
  flex-shrink: 0;
  opacity: 0.7;
}
.btn-onboard:hover svg {
  opacity: 1;
}

.historico-banner {
  background: linear-gradient(135deg, var(--creme-quente) 0%, var(--creme) 100%);
  border-left: 3px solid var(--cafe);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: var(--cafe-escuro);
  margin-bottom: 12px;
}
.historico-banner strong { color: var(--cafe); }
.widget {
  background: white;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(74, 55, 40, 0.05);
  border: 1px solid var(--borda-sutil);
}
.widget h4 {
  font-family: var(--serif);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--cafe);
  font-weight: 600;
  margin-bottom: 8px;
}
.widget .big {
  font-size: 24px;
  font-weight: 600;
  color: var(--texto);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.widget .label {
  font-size: 11px;
  color: var(--texto-suave);
  margin-top: 4px;
  letter-spacing: 0.3px;
}
.widget-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  font-size: 13px;
}
.widget-row .nome { color: var(--texto-suave); }
.widget-row .valor {
  color: var(--texto);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.widget.tempo { background: linear-gradient(135deg, #f0f4ed 0%, #fff 100%); }

/* Widget diesel — destaque sutil pro setor de frete TransAlfa */
.widget.widget-diesel {
  background: linear-gradient(135deg, #FAF6EE 0%, #FFFFFF 100%);
  border-color: var(--creme-quente);
}
.widget.widget-diesel .diesel-meta {
  font-size: 9.5px;
  color: var(--texto-mais-suave);
  margin-top: 6px;
  letter-spacing: 0.3px;
  font-style: italic;
}

/* Botao acao no header (jornal etc) */
.btn-header-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  background: var(--bg-app);
  border: 1px solid var(--borda-sutil);
  border-radius: 14px;
  cursor: pointer;
  color: var(--cafe);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: all 0.18s;
  margin-right: 10px;
  box-shadow: 0 1px 2px rgba(74, 55, 40, 0.04);
}
.btn-header-action:hover {
  background: var(--creme);
  border-color: var(--cafe-claro);
  color: var(--cafe-escuro);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(74, 55, 40, 0.10);
}
.btn-header-action svg { flex-shrink: 0; opacity: 0.75; }
.btn-header-action:hover svg { opacity: 1; }
@media (max-width: 900px) {
  .btn-header-action .btn-header-label { display: none; }
  .btn-header-action { padding: 6px 8px; }
}
.widget.tempo.clickable {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.widget.tempo.clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(92, 107, 69, 0.12);
}
.widget .clima-icon { font-size: 28px; line-height: 1; }
.widget .clima-temp { font-size: 22px; font-weight: 600; color: var(--cafe-escuro); }
.widget .clima-desc { font-size: 12px; color: var(--texto-suave); margin-top: 2px; }
.widget .clima-flex { display: flex; align-items: center; gap: 12px; }
.widget .clima-hint {
  font-size: 10px;
  color: var(--texto-mais-suave);
  margin-top: 6px;
  letter-spacing: 0.3px;
}

/* === Widget Emmy proativa — ROSA-DURAZNO acolhedor (28/04 ajuste Luke) === */
.widget.proativa {
  background: linear-gradient(135deg, var(--durazno) 0%, #FAEEE5 100%);
  border: 1px solid var(--durazno-borda);
  color: var(--durazno-texto);
  position: relative;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(184, 112, 79, 0.14);
  padding: 14px 16px;
}
.widget.proativa::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--durazno-faixa);
}
.widget.proativa h4 {
  color: var(--durazno-texto);
  font-family: var(--serif);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  opacity: 0.95;
}
.widget.proativa .pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--durazno-faixa);
  margin-right: 8px;
  box-shadow: 0 0 0 0 rgba(201, 128, 92, 0.55);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(201, 128, 92, 0.55); transform: scale(1); }
  70% { box-shadow: 0 0 0 7px rgba(201, 128, 92, 0); transform: scale(1.1); }
  100% { box-shadow: 0 0 0 0 rgba(201, 128, 92, 0); transform: scale(1); }
}
.widget.proativa .mensagem {
  font-size: 13.5px;
  color: var(--durazno-texto);
  line-height: 1.6;
  margin-top: 4px;
  font-style: italic;
  font-weight: 500;
  opacity: 0.95;
}
.widget.proativa .acao {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  color: #FFFFFF;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  background: var(--durazno-faixa);
  padding: 7px 14px;
  border-radius: 16px;
  transition: all 0.2s;
}
.widget.proativa .acao:hover {
  background: #B8704F;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(184, 112, 79, 0.4);
}

/* === Modal previsão clima === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(46, 33, 24, 0.55);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: white;
  border-radius: 16px;
  max-width: 540px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(46, 33, 24, 0.3);
  padding: 24px 26px 22px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-header h2 {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--cafe);
  font-weight: 600;
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--texto-suave);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover {
  background: var(--creme);
  color: var(--texto);
}
.previsao-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.previsao-dia {
  background: linear-gradient(180deg, #f0f4ed 0%, white 100%);
  border: 1px solid var(--borda-sutil);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
}
.previsao-dia .nome {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--cafe);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.previsao-dia .icon { font-size: 28px; line-height: 1; margin: 6px 0; }
.previsao-dia .max {
  font-size: 18px;
  font-weight: 600;
  color: var(--cafe-escuro);
}
.previsao-dia .min {
  font-size: 12px;
  color: var(--texto-suave);
}
.previsao-dia .desc {
  font-size: 10px;
  color: var(--texto-mais-suave);
  margin-top: 4px;
}
.modal-loading {
  text-align: center;
  padding: 40px;
  color: var(--texto-suave);
  font-style: italic;
}

.sidebar-divider {
  height: 1px;
  background: var(--borda-sutil);
  margin: 4px 0;
}

/* ═══════════ RESPONSIVO ═══════════ */
@media (max-width: 1200px) {
  .layout-grid { grid-template-columns: 240px 1fr 220px; }
}
@media (max-width: 1024px) {
  .layout-grid { grid-template-columns: 220px 1fr 200px; }
  .sidebar-left { padding: 14px 10px; }
  .sidebar-right { padding: 14px 10px; }
  .topbar-center .empresa-nome { font-size: 20px; }
}
@media (max-width: 900px) {
  .layout-grid { grid-template-columns: 1fr; }
  .sidebar-left, .sidebar-right { display: none; }
  .topbar { grid-template-columns: auto 1fr auto; }
}
@media (max-width: 600px) {
  .topbar { padding: 10px 14px 10px 90px; min-height: 60px; }
  .logo-avatar, .logo-fallback {
    width: 64px;
    height: 64px;
    left: -76px;
    transform: translateY(-25%);
  }
  .logo-fallback { font-size: 28px; }
  .brand-text h1 { font-size: 19px; }
  .subtitle { font-size: 10px; }
  .chat-inner { padding: 26px 14px 22px; gap: 18px; }
  .composer-wrap { padding: 12px 14px 16px; }
  .msg.user { max-width: 80%; margin-left: 0; font-size: 15px; }
  .msg.emmy { font-size: 15px; }
  .msg-image { max-width: 240px; }
  .btn-tool .tool-label { display: none; }
  .btn-tool { padding: 6px 8px; }
  .btn-tool .icon { font-size: 16px; }
  .drop-overlay-inner { padding: 36px 28px; }
  .drop-text { font-size: 20px; }
}

/* Scrollbar discreta */
.chat::-webkit-scrollbar { width: 6px; }
.chat::-webkit-scrollbar-track { background: transparent; }
.chat::-webkit-scrollbar-thumb { background: var(--borda); border-radius: 3px; }
.chat::-webkit-scrollbar-thumb:hover { background: var(--texto-mais-suave); }

.btn-tool.active {
  background: var(--cafe);
  color: var(--creme);
}
.btn-tool.active:hover {
  background: var(--cafe-escuro);
}

/* ONBOARDING RITO (primeira vez Sandra usa) */
.onboarding-overlay {
  position: fixed; inset: 0;
  background: rgba(46, 33, 24, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(6px);
}
.onboarding-overlay.ativa { opacity: 1; }
.onboarding-card {
  background: var(--bg-app);
  border-radius: 18px;
  padding: 36px 40px 32px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 12px 40px rgba(46, 33, 24, 0.30);
  text-align: center;
  transition: opacity 0.25s ease;
}
.onboarding-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.onboarding-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 3px solid var(--user-bg);
  box-shadow: 0 4px 14px rgba(74, 55, 40, 0.18);
}
.onboarding-card h2 {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--cafe-escuro);
  font-weight: 600;
}
.onboarding-card h3 {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--cafe-escuro);
  font-weight: 600;
  margin: 18px 0 22px;
  line-height: 1.4;
}
.onboarding-intro {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--texto);
  margin-bottom: 12px;
}
.onboarding-acoes {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}
.btn-onboarding-comecar,
.btn-onboarding-pular {
  border: none;
  border-radius: 14px;
  padding: 11px 22px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.3px;
}
.btn-onboarding-comecar {
  background: var(--cafe);
  color: var(--creme);
  box-shadow: 0 2px 8px rgba(74, 55, 40, 0.22);
}
.btn-onboarding-comecar:hover {
  background: var(--cafe-escuro);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46, 33, 24, 0.35);
}
.btn-onboarding-pular {
  background: transparent;
  color: var(--texto-suave);
  border: 1px solid var(--borda);
}
.btn-onboarding-pular:hover {
  background: var(--creme);
  color: var(--cafe-escuro);
}
.onboarding-progresso {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 6px;
}
.onboarding-progresso .ponto {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--borda);
  transition: background 0.2s;
}
.onboarding-progresso .ponto.ativo { background: var(--cafe); }
.onboarding-opcoes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}
.opcao-onboard {
  background: var(--user-bg);
  color: var(--user-texto);
  border: 1px solid var(--borda-sutil);
  border-radius: 12px;
  padding: 13px 18px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
}
.opcao-onboard:hover {
  background: var(--user-bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(92, 107, 69, 0.18);
}
.input-onboard {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--borda);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.18s;
}
.input-onboard:focus { border-color: var(--cafe-claro); }
.btn-proxima { display: block; margin: 0 auto; }
.btn-pular-pergunta {
  margin-top: 14px;
  background: transparent;
  border: none;
  color: var(--texto-mais-suave);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}
.onboarding-final h2 {
  margin-top: 6px;
}

/* MODO CONCENTRACAO (F11) — sidebars somem, fonte cresce, chat full */
body.modo-concentracao .sidebar-left,
body.modo-concentracao .sidebar-right,
body.modo-concentracao .footer-side,
body.modo-concentracao .btn-toggle-sidebar {
  display: none !important;
}
body.modo-concentracao .layout-grid {
  grid-template-columns: 1fr;
}
body.modo-concentracao .composer-wrap {
  grid-template-columns: 1fr;
}
body.modo-concentracao .chat-inner {
  max-width: 820px;
  font-size: 17px;
}
body.modo-concentracao .msg.emmy {
  font-size: 17px;
  line-height: 1.85;
}
body.modo-concentracao .msg.user {
  font-size: 17px;
}
