/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 13px;
  background: #f5f5f0;
  color: #1a1a1a;
  line-height: 1.5;
  cursor: none;
  user-select: none;
}

a { text-decoration: none; color: inherit; }
button { cursor: none; border: none; background: none; font-family: inherit; font-size: inherit; }

/* =====================================================
   CUSTOM CURSOR
   ===================================================== */
#tour-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 22px; height: 26px;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-2px, -2px);
  will-change: transform;
}

#tour-cursor svg {
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.3));
}

#cursor-click-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  border: 2px solid #16a34a;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}

#cursor-click-ring.ripple {
  animation: cursorRipple 0.5s ease-out forwards;
}

@keyframes cursorRipple {
  0%   { width: 0; height: 0; opacity: 0.7; }
  100% { width: 44px; height: 44px; opacity: 0; border-width: 1px; }
}

/* =====================================================
   DIM OVERLAY
   ===================================================== */
#tour-dim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  pointer-events: none;
  z-index: 9000;
  transition: background 0.4s ease;
}
#tour-dim.active { background: rgba(0,0,0,0.35); }

/* =====================================================
   TOUR TOOLTIP
   ===================================================== */
#tour-tooltip {
  position: fixed;
  bottom: 80px;
  right: 14px;
  width: 264px;
  background: #fff;
  border: 0.5px solid #ebebeb;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  z-index: 99990;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#tour-tooltip.visible { opacity: 1; transform: translateY(0); }
#tour-tooltip.hiding  { opacity: 0; transform: translateY(4px); transition: opacity 0.15s, transform 0.15s; }

.tt-icon {
  flex-shrink: 0;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.tt-body { flex: 1; min-width: 0; }

#tt-title {
  font-size: 12px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.4;
  margin-bottom: 4px;
}

#tt-text {
  font-size: 11px;
  color: #666;
  line-height: 1.55;
}

#tt-step {
  font-size: 9px;
  color: #aaa;
  margin-top: 6px;
  letter-spacing: 0.3px;
}

/* =====================================================
   APP SHELL
   ===================================================== */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
#sidebar {
  width: 172px;
  flex-shrink: 0;
  background: #000000;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  border-right: 0.5px solid #1a1a1a;
}

.sb-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 18px 14px 14px;
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
  margin-bottom: 6px;
}

.sb-logo-mark { flex-shrink: 0; }

.sb-workspace {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.05em;
}

.sb-product {
  font-size: 8px;
  font-weight: 400;
  color: rgba(255,255,255,0.35);
  margin-top: 1px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sb-nav {
  flex: 1;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 8px;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  font-weight: 400;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
}

.nav-item.active {
  background: rgba(22,163,74,0.18);
  color: #16a34a;
  font-weight: 500;
}

.nav-item.active svg { color: #16a34a; }

.sb-footer {
  padding: 10px 12px;
  border-top: 0.5px solid rgba(255,255,255,0.08);
}

.sb-user {
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(22,163,74,0.2);
  color: #16a34a;
  border: 1px solid rgba(22,163,74,0.3);
  font-size: 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-name {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}

.user-email {
  font-size: 9.5px;
  color: rgba(255,255,255,0.35);
  margin-top: 1px;
  white-space: nowrap;
}

/* =====================================================
   MAIN
   ===================================================== */
#main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* TOP BAR */
#topbar {
  background: #fff;
  border-bottom: 0.5px solid #ebebeb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  flex-shrink: 0;
  gap: 16px;
}

.tb-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.tb-title-group { display: flex; flex-direction: column; justify-content: center; }

#page-title {
  font-size: 14px;
  font-weight: 500;
  color: #111;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

#page-subtitle {
  font-size: 11px;
  font-weight: 400;
  color: #999;
  margin-top: 1px;
  display: none;
}

#page-tabs {
  display: flex;
  gap: 2px;
  align-items: center;
}

.tab-btn {
  padding: 5px 13px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  color: #888;
  cursor: none;
  transition: background 0.15s, color 0.15s;
}

.tab-btn:hover { background: #f5f5f0; color: #333; }

.tab-btn.active {
  background: #f0faf3;
  color: #16a34a;
  font-weight: 500;
}

.tb-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#page-filters {
  display: flex;
  gap: 4px;
}

.filter-btn {
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 400;
  color: #888;
  background: #f5f5f0;
  cursor: none;
  transition: background 0.15s, color 0.15s;
  border: none;
}

.filter-btn.active {
  background: #16a34a;
  color: #fff;
  font-weight: 500;
}

#page-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* CONTENT */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scroll-behavior: smooth;
  position: relative;
}

/* =====================================================
   TOUR HIGHLIGHT
   ===================================================== */
.tour-highlight {
  position: relative;
  z-index: 9100;
  border-radius: 10px;
  outline: 2px solid rgba(22,163,74,0.7);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(22,163,74,0.12);
  transition: outline 0.2s, box-shadow 0.2s;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-outline {
  border: 0.5px solid #ebebeb;
  color: #555;
  background: #fff;
}
.btn-outline:hover { background: #f5f5f0; }

.btn-primary {
  background: #16a34a;
  color: #fff;
  border: none;
}
.btn-primary:hover { background: #15803d; }

.btn-amber {
  background: #f59e0b;
  color: #fff;
  border: none;
}
.btn-amber:hover { background: #d97706; }

.btn-sm { padding: 5px 10px; font-size: 11.5px; }

/* =====================================================
   BADGES
   ===================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-verde  { background: #dcfce7; color: #16a34a; }
.badge-green  { background: #dcfce7; color: #16a34a; }
.badge-vermelho { background: #fee2e2; color: #dc2626; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-ambar  { background: #fef3c7; color: #92400e; }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-bronze { background: #fef3c7; color: #92400e; }
.badge-azul   { background: #dbeafe; color: #2563eb; }
.badge-blue   { background: #dbeafe; color: #2563eb; }
.badge-cinza  { background: #f3f4f6; color: #6b7280; }

/* Title badge */
.page-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 500;
  margin-left: 4px;
  vertical-align: middle;
}

/* =====================================================
   SEARCH INPUT (topbar)
   ===================================================== */
.tb-search { position: relative; }
.tb-search input {
  padding: 5px 10px 5px 26px;
  border: 0.5px solid #ebebeb;
  border-radius: 8px;
  font-size: 11.5px;
  font-family: inherit;
  background: #f9f9f9;
  color: #555;
  outline: none;
  cursor: none;
  width: 180px;
}
.tb-search svg { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: #ccc; }

/* Toggle group (Dia/Sem/Mês) */
.toggle-group { display: flex; border: 0.5px solid #ebebeb; border-radius: 8px; overflow: hidden; }
.toggle-item { padding: 5px 10px; font-size: 11px; font-weight: 400; color: #888; cursor: none; }
.toggle-item.active { background: #f59e0b; color: #fff; font-weight: 500; }

/* =====================================================
   KPI CARDS
   ===================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px 24px;
  min-height: 100px;
  border: 0.5px solid #ebebeb;
  transition: box-shadow 0.2s;
}

.kpi-card.card-teal   { background: #f0fdf9; border-color: #99f6e4; }
.kpi-card.card-orange { background: #fffbf0; border-color: #fde68a; }
.kpi-card.card-green  { background: #f0faf3; border-color: #bbf7d0; }

.kpi-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.05); }

.kpi-label {
  font-size: 13px;
  color: #999;
  font-weight: 400;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 500;
  color: #111;
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.kpi-value span { font-size: 15px; font-weight: 400; color: #999; }

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 100px;
}

.kpi-trend.up   { background: #dcfce7; color: #16a34a; }
.kpi-trend.down { background: #fee2e2; color: #dc2626; }
.kpi-trend.zero { background: #f3f4f6; color: #6b7280; }

.kpi-sub { font-size: 12px; color: #bbb; margin-top: 8px; }

/* =====================================================
   CONTENT GRIDS
   ===================================================== */
.content-grid-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.content-grid-3-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }

/* =====================================================
   CARDS
   ===================================================== */
.card {
  background: #fff;
  border: 0.5px solid #ebebeb;
  border-radius: 10px;
  padding: 18px 20px;
}

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

.card-title {
  font-size: 13px;
  font-weight: 500;
  color: #111;
}

.card-sub {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

/* =====================================================
   BAR CHART (Dashboard)
   ===================================================== */
.bar-chart-wrap {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 80px;
  padding-bottom: 2px;
}

.bar-item {
  flex: 1;
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  transition: opacity 0.2s;
}

.bar-item:hover { opacity: 0.8; }

.bar-xaxis {
  display: flex;
  justify-content: space-between;
  padding-top: 6px;
}

.bar-xaxis span { font-size: 9px; color: #ccc; }

/* =====================================================
   FUNIL
   ===================================================== */
.funil-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.funil-label { font-size: 11px; color: #666; min-width: 160px; }
.funil-bar-wrap { flex: 1; height: 8px; background: #f3f4f6; border-radius: 100px; overflow: hidden; }
.funil-bar-fill { height: 100%; border-radius: 100px; }
.funil-pct { font-size: 11px; font-weight: 500; color: #333; min-width: 30px; text-align: right; }

/* Conversions card */
.conv-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.conv-line-label { font-size: 11px; color: #666; min-width: 50px; }
.conv-line-bar-wrap { flex: 1; height: 6px; background: #f3f4f6; border-radius: 100px; overflow: hidden; }
.conv-line-bar-fill { height: 100%; background: #16a34a; border-radius: 100px; }
.conv-line-val { font-size: 11px; font-weight: 500; color: #333; min-width: 50px; text-align: right; }
.conv-footer { margin-top: 14px; padding-top: 12px; border-top: 0.5px solid #ebebeb; display: flex; justify-content: space-between; }
.conv-footer-label { font-size: 10.5px; color: #999; }
.conv-footer-val { font-size: 12px; font-weight: 500; color: #16a34a; }

/* =====================================================
   PIPELINE (KANBAN)
   ===================================================== */
.pipeline-wrap {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  height: calc(100vh - 52px - 40px - 60px);
}

.pipeline-wrap::-webkit-scrollbar { height: 4px; }
.pipeline-wrap::-webkit-scrollbar-track { background: transparent; }
.pipeline-wrap::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.pipeline-col {
  flex-shrink: 0;
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pipeline-col-header {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.col-meta { display: flex; align-items: center; gap: 6px; }
.col-count {
  font-size: 9.5px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 100px;
}
.col-value { font-size: 9.5px; font-weight: 400; color: #999; }

.col-novo     { background: #eff6ff; color: #3b82f6; }
.col-novo .col-count { background: #dbeafe; color: #3b82f6; }
.col-contato  { background: #f0f9ff; color: #0284c7; }
.col-contato .col-count { background: #bae6fd; color: #0284c7; }
.col-qual     { background: #fdf4ff; color: #9333ea; }
.col-qual .col-count { background: #f3e8ff; color: #9333ea; }
.col-proposta { background: #fff7ed; color: #ea580c; }
.col-proposta .col-count { background: #fed7aa; color: #ea580c; }
.col-negoc    { background: #fefce8; color: #ca8a04; }
.col-negoc .col-count { background: #fef08a; color: #ca8a04; }
.col-ganho    { background: #f0faf3; color: #16a34a; }
.col-ganho .col-count { background: #bbf7d0; color: #16a34a; }
.col-perdido  { background: #fef2f2; color: #dc2626; }
.col-perdido .col-count { background: #fecaca; color: #dc2626; }

.pipeline-card {
  background: #fff;
  border: 0.5px solid #ebebeb;
  border-radius: 10px;
  padding: 12px 14px;
  transition: box-shadow 0.2s;
}

.pipeline-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }

.pc-name  { font-size: 12px; font-weight: 500; color: #111; margin-bottom: 6px; }
.pc-value { font-size: 11.5px; color: #16a34a; font-weight: 500; }

.pc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 0.5px solid #f5f5f0;
}

.pc-avatar {
  width: 18px; height: 18px;
  border-radius: 50%;
  font-size: 7.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =====================================================
   DATA TABLE
   ===================================================== */
.table-card {
  background: #fff;
  border-radius: 10px;
  border: 0.5px solid #ebebeb;
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 0.5px solid #ebebeb;
}

.table-title { font-size: 13px; font-weight: 500; color: #111; }

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 9px 18px;
  font-size: 10px;
  font-weight: 500;
  color: #bbb;
  text-align: left;
  border-bottom: 0.5px solid #ebebeb;
  background: #fafafa;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.data-table td {
  padding: 11px 18px;
  font-size: 12px;
  color: #444;
  border-bottom: 0.5px solid #f5f5f0;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafaf8; }

.cell-user { display: flex; align-items: center; gap: 8px; }

.cell-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cell-name { font-weight: 500; color: #222; font-size: 12px; }
.cell-sub  { font-size: 10px; color: #bbb; margin-top: 1px; }

/* =====================================================
   METRIC CARDS INLINE
   ===================================================== */
.metric-inline {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.metric-inline-card {
  background: #fff;
  border: 0.5px solid #ebebeb;
  border-radius: 10px;
  padding: 20px 24px;
  min-height: 100px;
  flex: 1;
}

.metric-inline-value { font-size: 32px; font-weight: 500; color: #111; }
.metric-inline-label { font-size: 13px; font-weight: 400; color: #999; margin-top: 2px; }

/* =====================================================
   CHAT SPLIT LAYOUT (S05 / S06)
   ===================================================== */
.chat-split {
  display: flex;
  height: calc(100vh - 52px - 60px);
  background: #fff;
  border-radius: 10px;
  border: 0.5px solid #ebebeb;
  overflow: hidden;
  margin: -4px;
}

.chat-panel-left {
  width: 260px;
  flex-shrink: 0;
  border-right: 0.5px solid #ebebeb;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.chat-panel-header {
  padding: 12px 14px;
  border-bottom: 0.5px solid #ebebeb;
}

.chat-panel-title { font-size: 12px; font-weight: 500; color: #111; margin-bottom: 8px; }

.chat-search {
  padding: 6px 10px;
  border: 0.5px solid #ebebeb;
  border-radius: 8px;
  font-size: 11.5px;
  font-family: inherit;
  background: #f9f9f9;
  color: #555;
  width: 100%;
  outline: none;
  cursor: none;
}

.chat-dept-select {
  width: 100%;
  margin-top: 6px;
  padding: 5px 8px;
  border: 0.5px solid #ebebeb;
  border-radius: 8px;
  font-size: 11px;
  font-family: inherit;
  background: #fff;
  color: #888;
  outline: none;
  cursor: none;
  appearance: none;
}

.chat-conv-list { flex: 1; overflow-y: auto; }

.chat-conv-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 14px;
  border-bottom: 0.5px solid #f5f5f0;
  transition: background 0.12s;
}

.chat-conv-item:hover { background: #fafaf8; }
.chat-conv-item.active { background: #f0faf3; }

.cc-av {
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 10.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.cc-body { flex: 1; min-width: 0; }
.cc-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.cc-name { font-size: 11.5px; font-weight: 500; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-time { font-size: 9.5px; color: #ccc; flex-shrink: 0; }
.cc-preview { font-size: 10.5px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.cc-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 3px; }

.chat-panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.chat-header {
  padding: 12px 16px;
  border-bottom: 0.5px solid #ebebeb;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header-name { font-size: 13px; font-weight: 500; color: #111; }
.chat-header-dot { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fafaf8;
}

.msg-wrap-out { display: flex; justify-content: flex-end; }
.msg-wrap-in  { display: flex; justify-content: flex-start; flex-direction: column; gap: 2px; }

.msg-out {
  background: #fef3c7;
  border-radius: 14px 14px 4px 14px;
  padding: 8px 12px;
  font-size: 12px;
  max-width: 72%;
  color: #333;
}

.msg-in {
  background: #f0faf3;
  border-radius: 14px 14px 14px 4px;
  padding: 8px 12px;
  font-size: 12px;
  max-width: 72%;
  color: #333;
}

.msg-in-label {
  font-size: 9px;
  color: #16a34a;
  font-weight: 500;
  margin-bottom: 2px;
  padding-left: 2px;
}

.typing-indicator {
  background: #f0faf3;
  border-radius: 14px 14px 14px 4px;
  padding: 10px 14px;
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #16a34a;
  animation: typingPulse 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingPulse {
  0%,60%,100% { opacity: 0.3; transform: scale(1); }
  30%          { opacity: 1;   transform: scale(1.2); }
}

.chat-input-area {
  padding: 10px 14px;
  border-top: 0.5px solid #ebebeb;
}

.chat-input-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f5f5f0;
  border-radius: 10px;
  padding: 7px 10px;
}

.chat-input-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 12px;
  font-family: inherit;
  color: #999;
  outline: none;
  cursor: none;
}

.chat-send-amber {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* =====================================================
   CONTACT FORM (S08)
   ===================================================== */
.form-breadcrumb {
  font-size: 11.5px;
  color: #16a34a;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.form-page-user { display: flex; align-items: center; gap: 10px; }
.form-page-name { font-size: 15px; font-weight: 500; color: #111; }

.form-tabs { display: flex; gap: 0; border-bottom: 0.5px solid #ebebeb; margin-bottom: 16px; }
.form-tab { padding: 10px 16px; font-size: 12px; color: #888; cursor: none; border-bottom: 2px solid transparent; }
.form-tab.active { color: #16a34a; border-bottom-color: #16a34a; font-weight: 500; }

.form-section {
  background: #fff;
  border: 0.5px solid #ebebeb;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 12px;
}

.form-section-title {
  font-size: 11.5px;
  font-weight: 500;
  color: #444;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid #ebebeb;
}

.form-row { display: grid; gap: 10px; margin-bottom: 10px; }
.form-row-3 { grid-template-columns: repeat(3, 1fr); }
.form-row-2 { grid-template-columns: repeat(2, 1fr); }
.form-row-4 { grid-template-columns: repeat(4, 1fr); }
.form-row-1 { grid-template-columns: 1fr; }

.form-group { display: flex; flex-direction: column; gap: 4px; }

.form-label {
  font-size: 10px;
  font-weight: 500;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-input, .form-select {
  padding: 7px 10px;
  border: 0.5px solid #ebebeb;
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  color: #555;
  outline: none;
  cursor: none;
}

.form-section.collapsed {
  padding: 14px 20px;
}

.form-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 500;
  color: #444;
}

/* =====================================================
   CALENDAR (S09)
   ===================================================== */
.cal-wrap {
  background: #fff;
  border: 0.5px solid #ebebeb;
  border-radius: 10px;
  overflow: hidden;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 0.5px solid #ebebeb;
}

.cal-nav-title { font-size: 14px; font-weight: 500; color: #111; }

.cal-nav-btns { display: flex; gap: 6px; }
.cal-nav-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 0.5px solid #ebebeb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  cursor: none;
}

.cal-day-names {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 8px 12px 0;
  background: #fafafa;
  border-bottom: 0.5px solid #ebebeb;
}

.cal-day-name {
  text-align: center;
  font-size: 9.5px;
  font-weight: 500;
  color: #ccc;
  padding: 6px 0;
  text-transform: uppercase;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 4px 8px 8px;
}

.cal-cell {
  min-height: 72px;
  padding: 4px 5px;
  border-radius: 6px;
  margin: 1px;
}

.cal-cell.other-month { opacity: 0.3; }
.cal-cell.today { background: #f0faf3; }

.cal-day-num {
  font-size: 11.5px;
  font-weight: 400;
  color: #444;
  margin-bottom: 4px;
}

.cal-cell.today .cal-day-num {
  font-weight: 500;
  color: #16a34a;
}

.cal-event {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =====================================================
   PILLS GROUP
   ===================================================== */
.pills-group { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pill {
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 400;
  border: 0.5px solid #ebebeb;
  color: #666;
  cursor: none;
  background: #fff;
}
.pill.active { background: #16a34a; color: #fff; border-color: #16a34a; font-weight: 500; }
.pill.active-amber { background: #f59e0b; color: #fff; border-color: #f59e0b; font-weight: 500; }

/* =====================================================
   MODAL OVERLAY (S11)
   ===================================================== */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  background: #fff;
  border-radius: 12px;
  width: 420px;
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-title { font-size: 15px; font-weight: 500; color: #111; margin-bottom: 4px; }
.modal-sub   { font-size: 11.5px; font-weight: 400; color: #999; margin-bottom: 20px; }

.modal-field-label {
  font-size: 10px;
  font-weight: 500;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}

.modal-input {
  width: 100%;
  padding: 7px 10px;
  border: 0.5px solid #ebebeb;
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  color: #555;
  outline: none;
  cursor: none;
  margin-bottom: 12px;
}

.modal-select {
  width: 100%;
  padding: 7px 10px;
  border: 0.5px solid #ebebeb;
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  color: #888;
  outline: none;
  cursor: none;
  appearance: none;
  margin-bottom: 12px;
}

.period-pills { display: flex; gap: 6px; margin-bottom: 12px; }
.period-pill {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  border: 0.5px solid #ebebeb;
  color: #666;
  cursor: none;
}
.period-pill.active { background: #f59e0b; color: #fff; border-color: #f59e0b; }

.modal-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }

.modal-divider { height: 0.5px; background: #ebebeb; margin: 16px 0; }

.bloq-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 0.5px solid #f5f5f0;
  font-size: 11.5px;
  color: #555;
}
.bloq-item:last-child { border-bottom: none; }

/* =====================================================
   SETTINGS (S13–S15)
   ===================================================== */
.settings-tabs {
  display: flex;
  border-bottom: 0.5px solid #ebebeb;
  margin-bottom: 16px;
  background: #fff;
  border-radius: 10px 10px 0 0;
}

.settings-tab {
  padding: 11px 18px;
  font-size: 12.5px;
  font-weight: 400;
  color: #888;
  cursor: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}

.settings-tab.active {
  color: #16a34a;
  border-bottom-color: #16a34a;
  font-weight: 500;
}

.settings-card {
  background: #fff;
  border: 0.5px solid #ebebeb;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 14px;
}

/* WhatsApp instance card */
.wa-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 0.5px solid #ebebeb;
  border-radius: 10px;
  padding: 18px 20px;
}

.wa-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: #fef3c7;
  border: 0.5px solid #fde68a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: #92400e;
  flex-shrink: 0;
}

.wa-info { flex: 1; }
.wa-name { font-size: 13px; font-weight: 500; color: #111; margin-bottom: 3px; }
.wa-num  { font-size: 11px; font-weight: 400; color: #999; }

/* Manual card (indigo) */
.manual-hero {
  background: #4f46e5;
  border-radius: 10px;
  padding: 28px 32px;
  margin-bottom: 16px;
  color: #fff;
}

.manual-hero-title { font-size: 20px; font-weight: 500; margin-bottom: 8px; line-height: 1.3; }
.manual-hero-sub   { font-size: 12.5px; font-weight: 400; opacity: 0.8; line-height: 1.6; margin-bottom: 20px; }

.manual-stats { display: flex; gap: 28px; }
.manual-stat-val   { font-size: 18px; font-weight: 500; }
.manual-stat-label { font-size: 10px; font-weight: 400; opacity: 0.65; margin-top: 1px; text-transform: uppercase; letter-spacing: 0.05em; }

.manual-prereq {
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 16px;
}

.prereq-title { font-size: 11px; font-weight: 500; opacity: 0.9; margin-bottom: 8px; }
.prereq-row   { font-size: 11px; font-weight: 400; opacity: 0.75; margin-bottom: 4px; }
.prereq-key   { opacity: 1; font-weight: 500; }

.manual-btns { display: flex; gap: 10px; margin-top: 16px; }
.btn-white-outline {
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  cursor: none;
}
.btn-green-solid {
  padding: 7px 16px;
  border-radius: 8px;
  background: #16a34a;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  border: none;
  cursor: none;
}

/* Design system */
.design-section-title {
  font-size: 12px;
  font-weight: 500;
  color: #444;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid #ebebeb;
}

.upload-area {
  border: 1.5px dashed #d1d5db;
  border-radius: 10px;
  padding: 32px;
  text-align: center;
  color: #bbb;
  font-size: 11.5px;
  margin-bottom: 16px;
}

.color-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.color-label { font-size: 11.5px; color: #666; min-width: 110px; }
.color-swatch-preview {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 0.5px solid #ebebeb;
}
.color-hex {
  padding: 5px 10px;
  border: 0.5px solid #ebebeb;
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  color: #555;
  width: 90px;
  outline: none;
  cursor: none;
}

.avatar-upload-area {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 1.5px dashed #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 20px;
}

/* =====================================================
   TOUR BAR (bottom controls)
   ===================================================== */
#tour-bar {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99980;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: auto;
}

#tour-progress-wrap {
  width: 200px;
  height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 100px;
}

#tour-progress-fill {
  height: 100%;
  background: #16a34a;
  border-radius: 100px;
  transition: width 0.3s ease;
  width: 0%;
}

.tour-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(20,20,20,0.9);
  backdrop-filter: blur(12px);
  border-radius: 100px;
  padding: 7px 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.tb-nav-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  transition: background 0.15s, color 0.15s;
  cursor: pointer !important;
}

.tb-nav-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.tb-nav-btn:disabled { opacity: 0.2; cursor: default !important; }

#tour-counter {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.65);
  min-width: 38px;
  text-align: center;
}

.tb-play-btn { color: rgba(255,255,255,0.9) !important; }

#tour-screen-label {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255,255,255,0.45);
  background: rgba(20,20,20,0.8);
  padding: 3px 10px;
  border-radius: 100px;
  backdrop-filter: blur(8px);
}

/* =====================================================
   TOAST
   ===================================================== */
#tour-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #1a1a1a;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  padding: 10px 18px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  z-index: 99985;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
}
#tour-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =====================================================
   SCREEN TRANSITIONS
   ===================================================== */
#content.fade-out { opacity: 0; transition: opacity 0.2s ease; }
#content.fade-in  { opacity: 1; transition: opacity 0.3s ease; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  #sidebar { width: 54px; }
  .sb-logo-text, .nav-item span, .user-info { display: none; }
  .sb-logo { padding: 14px 10px; justify-content: center; }
  .nav-item { justify-content: center; padding: 9px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .content-grid-3-1 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  #content { padding: 12px; }
  .kpi-grid { grid-template-columns: 1fr; }
  #tour-tooltip { right: 8px; left: 8px; width: auto; bottom: 70px; }
  .chat-split { flex-direction: column; }
  .chat-panel-left { width: 100%; height: 200px; border-right: none; border-bottom: 0.5px solid #ebebeb; }
}
