/* =============================
   Plataforma Land — UI Revamp
   (Layout novo, funções intactas)
   ============================= */

:root{
  --bg: #0b1220;           /* fundo geral */
  --panel: #0f1a2e;        /* cards/painéis */
  --panel-2: #101f38;      /* variação */
  --stroke: rgba(255,255,255,.08);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.68);
  --muted2: rgba(255,255,255,.52);
  --accent: #4da3ff;       /* azul claro p/ destaque */
  --good: #40d27f;
}

*{ box-sizing:border-box; }

.dashboard-layout{
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  display:flex;
  height: var(--vh, 100vh);
  background: radial-gradient(1200px 700px at 20% 10%, rgba(77,163,255,.12), transparent 60%),
              radial-gradient(900px 600px at 80% 20%, rgba(64,210,127,.08), transparent 55%),
              var(--bg);
  color: var(--text);
}

/* ===== Sidebar (retrátil) ===== */
.sidebar{
  width: 280px;
  height: var(--vh, 100vh);
  position: fixed;
  left: 0;
  top: 0;
  /* mais respiro no topo */
  padding: 40px 16px;
  background: linear-gradient(180deg, rgba(16,31,56,.98), rgba(15,26,46,.92));
  border-right: 1px solid var(--stroke);
  box-shadow: 10px 0 40px rgba(0,0,0,.35);
  display:flex;
  flex-direction:column;
  gap: 14px;
  z-index: 10;
  transition: width .22s ease;
  /* A sidebar em si não rola; quem rola é a área abaixo do topo (.sidebar-scroll). */
  overflow: hidden;
}
/* Topo (logo + usuário + botão de recolher/expandir) fica FIXO. */
.sidebar-top{ flex-shrink: 0; }
/* Ferramentas + setores rolam JUNTOS, numa área única que começa DEPOIS do topo. */
.sidebar-scroll{
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  /* A barra vai para a BORDA DIREITA da sidebar (margem negativa cobre o padding
     lateral) e o conteúdo continua recuado (padding), garantindo folga entre os
     botões e a barra — sem sobreposição. */
  margin-right: -16px;
  padding-right: 16px;
  /* NÃO usar scrollbar-width/scrollbar-color aqui: no Chrome elas ativam a barra
     "padrão", que reintroduz as setas e ignora o ::-webkit-scrollbar-button.
     Ficamos só no webkit — sem setas e com a barra controlável. */
}
/* Espaço reservado (não desloca o conteúdo); trilha invisível; SEM setas. */
.sidebar-scroll::-webkit-scrollbar{ width: 6px; }
.sidebar-scroll::-webkit-scrollbar-button,
.sidebar-scroll::-webkit-scrollbar-button:single-button,
.sidebar-scroll::-webkit-scrollbar-button:vertical:decrement,
.sidebar-scroll::-webkit-scrollbar-button:vertical:increment{ display: none; height: 0; width: 0; }
.sidebar-scroll::-webkit-scrollbar-track{ background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb{ background: transparent; border-radius: 6px; }
/* A barra (só o thumb) aparece apenas com o mouse sobre a sidebar. */
.sidebar:hover .sidebar-scroll::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.22); }

.sidebar-top{
  display:flex;
  flex-direction:column;
  gap: 14px;
}

/* user + toggle (botão ao lado direito do usuário) */
.user-row{
  display:flex;
  /* deixa o botão com a mesma altura do card do usuário */
  align-items:stretch;
  gap: 10px;
}
.user-row .user-card{ flex: 1; }
.user-row  .sidebar-toggle{
  width:56px;
  height:68px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-right:6px;
}

 .sidebar-toggle{
  width:56px;
  height:68px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-right:6px;
}
.sidebar-toggle:hover{ background: rgba(255,255,255,.06); transform: translateY(-1px); }

.sidebar .a-logo{
  display:flex;
  justify-content:center;
  align-items:center;
  width:100%;
  padding: 6px 8px;
}

.sidebar .logo{
  width: 170px;
  max-width: 100%;
  display:block;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.35));
}

.user-card{
  display:flex;
  gap: 10px;
  align-items:center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--stroke);
}

.user-avatar{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--stroke);
}
.user-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}

.user-meta{ min-width: 0; flex: 1; }
.user-name{
  font-size: 13px;
  font-weight: 800;
  color: rgba(255,255,255,.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.user-role{
  font-size: 11px;
  color: rgba(255,255,255,.70);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-section{ display:flex; flex-direction:column; gap: 10px; min-height: 0; }
.sidebar-label{ font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted2); padding: 0 10px; }

#departamentos{
  /* Sem rolagem própria — quem rola é a sidebar inteira. */
  overflow: visible;
}

/* Itens do menu */
.nav-item{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  margin: 8px 0;
  border-radius: 14px;
  color: var(--text);
  background: transparent;
  cursor:pointer;
  text-decoration:none;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background .18s ease, border .18s ease, transform .15s ease;
}
.nav-item:hover{
  background: rgba(255,255,255,.05);
  border: 1px solid var(--stroke);
  transform: translateY(-1px);
}

.nav-item .material-symbols-outlined{ opacity: .92; }

/* Estado recolhido */
.sidebar.is-collapsed{ width: 84px; }
.sidebar.is-collapsed .user-card,
.sidebar.is-collapsed .sidebar-label{ display:none; }
.sidebar.is-collapsed .user-row{ justify-content:center; }
.sidebar.is-collapsed  .sidebar-toggle{
  width:56px;
  height:68px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-right:6px;
}
.sidebar.is-collapsed .a-logo{ padding: 6px 0; }
.sidebar.is-collapsed .logo{ width: 56px; transform: none !important; }
.sidebar.is-collapsed #departamentos .nav-item{ justify-content:center; }
.sidebar.is-collapsed #departamentos .nav-item{ gap: 0; }
.sidebar.is-collapsed #departamentos .nav-item{ padding: 12px 10px; }
.sidebar.is-collapsed #departamentos .nav-item{ font-size: 0; }
.sidebar.is-collapsed #departamentos .nav-item span,
.sidebar.is-collapsed #departamentos .nav-item i{ font-size: 22px; }

/* ===== Main ===== */
.main-content{
  flex: 1;
  margin-left: 280px;
  width: calc(100% - 280px);
  /* mais respiro no topo do "menu da direita" */
  padding: 42px 28px 26px;
  overflow: auto;
  transition: margin-left .22s ease, width .22s ease;
  background: #ffffff;
  color: #4b5563;
}
.main-content.is-expanded{
  margin-left: 84px;
  width: calc(100% - 84px);
}

/* Título do setor */
#dashboards h3{
  width: 100%;
  margin: 8px 0 16px;
  font-size: 22px;
  letter-spacing: .2px;
  color: #374151;
}

/* ===== Cards dos dashboards ===== */
.dash-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.dashboard-card{
  display:flex;
  flex-direction:column;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(2,6,23,.02), rgba(2,6,23,.00));
  border: 1px solid rgba(17,24,39,.10);
  box-shadow: 0 10px 24px rgba(0,0,0,.05);
  text-decoration:none;
  color: #111827;
  min-height: 130px;
  position: relative;
  overflow:hidden;
  transition: transform .16s ease, border .16s ease, box-shadow .16s ease;
}

.dashboard-card::before{
  content:"";
  position:absolute;
  inset: -60px -60px auto auto;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle at 30% 30%, rgba(77,163,255,.22), transparent 60%);
  transform: rotate(12deg);
  pointer-events:none;
}

.dashboard-card:hover{
  transform: translateY(-2px);
  border: 1px solid rgba(15,23,42,.18);
  box-shadow: 0 14px 34px rgba(0,0,0,.07);
}

.dash-head{
  display:flex;
  align-items:center;
  gap: 10px;
}

.dash-icon{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(15,23,42,.06);
  border: 1px solid rgba(15,23,42,.10);
  flex: 0 0 auto;
}

.dash-icon .material-symbols-outlined{ color: #0f1a2e; }

.dash-title{
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
  margin: 0;
  color: #374151;
}

.dash-desc{
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.dash-cta{
  margin-top: auto;
  display:flex;
  align-items:center;
  justify-content: space-between;
  font-size: 12px;
  color: #9ca3af;
}

.dash-cta .pill{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(17,24,39,.10);
  background: rgba(15,23,42,.06);
  color: #374151;
}

/* Iframe */
iframe{
  width:100%;
  min-height: 80vh;
  border: 1px solid rgba(17,24,39,.10);
  border-radius: 18px;
  overflow:hidden;
  margin-top: 16px;
  background: #ffffff;
}

/* Scrollbar suave */
*::-webkit-scrollbar{ width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.14); border-radius: 999px; }
*::-webkit-scrollbar-track{ background: rgba(255,255,255,.04); }

/* Responsivo */
@media (max-width: 860px){
  .sidebar{ width: 84px; }
  .sidebar .user-card, .sidebar .sidebar-label{ display:none; }
  .sidebar .user-row{ justify-content:center; }
  .main-content{ margin-left: 84px; width: calc(100% - 84px); }
}


/* ===== Welcome (tela inicial do conteúdo) ===== */
.welcome{
  height: calc(var(--vh, 100vh) - 60px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 10px;
  text-align:center;
}
.welcome-logo{
  /* +30% quando não tem setor selecionado */
  width: 430px;
  max-width: 70%;
  opacity: .92;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,.10));
}
.welcome-title{
  font-size: 30px;
  font-weight: 800;
  color: #111827;
}
.welcome-sub{
  font-size: 20px;
  color: #6b7280;
}

/* =============================
   Alfred 🕵🏼 — UI (sidebar + abaixo do dashboard)
   ============================= */

.alfred-sidebar{ flex: 0 0 auto; }

.alfred-card{
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  overflow: hidden;
}

.alfred-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.alfred-title{
  font-weight: 800;
  font-size: 13px;
  color: rgba(255,255,255,.92);
}

.alfred-toggle{
  width: 34px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.92);
  cursor:pointer;
}

.alfred-body{ padding: 10px 12px 12px; }

.alfred-answer{
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255,255,255,.90);
  background: rgba(0,0,0,.14);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 10px;
  min-height: 66px;
  max-height: 190px;
  overflow: auto;
}

.alfred-row{
  display:flex;
  gap: 8px;
  margin-top: 10px;
}

.alfred-input{
  flex: 1;
  min-width: 0;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  outline: none;
  font-size: 12px;
}

.alfred-input::placeholder{ color: rgba(255,255,255,.60); }

.alfred-btn{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(77,163,255,.20);
  color: rgba(255,255,255,.94);
  cursor:pointer;
  font-weight: 800;
}

.alfred-btn:disabled{ opacity: .6; cursor:not-allowed; }

.alfred-hint{
  margin-top: 8px;
  font-size: 11px;
  color: rgba(255,255,255,.62);
}

.alfred-muted{ color: rgba(255,255,255,.70); }
.alfred-err{ color: #ff9b9b; font-weight: 700; }

.alfred-card.collapsed .alfred-body{ display:none; }

/* Links dentro das respostas */
.alfred-answer a{ color: rgba(77,163,255,.95); text-decoration: none; }
.alfred-answer a:hover{ text-decoration: underline; }

/* Wrapper abaixo do dashboard (tema claro) */
.alfred-below-wrap{ margin-top: 18px; }

.main-content .alfred-card{
  border: 1px solid rgba(17,24,39,.10);
  background: #ffffff;
}

.main-content .alfred-head{
  border-bottom: 1px solid rgba(17,24,39,.10);
}

.main-content .alfred-title{ color: #111827; }

.main-content .alfred-toggle{
  border: 1px solid rgba(17,24,39,.12);
  background: rgba(15,23,42,.04);
  color: #111827;
}

.main-content .alfred-body{ padding: 12px; }

.main-content .alfred-answer{
  color: #111827;
  background: rgba(2,6,23,.02);
  border: 1px solid rgba(17,24,39,.10);
}

.main-content .alfred-input{
  border: 1px solid rgba(17,24,39,.12);
  background: rgba(2,6,23,.02);
  color: #111827;
}

.main-content .alfred-input::placeholder{ color: rgba(17,24,39,.55); }

.main-content .alfred-btn{
  border: 1px solid rgba(17,24,39,.12);
  background: rgba(15,23,42,.06);
  color: #111827;
}

.main-content .alfred-hint{ color: rgba(17,24,39,.55); }

.main-content .alfred-muted{ color: rgba(17,24,39,.55); }

.main-content .alfred-err{ color: #b91c1c; }

.main-content .alfred-answer a{ color: #2563eb; }

/* Quando a sidebar recolhe, esconde o Alfred pra não esmagar tudo */
.sidebar.is-collapsed .alfred-sidebar{ display:none; }

/* =====================================================
   Alfred Chat — Botão na Sidebar
   ===================================================== */

.alfred-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(77,163,255,.30);
  background: linear-gradient(135deg, rgba(77,163,255,.12), rgba(77,163,255,.06));
  color: rgba(255,255,255,.92);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  letter-spacing: .2px;
  transition: background .18s ease, border .18s ease, transform .15s ease, box-shadow .15s ease;
  position: relative;
  overflow: hidden;
}
.alfred-nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(77,163,255,.10), transparent);
  opacity: 0;
  transition: opacity .18s ease;
}
.alfred-nav-btn:hover {
  background: linear-gradient(135deg, rgba(77,163,255,.22), rgba(77,163,255,.10));
  border-color: rgba(77,163,255,.55);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(77,163,255,.20);
}
.alfred-nav-btn:hover::before { opacity: 1; }
.alfred-nav-btn:active { transform: translateY(0); }

.alfred-nav-icon { font-size: 18px; line-height: 1; flex: 0 0 auto; }
.alfred-nav-text { flex: 1; text-align: left; }
.alfred-nav-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  background: rgba(77,163,255,.25);
  color: #4da3ff;
  border: 1px solid rgba(77,163,255,.30);
  border-radius: 999px;
  padding: 2px 7px;
  flex: 0 0 auto;
}

/* Esconder texto quando sidebar recolhida */
.sidebar.is-collapsed .alfred-nav-btn { justify-content: center; padding: 12px 10px; gap: 0; }
.sidebar.is-collapsed .alfred-nav-text,
.sidebar.is-collapsed .alfred-nav-badge { display: none; }
.sidebar.is-collapsed .alfred-nav-icon { font-size: 22px; }

/* =====================================================
   Alfred Chat — Painel (estilo ChatGPT / LandApp)
   ===================================================== */

.alfred-chat-panel {
  position: fixed;
  top: 0;
  left: 280px;   /* ajustado via JS quando sidebar recolhe */
  right: 0;
  bottom: 0;
  background: #0b1220;
  display: flex;
  flex-direction: column;
  z-index: 100;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .28s ease, transform .28s ease;
  overflow: hidden;
}
.alfred-chat-panel.acp-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Header ── */
.acp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(15,26,46,.95);
  backdrop-filter: blur(10px);
  flex: 0 0 auto;
}
.acp-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.acp-logo {
  height: 32px;
  width: auto;
  opacity: .92;
}
.acp-header-info { display: flex; flex-direction: column; gap: 2px; }
.acp-name {
  font-size: 15px;
  font-weight: 800;
  color: rgba(255,255,255,.95);
  letter-spacing: .2px;
}
.acp-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(255,255,255,.55);
}
.acp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #40d27f;
  box-shadow: 0 0 6px #40d27f;
  animation: acp-pulse 2s infinite;
}
@keyframes acp-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}
.acp-header-right { display: flex; align-items: center; gap: 8px; }
.acp-btn-clear,
.acp-btn-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.70);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .16s ease, color .16s ease;
}
.acp-btn-clear:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.92); }
.acp-btn-close:hover { background: rgba(255,100,100,.12); color: #ff9b9b; }

/* ── Área de mensagens ── */
.acp-messages {
  flex: 1;
  overflow-y: auto;
  padding: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  scroll-behavior: smooth;
}
.acp-messages::-webkit-scrollbar { width: 6px; }
.acp-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.10); border-radius: 999px; }

/* ── Tela de boas-vindas ── */
.acp-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 48px 32px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}
.acp-welcome-icon { font-size: 54px; line-height: 1; }
.acp-welcome-title {
  font-size: 22px;
  font-weight: 800;
  color: rgba(255,255,255,.95);
}
.acp-welcome-sub {
  font-size: 14px;
  color: rgba(255,255,255,.55);
  line-height: 1.6;
  max-width: 420px;
}
.acp-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}
.acp-suggestion {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.75);
  font-size: 12.5px;
  cursor: pointer;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  transition: background .16s ease, border .16s ease, color .16s ease;
}
.acp-suggestion:hover {
  background: rgba(77,163,255,.12);
  border-color: rgba(77,163,255,.35);
  color: rgba(255,255,255,.92);
}

/* ── Mensagens ── */
.acp-msg {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 24px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.acp-msg-user {
  justify-content: flex-end;
}
.acp-msg-alfred {
  justify-content: flex-start;
}

.acp-avatar {
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(77,163,255,.12);
  border: 1px solid rgba(77,163,255,.20);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
}

.acp-bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: calc(100% - 52px);
}

.acp-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.acp-msg-user .acp-bubble {
  background: linear-gradient(135deg, #1e3a5f, #1a3555);
  border: 1px solid rgba(77,163,255,.25);
  color: rgba(255,255,255,.92);
  border-bottom-right-radius: 4px;
}
.acp-msg-alfred .acp-bubble {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.90);
  border-bottom-left-radius: 4px;
}

.acp-msg-time {
  font-size: 10px;
  color: rgba(255,255,255,.35);
  padding: 0 4px;
}
.acp-msg-user .acp-msg-time { text-align: right; }

/* ── Typing indicator ── */
.acp-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px !important;
  min-width: 56px;
}
.acp-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.50);
  animation: acp-bounce .9s infinite ease-in-out;
}
.acp-typing span:nth-child(2) { animation-delay: .15s; }
.acp-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes acp-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: .5; }
  40%           { transform: scale(1.1); opacity: 1; }
}

/* ── Input ── */
.acp-input-area {
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(15,26,46,.95);
  backdrop-filter: blur(10px);
  flex: 0 0 auto;
}
.acp-input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  padding: 10px 14px;
  transition: border .18s ease;
  max-width: 860px;
  margin: 0 auto;
}
.acp-input-row:focus-within {
  border-color: rgba(77,163,255,.40);
  box-shadow: 0 0 0 3px rgba(77,163,255,.08);
}
.acp-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: rgba(255,255,255,.92);
  font-size: 14px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  resize: none;
  line-height: 1.55;
  min-height: 22px;
  max-height: 160px;
  overflow-y: auto;
  padding: 0;
}
.acp-input::placeholder { color: rgba(255,255,255,.38); }
.acp-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: #4da3ff;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: background .16s ease, transform .15s ease;
}
.acp-send-btn:hover { background: #3b8fe6; transform: scale(1.05); }
.acp-send-btn:disabled { background: rgba(255,255,255,.12); cursor: not-allowed; transform: none; }
.acp-send-btn .material-symbols-outlined { font-size: 18px; }

.acp-footer-hint {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,.28);
  margin-top: 10px;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

/* Responsivo — painéis: o JS controla o left via inline style;
   aqui apenas garantimos o fallback quando o painel ainda não foi aberto */
@media (max-width: 860px) {
  .alfred-chat-panel:not([style*="left"]) { left: 84px; }
  .tool-panel:not([style*="left"])        { left: 84px; }
}

/* =====================================================
   Botões de Ferramentas (Calculadora / LandMap)
   ===================================================== */

.tool-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.80);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  letter-spacing: .2px;
  transition: background .18s ease, border .18s ease, transform .15s ease;
}
.tool-nav-btn:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.20);
  transform: translateY(-1px);
}
.tool-nav-btn .tool-nav-icon { font-size: 20px; flex: 0 0 auto; }
.tool-nav-btn .tool-nav-text { flex: 1; text-align: left; }

.tool-calc:hover   { border-color: rgba(64,210,127,.35); background: rgba(64,210,127,.08); }
.tool-map:hover    { border-color: rgba(255,180,50,.35); background: rgba(255,180,50,.08); }
.tool-terra:hover  { border-color: rgba(232,160,32,.35); background: rgba(232,160,32,.08); }
.tool-terra .tool-nav-icon { color: #e8a020; }
.tool-landocs:hover { border-color: rgba(14,122,91,.45); background: rgba(14,122,91,.10); }
.tool-landocs .tool-nav-icon { color: #40d27f; }

/* Esconder texto quando sidebar recolhida */
.sidebar.is-collapsed .tool-nav-btn { justify-content: center; padding: 12px 10px; gap: 0; }
.sidebar.is-collapsed .tool-nav-text { display: none; }
.sidebar.is-collapsed .tool-nav-icon { font-size: 22px; }

/* =====================================================
   Painel de Ferramentas (Calculadora / LandMap)
   ===================================================== */

.tool-panel {
  position: fixed;
  top: 0;
  left: 280px;
  right: 0;
  bottom: 0;
  background: #0b1220;
  display: flex;
  flex-direction: column;
  z-index: 100;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .28s ease, transform .28s ease;
  overflow: hidden;
}
.tool-panel.acp-visible {
  opacity: 1;
  transform: translateY(0);
}

.tool-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(15,26,46,.95);
  backdrop-filter: blur(10px);
  flex: 0 0 auto;
}
.tool-panel-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tool-panel-body {
  flex: 1;
  overflow: hidden;
  display: flex;
}

/* =====================================================
   Responsividade global dos painéis e sidebar
   ===================================================== */

/* Telas médias: sidebar recolhe automaticamente */
@media (max-width: 860px) {
  .sidebar { width: 84px !important; }
  .sidebar .user-card,
  .sidebar .sidebar-label { display: none; }
  .sidebar .user-row { justify-content: center; }
  .sidebar.is-collapsed { width: 84px !important; }
  .main-content { margin-left: 84px; width: calc(100% - 84px); }
  .main-content.is-expanded { margin-left: 84px; width: calc(100% - 84px); }

  /* header dos painéis mais compacto */
  .tool-panel-header { padding: 12px 16px; }
  .acp-header { padding: 12px 16px; }
}

/* Telas pequenas: painel lateral de ferramentas ocupa mais espaço */
@media (max-width: 640px) {
  .tool-panel-header { padding: 10px 12px; }
  .acp-header { padding: 10px 12px; }
  .acp-messages { padding: 20px 0; }
  .acp-msg { padding: 8px 12px; }
  .acp-input-area { padding: 12px 12px 16px; }
  .acp-welcome { padding: 32px 16px; }
  .acp-welcome-title { font-size: 18px; }
}
