/* ==========================================================================
   AMAS DASH - Painel Operacional da Recepção & Gestão de Horários
   ========================================================================== */

.dashboard-view {
  display: none;
}

.dashboard-view.active {
  display: block;
}

/* Barra de Resumo / Métricas Rápidas */
.dash-metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.dash-metric-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.dash-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  border-color: #cbd5e1;
}

.dash-metric-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
}

.dash-metric-card.green::before { background: var(--secondary); }
.dash-metric-card.amber::before { background: var(--accent); }
.dash-metric-card.blue::before { background: #0284c7; }
.dash-metric-card.purple::before { background: #8b5cf6; }
.dash-metric-card.emerald::before { background: #10b981; }

.metric-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.metric-data h4 {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.metric-number {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

/* Barra de Ferramentas da Recepção */
.dash-toolbar {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.dash-view-selector {
  display: flex;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.dash-subtab-btn {
  border: none;
  background: transparent;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-subtab-btn:hover {
  color: var(--primary);
}

.dash-subtab-btn.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.dash-actions-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-dash-action {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  transition: var(--transition);
}

.btn-morning-broadcast {
  background: linear-gradient(135deg, #128c7e, #075e54);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(18, 140, 126, 0.25);
}

.btn-morning-broadcast:hover {
  background: #075e54;
  transform: translateY(-1px);
}

.btn-new-queue-item {
  background: var(--primary);
  color: #ffffff;
}

.btn-new-queue-item:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ==========================================================================
   Grade Semanal de Disponibilidade (Matriz Visual de Horários)
   ========================================================================== */
.matrix-day-pills .filter-pill {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-main);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.matrix-day-pills .filter-pill:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: #ffffff;
}

.matrix-day-pills .filter-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(0, 37, 107, 0.25);
}

.matrix-day-pills .filter-pill .pill-count {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  margin-left: 2px;
}

.matrix-day-pills .filter-pill:not(.active) .pill-count {
  background: #e2e8f0;
  color: #475569;
}

.schedule-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: stretch;
}

/* Quando filtra apenas 1 dia, a coluna pode ocupar a largura, mas seus cards mantêm o padrão em grid */
.schedule-matrix-grid.single-day-view {
  grid-template-columns: 1fr;
}

.schedule-matrix-grid.single-day-view .schedule-day-column {
  max-width: 100%;
}

.schedule-matrix-grid.single-day-view .schedule-day-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding: 18px;
}

.schedule-day-column {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.schedule-day-column:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.schedule-day-column.today {
  border: 2px solid #10b981;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.18);
}

.schedule-day-header {
  background: #f8fafc;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.schedule-day-column.today .schedule-day-header {
  background: #ecfdf5;
  border-bottom-color: #a7f3d0;
}

.schedule-day-header h4 {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 2px;
  white-space: nowrap;
}

.schedule-day-column.today .schedule-day-header h4 {
  color: #065f46;
}

.day-badge-today {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
  text-transform: uppercase;
}

.schedule-day-column.today .day-badge-today {
  background: #10b981;
  color: #ffffff;
}

.doctors-count-tag {
  font-size: 0.72rem;
  font-weight: 700;
  background: #e6f4f1;
  color: #0F6E56;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid #c2e7df;
  white-space: nowrap;
}

.schedule-day-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  background: #f8fafc;
}

.doctor-schedule-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.doctor-schedule-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
}

.doctor-schedule-item:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(0, 37, 107, 0.09);
  transform: translateY(-2px);
}

.doc-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.doc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ebf1fa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  border: 1px solid #dbeafe;
}

.doc-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.25;
}

.doc-spec {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--secondary);
}

.doc-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  background: #f1f5f9;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.time-badge {
  font-weight: 700;
  color: #1e293b;
}

.format-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #475569;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==========================================================================
   Painel de Fila do Dia (Ordem de Chegada)
   ========================================================================== */
.daily-queue-container {
  display: block;
  width: 100%;
}

.queue-main-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.queue-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.queue-doctor-select-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.queue-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.queue-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  background: transparent;
  border-bottom: 2px solid var(--border);
}

.queue-table tbody tr {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.queue-table tbody tr:hover {
  background: #f8fafc;
  box-shadow: 0 4px 12px rgba(0, 37, 107, 0.06);
  transform: translateY(-1px);
}

.queue-table tbody tr.row-present {
  background: #f0fdf4;
  border-left: 4px solid #16a34a;
}

.queue-table td {
  padding: 14px 16px;
  font-size: 0.88rem;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}

.queue-table td:first-child {
  border-left: 1px solid #f1f5f9;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.queue-table td:last-child {
  border-right: 1px solid #f1f5f9;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.queue-pos-badge {
  display: inline-flex;
  width: 28px;
  height: 28px;
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 800;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
}

.queue-phone-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Consolas', monospace;
  font-size: 0.82rem;
  color: #334155;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  flex-shrink: 0;
}

.queue-patient-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.queue-patient-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ebf1fa;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #cbd5e1;
}

.queue-status-pill {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.queue-status-pill.aguardando { background: #fef3c7; color: #b45309; }
.queue-status-pill.chamado { background: #e0f2fe; color: #0284c7; }
.queue-status-pill.atendimento { background: #dcfce7; color: #15803d; }
.queue-status-pill.concluido { background: #f1f5f9; color: #64748b; }

/* Botão de Controle de Presença na Recepção */
.btn-presence-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-presence-toggle.present {
  background: #dcfce7;
  color: #15803d;
  border-color: #4ade80;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.15);
}

.btn-presence-toggle.present:hover {
  background: #bbf7d0;
  border-color: #22c55e;
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.25);
  transform: translateY(-1px);
}

.btn-presence-toggle.absent {
  background: #f8fafc;
  color: #64748b;
  border-color: #cbd5e1;
}

.btn-presence-toggle.absent:hover {
  background: #f1f5f9;
  color: #334155;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.queue-action-btns {
  display: flex;
  gap: 6px;
}

.btn-queue-action {
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-queue-action:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.current-calling-card {
  background: linear-gradient(135deg, var(--primary), #0a3d91);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.current-calling-card h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #93c5fd;
  margin-bottom: 8px;
}

.current-patient-name {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.current-doctor-info {
  font-size: 0.9rem;
  color: #e2e8f0;
  margin-bottom: 18px;
}

.btn-call-next {
  width: 100%;
  padding: 12px;
  background: var(--secondary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(15, 110, 86, 0.35);
}

.btn-call-next:hover {
  background: var(--secondary-dark);
}

/* ==========================================================================
   Modal do Disparo Matinal para Médicos (WhatsApp 1-Click)
   ========================================================================== */
.broadcast-doctor-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  background: var(--bg-main);
}

.broadcast-doctor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.broadcast-preview-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #25D366;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: 'Consolas', monospace;
  font-size: 0.78rem;
  white-space: pre-wrap;
  color: #334155;
  margin-bottom: 10px;
  max-height: 150px;
  overflow-y: auto;
}

.btn-send-single-wa {
  background: #25D366;
  color: #ffffff;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-send-single-wa:hover {
  background: #1eb956;
}

@media (max-width: 1024px) {
  .schedule-matrix-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .daily-queue-container {
    grid-template-columns: 1fr;
  }
  .dash-metrics-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .schedule-matrix-grid {
    grid-template-columns: 1fr;
  }
  .dash-metrics-bar {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   RECEPÇÃO PRO - GESTÃO DE PORTFÓLIO, ANTI-OVERBOOKING & LGPD
   ========================================================================== */

/* Toggle LGPD no Header */
.lgpd-toggle-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.lgpd-toggle-badge:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lgpd-toggle-badge.active {
  background: #10b981;
  border-color: #059669;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* Efeito LGPD Ativo */
body.lgpd-mode-active .lgpd-masked {
  filter: blur(0px);
  font-family: monospace;
  letter-spacing: 0.5px;
  color: var(--primary);
  background: rgba(0, 37, 107, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Medidor Anti-Overbooking & Capacidade */
.capacity-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: 10px;
}

.capacity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.capacity-progress-bg {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.capacity-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.capacity-progress-fill.free { background: #10b981; }
.capacity-progress-fill.warning { background: #f59e0b; }
.capacity-progress-fill.full { background: #ef4444; }
.capacity-progress-fill.blocked { background: #64748b; }

.badge-capacity-free {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-capacity-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-capacity-full {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  animation: pulse-border 2s infinite;
}

.badge-capacity-blocked {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Seção de Gestão de Portfólio & Escalas */
.portfolio-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
  background: #ffffff;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.doctor-admin-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.doctor-admin-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
}

.doctor-admin-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.doctor-admin-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.doctor-admin-avatar {
  font-size: 1.8rem;
  background: var(--primary-subtle);
  color: var(--primary);
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid #dbeafe;
  flex-shrink: 0;
}

.doctor-admin-info h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 2px;
  line-height: 1.3;
}

.doctor-admin-info .spec {
  display: inline-block;
  background: var(--secondary-subtle);
  color: var(--secondary);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 3px;
}

.doctor-admin-info .crm {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.days-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.day-chip {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.day-chip.active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: var(--primary);
}

.day-chip .remove-day-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.88rem;
  padding: 0 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.day-chip .remove-day-btn:hover {
  transform: scale(1.2);
}

.doctor-admin-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.doctor-admin-actions button {
  flex: 1;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 8px 10px;
  transition: var(--transition);
}

/* Modal WhatsApp D-1 Preview */
.whatsapp-preview-box {
  background: #e5ddd5;
  border-radius: 12px;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #111b21;
  position: relative;
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
}

.whatsapp-message-bubble {
  background: #ffffff;
  padding: 14px 16px;
  border-radius: 10px 10px 10px 0;
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  white-space: pre-wrap;
  position: relative;
}

.whatsapp-message-bubble .time-stamp {
  display: block;
  text-align: right;
  font-size: 0.7rem;
  color: #667781;
  margin-top: 6px;
}

/* White-Label Settings Box */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.color-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-input-wrapper input[type="color"] {
  width: 44px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

/* ==========================================================================
   DASHBOARDS & GESTÃO EXECUTIVA (ADMIN BI)
   ========================================================================== */
.exec-subtab-btn {
  padding: 8px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.exec-subtab-btn:hover {
  color: var(--primary);
  background: rgba(0, 37, 107, 0.05);
}

.exec-subtab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.exec-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1024px) {
  .exec-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .exec-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.exec-kpi-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.exec-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.exec-kpi-card.blue { border-top: 4px solid #0284c7; }
.exec-kpi-card.green { border-top: 4px solid #10b981; }
.exec-kpi-card.amber { border-top: 4px solid #f59e0b; }
.exec-kpi-card.purple { border-top: 4px solid #8b5cf6; }

.exec-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.exec-kpi-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.exec-kpi-number {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--text-main);
  margin-top: 6px;
  line-height: 1.1;
}

.exec-kpi-icon {
  font-size: 1.8rem;
  opacity: 0.85;
}

.exec-progress-bar-bg {
  width: 100%;
  height: 7px;
  background: #f1f5f9;
  border-radius: 10px;
  margin: 14px 0 10px;
  overflow: hidden;
}

.exec-progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.exec-progress-bar-fill.blue { background: #0284c7; }
.exec-progress-bar-fill.green { background: #10b981; }
.exec-progress-bar-fill.amber { background: #f59e0b; }
.exec-progress-bar-fill.purple { background: #8b5cf6; }

.exec-kpi-footnote {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.exec-panel-box {
  background: #ffffff;
  border-radius: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.exec-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.exec-panel-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.exec-audit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.exec-audit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.exec-audit-item:hover {
  background: #f1f5f9;
}

.badge-user-active {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-user-inactive {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-user-action {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #ffffff;
  transition: all 0.2s;
}

.btn-user-action:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-user-action.toggle-off {
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-user-action.toggle-off:hover {
  background: #fee2e2;
}

.btn-user-action.toggle-on {
  color: #16a34a;
  border-color: #86efac;
}

.btn-user-action.toggle-on:hover {
  background: #dcfce7;
}

/* ==========================================================================
   IA ANALÍTICA & ESTÚDIO DE GRÁFICOS (AMAS INTELLIGENCE)
   ========================================================================== */
.ai-prompt-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.ai-prompt-chip:hover {
  background: #f1f5f9;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.ai-chat-bubble {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 90%;
  animation: fadeIn 0.2s ease;
}

.ai-chat-bubble.bot {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 3px solid var(--secondary);
  color: var(--text-main);
}

.ai-chat-bubble.user {
  align-self: flex-end;
  background: var(--primary);
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.custom-chart-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  position: relative;
}

.custom-chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.custom-chart-card-header h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}

.btn-remove-pinned-chart {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-remove-pinned-chart:hover {
  background: #fca5a5;
}

.ai-filter-preset-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  font-size: 0.73rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-filter-preset-btn:hover {
  background: #f1f5f9;
  border-color: var(--primary);
  color: var(--primary);
}

.ai-filter-preset-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}



/* ==========================================================================
   ARQUITETURA DE MENU LATERAL (SIDEBAR ESTILO ERP TOTVS / SAP / SAAS MÉDICO)
   ========================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--bg-main);
  position: relative;
}

/* ==========================================================================
   MENU LATERAL INTELIGENTE (HOVER DRAWER EXPANSÍVEL & SUAVE ESTILO SAP FIORI)
   ========================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: #f8fafc;
  position: relative;
}

/* Sidebar Vertical Compacta por padrão, Auto-Expansível no Hover */
.app-sidebar {
  width: 68px; /* Modo recolhido leve de ícones */
  min-width: 68px;
  background: #f0f4f9; /* Azulzinho clarinho corporativo SAP */
  color: #1e293b;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1050;
  border-right: 1.5px solid #d0dbe9;
  box-shadow: 2px 0 10px rgba(10, 37, 64, 0.04);
  transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease;
  overflow-x: hidden;
  overflow-y: hidden;
  will-change: width;
}

/* Espaçamento do Conteúdo para conviver com a barra recolhida */
.app-main-content {
  flex: 1;
  min-width: 0;
  margin-left: 68px; /* Deixa a área útil livre */
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  overflow-x: hidden;
  transition: margin-left 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ESTADO EXPANDIDO SUAVE: Ao passar o mouse na barra (Hover Drawer) ou se estiver Fixado */
.app-sidebar:hover,
.app-sidebar.pinned {
  width: 310px; /* Amplo espaço para que nada seja cortado */
  box-shadow: 14px 0 35px rgba(0, 37, 107, 0.16);
  overflow-y: auto;
}

/* Se o usuário preferir fixar aberto */
.app-layout.sidebar-pinned .app-main-content {
  margin-left: 310px;
}

/* Header da Sidebar */
.sidebar-header {
  padding: 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid #d0dbe9;
  background: #e6eef7;
  gap: 8px;
  min-height: 64px;
  box-sizing: border-box;
}

.sidebar-brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  flex-shrink: 0;
}

.sidebar-brand-text {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.app-sidebar:hover .sidebar-brand-text,
.app-sidebar.pinned .sidebar-brand-text {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.sidebar-brand-text h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #00256B;
  letter-spacing: -0.3px;
  margin: 0;
  line-height: 1.1;
}

.sidebar-brand-text span {
  font-size: 0.70rem;
  color: #475569;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* Botão de Fixar / Desafixar Menu */
.sidebar-pin-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e3a5f;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.15s;
  flex-shrink: 0;
}

.app-sidebar:hover .sidebar-pin-btn,
.app-sidebar.pinned .sidebar-pin-btn {
  display: flex;
}

.sidebar-pin-btn:hover {
  background: #dbe7f5;
  color: #00256B;
}

/* Badge de Ambiente Homologação */
.sidebar-env-badge {
  margin: 10px 10px 2px 10px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  justify-content: center;
}

.sidebar-env-badge .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
  flex-shrink: 0;
}

.sidebar-env-badge span:not(.pulse-dot) {
  opacity: 0;
  visibility: hidden;
  display: none;
  transition: opacity 0.2s ease;
}

.app-sidebar:hover .sidebar-env-badge span:not(.pulse-dot),
.app-sidebar.pinned .sidebar-env-badge span:not(.pulse-dot) {
  opacity: 1;
  visibility: visible;
  display: inline;
}

.app-sidebar:hover .sidebar-env-badge,
.app-sidebar.pinned .sidebar-env-badge {
  justify-content: flex-start;
}

/* Menu de Navegação - Estilo SAP */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Separadores de Menu - Estilo Executivo AMAS / SAP */
.nav-section-title {
  font-size: 0.70rem;
  font-weight: 800;
  color: #1e3a5f;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  white-space: nowrap;
  border-top: none;
  margin: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  height: 0;
  overflow: hidden;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
  box-sizing: border-box;
}

.app-sidebar:hover .nav-section-title,
.app-sidebar.pinned .nav-section-title {
  opacity: 1;
  visibility: visible;
  height: auto;
  min-height: 28px;
  overflow: visible;
  flex-shrink: 0;
  border-top: 1.5px solid #d8e2ee;
  margin-top: 14px;
  margin-bottom: 6px;
  padding: 10px 10px 4px 10px;
  line-height: 1.4;
  display: block;
}

.app-sidebar:hover .sidebar-nav > .nav-section-title:first-child,
.app-sidebar.pinned .sidebar-nav > .nav-section-title:first-child {
  border-top: none;
  margin-top: 4px;
  margin-bottom: 6px;
  padding-top: 6px;
  padding-bottom: 4px;
  min-height: 24px;
}

/* Itens de Navegação */
.sidebar-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  position: relative;
  white-space: nowrap;
  box-sizing: border-box;
  flex-shrink: 0;
}

.sidebar-nav-item:hover {
  background: #dbe7f5;
  color: #0f2d4a;
}

/* Item Ativo - SAP Classic Blue */
.sidebar-nav-item.active {
  background: #004b87;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 75, 135, 0.25);
}

.sidebar-nav-item.active:hover {
  background: #003e70;
  color: #ffffff;
}

.sidebar-nav-item .nav-icon {
  font-size: 1.25rem;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav-item .nav-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s 0.05s ease;
}

.app-sidebar:hover .sidebar-nav-item .nav-label,
.app-sidebar.pinned .sidebar-nav-item .nav-label {
  opacity: 1;
  visibility: visible;
}

/* Badge NOVO - 100% Protegido contra Cortes */
.sidebar-nav-item .nav-badge-new {
  margin-left: auto;
  flex-shrink: 0;
  background: #059669;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2.5px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s 0.05s ease;
}

.app-sidebar:hover .sidebar-nav-item .nav-badge-new,
.app-sidebar.pinned .sidebar-nav-item .nav-badge-new {
  opacity: 1;
  visibility: visible;
}

/* Topbar Limpa com Usuário Integrado */
.app-topbar {
  background: #ffffff;
  border-bottom: 1.5px solid #d0dbe9;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 99;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #00256B;
  letter-spacing: -0.3px;
  margin: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* User Badge e Logout no Topbar */
.topbar-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 5px 12px;
  border-radius: 8px;
}

.topbar-user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f2d4a;
}

.topbar-logout-btn {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.topbar-logout-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
}


.clinics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.clinic-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.clinic-card:hover {
  border-color: #0284c7;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.clinic-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.clinic-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #00256B;
  margin-bottom: 4px;
}

.clinic-type-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.clinic-type-badge.sede {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.clinic-type-badge.externo {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.clinic-info-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.84rem;
  color: #475569;
  margin-bottom: 8px;
}

.clinic-info-row strong {
  color: #0f172a;
}

.clinic-instruction-alert {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #92400e;
  line-height: 1.4;
  margin: 12px 0;
}

.clinic-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

/* ==========================================================================
   MÓDULO: TEMPLATES DE WHATSAPP COM PREVIEW AO VIVO
   ========================================================================== */
.wpp-settings-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 24px;
  margin-top: 20px;
}

@media (max-width: 1024px) {
  .wpp-settings-layout {
    grid-template-columns: 1fr;
  }
}

.wpp-template-box {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.wpp-tags-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px 0;
  padding: 10px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
}

.wpp-tag-pill {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.wpp-tag-pill:hover {
  background: #0284c7;
  color: #ffffff;
  transform: scale(1.04);
}

.wpp-preview-mockup {
  background: #efeae2;
  border-radius: 24px;
  border: 8px solid #1f2937;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  max-width: 360px;
  margin: 0 auto;
}

.wpp-mockup-header {
  background: #075e54;
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wpp-mockup-body {
  padding: 16px 12px;
  min-height: 420px;
  background-image: radial-gradient(#d1d5db 1px, transparent 1px);
  background-size: 16px 16px;
}

.wpp-chat-bubble {
  background: #ffffff;
  border-radius: 8px 8px 8px 0;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: #111827;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   MÓDULO: COMPROVANTES & RECIBOS OFICIAIS AMAS (PADRÃO FISCAL / IMPRESSÃO)
   ========================================================================== */
.receipts-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.receipt-categories-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.receipt-cat-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.receipt-cat-pill:hover,
.receipt-cat-pill.active {
  background: #00256B;
  color: #ffffff;
  border-color: #00256B;
}

.receipt-templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-top: 14px;
}

.receipt-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.receipt-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 37, 107, 0.09);
  border-color: #93c5fd;
}

.receipt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 8px;
}

.receipt-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: #00256B;
  margin: 0;
  line-height: 1.3;
}

.receipt-card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}

.receipt-mini-paper {
  background: #fffdfa;
  border: 1.5px dashed #cbd5e1;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
  position: relative;
}

.receipt-mini-paper-header {
  text-align: center;
  border-bottom: 1px dotted #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.receipt-mini-paper-logo {
  font-size: 0.72rem;
  font-weight: 900;
  color: #00256B;
  letter-spacing: 0.5px;
}

.receipt-mini-paper-slogan {
  font-size: 0.65rem;
  color: #64748b;
  font-style: italic;
}

.receipt-mini-paper-redtitle {
  font-size: 0.78rem;
  font-weight: 900;
  color: #dc2626;
  text-transform: uppercase;
  margin: 6px 0;
  letter-spacing: 0.5px;
  text-align: center;
}

.receipt-mini-paper-body {
  font-size: 0.78rem;
  color: #1e293b;
  line-height: 1.45;
  margin-bottom: 10px;
}

.receipt-mini-paper-footer {
  font-size: 0.7rem;
  color: #64748b;
  border-top: 1px dotted #e2e8f0;
  padding-top: 6px;
}

.receipt-tag-chip {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  margin: 2px;
  transition: all 0.15s;
  user-select: none;
}

.receipt-tag-chip:hover {
  background: #0284c7;
  color: #ffffff;
  transform: scale(1.05);
}

.receipt-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  margin-top: auto;
}

/* ==========================================================================
   PALETA DE FORMATAÇÃO E EMOJIS PARA INSTRUÇÕES DE CONSULTÓRIO
   ========================================================================== */
.clinic-palette-container {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-palette-tool {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  color: #334155;
  font-weight: 600;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  user-select: none;
}

.btn-palette-tool:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-palette-tag {
  border-radius: 12px;
  padding: 2px 9px;
  font-size: 0.72rem;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid transparent;
  user-select: none;
}

.btn-palette-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tag-urgente { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.tag-atencao { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.tag-pagamento { background: #dcfce7; color: #166534; border-color: #86efac; }
.tag-local { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }
.tag-horario { background: #f3e8ff; color: #6b21a8; border-color: #d8b4fe; }
.tag-doc { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }

.palette-emoji-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.15s ease;
  user-select: none;
}

.palette-emoji-btn:hover {
  background: #e2e8f0;
  transform: scale(1.18);
  border-color: #cbd5e1;
}

