/* ─── App shell ─── */
.app-shell { display: flex; min-height: 100vh; position: relative; }

/* ─── Sidebar (desktop) ─── */
.sidebar {
  width: 220px;
  background: var(--ink-900);
  border-right: none;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 200; transition: width .2s ease; flex-shrink: 0;
}
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .sidebar-label { display: none; }
.sidebar.collapsed .sidebar-logo { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; }
.sidebar.collapsed .sidebar-collapse-btn { transform: rotate(180deg); }
.sidebar.collapsed .sidebar-item { justify-content: center; padding: 10px 0; gap: 0; }
.sidebar.collapsed .sidebar-icon { width: auto; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px; border-bottom: 1px solid var(--ink-700); min-height: 64px;
}
.sidebar-logo { font-size: 1.1rem; font-weight: 800; color: #fff; letter-spacing: .05em; }
.sidebar-collapse-btn {
  background: none; border: 1px solid var(--ink-600); border-radius: 6px;
  width: 28px; height: 28px; font-size: 1rem; cursor: pointer; color: var(--ink-400);
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; flex-shrink: 0;
}
.sidebar-collapse-btn:hover { background: var(--ink-700); color: #fff; }

.sidebar-nav {
  flex: 1; padding: 12px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar-bottom { padding: 8px; border-top: 1px solid var(--ink-700); }

.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px;
  background: none; border: none; border-radius: var(--radius);
  font-size: .875rem; font-weight: 500; color: var(--ink-400);
  cursor: pointer; text-align: left; transition: all .15s;
  min-height: 44px; white-space: nowrap;
}
.sidebar-item:hover  { background: var(--ink-700); color: var(--ink-100); }
.sidebar-item.active {
  background: var(--ink-800); color: #fff; font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gold-600);
}
.sidebar-icon  { font-size: 1.1rem; flex-shrink: 0; width: 20px; text-align: center; }
.sidebar-label { overflow: hidden; text-overflow: ellipsis; }

/* ─── Main content ─── */
.main-content {
  flex: 1; margin-left: 220px;
  display: flex; flex-direction: column;
  min-height: 100vh; overflow-x: hidden;
  transition: margin-left .2s ease;
}
.sidebar.collapsed ~ .main-content,
.main-content.expanded { margin-left: 64px; }

/* ─── Views ─── */
.view { display: none; flex: 1; flex-direction: column; }
.view.active { display: flex; }

#viewKanban .kanban { flex: 1; }
.coluna { max-height: calc(100vh - 115px); }

/* ─── Top bar mobile ─── */
.top-bar-mobile {
  display: none; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 56px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.top-bar-title { font-size: 1rem; font-weight: 700; color: var(--text); }

/* ─── Bottom nav (mobile) ─── */
.bottom-nav {
  display: none; position: fixed;
  bottom: 0; left: 0; right: 0; height: 60px;
  background: var(--surface); border-top: 1px solid var(--border);
  z-index: 200; padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: .65rem; font-weight: 500;
  min-height: 44px; transition: color .15s;
}
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-icon  { font-size: 1.3rem; line-height: 1; }
.bottom-nav-label { font-size: .65rem; }

/* ─── Dashboard ─── */
.dashboard {
  padding: 24px; max-width: 900px; width: 100%;
  display: flex; flex-direction: column; gap: 24px;
}
.dash-titulo    { font-size: 1.5rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.dash-subtitulo { font-size: .875rem; color: var(--text-muted); }

.dash-quick { display: flex; gap: 12px; flex-wrap: wrap; }
.dash-quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 20px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; font-size: .82rem; font-weight: 600; color: var(--text);
  cursor: pointer; transition: all .15s; min-width: 100px; min-height: 80px;
  box-shadow: var(--shadow);
}
.dash-quick-btn:hover {
  border-color: var(--primary); background: var(--warm-raised); color: var(--primary);
  transform: translateY(-1px); box-shadow: var(--shadow-lg);
}
.dash-quick-icon { font-size: 1.6rem; }

.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; text-align: center; cursor: pointer; transition: all .15s; box-shadow: var(--shadow);
}
.stat-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.stat-icon  { font-size: 1.4rem; margin-bottom: 4px; }
.stat-num   { font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-label { font-size: .72rem; color: var(--text-muted); font-weight: 500; margin-top: 4px; }
#statCardUrgentes .stat-num { color: var(--danger); }
#statCardEmail .stat-num    { color: var(--primary); }

.dash-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; box-shadow: var(--shadow);
}
.dash-section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.dash-section-title { font-size: 1rem; font-weight: 700; color: var(--text); }

.dash-leads-list { display: flex; flex-direction: column; gap: 8px; }
.dash-lead-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: all .15s; min-height: 56px;
}
.dash-lead-item:hover { border-color: var(--primary); background: var(--warm-raised); }
.dash-lead-info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; }
.dash-lead-neg {
  font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 99px;
  color: #fff; white-space: nowrap; flex-shrink: 0;
}
.dash-lead-neg.negocio-carbono_zero { background: var(--cz); color: var(--cz-fg); }
.dash-lead-neg.negocio-tarmac       { background: var(--tm); color: var(--tm-fg); }
.dash-lead-neg.negocio-elevator     { background: var(--el); color: var(--el-fg); }
.dash-lead-nome { font-size: .875rem; font-weight: 600; color: var(--text); }
.dash-lead-seg  { font-size: .78rem; color: var(--text-muted); }

.dash-empty { text-align: center; padding: 24px 0; color: var(--text-muted); font-size: .875rem; }

/* ─── Pipeline pulse ─── */
.dash-pipeline {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px;
}
.dash-pipeline::-webkit-scrollbar { height: 4px; }
.dash-pipeline::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.dash-pipe-col {
  flex: 1; min-width: 80px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 12px 8px; text-align: center;
  cursor: pointer; transition: all .15s;
}
.dash-pipe-col:hover { border-color: var(--primary); background: var(--warm-raised); }
.dash-pipe-col--vazia { opacity: .45; }
.dash-pipe-count {
  font-size: 1.4rem; font-weight: 800; color: var(--primary); line-height: 1;
}
.dash-pipe-col--vazia .dash-pipe-count { color: var(--text-muted); }
.dash-pipe-label {
  font-size: .67rem; font-weight: 600; color: var(--text-muted);
  margin-top: 4px; line-height: 1.2; text-transform: uppercase; letter-spacing: .04em;
}

/* dash-section-title com ícone */
.dash-section-title {
  display: flex; align-items: center; gap: 6px;
}
.dash-section-title svg { width: 15px; height: 15px; color: var(--primary); }

.dash-sugestao-card {
  background: var(--fill-warn); border: 1px solid var(--border-warn); border-left: 4px solid var(--warn);
  border-radius: var(--radius); padding: 14px 16px; font-size: .875rem; color: var(--text);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.btn-sugestao {
  background: var(--warn); color: #fff; border: none; border-radius: var(--radius);
  padding: 6px 14px; font-size: .82rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .15s;
}
.btn-sugestao:hover { background: #9A7530; }

/* ─── Painel de notificações (Feature 3) ─── */
.notif-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 499;
}
.notif-panel {
  position: fixed; right: 0; top: 0; bottom: 0; width: 360px; max-width: 95vw;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,.15);
  z-index: 500; display: flex; flex-direction: column; overflow: hidden;
}
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .95rem; gap: 8px; flex-shrink: 0;
}
.notif-panel-header svg { width: 18px; height: 18px; vertical-align: middle; margin-right: 6px; }
.notif-panel-lista { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.notif-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg);
}
.notif-item-info { flex: 1; min-width: 0; }
.notif-item-titulo { font-weight: 600; font-size: .88rem; margin-bottom: 2px; }
.notif-item-empresa { font-size: .8rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.notif-item-data { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.notif-vazio { color: var(--text-muted); font-size: .85rem; text-align: center; padding: 24px 0; }
.sidebar-bell.tem-notif .sidebar-icon i { color: var(--warn); }

/* ─── Migrado de style.css ─── */
.header-right { display: flex; align-items: center; gap: 12px; }
.dash-welcome {}

/* ══════════════════════════════════════
   HOME COCKPIT
══════════════════════════════════════ */
.home-cockpit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
  grid-template-areas: "saudacao saudacao" "reunioes tarefas" "emails perf";
  gap: 16px;
  padding: 20px 24px 40px;
  align-content: start;
}
.home-saudacao      { grid-area: saudacao; }
.home-bloco-reunioes { grid-area: reunioes; }
.home-bloco-tarefas  { grid-area: tarefas; }
.home-bloco-emails   { grid-area: emails; }
#homePerfBloco       { grid-area: perf; }
@media (max-width: 767px) {
  .home-cockpit {
    grid-template-columns: 1fr;
    grid-template-areas: "saudacao" "reunioes" "emails" "tarefas" "perf";
  }
}

/* ─── Bloco genérico ─── */
.home-bloco {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
  box-shadow: var(--shadow);
}

/* ─── Bloco 1: Saudação ─── */
.home-saudacao { display: flex; flex-direction: column; gap: 10px; }
.home-saudacao-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.home-titulo  { font-size: 1.5rem; font-weight: 800; color: var(--text); margin: 0; }
.home-data    { font-size: .875rem; color: var(--text-muted); margin: 4px 0 0; }
.home-refresh-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 6px; cursor: pointer;
  color: var(--text-muted); display: flex; flex-shrink: 0;
  transition: color .15s, border-color .15s;
}
.home-refresh-btn:hover { color: var(--primary); border-color: var(--primary); }
.home-refresh-btn svg  { width: 16px; height: 16px; }
.home-streak {
  display: flex; align-items: center; gap: 6px;
  font-size: .85rem; font-weight: 600; color: #f59e0b;
}
.home-streak svg { width: 16px; height: 16px; }
.home-meta-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(250,204,21,.15); border: 1px solid rgba(250,204,21,.35);
  color: #ca8a04; font-size: .82rem; font-weight: 700;
  padding: 5px 12px; border-radius: 99px; width: fit-content;
}
.home-meta-badge svg { width: 14px; height: 14px; }

/* ─── Header de bloco ─── */
.home-bloco-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.home-bloco-titulo {
  font-size: .95rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 7px; margin: 0;
}
.home-bloco-titulo svg { width: 16px; height: 16px; color: var(--primary); }
.home-bloco-count { font-size: .82rem; font-weight: 500; color: var(--text-muted); }
.home-tarefas-sub { font-size: .8rem; color: var(--text-muted); margin-left: auto; }

/* ─── Lista genérica ─── */
.home-lista { display: flex; flex-direction: column; gap: 8px; }
.home-vazio { color: var(--text-muted); font-size: .875rem; text-align: center; padding: 16px 0; }
.home-loading { display: flex; justify-content: center; }
.home-loading svg { width: 18px; height: 18px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Item genérico ─── */
.home-item {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg);
  transition: border-color .15s; cursor: default;
}
.home-item:has([data-open-empresa]) { cursor: pointer; }
.home-item:hover { border-color: var(--primary-muted, var(--border)); }
.home-item-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.home-item-info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.home-item-titulo { font-size: .875rem; font-weight: 600; color: var(--text); }
.home-item-assunto { font-size: .8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-item-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.home-item-icon { color: var(--text-muted); flex-shrink: 0; }
.home-item-icon svg { width: 15px; height: 15px; }
.home-link { cursor: pointer; color: var(--primary); font-weight: 500; }
.home-link:hover { text-decoration: underline; }
.home-tempo { font-size: .75rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* ─── Negócio badge (herda .negocio-*) ─── */
.home-neg-badge {
  font-size: .68rem; font-weight: 700; padding: 2px 7px;
  border-radius: 99px; color: #fff; white-space: nowrap;
}
.home-neg-badge.negocio-carbono_zero { background: var(--cz); color: var(--cz-fg); }
.home-neg-badge.negocio-tarmac       { background: var(--tm); color: var(--tm-fg); }
.home-neg-badge.negocio-elevator     { background: var(--el); color: var(--el-fg); }

/* ─── Reunião ─── */
.home-reuniao-hora { font-size: .9rem; font-weight: 700; color: var(--text); flex-shrink: 0; min-width: 40px; }
.home-reuniao-agora { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-muted, rgba(99,102,241,.15)); }
.home-reuniao-entrar {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .8rem; font-weight: 600;
  background: var(--primary); color: #fff;
  padding: 5px 12px; border-radius: 8px; text-decoration: none;
  white-space: nowrap; flex-shrink: 0; transition: opacity .15s;
}
.home-reuniao-entrar:hover { opacity: .85; }
.home-reuniao-entrar svg { width: 13px; height: 13px; }
.home-reuniao-item { cursor: default; }

/* ─── Badge atrasada ─── */
.home-badge-atrasada {
  font-size: .7rem; font-weight: 700;
  background: rgba(239,68,68,.15); color: #ef4444;
  border: 1px solid rgba(239,68,68,.3);
  padding: 2px 7px; border-radius: 99px;
}

/* ─── Ver todos ─── */
.home-ver-todos {
  display: block; width: 100%; margin-top: 10px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px;
  font-size: .82rem; color: var(--text-muted); cursor: pointer;
  transition: color .15s, border-color .15s;
}
.home-ver-todos:hover { color: var(--primary); border-color: var(--primary); }

/* ─── Performance ─── */
.home-perf-bateu { border-color: rgba(250,204,21,.4); background: rgba(250,204,21,.06); }
.home-perf-linha { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.home-perf-pontos { font-size: 1.8rem; font-weight: 800; color: var(--text); }
.home-perf-meta   { font-size: .8rem; color: var(--text-muted); }
.home-perf-barra-wrap {
  height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; margin-bottom: 10px;
}
.home-perf-barra { height: 100%; background: var(--success, #22c55e); border-radius: 99px; transition: width .4s ease; }
.home-perf-streak { font-size: .85rem; color: #f59e0b; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.home-perf-streak svg { width: 15px; height: 15px; }
.home-perf-meta-ok { font-size: .85rem; font-weight: 700; color: #ca8a04; margin-top: 6px; }

/* ─── RSVP convites pendentes ─── */
.home-reuniao-pendente { border-color: rgba(245,158,11,.4); }
.home-rsvp-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .7rem; font-weight: 600;
  color: #b45309; background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.3);
  padding: 2px 8px; border-radius: 99px;
}
.home-rsvp-badge svg { width: 11px; height: 11px; }
.home-rsvp-btns {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px;
}
.home-rsvp-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .78rem; font-weight: 600;
  padding: 5px 11px; border-radius: 8px;
  cursor: pointer; border: 1px solid; text-decoration: none;
  transition: opacity .15s;
}
.home-rsvp-btn svg { width: 12px; height: 12px; }
.home-rsvp-aceitar { background: var(--success, #22c55e); color: #fff; border-color: var(--success, #22c55e); }
.home-rsvp-recusar { background: transparent; color: var(--danger, #ef4444); border-color: var(--danger, #ef4444); }
.home-rsvp-propor  { background: transparent; color: var(--text-muted); border-color: var(--border); }
.home-rsvp-btn:hover { opacity: .8; }
.home-rsvp-btn:disabled { cursor: not-allowed; }
/* Label da plataforma no botão Entrar */
.home-reuniao-entrar span { margin-left: 2px; }
