:root {
  --bg-main: #fcfbf9;
  --bg-card: #ffffff;
  --bg-card-hover: #fbf7f4;
  --border-color: #e2d9d2;
  --border-focus: #b86e5c;
  
  --primary: #a85d4c; /* Rose Gold Terracota elegante, com contraste 5.2:1 em fundo branco */
  --primary-light: #7c3a2d; /* Rose escuro e nítido para textos e títulos em fundo claro */
  --primary-surface: #fdf6f3; /* Fundo suave para cards e blocos */
  --primary-dark: #5c2217;
  --primary-glow: rgba(168, 93, 76, 0.2);
  --gold-gradient: linear-gradient(135deg, #c98877 0%, #a85d4c 50%, #8c4333 100%);
  --gold-gradient-soft: linear-gradient(135deg, rgba(168, 93, 76, 0.08) 0%, rgba(168, 93, 76, 0.02) 100%);
  
  --success: #059669;
  --success-dark: #047857;
  --warning: #b45309;
  --warning-dark: #92400e;
  --danger: #b91c1c;
  --danger-dark: #991b1b;
  --info: #0284c7;
  --info-dark: #0369a1;
  --purple: #7c3aed;
  --purple-dark: #6b21a8;
  
  --text-primary: #0f172a; /* Preto azulado ultra nítido (contraste 16:1) */
  --text-secondary: #334155; /* Cinza grafite escuro (contraste 9:1) */
  --text-muted: #526074; /* Cinza médio nítido e legível (contraste 5.5:1) */
  
  --sidebar-width: 275px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 4px 20px rgba(160, 130, 120, 0.08);
  --shadow-glow: 0 4px 25px rgba(168, 93, 76, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(201, 136, 119, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(201, 136, 119, 0.05) 0%, transparent 50%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Layout Geral */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  position: fixed;
  height: 100vh;
  z-index: 100;
  backdrop-filter: blur(12px);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Botão de Recolher Sidebar Desktop */
.btn-sidebar-collapse {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  background: rgba(168, 93, 76, 0.08);
  border: 1px solid rgba(168, 93, 76, 0.25);
  color: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.25s ease;
  z-index: 10;
}

.btn-sidebar-collapse:hover {
  background: var(--primary);
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 2px 10px rgba(168, 93, 76, 0.3);
}

.desktop-sidebar-toggle {
  display: none;
  background: rgba(168, 93, 76, 0.08);
  border: 1px solid rgba(168, 93, 76, 0.25);
  color: var(--primary);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  margin-right: 12px;
}

@media (min-width: 769px) {
  .desktop-sidebar-toggle {
    display: inline-flex;
  }
}

.desktop-sidebar-toggle:hover {
  background: var(--primary);
  color: #ffffff;
  transform: scale(1.05);
}

/* Rótulos de Seções do Menu Lateral */
.nav-section-label {
  padding: 14px 10px 4px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8c9ba5;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  transition: opacity 0.2s ease;
}

.nav-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(226, 217, 210, 0.5);
}

/* Sidebar Recolhida (Collapsed) */
.sidebar.collapsed {
  width: 76px;
  padding: 16px 8px;
}

.sidebar.collapsed .brand {
  padding-bottom: 12px;
  margin-bottom: 12px;
  gap: 6px;
}

.sidebar.collapsed .btn-sidebar-collapse {
  position: static;
  margin: 0 auto 6px auto;
  width: 32px;
  height: 32px;
}

.sidebar.collapsed .brand-logo-wrap {
  max-width: 44px;
  padding: 4px;
  border-radius: 8px;
}

.sidebar.collapsed .brand-text {
  display: none !important;
}

.sidebar.collapsed .nav-section-label {
  padding: 6px 0;
  margin: 6px 4px;
  height: 1px;
  overflow: hidden;
  background: var(--border-color);
}

.sidebar.collapsed .nav-section-label span,
.sidebar.collapsed .nav-section-label::after {
  display: none !important;
}

.sidebar.collapsed .nav-item {
  padding: 9px 0;
  justify-content: center;
  border-radius: 10px;
}

.sidebar.collapsed .nav-item span:not(.pending-badge):not(.live-dot) {
  display: none !important;
}

.sidebar.collapsed .nav-item i {
  width: 38px;
  height: 38px;
  font-size: 16px;
  margin: 0 auto;
}

.sidebar.collapsed .nav-item .pending-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  font-size: 9px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.sidebar.collapsed .nav-item .live-dot {
  position: absolute;
  top: 4px;
  right: 12px;
  width: 7px;
  height: 7px;
}

.sidebar.collapsed .doctor-profile-card {
  padding: 8px 4px;
  justify-content: center;
}

.sidebar.collapsed .doctor-profile-card .doc-info {
  display: none !important;
}

/* Tratamento de Rolagem e Layout na Sidebar Recolhida */
.sidebar.collapsed {
  width: 76px !important;
  padding: 14px 6px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: 100vh !important;
  scrollbar-width: thin;
}

.sidebar.collapsed::-webkit-scrollbar {
  width: 4px;
}

.sidebar.collapsed::-webkit-scrollbar-thumb {
  background: rgba(168, 93, 76, 0.25);
  border-radius: 4px;
}

/* Botão de Agendamento Rápido na Barra Lateral */
.sidebar-new-appointment-btn {
  background: linear-gradient(135deg, #a85d4c 0%, #8c4434 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(168, 93, 76, 0.28);
  margin-bottom: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.sidebar-new-appointment-btn:hover {
  background: linear-gradient(135deg, #b96957 0%, #9c4c3b 100%);
  box-shadow: 0 5px 14px rgba(168, 93, 76, 0.4);
  transform: translateY(-1px);
}

.sidebar.collapsed .sidebar-new-appointment-btn {
  width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  margin: 0 auto 10px auto !important;
  border-radius: 10px !important;
  justify-content: center !important;
  position: relative;
}

.sidebar.collapsed .sidebar-new-appointment-btn span {
  display: none !important;
  width: 0 !important;
  opacity: 0 !important;
}

.sidebar.collapsed .sidebar-new-appointment-btn::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 56px;
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: #0f172a;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 1000;
}

.sidebar.collapsed .sidebar-new-appointment-btn:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.sidebar.collapsed .sidebar-header-row {
  justify-content: center !important;
  gap: 0 !important;
  padding-bottom: 8px !important;
  margin-bottom: 8px !important;
}

.sidebar.collapsed .sidebar-header-row .btn-sidebar-collapse {
  margin: 0 auto !important;
}

.sidebar.collapsed .sidebar-header-title,
.sidebar.collapsed .sidebar-header-title *,
.sidebar.collapsed .mobile-sidebar-close {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
}

.sidebar.collapsed .sidebar-user-pill {
  justify-content: center !important;
  padding: 4px 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin-bottom: 10px !important;
}

.sidebar.collapsed .sidebar-user-avatar {
  margin: 0 auto !important;
}

.sidebar.collapsed .sidebar-user-details,
.sidebar.collapsed .sidebar-user-name,
.sidebar.collapsed .sidebar-user-role,
.sidebar.collapsed .sidebar-user-edit-btn {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
}

.sidebar.collapsed .sidebar-action-footer {
  grid-template-columns: 1fr !important;
  gap: 6px !important;
  padding-top: 8px !important;
}

.sidebar.collapsed .sidebar-footer-btn {
  padding: 8px 0 !important;
  justify-content: center !important;
  font-size: 13px !important;
  position: relative;
}

.sidebar.collapsed .sidebar-footer-btn span {
  display: none !important;
  width: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
}

/* Tooltips Flutuantes no Menu Recolhido */
.sidebar.collapsed .nav-item {
  position: relative;
}

.sidebar.collapsed .nav-item::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 80px;
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: #0f172a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 1000;
}

.sidebar.collapsed .nav-item:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.sidebar.collapsed .sidebar-footer-btn::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 80px;
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 1000;
}

.sidebar.collapsed .sidebar-footer-btn:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
  position: relative;
}

.brand-logo-wrap {
  width: 100%;
  max-width: 200px;
  background: #ffffff;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(197, 168, 128, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand-logo-wrap:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(197, 168, 128, 0.3), 0 0 0 1px var(--primary);
}

.ambiance-nav-logo {
  max-width: 100%;
  height: auto;
  max-height: 48px;
  object-fit: contain;
}

.brand-text h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #1e293b;
  margin-top: 4px;
}

.brand-subtext {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary);
  font-weight: 600;
  display: block;
}

.badge-status {
  font-size: 11px;
  color: var(--success-light);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 4px;
}

.badge-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  box-shadow: 0 0 8px var(--success);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-align: left;
}

.nav-item i {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ícones Coloridos do Menu Lateral — Estilo Painel Médico */
.nav-item[data-tab="dashboard"] i {
  background: rgba(197, 168, 128, 0.16);
  color: #e8d9c5;
  border: 1px solid rgba(197, 168, 128, 0.35);
  box-shadow: 0 2px 8px rgba(197, 168, 128, 0.15);
}
.nav-item[data-tab="calendar"] i {
  background: rgba(99, 102, 241, 0.16);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}
.nav-item[data-tab="approvals"] i {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}
.nav-item[data-tab="pending-reschedules"] i {
  background: rgba(249, 115, 22, 0.16);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.35);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.15);
}
.nav-item[data-tab="patients"] i {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}
.nav-item[data-tab="campaigns"] i {
  background: rgba(236, 72, 153, 0.16);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.35);
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.15);
}
.nav-item[data-tab="pricing"] i {
  background: rgba(234, 179, 8, 0.16);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.15);
}
.nav-item[data-tab="simulator"] i {
  background: rgba(6, 182, 212, 0.16);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.15);
}
.nav-item[data-tab="team"] i {
  background: rgba(139, 92, 246, 0.16);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}
.nav-item[data-tab="channels"] i {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}
.nav-item[data-tab="doctor-schedules"] i {
  background: rgba(14, 165, 233, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.35);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
}
.nav-item[data-tab="settings"] i {
  background: rgba(217, 70, 239, 0.16);
  color: #e879f9;
  border: 1px solid rgba(217, 70, 239, 0.35);
  box-shadow: 0 2px 8px rgba(217, 70, 239, 0.15);
}
.nav-item[data-tab="audit-logs"] i {
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

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

.nav-item:hover i {
  transform: scale(1.14);
  filter: brightness(1.25);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(201, 136, 119, 0.15), transparent);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

.nav-item.active i {
  transform: scale(1.08);
  filter: brightness(1.1);
  box-shadow: 0 0 10px rgba(201, 136, 119, 0.35);
}

.pending-badge {
  margin-left: auto;
  background: var(--warning);
  color: #ffffff;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
}

.live-dot {
  margin-left: auto;
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
}

.doctor-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(180, 150, 140, 0.08);
}

.doc-avatar {
  width: 38px;
  height: 38px;
  background: rgba(201, 136, 119, 0.15);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid rgba(201, 136, 119, 0.3);
}

.doc-info h4 {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.doc-info p {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Conteúdo Principal */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 24px 36px;
  max-width: calc(100% - var(--sidebar-width));
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-container.sidebar-collapsed .main-content {
  margin-left: 76px;
  max-width: calc(100% - 76px);
}

/* Topbar com Glassmorphism e Sombra Suave */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(168, 93, 76, 0.05);
  position: sticky;
  top: 14px;
  z-index: 40;
  transition: all 0.25s ease;
}

.topbar-left {
  display: flex;
  align-items: center;
}

.topbar-left h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin-top: 3px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.system-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--success-light);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 20px;
}

.pulse-green {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn-primary {
  background: var(--gold-gradient);
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(168, 93, 76, 0.3);
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: rotate(25deg);
  transition: none;
  pointer-events: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 93, 76, 0.45);
  filter: brightness(1.04);
}

.btn-primary:hover::after {
  left: 125%;
  transition: all 0.65s ease-in-out;
}

/* Scrollbar Premium Fina */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(168, 93, 76, 0.22);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 93, 76, 0.45);
}

/* Efeito de Elevação Suave e Brilho nos Cards */
.content-card, .metric-card, .info-card {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
}

.content-card:hover, .metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -4px rgba(168, 93, 76, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.03);
  border-color: rgba(168, 93, 76, 0.3);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(180, 150, 140, 0.06);
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #faf7f2;
  border-color: var(--primary);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Tabs */
.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards de Métricas */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.2s;
}

.metric-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-sm);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-title {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.alert-bg { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.success-bg { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.info-bg { background: rgba(197, 168, 128, 0.15); color: var(--primary-light); }
.purple-bg { background: rgba(139, 92, 246, 0.15); color: var(--purple); }

.metric-value {
  font-size: 32px;
  font-weight: 700;
  margin: 12px 0 6px;
  font-family: 'Outfit', sans-serif;
}

.metric-footer {
  font-size: 12px;
}

.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
.text-muted { color: var(--text-muted); }
.text-purple { color: var(--purple); }
.text-primary { color: var(--primary); }

/* Split no Dashboard */
.dashboard-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
}

.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

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

.header-with-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.date-badge {
  background: rgba(201, 136, 119, 0.12);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  border: 1px solid rgba(201, 136, 119, 0.25);
}

/* Lista de Aprovações Pendentes */
.pending-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pending-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 2px 10px rgba(180, 150, 140, 0.06);
  transition: all 0.2s;
}

.pending-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(201, 136, 119, 0.15);
}

.pending-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.patient-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.channel-tag.whatsapp {
  background: rgba(37, 211, 102, 0.15);
  color: #25d366;
}

.channel-tag.instagram {
  background: rgba(225, 48, 108, 0.15);
  color: #e1306c;
}

.patient-name {
  font-weight: 600;
  font-size: 15px;
}

.requested-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
}

.pending-item-details {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.5;
}

.pending-item-actions {
  display: flex;
  gap: 10px;
}

.btn-approve {
  background: var(--success);
  color: white;
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-approve:hover {
  background: var(--success-light);
  transform: translateY(-1px);
}

.btn-reject {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reject:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* Timeline da Agenda */
.schedule-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schedule-slot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 4px solid transparent;
  box-shadow: 0 2px 8px rgba(180, 150, 140, 0.05);
}

.schedule-slot.booked {
  border-left-color: var(--primary);
  background: #ffffff;
}

.slot-time-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 84px;
  flex-shrink: 0;
}

.slot-time {
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
}

.slot-date-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(201, 136, 119, 0.12);
  border: 1px solid rgba(201, 136, 119, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.schedule-slot.cancelled .slot-date-sub {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  text-decoration: none;
}

.schedule-slot.clickable-slot {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.schedule-slot.clickable-slot:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  background: #faf7f2;
  box-shadow: 0 4px 18px rgba(201, 136, 119, 0.15);
}

.schedule-slot.cancelled.clickable-slot:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.15);
}

/* Efeito pulsante ao navegar para o agendamento na Agenda Mensal */
@keyframes slotPulseHighlight {
  0% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.8);
    border-color: #e8d9c5;
    background: rgba(197, 168, 128, 0.25);
  }
  50% {
    box-shadow: 0 0 25px 6px rgba(56, 189, 248, 0.45);
    border-color: #e8d9c5;
    background: rgba(197, 168, 128, 0.15);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
  }
}

.slot-highlight-pulse {
  animation: slotPulseHighlight 2.5s ease-in-out;
  border-color: #e8d9c5 !important;
}

.slot-patient {
  flex: 1;
}

.slot-patient h5 {
  font-size: 14px;
  font-weight: 600;
}

.slot-patient p {
  font-size: 12px;
  color: var(--text-muted);
}

.slot-status-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.status-confirmed {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-light);
}

.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

/* Estilo para Agendamento Cancelado (Visual Marcante SEM Tachar Informações do Cliente) */
.schedule-slot.cancelled {
  border-left: 4px solid #ef4444;
  border-top: 1px solid rgba(239, 68, 68, 0.2);
  border-right: 1px solid rgba(239, 68, 68, 0.2);
  border-bottom: 1px solid rgba(239, 68, 68, 0.2);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.05) 0%, #ffffff 100%);
  opacity: 1;
}

.schedule-slot.cancelled .slot-patient h5 {
  text-decoration: none !important;
  color: #1e293b;
  font-weight: 600;
}

.schedule-slot.cancelled .slot-patient p {
  text-decoration: none !important;
  color: #64748b;
}

.schedule-slot.cancelled .slot-time {
  text-decoration: none !important;
  color: #ef4444;
  font-weight: 700;
}

.status-cancelled {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.1);
}

/* Selo Circular Ⓡ para Horários Remanejados com Sucesso */
.badge-rescheduled-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #ffffff;
  font-weight: 800;
  font-size: 11px;
  margin-left: 6px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
  border: 1.5px solid #93c5fd;
  vertical-align: middle;
  cursor: help;
}

.badge-reschedule-meta {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  margin-left: 6px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Barra de Filtro Separada por Médico na Agenda Médica */
.doctor-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
}

.doctor-filter-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.doctor-filter-pills {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.doc-filter-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.doc-filter-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.doc-filter-pill.active {
  background: var(--primary);
  border-color: var(--primary-light);
  color: #fff;
  box-shadow: 0 0 10px rgba(197, 168, 128, 0.4);
  font-weight: 600;
}

.doc-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 10px;
  margin-bottom: 4px;
  border-left: 3px solid var(--primary);
}

.btn-cancel-slot {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 13px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-cancel-slot:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.btn-redirect-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #22c55e;
  color: #ffffff;
  font-weight: 600;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  margin-top: 10px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-redirect-whatsapp:hover {
  background: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.45);
}

/* SIMULADOR DE CANAIS */
.simulator-wrapper {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: start;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-light);
  background: rgba(197, 168, 128, 0.15);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.info-card h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.info-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.scenario-suggestions h4 {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scenario-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  background: rgba(197, 168, 128, 0.15);
  border-color: var(--primary);
  color: var(--primary-light);
}

.how-it-works-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 18px;
  border-radius: var(--radius-md);
}

.how-it-works-box h4 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.how-it-works-box ol {
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Smartphone Mockup */
.phone-mockup-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.channel-toggle-bar {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 4px;
  margin-bottom: 16px;
  width: 100%;
  max-width: 360px;
}

.btn-channel {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-channel.active {
  background: var(--primary);
  color: white;
}

.btn-channel#btn-chan-whatsapp.active {
  background: #25d366;
  color: #0b1120;
}

.btn-channel#btn-chan-instagram.active {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: white;
}

.phone-frame {
  width: 360px;
  height: 620px;
  background: #0f172a;
  border: 10px solid #1e293b;
  border-radius: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), var(--shadow-glow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.phone-notch {
  width: 120px;
  height: 18px;
  background: #1e293b;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  z-index: 50;
}

.phone-header {
  background: #1f2c34;
  padding: 24px 16px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-contact-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  background: #c5a880;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.chat-contact-info h4 {
  font-size: 14px;
  font-weight: 600;
}

.online-status {
  font-size: 11px;
  color: #25d366;
}

.chat-actions {
  color: var(--text-secondary);
  display: flex;
  gap: 14px;
  font-size: 14px;
}

.phone-body {
  flex: 1;
  background: #0b141a;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Balões de Mensagens */
.bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  position: relative;
  word-break: break-word;
  animation: messagePop 0.25s ease;
}

@keyframes messagePop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.bubble.patient {
  align-self: flex-end;
  background: #005c4b;
  color: #e9edef;
  border-bottom-right-radius: 2px;
}

.bubble.ai {
  align-self: flex-start;
  background: #202c33;
  color: #e9edef;
  border-bottom-left-radius: 2px;
}

/* Instagram Theme Variations */
.phone-frame.theme-instagram .phone-header {
  background: #121212;
}

.phone-frame.theme-instagram .phone-body {
  background: #000000;
}

.phone-frame.theme-instagram .bubble.patient {
  background: #3797f0;
}

.phone-frame.theme-instagram .bubble.ai {
  background: #262626;
}

.bubble-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  display: block;
  text-align: right;
  margin-top: 4px;
}

.phone-footer {
  background: #1f2c34;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.phone-footer input {
  flex: 1;
  background: #2a3942;
  border: none;
  padding: 10px 14px;
  border-radius: 20px;
  color: white;
  font-size: 13px;
  outline: none;
}

.phone-footer input::placeholder {
  color: #8696a0;
}

.send-btn {
  width: 36px;
  height: 36px;
  background: #00a884;
  border: none;
  color: #0b1120;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}

/* ABA CANAIS */
.channels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.channel-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.channel-card-header i {
  font-size: 32px;
}

.whatsapp-header i { color: #25d366; }
.instagram-header i { color: #e1306c; }

.channel-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

.channel-status.online {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-light);
}

.channel-status.pending {
  background: rgba(197, 168, 128, 0.15);
  color: var(--primary-light);
}

.qr-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.qr-code-img {
  background: white;
  padding: 10px;
  border-radius: 8px;
}

.qr-code-img img {
  display: block;
}

.qr-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.step-guide {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.step-guide strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 8px;
}

.step-guide ol, .step-guide ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.webhook-info {
  font-size: 12px;
  color: var(--text-muted);
}

.webhook-info label {
  display: block;
  margin-bottom: 4px;
}

.webhook-info code {
  display: block;
  background: #0b1120;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--primary-light);
  font-family: monospace;
}

.insta-integration-box {
  text-align: center;
  padding: 28px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.insta-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: white;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.btn-insta-connect {
  background: #1877f2;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* FORMULÁRIO DE CONFIGURAÇÕES */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input, .form-group select, .form-group textarea {
  background: #ffffff !important;
  border: 1px solid rgba(201, 136, 119, 0.25) !important;
  color: #1e293b !important;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(180, 150, 140, 0.04);
}

.form-group select option {
  background-color: #ffffff !important;
  color: #1e293b !important;
  padding: 12px;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(201, 136, 119, 0.15) !important;
}

/* =========================================
   ESTILOS DO CALENDÁRIO MENSAL (AGENDA)
   ========================================= */
.calendar-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.calendar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.calendar-header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-header-nav h3 {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-nav-buttons {
  display: flex;
  gap: 8px;
}

.cal-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.cal-btn:hover {
  background: var(--primary);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  text-align: center;
}

.cal-weekday {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 8px 0;
}

.cal-day-cell {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  min-height: 72px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(180, 150, 140, 0.04);
}

.cal-day-cell:hover {
  border-color: var(--primary);
  background: #faf6f2;
}

.cal-day-cell.selected {
  border-color: var(--primary);
  background: rgba(201, 136, 119, 0.12);
  box-shadow: 0 0 10px rgba(201, 136, 119, 0.25);
}

.cal-day-cell.today {
  border: 1.5px solid var(--primary);
}

.cal-day-number {
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  color: #1e293b;
}

.cal-events-indicator {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

.cal-event-pill {
  font-size: 10px;
  background: rgba(201, 136, 119, 0.15);
  color: var(--primary);
  border: 1px solid rgba(201, 136, 119, 0.3);
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  font-weight: 600;
}

.cal-event-pill.pending {
  background: rgba(245, 158, 11, 0.25);
  color: var(--warning);
}

.cal-event-pill.rescheduled {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.cal-event-pill.cancelled-pending {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.55);
  text-decoration: none !important;
  font-weight: 600;
}

/* Botão de Reagendamento na Agenda */
.btn-reschedule-slot {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: #e8d9c5;
  cursor: pointer;
  padding: 5px 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-reschedule-slot:hover {
  background: #c5a880;
  color: #ffffff;
  border-color: #c5a880;
  box-shadow: 0 0 10px rgba(197, 168, 128, 0.4);
}

.btn-reschedule-slot.highlight {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fcd34d;
}

.btn-reschedule-slot.highlight:hover {
  background: #d97706;
  color: #ffffff;
  border-color: #d97706;
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.4);
}

.day-details-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* =========================================
   ESTILOS DE PACIENTES & CAMPANHAS IA
   ========================================= */
.patients-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.campaign-ai-box {
  background: linear-gradient(135deg, rgba(197, 168, 128, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(197, 168, 128, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.campaign-input-group {
  display: flex;
  gap: 10px;
  margin: 16px 0;
}

.campaign-input-group input {
  flex: 1;
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white !important;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
}

.campaign-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-shortcut {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-shortcut:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.patients-table-container {
  overflow-x: auto;
}

.patients-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 13.5px;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid #ebdcd3;
}

.patients-table th {
  padding: 14px 16px;
  border-bottom: 2px solid #ebdcd3;
  background: #fbf7f4;
  color: #0f172a;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-size: 12px;
}

.patients-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f2ebe5;
  color: #1e293b;
  font-size: 13.5px;
  transition: all 0.15s ease;
}

.patients-table tr:hover td {
  background: #fdfaf7;
}

.patients-table tr:hover td:first-child {
  border-left: 3.5px solid var(--primary);
  padding-left: 12.5px;
}

.birthday-badge {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.birthday-today-highlight {
  background: rgba(236, 72, 153, 0.3) !important;
  color: #fff !important;
  border: 1px solid #f472b6;
  animation: pulse 2s infinite;
}

.broadcast-logs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.broadcast-log-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
}

/* =========================================
   ESTILOS DE PERFIS E GESTÃO DE USUÁRIOS
   ========================================= */
.user-profile-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-tag-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.role-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-pill.admin {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.role-pill.doctor {
  background: rgba(197, 168, 128, 0.2);
  color: #e8d9c5;
  border: 1px solid rgba(197, 168, 128, 0.4);
}

.role-pill.secretary {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.btn-switch-profile {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-switch-profile:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.user-select-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.2s;
}

.user-select-card:hover {
  border-color: var(--primary);
  background: rgba(197, 168, 128, 0.1);
}

.user-select-card.active {
  border-color: var(--primary-light);
  background: rgba(197, 168, 128, 0.2);
}

.btn-delete-user {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-delete-user:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* MODAL */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer; /* Indicação tátil de que clicar fora fecha o modal */
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: modalEnter 0.2s ease;
  cursor: default; /* Conteúdo interno mantém o cursor padrão */
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: white;
  border-left: 4px solid var(--success);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  z-index: 2000;
  animation: slideIn 0.3s ease;
}

.toast.show {
  display: flex;
}

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

/* ===================================================
   ESTILOS PARA PRONTUÁRIO MÉDICO & TABELA DE PREÇOS
   =================================================== */

/* Tabela de Preços & Procedimentos */
.price-input {
  background: #0f172a !important;
  color: #10b981 !important;
  font-weight: 700 !important;
  font-size: 14px !important;
}

.spec-input {
  background: #0f172a !important;
  color: #ffffff !important;
  font-weight: 500 !important;
}

.btn-delete-row {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.btn-delete-row:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

/* Botões de Ação na Tabela de Pacientes */
.btn-open-chart {
  background: linear-gradient(135deg, rgba(197, 168, 128, 0.2), rgba(14, 165, 233, 0.3));
  border: 1px solid var(--primary);
  color: #e8d9c5;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-open-chart:hover {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(197, 168, 128, 0.4);
}

.btn-delete-patient {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 6px;
  transition: all 0.2s;
}

.btn-delete-patient:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ffffff;
}

.records-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(197, 168, 128, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(197, 168, 128, 0.3);
}

/* Linha do Tempo e Cards do Prontuário Médico */
.medical-records-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 6px;
}

.medical-record-card {
  background: #ffffff;
  border: 1.5px solid #ebdcd3;
  border-top: 3.5px solid var(--primary);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(168, 93, 76, 0.05);
  transition: all 0.2s ease;
}

.medical-record-card:hover {
  border-color: #dfc8bc;
  box-shadow: 0 6px 22px rgba(168, 93, 76, 0.09);
  transform: translateY(-1px);
}

.record-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1ece7;
}

.record-doctor-badge {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.record-date-badge {
  font-size: 12px;
  color: #475569;
  font-weight: 700;
  background: #fdfaf8;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #ebdcd3;
}

.record-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  .record-field-grid {
    grid-template-columns: 1fr;
  }
}

.record-field-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.record-complaint-box {
  background: #fdfaf8;
  border: 1.5px solid #ebdcd3;
  border-left: 3.5px solid var(--primary);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: #1e293b;
  line-height: 1.5;
}

.record-prescription-box {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-left: 3.5px solid #2563eb;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: #1e3a8a;
  font-weight: 500;
  line-height: 1.5;
}

.record-notes-box {
  background: #faf5ff;
  border: 1.5px solid #e9d5ff;
  border-left: 3.5px solid #9333ea;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: #581c87;
  font-weight: 500;
  margin-top: 8px;
  line-height: 1.5;
}

/* Barra de Pesquisa de Pacientes */
.patient-search-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 10px rgba(160, 130, 120, 0.05);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 550px;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  padding: 10px 38px 10px 38px !important;
  background: #fbf9f6 !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: 20px !important;
  color: #0f172a !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
  background: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 12px rgba(168, 93, 76, 0.2) !important;
  color: #0f172a !important;
}

#clear-search-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: color 0.2s;
}

#clear-search-btn:hover {
  color: #0f172a;
}

.cpf-badge {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #7c3a2d;
  background: #fdf5f2;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #e8c7be;
  display: inline-block;
  white-space: nowrap;
}

.records-count-badge {
  font-size: 11px;
  font-weight: 700;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   ESTILOS: BLOQUEIO DE DIAS COM 'X', SELEÇÃO DE MÉDICOS & IA AUTÔNOMA
   ========================================================================== */

/* Dia Bloqueado no Calendário (com 'X') */
.cal-day-cell.blocked {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(185, 28, 28, 0.06) 100%) !important;
  border: 1.5px dashed rgba(239, 68, 68, 0.45) !important;
  position: relative;
  overflow: hidden;
}

.cal-day-cell.blocked:hover {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: #ef4444 !important;
}

.cal-day-cell.blocked.selected {
  border-color: #ef4444 !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35) !important;
}

.cal-blocked-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 3px;
}

.cal-day-blocked-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 900;
  color: rgba(239, 68, 68, 0.18);
  pointer-events: none;
  user-select: none;
}

/* Barra de Seleção de Médico no Calendário */
.cal-doctor-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.cal-doctor-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cal-doctor-picker label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.cal-doctor-picker select {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #0f172a;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.cal-doctor-picker select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(168, 93, 76, 0.2);
}

.cal-doctor-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.cal-doctor-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Botão de Alternar Bloqueio com 'X' */
.btn-toggle-block-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 14px;
  border: 1px solid transparent;
}

.btn-toggle-block-day.block-action {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.btn-toggle-block-day.block-action:hover {
  background: #fecaca;
  border-color: #ef4444;
  color: #7f1d1d;
}

.btn-toggle-block-day.unblock-action {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}

.btn-toggle-block-day.unblock-action:hover {
  background: #a7f3d0;
  border-color: #10b981;
  color: #064e3b;
}

/* Grade de Checkboxes de Médicos para Recepcionista */
.doctor-checkbox-container {
  margin-top: 8px;
  padding: 12px;
  background: #faf8f5;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.doctor-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.doctor-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.doctor-check-item:hover {
  background: #fdf5f2;
  border-color: var(--primary);
}

.doctor-check-item input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.doctor-check-info {
  display: flex;
  flex-direction: column;
}

.doctor-check-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.doctor-check-spec {
  font-size: 11px;
  color: #526074;
}

/* Badges de Médicos Atribuídos na Tabela */
.assigned-docs-badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.assigned-doc-pill {
  font-size: 11px;
  font-weight: 700;
  background: #fdf5f2;
  color: #7c3a2d;
  border: 1px solid #e8c7be;
  border-radius: 4px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Alerta de Dia Bloqueado no Detalhe do Dia */
.day-blocked-alert-box {
  background: #fee2e2;
  border: 1.5px solid #fca5a5;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.day-blocked-alert-box i {
  color: #b91c1c;
  font-size: 20px;
  margin-top: 2px;
}

.day-blocked-alert-box h4 {
  font-size: 13px;
  font-weight: 700;
  color: #991b1b;
  margin-bottom: 2px;
}

.day-blocked-alert-box p {
  font-size: 12px;
  color: #7f1d1d;
  line-height: 1.4;
}

/* Tabela de Escala Semanal de Atendimento com Intervalos */
.weekly-schedule-table-container {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 10px;
}

.schedule-config-table {
  width: 100%;
  border-collapse: collapse;
}

.schedule-config-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.schedule-config-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
  vertical-align: middle;
}

.schedule-config-table tr:last-child td {
  border-bottom: none;
}

.schedule-config-table tr:hover {
  background: #fdfaf8;
}

.schedule-day-label {
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-hours-input {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #ebdcd3;
  border-radius: var(--radius-sm);
  color: #0f172a;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.schedule-hours-input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(168, 93, 76, 0.15);
  outline: none;
}

.schedule-hours-input:disabled {
  opacity: 0.7;
  background: #f5f0ec;
  border-color: #ebdcd3;
  color: #94a3b8;
  cursor: not-allowed;
}

.schedule-toggle-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ==========================================================================
   SISTEMA DE RESPONSIVIDADE & OTIMIZAÇÃO PARA CELULARES E TABLETS (MOBILE-FIRST)
   ========================================================================== */

/* Elementos do Menu Móvel (Desktop: ocultos por padrão) */
.mobile-menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mobile-menu-toggle:active {
  background: rgba(197, 168, 128, 0.2);
  border-color: var(--primary);
  transform: scale(0.96);
}

.mobile-sidebar-close {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: all 0.2s ease;
}

.mobile-sidebar-close:active {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

body.sidebar-locked {
  overflow: hidden !important;
}

.topbar-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ==========================================================================
   BREAKPOINT: Telas Médias e Laptops Pequenos (Max: 1200px)
   ========================================================================== */
@media (max-width: 1200px) {
  .dashboard-split {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .simulator-wrapper {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .calendar-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .patients-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* ==========================================================================
   BREAKPOINT: Tablets e Dispositivos Móveis (Max: 992px)
   - Transforma a barra lateral em uma Gaveta Retrátil (Off-Canvas Drawer)
   - Ativa botão hambúrguer no Topbar
   ========================================================================== */
@media (max-width: 992px) {
  .mobile-menu-toggle {
    display: inline-flex;
  }

  .mobile-sidebar-close {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    width: 290px;
    max-width: 86vw;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.75);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    max-width: 100%;
    width: 100%;
    padding: 20px 16px 40px 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 24px;
  }

  .topbar-left {
    width: 100%;
  }

  .topbar-right {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
}

/* ==========================================================================
   BREAKPOINT: Smartphones em Geral (Max: 768px)
   - Otimizações finas de toque, fontes, cards e formulários
   ========================================================================== */
@media (max-width: 768px) {
  .main-content {
    padding: 12px 10px 48px 10px;
  }

  /* Cabeçalho Compacto e Elegante */
  .topbar-left h1 {
    font-size: 20px;
    letter-spacing: -0.3px;
  }

  .subtitle {
    font-size: 12px;
    line-height: 1.4;
  }

  .topbar-right {
    gap: 8px;
  }

  .online-public-status {
    padding: 4px 10px !important;
    font-size: 11.5px !important;
  }

  .user-tag-pill {
    padding: 4px 10px;
    font-size: 12px;
  }

  .btn-switch-profile {
    padding: 6px 10px;
    font-size: 11.5px;
  }

  /* Cards de Métricas do Médico */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
  }

  .metric-card {
    padding: 14px 12px;
    border-radius: var(--radius-md);
  }

  .metric-title {
    font-size: 11.5px;
  }

  .metric-value {
    font-size: 24px;
    margin: 8px 0 4px;
  }

  .metric-footer {
    font-size: 11px;
  }

  .metric-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 8px;
  }

  /* Cards de Conteúdo Gerais */
  .content-card {
    padding: 16px 12px;
    border-radius: var(--radius-md);
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
  }

  .card-header h3 {
    font-size: 15px;
  }

  /* Fila de Aprovações Pendentes */
  .pending-item {
    padding: 12px;
  }

  .pending-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .pending-actions {
    flex-direction: column;
    width: 100%;
    gap: 8px;
    margin-top: 10px;
  }

  .pending-actions button,
  .pending-actions a {
    width: 100%;
    justify-content: center;
    min-height: 42px;
    font-size: 13px;
  }

  /* Calendário Mensal no Celular */
  .calendar-card {
    padding: 14px 8px;
    border-radius: var(--radius-md);
  }

  .calendar-header-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
  }

  .calendar-header-nav h3 {
    font-size: 15px;
    justify-content: center;
  }

  .cal-nav-buttons {
    justify-content: center;
    width: 100%;
  }

  .cal-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 12px;
  }

  .calendar-grid {
    gap: 3px;
  }

  .cal-weekday {
    font-size: 10px;
    padding: 4px 0;
    font-weight: 800;
  }

  .cal-day-cell {
    min-height: 48px;
    padding: 3px 2px;
    border-radius: 6px;
  }

  .cal-day-number {
    font-size: 11px;
  }

  .cal-event-pill {
    font-size: 9px;
    padding: 1px 3px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .day-details-card {
    padding: 16px 12px;
    border-radius: var(--radius-md);
  }

  /* Simulador de Canais (WhatsApp & Instagram) */
  .phone-mockup-container {
    width: 100%;
  }

  .channel-toggle-bar {
    max-width: 100%;
    margin-bottom: 14px;
  }

  .btn-channel {
    padding: 8px 10px;
    font-size: 12px;
  }

  .phone-frame {
    width: 100% !important;
    max-width: 100% !important;
    height: 520px;
    border-width: 4px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  }

  .phone-notch {
    display: none; /* Remove entalhe artificial no celular real */
  }

  .phone-header {
    padding: 12px 14px;
  }

  .chat-messages {
    padding: 12px;
  }

  .chat-bubble {
    max-width: 88%;
    font-size: 13px;
    padding: 10px 12px;
  }

  .chat-input-container {
    padding: 10px;
    gap: 6px;
  }

  .chat-input-container input {
    font-size: 14px;
    padding: 10px 12px;
  }

  .btn-send {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
  }

  .scenario-suggestions {
    gap: 6px;
  }

  .chip {
    padding: 9px 12px;
    font-size: 12px;
  }

  /* Campanhas IA & Disparos */
  .campaign-ai-box {
    padding: 16px 12px;
    border-radius: var(--radius-md);
  }

  .campaign-input-group {
    flex-direction: column;
    gap: 10px;
  }

  .campaign-input-group input {
    width: 100%;
    font-size: 14px;
    padding: 12px;
  }

  .campaign-input-group button {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .campaign-shortcuts {
    gap: 6px;
  }

  .btn-shortcut {
    font-size: 11px;
    padding: 6px 10px;
  }

  /* Tabelas Responsivas com Rolagem Suave Touch */
  .patients-table-container,
  .weekly-schedule-table-container,
  .audit-logs-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
  }

  .patients-table th,
  .patients-table td {
    padding: 10px 8px;
    font-size: 12px;
    white-space: nowrap;
  }

  .schedule-config-table th,
  .schedule-config-table td {
    padding: 8px 6px;
    font-size: 11.5px;
  }

  .schedule-hours-input {
    font-size: 11px;
    padding: 6px 6px;
    min-width: 130px;
  }

  /* Logs de Auditoria do Administrador Master */
  .audit-logs-filters-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .audit-logs-filters-bar input,
  .audit-logs-filters-bar select,
  .audit-logs-filters-bar button {
    width: 100% !important;
    min-height: 42px;
    font-size: 13px;
  }

  /* Modais Adaptados para Smartphones */
  .modal-overlay {
    padding: 12px;
    align-items: flex-end; /* Abre no estilo bottom-sheet ou centralizado */
  }

  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88vh;
    max-height: 88dvh;
    padding: 18px 14px !important;
    border-radius: 18px 18px 12px 12px !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-header {
    margin-bottom: 14px;
  }

  .modal-header h3 {
    font-size: 16px;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
    margin-top: 18px;
  }

  .modal-footer button {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    font-size: 14px;
  }

  /* Previne Zoom Automático Chato do iOS ao focar em inputs */
  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px !important;
  }

  /* Toasts Adaptados para Telas Pequenas */
  .toast {
    left: 12px;
    right: 12px;
    bottom: 14px;
    font-size: 12.5px;
    padding: 12px 14px;
    text-align: center;
    justify-content: center;
    border-radius: 10px;
  }
}

/* ==========================================================================
   BREAKPOINT: Telas Ultra Compactas (Max: 420px)
   - Ex: iPhone SE, Galaxy A-series estreitos
   ========================================================================== */
@media (max-width: 420px) {
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .topbar-right {
    flex-direction: column;
    align-items: stretch;
  }

  .online-public-status {
    justify-content: center;
  }

  .user-profile-header {
    width: 100%;
    justify-content: space-between;
  }

  .btn-switch-profile {
    flex: 1;
    justify-content: center;
  }
}

/* =========================================================================
   ESTILOS DA ABA FALTA REAGENDAR (NOVA ABA LATERAL)
   ========================================================================= */
.pending-reschedules-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pending-reschedule-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.2s ease;
}

.pending-reschedule-card:hover {
  background: rgba(245, 158, 11, 0.04);
  border-color: var(--warning);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.12);
  transform: translateY(-1px);
}

.reschedule-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.reschedule-patient-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.reschedule-patient-title h4 {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.reschedule-warning-pill {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.reschedule-ai-sent-pill {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.reschedule-mode-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.reschedule-mode-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.reschedule-phone {
  font-size: 12px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.reschedule-meta-doc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.reschedule-original-date {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 8px;
  text-align: right;
  font-size: 12px;
}

.reschedule-original-date .label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.reschedule-original-date .val {
  font-weight: 700;
  color: #fca5a5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.reschedule-reason-box {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-left: 4px solid #b45309;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 12px 0 16px;
  font-size: 13px;
  color: #78350f;
  line-height: 1.5;
}

.reschedule-reason-box strong {
  color: #92400e;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

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

@media (max-width: 768px) {
  .pending-reschedule-card {
    padding: 14px 12px;
  }
  .reschedule-card-actions {
    flex-direction: column;
    width: 100%;
  }
  .reschedule-card-actions button {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }
  .reschedule-original-date {
    width: 100%;
    text-align: left;
  }
}

.btn-dismiss-reschedule-card {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #b91c1c;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  transition: all 0.2s ease;
}

.btn-dismiss-reschedule-card:hover {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-dismiss-action:hover {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #991b1b !important;
}

@media (max-width: 768px) {
  .btn-dismiss-reschedule-card {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   PAINEL DE CONVERSAS DE CLIENTES NO SIMULADOR (CRM MULTI-PACIENTE)
   ========================================================================== */
.simulator-conversations-panel {
  width: 290px;
  background: #ffffff;
  border: 1.5px solid #ebdcd3;
  border-top: 3.5px solid var(--primary);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 575px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(168, 93, 76, 0.06);
}

.conv-panel-header {
  padding: 14px 16px;
  background: #fdfaf8;
  border-bottom: 1.5px solid #ebdcd3;
}

.btn-new-chat-sim {
  background: rgba(168, 93, 76, 0.1);
  border: 1px solid rgba(168, 93, 76, 0.3);
  color: var(--primary);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-new-chat-sim:hover {
  background: var(--primary);
  color: #fff;
}

.conv-search-box {
  margin-top: 10px;
  position: relative;
  display: flex;
  align-items: center;
}

.conv-search-box i {
  position: absolute;
  left: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.conv-search-box input {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #ebdcd3;
  border-radius: 6px;
  padding: 6px 10px 6px 28px;
  font-size: 12px;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s;
}

.conv-search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(168, 93, 76, 0.15);
}

.conv-panel-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #f2ebe5;
  cursor: pointer;
  transition: background 0.15s ease;
}

.conv-item:hover {
  background: #fdfaf7;
}

.conv-item.active {
  background: #fdf5f2;
  border-left: 3.5px solid var(--primary);
}

.conv-item-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(168, 93, 76, 0.12);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  font-weight: 700;
}

.conv-item-info {
  flex: 1;
  min-width: 0;
}

.conv-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.conv-item-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-item-preview {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}

/* Abas e timeline no prontuário */
.chart-tab-btn {
  background: #ffffff;
  border: 1.5px solid #ebdcd3;
  color: #334155;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.chart-tab-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: #fdfaf8;
  transform: translateY(-1px);
}

.chart-tab-btn.active {
  background: linear-gradient(135deg, #a85d4c 0%, #8c4333 100%) !important;
  color: #ffffff !important;
  border-color: #8c4333 !important;
  box-shadow: 0 4px 14px rgba(168, 93, 76, 0.3) !important;
}

.patient-chat-timeline {
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #fcfbf9;
  border-radius: 10px;
  border: 1.5px solid #ebdcd3;
}

/* Cards de Evolução Clínica do Prontuário */
.medical-record-card {
  background: #ffffff;
  border: 1.5px solid #ebdcd3;
  border-top: 3.5px solid var(--primary);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(168, 93, 76, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.medical-record-card:hover {
  box-shadow: 0 6px 22px rgba(168, 93, 76, 0.09);
  border-color: #dfc8bc;
}

.record-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1ece7;
}

.record-doctor-badge {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.record-date-badge {
  font-size: 12px;
  color: #475569;
  font-weight: 700;
  background: #fdfaf8;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #ebdcd3;
}

.record-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.record-field-label {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.record-complaint-box {
  background: #fdfaf8;
  border: 1.5px solid #ebdcd3;
  border-left: 3.5px solid var(--primary);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #1e293b;
}

.record-prescription-box {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-left: 3.5px solid #2563eb;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #1e3a8a;
  font-weight: 500;
}

.record-notes-box {
  background: #faf5ff;
  border: 1.5px solid #e9d5ff;
  border-left: 3.5px solid #9333ea;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #581c87;
  font-weight: 500;
}

/* ==========================================================================
   REGRAS DE IMPRESSÃO PROFISSIONAL DE PRONTUÁRIO MÉDICO (@media print)
   ========================================================================== */
@media print {
  body * {
    visibility: hidden !important;
  }
  #patient-chart-modal,
  #patient-chart-modal * {
    visibility: visible !important;
  }
  #patient-chart-modal {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: #fff !important;
    color: #000 !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 999999 !important;
  }
  .modal-box {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
  }
  .modal-box button,
  .close-btn,
  .chart-modal-tabs,
  #add-medical-record-form {
    display: none !important;
  }
  .medical-record-card {
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #000 !important;
    page-break-inside: avoid;
    margin-bottom: 20px !important;
  }
  .record-complaint-box,
  .record-prescription-box {
    background: #f8fafc !important;
    border: 1px solid #ddd !important;
    color: #000 !important;
  }
  #chart-patient-name {
    color: #000 !important;
  }
}










/* ==========================================================================
   ELEMENTOS DE LUXO — AMBIANCE HEALTH INSTITUTE (ROSE GOLD EDITORIAL)
   ========================================================================== */
.ambiance-welcome-card {
  background: linear-gradient(135deg, #ffffff 0%, #faf6f2 100%);
  border: 1px solid rgba(201, 136, 119, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px 30px;
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(180, 150, 140, 0.1);
}

.ambiance-welcome-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold-gradient);
}

.ambiance-badge-gold {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(201, 136, 119, 0.12);
  border: 1px solid rgba(201, 136, 119, 0.35);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.ambiance-welcome-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 6px 0;
  letter-spacing: 0.3px;
}

.ambiance-welcome-card p {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
  max-width: 680px;
  line-height: 1.5;
}

.ambiance-doctors-pill-group {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.ambiance-doc-pill {
  background: #ffffff;
  border: 1px solid rgba(201, 136, 119, 0.25);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(180, 150, 140, 0.08);
  transition: all 0.2s ease;
}

.ambiance-doc-pill:hover {
  background: #faf6f2;
  border-color: var(--primary);
  transform: translateY(-2px);
}

.ambiance-doc-pill img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--primary);
  background: #fff;
}

.ambiance-doc-pill-info h5 {
  margin: 0;
  font-size: 12px;
  color: #1e293b;
  font-weight: 600;
}

.ambiance-doc-pill-info span {
  font-size: 10px;
  color: var(--primary);
  display: block;
}

.ambiance-hero-stamp {
  width: 96px;
  height: 96px;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(180, 150, 140, 0.15), 0 0 0 1px rgba(201, 136, 119, 0.35);
  flex-shrink: 0;
}

.ambiance-hero-stamp img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.btn-primary {
  background: var(--gold-gradient) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 15px rgba(201, 136, 119, 0.35) !important;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(201, 136, 119, 0.5) !important;
  filter: brightness(1.05);
}

/* ==========================================================================
   SISTEMA DE ALTO CONTRASTE E NITIDEZ VISUAL (PADRÃO WCAG AA)
   Garante 100% de legibilidade em toda a aplicação sem textos apagados
   ========================================================================== */

/* 1. Tipografia e Cores Globais de Texto */
body, .main-content, .tab-pane {
  color: #0f172a !important;
}

h1, h2, h3, h4, h5, h6 {
  color: #0f172a !important;
  letter-spacing: -0.2px;
}

p, span, label, li {
  color: #334155;
}

.text-muted {
  color: #526074 !important;
}

.subtitle {
  color: #475569 !important;
  font-weight: 500 !important;
}

/* 2. Cards com Fundo Branco Nítido e Bordas Definidas */
.content-card, .metric-card, .ambiance-gold-card {
  background: #ffffff !important;
  border: 1px solid #e2d9d2 !important;
  box-shadow: 0 4px 20px rgba(160, 130, 120, 0.08) !important;
  color: #0f172a !important;
}

.card-header h3, .card-header h4 {
  color: #0f172a !important;
  font-weight: 700 !important;
}

.metric-title {
  color: #475569 !important;
  font-weight: 600 !important;
  font-size: 13px !important;
}

.metric-value {
  color: #0f172a !important;
  font-weight: 800 !important;
}

/* 2. Sobrescreve quaisquer blocos escuros herdados em qualquer lugar do sistema (Modais e Telas) */
div[style*="background: rgba(15, 23, 42"],
div[style*="background:rgba(15, 23, 42"],
div[style*="background: rgba(0, 0, 0, 0.2"],
div[style*="background: rgba(15, 23, 42, 0.6)"],
div[style*="background: rgba(15, 23, 42, 0.7)"],
div[style*="background: rgba(15, 23, 42, 0.8)"],
div[style*="background: rgba(15, 23, 42, 0.9)"],
div[style*="background: rgba(15, 23, 42, 0.95)"] {
  background: #ffffff !important;
  border: 1.5px solid #ebdcd3 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 16px rgba(168, 93, 76, 0.05) !important;
}

div[style*="background: rgba(15, 23, 42"] h4,
div[style*="background: rgba(15, 23, 42"] h5,
div[style*="background: rgba(15, 23, 42"] strong,
div[style*="background: rgba(15, 23, 42"] label,
div[style*="background: rgba(15, 23, 42"] p,
div[style*="background: rgba(15, 23, 42"] span {
  color: #0f172a !important;
}

/* Linhas e Detalhes Nobres de Destaque - Design System Ambiance Luxury */
.card, .table-card, .dashboard-card, .chat-panel, .simulator-card {
  border: 1px solid rgba(168, 93, 76, 0.16) !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: 0 4px 20px rgba(168, 93, 76, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.card:hover, .dashboard-card:hover {
  box-shadow: 0 10px 30px rgba(168, 93, 76, 0.1) !important;
  transform: translateY(-2px);
}

.modal-box {
  border: 1px solid rgba(168, 93, 76, 0.2) !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(168, 93, 76, 0.08) !important;
  overflow: hidden !important;
}

.modal-header {
  border-bottom: 1px solid rgba(168, 93, 76, 0.12) !important;
  padding: 20px 24px !important;
  margin-bottom: 16px !important;
  background: linear-gradient(135deg, #fffcfb 0%, #faf5f1 100%) !important;
}

/* 3. Tabelas de Alta Nitidez & Linhas de Separação Claras */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff !important;
  border: 1.5px solid #ebdcd3 !important;
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.data-table th {
  background: #fbf7f4 !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 12.5px !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #ebdcd3 !important;
  padding: 13px 16px !important;
}

.data-table td {
  background: #ffffff !important;
  color: #1e293b !important;
  border-bottom: 1px solid #f2ebe5 !important;
  padding: 13px 16px !important;
  font-size: 13px !important;
  transition: background 0.15s ease;
}

.data-table tr:hover td {
  background: #fdfaf7 !important;
  box-shadow: inset 3px 0 0 var(--primary);
}

.data-table td strong {
  color: #0f172a !important;
  font-weight: 700 !important;
}

/* 4. Badges e Pílulas de Status — Fórmula de Alto Contraste */
.badge, .badge-action-pill, .slot-status-badge {
  font-weight: 700 !important;
  letter-spacing: 0.2px;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  transition: all 0.2s ease !important;
}

/* Verde: Pagamento Quitado / Sinal Pago / Confirmado */
.badge-status-green,
button[style*="34d399"],
span[style*="34d399"],
span[style*="6ee7b7"],
.status-confirmed {
  background: #ecfdf5 !important;
  color: #065f46 !important;
  border: 1.5px solid #a7f3d0 !important;
}

/* Âmbar/Amarelo: Sinal Pendente / Aguardando / Atenção */
.badge-status-yellow,
button[style*="fbbf24"],
span[style*="fbbf24"],
.status-pending {
  background: #fffbeb !important;
  color: #92400e !important;
  border: 1.5px solid #fde68a !important;
}

/* Azul: Presente na Recepção / iClinic / Info */
.badge-status-blue,
button[style*="60a5fa"],
span[style*="60a5fa"],
span[style*="93c5fd"],
span[style*="38bdf8"] {
  background: #eff6ff !important;
  color: #1e40af !important;
  border: 1.5px solid #bfdbfe !important;
}

/* Roxo: Em Atendimento / Especialidades */
.badge-status-purple,
button[style*="c084fc"],
span[style*="c084fc"] {
  background: #faf5ff !important;
  color: #6b21a8 !important;
  border: 1.5px solid #e9d5ff !important;
}

/* Vermelho: Faltou (No-show) / Cancelado / Bloqueado */
.badge-status-red,
button[style*="f87171"],
span[style*="f87171"],
span[style*="fca5a5"],
.status-cancelled {
  background: #fef2f2 !important;
  color: #991b1b !important;
  border: 1.5px solid #fecaca !important;
}

/* Cinza/Neutro: Aguardando Confirmação / Isento */
button[style*="cbd5e1"],
span[style*="cbd5e1"] {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1.5px solid #cbd5e1 !important;
}

/* 5. Slots da Agenda Médica */
.schedule-slot {
  background: #ffffff !important;
  border: 1px solid #e2d9d2 !important;
  box-shadow: 0 2px 8px rgba(160, 130, 120, 0.05) !important;
}

.schedule-slot:hover {
  background: #fbf7f4 !important;
  border-color: var(--primary) !important;
  box-shadow: 0 6px 18px rgba(168, 93, 76, 0.12) !important;
}

.slot-time {
  color: #0f172a !important;
  font-weight: 800 !important;
}

.slot-patient h5 {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 15px !important;
}

.slot-patient p {
  color: #475569 !important;
  font-weight: 500 !important;
}

.slot-date-sub {
  color: #7c3a2d !important;
  background: #fdf5f2 !important;
  border: 1px solid #e8c7be !important;
  font-weight: 600 !important;
}

/* 6. Modais & Formulários - Design Limpo e Sem Faixas Cinzas */
.modal-overlay {
  background: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: blur(8px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(8px) saturate(160%) !important;
}

.modal-box {
  background: #ffffff !important;
  border: 1px solid rgba(168, 93, 76, 0.18) !important;
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(168, 93, 76, 0.08) !important;
  color: #0f172a !important;
}

.modal-header h3 {
  color: #0f172a !important;
  font-weight: 700 !important;
  letter-spacing: -0.2px;
}

.modal-box label {
  color: #1e293b !important;
  font-weight: 600 !important;
  font-size: 13px !important;
}

.modal-box input, 
.modal-box select, 
.modal-box textarea,
.settings-form input,
.settings-form select,
.settings-form textarea {
  background: #ffffff !important;
  border: 1px solid #dcd3cb !important;
  color: #0f172a !important;
  font-weight: 500 !important;
  border-radius: 9px !important;
  padding: 10px 14px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.modal-box input:focus, 
.modal-box select:focus, 
.modal-box textarea:focus,
.settings-form input:focus,
.settings-form select:focus,
.settings-form textarea:focus {
  background: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3.5px rgba(168, 93, 76, 0.14) !important;
  color: #0f172a !important;
  outline: none !important;
}

.modal-box .close-btn {
  color: #64748b !important;
  transition: all 0.2s ease !important;
}

.modal-box .close-btn:hover {
  color: var(--primary) !important;
  transform: rotate(90deg) scale(1.1);
}

/* Classes de Alto Padrão - Fim das Faixas Cinzas */
.luxury-card-inset {
  background: #ffffff !important;
  border: 1px solid rgba(168, 93, 76, 0.14) !important;
  border-left: 3.5px solid var(--primary) !important;
  border-radius: 12px !important;
  box-shadow: 0 3px 12px rgba(168, 93, 76, 0.04) !important;
  padding: 14px 16px !important;
  transition: all 0.2s ease !important;
}

.luxury-card-inset:hover {
  border-color: rgba(168, 93, 76, 0.3) !important;
  box-shadow: 0 6px 18px rgba(168, 93, 76, 0.08) !important;
}

.luxury-info-box {
  background: linear-gradient(135deg, #fdfbf9 0%, #ffffff 100%) !important;
  border: 1px solid rgba(168, 93, 76, 0.16) !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
}

.luxury-alert-amber {
  background: linear-gradient(135deg, #fffcf5 0%, #fffbeb 100%) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  border-left: 3.5px solid #d97706 !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
}

.luxury-alert-blue {
  background: linear-gradient(135deg, #f8fbff 0%, #eff6ff 100%) !important;
  border: 1px solid rgba(59, 130, 246, 0.25) !important;
  border-left: 3.5px solid #2563eb !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
}

.luxury-alert-green {
  background: linear-gradient(135deg, #f7fdfa 0%, #ecfdf5 100%) !important;
  border: 1px solid rgba(16, 185, 129, 0.28) !important;
  border-left: 3.5px solid #059669 !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
}

/* 7. Navegação Lateral (Sidebar) */
.nav-item {
  color: #334155 !important;
  font-weight: 600 !important;
}

.nav-item:hover {
  color: #0f172a !important;
  background: #fbf7f4 !important;
}

.nav-item.active {
  background: #fdf5f2 !important;
  color: #7c3a2d !important;
  font-weight: 700 !important;
  border: 1px solid #e8c7be !important;
}

/* ==========================================================================
   8. SISTEMA DE HARMONIZAÇÃO TIPOGRÁFICA & RESOLUÇÃO RESPONSIVA (WCAG & 2K+)
   ========================================================================== */

/* 8.1 Ajuste Base Universal: Eliminação de fontes minúsculas (<11.5px) */
.badge, 
.badge-action-pill, 
.slot-status-badge, 
.channel-tag, 
.date-badge,
.badge-tag {
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 3px 9px !important;
  line-height: 1.35 !important;
}

.cal-event-pill {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  padding: 3px 6px !important;
  border-radius: 5px !important;
  line-height: 1.3 !important;
}

.cal-weekday {
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
}

.cal-day-number {
  font-size: 14px !important;
  font-weight: 700 !important;
}

.cal-day-cell {
  min-height: 84px !important;
  padding: 8px !important;
}

.slot-time {
  font-size: 15px !important;
  font-weight: 800 !important;
}

.slot-patient h5 {
  font-size: 15.5px !important;
  font-weight: 700 !important;
}

.slot-patient p {
  font-size: 13px !important;
  font-weight: 500 !important;
}

.slot-date-sub {
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 2px 7px !important;
}

.metric-title {
  font-size: 13.5px !important;
  font-weight: 600 !important;
}

.metric-value {
  font-size: 34px !important;
  font-weight: 800 !important;
}

.metric-footer {
  font-size: 12.5px !important;
  font-weight: 500 !important;
}

.nav-item {
  font-size: 14px !important;
  padding: 10px 14px !important;
}

.nav-item i {
  width: 32px !important;
  height: 32px !important;
  font-size: 14px !important;
}

.data-table th, 
.patients-table th {
  font-size: 13px !important;
  font-weight: 700 !important;
  padding: 13px 16px !important;
}

.data-table td, 
.patients-table td {
  font-size: 13.5px !important;
  padding: 13px 16px !important;
}

.cpf-badge {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  padding: 3px 8px !important;
}

.records-count-badge {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  padding: 3px 10px !important;
}

/* 8.2 Escala para Monitores Médio-Grandes (Full HD Ampliado / 1600px - 1999px) */
@media (min-width: 1600px) {
  :root {
    --sidebar-width: 295px;
  }

  .main-content {
    padding: 36px 48px;
  }

  .topbar-left h1 {
    font-size: 28px !important;
  }

  .subtitle {
    font-size: 15px !important;
  }

  .nav-item {
    font-size: 14.5px !important;
    padding: 11px 16px !important;
    gap: 13px !important;
  }

  .nav-item i {
    width: 34px !important;
    height: 34px !important;
    font-size: 15px !important;
  }

  .metric-card {
    padding: 22px !important;
  }

  .metric-title {
    font-size: 14px !important;
  }

  .metric-value {
    font-size: 38px !important;
  }

  .metric-footer {
    font-size: 13px !important;
  }

  .data-table th, 
  .patients-table th {
    font-size: 13.5px !important;
    padding: 14px 18px !important;
  }

  .data-table td, 
  .patients-table td {
    font-size: 14px !important;
    padding: 14px 18px !important;
  }

  .schedule-slot {
    padding: 14px 18px !important;
  }

  .slot-time {
    font-size: 16px !important;
  }

  .slot-patient h5 {
    font-size: 16px !important;
  }

  .slot-patient p {
    font-size: 13.5px !important;
  }

  .badge, 
  .badge-action-pill, 
  .slot-status-badge {
    font-size: 12.5px !important;
    padding: 4px 10px !important;
  }

  .cal-day-cell {
    min-height: 92px !important;
  }

  .cal-event-pill {
    font-size: 12px !important;
    padding: 3.5px 7px !important;
  }
}

/* 8.3 Escala para Monitores de Alta Resolução / 2K / 1440p / 2560px Ultrawide (2000px+) */
@media (min-width: 2000px) {
  :root {
    --sidebar-width: 320px;
    --radius-lg: 18px;
  }

  body {
    font-size: 15px;
  }

  .sidebar {
    padding: 26px 18px;
  }

  .brand-logo-wrap {
    max-width: 220px;
    padding: 10px 14px;
  }

  .brand-text h2 {
    font-size: 24px !important;
  }

  .brand-subtext {
    font-size: 12px !important;
    letter-spacing: 2.2px !important;
  }

  .nav-item {
    font-size: 15px !important;
    padding: 12px 18px !important;
    gap: 14px !important;
    border-radius: 10px !important;
  }

  .nav-item i {
    width: 38px !important;
    height: 38px !important;
    font-size: 16px !important;
    border-radius: 10px !important;
  }

  .main-content {
    padding: 40px 60px;
  }

  .topbar {
    margin-bottom: 34px;
  }

  .topbar-left h1 {
    font-size: 32px !important;
    letter-spacing: -0.5px !important;
  }

  .subtitle {
    font-size: 16px !important;
    margin-top: 6px;
  }

  .btn-primary, 
  .btn-secondary {
    font-size: 15px !important;
    padding: 12px 22px !important;
    border-radius: 10px !important;
  }

  .btn-switch-profile {
    font-size: 14px !important;
    padding: 10px 16px !important;
  }

  .metrics-grid {
    gap: 20px !important;
    margin-bottom: 32px !important;
  }

  .metric-card {
    padding: 26px 24px !important;
    border-radius: 18px !important;
  }

  .metric-icon {
    width: 44px !important;
    height: 44px !important;
    font-size: 19px !important;
    border-radius: 12px !important;
  }

  .metric-title {
    font-size: 14.5px !important;
    font-weight: 600 !important;
  }

  .metric-value {
    font-size: 42px !important;
    margin: 14px 0 8px !important;
  }

  .metric-footer {
    font-size: 13.5px !important;
  }

  .content-card {
    padding: 28px 30px !important;
    border-radius: 18px !important;
  }

  .card-header h3 {
    font-size: 19px !important;
  }

  .schedule-slot {
    padding: 16px 20px !important;
    border-radius: 12px !important;
    gap: 20px !important;
  }

  .slot-time {
    font-size: 17px !important;
  }

  .slot-date-sub {
    font-size: 12.5px !important;
    padding: 3px 8px !important;
    border-radius: 5px !important;
  }

  .slot-patient h5 {
    font-size: 17px !important;
  }

  .slot-patient p {
    font-size: 14px !important;
  }

  .badge, 
  .badge-action-pill, 
  .slot-status-badge {
    font-size: 13px !important;
    padding: 5px 12px !important;
    border-radius: 6px !important;
  }

  .data-table th, 
  .patients-table th {
    font-size: 14px !important;
    padding: 16px 20px !important;
  }

  .data-table td, 
  .patients-table td {
    font-size: 14.5px !important;
    padding: 16px 20px !important;
  }

  .cpf-badge {
    font-size: 13.5px !important;
    padding: 4px 10px !important;
  }

  .records-count-badge {
    font-size: 13px !important;
    padding: 4px 12px !important;
  }

  .btn-open-chart {
    font-size: 13.5px !important;
    padding: 9px 18px !important;
  }

  .patient-search-toolbar {
    padding: 18px 24px !important;
    margin-bottom: 20px !important;
  }

  .search-input-wrapper {
    max-width: 680px !important;
  }

  .search-input-wrapper input {
    font-size: 15px !important;
    padding: 12px 44px !important;
  }

  .search-input-wrapper .search-icon {
    font-size: 16px !important;
    left: 16px !important;
  }

  .calendar-card {
    padding: 28px !important;
    border-radius: 18px !important;
  }

  .calendar-header-nav h3 {
    font-size: 21px !important;
  }

  .cal-btn {
    font-size: 14px !important;
    padding: 8px 16px !important;
  }

  .cal-weekday {
    font-size: 14px !important;
    padding: 10px 0 !important;
  }

  .cal-day-cell {
    min-height: 106px !important;
    padding: 10px !important;
    border-radius: 12px !important;
  }

  .cal-day-number {
    font-size: 15px !important;
  }

  .cal-event-pill {
    font-size: 12.5px !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
  }

  .modal-box {
    border-radius: 18px !important;
    padding: 28px !important;
  }

  .modal-header h3 {
    font-size: 20px !important;
  }

  .modal-box label {
    font-size: 14px !important;
    margin-bottom: 6px !important;
  }

  .modal-box input, 
  .modal-box select, 
  .modal-box textarea {
    font-size: 14.5px !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
  }
}

/* ==========================================================================
   TELA INICIAL DE LOGIN OBRIGATÓRIO (GATEKEEPER / LOGIN WALL)
   Ambiance Health Institute - Padrão Nobre com Efeito Glassmorphism
   ========================================================================== */

/* Bloqueio absoluto do aplicativo quando não autenticado */
body.auth-locked #main-app-container {
  display: none !important;
}

body.auth-locked {
  background: #090e17 !important;
  overflow: hidden !important;
}

.login-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  background: radial-gradient(circle at 50% 20%, #1a2333 0%, #0c1322 55%, #070b13 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
}

.login-screen-overlay.login-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.login-card-container {
  width: 100%;
  max-width: 440px;
  margin: auto;
  animation: loginCardSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(194, 112, 78, 0.25);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 30px rgba(194, 112, 78, 0.15);
  border-radius: 20px;
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #c2704e 0%, #d4af37 50%, #c2704e 100%);
}

.login-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-logo-wrap {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(194, 112, 78, 0.2), 0 0 0 1px rgba(194, 112, 78, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 6px;
}

.login-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.login-brand-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.5px;
  line-height: 1.1;
  margin: 0;
}

.login-brand-sub {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: #c2704e;
  margin-top: 4px;
}

.login-secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fdf8f6;
  border: 1px solid rgba(194, 112, 78, 0.3);
  color: #9c4727;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-top: 10px;
}

.login-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
  margin: 20px 0;
}

.login-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.login-input-wrap {
  position: relative;
}

.login-input {
  width: 100%;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
  font-size: 14px !important;
  color: #0f172a !important;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.login-input:focus {
  border-color: #c2704e !important;
  box-shadow: 0 0 0 3.5px rgba(194, 112, 78, 0.16) !important;
}

.login-pwd-toggle {
  font-size: 11.5px;
  color: #64748b;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.login-pwd-toggle:hover {
  color: #c2704e;
}

.login-options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.login-remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #475569;
  cursor: pointer;
}

.login-remember-me input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #c2704e;
  cursor: pointer;
}

.login-submit-btn {
  width: 100%;
  padding: 13px !important;
  font-size: 14.5px !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #c2704e 0%, #a85837 100%) !important;
  box-shadow: 0 4px 14px rgba(194, 112, 78, 0.35) !important;
  transition: all 0.25s ease;
  cursor: pointer;
}

.login-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(194, 112, 78, 0.45) !important;
}

.login-alert-danger {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  animation: shakeAlert 0.4s ease;
}

@keyframes shakeAlert {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.login-quick-access {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed #e2e8f0;
}

.login-quick-title {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  text-align: center;
}

.login-quick-badges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quick-user-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-user-btn:hover {
  background: #ffffff;
  border-color: #c2704e;
  box-shadow: 0 2px 8px rgba(194, 112, 78, 0.15);
  transform: translateY(-1px);
}

.login-footer-info {
  margin-top: 20px;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
}

/* Botões de Logout (Sidebar e Topbar) */
.btn-logout-sidebar {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.2s;
}

.btn-logout-sidebar:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.btn-logout-topbar:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}

/* ==========================================================================
   NOVA ESTRUTURA: MENU LATERAL IMUTÁVEL E DASHBOARD EM 3 COLUNAS
   Alinhamento de Alta Performance Ambiance Health Institute
   ========================================================================== */

/* Ajustes de Variáveis */
:root {
  --sidebar-width: 285px;
}

/* Sidebar Cabeçalho e Título */
.sidebar-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header-row .btn-sidebar-collapse {
  position: static;
  width: 32px;
  height: 32px;
  background: rgba(168, 93, 76, 0.08);
  border: 1px solid rgba(168, 93, 76, 0.25);
  color: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sidebar-header-row .btn-sidebar-collapse:hover {
  background: var(--primary);
  color: #ffffff;
}

.sidebar-header-title h2 {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.3px;
  margin: 0;
}

/* Perfil do Usuário na Sidebar */
.sidebar-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fdfbf9;
  border: 1px solid var(--border-color);
  padding: 8px 10px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #c2704e;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(194, 112, 78, 0.25);
}

.sidebar-user-details {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
}

.sidebar-user-edit-btn {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #059669;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.sidebar-user-edit-btn:hover {
  background: #059669;
  color: #ffffff;
}

/* Card Ambiance Health Institute no Menu Lateral */
.sidebar-ambiance-card {
  background: #ffffff;
  border: 1.5px solid #e8dfd8;
  border-radius: 14px;
  padding: 12px 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  margin-bottom: 14px;
  text-align: center;
}

.ambiance-card-logo-wrap {
  width: 100%;
  max-width: 100px;
  margin: 0 auto 6px auto;
}

.ambiance-card-logo-img {
  max-width: 100%;
  height: auto;
  max-height: 38px;
  object-fit: contain;
}

.ambiance-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary-light);
  background: rgba(168, 93, 76, 0.08);
  border: 1px solid rgba(168, 93, 76, 0.25);
  padding: 2px 8px;
  border-radius: 12px;
  margin-bottom: 6px;
}

.ambiance-card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.ambiance-card-doctors {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  text-align: left;
}

.ambiance-doc-micro {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fdfbf9;
  border: 1px solid #ebdcd3;
  padding: 4px 8px;
  border-radius: 8px;
}

.ambiance-doc-micro img,
.ambiance-doc-micro .doc-micro-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.ambiance-doc-micro .doc-micro-avatar {
  background: linear-gradient(135deg, #c5a880, #9e825c);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}

.ambiance-doc-micro strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.ambiance-doc-micro span {
  font-size: 9px;
  color: var(--text-muted);
}

.ambiance-card-address {
  font-size: 10.5px;
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding-top: 5px;
  border-top: 1px solid #f1ece7;
}

/* Rodapé de Ações Rápidas na Sidebar */
.sidebar-action-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sidebar-footer-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 10.5px;
  font-weight: 600;
  padding: 6px 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.sidebar-footer-btn:hover {
  background: #ffffff;
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.sidebar-footer-btn.btn-danger-soft {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.2);
}

.sidebar-footer-btn.btn-danger-soft:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

/* ==========================================================================
   PAINEL DE CONTROLE MÉDICO: 2 LINHAS DE MÉTRICAS + AGENDA AMPLA ABAIXO
   Design Ambiance Luxury: Elegante, Moderno, Sem Menu Superior Repetitivo
   ========================================================================== */

/* Ocultação Definitiva do Menu Superior (TopBar) */
.topbar,
.topbar.topbar-slim {
  display: none !important;
}

/* Espaçamento Nobre do Conteúdo Principal sem o Menu Superior */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 24px 32px 36px 32px !important;
  max-width: calc(100% - var(--sidebar-width));
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-container.sidebar-collapsed .main-content {
  margin-left: 76px;
  max-width: calc(100% - 76px);
  padding: 24px 32px 36px 32px !important;
}

/* Botão Flutuante de Menu Mobile */
.mobile-menu-floating-trigger {
  display: none;
}

@media (max-width: 768px) {
  .mobile-menu-floating-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 14px;
    left: 14px;
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 1.5px solid #ebdcd3;
    color: #a85d4c;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(168, 93, 76, 0.15);
    z-index: 99;
    cursor: pointer;
    font-size: 16px;
  }

  .main-content {
    margin-left: 0 !important;
    max-width: 100% !important;
    padding: 64px 14px 40px 14px !important;
  }
}

.topbar-slim .subtitle-inline {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
  display: inline-block;
  white-space: nowrap;
}

.topbar-slim .online-public-status {
  padding: 3px 10px;
  font-size: 11px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-slim .online-link-text {
  color: #059669;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar-slim .btn-copy-link {
  background: transparent;
  border: none;
  color: #10b981;
  cursor: pointer;
  padding: 1px 4px;
  font-size: 11px;
}

.topbar-slim .user-profile-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-slim .user-tag-pill {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 6px;
}

.topbar-slim .btn-switch-profile {
  padding: 3px 8px;
  font-size: 11px;
  height: 28px;
  border-radius: 6px;
}

.topbar-slim .btn-sm-action {
  padding: 5px 12px !important;
  font-size: 11.5px !important;
  height: 30px !important;
  border-radius: 6px !important;
}

/* ==========================================================================
   CONTAINER PRINCIPAL DO DASHBOARD (ESTRUTURA HORIZONTAL EMPILHADA)
   ========================================================================== */

.dashboard-stacked-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

/* Seção de 2 Linhas de Cards de Informação */
.kpi-two-tier-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 4px;
}

/* Cada Linha Horizontal com 4 Colunas Equivalentes */
.kpi-tier-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: 100%;
}

/* Card Moderno de KPI */
.kpi-modern-card {
  background: #ffffff;
  border: 1.5px solid #ebdcd3;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 86px;
  box-shadow: 0 2px 8px rgba(168, 93, 76, 0.03);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.kpi-modern-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(168, 93, 76, 0.08);
}

/* Bordas de Identificação Nobre */
.kpi-modern-card.border-green {
  border-left: 4px solid #16a34a !important;
}

.kpi-modern-card.border-teal {
  border-left: 4px solid #0d9488 !important;
}

.kpi-modern-card.border-pink {
  border-left: 4px solid #db2777 !important;
}

.kpi-modern-card.border-blue {
  border-left: 4px solid #0284c7 !important;
}

.kpi-modern-card.border-purple {
  border-left: 4px solid #7c3aed !important;
}

.kpi-modern-card.border-orange {
  border-left: 4px solid #ea580c !important;
}

.kpi-modern-card.border-sky {
  border-left: 4px solid #0284c7 !important;
}

.kpi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.kpi-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.kpi-icon-wrap.bg-gold {
  background: #fef9c3;
  color: #854d0e;
}

.kpi-icon-wrap.bg-pix {
  background: #ccfbf1;
  color: #0f766e;
}

.kpi-icon-wrap.bg-sofia {
  background: #fdf2f8;
  color: #db2777;
}

.kpi-icon-wrap.bg-blue {
  background: #e0f2fe;
  color: #0369a1;
}

.kpi-icon-wrap.bg-green {
  background: #dcfce7;
  color: #166534;
}

.kpi-icon-wrap.bg-purple {
  background: #f3e8ff;
  color: #7c3aed;
}

.kpi-icon-wrap.bg-orange {
  background: #ffedd5;
  color: #c2410c;
}

.kpi-card-value {
  font-size: 21px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
  margin: 1px 0;
}

.kpi-card-footer {
  font-size: 10.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Card Especial: Produção Médica Atual (Linha 2, Card 4) */
.doctor-production-card-modern {
  padding: 8px 12px;
}

.badge-mini-active {
  font-size: 9.5px;
  font-weight: 700;
  color: #0284c7;
  background: #e0f2fe;
  padding: 1px 6px;
  border-radius: 4px;
}

.doctor-revenue-compact-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.doc-compact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 6px;
  background: #f8fafc;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.doc-compact-name {
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}

.doc-compact-sub {
  font-size: 9.5px;
  color: #64748b;
}

.doc-compact-val {
  font-size: 11.5px;
  font-weight: 800;
  color: #059669;
  text-align: right;
  line-height: 1.1;
}

.doc-compact-dep {
  font-size: 9px;
  color: #a85d4c;
  text-align: right;
}

/* ==========================================================================
   AGENDA MÉDICA AMPLA (ABAIXO DAS 2 LINHAS DE INFORMAÇÃO)
   ========================================================================== */

.agenda-wide-container {
  width: 100%;
}

.agenda-wide-card {
  background: #ffffff;
  border: 1.5px solid #ebdcd3;
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 3px 14px rgba(168, 93, 76, 0.04);
  display: flex;
  flex-direction: column;
}

.agenda-wide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #ebdcd3;
  flex-wrap: wrap;
  gap: 12px;
}

.agenda-header-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.agenda-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agenda-title-wrap h3 {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.date-badge-pill {
  font-size: 11px;
  font-weight: 700;
  color: #a85d4c;
  background: #fdf5f2;
  border: 1px solid #ebdcd3;
  padding: 2px 10px;
  border-radius: 12px;
}

.doctor-filter-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-caption {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
}

.doctor-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.doc-filter-pill {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.doc-filter-pill:hover {
  background: #f1f5f9;
  border-color: var(--primary);
  color: var(--primary);
}

.doc-filter-pill.active {
  background: #a85d4c !important;
  color: #ffffff !important;
  border-color: #a85d4c !important;
}

.btn-text-action {
  background: transparent;
  border: none;
  color: #a85d4c;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s ease;
}

.btn-text-action:hover {
  color: #8c4233;
  text-decoration: underline;
}

/* Timeline Ampla com Scroll Confortável */
.schedule-timeline-wide {
  max-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 6px;
}

.schedule-timeline-wide::-webkit-scrollbar {
  width: 6px;
}

.schedule-timeline-wide::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 4px;
}

.schedule-timeline-wide::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.schedule-timeline-wide::-webkit-scrollbar-thumb:hover {
  background: #a85d4c;
}

/* Item de Horário Amplo (.schedule-slot) */
.schedule-slot {
  display: grid !important;
  grid-template-columns: 86px 1fr auto !important;
  gap: 14px !important;
  align-items: center !important;
  padding: 10px 14px !important;
  background: #ffffff !important;
  border: 1px solid #ebdcd3 !important;
  border-left: 4px solid #a85d4c !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.schedule-slot:hover {
  background: #faf7f2 !important;
  border-color: #a85d4c !important;
  box-shadow: 0 4px 14px rgba(168, 93, 76, 0.08) !important;
  transform: translateY(-1px);
}

.schedule-slot.cancelled {
  border-left-color: #ef4444 !important;
  background: #fffafa !important;
}

.slot-time-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 86px;
  flex-shrink: 0;
}

.slot-time {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.1;
}

.slot-date-sub {
  font-size: 10.5px !important;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
}

.slot-patient {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.slot-patient h5 {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.25;
}

.slot-patient p {
  font-size: 11.5px !important;
  color: #475569 !important;
  margin: 0;
  line-height: 1.25;
}

.slot-badge-row {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-top: 3px !important;
}

.slot-badge-pill {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  padding: 3px 8px !important;
  border-radius: 5px !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  cursor: pointer;
  border: 1px solid transparent;
}

.slot-note-text {
  font-size: 11px !important;
  color: #475569 !important;
  margin-top: 3px !important;
  background: #fdfaf8 !important;
  border: 1px dashed #ebdcd3 !important;
  padding: 3px 8px !important;
  border-radius: 4px !important;
  display: inline-block;
}

.slot-actions-col {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

.slot-actions-col .slot-status-badge {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  padding: 4px 9px !important;
  border-radius: 5px !important;
  white-space: nowrap !important;
}

.slot-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-reschedule-slot,
.btn-cancel-slot {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  padding: 4px 9px !important;
  height: 28px !important;
  border-radius: 5px !important;
  white-space: nowrap !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Responsividade Adaptativa para Telas Menores */
@media (max-width: 1200px) {
  .kpi-tier-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .kpi-tier-row {
    grid-template-columns: 1fr;
  }

  .schedule-slot {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .slot-actions-col {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
}

