/* =========================================================
   Oxford — Reports (scoped)
   Tudo sob .oxr-wrap p/ evitar vazamento de estilos
   ========================================================= */

/* ─── Unified design tokens (aligned with oxford-teachers) ─── */
.oxr-wrap,
.oxr-commercial-actions,
.oxr-page-back {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
}

/* Wrapper padrão */
.oxr-wrap { max-width: 980px; margin: 0 auto; }

/* ---------------------------
   Formulário (full mode)
---------------------------- */
.oxr-wrap .oxr-form {
  max-width: 520px;
  margin: 0 auto 24px;
  padding: 20px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
}
.oxr-wrap .oxr-field { margin-bottom: 10px; }
.oxr-wrap .oxr-field label { display: block; font-weight: 600; margin-bottom: 6px; }
.oxr-wrap .oxr-field input[type="number"],
.oxr-wrap .oxr-field input[type="text"],
.oxr-wrap .oxr-field input[type="date"] {
  width: 100%;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}
.oxr-wrap .oxr-form button[type="submit"] {
  width: 100%;
  padding: 10px;
  background: #1e3a5f;
  color: #fff;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}
.oxr-wrap .oxr-form button[type="submit"]:hover {
  background: #2c5282;
}
.oxr-wrap .oxr-form button[type="submit"]:hover { filter: brightness(1.05); }

/* ---------------------------
   Botões utilitários
---------------------------- */
/* Botões dentro de .oxr-wrap */
.oxr-wrap .oxr-btn {
  display: inline-block;
  padding: 10px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.oxr-wrap .oxr-btn-primary { background:#1e3a5f; color:#fff; }
.oxr-wrap .oxr-btn-success { background:#28a745; color:#fff; }
.oxr-wrap .oxr-btn-danger  { background:#dc3545; color:#fff; }

/* Botões oxr-btn standalone (para modais fora de .oxr-wrap) */
.oxr-btn {
  display: inline-block;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
.oxr-btn-primary { background: #1e3a5f; color: #fff; }
.oxr-btn-primary:hover { background: #2c5282; }
.oxr-btn-success { background: #28a745; color: #fff; }
.oxr-btn-success:hover { background: #218838; }
.oxr-btn-danger { background: #dc3545; color: #fff; }
.oxr-btn-danger:hover { background: #c82333; }
.oxr-btn-secondary { background: #4a5568; color: #fff; }
.oxr-btn-secondary:hover { background: #5a6a7a; }
.oxr-btn-save-appointment { background: #1e3a5f; color: #fff; min-width: 150px; }
.oxr-btn-save-appointment:hover { background: #2c5282; }
.oxr-wrap .oxr-actions { display:flex; flex-direction:column; align-items:center; gap:10px; margin-top:20px; }
.oxr-wrap .oxr-center { text-align: center; }

/* ---------------------------
   Resumo / containers
---------------------------- */
.oxr-wrap #resultado,
.oxr-wrap .oxr-resultado {
  margin-top: 20px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}
.oxr-wrap .charts-container {
  margin-top: 30px;
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}
.oxr-wrap .oxr-chart-wrap {
  margin: 40px auto;
  max-width: 640px;
}

/* ---------------------------
   Donuts
---------------------------- */
.oxr-wrap .donut {
  --size: 120px;
  --thickness: 20px;
  --fill-color: #28a745;
  --empty-color: #eee;
  --pct: 0;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background:
    conic-gradient(
      var(--fill-color) calc(var(--pct) * 1%),
      var(--empty-color) 0
    );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.oxr-wrap .donut::before {
  content: "";
  width: calc(var(--size) - var(--thickness) * 2);
  height: calc(var(--size) - var(--thickness) * 2);
  background: #fff;
  border-radius: 50%;
}
.oxr-wrap .donut-label {
  position: absolute;
  font-size: 1.1rem;
  font-weight: 700;
}
.oxr-wrap .donut-title { margin-top: 8px; text-align: center; font-size: .9rem; }

/* Versão compacta p/ página do consultor */
.oxr-wrap.oxr-consultor-wrap .donut {
  --size: 100px;
  --thickness: 16px;
}

/* ---------------------------
   Tabelas (relatório diário)
---------------------------- */
.oxr-wrap .oxr-table {
  margin: 16px auto;
  border-collapse: collapse;
  text-align: center;
  width: 100%;
  max-width: 900px;
}
.oxr-wrap .oxr-table th,
.oxr-wrap .oxr-table td {
  border: 1px solid #ccc;
  padding: 6px 8px;
  font-size: 0.875rem;
}
.oxr-wrap .oxr-table thead th {
  background: #f1f5f9;
  font-weight: 700;
}

/* ---------------------------
   Seções de gráficos
---------------------------- */
.oxr-wrap #grafico-medias-wrapper,
.oxr-wrap #grafico-matriculados-wrapper,
.oxr-wrap #grafico-agendados-wrapper,
.oxr-wrap #grafico-atendidos-wrapper {
  display: none;
  margin: 40px auto;
  max-width: 720px;
  position: relative;
  height: 400px;
}
.oxr-wrap .oxr-chart-wrap {
  position: relative;
  height: 400px;
}
.oxr-wrap .oxr-chart-wrap h3 {
  text-align: center;
  margin-bottom: 16px;
  color: #1e3a5f;
  font-size: 1.125rem;
  font-weight: 600;
}
.oxr-wrap .oxr-chart-wrap canvas {
  max-height: 350px;
  max-width: 100%;
}

/* ---------------------------
   Botões de exportação
---------------------------- */
.oxr-wrap #baixar-estatisticas,
.oxr-wrap #baixar-estatisticas-pdf {
  margin-top: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  display: none;
}
.oxr-wrap #baixar-estatisticas { background: #28a745; color: #fff; }
.oxr-wrap #baixar-estatisticas-pdf { background: #dc3545; color: #fff; }

/* ---------------------------
   Toggle detalhes
---------------------------- */
.oxr-wrap #toggle-relatorio-wrapper {
  text-align: center;
  margin-top: 30px;
  display: none;
}
.oxr-wrap #toggle-relatorio {
  background: #1e3a5f;
  color: #fff;
  border: 0;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}
.oxr-wrap #toggle-relatorio:hover { filter: brightness(1.05); }

/* ---------------------------
   Consultor mode container
---------------------------- */
.oxr-wrap #relatorio { max-width: 800px; margin: 0 auto; }

/* ---------------------------
   Títulos padronizados (todos os relatórios)
---------------------------- */
.oxr-wrap .oxr-title {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: #1e3a5f;
  font-weight: 700;
}
.oxr-wrap .oxr-subtitle {
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 24px;
}
.oxr-wrap .oxr-loading {
  text-align: center;
  font-size: 1.125rem;
  color: #1e3a5f;
  padding: 40px 0;
}
.oxr-wrap .oxr-totais {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 30px 0;
}
.oxr-wrap .oxr-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 20px;
  border-radius: 12px;
  min-width: 200px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.oxr-wrap .oxr-card h3 {
  margin: 0 0 10px 0;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}
.oxr-wrap .oxr-card .oxr-stat {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
}
.oxr-wrap .oxr-table-wrap {
  margin: 30px 0;
  overflow-x: auto;
}
.oxr-wrap .oxr-table-wrap h3 {
  text-align: center;
  margin-bottom: 16px;
  color: #1e3a5f;
}
.oxr-wrap .oxr-field select {
  width: 100%;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #ccc;
  box-sizing: border-box;
  background: #fff;
}

/* ---------------------------
   Listagem de Leads
---------------------------- */
.oxr-wrap.oxr-leads-listagem,
.oxr-wrap.oxr-banco-leads {
  /* max-width, margin e padding removidos para permitir controle via Elementor */
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  padding: 0;
  box-sizing: border-box;
}

.oxr-wrap .oxr-leads-filtros {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}

.oxr-wrap .oxr-leads-filtros h2 {
  margin: 0 0 20px 0;
  font-size: 1.5rem;
  color: #1e3a5f;
  text-align: center;
}

.oxr-wrap .oxr-filtros-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 20px;
}

.oxr-wrap .oxr-filtro-grupo {
  background: #fff;
  padding: 16px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.oxr-wrap .oxr-filtro-grupo h3 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #555;
}

.oxr-wrap .oxr-checkbox-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 8px;
}

.oxr-wrap .oxr-checkbox-group::-webkit-scrollbar {
  width: 6px;
}

.oxr-wrap .oxr-checkbox-group::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.oxr-wrap .oxr-checkbox-group::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.oxr-wrap .oxr-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 0;
}

.oxr-wrap .oxr-checkbox-label input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.oxr-wrap .oxr-search-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.875rem;
  box-sizing: border-box;
}

.oxr-wrap .oxr-search-hint {
  margin: 8px 0 0 0;
  font-size: 0.75rem;
  color: #666;
  font-style: italic;
}

.oxr-wrap .oxr-filtro-grupo.oxr-filtro-pesquisa {
  grid-column: span 1;
}

/* Filtro de intervalo de datas */
.oxr-wrap .oxr-date-range-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.oxr-wrap .oxr-date-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: #333;
  flex: 1;
}

.oxr-wrap .oxr-date-label input[type="date"] {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.875rem;
  box-sizing: border-box;
  flex: 1;
}

.oxr-wrap .oxr-filtros-acoes {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
}

.oxr-wrap .oxr-btn-secondary {
  background: #6c757d;
  color: #fff;
}

.oxr-wrap .oxr-btn-secondary:hover {
  background: #5a6268;
}

.oxr-wrap .oxr-leads-loading {
  text-align: center;
  padding: 30px;
  font-size: 1.125rem;
  color: #1e3a5f;
  font-weight: 600;
}

.oxr-wrap .oxr-leads-info {
  text-align: center;
  padding: 12px;
  background: #e7f3ff;
  border-radius: 6px;
  margin-bottom: 16px;
}

.oxr-wrap .oxr-leads-info strong {
  color: #1e3a5f;
  font-size: 1.125rem;
}

.oxr-wrap .oxr-leads-table-container {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 600px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
}

.oxr-wrap .oxr-leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.oxr-wrap .oxr-leads-table thead {
  background: #1e3a5f;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.oxr-wrap .oxr-leads-table th {
  padding: 12px 10px;
  text-align: left;
  font-weight: 600;
  color: #fff;
  border-bottom: 2px solid #ddd;
  white-space: nowrap;
}

.oxr-wrap .oxr-leads-table td {
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.oxr-wrap .oxr-leads-table tbody tr:hover {
  background: #f9f9f9;
}

.oxr-wrap .oxr-leads-table .oxr-lead-row-clickable:hover {
  background: #e3f2fd !important;
  transition: background-color 0.2s ease;
}

.oxr-wrap .oxr-leads-table .oxr-lead-row-clickable:active {
  background: #bbdefb !important;
}

.oxr-wrap .oxr-leads-table .oxr-no-results {
  text-align: center;
  font-style: italic;
  color: #666;
}

.oxr-wrap .oxr-leads-error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  padding: 16px;
  margin-top: 20px;
}

.oxr-wrap .oxr-error-message {
  margin: 0;
  color: #721c24;
  font-weight: 600;
}

/* Estilos para células específicas */
.oxr-wrap .oxr-leads-table .oxr-lead-telefone {
  font-family: monospace;
  font-weight: 600;
}

.oxr-wrap .oxr-leads-table .oxr-lead-observacao {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oxr-wrap .oxr-leads-table .oxr-lead-data {
  white-space: nowrap;
  font-weight: 500;
}

/* Coluna de ações */
.oxr-wrap .oxr-leads-table .oxr-th-acoes {
  width: 80px;
  text-align: center;
}

.oxr-wrap .oxr-leads-table .oxr-lead-acoes {
  white-space: nowrap;
  text-align: center;
}

/* Botões de ação na tabela */
.oxr-wrap .oxr-btn-acao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  margin: 0 2px;
  /* Reset para uso como <button> (mantém compatibilidade com <a>) */
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  line-height: 1;
}

.oxr-wrap .oxr-btn-acao svg {
  width: 16px;
  height: 16px;
}

/* Botão Mensagem (verde WhatsApp) */
.oxr-wrap .oxr-btn-mensagem {
  background: #25D366;
  color: #fff;
}

.oxr-wrap .oxr-btn-mensagem:hover {
  background: #1DA851;
  transform: scale(1.1);
}

/* Botão Editar (azul) */
.oxr-wrap .oxr-btn-editar {
  background: #1e3a5f;
  color: #fff;
}

.oxr-wrap .oxr-btn-editar:hover {
  background: #2c5282;
  transform: scale(1.1);
}

/* Botão Notas (cinza-azulado neutro) */
.oxr-wrap .oxr-btn-notas {
  background: #5d6d7e;
  color: #fff;
}

.oxr-wrap .oxr-btn-notas:hover {
  background: #34495e;
  transform: scale(1.1);
}

/* ---------------------------
   Layout Banco de Leads (4 filtros + pesquisa)
---------------------------- */
.oxr-wrap .oxr-filtros-banco {
  grid-template-columns: repeat(4, 1fr);
}

.oxr-wrap .oxr-filtros-banco .oxr-filtro-pesquisa {
  grid-column: 1 / -1;
}

/* ---------------------------
   Responsivo simples
---------------------------- */
@media (max-width: 1024px) {
  /* Tablets: mantém 2 colunas */
  .oxr-wrap .oxr-filtros-banco {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Totais: 3 colunas em tablets */
  .oxr-wrap .oxr-totais {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .oxr-wrap .donut { --size: 96px; --thickness: 18px; }
  .oxr-wrap .donut-label { font-size: 1rem; }

  .oxr-wrap .oxr-filtros-container,
  .oxr-wrap .oxr-filtros-banco {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------
   Formulário de Lead
---------------------------- */
.oxr-lead-form-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.oxr-form-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
}

.oxr-form-header h2 {
  margin: 0 0 8px 0;
  font-size: 1.4rem;
  color: #1e3a5f;
  font-weight: 700;
}

.oxr-lead-id {
  margin: 0;
  color: #666;
  font-size: 0.875rem;
}

/* Loading Overlay */
.oxr-form-loading {
  text-align: center;
  padding: 40px;
  background: rgba(255, 255, 255, 0.95);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.oxr-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #1e3a5f;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: oxr-spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes oxr-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mensagens */
.oxr-form-messages {
  margin-bottom: 20px;
}

.oxr-form-success,
.oxr-form-error {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-weight: 500;
}

.oxr-form-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.oxr-form-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Grid de Campos */
.oxr-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.oxr-form-group {
  display: flex;
  flex-direction: column;
}

.oxr-form-group.oxr-full-width {
  grid-column: 1 / -1;
}

.oxr-form-group label {
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
  font-size: 0.875rem;
}

.oxr-form-group.oxr-required label::after {
  content: ' *';
  color: #dc3545;
}

.oxr-input,
.oxr-select,
.oxr-textarea {
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.oxr-input:focus,
.oxr-select:focus,
.oxr-textarea:focus {
  outline: none;
  border-color: #1e3a5f;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.oxr-input-error {
  border-color: #dc3545 !important;
}

.oxr-input-valid {
  border-color: #28a745 !important;
}

.oxr-input-highlight {
  animation: oxr-highlight 0.3s ease;
}

@keyframes oxr-highlight {
  0%, 100% { background: transparent; }
  50% { background: #ffffcc; }
}

.oxr-textarea {
  resize: vertical;
  min-height: 80px;
}

.oxr-field-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: #666;
  font-style: italic;
}

/* Contadores */
.oxr-counters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 8px;
}

.oxr-counter-item {
  display: flex;
  flex-direction: column;
}

.oxr-counter-item label {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.oxr-counter-control {
  display: flex;
  gap: 8px;
  align-items: center;
}

.oxr-counter-input {
  flex: 1;
  text-align: center;
  font-weight: 600;
  background: #f8f9fa;
}

.oxr-btn-counter {
  padding: 10px 16px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.oxr-btn-counter:hover {
  background: #218838;
}

.oxr-btn-counter:active {
  transform: scale(0.95);
}

/* Botões de Ação */
.oxr-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid #e0e0e0;
}

.oxr-btn-save {
  flex: 1;
}

.oxr-btn-toggle-history {
  flex-shrink: 0;
}

/* Histórico */
.oxr-lead-history {
  margin-top: 32px;
  padding: 24px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.oxr-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #dee2e6;
}

.oxr-history-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #1e3a5f;
}

.oxr-btn-close-history {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.oxr-history-loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.oxr-history-empty {
  text-align: center;
  padding: 40px;
  color: #999;
  font-style: italic;
}

.oxr-history-item {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  margin-bottom: 16px;
  padding: 16px;
  transition: box-shadow 0.2s;
}

.oxr-history-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.oxr-history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e9ecef;
}

.oxr-history-date {
  font-weight: 600;
  color: #495057;
  font-size: 0.875rem;
}

.oxr-history-id {
  font-size: 0.75rem;
  color: #6c757d;
  background: #e9ecef;
  padding: 2px 8px;
  border-radius: 4px;
}

.oxr-history-item-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.oxr-history-field {
  font-size: 0.8rem;
  line-height: 1.5;
}

.oxr-history-field strong {
  color: #495057;
}

.oxr-history-obs {
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
  border-left: 3px solid #1e3a5f;
}

/* Responsivo */
@media (max-width: 768px) {
  .oxr-form-grid {
    grid-template-columns: 1fr;
  }

  .oxr-counters-grid {
    grid-template-columns: 1fr;
  }

  .oxr-form-actions {
    flex-direction: column;
  }

  .oxr-btn-save,
  .oxr-btn-toggle-history {
    width: 100%;
  }

  .oxr-wrap .oxr-totais {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .oxr-wrap .oxr-card {
    min-width: unset;
    padding: 15px;
  }

  /* Responsivo para listagem de leads */
  .oxr-wrap .oxr-filtros-container {
    grid-template-columns: 1fr;
  }

  .oxr-wrap .oxr-checkbox-group {
    grid-template-columns: 1fr;
  }

  .oxr-wrap .oxr-filtro-grupo.oxr-filtro-pesquisa {
    grid-column: 1;
  }

  .oxr-wrap .oxr-filtros-acoes {
    flex-direction: column;
  }

  .oxr-wrap .oxr-filtros-acoes .oxr-btn {
    width: 100%;
  }

  .oxr-wrap .oxr-leads-table {
    font-size: 0.75rem;
  }

  .oxr-wrap .oxr-leads-table th,
  .oxr-wrap .oxr-leads-table td {
    padding: 8px 6px;
  }
}

/* =====================================================
   MODAL DE AGENDAMENTO
   ===================================================== */

.oxr-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999 !important;
  display: none;
}

.oxr-modal.oxr-modal-show {
  display: block !important;
}

.oxr-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999999;
}

.oxr-modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000000 !important;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
}

.oxr-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f9f9f9;
}

.oxr-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e3a5f;
}

.oxr-btn-close-modal {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.oxr-btn-close-modal:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
}

.oxr-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.oxr-modal-messages {
  margin-bottom: 16px;
}

.oxr-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background: #f9f9f9;
}

.oxr-btn-cancel-appointment {
  background: #6c757d;
  color: #fff;
}

.oxr-btn-cancel-appointment:hover {
  background: #5a6268;
}

/* Botões dentro do modal (fora de .oxr-wrap) */
.oxr-modal .oxr-btn {
  display: inline-block;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.oxr-modal .oxr-btn-primary,
.oxr-modal .oxr-btn-save-appointment {
  background: #1e3a5f;
  color: #fff;
}

.oxr-modal .oxr-btn-primary:hover,
.oxr-modal .oxr-btn-save-appointment:hover {
  background: #2c5282;
}

.oxr-modal .oxr-btn-secondary {
  background: #6c757d;
  color: #fff;
}

.oxr-modal .oxr-btn-secondary:hover {
  background: #5a6268;
}

/* Estilos específicos para o formulário de agendamento */
.oxr-appointment-form .oxr-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.oxr-appointment-form .oxr-form-group.oxr-full-width {
  grid-column: 1 / -1;
}

/* Responsivo para modal */
@media (max-width: 640px) {
  .oxr-modal-container {
    width: 95%;
    margin: 2vh auto;
    max-height: 96vh;
  }

  .oxr-appointment-form .oxr-form-grid {
    grid-template-columns: 1fr;
  }

  .oxr-modal-footer {
    flex-direction: column-reverse;
  }

  .oxr-modal-footer .oxr-btn {
    width: 100%;
  }
}

/* =====================================================
   LISTAGEM DE AGENDAMENTOS
   ===================================================== */

.oxr-appointments-list-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.oxr-appointments-header {
  margin-bottom: 24px;
}

.oxr-appointments-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e3a5f;
}

.oxr-appointments-filters {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.oxr-appointments-filters .oxr-filtros-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.oxr-appointments-filters .oxr-filtro-grupo {
  background: #fff;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.oxr-appointments-filters .oxr-filtro-grupo label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
  font-size: 0.875rem;
}

.oxr-appointments-filters .oxr-filtros-acoes {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
}

.oxr-appointments-loading {
  text-align: center;
  padding: 40px 20px;
}

.oxr-appointments-messages {
  margin-bottom: 16px;
}

.oxr-appointments-table-container {
  overflow-x: auto;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 20px;
}

.oxr-appointments-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.oxr-appointments-table thead {
  background: #f5f5f5;
}

.oxr-appointments-table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #e0e0e0;
  font-size: 0.875rem;
}

.oxr-appointments-table td {
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.875rem;
  color: #555;
}

.oxr-appointments-table tbody tr:hover {
  background: #fafafa;
  cursor: pointer;
}

.oxr-appointment-row {
  transition: background-color 0.2s ease;
}

.oxr-appointment-row:hover {
  background-color: #e8f4f8 !important;
}

.oxr-appointments-empty {
  text-align: center;
  padding: 60px 20px;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  color: #666;
}

/* Status badges */
.oxr-status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.oxr-status-aberto {
  background: #e3f2fd;
  color: #1976d2;
}

.oxr-status-confirmado {
  background: #e8f5e9;
  color: #388e3c;
}

.oxr-status-atendido {
  background: #f3e5f5;
  color: #7b1fa2;
}

.oxr-status-remarcado {
  background: #fff3e0;
  color: #f57c00;
}

.oxr-status-cancelado {
  background: #ffebee;
  color: #d32f2f;
}

.oxr-status-nao-compareceu {
  background: #fce4ec;
  color: #c2185b;
}

/* =====================================================
   TOGGLE DE FILTROS
   ===================================================== */

.oxr-filtros-toggle-wrapper {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px 24px;
  margin-bottom: 24px;
}

.oxr-filtros-toggle-wrapper .oxr-leads-filtros {
  margin-top: 16px;
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.oxr-btn-toggle-filtros {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: #495057;
  transition: all 0.2s ease;
}

.oxr-btn-toggle-filtros:hover {
  background: #e9ecef;
  border-color: #ced4da;
}

.oxr-btn-toggle-filtros[aria-expanded="true"] {
  background: #1e3a5f;
  color: #fff;
  border-color: #1e3a5f;
}

.oxr-btn-toggle-filtros[aria-expanded="true"]:hover {
  background: #2c5282;
  border-color: #2c5282;
}

.oxr-toggle-icon {
  font-size: 0.625rem;
  transition: transform 0.2s ease;
}

.oxr-toggle-text {
  font-weight: 500;
}

/* =====================================================
   BOTÃO MOSTRAR MAIS AGENDAMENTOS
   ===================================================== */

.oxr-appointments-show-more-wrapper {
  text-align: center;
  margin: 16px 0;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px dashed #dee2e6;
}

.oxr-btn-show-more {
  padding: 12px 24px;
  font-size: 0.875rem;
  font-weight: 500;
}

.oxr-btn-show-more:hover {
  background: #5a6268;
}

.oxr-hidden-count {
  font-weight: 700;
  color: #fff;
}

/* Animação para linhas reveladas */
.oxr-appointment-revealed {
  animation: oxr-reveal-row 0.3s ease-out;
}

@keyframes oxr-reveal-row {
  from {
    opacity: 0;
    background-color: #fffde7;
  }
  to {
    opacity: 1;
    background-color: transparent;
  }
}

/* Cabeçalho da listagem de leads */
.oxr-leads-header {
  margin-bottom: 16px;
}

.oxr-leads-header h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e3a5f;
}

/* Responsivo para listagem de agendamentos */
@media (max-width: 768px) {
  .oxr-appointments-filters .oxr-filtros-container {
    grid-template-columns: 1fr;
  }

  .oxr-appointments-filters .oxr-filtros-acoes {
    flex-direction: column;
  }

  .oxr-appointments-filters .oxr-filtros-acoes .oxr-btn {
    width: 100%;
  }

  .oxr-appointments-table {
    font-size: 0.75rem;
  }

  .oxr-appointments-table th,
  .oxr-appointments-table td {
    padding: 8px 6px;
  }

  .oxr-status-badge {
    font-size: 0.625rem;
    padding: 3px 8px;
  }

  /* Toggle responsivo */
  .oxr-btn-toggle-filtros {
    width: 100%;
    justify-content: center;
  }

  .oxr-appointments-show-more-wrapper {
    padding: 8px;
  }

  .oxr-btn-show-more {
    width: 100%;
    padding: 10px 16px;
  }
}

/* =========================================================
   Produtividade Dashboard
   ========================================================= */

/* Form inline */
.oxr-wrap .oxr-form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  max-width: 100%;
}

.oxr-wrap .oxr-form-inline .oxr-field {
  flex: 1;
  min-width: 140px;
  margin-bottom: 0;
}

.oxr-wrap .oxr-form-inline .oxr-btn {
  flex-shrink: 0;
  height: 38px;
}

/* Cards de tempo real */
.oxr-wrap .oxr-realtime-cards {
  margin: 24px 0;
}

.oxr-wrap .oxr-realtime-cards h3 {
  margin-bottom: 16px;
  font-size: 1.125rem;
  color: #1e3a5f;
}

.oxr-wrap .oxr-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.oxr-wrap .oxr-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.oxr-wrap .oxr-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.oxr-wrap .oxr-card-blue .oxr-card-icon {
  background: rgba(54, 162, 235, 0.15);
  color: #36a2eb;
}

.oxr-wrap .oxr-card-orange .oxr-card-icon {
  background: rgba(255, 159, 64, 0.15);
  color: #ff9f40;
}

.oxr-wrap .oxr-card-green .oxr-card-icon {
  background: rgba(75, 192, 192, 0.15);
  color: #4bc0c0;
}

.oxr-wrap .oxr-card-content {
  display: flex;
  flex-direction: column;
}

.oxr-wrap .oxr-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #222;
  line-height: 1.2;
}

.oxr-wrap .oxr-card-label {
  font-size: 0.8rem;
  color: #666;
}

/* Métricas totais */
.oxr-wrap .oxr-metrics-section {
  margin: 32px 0;
  padding: 24px;
  background: #f8f9fa;
  border-radius: 10px;
}

.oxr-wrap .oxr-metrics-section h3 {
  margin: 0 0 20px 0;
  font-size: 1.125rem;
  color: #1e3a5f;
  text-align: center;
}

.oxr-wrap .oxr-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
}

.oxr-wrap .oxr-metric {
  text-align: center;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.oxr-wrap .oxr-metric-value {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 4px;
}

.oxr-wrap .oxr-metric-label {
  display: block;
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Loading spinner */
.oxr-wrap .oxr-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #1e3a5f;
  border-radius: 50%;
  animation: oxr-spin 1s linear infinite;
  margin: 0 auto 12px;
}

@keyframes oxr-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error */
.oxr-wrap .oxr-error {
  padding: 16px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  text-align: center;
  color: #856404;
}

/* Tabela responsiva */
.oxr-wrap .oxr-table-responsive {
  overflow-x: auto;
}

/* Produtividade responsive */
@media (max-width: 768px) {
  .oxr-wrap .oxr-form-inline {
    flex-direction: column;
  }

  .oxr-wrap .oxr-form-inline .oxr-field {
    width: 100%;
  }

  .oxr-wrap .oxr-form-inline .oxr-btn {
    width: 100%;
  }

  .oxr-wrap .oxr-cards-grid {
    grid-template-columns: 1fr;
  }

  .oxr-wrap .oxr-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .oxr-wrap .oxr-card-value {
    font-size: 1.5rem;
  }

  .oxr-wrap .oxr-metric-value {
    font-size: 1.5rem;
  }
}

/* =========================================================
   Métricas Avançadas - Produtividade
   ========================================================= */

.oxr-wrap .oxr-advanced-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 2px solid #e9ecef;
}

.oxr-wrap .oxr-section-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 24px;
}

.oxr-wrap .oxr-advanced-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.oxr-wrap .oxr-advanced-card h3 {
  margin: 0 0 20px 0;
  font-size: 1.125rem;
  color: #1e3a5f;
  border-bottom: 2px solid #1e3a5f;
  padding-bottom: 10px;
}

.oxr-wrap .oxr-advanced-card h4 {
  margin: 20px 0 12px 0;
  font-size: 0.875rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Funil de Conversão */
.oxr-wrap .oxr-funnel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.oxr-wrap .oxr-funnel-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 100px;
}

.oxr-wrap .oxr-funnel-bar {
  width: 80px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin-bottom: 8px;
}

.oxr-wrap .oxr-funnel-leads { background: #e3f2fd; color: #1976d2; }
.oxr-wrap .oxr-funnel-agendamento { background: #fff3e0; color: #f57c00; }
.oxr-wrap .oxr-funnel-atendido { background: #e8f5e9; color: #388e3c; }
.oxr-wrap .oxr-funnel-matricula { background: #f3e5f5; color: #7b1fa2; }

.oxr-wrap .oxr-funnel-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.oxr-wrap .oxr-funnel-label {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 4px;
}

.oxr-wrap .oxr-funnel-rate {
  font-size: 0.8rem;
  font-weight: 600;
  color: #28a745;
}

.oxr-wrap .oxr-funnel-arrow {
  font-size: 1.25rem;
  color: #ccc;
  margin: 0 4px;
}

.oxr-wrap .oxr-conversion-summary {
  text-align: center;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 1rem;
}

.oxr-wrap .oxr-highlight {
  font-size: 1.75rem;
  font-weight: 700;
  color: #28a745;
  margin-left: 12px;
}

.oxr-wrap .oxr-highlight-danger {
  font-size: 1.75rem;
  font-weight: 700;
  color: #dc3545;
  margin-left: 12px;
}

/* Abandono de Conversas */
.oxr-wrap .oxr-abandono-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.oxr-wrap .oxr-abandono-stat {
  text-align: center;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px solid transparent;
}

.oxr-wrap .oxr-abandono-warning {
  border-color: #ffc107;
  background: #fff8e1;
}

.oxr-wrap .oxr-abandono-danger {
  border-color: #dc3545;
  background: #ffebee;
}

.oxr-wrap .oxr-abandono-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}

.oxr-wrap .oxr-abandono-label {
  display: block;
  font-size: 0.75rem;
  color: #666;
}

.oxr-wrap .oxr-abandono-taxa {
  text-align: center;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 20px;
}

.oxr-wrap .oxr-abandono-lista {
  margin-top: 20px;
}

.oxr-wrap .oxr-abandono-lista h4 {
  margin: 0 0 12px 0;
}

.oxr-wrap .oxr-table-compact {
  font-size: 0.8rem;
}

.oxr-wrap .oxr-table-compact th,
.oxr-wrap .oxr-table-compact td {
  padding: 8px 12px;
}

/* Tempo até Agendamento */
.oxr-wrap .oxr-tempo-grid {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.oxr-wrap .oxr-tempo-main {
  text-align: center;
  padding: 24px 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: #fff;
}

.oxr-wrap .oxr-tempo-value {
  display: block;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 4px;
}

.oxr-wrap .oxr-tempo-label {
  display: block;
  font-size: 0.875rem;
  opacity: 0.9;
}

.oxr-wrap .oxr-tempo-total {
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.oxr-wrap .oxr-tempo-small-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
}

.oxr-wrap .oxr-tempo-small-label {
  display: block;
  font-size: 0.75rem;
  color: #666;
}

.oxr-wrap .oxr-tempo-distribuicao {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.oxr-wrap .oxr-tempo-dist-item {
  text-align: center;
  padding: 16px 8px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px solid transparent;
}

.oxr-wrap .oxr-tempo-fast {
  border-color: #28a745;
  background: #e8f5e9;
}

.oxr-wrap .oxr-tempo-slow {
  border-color: #dc3545;
  background: #ffebee;
}

.oxr-wrap .oxr-dist-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}

.oxr-wrap .oxr-dist-label {
  display: block;
  font-size: 0.69rem;
  color: #666;
  text-transform: uppercase;
}

/* Responsivo Métricas Avançadas */
@media (max-width: 768px) {
  .oxr-wrap .oxr-funnel {
    flex-direction: column;
    gap: 16px;
  }

  .oxr-wrap .oxr-funnel-arrow {
    transform: rotate(90deg);
  }

  .oxr-wrap .oxr-abandono-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .oxr-wrap .oxr-tempo-grid {
    flex-direction: column;
  }

  .oxr-wrap .oxr-tempo-main {
    width: 100%;
    padding: 20px;
  }

  .oxr-wrap .oxr-tempo-total {
    width: 100%;
  }

  .oxr-wrap .oxr-tempo-distribuicao {
    grid-template-columns: repeat(2, 1fr);
  }

  .oxr-wrap .oxr-tempo-distribuicao .oxr-tempo-dist-item:last-child {
    grid-column: span 2;
  }
}

/* =========================================================
   Breakdown Section - Produtividade
   ========================================================= */

.oxr-wrap .oxr-breakdown-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 2px solid #e9ecef;
}

.oxr-wrap .oxr-breakdown-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.oxr-wrap .oxr-breakdown-card h3 {
  margin: 0 0 20px 0;
  font-size: 1.125rem;
  color: #1e3a5f;
  border-bottom: 2px solid #28a745;
  padding-bottom: 10px;
}

.oxr-wrap .oxr-breakdown-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.oxr-wrap .oxr-breakdown-center {
  display: flex;
  justify-content: center;
}

.oxr-wrap .oxr-chart-mini {
  min-height: 250px;
  max-height: 350px;
}

.oxr-wrap .oxr-chart-mini canvas {
  max-height: 300px;
}

.oxr-wrap .oxr-chart-pie {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.oxr-wrap .oxr-chart-pie canvas {
  max-height: 350px;
}

/* Responsivo Breakdown */
@media (max-width: 1024px) {
  .oxr-wrap .oxr-breakdown-content {
    grid-template-columns: 1fr;
  }

  .oxr-wrap .oxr-chart-mini {
    margin-top: 20px;
  }
}

@media (max-width: 768px) {
  .oxr-wrap .oxr-breakdown-card {
    padding: 16px;
  }

  .oxr-wrap .oxr-breakdown-card h3 {
    font-size: 1rem;
  }
}

/* ========== AI Toggle Switch ========== */
.oxr-switch input:checked + .oxr-switch-slider {
  background: #22c55e;
}
.oxr-switch .oxr-switch-slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: .3s;
}
.oxr-switch input:checked + .oxr-switch-slider::before {
  transform: translateX(22px);
}

/* =========================================================
   KANBAN BOARD
   ========================================================= */

/* Wrapper full-width: escapa do max-width 980px do .oxr-wrap */
.oxr-wrap .oxr-kanban-fullwidth {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 0 20px;
  box-sizing: border-box;
}

.oxr-wrap .oxr-kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 16px 0 24px;
  -webkit-overflow-scrolling: touch;
}

.oxr-wrap .oxr-kanban-loading {
  text-align: center;
  padding: 40px;
  color: #6c757d;
  font-size: 0.875rem;
  width: 100%;
}

.oxr-wrap .oxr-kanban-column {
  min-width: 220px;
  max-width: none;
  flex: 1 1 220px;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.oxr-wrap .oxr-kanban-column-header {
  font-weight: 700;
  font-size: 0.8rem;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  text-align: center;
  color: #fff;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.oxr-wrap .oxr-kanban-count {
  background: rgba(255,255,255,0.3);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.oxr-wrap .oxr-kanban-stale-count {
  font-size: 0.69rem;
  opacity: 0.9;
}

.oxr-wrap .oxr-kanban-cards {
  flex: 1;
  overflow-y: auto;
  max-height: 500px;
  padding-right: 4px;
}

.oxr-wrap .oxr-kanban-cards::-webkit-scrollbar { width: 4px; }
.oxr-wrap .oxr-kanban-cards::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.oxr-wrap .oxr-kanban-card {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  cursor: grab;
  transition: box-shadow 0.2s, transform 0.15s;
  border-left: 4px solid transparent;
}

.oxr-wrap .oxr-kanban-card:active { cursor: grabbing; }

.oxr-wrap .oxr-kanban-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

.oxr-wrap .oxr-kanban-card.oxr-stale {
  border-left-color: #dc3545;
  background: linear-gradient(135deg, #fff5f5 0%, #fff 60%);
}

.oxr-wrap .oxr-kanban-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 6px;
}

.oxr-wrap .oxr-kanban-card-name {
  font-weight: 600;
  font-size: 0.8rem;
  color: #333;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.oxr-wrap .oxr-stale-badge {
  background: #dc3545;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.oxr-wrap .oxr-kanban-card-phone {
  font-size: 0.75rem;
  color: #555;
  margin-bottom: 6px;
}

.oxr-wrap .oxr-kanban-card-dates {
  display: flex;
  justify-content: space-between;
  font-size: 0.69rem;
  color: #888;
}

.oxr-wrap .oxr-kanban-card-dates span {
  display: inline-block;
}

.oxr-wrap .oxr-kanban-empty {
  text-align: center;
  padding: 24px 12px;
  color: #aaa;
  font-size: 0.8rem;
  font-style: italic;
}

.oxr-wrap .oxr-kanban-show-more {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  background: none;
  border: 1px dashed #ccc;
  border-radius: 8px;
  color: #1e3a5f;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.oxr-wrap .oxr-kanban-show-more:hover {
  background: #f0f7ff;
  border-color: #1e3a5f;
}

/* Ações inline no card (WhatsApp + Editar) */
.oxr-wrap .oxr-kanban-card-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}

.oxr-wrap .oxr-kanban-card-actions .oxr-btn-acao {
  width: 28px;
  height: 28px;
  margin: 0;
}

.oxr-wrap .oxr-kanban-card-actions .oxr-btn-acao svg {
  width: 14px;
  height: 14px;
}

/* Sortable.js — feedback visual durante drag */
.oxr-kanban-card-ghost {
  opacity: 0.4;
  background: #e3f2fd !important;
}

.oxr-kanban-card-chosen {
  cursor: grabbing;
}

.oxr-kanban-card-drag {
  transform: rotate(2deg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2) !important;
  cursor: grabbing;
}

/* Modal de movimentação / matrícula */
.oxr-kanban-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  animation: oxrFadeIn 0.15s ease;
}

@keyframes oxrFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.oxr-kanban-modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  min-width: 340px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
}

.oxr-kanban-modal h3 {
  margin: 0 0 16px;
  font-size: 1.05rem;
  color: #1e3a5f;
  font-weight: 700;
}

.oxr-kanban-modal label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: #555;
  font-weight: 500;
}

.oxr-kanban-modal select,
.oxr-kanban-modal input[type="text"],
.oxr-kanban-modal textarea {
  width: 100%;
  padding: 8px 10px;
  margin-top: 4px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  box-sizing: border-box;
}

.oxr-kanban-modal textarea {
  resize: vertical;
  min-height: 60px;
}

.oxr-kanban-modal select:focus,
.oxr-kanban-modal input[type="text"]:focus,
.oxr-kanban-modal textarea:focus {
  outline: none;
  border-color: #1e3a5f;
  box-shadow: 0 0 0 2px rgba(30,58,95,0.1);
}

.oxr-kanban-modal-readonly {
  margin-top: 4px;
  padding: 8px 10px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #333;
  font-weight: 600;
}

.oxr-kanban-modal-hint {
  display: inline;
  font-weight: 400;
  color: #888;
  font-size: 0.75rem;
  margin-left: 4px;
}

.oxr-kanban-quick-set {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.oxr-kanban-quick-set button {
  padding: 4px 10px;
  font-size: 0.72rem;
  background: #f0f7ff;
  border: 1px solid #d0e3ff;
  color: #1e3a5f;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

.oxr-kanban-quick-set button:hover {
  background: #e3eeff;
  border-color: #1e3a5f;
}

/* Modal de notas (lista timestamped) */
.oxr-kanban-modal-notes {
  max-width: 540px;
}

.oxr-kanban-notes-list {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding: 4px;
  background: #fafbfc;
  border-radius: 6px;
  border: 1px solid #eee;
}

.oxr-kanban-notes-loading,
.oxr-kanban-notes-empty {
  padding: 24px 12px;
  text-align: center;
  color: #999;
  font-size: 0.85rem;
  font-style: italic;
}

.oxr-kanban-note {
  padding: 10px 12px;
  margin-bottom: 6px;
  background: #fff;
  border-radius: 6px;
  border-left: 3px solid #1e3a5f;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.oxr-kanban-note:last-child { margin-bottom: 0; }

.oxr-kanban-note-meta {
  font-size: 0.72rem;
  color: #888;
  margin-bottom: 4px;
}

.oxr-kanban-note-meta strong {
  color: #1e3a5f;
  font-weight: 600;
}

.oxr-kanban-note-body {
  font-size: 0.85rem;
  color: #333;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.oxr-kanban-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

.oxr-kanban-modal-actions button {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s;
}

.oxr-kanban-modal-actions button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.oxr-kanban-btn-cancel {
  background: #fff;
  border-color: #ccc !important;
  color: #555;
}

.oxr-kanban-btn-cancel:hover {
  background: #f5f5f5;
}

.oxr-kanban-btn-save {
  background: #1e3a5f;
  color: #fff;
}

.oxr-kanban-btn-save:hover:not(:disabled) {
  background: #2c5282;
}

/* Kanban responsive */
@media (max-width: 768px) {
  .oxr-wrap .oxr-kanban-board {
    padding: 12px 0;
  }
  .oxr-wrap .oxr-kanban-column {
    min-width: 220px;
    flex: 1 0 220px;
  }
  .oxr-wrap .oxr-kanban-fullwidth {
    padding: 0 8px;
  }
}

/* =========================================================
   CALENDAR VIEW
   ========================================================= */

/* --- Section & Toolbar --- */
.oxr-calendar-section {
  margin-bottom: 24px;
}

.oxr-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px 8px 0 0;
  flex-wrap: wrap;
  gap: 8px;
}

.oxr-toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.oxr-calendar-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e3a5f;
  margin-left: 8px;
}

.oxr-view-switcher {
  display: flex;
  gap: 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  overflow: hidden;
}

.oxr-view-switcher .oxr-view-btn {
  border: none;
  border-radius: 0;
  padding: 6px 14px;
  font-size: 0.8rem;
  background: #fff;
  color: #555;
  cursor: pointer;
  transition: background 0.15s;
}

.oxr-view-switcher .oxr-view-btn + .oxr-view-btn {
  border-left: 1px solid #ccc;
}

.oxr-view-switcher .oxr-view-btn.active {
  background: #1e3a5f;
  color: #fff;
}

.oxr-view-switcher .oxr-view-btn:hover:not(.active) {
  background: #e9ecef;
}

.oxr-cal-today, .oxr-cal-prev, .oxr-cal-next {
  padding: 6px 12px;
  font-size: 0.8rem;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
}

.oxr-cal-prev, .oxr-cal-next {
  padding: 6px 10px;
  font-size: 1.125rem;
  font-weight: 700;
}

.oxr-cal-today:hover, .oxr-cal-prev:hover, .oxr-cal-next:hover {
  background: #e9ecef;
}

/* --- Calendar Grid Container --- */
.oxr-calendar-grid {
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: #fff;
  min-height: 200px;
}

.oxr-cal-loading, .oxr-cal-error {
  text-align: center;
  padding: 40px;
  color: #888;
  font-size: 0.875rem;
}

/* --- Month View --- */
.oxr-cal-month { }

.oxr-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f1f5f9;
  border-bottom: 1px solid #e0e0e0;
}

.oxr-cal-weekday {
  text-align: center;
  padding: 8px 4px;
  font-weight: 600;
  font-size: 0.75rem;
  color: #555;
  text-transform: uppercase;
}

.oxr-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.oxr-cal-month-day {
  min-height: 90px;
  border-right: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  padding: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.oxr-cal-month-day:hover { background: #f9fafb; }

.oxr-cal-month-day.oxr-cal-today {
  background: #e8f4fd;
}

.oxr-cal-month-day.oxr-cal-other-month {
  opacity: 0.4;
}

.oxr-cal-month-day.oxr-cal-blocked-day {
  background: #f5f5f5;
  opacity: 0.5;
}

.oxr-cal-day-number {
  font-size: 0.8rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.oxr-cal-today .oxr-cal-day-number {
  background: #1e3a5f;
  color: #fff;
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
}

.oxr-cal-day-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.oxr-cal-day-event {
  font-size: 0.69rem;
  color: #fff;
  padding: 2px 4px;
  border-radius: 3px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}

.oxr-cal-event-time {
  font-weight: 600;
}

.oxr-cal-day-more {
  font-size: 0.69rem;
  color: #1e3a5f;
  padding: 2px 4px;
  cursor: pointer;
}

/* --- Week/Day View --- */
.oxr-cal-week, .oxr-cal-day-view { }

.oxr-cal-week-header, .oxr-cal-day-view-header {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
  position: sticky;
  top: 0;
  z-index: 5;
}

.oxr-cal-time-gutter-header {
  width: 56px;
  flex-shrink: 0;
  border-right: 1px solid #e0e0e0;
}

.oxr-cal-col-header {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  font-size: 0.8rem;
  color: #555;
  border-right: 1px solid #f0f0f0;
}

.oxr-cal-col-header.oxr-cal-today {
  background: #e8f4fd;
  color: #1e3a5f;
  font-weight: 700;
}

.oxr-cal-week-body, .oxr-cal-day-view-body {
  display: flex;
  overflow-y: auto;
  max-height: 660px;
}

.oxr-cal-time-gutter {
  width: 56px;
  flex-shrink: 0;
  border-right: 1px solid #e0e0e0;
}

.oxr-cal-time-label {
  font-size: 0.69rem;
  color: #999;
  text-align: right;
  padding-right: 8px;
  padding-top: 0;
  box-sizing: border-box;
  position: relative;
}

.oxr-cal-time-label::after {
  content: '';
  position: absolute;
  top: 0;
  right: -8px;
  width: 8px;
  border-top: 1px solid #e0e0e0;
}

.oxr-cal-columns {
  display: flex;
  flex: 1;
  position: relative;
}

.oxr-cal-single-col { }

.oxr-cal-column {
  flex: 1;
  position: relative;
  border-right: 1px solid #f0f0f0;
}

.oxr-cal-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid #f0f0f0;
  pointer-events: none;
}

/* --- Events (positioned) --- */
.oxr-cal-event {
  border-radius: 4px;
  padding: 3px 5px;
  color: #fff;
  font-size: 0.69rem;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: box-shadow 0.15s;
  box-sizing: border-box;
  margin-left: 2px;
}

.oxr-cal-event:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
  z-index: 10 !important;
}

.oxr-cal-event .oxr-cal-event-time {
  font-weight: 700;
  font-size: 0.69rem;
}

.oxr-cal-event-title {
  font-weight: 600;
  font-size: 0.625rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.oxr-cal-event-detail {
  font-size: 0.625rem;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Blocked/Off-hours Overlays --- */
.oxr-cal-off-hours {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.04);
  z-index: 0;
  pointer-events: none;
}

.oxr-cal-blocked-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(0,0,0,0.05) 8px,
    rgba(0,0,0,0.05) 16px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
}

.oxr-cal-blocked-overlay span {
  background: rgba(0,0,0,0.08);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #888;
  font-weight: 600;
}

.oxr-cal-turma-block {
  position: absolute;
  left: 0;
  right: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(108, 117, 125, 0.1) 4px,
    rgba(108, 117, 125, 0.1) 8px
  );
  border-left: 3px solid #6c757d;
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  padding: 2px 6px;
}

.oxr-cal-turma-block span {
  font-size: 0.625rem;
  color: #6c757d;
  font-weight: 600;
}

/* --- Now Line --- */
.oxr-cal-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #dc3545;
  z-index: 4;
  pointer-events: none;
}

.oxr-cal-now-line::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  background: #dc3545;
  border-radius: 50%;
}

/* --- Calendar Responsive --- */
@media (max-width: 768px) {
  .oxr-calendar-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .oxr-toolbar-left {
    justify-content: center;
  }
  .oxr-toolbar-right {
    display: flex;
    justify-content: center;
  }
  .oxr-cal-month-day { min-height: 60px; }
  .oxr-cal-day-event { font-size: 0.625rem; }
  .oxr-cal-time-gutter { width: 40px; }
  .oxr-cal-time-gutter-header { width: 40px; }
  .oxr-cal-time-label { font-size: 0.625rem; padding-right: 4px; }
}
