/* Maya Desk - Internal Clinic System v1.0 */

:root {
  --primary: #2563EB;
  --primary-light: #EFF6FF;
  --primary-dark: #1D4ED8;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --purple: #8B5CF6;
  --text: #0F172A;
  --text-light: #64748B;
  --bg: #F1F5F9;
  --white: #FFFFFF;
  --border: #E2E8F0;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.08);

  /* Status colors */
  --s-novo: #EF4444;
  --s-atendimento: #2563EB;
  --s-aguardando: #F59E0B;
  --s-finalizado: #10B981;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

/* ─── LOGIN SCREEN ─── */
.login-screen {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 100%);
}

.login-logo {
  color: white;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
}
.login-logo span { color: #60A5FA; }

.login-subtitle {
  color: #94A3B8;
  margin-bottom: 40px;
  font-size: 14px;
}

.conn-err {
  background: #FEE2E2;
  color: #DC2626;
  padding: 12px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 13px;
  text-align: center;
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.user-btn {
  width: 120px;
  height: 90px;
  border: 2px solid #334155;
  background: #1E293B;
  border-radius: 16px;
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.user-btn:hover, .user-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(37,99,235,0.3);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

.pin-panel {
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 20px;
  padding: 24px;
  width: 280px;
}

.pin-display {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #475569;
  transition: all 0.2s;
}
.pin-dot.filled { background: var(--primary); border-color: var(--primary); }

.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pin-key {
  height: 52px;
  background: #0F172A;
  border: 1px solid #334155;
  border-radius: 12px;
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.pin-key:hover { background: #334155; }
.pin-key.clear { color: var(--danger); font-size: 14px; }
.pin-key.enter { background: var(--primary); border-color: var(--primary); }

.login-error {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
}

/* ─── MAIN APP LAYOUT ─── */
.app-layout {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 220px;
  background: #0F172A;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
}

.sidebar-logo {
  font-size: 22px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}
.sidebar-logo span { color: #60A5FA; }

.sidebar-user {
  font-size: 12px;
  color: #64748B;
  margin-bottom: 32px;
}

.sidebar-middle {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-middle::-webkit-scrollbar { display: none; }

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li { margin-bottom: 4px; }

.sidebar-nav button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: #94A3B8;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-nav button:hover, .sidebar-nav button.active {
  background: #1E293B;
  color: white;
}

.sidebar-nav button.active { color: #60A5FA; }

.badge-count {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.badge-count.green { background: var(--success); }

.logout-btn {
  width: 100%;
  background: none;
  border: 1px solid #334155;
  color: #64748B;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 16px;
  transition: all 0.15s;
}
.logout-btn:hover { border-color: var(--danger); color: var(--danger); }

/* ── Kill switch global do bot ── */
.bot-kill-switch {
  width: 100%;
  background: none;
  border: 1px solid #334155;
  color: #64748B;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;
  text-align: center;
}
.bot-kill-switch:hover { border-color: #EA580C; color: #EA580C; background: #FFF7ED; }
.bot-kill-switch--paused {
  background: #FEE2E2;
  border-color: #EF4444;
  color: #B91C1C;
  animation: pulse-red 2s infinite;
}
.bot-kill-switch--paused:hover { background: #EF4444; color: #fff; }
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

.sidebar-ai-summary {
  font-size: 12px;
  line-height: 1.6;
  color: #CBD5E1;
  white-space: pre-wrap;
}

/* ─── SIDEBAR LEAD INFO ─── */
.sidebar-lead-info {
  margin: 12px 0 4px;
  padding: 10px 12px;
  background: #1E293B;
  border-radius: 8px;
  border: 1px solid #334155;
}

.sidebar-info-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #60A5FA;
  margin-bottom: 8px;
}

.sidebar-info-item {
  margin-bottom: 6px;
}

.sidebar-info-label {
  font-size: 10px;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.sidebar-info-value {
  font-size: 12px;
  font-weight: 500;
  color: #E2E8F0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── SIDEBAR NOTE ─── */
.sidebar-note-area { display: flex; flex-direction: column; }
.sidebar-note-input {
  width: 100%;
  background: #0F172A;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  color: #E2E8F0;
  resize: none;
  outline: none;
  min-height: 72px;
  line-height: 1.4;
}
.sidebar-note-input::placeholder { color: #475569; }
.sidebar-note-input:focus { border-color: #3B82F6; }

/* ─── WORKSPACE ─── */
.workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.leads-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.workspace-title {
  font-size: 18px;
  font-weight: 600;
  flex: 1;
}

.search-input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  width: 240px;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--primary); }

.filter-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  gap: 8px;
}

.filter-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.leads-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─── LEAD CARD ─── */
.lead-card {
  background: white;
  border-radius: 14px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 14px;
}

.lead-card:hover { border-color: var(--primary); transform: translateX(2px); }
.lead-card.selected { border-color: var(--primary); background: var(--primary-light); }
.lead-card.overdue { border-left: 4px solid var(--danger); }

.lead-priority-bar {
  width: 4px;
  height: 44px;
  border-radius: 2px;
  flex-shrink: 0;
}
.lead-priority-bar.Urgente { background: var(--danger); }
.lead-priority-bar.Importante { background: var(--warning); }
.lead-priority-bar.Normal { background: #CBD5E1; }

.lead-info { flex: 1; min-width: 0; }
.lead-name { font-size: 15px; font-weight: 600; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-meta { font-size: 12px; color: var(--text-light); display: flex; gap: 12px; }
.lead-time { font-size: 11px; color: #94A3B8; margin-top: 2px; }

.lead-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.badge-novo { background: #FEE2E2; color: #DC2626; }
.badge-atendimento { background: #DBEAFE; color: #1D4ED8; }
.badge-aguardando { background: #FEF3C7; color: #92400E; }
.badge-finalizado { background: #D1FAE5; color: #065F46; }
.badge-intent { background: var(--primary-light); color: var(--primary); }

.lead-timer { font-size: 12px; color: var(--text-light); white-space: nowrap; }
.lead-timer.urgent { color: var(--danger); font-weight: 600; }

/* ─── LEAD CARD 4-BLOCK GRID ─── */
.lead-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 2fr 1.1fr 2.2fr 1.5fr;
  gap: 0 14px;
  align-items: center;
  min-width: 0;
}
.lc-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.lc-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-phone { font-size: 11px; color: var(--text-light); }
.lc-date { font-size: 11px; color: #94A3B8; }
.lc-no-cat { font-size: 11px; color: #94A3B8; font-style: italic; }
.lc-intent-badge { font-size: 10px !important; padding: 2px 8px !important; }
.lc-urgency-tag { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; width: fit-content; }
.lc-urg-alta { background: #FEE2E2; color: #DC2626; }
.lc-urg-media { background: #FEF3C7; color: #92400E; }
.lc-obs-text {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lc-obs-empty { font-size: 11px; color: #CBD5E1; font-style: italic; }
.lc-operation { align-items: flex-start; }
.lc-assigned { font-size: 11px; color: var(--text-light); }

/* ─── DETAIL PANEL ─── */
.detail-panel {
  width: 720px;
  background: white;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.detail-header {
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--border);
}

.detail-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.detail-phone { font-size: 14px; color: var(--text-light); margin-bottom: 14px; }

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.detail-cat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}

.detail-assigned-chip {
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  color: var(--text-light);
  white-space: nowrap;
}

.btn {
  padding: 8px 14px;
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: #D1FAE5; color: #065F46; }
.btn-success:hover { background: var(--success); color: white; }
.btn-warning { background: #FEF3C7; color: #92400E; }
.btn-warning:hover { background: var(--warning); color: white; }
.btn-danger { background: #FEE2E2; color: #DC2626; }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-ghost { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-bot-pause { background: #FFF7ED; color: #C2410C; border: 1px solid #FDBA74; }
.btn-bot-pause:hover { background: #EA580C; color: white; }
.btn-bot-resume { background: #F0FDF4; color: #15803D; border: 1px solid #86EFAC; }
.btn-bot-resume:hover { background: #16A34A; color: white; }
.btn-new { background: #0F172A; color: white; padding: 8px 16px; display: flex; align-items: center; gap: 6px; }
.btn-new:hover { background: #1E293B; }

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.detail-columns {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border-top: 1px solid var(--border);
}

.detail-col-left {
  overflow-y: auto;
  padding: 20px 20px;
  border-right: 1px solid var(--border);
}

.detail-col-right {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.detail-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.detail-section:last-child { border-bottom: none; margin-bottom: 0; }

.detail-section h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-light);
  margin-bottom: 12px;
}

/* ─── Chat bubbles ─── */
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-bubble-wrap {
  display: flex;
}
.chat-bubble-wrap.patient { justify-content: flex-start; }
.chat-bubble-wrap.team    { justify-content: flex-end; }
.chat-bubble-wrap.bot     { justify-content: flex-end; }

.chat-bubble {
  max-width: 78%;
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.45;
}
.bubble-patient {
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.bubble-team {
  background: #DCF8C6;
  border-bottom-right-radius: 4px;
  color: #1a1a1a;
}
.bubble-bot {
  background: #e8f4fd;
  border-bottom-right-radius: 4px;
  color: #1a1a1a;
}
.badge-sup {
  background: #ff4d4f;
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-ext {
  background: #722ed1;
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.bubble-audio-badge {
  display: inline-block;
  background: #e6f4ff;
  color: #0958d9;
  border: 1px solid #91caff;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 4px;
}
.bubble-sender {
  font-size: 10px;
  font-weight: 700;
  color: #2d7a4f;
  margin-bottom: 2px;
}
.bubble-sender-bot {
  color: #1a6fa8;
}
.bubble-text {
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble-time {
  font-size: 10px;
  color: #888;
  margin-top: 4px;
  text-align: right;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-item {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 14px;
}
.detail-item .label { font-size: 11px; color: var(--text-light); }
.detail-item .value { font-size: 14px; font-weight: 600; margin-top: 3px; }

.ai-summary {
  background: var(--primary-light);
  border: 1px solid #BFDBFE;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #1E40AF;
}

/* History */
.history-item {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
}

.history-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 5px;
}

.history-content { flex: 1; }
.history-action { font-weight: 600; color: var(--text); }
.history-meta { color: var(--text-light); font-size: 12px; margin-top: 2px; }
.history-note {
  background: #FEF9C3;
  border-radius: 6px;
  padding: 6px 10px;
  color: #78350F;
  margin-top: 4px;
  font-size: 12px;
}

/* Note input */
.note-input-area {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.note-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  resize: none;
  outline: none;
  min-height: 96px;
  align-self: stretch;
  line-height: 1.4;
}
.note-input:focus { border-color: var(--primary); }

/* ─── FAST REPLIES ─── */
.fast-replies-toggle {
  width: 100%;
  background: var(--bg);
  border: none;
  border-top: 1px solid var(--border);
  padding: 10px 24px;
  text-align: left;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}
.fast-replies-toggle:hover { background: #E2E8F0; }
.fast-replies-list { padding: 12px 24px; max-height: 180px; overflow-y: auto; border-top: 1px solid var(--border); }
.reply-cat-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 6px;
  margin-top: 10px;
}
.reply-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}
.reply-item:hover { border-color: var(--primary); background: var(--primary-light); }
.reply-item-title { font-weight: 600; font-size: 13px; }
.reply-item-text { color: var(--text-light); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── SUGGESTED REPLIES ─── */
.suggested-replies-panel {
  padding: 14px 0;
  margin-bottom: 8px;
}
.suggested-replies-header { margin-bottom: 10px; }
.suggested-replies-title { font-size: 13px; font-weight: 700; color: var(--text); display: block; }
.suggested-replies-sub { font-size: 11px; color: var(--text-light); margin-top: 2px; display: block; }
.suggested-replies-list { display: flex; flex-direction: column; gap: 8px; }
.suggested-reply-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.suggested-reply-item:hover { border-color: var(--primary); background: var(--primary-light); }
.suggested-reply-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.suggested-reply-text {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.suggested-reply-action { font-size: 11px; color: var(--primary); margin-top: 6px; font-weight: 500; }

/* ─── FOLLOW-UP PANEL ─── */
.followup-panel {
  padding: 16px 20px;
  background: #FAFBFC;
}
.followup-header { margin-bottom: 10px; }
.followup-title { font-size: 14px; font-weight: 700; color: var(--text); }
.followup-subtitle { font-size: 12px; color: var(--text-light); margin-top: 2px; }

.followup-last {
  font-size: 12px;
  color: var(--text-light);
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.followup-count-badge {
  margin-left: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}

.followup-type-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.followup-type-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: white;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Outfit', sans-serif;
  white-space: nowrap;
  position: relative;
}
.followup-type-pill:hover { border-color: var(--primary); color: var(--primary); }
.followup-type-pill.active { border-color: var(--primary); background: var(--primary); color: white; }
.followup-type-pill.suggested:not(.active) { border-color: var(--primary); border-style: dashed; }
.followup-suggested-badge {
  font-size: 10px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 1px 5px;
  border-radius: 10px;
  margin-left: 4px;
}

.followup-type-desc {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 10px;
  padding-left: 2px;
}

.followup-warnings {
  background: #FFF8ED;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
}
.followup-warning-item {
  font-size: 12px;
  color: #92400E;
  margin-bottom: 4px;
}
.followup-warning-item:last-child { margin-bottom: 0; }

.followup-confirm {
  background: #FFF8ED;
  border: 1px solid var(--warning);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 10px;
}

.followup-message-area { margin-bottom: 10px; }
.followup-message-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-bottom: 6px;
}
.followup-message-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  min-height: 80px;
  transition: border 0.15s;
}
.followup-message-input:focus { outline: none; border-color: var(--primary); }

.followup-send-btn {
  width: 100%;
  justify-content: center;
  font-size: 14px;
  padding: 10px;
}

/* ─── METRICS DASHBOARD ─── */
.metrics-view {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.metrics-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.metrics-title { font-size: 22px; font-weight: 700; }
.metrics-period-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.period-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-light);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.period-btn:hover { border-color: var(--primary); color: var(--primary); }
.period-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.period-date-input {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  color: var(--text);
  background: var(--white);
}
.metrics-period-info {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 20px;
  padding: 6px 12px;
  background: var(--primary-light);
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

.metrics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.metric-card {
  background: white;
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: var(--card-shadow);
}

.metric-card p { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.metric-card h3 { font-size: 32px; font-weight: 700; line-height: 1; }
.metric-card.highlight { background: linear-gradient(135deg, var(--primary), #6366F1); color: white; }
.metric-card.highlight p { color: rgba(255,255,255,0.7); }

.user-metrics-table {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--card-shadow);
  overflow-x: auto;
  margin-bottom: 24px;
}

.user-metrics-table h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
}
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

.intent-bar {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--card-shadow);
}
.intent-bar h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.intent-bar-item { margin-bottom: 12px; }
.intent-bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; font-weight: 500; }
.intent-bar-track { background: var(--bg); border-radius: 4px; height: 8px; }
.intent-bar-fill { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--primary), #6366F1); transition: width 0.5s; }

/* ─── METRICS — SEÇÕES E NOVOS COMPONENTES ─── */
.metrics-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin: 28px 0 12px;
}

.metric-card.metric-alert {
  border: 1.5px solid var(--danger);
  background: #FFF5F5;
}

.metric-alert-label {
  font-size: 11px;
  color: var(--danger);
  font-weight: 600;
  margin-top: 6px;
}

.metrics-quality-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.quality-card {
  background: white;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--card-shadow);
}

.quality-label {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 6px;
}

.quality-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.quality-sub {
  font-size: 11px;
  color: var(--text-light);
}

.metrics-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal {
  background: white;
  border-radius: 20px;
  padding: 28px;
  width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.modal-field { margin-bottom: 14px; }
.modal-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.modal input, .modal select, .modal textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  outline: none;
  background: white;
}
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--primary); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ─── TOAST ─── */
@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #1E293B;
  color: white;
  padding: 14px 20px;
  border-radius: 12px;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  max-width: 320px;
  animation: slideIn 0.3s ease;
}

.toast-warning { background: #92400E; }
.toast-success { background: #065F46; }

/* ─── BUTTONS (extra) ─── */
.btn-doctoralia { background: #E8F5E9; color: #1B5E20; }
.btn-doctoralia:hover { background: #4CAF50; color: white; }

/* ─── UTILS ─── */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  gap: 8px;
}
.empty-state span { font-size: 48px; }

.loading { text-align: center; padding: 40px; color: var(--text-light); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── FINALIZAR MODAL ─── */
.finalizar-blocked {
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: 10px;
  padding: 14px;
  font-size: 13px;
  color: #92400E;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* ─── LEAD CARD: badge pronto ─── */
.badge-pronto {
  background: #D1FAE5;
  color: #065F46;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.lc-pronto-badge { margin-top: 4px; }

/* ─── LEAD CARD: bot pause alerts ─── */
.lc-pause-alert {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-pause-warning  { background: #FEF9C3; color: #854D0E; }
.lc-pause-danger   { background: #FED7AA; color: #9A3412; }
.lc-pause-critical { background: #FEE2E2; color: #B91C1C; }

/* borda lateral colorida no card conforme urgência da pausa */
.paused-warning  { border-left: 3px solid #EAB308 !important; }
.paused-danger   { border-left: 3px solid #F97316 !important; }
.paused-critical { border-left: 3px solid #DC2626 !important; animation: pulse-border 2s ease-in-out infinite; }

@keyframes pulse-border {
  0%, 100% { border-left-color: #DC2626; }
  50%       { border-left-color: #FCA5A5; }
}

/* ─── CONSULTATION AGENT PANEL ─── */
.cap-panel {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.cap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cap-title {
  font-size: 13px;
  font-weight: 700;
  color: #065F46;
}
.cap-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.cap-badge-pronto {
  background: #065F46;
  color: #fff;
}
.cap-badge-pending {
  background: #FEF3C7;
  color: #92400E;
}
.cap-summary {
  background: white;
  border: 1px solid #BBF7D0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.cap-summary-label {
  font-size: 10px;
  font-weight: 700;
  color: #065F46;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}
.cap-summary-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}
.cap-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cap-field {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
}
.cap-fl {
  font-size: 10px;
  font-weight: 700;
  color: #065F46;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  min-width: 64px;
  flex-shrink: 0;
}
.cap-fv {
  color: var(--text);
  line-height: 1.4;
}
.cap-id-confirmed { color: var(--success); font-weight: 600; }
.cap-id-failed    { color: var(--danger);  font-weight: 600; }
.cap-id-pending   { color: var(--warning); font-weight: 600; }
.cap-status-row {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-light);
  border-top: 1px solid #BBF7D0;
  padding-top: 8px;
}

/* ── Confirmations Tab ───────────────────────────────────────────────── */
.conf-tab { padding: 24px; width: 100%; overflow-y: auto; }
.conf-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.conf-title { font-size: 18px; font-weight: 700; color: #1a1a2e; }
.conf-summary { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; padding: 8px 12px; background: #f8f9fa; border-radius: 6px; border: 1px solid #e8e8e8; }
.conf-sum-item { font-size: 12px; font-weight: 600; padding: 2px 0; }
.conf-sum-pending   { color: #d48806; }
.conf-sum-confirmed { color: #389e0d; }
.conf-sum-cancelled { color: #cf1322; }
.conf-sum-reschedule { color: #531dab; }
.conf-table-wrap { overflow-x: auto; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.conf-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
.conf-th { background: #f0f2f5; padding: 9px 12px; text-align: left; font-weight: 600; color: #555; border-bottom: 2px solid #e0e0e0; white-space: nowrap; font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; }
.conf-td { padding: 9px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.conf-tr:hover td { background: #f6f8ff; }
.conf-name { font-weight: 600; color: #1a1a2e; white-space: nowrap; }
.conf-phone { color: #555; font-size: 12px; white-space: nowrap; }
.conf-time { font-weight: 700; color: #096dd9; white-space: nowrap; font-size: 14px; }
.conf-status-badge { padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.conf-win-sent { color: #389e0d; font-size: 11px; white-space: nowrap; }
.conf-win-overdue { color: #d46b08; font-size: 11px; font-weight: 600; }
.conf-win-scheduled { color: #096dd9; font-size: 11px; white-space: nowrap; }
.conf-win-empty { color: #ccc; font-size: 11px; }
.conf-reply { max-width: 220px; }
.conf-reply-text { font-style: italic; color: #595959; font-size: 12px; }
.conf-no-reply { color: #bbb; font-size: 11px; }
.conf-date-separator td { background: #e6f0ff; border-top: 2px solid #b3d0ff; border-bottom: 1px solid #c5d9f5; }
.conf-date-label { padding: 7px 14px; font-size: 12px; font-weight: 700; color: #1d4ed8; letter-spacing: 0.3px; text-transform: capitalize; }
.conf-view-toggle { display: flex; gap: 4px; background: #f0f2f5; border-radius: 6px; padding: 3px; }
.conf-view-btn { background: transparent; border: none; padding: 5px 12px; border-radius: 4px; font-size: 12px; font-weight: 600; color: #666; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.conf-view-btn:hover { background: #e0e0e0; color: #333; }
.conf-view-btn.active { background: #fff; color: #1a1a2e; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.conf-past-count { display: inline-flex; align-items: center; justify-content: center; background: #8c8c8c; color: #fff; border-radius: 10px; font-size: 10px; padding: 0 5px; min-width: 16px; height: 16px; margin-left: 4px; }

/* ── Cancellations Tab ── */
.canc-tab { padding: 24px; width: 100%; overflow-y: auto; }
.canc-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.canc-title { font-size: 18px; font-weight: 700; color: #1a1a2e; }
.canc-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.canc-table-wrap { overflow-x: auto; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.canc-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
.canc-th { background: #1a1a2e; color: #fff; padding: 10px 13px; text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: 0.03em; white-space: nowrap; }
.canc-td { padding: 10px 13px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.canc-tr:hover { background: #fff5f5; }
.canc-name { font-weight: 600; color: #1a1a2e; }
.canc-date { font-weight: 600; color: #1a1a2e; white-space: nowrap; }
.canc-spec { color: #666; font-size: 12px; }
