/* ============================================================
   VÓ DO CRÉDITO · DESIGN SYSTEM PROFISSIONAL
   Identidade alinhada ao site vodocredito.com.br
   brand-blue (#0B1F3A) + brand-green (#10b981)
   ============================================================ */

:root {
  /* Navy — cor principal (igual ao site) */
  --navy-900: #0B1F3A;
  --navy-800: #123A58;
  --navy-700: #1A4E77;
  --navy-600: #23618F;

  /* Verde esmeralda — acento (igual ao site) */
  --accent: #10b981;
  --accent-dark: #0d9f70;
  --accent-soft: rgba(16, 185, 129, 0.14);

  --warning: #f59e0b;
  --danger: #ef4444;

  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --line: #e6eaf1;
  --line-strong: #d6dde9;

  --ink: #0f172a;
  --ink-2: #3b4a5f;
  --ink-3: #6b7a8f;
  --ink-4: #94a3b8;

  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(15,23,42,.05);
  --shadow-md: 0 6px 18px rgba(15,23,42,.07);
  --shadow-lg: 0 16px 40px rgba(15,23,42,.13);
  --ring-green: 0 0 0 4px rgba(16,185,129,.16);
}

* { box-sizing: border-box; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

/* ============================ HEADER ============================ */
header {
  background:
    radial-gradient(1100px 300px at 0% 0%, rgba(16,185,129,.16), transparent 55%),
    radial-gradient(900px 280px at 100% 0%, rgba(35,108,143,.28), transparent 50%),
    linear-gradient(120deg, var(--navy-900) 0%, var(--navy-700) 62%, var(--navy-800) 100%);
  box-shadow: 0 8px 30px rgba(11,29,58,.32);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
header h1 { font-weight: 800; letter-spacing: -0.5px; }
.brand-mark {
  background: linear-gradient(145deg, rgba(16,185,129,.28), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 14px rgba(0,0,0,.18);
}
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(16,185,129,.16);
  border: 1px solid rgba(16,185,129,.4);
  color: #6ff0c4; font-size: 12px; font-weight: 700;
  padding: 6px 12px; border-radius: var(--r-pill);
  backdrop-filter: blur(6px);
}
.live-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.25);
  animation: pulse 1.8s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
.attendant-chip {
  display:flex; align-items:center; gap:10px;
  background: rgba(255,255,255,.97);
  color: var(--navy-900);
  padding: 6px 12px 6px 6px; border-radius: var(--r-pill);
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.attendant-chip .avatar { width:34px; height:34px; border-radius:50%; background:linear-gradient(135deg,var(--navy-700),var(--accent)); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; }
.attendant-chip .role { font-size:10px; text-transform:uppercase; letter-spacing:.5px; opacity:.6; line-height:1; }
.attendant-chip .who { font-size:13px; font-weight:700; line-height:1.2; }
#current-atendente-select {
  border:none; background:transparent; color:var(--navy-900);
  font-weight:600; font-size:13px; outline:none; cursor:pointer; padding:0;
}

/* ============================ SIDEBAR ============================ */
aside { background: var(--surface); border-right: 1px solid var(--line); overflow-y:auto; }
#sidebar-title { font-size: 15px; font-weight: 800; letter-spacing: -0.3px; }

/* NAVEGAÇÃO */
#show-dashboard-btn, #show-conversations-btn, #show-tasks-btn, #show-campaigns-btn,
#show-triagem-btn {
  color: var(--ink-2); font-weight:600;
  padding: 11px 14px; border-radius: var(--r-md);
  transition: all .18s ease; font-size: 14px;
  background: transparent; border:none; text-align:left;
  display:inline-flex; align-items:center; justify-content:center;
  box-shadow: none !important;
}
#show-dashboard-btn.active, #show-conversations-btn.active, #show-tasks-btn.active,
#show-campaigns-btn.active, #show-triagem-btn.active {
  background: linear-gradient(135deg, var(--navy-700), var(--accent-dark));
  color: #fff; box-shadow: 0 8px 22px rgba(11,130,92,.32);
}
#show-dashboard-btn:hover, #show-conversations-btn:hover, #show-tasks-btn:hover,
#show-campaigns-btn:hover, #show-triagem-btn:hover { color: var(--accent-dark); background: var(--surface-2); }

/* BUSCA E FILTROS */
#search-input:focus, #new-contact-number:focus, select:focus, textarea:focus,
.reply-wrap textarea:focus {
  outline:none; border-color: var(--accent);
  box-shadow: var(--ring-green);
}

/* ---- LISTA DE CONVERSAS ---- */
#conversations-list { display:flex; flex-direction:column; gap:8px; padding:12px; }
.conversation-item {
  padding: 0;
  margin: 0;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer; transition: all .18s ease;
  position: relative; overflow: hidden;
}
.conversation-item::before {
  content:''; position:absolute; left:0; top:0; bottom:0; width:3px;
  background: linear-gradient(180deg,var(--accent),var(--navy-700));
  opacity:0; transition:.2s;
}
.conversation-item:hover { border-color: var(--line-strong); transform: translateX(3px); box-shadow: var(--shadow-md); }
.conversation-item.active {
  background: linear-gradient(135deg, rgba(16,185,129,.12), rgba(11,31,58,.05));
  border-color: rgba(16,185,129,.45);
  box-shadow: 0 4px 14px rgba(16,185,129,.16);
}
.conversation-item.active::before { opacity: 1; }

.conv-item-main { display:flex; align-items:flex-start; gap:12px; padding:12px 14px; }
.conv-avatar {
  width:44px; height:44px; border-radius:50%; flex-shrink:0;
  background: linear-gradient(135deg, var(--navy-700), var(--accent));
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:14px;
  box-shadow: 0 2px 8px rgba(11,31,58,.25);
}
.conv-body { flex:1; min-width:0; }
.conv-top { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.conv-name { font-weight:700; font-size:13.5px; color: var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.conv-time { font-size:10px; color: var(--ink-4); flex-shrink:0; }
.conv-preview { font-size:12px; color: var(--ink-3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:2px; }
.conv-tags { display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; }
.conv-tag {
  font-size:10px; font-weight:600; padding:2px 8px; border-radius: var(--r-pill);
  background: rgba(16,185,129,.12); color: var(--accent-dark);
}
.conv-tag.stage { background: rgba(11,31,58,.07); color: var(--navy-700); }
.conv-status { flex-shrink:0; width:9px; height:9px; border-radius:50%; margin-top:5px; }
.conv-status.st-live { background:#34d399; box-shadow:0 0 0 3px rgba(52,211,153,.22); }
.conv-status.st-warning { background:#fbbf24; box-shadow:0 0 0 3px rgba(251,191,36,.22); }
.conv-status.st-bot { background:#a78bfa; box-shadow:0 0 0 3px rgba(167,139,250,.22); }
.conv-status.st-new { background:#60a5fa; box-shadow:0 0 0 3px rgba(96,165,250,.22); }
.conv-status.st-closed { background:#94a3b8; }
.conv-status.st-off { background:#cbd5e1; }
.conversation-item .active-indicator { width:6px; height:22px; border-radius:6px; background: transparent; }
.conversation-item.active .active-indicator { background: var(--accent); }

/* ============================ CONTEÚDO / CARDS ============================ */
#main-dashboard-view h2 {
  background: linear-gradient(135deg, var(--navy-900), var(--accent-dark));
  -webkit-background-clip:text; background-clip:text; color:transparent;
  font-weight:800; letter-spacing:-0.6px; font-size:1.9rem;
}
#main-dashboard-view h2 + p { color: var(--ink-3); }

/* ---- KPI ---- */
.kpi-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px;
  position: relative; overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease;
  box-shadow: var(--shadow-sm);
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.kpi-card .kpi-icon {
  width: 46px; height:46px; border-radius:12px; display:flex; align-items:center;
  justify-content:center; font-size:22px; margin-bottom:14px;
}
.kpi-card.primary .kpi-icon{ background:linear-gradient(135deg,#d1fae5,#e8fbf2); }
.kpi-card.success .kpi-icon{ background:linear-gradient(135deg,#d1fae5,#e8fbf2); }
.kpi-card.warning .kpi-icon{ background:linear-gradient(135deg,#fef3c7,#fffaeb); }
.kpi-card.danger  .kpi-icon{ background:linear-gradient(135deg,#fee2e2,#fef2f2); }
.kpi-label { color: var(--ink-3); font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.kpi-value { font-size: 2.3rem; font-weight: 800; letter-spacing:-1px; color: var(--ink); line-height:1; }
.kpi-change { font-size: .75rem; font-weight:600; }
.kpi-change.positive { color: var(--accent-dark); }
.kpi-change.negative { color: var(--danger); }

/* ---- CAMPANHAS (cards) ---- */
.campaign-grid {
  display:grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap:16px;
}
.campaign-card {
  background: var(--surface);
  border:1px solid var(--line);
  border-radius: var(--r-lg);
  padding:18px;
  box-shadow: var(--shadow-xs);
  transition: transform .2s ease, box-shadow .2s ease;
  display:flex; flex-direction:column; gap:10px;
}
.campaign-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(16,185,129,.3); }
.campaign-card-head {
  display:flex; justify-content:space-between; align-items:center;
}
.campaign-id {
  font-size:10px; font-weight:700; letter-spacing:.4px;
  background: rgba(16,185,129,.12); color: var(--accent-dark);
  padding:4px 10px; border-radius: var(--r-pill); text-transform:uppercase;
}
.campaign-date { font-size:11px; color: var(--ink-4); }
.campaign-name {
  font-size:16px; font-weight:700; color: var(--ink); letter-spacing:-.2px; line-height:1.3;
}
.campaign-msg {
  font-size:12.5px; color: var(--ink-3); line-height:1.5;
  min-height:38px;
}
.campaign-card-foot {
  display:flex; justify-content:space-between; align-items:center;
  padding-top:12px; border-top:1px solid var(--line);
  margin-top:auto;
}
.campaign-stat { font-size:12px; color: var(--ink-2); }
.campaign-stat strong { color: var(--accent-dark); }
.campaign-actions { display:flex; gap:12px; align-items:center; }

/* ---- CHART / TASKS ---- */
.chart-container, .tasks-container {
  background: var(--surface); border:1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-sm);
}
.chart-title { font-weight:700; color:var(--ink); font-size:15px; }
.chart-title::before { height:18px; background: var(--accent); outline:none; }

/* ---- TAREFAS ---- */
.task-item {
  background: var(--surface-2); border-left:4px solid var(--accent);
  border-radius: var(--r-md); transition:all .18s ease;
}
.task-item:hover { background: var(--surface); box-shadow: var(--shadow-sm); }

/* Cards de Tarefa (sidebar) */
#tasks-dashboard-list { display:flex; flex-direction:column; gap:10px; }
.task-card {
  display:flex; align-items:flex-start; gap:12px;
  background: var(--surface);
  border:1px solid var(--line);
  border-left:4px solid var(--accent);
  border-radius: var(--r-md);
  padding:12px 14px;
  box-shadow: var(--shadow-xs);
  transition: all .18s ease;
}
.task-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateX(3px); }
.task-check { margin-top:4px; accent-color: var(--accent); }
.task-title { font-size:13px; font-weight:600; color: var(--ink); line-height:1.3; margin-bottom:4px; }
.task-meta { font-size:11px; color: var(--ink-3); }
.task-link { color: var(--accent-dark); font-weight:600; text-decoration:none; }
.task-link:hover { text-decoration:underline; }
.task-due { color: var(--danger); font-weight:600; }
.task-badge {
  flex-shrink:0; font-size:10px; font-weight:700;
  background: rgba(239,68,68,.12); color: var(--danger);
  padding:4px 9px; border-radius: var(--r-pill); text-transform:uppercase; letter-spacing:.3px;
}

/* ============ CHAT (Dashboard) ============ */
#chat-panel { background: var(--surface); }
#chat-history { background: linear-gradient(180deg,#f0f3f8,#e9eef5); }
#chat-header { border-bottom:1px solid var(--line); }
#active-chat { background: var(--surface); }
#welcome-panel svg { color: rgba(16,185,129,.5); }
#reply-input {
  border:1px solid var(--line-strong); border-radius: var(--r-md);
  padding:12px 14px; box-shadow: var(--shadow-xs); resize:none;
}
#send-button { background: var(--accent); }
#send-button:hover { background: var(--accent-dark); }
#send-button, #correct-button, #pdf-upload + label {
  border-radius:10px; transition:transform .15s ease, background .15s ease;
}
#send-button:hover, #correct-button:hover { transform: translateY(-1px); }

/* ---- PAINEL DE INFORMAÇÕES DO CLIENTE ---- */
#customer-info-panel { background: var(--surface); border-left:1px solid var(--line); }
#info-avatar { box-shadow: var(--shadow-md); }
#info-name { font-weight:700; }

/* ============ MODAIS ============ */
#analytics-modal, #correction-modal { backdrop-filter:blur(3px); }
#analytics-modal .relative, #correction-modal .relative {
  background:var(--surface); border-radius:var(--r-lg); box-shadow:var(--shadow-lg); border:none;
}
#analytics-modal h3, #correction-modal h3 { font-weight:800; }
#accept-send-btn { background: var(--accent); }
#accept-send-btn:hover { background: var(--accent-dark); }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width:9px; height:9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(16,185,129,.45); border-radius:9px; border:2px solid transparent; background-clip:content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip:content-box; }

/* ============ RESPONSIVO ============ */
@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-value { font-size: 1.9rem; }
}