/* ═══════════════════════════════════════════════════════════
   DaVinci — Enterprise Academic Design System
   Modo Escuro (Padrão) & Modo Claro + Glassmorphism Premium
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Dark Theme Tokens (Default) */
  --bg-base: #080c15;
  --bg-surface: #0e1424;
  --bg-card: rgba(16, 23, 41, 0.75);
  --bg-card-hover: rgba(24, 34, 58, 0.9);
  --bg-input: #0b101d;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-indigo: #6366f1;
  --accent-indigo-hover: #4f46e5;
  --accent-cyan: #06b6d4;
  --accent-cyan-hover: #0891b2;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

[data-theme="light"] {
  /* Light Theme Tokens */
  --bg-base: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: #ffffff;
  --bg-input: #f8fafc;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #4f46e5;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* ─── RESET & TIPOGRAFIA ───────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
}

a {
  color: var(--accent-indigo);
  text-decoration: none;
}

/* Scrollbar Elegante */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-indigo);
}

/* ─── COMPONENTES GLASS & PAINÉIS ──────────────────────────── */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ─── SISTEMA DE ESPAÇAMENTO & ANTI-COLISÃO DE QUADRANTES ──── */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 2rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 2rem !important; }

.my-1 { margin-top: 0.25rem !important; margin-bottom: 0.25rem !important; }
.my-2 { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; }
.my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.my-5 { margin-top: 2rem !important; margin-bottom: 2rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }

.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

/* ─── 1. TELA DE LOGIN ─────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.login-background-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(6, 182, 212, 0.15) 45%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.login-card {
  width: 100%;
  max-width: 450px;
  padding: 40px;
  position: relative;
  z-index: 1;
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.brand-orb {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
  margin-bottom: 14px;
}

.login-brand h2 {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.brand-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.code-editor-area {
  width: 100%;
  padding: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Fira Code', monospace;
  font-size: 0.86rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

.code-editor-area:focus {
  border-color: var(--border-focus);
}

/* ─── BOTÕES ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: 4px;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 0.95rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-indigo), #4f46e5);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-primary);
}

.btn-emerald {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #ffffff;
}

.btn-outline-primary {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--accent-indigo);
}
.btn-outline-primary:hover {
  background: rgba(99, 102, 241, 0.2);
}

.btn-outline-cyan {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.35);
  color: var(--accent-cyan);
}
.btn-outline-cyan:hover {
  background: rgba(6, 182, 212, 0.2);
}

.btn-outline-indigo {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--accent-indigo);
}
.btn-outline-rose {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.35);
  color: var(--accent-rose);
}
.btn-outline-rose:hover {
  background: rgba(244, 63, 94, 0.22);
  border-color: var(--accent-rose);
  color: #ffffff;
}

.demo-profiles-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.divider-text {
  text-align: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.demo-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-demo-pill {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-demo-pill:hover {
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
}

/* ─── 2. ESTRUTURA PRINCIPAL (COMMAND CENTER) ──────────────── */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* NAVBAR SUPERIOR */
.navbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  z-index: 50;
  height: 62px;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
}

.brand-title h1 {
  font-size: 1.15rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-version {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo);
  text-transform: uppercase;
}

.brand-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: block;
}

.system-status-indicators {
  display: flex;
  gap: 10px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald);
  transition: all 0.2s ease;
}

.status-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.status-pill.green {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #10b981;
}
.status-pill.green .status-bullet {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.status-pill.yellow {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}
.status-pill.yellow .status-bullet {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.status-pill.red {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}
.status-pill.red .status-bullet {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.status-pill.blue {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: #3b82f6;
}
.status-pill.blue .status-bullet {
  background: #3b82f6;
  box-shadow: 0 0 8px #3b82f6;
}

.status-pill.gray {
  background: rgba(156, 163, 175, 0.12);
  border-color: rgba(156, 163, 175, 0.3);
  color: #9ca3af;
}
.status-pill.gray .status-bullet {
  background: #9ca3af;
  box-shadow: 0 0 6px #9ca3af;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-icon-circle:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 4px 10px 4px 6px;
  border-radius: 30px;
  max-width: 230px;
  min-width: 0;
  flex-shrink: 0;
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-indigo), #8b5cf6);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-profile-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  justify-content: center;
}

.user-name-text {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 135px;
  line-height: 1.2;
}

.user-role-badge {
  font-size: 0.62rem;
  color: var(--accent-cyan);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 135px;
  line-height: 1.2;
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 4px;
  margin-left: 2px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.btn-logout:hover {
  color: var(--accent-rose);
}

/* SUB-NAVBAR TABS */
.sub-navbar-tabs {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 6px 24px;
}

.tabs-scroll-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.tab-button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-button:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.tab-button.active {
  background: var(--accent-indigo);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.tab-counter {
  background: var(--accent-amber);
  color: #000000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
}

/* ÁREA DE CONTEÚDO PRINCIPAL */
.main-body-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  position: relative;
}

.tab-section {
  display: none;
  min-height: 100%;
  box-sizing: border-box;
}
.tab-section.active {
  display: block;
}

/* ─── ABA 1: WORKBENCH DO LIVE CHAT (ESTILO ARIA CRM) ──────── */
.chat-layout {
  display: grid;
  grid-template-columns: 380px 1fr 340px;
  height: calc(100vh - 128px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
}

.chat-sidebar {
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-surface);
}

.sidebar-header {
  padding: 14px 14px 12px 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-surface);
}

.sidebar-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.whatsapp-icon-glow {
  font-size: 1.25rem;
  color: #22c55e;
  filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.45));
}

.sidebar-brand-title h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.chat-count-badge {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #22c55e;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chat-search-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.84rem;
  transition: all 0.2s ease;
}

.chat-search-mini:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.chat-search-mini i {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.chat-search-mini input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  font-size: 0.82rem;
  font-family: inherit;
}

/* 5 FILTROS PROPORCIONAIS SEM CORTAR */
.chat-filter-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
}

.filter-tab-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.69rem;
  font-weight: 600;
  padding: 6px 2px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-tab-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.16);
}

.filter-tab-btn.active {
  background: var(--accent-indigo);
  border-color: var(--accent-indigo);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* LISTA DE CONVERSAS / CANDIDATOS */
.chat-candidate-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.loading-state-cell {
  padding: 30px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.chat-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s ease, border-left-color 0.2s ease;
  border-left: 3px solid transparent;
}
.chat-item:hover {
  background-color: var(--bg-card-hover);
}
.chat-item.active {
  background-color: var(--bg-card-hover);
  border-left: 3px solid var(--accent-indigo);
}
.chat-item.risk {
  border-left: 3px solid var(--accent-rose);
  background: rgba(244, 63, 94, 0.06);
}

.chat-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.chat-item-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}
.chat-item-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chat-item-course {
  font-size: 0.78rem;
  color: var(--accent-indigo);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.chat-item-snippet {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-item-badges {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* JANELA PRINCIPAL DO CHAT */
.chat-window {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-surface);
}

.empty-chat-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}
.empty-chat-state h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}
.empty-chat-state p {
  font-size: 0.85rem;
  max-width: 420px;
  line-height: 1.5;
}

.chat-active-window {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: var(--bg-surface);
  gap: 8px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.btn-back-to-list {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.btn-back-to-list:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-indigo);
}

.dossier-toggle-btn {
  display: none;
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.chat-user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.chat-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-user-details h4 {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: var(--text-primary);
}
.chat-user-details p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.chat-actions-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.status-mode-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-outline-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--accent-amber);
}
.btn-outline-warning:hover {
  background: rgba(245, 158, 11, 0.2);
}

/* BANNER DE RESUMO DA IA */
.ai-summary-bar {
  background: rgba(6, 182, 212, 0.08);
  border-bottom: 1px solid rgba(6, 182, 212, 0.2);
  padding: 8px 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  line-height: 1.4;
  width: 100%;
  box-sizing: border-box;
}
.ai-badge-label {
  color: var(--accent-cyan);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}
.ai-badge-content {
  color: var(--text-primary);
  font-size: 0.8rem;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

/* FLUXO DE MENSAGENS */
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-bubble {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}
.msg-bubble.inbound {
  align-self: flex-start;
}
.msg-bubble.outbound {
  align-self: flex-end;
}
.msg-bubble.ai {
  align-self: flex-start;
  max-width: 80%;
}

.msg-bubble-content {
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}

.msg-bubble.inbound .msg-bubble-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px 14px 14px 2px;
}

.msg-bubble.outbound .msg-bubble-content {
  background: linear-gradient(135deg, var(--accent-indigo), #4f46e5);
  color: #ffffff;
  border-radius: 14px 14px 2px 14px;
  box-shadow: 0 3px 12px rgba(99, 102, 241, 0.25);
}

.msg-bubble.ai .msg-bubble-content {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 14px 14px 14px 2px;
}

.msg-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.msg-bubble.outbound .msg-meta {
  justify-content: flex-end;
}

/* RODAPÉ E BARRA DE ENVIO */
.chat-input-bar {
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.chat-macros-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}
.macro-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}
.macro-chip {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.macro-chip:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.chat-input-row input {
  flex: 1;
  padding: 11px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input-row input:focus {
  border-color: var(--border-focus);
}

/* PAINEL LATERAL DIREITO - DETALHES DO ALUNO */
.chat-lead-info-panel {
  border-left: 1px solid var(--border-color);
  background: var(--bg-surface);
  padding: 20px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lead-panel-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.lead-profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.lead-avatar-big {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  box-shadow: var(--shadow-glow);
}

.lead-profile-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.lead-profile-phone {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.lead-info-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.84rem;
}

.lead-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lead-info-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}
.lead-info-value {
  font-weight: 600;
  color: var(--text-primary);
}


.btn-send-message {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--accent-indigo);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
  transition: all 0.2s;
}
.btn-send-message:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
}

/* COLUNA 3: PRONTUÁRIO */
.chat-lead-info-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  overflow: hidden;
}

.dossier-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.dossier-header-title {
  font-size: 0.84rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  white-space: nowrap;
}

.btn-close-dossier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-close-dossier:hover {
  background: var(--accent-indigo);
  color: #ffffff;
  border-color: var(--accent-indigo);
}

.dossier-content-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.dossier-scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.dossier-info-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 14px;
}

.dossier-row {
  margin-bottom: 8px;
}
.dossier-row:last-child {
  margin-bottom: 0;
}
.dossier-row label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}
.dossier-row strong {
  font-size: 0.84rem;
}

.internal-notes-stream {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.note-item-bubble {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--accent-amber);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  transition: all 0.15s ease;
}
.note-item-bubble:hover {
  background: rgba(245, 158, 11, 0.14);
}

.note-item-content {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  line-height: 1.35;
}

.note-item-actions {
  display: flex;
  gap: 3px;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}
.note-item-bubble:hover .note-item-actions {
  opacity: 1;
}

.btn-note-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.72rem;
  padding: 2px 5px;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.btn-note-action:hover {
  color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.15);
}
.btn-note-action.danger:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.15);
}

.empty-dossier-msg {
  text-align: center;
  padding: 40px 10px;
  color: var(--text-muted);
}
.empty-dossier-msg i {
  font-size: 2.5rem;
  opacity: 0.3;
  margin-bottom: 10px;
}

/* ─── ABA 2: DASHBOARD & MÉTRICAS ──────────────────────────── */
.dashboard-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
  width: 100%;
}

.kpi-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.kpi-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(99, 102, 241, 0.35);
}

.kpi-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.kpi-box.indigo .kpi-icon-circle { background: rgba(99, 102, 241, 0.12); color: var(--accent-indigo); }
.kpi-box.cyan .kpi-icon-circle { background: rgba(6, 182, 212, 0.12); color: var(--accent-cyan); }
.kpi-box.emerald .kpi-icon-circle { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); }
.kpi-box.rose .kpi-icon-circle { background: rgba(244, 63, 94, 0.12); color: var(--accent-rose); }

.kpi-content {
  min-width: 0;
  overflow: hidden;
}

.kpi-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.kpi-content h2 {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 2px 0;
  white-space: nowrap;
}
.kpi-subtitle {
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.kpi-subtitle.positive { color: var(--accent-emerald); }

.dashboard-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 24px;
}

.chart-card {
  padding: 20px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.chart-header {
  margin-bottom: 8px;
}
.chart-header h3 {
  font-size: 0.95rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chart-canvas-container {
  position: relative;
  height: 320px;
  min-height: 280px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 14px;
}
.chart-canvas-container canvas {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
}

/* ─── TABELAS DE DADOS (RELATÓRIOS, ALUNOS, BACKUPS) ───────── */
.section-container {
  max-width: 1400px;
  margin: 0 auto;
}

.section-topbar {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.section-topbar h2 {
  font-size: 1.3rem;
  margin-bottom: 2px;
}
.section-topbar p {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.section-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.students-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-card {
  padding: 20px 24px;
  margin-bottom: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.table-card-header {
  margin-bottom: 12px;
}
.table-card-header h3 {
  font-size: 0.95rem;
}

.responsive-table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.data-table th {
  text-align: left;
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.data-table tr:hover td {
  background: rgba(148, 163, 184, 0.04);
}

.text-right {
  text-align: right;
}

/* ─── SPOTLIGHT CARDS & BANNERS ─────────────────────────────── */
.backup-spotlight-card,
.spotlight-banner {
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(135deg, rgba(16, 23, 41, 0.9), rgba(30, 27, 75, 0.4));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.spotlight-content {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 260px;
}

.spotlight-shield-icon {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.spotlight-content h2 {
  font-size: 1.25rem;
  margin-bottom: 4px;
  font-weight: 700;
  color: var(--text-primary);
}
.spotlight-content p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.spotlight-action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ─── NAVEGAÇÃO SEGMENTADA DE SUB-ABAS (COORDINATORS / COURSES) ─── */
.segmented-nav-tabs {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: 10px;
  gap: 6px;
  margin-bottom: 16px;
}

.segmented-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.segmented-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.segmented-tab-btn.active {
  background: var(--accent-indigo);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.working-hours-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wh-days {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.wh-time {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─── CÉREBRO DA IA GRID ───────────────────────────────────── */
.ai-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.card-box {
  padding: 24px;
}
.card-box-header {
  margin-bottom: 4px;
}
.card-box-header.space-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.kb-topics-stream {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
}

.kb-topic-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.kb-topic-card h5 {
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.kb-topic-card p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ─── MODAL CUSTOMIZADO ───────────────────────────────────── */
.custom-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.custom-modal-dialog {
  width: 100%;
  max-width: 750px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.modal-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.modal-dialog-body {
  flex: 1;
  overflow-y: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}

.modal-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  margin-top: 16px;
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}
.btn-modal-close:hover {
  color: var(--accent-rose);
}

/* ─── TOAST NOTIFICATIONS ─────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast.success { border-left: 3px solid var(--accent-emerald); }
.toast.error { border-left: 3px solid var(--accent-rose); }
.toast.info { border-left: 3px solid var(--accent-cyan); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── RESPONSIVIDADE COMPLETA MULTI-DISPOSITIVOS ─────────────── */

/* 0. Telas Compactas / Laptops com tela dividida (<= 1360px) */
@media (max-width: 1360px) {
  .status-pill-responsive {
    display: none !important;
  }
  .btn-text-responsive {
    display: none !important;
  }
  .spotlight-btn-text, .spotlight-kbd {
    display: none !important;
  }
  .btn-spotlight-trigger {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
}

/* 0.5 Telas Intermediárias (<= 1100px) */
@media (max-width: 1100px) {
  .user-profile-details {
    display: none !important;
  }
  .user-profile-widget {
    padding: 4px;
    gap: 4px;
  }
}

/* 1. Telas Médias / Laptops / Tablets em Paisagem (769px a 1180px) */
@media (max-width: 1180px) {
  .system-status-indicators {
    display: none !important;
  }
  .brand-desc {
    display: none !important;
  }

  .chat-layout {
    grid-template-columns: 340px 1fr !important;
    position: relative;
  }
  
  .chat-lead-info-panel {
    display: none;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 340px;
    z-index: 50;
    background: var(--bg-surface);
    box-shadow: -6px 0 25px rgba(0, 0, 0, 0.45);
    border-left: 1px solid var(--border-color);
  }

  .chat-layout.dossier-drawer-open .chat-lead-info-panel {
    display: flex !important;
  }

  .dossier-toggle-btn {
    display: inline-flex !important;
  }

  .kpi-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
  }
  
  .dashboard-charts-grid, .ai-editor-grid {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    gap: 14px !important;
  }

  .chart-canvas-container {
    height: 260px !important;
    width: 100% !important;
  }
}

/* 2. Telas Pequenas / Celulares / Smartphones (<= 768px) */
@media (max-width: 768px) {
  .navbar-top {
    padding: 8px 12px;
    gap: 8px;
    justify-content: space-between;
  }

  .navbar-brand {
    gap: 8px;
  }
  .navbar-brand .logo-box {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .navbar-brand h1 {
    font-size: 1rem;
  }
  .badge-version,
  .brand-desc {
    display: none !important;
  }

  /* Mantém o botão de alternar tema e busca visíveis em smartphones verticais */
  #btn-theme-toggle {
    display: inline-flex !important;
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
  }

  /* Para coordenadores, mantém o pill 'Conexão: OK' visível e compacto no cabeçalho */
  body.coordinator-mode .system-status-indicators {
    display: flex !important;
  }
  body.coordinator-mode #coordinator-status-indicator {
    display: flex !important;
  }
  body.coordinator-mode #admin-status-indicators {
    display: none !important;
  }

  .user-profile-details,
  .profile-dropdown-caret {
    display: none !important;
  }
  .user-profile-widget {
    padding: 2px;
    background: transparent;
    border: none;
  }
  .btn-mobile-nav-toggle {
    display: inline-flex !important;
  }

  /* Oculta abas desktop e ativa barra inferior mobile */
  .desktop-tabs {
    display: none !important;
  }

  .bottom-nav-bar {
    display: flex !important;
    padding-bottom: env(safe-area-inset-bottom, 0);
    height: calc(56px + env(safe-area-inset-bottom, 0));
  }

  .main-body-container {
    padding: 10px 10px calc(76px + env(safe-area-inset-bottom, 0)) 10px !important;
    min-height: calc(100dvh - 56px);
  }

  .main-content {
    padding: 4px;
  }

  /* ─── CHAT AO VIVO MOBILE (ESTILO WHATSAPP NATIVO) ────────── */
  .chat-layout {
    display: flex !important;
    flex-direction: column;
    height: calc(100dvh - 128px) !important;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
  }

  /* Quando na lista de conversas: ocupa 100% */
  .chat-layout:not(.mobile-chat-open) .chat-sidebar {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    border-right: none;
  }
  .chat-layout:not(.mobile-chat-open) .chat-window {
    display: none !important;
  }
  .chat-layout:not(.mobile-chat-open) .chat-lead-info-panel {
    display: none !important;
  }

  /* Quando abre uma conversa: chat ocupa 100% */
  .chat-layout.mobile-chat-open .chat-sidebar {
    display: none !important;
  }
  .chat-layout.mobile-chat-open .chat-window {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
  }

  /* Botão Voltar para a lista no chat */
  .btn-back-to-list {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-right: 4px;
    cursor: pointer;
    flex-shrink: 0;
  }

  .chat-header {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
  }
  .chat-header-left {
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
    max-width: 100%;
  }
  .chat-user-avatar {
    width: 38px;
    height: 38px;
    font-size: 1rem;
    flex-shrink: 0;
  }
  .chat-user-details h4 {
    font-size: 0.9rem;
    font-weight: 700;
  }
  .chat-user-details p {
    font-size: 0.72rem;
    color: var(--text-secondary);
  }

  .chat-actions-header {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: auto;
  }
  
  /* Mantém botões de ação e status com textos visíveis no mobile vertical */
  .chat-actions-header .btn {
    padding: 6px 11px !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
  }
  .btn-text-responsive {
    display: inline !important; /* TEXTOS NÃO FICAM ESCONDIDOS NO MODO VERTICAL */
  }
  .status-pill-responsive {
    display: inline-flex !important;
    font-size: 0.7rem !important;
    padding: 3px 8px !important;
  }

  .dossier-toggle-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 12px !important;
    background: rgba(6, 182, 212, 0.14) !important;
    border: 1px solid rgba(6, 182, 212, 0.45) !important;
    color: var(--accent-cyan) !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.15) !important;
  }

  /* Painel de Prontuário desliza em tela cheia no mobile */
  .chat-lead-info-panel {
    display: none;
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 100;
    background: var(--bg-surface);
    overflow-y: auto;
    animation: slideRightMobile 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .chat-layout.mobile-chat-open.dossier-drawer-open .chat-lead-info-panel {
    display: flex !important;
    flex-direction: column;
  }

  .btn-close-dossier {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--accent-cyan);
    cursor: pointer;
  }

  /* Mensagens e balões adaptados para toque */
  .chat-messages {
    padding: 10px;
    gap: 8px;
  }
  .message-bubble {
    max-width: 88% !important;
    padding: 8px 12px;
    font-size: 0.84rem;
  }

  /* Barra de envio e macros */
  .chat-input-bar {
    padding: 6px 8px;
    gap: 6px;
  }
  .chat-macros-bar {
    margin-bottom: 2px;
  }
  .quick-macros-chips {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    flex-wrap: nowrap;
  }
  .macro-chip {
    flex-shrink: 0;
    font-size: 0.72rem;
    padding: 2px 7px;
  }

  .chat-input-row {
    padding: 4px 6px;
    gap: 6px;
  }
  .chat-input-row input {
    font-size: 16px; /* Evita zoom automático no iOS Safari */
    padding: 8px 10px;
  }
  .btn-chat-addon {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
    flex-shrink: 0;
  }
  #btn-send-msg {
    padding: 0 14px !important;
    min-width: 42px !important;
    height: 36px !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  #btn-send-msg .btn-send-label {
    display: none !important; /* Mostra apenas o ícone de avião de papel no mobile para não espremer o input */
  }

  /* Barra de gravação de áudio no mobile */
  .audio-recorder-bar {
    padding: 4px 8px;
    gap: 6px;
  }
  .rec-time-display {
    font-size: 0.82rem;
  }

  /* Dropdown de Notificações adaptado */
  .notifications-dropdown {
    width: 320px;
    max-width: 90vw;
    right: -40px;
  }

  /* Modais e Diálogos no Mobile */
  .custom-modal-dialog {
    width: 96% !important;
    max-width: 96% !important;
    margin: 8px auto !important;
    max-height: 92vh !important;
    border-radius: 12px;
  }
  .doc-sheet-dialog,
  .file-preview-dialog,
  .transfer-dialog,
  .macros-manager-dialog {
    width: 96% !important;
    max-width: 96% !important;
  }

  /* Seletor de Decisão do Parecer em 2 colunas no mobile */
  .parecer-decision-selector {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .decision-radio-card {
    padding: 8px;
  }
  .decision-radio-card strong {
    font-size: 0.76rem;
  }
  .decision-radio-card span {
    font-size: 0.65rem;
  }

  .official-letterhead-sheet {
    padding: 20px 16px;
  }
  .letterhead-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .letterhead-badge {
    text-align: left;
  }
  .letterhead-signature-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* Dashboard / Métricas no Mobile — Anti-Colisão de Quadrantes */
  .dashboard-wrapper,
  .section-container,
  .content-container {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .kpi-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
  }
  .kpi-box {
    padding: 14px 12px !important;
    gap: 10px !important;
    border-radius: var(--radius-md) !important;
  }
  .kpi-icon-circle {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.15rem !important;
  }
  .kpi-content h2 {
    font-size: 1.3rem !important;
    font-weight: 700 !important;
  }
  .kpi-title {
    font-size: 0.68rem !important;
  }
  .kpi-subtitle {
    font-size: 0.68rem !important;
  }

  .dashboard-charts-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    margin-bottom: 24px !important;
  }

  .chart-card {
    padding: 16px 14px !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 18px !important;
    overflow: visible !important;
  }

  .chart-canvas-container {
    height: 280px !important;
    min-height: 240px !important;
    overflow: visible !important;
    margin-top: 10px !important;
  }

  .section-topbar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 16px 18px !important;
    margin-bottom: 20px !important;
    border-radius: var(--radius-md) !important;
  }
  
  .section-actions-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    width: 100% !important;
    gap: 8px !important;
  }
  .section-actions-row .btn {
    width: 100% !important;
    justify-content: center !important;
    font-size: 0.78rem !important;
    padding: 8px 10px !important;
  }

  .students-actions-row {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }
  .students-actions-row .search-input-box {
    width: 100% !important;
    max-width: 100% !important;
  }

  .table-card {
    padding: 16px 14px !important;
    margin-bottom: 20px !important;
    border-radius: var(--radius-md) !important;
  }

  /* Garante que tabelas no celular tenham coluna de ações sempre visível e com scroll suave */
  .responsive-table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 8px !important;
  }
  .data-table th,
  .data-table td {
    padding: 10px 12px !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
  }
  .data-table td.text-right,
  .data-table th.text-right {
    position: sticky !important;
    right: 0 !important;
    background: var(--bg-card) !important;
    box-shadow: -4px 0 8px rgba(0, 0, 0, 0.25) !important;
    z-index: 2 !important;
  }

  /* Spotlight Banner Responsivo */
  .spotlight-banner,
  .backup-spotlight-card {
    padding: 18px 16px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
    margin-bottom: 20px !important;
    border-radius: var(--radius-md) !important;
  }
  .spotlight-banner .spotlight-content,
  .backup-spotlight-card .spotlight-content {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .spotlight-banner .spotlight-action,
  .backup-spotlight-card .spotlight-action {
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
  }
  .spotlight-banner .spotlight-action button,
  .backup-spotlight-card .spotlight-action button {
    flex: 1 !important;
    min-width: 130px !important;
    font-size: 0.82rem !important;
    padding: 8px 12px !important;
    justify-content: center !important;
  }

  /* Navegação Segmentada Responsiva */
  .segmented-nav-tabs {
    width: 100% !important;
    display: flex !important;
    margin-bottom: 16px !important;
  }
  .segmented-tab-btn {
    flex: 1 !important;
    justify-content: center !important;
    padding: 8px 10px !important;
    font-size: 0.78rem !important;
  }
}

/* 3. Smartphones Ultra-Compactos (<= 480px) */
@media (max-width: 480px) {
  .section-actions-row {
    grid-template-columns: 1fr !important;
  }
  .parecer-decision-selector {
    grid-template-columns: 1fr;
  }
  .sidebar-segmented-controls {
    gap: 2px;
  }
  .filter-tab-btn {
    padding: 4px 6px;
    font-size: 0.68rem;
  }
}

@media (max-width: 360px) {
  .kpi-cards-grid {
    grid-template-columns: 1fr !important;
  }
}

@keyframes slideRightMobile {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* ═════════════════════════════════════════════════════════════ */
/* 1. SPOTLIGHT GLOBAL SEARCH (CTRL + K)                         */
/* ═════════════════════════════════════════════════════════════ */
.btn-spotlight-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-spotlight-trigger:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent-indigo);
}
.spotlight-kbd {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-family: inherit;
  padding: 2px 6px;
  border-radius: 4px;
}

.spotlight-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  animation: fadeIn 0.2s ease;
}

.spotlight-dialog {
  width: 100%;
  max-width: 620px;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.spotlight-input-bar {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
}
.spotlight-search-icon {
  font-size: 1.1rem;
  color: var(--accent-indigo);
}
.spotlight-input-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.05rem;
  outline: none;
  font-family: inherit;
}
.spotlight-esc-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
}

.spotlight-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spotlight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-primary);
}
.spotlight-item:hover, .spotlight-item.active {
  background: rgba(99, 102, 241, 0.15);
  border-left: 3px solid var(--accent-indigo);
}
.spotlight-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.spotlight-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  color: var(--accent-cyan);
  font-size: 0.85rem;
}
.spotlight-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.spotlight-item-sub {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.spotlight-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.spotlight-tips {
  display: flex;
  gap: 12px;
}
.spotlight-tips kbd {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.65rem;
}
.spotlight-brand {
  font-weight: 700;
  color: var(--accent-indigo);
}

/* ═════════════════════════════════════════════════════════════ */
/* 2. POPUP FLUTUANTE DE AUTOCOMPLETE DE MACROS (TYPEAHEAD)     */
/* ═════════════════════════════════════════════════════════════ */
.macro-typeahead-popup {
  position: absolute;
  bottom: 85px;
  left: 18px;
  right: 18px;
  max-width: 520px;
  background: var(--bg-surface);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 12px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.15);
  overflow: hidden;
  z-index: 100;
  animation: slideUp 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.macro-typeahead-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: rgba(99, 102, 241, 0.08);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 700;
}
.typeahead-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: normal;
}

.macro-typeahead-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.macro-typeahead-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.macro-typeahead-item:hover, .macro-typeahead-item.active {
  background: var(--accent-indigo);
  color: #ffffff !important;
}
.macro-typeahead-item:hover .macro-code, .macro-typeahead-item.active .macro-code {
  color: #ffffff;
}
.macro-typeahead-item:hover .macro-preview, .macro-typeahead-item.active .macro-preview {
  color: rgba(255, 255, 255, 0.85);
}

.macro-code {
  font-family: 'Fira Code', monospace;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent-cyan);
}
.macro-preview {
  font-size: 0.74rem;
  color: var(--text-secondary);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═════════════════════════════════════════════════════════════ */
/* 3. PLAYER DE ÁUDIO WHATSAPP COM TRANSCRIÇÃO IA               */
/* ═════════════════════════════════════════════════════════════ */
.audio-msg-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 260px;
  max-width: 340px;
}

.audio-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audio-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-indigo);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.audio-play-btn:hover {
  transform: scale(1.08);
}

.audio-waveform-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
}
.wave-bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  transition: height 0.2s ease;
}
.msg-bubble.inbound .wave-bar {
  background: rgba(99, 102, 241, 0.4);
}
.wave-bar.played {
  background: var(--accent-indigo) !important;
}

.audio-duration-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.audio-ai-transcript-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.2);
  font-size: 0.72rem;
  color: var(--accent-cyan);
  cursor: pointer;
  font-weight: 600;
}
.audio-ai-transcript-toggle:hover {
  background: rgba(6, 182, 212, 0.15);
}

.audio-transcript-content {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  margin-top: 4px;
  border-left: 2px solid var(--accent-cyan);
}

/* ═════════════════════════════════════════════════════════════ */
/* 4. TIMELINE ACADÊMICA NO PRONTUÁRIO DO ALUNO                 */
/* ═════════════════════════════════════════════════════════════ */
.academic-timeline-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 18px;
  margin-top: 8px;
}
.academic-timeline-stream::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-color);
}

.timeline-event-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.timeline-event-dot {
  position: absolute;
  left: -18px;
  top: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-indigo);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 6px var(--accent-indigo);
}
.timeline-event-dot.success { background: var(--accent-emerald); box-shadow: 0 0 6px var(--accent-emerald); }
.timeline-event-dot.risk { background: var(--accent-rose); box-shadow: 0 0 6px var(--accent-rose); }

.timeline-event-date {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}
.timeline-event-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}
.timeline-event-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* ═════════════════════════════════════════════════════════════ */
/* 5. FOLHA DE PARECER OFICIAL TIMBRADA (INTERATIVO & PDF)       */
/* ═════════════════════════════════════════════════════════════ */
.doc-sheet-dialog {
  max-width: 860px !important;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  box-sizing: border-box;
}

.parecer-tab-switch {
  display: inline-flex;
  background: var(--bg-input);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  gap: 4px;
}
.btn-parecer-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.btn-parecer-tab.active {
  background: var(--accent-indigo);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.parecer-meta-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.parecer-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}
.parecer-footer-sub-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 680px) {
  .parecer-meta-inputs-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .parecer-modal-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .parecer-modal-footer .btn-block-mobile {
    width: 100% !important;
    font-size: 0.88rem;
    padding: 10px;
    justify-content: center;
  }
  .parecer-footer-sub-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    width: 100%;
  }
  .parecer-footer-sub-actions .btn {
    padding: 8px 4px !important;
    font-size: 0.76rem !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .parecer-footer-sub-actions .btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.parecer-student-summary-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.parecer-protocol-tag {
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Seletor de Decisão do Colegiado (Radio Cards) */
.parecer-decision-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.decision-radio-card {
  position: relative;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.decision-radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.decision-radio-card strong {
  font-size: 0.84rem;
  display: block;
}
.decision-radio-card span {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.decision-radio-card.deferido.active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}
.decision-radio-card.parcial.active {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}
.decision-radio-card.indeferido.active {
  border-color: #f43f5e;
  background: rgba(244, 63, 94, 0.12);
}
.decision-radio-card.diligencia.active {
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.12);
}

.parecer-docs-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.checkbox-pill {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  transition: all 0.15s ease;
}
.checkbox-pill:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}
.checkbox-pill input {
  cursor: pointer;
  accent-color: var(--accent-indigo);
}

/* Folha Timbrada Impressa / A4 */
.official-letterhead-sheet {
  background: #ffffff;
  color: #0f172a;
  padding: 40px 48px;
  border-radius: 6px;
  font-family: 'Inter', -apple-system, sans-serif;
  line-height: 1.55;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.letterhead-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 14px;
  margin-bottom: 20px;
}
.letterhead-institution h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.letterhead-institution p {
  font-size: 0.82rem;
  color: #475569;
  margin: 2px 0 0 0;
  font-weight: 600;
}

.letterhead-badge {
  text-align: right;
  font-size: 0.76rem;
  color: #475569;
}
.letterhead-badge strong {
  display: block;
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  color: #4338ca;
}

.letterhead-doc-title {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f1f5f9;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}

.letterhead-meta-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 0.84rem;
}
.letterhead-meta-table td {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  color: #1e293b;
}
.letterhead-meta-table td.label {
  background: #f8fafc;
  font-weight: 700;
  width: 24%;
  color: #334155;
  font-size: 0.78rem;
}

/* Selo Oficial de Veredito / Decisão */
.verdict-seal-banner {
  margin: 18px 0;
  padding: 12px 18px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 2px solid;
}
.verdict-seal-banner.deferido {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}
.verdict-seal-banner.parcial {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}
.verdict-seal-banner.indeferido {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}
.verdict-seal-banner.diligencia {
  background: #ecfeff;
  border-color: #06b6d4;
  color: #155e75;
}
.verdict-seal-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.letterhead-section-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #0f172a;
  margin: 16px 0 6px 0;
  text-transform: uppercase;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 4px;
}

.letterhead-opinion-box {
  background: #f8fafc;
  border-left: 4px solid #4338ca;
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
  color: #1e293b;
  margin-bottom: 20px;
  white-space: pre-line;
  line-height: 1.5;
}

.letterhead-auth-bar {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: #64748b;
}
.letterhead-auth-bar code {
  font-family: 'Fira Code', monospace;
  font-weight: 700;
  color: #334155;
}

.letterhead-signature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 40px;
  text-align: center;
}
.signature-line {
  border-top: 1px solid #0f172a;
  padding-top: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
}
.signature-sub {
  font-size: 0.72rem;
  color: #64748b;
}

@media (max-width: 680px) {
  #parecer-preview-view {
    padding: 6px !important;
    background: #ffffff !important;
    width: 100% !important;
    box-sizing: border-box;
    overflow-x: hidden !important;
  }

  .official-letterhead-sheet {
    padding: 16px 12px !important;
    width: 100% !important;
    box-sizing: border-box;
    overflow-x: hidden !important;
    box-shadow: none !important;
  }

  .letterhead-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  .letterhead-institution h2 {
    font-size: 1.05rem !important;
  }
  .letterhead-institution p {
    font-size: 0.74rem !important;
  }
  .letterhead-badge {
    text-align: left !important;
    width: 100% !important;
  }

  .letterhead-doc-title {
    font-size: 0.88rem !important;
    padding: 6px !important;
    margin: 12px 0 !important;
  }

  /* Tabela de dados cadastrais adaptada para tela vertical no celular */
  .letterhead-meta-table {
    display: block !important;
    width: 100% !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    margin-bottom: 12px !important;
  }
  .letterhead-meta-table tbody {
    display: block !important;
    width: 100% !important;
  }
  .letterhead-meta-table tr {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }
  .letterhead-meta-table tr:last-child {
    border-bottom: none !important;
  }
  .letterhead-meta-table td {
    display: block !important;
    width: 100% !important;
    border: none !important;
    padding: 5px 8px !important;
    box-sizing: border-box !important;
    word-break: break-word !important;
  }
  .letterhead-meta-table td.label {
    background: #f1f5f9 !important;
    font-size: 0.7rem !important;
    color: #475569 !important;
    padding-top: 6px !important;
    padding-bottom: 2px !important;
  }
  .letterhead-meta-table td:not(.label) {
    font-size: 0.82rem !important;
    padding-top: 2px !important;
    padding-bottom: 6px !important;
  }

  .verdict-seal-banner {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    padding: 10px 12px !important;
  }
  .verdict-seal-title {
    font-size: 0.95rem !important;
  }

  .letterhead-opinion-box {
    padding: 10px 12px !important;
    font-size: 0.82rem !important;
  }

  .letterhead-signature-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    margin-top: 24px !important;
  }

  .letterhead-auth-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    font-size: 0.68rem !important;
  }
}

@media print {
  body * {
    visibility: hidden;
  }
  .doc-sheet-dialog, .official-letterhead-sheet, .official-letterhead-sheet * {
    visibility: visible;
  }
  .doc-sheet-dialog {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
  }
  .official-letterhead-sheet {
    box-shadow: none;
    padding: 20px;
  }
  .letterhead-meta-table {
    display: table !important;
    width: 100% !important;
  }
  .letterhead-meta-table tbody {
    display: table-row-group !important;
  }
  .letterhead-meta-table tr {
    display: table-row !important;
  }
  .letterhead-meta-table td {
    display: table-cell !important;
    border: 1px solid #cbd5e1 !important;
  }
  .letterhead-meta-table td.label {
    width: 24% !important;
    display: table-cell !important;
  }
  .letterhead-signature-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }

  /* ─── SUPORTE À IMPRESSÃO DO MODAL DE RELATÓRIO EXECUTIVO (#modal-report) ─── */
  #modal-report,
  #modal-report .custom-modal-dialog,
  #modal-report .custom-modal-dialog * {
    visibility: visible !important;
  }
  #modal-report {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    display: block !important;
    z-index: 99999 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }
  #modal-report .custom-modal-dialog {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 20px 30px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  #modal-report .modal-dialog-header {
    border-bottom: 2px solid #0f172a !important;
    padding-bottom: 10px !important;
    margin-bottom: 16px !important;
    display: block !important;
  }
  #modal-report .modal-dialog-header h3 {
    color: #0f172a !important;
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
  }
  #modal-report .btn-modal-close,
  #modal-report .modal-dialog-footer,
  #modal-report .btn,
  #modal-report .btn-sm {
    display: none !important;
  }
  #modal-report .dossier-info-card {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 14px 18px !important;
    margin-bottom: 18px !important;
    color: #0f172a !important;
  }
  #modal-report .dossier-info-card * {
    color: #0f172a !important;
  }
  #modal-report .dossier-info-card label {
    color: #475569 !important;
    font-weight: 700 !important;
  }
  #modal-report h4 {
    color: #0f172a !important;
    font-weight: 700 !important;
    margin: 14px 0 8px 0 !important;
    font-size: 1rem !important;
  }
  #modal-report .responsive-table-wrapper {
    overflow: visible !important;
  }
  #modal-report .data-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 6px !important;
  }
  #modal-report .data-table th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    padding: 7px 10px !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    text-align: left !important;
  }
  #modal-report .data-table td {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    padding: 7px 10px !important;
    font-size: 0.82rem !important;
  }
  #modal-report .tag-chip {
    background: #e2e8f0 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 600 !important;
  }

  .no-print {
    display: none !important;
  }
}

/* ═════════════════════════════════════════════════════════════ */
/* 6. COMPONENTES DE NAVEGAÇÃO MOBILE & USER DROPDOWN            */
/* ═════════════════════════════════════════════════════════════ */

/* Botão Hambúrguer Mobile */
.btn-mobile-nav-toggle {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  margin-right: 6px;
  flex-shrink: 0;
}

/* Container do Perfil & Dropdown Popover */
.user-profile-widget-container {
  position: relative;
}

.user-profile-widget {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}
.user-profile-widget:hover {
  border-color: var(--accent-indigo);
  background: var(--bg-card-hover);
}

.profile-dropdown-caret {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: 2px;
  margin-right: 2px;
}

.user-profile-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  width: 250px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  padding: 12px;
  z-index: 1000;
  animation: slideDown 0.18s ease;
}

.dropdown-user-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
}
.user-avatar-circle.large {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}
.dropdown-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.dropdown-user-info strong {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-course-name {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 6px 0;
}

.dropdown-item-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 10px;
  font-size: 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}
.dropdown-item-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
}
.dropdown-item-btn.logout-danger {
  color: var(--accent-rose);
}
.dropdown-item-btn.logout-danger:hover {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
}

/* Barra de Navegação Inferior Mobile (Bottom Nav Bar) */
.bottom-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
  z-index: 500;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
}

.bottom-nav-item {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.bottom-nav-item i {
  font-size: 1.15rem;
}
.bottom-nav-item.active {
  color: var(--accent-indigo);
}
.bottom-nav-item:hover {
  color: var(--text-primary);
}

.nav-icon-wrapper {
  position: relative;
  display: inline-flex;
}
.bottom-nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--accent-amber);
  color: #000;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 10px;
}

/* Gaveta Lateral de Navegação (Offcanvas Drawer) */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.mobile-nav-drawer {
  width: 290px;
  height: 100%;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  animation: slideRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.drawer-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

.drawer-nav-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}
.drawer-nav-btn:hover, .drawer-nav-btn.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo);
}

.drawer-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideRight {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* ═════════════════════════════════════════════════════════════ */
/* 7. GERENCIADOR DE MACROS PERSONALIZADAS                       */
/* ═════════════════════════════════════════════════════════════ */
.macro-chip.config-btn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--accent-amber);
  margin-left: auto;
}
.macro-chip.config-btn:hover {
  background: var(--accent-amber);
  color: #000;
}

.quick-macros-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.macros-manager-dialog {
  max-width: 680px !important;
  width: 100%;
}

.macro-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.2s ease;
}
.macro-item-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.macro-card-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.macro-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.macro-card-shortcut {
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}
.macro-card-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
}

.macro-card-content {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
}

.macro-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.btn-macro-action {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-macro-action:hover {
  background: var(--accent-indigo);
  color: #fff;
  border-color: var(--accent-indigo);
}
.btn-macro-action.danger:hover {
  background: var(--accent-rose);
  color: #fff;
  border-color: var(--accent-rose);
}

/* ─── BOTÕES DE ADD-ON NO CHAT (ANEXO & MICROFONE) ────────── */
.btn-chat-addon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.btn-chat-addon:hover {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
}
.btn-chat-addon.active {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.15);
  animation: pulse-red 1.5s infinite;
}

/* ─── BARRA DE GRAVAÇÃO DE ÁUDIO ───────────────────────────── */
.audio-recorder-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 10;
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.25);
  border: 1px solid rgba(244, 63, 94, 0.4);
}
.rec-status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rec-pulse-bullet {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-rose);
  box-shadow: 0 0 8px var(--accent-rose);
  animation: pulse-rec 1s infinite alternate;
}
@keyframes pulse-rec {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.25); opacity: 1; }
}
.rec-time-display {
  font-family: 'Fira Code', monospace;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-rose);
}
.rec-status-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.rec-actions-group {
  display: flex;
  gap: 8px;
}
.btn-rec-control {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.btn-rec-control.cancel {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}
.btn-rec-control.cancel:hover {
  background: var(--accent-rose);
  color: #fff;
}
.btn-rec-control.send {
  background: var(--accent-emerald);
  color: #fff;
}
.btn-rec-control.send:hover {
  background: #059669;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* ─── DRAG & DROP OVERLAY NO CHAT ──────────────────────────── */
.chat-messages {
  position: relative;
}
.chat-drag-overlay {
  position: absolute;
  inset: 0;
  background: rgba(14, 20, 36, 0.88);
  backdrop-filter: blur(6px);
  border: 2px dashed var(--accent-cyan);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 50;
  color: var(--accent-cyan);
  font-size: 1.1rem;
  font-weight: 600;
  pointer-events: none;
}
.chat-drag-overlay i {
  font-size: 3rem;
  animation: bounce 1s infinite alternate;
}
@keyframes bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

/* ─── CENTRAL DE NOTIFICAÇÕES (DROPDOWN) ───────────────────── */
.notifications-widget-container {
  position: relative;
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-rose);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 10px;
  border: 2px solid var(--bg-dark);
}
.notifications-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-width: 90vw;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 1000;
  overflow: hidden;
}
.notif-dropdown-header {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}
.notif-dropdown-header h4 {
  font-size: 0.88rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-clear-notif {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
}
.btn-clear-notif:hover {
  color: var(--accent-cyan);
}
.notif-items-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.15s ease;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.notif-item:hover {
  background: var(--bg-input);
}
.notif-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.notif-item-icon.risk { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.notif-item-icon.new { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.notif-item-icon.transfer { background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo); }
.notif-item-body {
  flex: 1;
  min-width: 0;
}
.notif-item-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
}
.notif-item-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.notif-item-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.3;
}

/* ─── TAGS & ETIQUETAS DO PRONTUÁRIO E CHAT ────────────────── */
.dossier-tags-section {
  margin-top: 14px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}
.tags-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tag-badge-pill {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
}
.tag-badge-pill.selectable {
  background: var(--bg-input);
  color: var(--text-muted);
  border-color: var(--border-color);
}
.tag-badge-pill.selectable:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}
.tag-badge-pill.active.urgente { background: rgba(244, 63, 94, 0.18); color: var(--accent-rose); border-color: rgba(244, 63, 94, 0.4); }
.tag-badge-pill.active.matricula { background: rgba(6, 182, 212, 0.18); color: var(--accent-cyan); border-color: rgba(6, 182, 212, 0.4); }
.tag-badge-pill.active.financeiro { background: rgba(245, 158, 11, 0.18); color: var(--accent-amber); border-color: rgba(245, 158, 11, 0.4); }
.tag-badge-pill.active.estagio, .tag-badge-pill.active.estagiotcc { background: rgba(99, 102, 241, 0.18); color: var(--accent-indigo); border-color: rgba(99, 102, 241, 0.4); }
.tag-badge-pill.active.formando { background: rgba(16, 185, 129, 0.18); color: var(--accent-emerald); border-color: rgba(16, 185, 129, 0.4); }

.chat-item-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.chat-item-tag-mini {
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

/* ─── MODAIS DE PREVIEW E TRANSFERÊNCIA ────────────────────── */
.file-preview-dialog, .transfer-dialog {
  max-width: 480px;
  width: 95%;
}
.file-preview-media-container {
  max-height: 220px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1px solid var(--border-color);
}
.file-preview-media-container img {
  max-height: 200px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 6px;
}
.file-preview-doc-icon {
  font-size: 3.5rem;
  color: var(--accent-cyan);
}

/* ═════════════════════════════════════════════════════════════
   MODO COORDENADOR: LAYOUT ULTRA-SIMPLIFICADO & FOCADO
   ═════════════════════════════════════════════════════════════ */
body.coordinator-mode {
  /* Layout limpo e arejado */
}

/* Oculta os indicadores detalhados de infraestrutura para coordenadores */
body.coordinator-mode #admin-status-indicators {
  display: none !important;
}

/* Exibe exclusivamente o indicador simples de conexão OK / Alerta */
body.coordinator-mode #coordinator-status-indicator {
  display: flex !important;
}

body.coordinator-mode .system-status-indicators {
  display: flex !important;
}

body.coordinator-mode #coordinator-status-indicator {
  display: flex !important;
  align-items: center;
}

body.coordinator-mode .navbar-brand .brand-desc {
  display: none;
}

body.coordinator-mode .desktop-tabs .tabs-scroll-container {
  gap: 6px;
}

body.coordinator-mode .tab-button {
  padding: 8px 18px;
  font-size: 0.84rem;
  border-radius: 8px;
}

body.coordinator-mode .chat-layout {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

body.coordinator-mode .chat-sidebar {
  border-right: 1px solid var(--border-color);
}

body.coordinator-mode .chat-item {
  padding: 11px 13px;
  border-radius: 8px;
  margin: 3px 6px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

body.coordinator-mode .chat-item.active {
  border-color: rgba(99, 102, 241, 0.35);
  background: var(--bg-card-hover);
}

body.coordinator-mode .chat-item-title {
  font-size: 0.88rem;
  font-weight: 700;
}

body.coordinator-mode .chat-input-row {
  border-radius: 10px;
  padding: 6px 10px;
}

body.coordinator-mode .chat-input-row input {
  font-size: 0.88rem;
}

body.coordinator-mode .lead-profile-card {
  padding: 16px;
  border-radius: 10px;
  text-align: center;
}

body.coordinator-mode .lead-avatar-big {
  width: 54px;
  height: 54px;
  font-size: 1.3rem;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}

body.coordinator-mode .lead-profile-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

body.coordinator-mode .lead-info-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

body.coordinator-mode .lead-info-item {
  background: var(--bg-input);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

/* ═════════════════════════════════════════════════════════════ */
/* 10. BLOQUEIO DE TELA POR INATIVIDADE (SECURITY LOCKSCREEN)   */
/* ═════════════════════════════════════════════════════════════ */
.security-lockscreen-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease;
}

.security-lockscreen-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(99, 102, 241, 0.2);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lockscreen-shield-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  border: 2px solid rgba(99, 102, 241, 0.4);
  color: var(--accent-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.lockscreen-user-badge {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ═════════════════════════════════════════════════════════════ */
/* 5. GESTÃO & CONEXÃO DO WHATSAPP (EVOLUTION API)               */
/* ═════════════════════════════════════════════════════════════ */
.clickable-status {
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.clickable-status:hover {
  filter: brightness(1.2);
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}
.clickable-status.red:hover {
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}
.clickable-status.yellow:hover {
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.4);
}

.wa-hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
@media (max-width: 900px) {
  .wa-hub-grid {
    grid-template-columns: 1fr;
  }
}

.qr-scanner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 24px;
}

.qr-code-frame {
  position: relative;
  width: 270px;
  height: 270px;
  background: #ffffff;
  border-radius: 16px;
  padding: 12px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(34, 197, 94, 0.3);
  border: 3px solid #22c55e;
  overflow: hidden;
}

.qr-code-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.qr-scanner-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #22c55e, #10b981, transparent);
  box-shadow: 0 0 10px #22c55e;
  animation: scanLaser 2.5s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes scanLaser {
  0% { top: 0%; opacity: 0.3; }
  50% { opacity: 1; }
  100% { top: 96%; opacity: 0.3; }
}

.wa-instructions-list {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.wa-step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.wa-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.wa-connected-shield {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 30px 20px;
}

.wa-pulse-avatar-box {
  position: relative;
  width: 90px;
  height: 90px;
}

.wa-avatar-img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #22c55e;
}

.wa-avatar-fallback {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #22c55e;
}

.wa-pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #22c55e;
  animation: waPulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes waPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  70% { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(1.2); opacity: 0; }
}



