/* =============================================
   FISIO SaaS — Design System
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg-primary: #05100e;
  --bg-secondary: #091a16;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.15);

  --teal: #0d9488;
  --teal-light: #2dd4bf;
  --blue: #3b82f6;
  --blue-light: #60a5fa;
  --blue-dark: #1d4ed8;
  --copper: #c2703a;
  --copper-light: #d4895a;
  --cyan: #34d399;
  --energy: #f97316;
  --indigo: #6366f1;
  --purple: #8b5cf6;
  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;

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

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-glow-blue: 0 0 40px rgba(59,130,246,0.15);
  --shadow-glow-teal: 0 0 40px rgba(13,148,136,0.18);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-card-hover: 0 8px 40px rgba(0,0,0,0.6);

  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 0.4s cubic-bezier(0.4,0,0.2,1);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

/* ─── Typography ─── */
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); font-weight: 700; line-height: 1.25; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: 0.9375rem; font-weight: 600; }
p { line-height: 1.6; }

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

/* ─── Layout ─── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }

@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 480px) { .grid-4 { grid-template-columns: 1fr; } }

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
  backdrop-filter: blur(12px);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
}

.card-glass {
  background: rgba(13,22,48,0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  color: #fff;
  box-shadow: 0 4px 20px rgba(59,130,246,0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(59,130,246,0.5);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: var(--blue); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  padding: 10px 16px;
}
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); border-color: var(--border); }

.btn-danger { background: rgba(244,63,94,0.15); color: var(--rose); border: 1px solid rgba(244,63,94,0.3); }
.btn-danger:hover { background: rgba(244,63,94,0.25); }

.btn-sm { padding: 8px 16px; font-size: 0.875rem; }
.btn-lg { padding: 16px 32px; font-size: 1.0625rem; }
.btn-full { width: 100%; }

.btn-icon {
  width: 40px; height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ─── Inputs ─── */
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); }

.input {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
  width: 100%;
}
.input:focus { border-color: var(--blue); background: rgba(59,130,246,0.05); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.input::placeholder { color: var(--text-muted); }
.input:disabled { opacity: 0.5; cursor: not-allowed; }

select.input { cursor: pointer; color-scheme: dark; }
select.input option { background: #0d1630; color: #f1f5f9; }
textarea.input { resize: vertical; min-height: 100px; }

input[type="number"].input { color-scheme: dark; }
input[type="number"].input::-webkit-inner-spin-button,
input[type="number"].input::-webkit-outer-spin-button {
  opacity: 1;
  background: rgba(255,255,255,0.12);
  border-left: 1px solid rgba(255,255,255,0.1);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  filter: invert(1) brightness(1.5);
  height: auto;
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-blue { background: rgba(59,130,246,0.15); color: var(--blue-light); border: 1px solid rgba(59,130,246,0.25); }
.badge-emerald { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.badge-amber { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-rose { background: rgba(244,63,94,0.15); color: #fb7185; border: 1px solid rgba(244,63,94,0.25); }
.badge-purple { background: rgba(139,92,246,0.15); color: #a78bfa; border: 1px solid rgba(139,92,246,0.25); }
.badge-cyan { background: rgba(6,182,212,0.15); color: #22d3ee; border: 1px solid rgba(6,182,212,0.25); }

/* ─── Status dot ─── */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--emerald); box-shadow: 0 0 6px var(--emerald); }
.dot-amber { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.dot-rose { background: var(--rose); box-shadow: 0 0 6px var(--rose); }
.dot-blue { background: var(--blue); box-shadow: 0 0 6px var(--blue); }

/* ─── Avatar ─── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-placeholder {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  color: #fff;
}

/* ─── Divider ─── */
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.divider-vertical { width: 1px; background: var(--border); align-self: stretch; }

/* ─── Sidebar Layout ─── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition-slow);
}

.sidebar-logo {
  padding: 28px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}

.logo-text { font-size: 1.125rem; font-weight: 800; }
.logo-tagline { font-size: 0.6875rem; color: var(--text-muted); font-weight: 500; margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.nav-section { margin-bottom: 8px; }
.nav-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: 'Inter', system-ui, sans-serif;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.nav-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.nav-item.active {
  background: rgba(59,130,246,0.12);
  color: var(--blue-light);
  border: 1px solid rgba(59,130,246,0.2);
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: rgba(244,63,94,0.2);
  color: #fb7185;
  border-radius: 99px;
  padding: 1px 7px;
  font-size: 0.7rem;
  font-weight: 700;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition);
}
.user-card:hover { background: var(--bg-card-hover); }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Main Content ─── */
.main-content {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
}

.topbar {
  height: 64px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6,13,31,0.8);
  backdrop-filter: blur(20px);
}

.topbar-title { font-size: 1.125rem; font-weight: 700; }
.topbar-breadcrumb { font-size: 0.875rem; color: var(--text-secondary); }
.topbar-spacer { flex: 1; }

.page-content { padding: 32px; }

/* ─── Stats Card ─── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(59,130,246,0.05));
  pointer-events: none;
}

.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-card); }

.stat-label { font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-change { font-size: 0.8125rem; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-change.up { color: var(--emerald); }
.stat-change.down { color: var(--rose); }
.stat-icon {
  position: absolute; top: 20px; right: 20px;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.125rem;
}

/* ─── Table ─── */
.table-wrapper { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.table tr:hover td { background: rgba(255,255,255,0.02); }
.table tr:last-child td { border-bottom: none; }

/* ─── Calendar ─── */
.calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.cal-header { text-align: center; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); padding: 8px 0; }
.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  gap: 3px;
}
.cal-day:hover { background: var(--bg-card-hover); }
.cal-day.today { background: rgba(59,130,246,0.15); color: var(--blue-light); font-weight: 700; border: 1px solid rgba(59,130,246,0.3); }
.cal-day.selected { background: var(--blue); color: #fff; }
.cal-day.other-month { color: var(--text-muted); }
.cal-dots { display: flex; gap: 2px; }
.cal-dot { width: 4px; height: 4px; border-radius: 50%; }

/* ─── Timeline ─── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 9px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot {
  position: absolute;
  left: -28px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

/* ─── Progress ─── */
.progress { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width 0.6s ease; }

/* ─── Chips ─── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.chip:hover { border-color: var(--blue); color: var(--blue-light); }
.chip.active { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.4); color: var(--blue-light); }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #0d1630;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: var(--transition);
  color-scheme: dark;
  isolation: isolate;
}
.modal .card { backdrop-filter: none; }
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { padding: 24px 24px 0; display: flex; align-items: flex-start; justify-content: space-between; }
.modal-body { padding: 24px; }
.modal-footer { padding: 0 24px 24px; display: flex; gap: 12px; justify-content: flex-end; }

/* ─── Toast ─── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.toast {
  background: #1a2236;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  animation: toastIn 0.3s ease;
  max-width: 360px;
}
.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.error { border-color: rgba(244,63,94,0.4); }

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

/* ─── Skeleton ─── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-secondary);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { margin-bottom: 8px; color: var(--text-primary); }

/* ─── Tooltip ─── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a2236;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: var(--transition);
  z-index: 99;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ─── Animations ─── */
.fade-in { animation: fadeIn 0.5s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.slide-in { animation: slideIn 0.4s ease forwards; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }

.pulse { animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── Notification dot ─── */
.notif-indicator {
  width: 8px; height: 8px;
  background: var(--rose);
  border-radius: 50%;
  position: absolute;
  top: 6px; right: 6px;
  border: 2px solid var(--bg-secondary);
}

/* ─── Chart containers ─── */
.chart-container { position: relative; }
.chart-bar {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
}
.chart-bar-item {
  flex: 1;
  border-radius: 4px 4px 0 0;
  transition: height 0.6s cubic-bezier(0.4,0,0.2,1), opacity 0.2s;
  cursor: pointer;
  position: relative;
}
.chart-bar-item:hover { opacity: 0.8; }
.chart-bar-labels { display: flex; gap: 6px; margin-top: 6px; }
.chart-bar-label { flex: 1; text-align: center; font-size: 0.7rem; color: var(--text-muted); }

/* ─── Responsive sidebar ─── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 200;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 10px 0 40px rgba(0,0,0,0.5); }
  .sidebar-toggle { display: flex; }
  .main-content { margin-left: 0; }
  .page-content { padding: 20px; }
  .topbar { padding: 0 16px 0 60px; }
}

@media (max-width: 640px) {
  #topbarSearchWrap { display: none; }
  .topbar-link-label { display: none; }
  #topbarLinkBtn { padding: 8px; min-width: 36px; }
  .topbar { gap: 10px; }
  .topbar-breadcrumb { display: none; }
}

/* ─── Misc ─── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-auto { margin-top: auto; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-secondary); }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no-shrink { flex-shrink: 0; }

.glow-blue { text-shadow: 0 0 20px rgba(59,130,246,0.6); }

/* ── Enhanced stat card color variants ── */
.stat-card-emerald { border-top: 2px solid var(--emerald); }
.stat-card-blue    { border-top: 2px solid var(--blue); }
.stat-card-purple  { border-top: 2px solid var(--purple); }
.stat-card-cyan    { border-top: 2px solid var(--cyan); }
.stat-card-amber   { border-top: 2px solid var(--amber); }

/* ── Pulse animation for live status ── */
@keyframes pulse-ring {
  0%   { transform: scale(1);   opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}
.pulse-dot {
  position: relative;
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--emerald);
}
.pulse-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--emerald);
  animation: pulse-ring 1.6s ease-out infinite;
}

/* ── Chat bubble styles (WhatsApp simulation) ── */
.chat-window {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 16px;
  background: #0a1628;
  border-radius: 12px;
  overflow-y: auto;
  max-height: 420px;
}
.chat-bubble {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 0.8375rem;
  line-height: 1.45;
  position: relative;
}
.chat-bubble-out {
  background: linear-gradient(135deg, rgba(37,211,102,0.18), rgba(18,140,126,0.18));
  border: 1px solid rgba(37,211,102,0.2);
  border-radius: 12px 2px 12px 12px;
  align-self: flex-end;
  color: #e2fce7;
}
.chat-bubble-in {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 2px 12px 12px 12px;
  align-self: flex-start;
  color: var(--text-primary);
}
.chat-bubble-bot {
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 2px 12px 12px 12px;
  align-self: flex-start;
  color: #bfdbfe;
}
.chat-time {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.3);
  margin-top: 4px;
  text-align: right;
}
.chat-sender {
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: 3px;
}
.chat-sender-bot { color: var(--blue); }
.chat-sender-patient { color: var(--emerald); }

/* ── Template cards (WhatsApp) ── */
.template-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  transition: var(--transition);
  cursor: pointer;
}
.template-card:hover { border-color: var(--blue); background: rgba(59,130,246,0.04); }
.template-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.template-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
}
.template-tag-agendamento { background: rgba(59,130,246,0.15); color: var(--blue); }
.template-tag-confirmacao { background: rgba(16,185,129,0.15); color: var(--emerald); }
.template-tag-lembrete    { background: rgba(245,158,11,0.15); color: var(--amber); }
.template-tag-retorno     { background: rgba(139,92,246,0.15); color: var(--purple); }

/* ── Plan / subscription card ── */
.plan-card {
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(139,92,246,0.06));
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}
.plan-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8375rem;
  color: var(--text-secondary);
  padding: 5px 0;
}
.plan-feature svg { color: var(--emerald); flex-shrink: 0; }

/* ── KPI / metric cards ── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 900px) { .kpi-row { grid-template-columns: repeat(2,1fr); } }
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  transition: var(--transition);
}
.kpi-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.kpi-value { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.kpi-label { font-size: 0.72rem; color: var(--text-secondary); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-delta { font-size: 0.7rem; margin-top: 4px; font-weight: 600; }
.kpi-delta.up   { color: var(--emerald); }
.kpi-delta.down { color: var(--rose); }

/* ── QR code placeholder ── */
.qr-placeholder {
  width: 160px; height: 160px;
  background: #fff;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
  flex-shrink: 0;
}
.qr-inner {
  width: 100%; height: 100%;
  display: grid;
  grid-template-columns: repeat(7,1fr);
  gap: 2px;
}

/* ── Share buttons ── */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.share-btn:hover { transform: translateY(-1px); }
.share-btn-whatsapp { border-color: rgba(37,211,102,0.3); background: rgba(37,211,102,0.06); color: #34d399; }
.share-btn-whatsapp:hover { border-color: rgba(37,211,102,0.5); background: rgba(37,211,102,0.1); }
.share-btn-copy { border-color: rgba(59,130,246,0.3); background: rgba(59,130,246,0.06); color: var(--blue); }
.share-btn-copy:hover { border-color: var(--blue); background: rgba(59,130,246,0.1); }
.share-btn-email { border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.06); color: var(--amber); }
.share-btn-email:hover { border-color: var(--amber); background: rgba(245,158,11,0.1); }

/* ── Notification toggle ── */
.notif-pref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.notif-pref:last-child { border-bottom: none; }
.toggle {
  width: 40px; height: 22px;
  background: var(--blue);
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.toggle::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.2s;
}
.toggle.off { background: rgba(255,255,255,0.12); }
.toggle.off::after { transform: none; }
.toggle:not(.off)::after { transform: translateX(18px); }

/* ── Session type tags ── */
.tag-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
}
.tag-avaliacao  { background: rgba(59,130,246,0.15); color: var(--blue); }
.tag-retorno    { background: rgba(16,185,129,0.15); color: var(--emerald); }
.tag-alta       { background: rgba(139,92,246,0.15); color: var(--purple); }
.tag-emergencia { background: rgba(239,68,68,0.15);  color: #f87171; }
.tag-online     { background: rgba(6,182,212,0.15);  color: var(--cyan); }

/* ── Testimonial card ── */
.testimonial {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 24px;
}
.testimonial-text { font-size: 0.875rem; color: var(--text-secondary, #94a3b8); line-height: 1.55; font-style: italic; }
.testimonial-author { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.testimonial-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,#3b82f6,#34d399); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.testimonial-name { font-size: 0.8rem; font-weight: 700; }
.testimonial-cred { font-size: 0.72rem; color: var(--text-muted, #64748b); }

/* ── Link de agendamento stats ── */
.link-stat {
  text-align: center;
  padding: 14px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  flex: 1;
}
.link-stat-value { font-size: 1.4rem; font-weight: 800; }
.link-stat-label { font-size: 0.7rem; color: var(--text-secondary); margin-top: 4px; }

