:root {
  --brand:     #FF6B00;
  --brand-d:   #CC5500;
  --brand-l:   #FF8C3A;
  --bg:        #0A0A0F;
  --bg2:       #111118;
  --bg3:       #18181F;
  --border:    #252530;
  --text:      #F0F0F5;
  --text2:     #9090A8;
  --text3:     #5A5A70;
  --green:     #22C55E;
  --blue:      #3B82F6;
  --purple:    #A855F7;
  --red:       #EF4444;
  --yellow:    #F59E0B;
  --card-r:    12px;
  --trans:     all .2s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ══════════════════════════════════════════════════════════════
   LOGIN
══════════════════════════════════════════════════════════════ */
#login-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,107,0,.12), transparent);
  z-index: 1000;
}
.login-card {
  width: 400px; padding: 48px 40px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 40px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,107,0,.06);
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.login-logo-icon {
  width: 44px; height: 44px; background: var(--brand); border-radius: 10px;
  display: grid; place-items: center; font-size: 22px;
}
.login-logo-text { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 20px; }
.login-logo-text span { color: var(--brand); }
.login-title { font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.login-sub { color: var(--text2); font-size: 14px; margin-bottom: 32px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text2); margin-bottom: 8px; }
.form-group input {
  width: 100%; padding: 12px 14px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 15px; font-family: inherit;
  transition: var(--trans); outline: none;
}
.form-group input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,107,0,.12); }
.btn-login {
  width: 100%; padding: 14px;
  background: var(--brand); border: none; border-radius: 8px;
  color: #fff; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 15px;
  cursor: pointer; transition: var(--trans); margin-top: 8px;
}
.btn-login:hover { background: var(--brand-l); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255,107,0,.3); }
.login-error { color: var(--red); font-size: 13px; margin-top: 12px; display: none; text-align: center; }

/* ══════════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL
══════════════════════════════════════════════════════════════ */
#app { display: none; height: 100vh; flex-direction: column; }
#app.visible { display: flex; }

/* ── TOPBAR ── */
.topbar {
  height: 60px; padding: 0 24px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; flex-shrink: 0;
}
.topbar-logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 18px; }
.topbar-logo span { color: var(--brand); }
.topbar-spacer { flex: 1; }
.topbar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; border-radius: 8px;
  cursor: pointer; transition: var(--trans);
}
.topbar-user:hover { background: var(--bg3); }
.topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--purple));
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.topbar-name { font-size: 14px; font-weight: 500; }
.topbar-btn-logout {
  padding: 7px 14px; background: transparent; border: 1px solid var(--border);
  border-radius: 7px; color: var(--text2); font-size: 13px; cursor: pointer;
  transition: var(--trans);
}
.topbar-btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ── BUSCA GLOBAL ── */
.busca-wrap { position: relative; }
.busca-input {
  width: 220px; padding: 7px 12px 7px 32px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 13px; font-family: inherit;
  outline: none; transition: var(--trans);
}
.busca-input:focus { border-color: var(--brand); width: 280px; }
.busca-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--text3); pointer-events: none; }
.busca-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; left: auto;
  width: 360px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.4);
  z-index: 1000; overflow: hidden; display: none;
}
.busca-dropdown.open { display: block; }
.busca-group-title { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; padding: 10px 14px 4px; }
.busca-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  cursor: pointer; font-size: 13px; transition: background .15s;
}
.busca-item:hover { background: var(--bg3); }
.busca-item-main { flex: 1; font-weight: 500; }
.busca-item-sub { font-size: 11px; color: var(--text3); }
.busca-empty { padding: 20px 14px; color: var(--text3); font-size: 13px; text-align: center; }

/* ── BODY ROW ── */
.body-row { display: flex; flex: 1; overflow: hidden; }

/* ── SIDEBAR ── */
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg2); border-right: 1px solid var(--border);
  padding: 16px 12px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px;
  cursor: pointer; transition: var(--trans);
  color: var(--text2); font-size: 14px; font-weight: 500;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: rgba(255,107,0,.12); color: var(--brand); }
.nav-icon { font-size: 17px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: var(--brand);
  color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
}
.nav-sep { height: 1px; background: var(--border); margin: 8px 0; }

/* ── MAIN CONTENT ── */
.main { flex: 1; overflow-y: auto; padding: 28px; }

/* ── SEÇÃO ── */
.section { display: none; }
.section.active { display: block; }

/* Chat Mensagens — flex para preencher altura disponível */
#section-mensagens { display: none; flex-direction: column; min-height: 0; }
#section-mensagens.active { display: flex !important; }

.section-header { margin-bottom: 24px; }
.section-title { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 24px; }
.section-sub { color: var(--text2); font-size: 14px; margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════
   KPI CARDS
══════════════════════════════════════════════════════════════ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.kpi-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--card-r);
  padding: 20px; position: relative; overflow: hidden; transition: var(--trans);
}
.kpi-card:hover { border-color: rgba(255,107,0,.3); transform: translateY(-2px); }
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent, var(--brand));
}
.kpi-label { font-size: 12px; font-weight: 500; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; }
.kpi-value { font-family: 'Syne', sans-serif; font-size: 32px; font-weight: 800; line-height: 1; }
.kpi-value.small { font-size: 22px; }
.kpi-sub { font-size: 12px; color: var(--text3); margin-top: 6px; }
.kpi-icon {
  position: absolute; top: 18px; right: 16px;
  font-size: 26px; opacity: .2;
}
.cat-detalhe { font-size: 12px; color: var(--text2); margin-top: 8px; line-height: 1.7; }
.cat-detalhe .l { display: flex; justify-content: space-between; }
.cat-detalhe .l b { color: var(--text); font-weight: 700; }
.kpi-card[onclick]:hover { border-color: var(--brand); transform: translateY(-2px); }
.kpi-card[onclick] { transition: var(--trans); }

/* ══════════════════════════════════════════════════════════════
   GRÁFICOS SIMPLES (canvas-like com divs)
══════════════════════════════════════════════════════════════ */
.charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 28px; }
.chart-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--card-r); padding: 20px;
}
.chart-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 15px; margin-bottom: 16px; }
.chart-wrap { height: 180px; display: flex; align-items: flex-end; gap: 4px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bar-pair { width: 100%; display: flex; gap: 2px; align-items: flex-end; height: 150px; }
.bar {
  flex: 1; border-radius: 4px 4px 0 0;
  transition: all .4s ease; cursor: pointer; position: relative;
  min-height: 4px;
}
.bar:hover { filter: brightness(1.3); }
.bar-label { font-size: 9px; color: var(--text3); white-space: nowrap; overflow: hidden; max-width: 100%; text-align: center; }
.bar-in  { background: var(--blue); }
.bar-out { background: var(--brand); }
.chart-legend { display: flex; gap: 16px; margin-top: 10px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; }

/* Donut chart */
.donut-wrap { position: relative; width: 160px; height: 160px; margin: 0 auto 16px; }
.donut-wrap svg { transform: rotate(-90deg); }
.donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.donut-center-val { font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 800; }
.donut-center-label { font-size: 11px; color: var(--text2); }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.donut-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.donut-legend-label { color: var(--text2); flex: 1; }
.donut-legend-val { font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   TABELAS
══════════════════════════════════════════════════════════════ */
.table-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--card-r); overflow: hidden;
}
.table-top {
  padding: 16px 20px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.table-top-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 15px; flex: 1; }
.search-input {
  padding: 8px 12px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); font-size: 13px; font-family: inherit;
  outline: none; transition: var(--trans); width: 200px;
}
.search-input:focus { border-color: var(--brand); }
.select-filter {
  padding: 8px 10px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); font-size: 13px; font-family: inherit;
  outline: none; cursor: pointer;
}
.date-filter-group { display: flex; align-items: center; gap: 6px; }
.date-filter-label { font-size: 12px; font-weight: 600; color: var(--text2); white-space: nowrap; }
.date-filter-sep   { font-size: 12px; color: var(--text3); white-space: nowrap; }
.date-filter-clear {
  background: none; border: 1px solid var(--border); border-radius: 7px;
  color: var(--text3); cursor: pointer; font-size: 14px; padding: 7px 9px;
  line-height: 1; transition: var(--trans);
}
.date-filter-clear:hover { color: var(--text); border-color: var(--text3); }
.btn-sm {
  padding: 8px 14px; background: var(--brand); border: none; border-radius: 7px;
  color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: var(--trans); font-family: inherit;
}
.btn-sm:hover { background: var(--brand-l); }
.btn-sm.ghost {
  background: transparent; border: 1px solid var(--border); color: var(--text2);
}
.btn-sm.ghost:hover { border-color: var(--brand); color: var(--brand); background: rgba(255,107,0,.08); }

table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border); }
th {
  padding: 12px 20px; text-align: left;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text3);
}
td { padding: 14px 20px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.03); }
tbody tr { transition: var(--trans); cursor: pointer; }
tbody tr:hover { background: rgba(255,255,255,.02); }
tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
}
.badge.novo       { background: rgba(59,130,246,.15); color: var(--blue); }
.badge.cotacao    { background: rgba(245,158,11,.15); color: var(--yellow); }
.badge.negociacao { background: rgba(168,85,247,.15); color: var(--purple); }
.badge.cliente    { background: rgba(34,197,94,.15);  color: var(--green); }
.badge.inativo    { background: rgba(144,144,168,.1); color: var(--text3); }
.badge.dhl        { background: rgba(255,204,0,.15);  color: #FFCC00; }
.badge.fedex      { background: rgba(77,53,131,.3);   color: #9D7AFF; }
.badge.open       { background: rgba(34,197,94,.15);  color: var(--green); }
.badge.pending    { background: rgba(245,158,11,.15); color: var(--yellow); }
.badge.closed     { background: rgba(144,144,168,.1); color: var(--text3); }
.badge.emitido    { background: rgba(34,197,94,.15);  color: var(--green); }
.badge.entrada    { background: rgba(59,130,246,.12); color: var(--blue); }
.badge.saida      { background: rgba(255,107,0,.12);  color: var(--brand); }
.badge.realizada  { background: rgba(144,144,168,.1); color: var(--text3); }
.badge.convertida { background: rgba(34,197,94,.15);  color: var(--green); }
.badge.cancelada  { background: rgba(144,144,168,.1); color: var(--text3); }
.badge.perdida    { background: rgba(231,76,60,.12);  color: #e74c3c; }

.phone-chip { font-family: monospace; font-size: 13px; color: var(--text2); }
.chat-filter-pill {
  padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); background: transparent; color: var(--text2); cursor: pointer;
  transition: var(--trans); white-space: nowrap;
}
.chat-filter-pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.btn-sugerir-ap {
  width:36px; height:36px; background:rgba(139,92,246,.12); border:1px solid rgba(139,92,246,.3);
  border-radius:8px; color:var(--purple); font-size:16px; cursor:pointer; flex-shrink:0;
  display:grid; place-items:center; transition:var(--trans); title:"Sugerir aprendizado";
}
.btn-sugerir-ap:hover { background:rgba(139,92,246,.22); }
.ap-func-card {
  padding:14px 16px; background:rgba(139,92,246,.06); border:1px solid rgba(139,92,246,.2);
  border-radius:10px;
}
.ap-func-badge {
  font-size:11px; font-weight:700; background:var(--purple); color:#fff;
  padding:2px 8px; border-radius:99px;
}
.ap-rel-table th, .ap-rel-table td {
  padding:8px 12px; text-align:left; font-size:12px; border-bottom:1px solid var(--border);
}
.ap-rel-table th { font-weight:700; color:var(--text2); background:var(--bg3); }

.pagination {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; padding: 14px 20px;
  border-top: 1px solid var(--border); font-size: 13px; color: var(--text2);
}
.page-btn {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); cursor: pointer; font-size: 13px;
  display: grid; place-items: center; transition: var(--trans);
}
.page-btn:hover { border-color: var(--brand); color: var(--brand); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ══════════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: none; align-items: center; justify-content: center; z-index: 500;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 16px;
  width: 600px; max-width: 95vw; max-height: 90vh; overflow-y: auto;
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 18px; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); cursor: pointer; font-size: 18px;
  display: grid; place-items: center; transition: var(--trans);
}
.modal-close:hover { border-color: var(--red); color: var(--red); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── PERFIL DE CONTATO ── */
.contact-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.contact-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--purple));
  display: grid; place-items: center; font-family: 'Syne', sans-serif;
  font-size: 20px; font-weight: 800; flex-shrink: 0;
}
.contact-info-name { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 18px; }
.contact-info-phone { color: var(--text2); font-size: 13px; margin-top: 2px; font-family: monospace; }
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 20px; }
.stat-mini {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; text-align: center;
}
.stat-mini-val { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800; color: var(--brand); }
.stat-mini-label { font-size: 11px; color: var(--text2); margin-top: 2px; }
.msg-timeline { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; padding: 4px; }
.msg-bubble {
  max-width: 80%; padding: 10px 14px; border-radius: 12px;
  font-size: 13px; line-height: 1.5;
}
.msg-bubble.entrada { background: var(--bg3); align-self: flex-start; border-radius: 4px 12px 12px 12px; }
.msg-bubble.saida { background: rgba(255,107,0,.15); border: 1px solid rgba(255,107,0,.2); align-self: flex-end; border-radius: 12px 4px 12px 12px; }
.msg-time { font-size: 10px; color: var(--text3); margin-top: 4px; }

/* ── STATUS PICKER ── */
.status-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.status-opt {
  padding: 6px 14px; border-radius: 99px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 2px solid transparent; transition: var(--trans);
}
.status-opt.selected { box-shadow: 0 0 0 2px var(--brand); }

/* ── USUARIOS ── */
.user-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.user-form .full { grid-column: 1/-1; }

/* ══════════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════════ */
#toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  padding: 14px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  background: var(--bg2); border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  transform: translateY(80px); opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.ok  { border-color: var(--green); color: var(--green); }
#toast.err { border-color: var(--red);   color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   LOADING
══════════════════════════════════════════════════════════════ */
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; justify-content: center; padding: 40px; }

/* ── período selector ── */
.period-pills { display: flex; gap: 6px; }
.period-pill {
  padding: 6px 14px; border-radius: 99px; font-size: 13px;
  background: var(--bg3); border: 1px solid var(--border);
  cursor: pointer; transition: var(--trans); color: var(--text2);
}
.period-pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ── empty state ── */
.empty-state { text-align: center; padding: 48px; color: var(--text3); }

/* ── Mídias no chat ── */
.chat-bubble img { max-width: 240px; max-height: 240px; border-radius: 8px; cursor: pointer; display: block; }
.chat-bubble video { max-width: 260px; border-radius: 8px; display: block; }
.chat-bubble audio { width: 220px; }
.chat-bubble img:hover { opacity: .9; }

/* ── Chat WhatsApp-style ── */
.chat-item {
  padding: 12px 16px; cursor: pointer; transition: var(--trans);
  border-bottom: 1px solid rgba(255,255,255,.03);
  display: flex; align-items: center; gap: 12px;
}
.chat-item:hover  { background: rgba(255,255,255,.04); }
.chat-item.active { background: rgba(255,107,0,.08); border-left: 3px solid var(--brand); }
.chat-avatar-sm {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--purple));
  display: grid; place-items: center;
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 16px;
}
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-preview { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-item-meta { text-align: right; flex-shrink: 0; }
.chat-item-time { font-size: 11px; color: var(--text3); }
.chat-item-badge {
  background: var(--brand); color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 99px; margin-top: 4px; display: inline-block;
}

.chat-bubble-wrap { display: flex; flex-direction: column; }
.chat-bubble-wrap.saida  { align-items: flex-end; }
.chat-bubble-wrap.entrada { align-items: flex-start; }
.chat-bubble {
  max-width: 72%; padding: 10px 14px; border-radius: 12px;
  font-size: 13px; line-height: 1.55; word-break: break-word;
  position: relative;
}
.chat-bubble.entrada {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 4px 12px 12px 12px;
}
.chat-bubble.saida {
  background: rgba(255,107,0,.18); border: 1px solid rgba(255,107,0,.25);
  border-radius: 12px 4px 12px 12px;
}
.chat-time { font-size: 10px; color: var(--text3); margin-top: 3px; padding: 0 2px; }
#chat-input-txt:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,107,0,.1); }
#btn-pausar-ia:hover:not(:disabled) { opacity: .8; }
#btn-pausar-ia:disabled { opacity: .5; cursor: not-allowed; }
#chat-send-btn:hover:not(:disabled) { background: var(--brand-l); transform: scale(1.05); }
.chat-date-sep {
  text-align: center; color: var(--text3); font-size: 11px;
  margin: 8px 0; position: relative;
}
.chat-date-sep::before, .chat-date-sep::after {
  content: ''; position: absolute; top: 50%; width: 30%;
  height: 1px; background: var(--border);
}
.chat-date-sep::before { left: 0; }
.chat-date-sep::after  { right: 0; }
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state-text { font-size: 15px; }

/* ── países ranking ── */
.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-item { display: flex; align-items: center; gap: 10px; }
.rank-pos { font-family: 'Syne', sans-serif; font-size: 12px; font-weight: 700; color: var(--text3); width: 20px; }
.rank-flag { font-size: 18px; }
.rank-label { flex: 1; font-size: 13px; }
.rank-bar-wrap { width: 80px; height: 6px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.rank-bar-fill { height: 100%; background: var(--brand); border-radius: 99px; transition: width .8s ease; }
.rank-val { font-size: 13px; font-weight: 600; width: 28px; text-align: right; }


/* ── ONBOARDING WIZARD ── */
.onb-stepper {
  display: flex; align-items: flex-start; padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border); gap: 0;
}
.onb-dot { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.onb-dot-circle {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg3); border: 2px solid var(--border);
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: var(--text3); position: relative; z-index: 1; transition: var(--trans);
}
.onb-dot-circle::after {
  content: ''; position: absolute; left: 100%; width: calc(((100vw / 6) - 28px)); height: 2px;
  background: var(--border); top: 50%; transform: translateY(-50%); z-index: 0; min-width: 20px;
}
.onb-dot:last-child .onb-dot-circle::after { display: none; }
.onb-dot.active .onb-dot-circle { background: var(--brand); border-color: var(--brand); color: #fff; }
.onb-dot.done   .onb-dot-circle { background: var(--green); border-color: var(--green); color: #fff; }
.onb-dot.done   .onb-dot-circle::after { background: var(--green); }
.onb-dot-label { font-size: 10px; color: var(--text3); text-align: center; white-space: nowrap; }
.onb-dot.active .onb-dot-label { color: var(--brand); font-weight: 600; }
.onb-dot.done   .onb-dot-label { color: var(--green); }
.onb-panel { display: none; }
.onb-panel.active { display: flex; flex-direction: column; gap: 14px; }
.onb-success-icon { font-size: 56px; text-align: center; }
