/* Dark theme removed — la app usa un único tema global claro. */

:root,
:root[data-theme-mode="light"] {
  --bg-main: #ffffff;
  --sidebar-color: #ffffff;
  --card-color: #ffffff;
  --bg: #ffffff;
  --bg-2: #ffffff;
  --bg-3: #ffffff;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --accent-2: #475569;
  --accent-3: #334155;
  --nav: #ffffff;
  --stroke: rgba(15, 23, 42, 0.08);
  --stroke-strong: rgba(15, 23, 42, 0.12);
  --soft: rgba(15, 23, 42, 0.04);
  --shadow: 0 22px 48px rgba(15, 23, 42, 0.10);
  --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.08);
  --backdrop-start: rgba(255, 255, 255, 0.98);
  --backdrop-end: rgba(248, 250, 252, 0.98);
  --orb-primary: transparent;
  --orb-secondary: transparent;
  --neon-glow: rgba(59, 130, 246, 0.10);
  --chart-tick: rgba(15, 23, 42, 0.72);
  --chart-grid: rgba(15, 23, 42, 0.08);
  --stat-tail: #eff4fb;
  --card-bg: rgba(255, 255, 255, 0.96);
  --border-soft: rgba(15, 23, 42, 0.08);
  --bg-hover: #f1f5f9;
  --text-main: #0f172a;
  --text-secondary: #64748b;
  /* Mode-independent tokens (brand, status, radii) */
  --primary-color: #1f5fff;
  --primary-light: rgba(31, 95, 255, 0.11);
  --primary-glow: rgba(31, 95, 255, 0.3);
  --accent: var(--primary-color);
  --accent-depth: #3b82f6;
  --blue: #1f5fff;
  --blue-glow: rgba(31, 95, 255, 0.26);
  --success-color: #22c55e;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --radius-card: 16px;
  --radius-shell: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Roboto", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: radial-gradient(
      circle at 14% 6%,
      var(--orb-primary),
      transparent 34%
    ),
    radial-gradient(
      circle at 88% 14%,
      var(--orb-secondary),
      transparent 36%
    ),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 56%, var(--bg-3) 100%);
  background-attachment: fixed;
}

body.no-scroll {
  overflow: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  filter: blur(42px);
  opacity: 0.22;
  z-index: 0;
  pointer-events: none;
}

body::before {
  top: -140px;
  left: -140px;
  background: radial-gradient(circle, var(--orb-primary), transparent 72%);
}

body::after {
  bottom: -170px;
  right: -120px;
  background: radial-gradient(circle, var(--orb-secondary), transparent 72%);
}

img {
  max-width: 100%;
  display: block;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  padding: 20px 24px 24px;
  position: relative;
  z-index: 1;
}

.sidebar {
  position: sticky;
  top: 20px;
  height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--nav);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 14px 10px 18px;
  gap: 10px;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 10px;
  border-bottom: 1px solid var(--stroke);
}

.sidebar-brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sidebar-brand-copy strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}

.sidebar-brand-copy span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav-shell {
  display: grid;
  gap: 6px;
  min-height: 0;
  flex: 1 1 auto;
}

.sidebar-section-title {
  padding: 10px 10px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar .nav-dot:hover:not(.active) {
  color: var(--ink);
}

.sidebar-industry {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--soft);
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.02em;
  display: grid;
  gap: 6px;
}

.sidebar-scope-link {
  color: #3ea6ff;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-group-children {
  display: none;
  gap: 4px;
  padding-left: 8px;
}

.nav-group.is-expanded .nav-group-children {
  display: grid;
}

.nav-dot-sub {
  min-height: 44px;
  border-radius: 12px;
  padding: 6px 10px;
}

.nav-dot-sub .nav-label {
  font-size: 12px;
}

.logo {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(37, 99, 235, 0.14));
  border: 1px solid var(--stroke-strong);
  color: var(--ink);
  font-weight: 700;
  display: grid;
  place-items: center;
  font-family: "Inter", "Roboto", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  position: relative;
}

.logo-link {
  text-decoration: none;
  align-self: center;
  margin-bottom: 0;
}

.logo-link.has-image {
  background:
    radial-gradient(circle at 25% 18%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(145deg, #0f172a, #020617);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: var(--shadow-soft);
  padding: 10px;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
}

.logo-link.has-image .logo-mark {
  width: 100%;
  height: 100%;
  padding: 6px;
  border-radius: 999px;
  object-fit: contain;
}

.logo-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.nav-dot {
  --nav-icon-color: var(--muted);
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  transition: color 0.22s ease, opacity 0.22s ease, background 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: transparent;
  box-shadow: none;
  flex: 0 0 28px;
}

.nav-dot svg {
  width: 20px;
  height: 20px;
  color: var(--nav-icon-color);
}

.nav-icon-image {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.nav-dot[data-nav-key="module-integration.ribotech"] .nav-icon,
.nav-dot[data-nav-key="module-integration.prosperprox"] .nav-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  overflow: hidden;
}

.nav-dot[data-nav-key="module-integration.ribotech"] .nav-icon-image,
.nav-dot[data-nav-key="module-integration.prosperprox"] .nav-icon-image {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  object-fit: contain;
}

.nav-dot-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nav-label {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 500;
  color: inherit;
  text-align: left;
  max-width: 100%;
  display: block;
  word-break: break-word;
  letter-spacing: 0.01em;
}

.nav-dot.active {
  --nav-icon-color: var(--ink);
  color: var(--ink);
  background: var(--soft);
  border-color: var(--stroke);
  box-shadow: none;
  transform: none;
}

.nav-dot.active .nav-icon {
  background: transparent;
}

.nav-dot.active .nav-label {
  font-weight: 700;
}

.nav-dot:hover:not(.active) {
  background: var(--surface-elevated);
  border-color: var(--stroke);
  box-shadow: none;
}

/* Canonical LeadsFlows sidebar style used across dashboards and industry workspaces. */
.sidebar {
  background: #ffffff;
  color: var(--ink);
  border-color: rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  font-family: "Roboto", "Segoe UI", Arial, sans-serif;
}

.sidebar-brand {
  border-bottom: 0;
  padding: 4px 8px 12px;
}

.sidebar-brand-copy strong {
  color: var(--ink);
  font-size: 18px;
  font-family: "Roboto", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sidebar-brand-copy span,
.sidebar-section-title,
.sidebar-industry,
.nav-dot {
  color: #64748b;
  font-family: "Roboto", "Segoe UI", Arial, sans-serif;
}

.sidebar-section-title {
  padding: 8px 12px 2px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.sidebar-section-title--nested {
  padding-left: 30px;
}

.sidebar-nav-shell,
.nav-group,
.nav-group-children {
  gap: 3px;
}

.nav-group-children {
  padding-left: 0;
}

.nav-group:not(.is-expanded) .nav-group-children {
  display: none;
}

.nav-group.is-expanded .nav-group-children {
  display: grid;
}

.nav-dot,
.nav-dot-sub {
  min-height: 44px;
  border-radius: 10px;
  padding: 0 14px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-family: "Roboto", "Segoe UI", Arial, sans-serif;
  font-weight: 500;
  letter-spacing: 0.01em;
  gap: 12px;
}

.nav-dot-button {
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.nav-dot i {
  width: 20px;
  height: 20px;
  color: var(--nav-icon-color);
}

.nav-dot-sub {
  min-height: 40px;
  padding-left: 30px;
  color: #70819a;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
  border-radius: 0;
}

.nav-dot svg {
  width: 20px;
  height: 20px;
}

.nav-dot-sub svg {
  width: 17px;
  height: 17px;
}

.nav-label,
.nav-dot-sub .nav-label {
  font-size: 14px;
  font-family: "Roboto", "Segoe UI", Arial, sans-serif;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-dot.active,
.nav-dot.is-active,
.nav-dot:hover:not(.active) {
  color: #2563eb;
  background: #eef4ff;
  border-color: transparent;
  box-shadow: none;
}

.nav-dot.active,
.nav-dot.is-active {
  --nav-icon-color: #2563eb;
}

.nav-dot.active .nav-label,
.nav-dot.is-active .nav-label {
  color: #2563eb;
  font-weight: 700;
}

.main {
  padding: 0 6px 40px 0;
  min-width: 0;
}

.content-grid {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 22px;
  padding: 18px 22px;
  border-radius: var(--radius-shell);
  border: 1px solid var(--stroke-strong);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-elevated) 100%);
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--stroke);
  backdrop-filter: blur(10px);
}

.topbar-copy {
  display: grid;
  gap: 8px;
}

.page-hero-shell {
  margin-top: -4px;
}

.page-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.page-hero-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  min-height: 100%;
  padding: 24px;
  border-radius: var(--radius-shell);
  border: 1px solid var(--stroke-strong);
  background:
    radial-gradient(circle at top left, rgba(31, 95, 255, 0.18), transparent 36%),
    linear-gradient(155deg, var(--surface) 0%, var(--surface-elevated) 100%);
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--stroke);
}

.page-hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, var(--soft), transparent 35%);
}

.page-hero-card > * {
  position: relative;
  z-index: 1;
}

.page-hero-card--secondary {
  background:
    radial-gradient(circle at top right, rgba(12, 169, 255, 0.14), transparent 34%),
    linear-gradient(155deg, var(--surface-elevated) 0%, var(--surface) 100%);
}

.hero-eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(31, 95, 255, 0.1);
  border: 1px solid rgba(31, 95, 255, 0.22);
  color: #1a4fd8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-hero-title {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.page-hero-copy {
  margin: 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.hero-stat-row,
.hero-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-note-list {
  display: grid;
  gap: 10px;
}

.hero-stat-chip,
.hero-note-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke-strong);
  background: rgba(31, 95, 255, 0.045);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.hero-stat-chip strong,
.hero-note-chip strong {
  color: var(--ink);
}

.hero-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--stroke-strong);
  background: rgba(31, 95, 255, 0.05);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.hero-action-button:hover {
  transform: translateY(-1px);
  color: var(--ink);
  border-color: rgba(31, 95, 255, 0.34);
  box-shadow: 0 14px 28px rgba(10, 37, 64, 0.12);
}

.hero-action-button.primary {
  background: linear-gradient(135deg, #2b6dff, #1f5fff 52%, #1749d6 100%);
  border-color: transparent;
  color: #fff;
}

.hero-action-button.secondary {
  background: rgba(31, 95, 255, 0.035);
}

.workspace-surface-shell {
  margin-top: 18px;
}

.workspace-surface-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.88fr);
  gap: 18px;
}

.workspace-surface-main,
.workspace-surface-side {
  gap: 20px;
}

.workspace-surface-header {
  display: grid;
  gap: 10px;
}

.workspace-surface-title {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.workspace-surface-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.workspace-surface-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.workspace-surface-stat-card,
.workspace-surface-action-card,
.workspace-connection-card,
.workspace-surface-checklist {
  display: grid;
  gap: 10px;
}

.workspace-surface-stat-card {
  min-height: 132px;
  padding: 18px;
  border-radius: 22px;
}

.workspace-surface-stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.workspace-surface-stat-card strong {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1;
}

.workspace-surface-stat-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.workspace-surface-action-grid,
.workspace-surface-connection-grid {
  display: grid;
  gap: 12px;
}

.workspace-surface-action-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workspace-surface-action-card,
.workspace-connection-card,
.workspace-surface-checklist {
  padding: 18px;
  border-radius: 22px;
}

.workspace-surface-action-copy h4,
.workspace-connection-copy h4,
.workspace-surface-checklist-head h4,
.workspace-surface-checklist-item strong {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.workspace-surface-action-copy p,
.workspace-connection-copy p,
.workspace-surface-checklist-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.workspace-surface-action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.workspace-connection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workspace-connection-mark {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(31, 95, 255, 0.08);
  border: 1px solid rgba(31, 95, 255, 0.16);
  color: var(--primary-color);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-surface-checklist-list {
  display: grid;
  gap: 12px;
}

.workspace-surface-checklist-item {
  display: grid;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px dashed var(--stroke);
}

.workspace-surface-checklist-item:first-child {
  padding-top: 0;
  border-top: none;
}

.hero-side-head {
  display: grid;
  gap: 6px;
}

.hero-side-head h3 {
  margin: 0;
  font-size: 18px;
}

.hero-side-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.hero-note-chip {
  justify-content: space-between;
  border-radius: 16px;
  min-height: 0;
  padding: 12px 14px;
}

.hero-note-chip span {
  color: var(--muted);
  font-size: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  min-width: 240px;
  border-radius: 999px;
  border: 1px solid var(--stroke-strong);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(6px);
  position: relative;
}

.user-chip-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.user-chip-inline-logout {
  flex-shrink: 0;
}

.user-chip-profile-link:hover {
  color: inherit;
}

.topbar:not(.app-topbar) .user-chip-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 0;
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
}

.user-chip-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--stroke-strong);
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
  text-decoration: none;
}

.user-chip-icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary-glow);
  color: var(--primary-color);
  background: var(--primary-light);
}

.user-chip-icon-btn svg {
  width: 17px;
  height: 17px;
}

.theme-toggle-btn .theme-icon-sun {
  display: none;
}

.theme-toggle-btn[data-mode="light"] .theme-icon-sun {
  display: block;
}

.theme-toggle-btn[data-mode="light"] .theme-icon-moon {
  display: none;
}

.user-avatar {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-elevated);
  color: var(--ink);
  font-weight: 600;
  flex: 0 0 52px;
  z-index: 1;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.user-avatar::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #3b82f6, #22c55e, #3b82f6);
  animation: rotateRing 3s linear infinite;
  z-index: -1;
}

.user-avatar::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.4), transparent 70%);
  filter: blur(6px);
  z-index: -2;
}

@keyframes rotateRing {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.user-avatar .status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 8px #22c55e;
}

.user-avatar:hover {
  transform: scale(1.08);
  transition: all 0.3s ease;
}

.user-name {
  font-weight: 700;
  font-size: 13px;
}

.user-role {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-color);
  line-height: 1.2;
}

.logout-link {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  margin-top: 2px;
}

.logout-link:hover {
  color: var(--primary-color);
}

a:hover {
  color: var(--primary-color);
}

.search-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--stroke-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.search-field:focus-within {
  border-color: var(--primary-glow);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.search-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}

.search-icon svg {
  width: 18px;
  height: 18px;
}

.search-input {
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  min-width: 180px;
  outline: none;
}

.search-input::placeholder {
  color: var(--muted);
}

.title {
  font-size: clamp(26px, 3vw, 40px);
  margin: 0 0 6px;
  font-family: "Inter", "Roboto", "Segoe UI", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.company-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.company-title-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.panel,
.progress-card {
  background: linear-gradient(145deg, var(--surface), var(--surface-elevated));
  border: 1px solid var(--stroke);
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 var(--stroke);
  backdrop-filter: blur(9px);
  border-radius: 20px;
}

.panel {
  padding: 22px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.panel.is-flat,
.integration-section-card.is-flat,
:root[data-theme-mode="light"] .panel.is-flat,
:root[data-theme-mode="light"] .integration-section-card.is-flat {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.panel:hover {
  border-color: rgba(31, 95, 255, 0.24);
  box-shadow: 0 24px 54px rgba(31, 95, 255, 0.12);
}

.panel.is-flat:hover,
.integration-section-card.is-flat:hover {
  border-color: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.lead-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.chat-panel {
  align-self: stretch;
  height: auto;
  background: linear-gradient(165deg, var(--surface), var(--surface-elevated));
  color: var(--ink);
  border-radius: 22px;
  padding: 20px;
  border: 1px solid var(--stroke);
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  box-shadow: var(--shadow-soft);
}

.chat-panel,
.chat-stack,
.chat-messages,
.chat-bar,
.chat-input,
.chat-send,
.chat-bubble,
.chat-body,
.chat-sender,
.chat-meta {
  font-family: "Segoe UI", "Roboto", "Oxygen", "Open Sans", "Helvetica Neue", sans-serif;
}

.chat-panel.preview {
  min-height: 220px;
  grid-template-rows: auto auto 1fr;
}

.chat-header {
  display: none;
}

.chat-header h3 {
  margin: 0;
}

.chat-header p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.chat-pill {
  font-size: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  border: 1px solid var(--stroke);
}

.chat-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  font-family: inherit;
}

.chat-hidden {
  display: none;
}

.chat-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 16px;
  background: var(--soft);
  border: 1px solid var(--stroke);
  max-width: 100%;
}

.chat-contact .chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  flex: 0 0 34px;
}

.chat-contact .chat-avatar-initials {
  font-size: 13px;
  font-weight: 700;
}

.chat-contact > div:last-child {
  min-width: 0;
  flex: 1 1 auto;
}

.chat-open {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--stroke);
  transition: 0.2s ease;
}

.chat-open:hover {
  border-color: var(--primary-glow);
  color: var(--primary-color);
}

.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-weight: 600;
  background-size: cover;
  background-position: center;
  position: relative;
}

.chat-avatar.has-image {
  color: transparent;
}

.chat-avatar-initials {
  position: relative;
  z-index: 1;
}

.whatsapp-badge {
  position: static;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #25d366;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.whatsapp-badge::before {
  content: "";
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='white' d='M19.11 17.2c-.27-.14-1.6-.79-1.85-.88-.25-.09-.43-.14-.61.14-.18.27-.7.88-.86 1.06-.16.18-.32.2-.59.07-.27-.14-1.13-.42-2.16-1.34-.8-.71-1.34-1.59-1.5-1.86-.16-.27-.02-.42.12-.55.12-.12.27-.32.41-.48.14-.16.18-.27.27-.45.09-.18.05-.34-.02-.48-.07-.14-.61-1.47-.84-2.01-.22-.53-.45-.46-.61-.47h-.52c-.18 0-.48.07-.73.34-.25.27-.95.93-.95 2.26s.97 2.62 1.1 2.8c.14.18 1.91 2.92 4.62 4.09.64.28 1.14.45 1.53.57.64.2 1.22.17 1.68.1.51-.08 1.6-.65 1.82-1.28.23-.63.23-1.17.16-1.28-.07-.11-.25-.18-.52-.32z'/><path fill='white' d='M16 3C9.37 3 4 8.37 4 15c0 2.32.66 4.49 1.8 6.33L4 29l7.86-1.76A11.94 11.94 0 0 0 16 27c6.63 0 12-5.37 12-12S22.63 3 16 3zm0 21.6c-2.02 0-3.9-.6-5.48-1.62l-.39-.24-4.66 1.05 1.04-4.54-.25-.4A9.58 9.58 0 0 1 6.4 15C6.4 9.7 10.7 5.4 16 5.4S25.6 9.7 25.6 15 21.3 24.6 16 24.6z'/></svg>");
  background-repeat: no-repeat;
  background-size: contain;
}
.chat-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  font-size: 14px;
  line-height: 1.1;
}

.chat-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-name .whatsapp-badge {
  margin-left: auto;
}

.chat-contact .whatsapp-badge {
  width: 18px;
  height: 18px;
}

.chat-contact .whatsapp-badge::before {
  width: 12px;
  height: 12px;
}

.chat-sub {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.1;
  color: var(--muted);
}

.chat-messages {
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 6px;
  overflow-y: auto;
  height: 100%;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.chat-panel.preview .chat-messages {
  height: 140px;
  overflow: hidden;
}

.chat-stack {
  background: var(--soft);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-card);
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  height: 100%;
  min-height: 0;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

.whatsapp-main {
  display: block;
}

.whatsapp-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(320px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.whatsapp-layout.followup-layout {
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.8fr) minmax(320px, 0.95fr);
  align-items: start;
}

.followup-center-stack {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.whatsapp-layout > .panel,
.whatsapp-layout > .chat-panel {
  height: auto;
  max-height: 600px;
  min-width: 0;
}

.whatsapp-layout > .chat-panel {
  height: 750px;
  min-height: 750px;
  max-height: 750px;
  width: 100%;
  min-width: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.whatsapp-layout > .detail-panel {
  max-height: none;
  min-width: 0;
}

.whatsapp-layout > .progress-panel {
  max-height: none;
  min-width: 0;
}

.progress-panel {
  display: grid;
  gap: 10px;
  height: fit-content;
  overflow: visible;
  align-content: start;
}

.progress-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.progress-card .field {
  display: grid;
  gap: 6px;
}

.progress-card .two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.case-detail-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.progress-card .field-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.progress-card input[type="text"],
.progress-card input[type="number"],
.progress-card select {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  background: var(--surface-elevated);
  color: var(--ink);
  width: 100%;
}

.progress-card-inline {
  margin-bottom: 12px;
  text-align: center;
  justify-items: center;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.52));
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.14);
}

.progress-card-inline .progress-title {
  text-align: left;
  justify-self: start;
  font-size: 15px;
  font-weight: 800;
}

.progress-card-inline .progress-step-list {
  width: 100%;
}

.progress-label {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.progress-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.progress-value {
  font-size: 22px;
}

.progress-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.progress-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-elevated);
}

.progress-dot.active {
  color: var(--ink);
  border-color: var(--primary-glow);
  background: var(--primary-light);
}

.progress-remaining {
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--stroke);
  padding-top: 6px;
}

.progress-step-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  border-top: 1px solid var(--stroke);
  font-size: 11px;
  color: var(--ink);
  margin-top: 0;
  background: var(--soft);
  border-radius: 12px;
  padding: 10px 8px 12px;
  position: relative;
  --progress: 0%;
  --progress-pad: 14px;
  justify-items: center;
}

.progress-step-list--wide {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 10px 10px;
}

.progress-step-list--wide .progress-step-item {
  white-space: normal;
  font-size: 11px;
  line-height: 1.25;
  word-break: normal;
  hyphens: none;
}

.progress-step-item {
  padding-top: 30px;
  padding-left: 0;
  position: relative;
  line-height: 1.2;
  text-align: center;
  min-height: 48px;
  word-break: normal;
  hyphens: none;
  width: 100%;
}

.progress-step-list::before {
  content: "";
  position: absolute;
  left: calc(var(--progress-pad) + (100% - (var(--progress-pad) * 2)) / 6);
  right: calc(var(--progress-pad) + (100% - (var(--progress-pad) * 2)) / 6);
  top: 16px;
  height: 3px;
  border-radius: 999px;
  background: var(--stroke-strong);
}

.progress-step-list--intake::before {
  left: calc(var(--progress-pad) + (100% - (var(--progress-pad) * 2)) / 8 - 12px);
  right: calc(var(--progress-pad) + (100% - (var(--progress-pad) * 2)) / 8 + 82px);
}

.progress-step-list--claim::before {
  left: calc(var(--progress-pad) + (100% - (var(--progress-pad) * 2)) / 10);
  right: calc(var(--progress-pad) + (100% - (var(--progress-pad) * 2)) / 10);
}
.progress-step-list.has-progress::before {
  background: linear-gradient(
    90deg,
    var(--primary-color) 0,
    var(--primary-color) var(--progress),
    var(--stroke-strong) var(--progress),
    var(--stroke-strong) 100%
  );
}

.progress-step-item::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--stroke-strong);
  position: absolute;
  left: 50%;
  top: 5px;
  transform: translateX(-50%);
}

.progress-step-item.active {
  color: var(--ink);
}

.progress-step-item.active::before {
  background: var(--primary-color);
}

.progress-step-item.active::after {
  content: "✓";
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.progress-input {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  background: var(--surface-elevated);
  color: var(--ink);
  font-size: 13px;
  width: 100%;
  max-width: 280px;
}

.time-fields {
  display: grid;
  gap: 6px;
}

.time-row {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.time-row input[type="date"] {
  justify-self: end;
  width: 96px;
}

.time-row-check span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.time-row-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

.time-row input {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px 8px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 12px;
}

.time-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  justify-items: center;
  text-align: center;
}

.time-metrics strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  margin-top: 6px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--primary-light);
  border: 1px solid var(--primary-glow);
  width: fit-content;
}

.calendar-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(148, 163, 184, 0.05));
}

.calendar-head {
  font-weight: 600;
  margin-bottom: 12px;
}

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

.calendar-grid span {
  padding: 6px 0;
  border-radius: 10px;
}

.calendar-grid span.weekday {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.calendar-grid span.muted {
  opacity: 0.3;
}

.calendar-grid .active {
  background: var(--primary-light);
  border: 1px solid var(--primary-glow);
  color: var(--ink);
}

.detail-panel .two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-panel .field {
  display: grid;
  gap: 7px;
}

.detail-panel .field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.92);
}

.detail-panel .field-label.field-label--icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.field-label-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 0;
  flex-shrink: 0;
  border: none;
  background: transparent;
}

.field-label-icon svg {
  width: 18px;
  height: 18px;
}

.field-label-icon--sky {
  color: var(--primary-color);
}

.field-label-icon--emerald {
  color: #10b981;
}

.field-label-icon--amber {
  color: #f59e0b;
}

.field-label-icon--rose {
  color: #f43f5e;
}

.field-label-icon--violet {
  color: #8b5cf6;
}

.field-label-icon--lime {
  color: #84cc16;
}

.field-label-icon--cyan {
  color: #06b6d4;
}

.detail-panel input[type="text"],
.detail-panel input[type="email"],
.detail-panel input[type="date"],
.detail-panel input[type="time"],
.detail-panel select,
.detail-panel textarea {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 11px 12px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  width: 100%;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.detail-panel input[type="text"]:focus,
.detail-panel input[type="email"]:focus,
.detail-panel input[type="date"]:focus,
.detail-panel input[type="time"]:focus,
.detail-panel select:focus,
.detail-panel textarea:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.42);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.detail-panel textarea {
  resize: vertical;
  min-height: 112px;
}

.insurance-fields {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(148, 163, 184, 0.05));
}

.lead-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin-bottom: 6px;
}

.check-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.check-row input {
  width: 16px;
  height: 16px;
}

.conversation-panel {
  height: fit-content;
}

.conversation-avatar {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.84), rgba(16, 185, 129, 0.76));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.conversation-list {
  display: grid;
  gap: 10px;
  max-height: 340px;
  overflow: auto;
  padding-right: 2px;
}

.conversation-item {
  appearance: none;
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.conversation-item:hover,
.conversation-item.is-active {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.34);
  background: rgba(59, 130, 246, 0.1);
}

.conversation-info strong {
  display: block;
  font-size: 13px;
}

.conversation-info span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.chat-empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.chat-bubble {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 9px 11px 7px;
  border-radius: 16px;
  font-size: 11px;
  max-width: 86%;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.chat-bubble.incoming {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(34, 197, 94, 0.14);
  align-self: flex-start;
  border-top-left-radius: 6px;
}

.chat-bubble.outgoing {
  background: linear-gradient(135deg, var(--primary-light), rgba(59, 130, 246, 0.38));
  border: 1px solid var(--primary-glow);
  align-self: flex-end;
  border-top-right-radius: 6px;
}

:root[data-theme-mode="light"] .chat-bubble.incoming {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  border-color: rgba(34, 197, 94, 0.16);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

:root[data-theme-mode="light"] .chat-bubble.outgoing {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(37, 99, 235, 0.22));
  border-color: rgba(59, 130, 246, 0.18);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.10);
}

:root[data-theme-mode="light"] .chat-bubble.ai {
  background: linear-gradient(180deg, rgba(240, 249, 255, 0.98), rgba(224, 242, 254, 0.98));
  border-color: rgba(14, 165, 233, 0.18);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.08);
}

:root[data-theme-mode="light"] .chat-sender {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.08);
  color: #475569;
}

:root[data-theme-mode="light"] .chat-bubble.incoming .chat-sender {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.18);
  color: #166534;
}

:root[data-theme-mode="light"] .chat-bubble.staff .chat-sender,
:root[data-theme-mode="light"] .chat-bubble.outgoing .chat-sender {
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.18);
  color: #1d4ed8;
}

:root[data-theme-mode="light"] .chat-bubble.ai .chat-sender {
  background: rgba(14, 165, 233, 0.10);
  border-color: rgba(14, 165, 233, 0.18);
  color: #0369a1;
}

.chat-meta {
  font-size: 8px;
  color: var(--muted);
  text-align: right;
  margin-top: -1px;
}

.chat-body {
  font-size: 12px;
  line-height: 1.38;
  letter-spacing: 0.01em;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
}

.chat-send {
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 15px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-depth));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.chat-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-top: none;
  border-radius: 0;
  background: transparent;
}

.chat-bar .chat-input {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--surface-elevated);
  padding: 10px 12px;
  font-size: 12px;
}

.chat-bar .chat-input:focus {
  outline: none;
  box-shadow: none;
}

.chat-bar .chat-input::placeholder {
  font-size: 12px;
}

.panel + .panel {
  margin-top: 24px;
}

.whatsapp-layout .panel + .panel {
  margin-top: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-header-spacer {
  flex: 1;
}

.panel-header h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.detail-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  width: 100%;
  gap: 8px;
  margin: 12px 0 14px;
  padding: 8px;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.9), rgba(12, 18, 31, 0.92));
  border: 1px solid var(--stroke-strong);
  border-radius: 16px;
  overflow-x: visible;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

.detail-tabs::-webkit-scrollbar {
  height: 6px;
}

.detail-tabs::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
}

.detail-tabs.tab-bar {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.9), rgba(12, 18, 31, 0.92));
  border: 1px solid var(--stroke-strong);
  padding: 8px;
}

.detail-tabs .tab-button {
  padding: 7px 9px;
  min-height: 34px;
  font-size: 12px;
  white-space: nowrap;
  width: auto;
  text-align: center;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  flex: 1 1 118px;
  font-weight: 700;
}

.detail-tabs .tab-button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
  border-color: rgba(96, 165, 250, 0.35);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.title-case-number {
  display: block;
  margin-top: 6px;
  font-size: 0.6em;
  color: var(--muted);
  font-weight: 500;
}

.detail-tab-panel {
  display: none;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.58));
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.14);
}

.detail-tab-panel.active {
  display: grid;
  gap: 14px;
}

.detail-tabs .detail-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.detail-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 0;
  flex-shrink: 0;
  border: none;
  background: transparent;
}

.detail-tab-icon svg {
  width: 18px;
  height: 18px;
}

.detail-tab-icon--sky {
  color: var(--primary-color);
}

.detail-tab-icon--emerald {
  color: #10b981;
}

.detail-tab-icon--amber {
  color: #f59e0b;
}

.detail-tabs .detail-tab[data-tab="appointments"] .detail-tab-icon {
  transform: translateY(-2px);
}

.detail-tab-icon--violet {
  color: #8b5cf6;
}

.detail-tab-icon--rose {
  color: #f43f5e;
}

.detail-tab-icon--cyan {
  color: #06b6d4;
}

.detail-tab-icon--lime {
  color: #84cc16;
}

.detail-tab-icon--slate {
  color: #94a3b8;
}

.detail-tabs .tab-button.active .detail-tab-icon,
.detail-panel .detail-tabs .tab-button.active .detail-tab-icon,
:root[data-theme-mode="light"] .detail-tabs .tab-button.active .detail-tab-icon,
:root[data-theme-mode="light"] .detail-panel .detail-tabs .tab-button.active .detail-tab-icon {
  color: #ffffff !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.detail-tabs .tab-button.active .detail-tab-icon svg,
.detail-panel .detail-tabs .tab-button.active .detail-tab-icon svg,
:root[data-theme-mode="light"] .detail-tabs .tab-button.active .detail-tab-icon svg,
:root[data-theme-mode="light"] .detail-panel .detail-tabs .tab-button.active .detail-tab-icon svg {
  color: currentColor !important;
}

.detail-tab-panel[data-tab-panel="referred"] {
  text-align: left;
}

.referred-by-select {
  width: 100%;
  max-width: 100%;
  padding: 7px 10px;
  height: 38px;
  line-height: 1.35;
  font-size: 15px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid var(--stroke);
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
  transition: 0.2s ease;
}

.chip:hover {
  border-color: var(--primary-glow);
  color: var(--primary-color);
}

.chip.mini {
  padding: 6px 10px;
  font-size: 12px;
}

.chip.danger {
  background: rgba(220, 38, 38, 0.16);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.chip-icon {
  font-weight: 700;
}

.action-chip {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-depth));
  border-color: var(--primary-glow);
  color: #fff;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.36), 0 0 0 1px var(--primary-glow);
}

.table-wrap {
  overflow-x: auto;
}

.pipeline-board-header {
  align-items: flex-end;
  margin-bottom: 14px;
}

.pipeline-board-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(148px, 1fr));
  gap: 10px;
  min-width: 980px;
  padding: 4px 2px 10px;
  margin-bottom: 10px;
}

.pipeline-lane {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 210px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.72));
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.28), 0 0 0 1px rgba(59, 130, 246, 0.04);
  position: relative;
  overflow: hidden;
}

@media (max-width: 720px) {
  .pipeline-board {
    min-width: 100%;
    grid-template-columns: 1fr;
  }
}

.pipeline-lane::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), rgba(255, 255, 255, 0.16));
  opacity: 0.9;
}

.pipeline-lane-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.pipeline-lane-title {
  display: grid;
  gap: 2px;
}

.pipeline-lane-header strong {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pipeline-lane-title small {
  font-size: 10px;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.02em;
}

.pipeline-lane-header span {
  min-width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 11px;
  color: var(--ink);
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.pipeline-lane-body {
  display: grid;
  gap: 7px;
  align-content: start;
}

.pipeline-ticket {
  display: block;
  padding: 7px 8px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.2);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.pipeline-ticket-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.pipeline-ticket:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(59, 130, 246, 0.08);
}

.pipeline-ticket-title {
  font-weight: 600;
  line-height: 1.15;
  font-size: 10px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-ticket-meta,
.pipeline-ticket-footer {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
  flex: 0 0 auto;
}

.pipeline-ticket-chip {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 9px;
  background: rgba(59, 130, 246, 0.14);
  color: #cfe3ff;
  white-space: nowrap;
  flex: 0 0 auto;
}

.pipeline-ticket-empty {
  padding: 12px 8px;
  border-radius: 12px;
  font-size: 11px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(148, 163, 184, 0.18);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 15px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 13px;
}

.data-table th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: var(--muted);
}

.data-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(31, 95, 255, 0.08), rgba(31, 95, 255, 0.02));
}

/* ===== LISTA DE PROSPECTOS ===== */
.lead-table {
  border-collapse: separate;
  border-spacing: 0 10px;
}

.lead-table .lead-item {
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  transition: all 0.25s ease;
}

.lead-table .lead-item td {
  border-bottom: none;
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
  background: transparent;
  padding-top: 14px;
  padding-bottom: 14px;
}

.lead-table .lead-item td:first-child {
  border-left: 1px solid var(--stroke);
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
  padding-left: 16px;
}

.lead-table .lead-item td:last-child {
  border-right: 1px solid var(--stroke);
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
  padding-right: 16px;
  overflow: visible;
}

/* HOVER */
.lead-table .lead-item:hover {
  background: var(--surface-elevated);
  transform: translateX(2px);
}

/* ===== ACTIVO ===== */
.lead-table .lead-item.active,
.lead-table .lead-item:focus-within {
  background: linear-gradient(180deg, var(--surface-elevated), var(--surface));
}

.lead-table .lead-item.active td,
.lead-table .lead-item:focus-within td {
  border-top-color: rgba(34, 197, 94, 0.15);
  border-bottom-color: rgba(34, 197, 94, 0.15);
}

.lead-table .lead-item.active td:first-child,
.lead-table .lead-item:focus-within td:first-child {
  border-left-color: rgba(34, 197, 94, 0.15);
  position: relative;
}

.lead-table .lead-item.active td:last-child,
.lead-table .lead-item:focus-within td:last-child {
  border-right-color: rgba(34, 197, 94, 0.15);
}

/* 🔥 LÍNEA VERDE IZQUIERDA */
.lead-table .lead-item.active td:first-child::before,
.lead-table .lead-item:focus-within td:first-child::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, #22c55e, #4ade80);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
  animation: pulseLine 2s infinite;
}

@keyframes pulseLine {
  0% {
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
  }
  50% {
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.8);
  }
  100% {
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
  }
}

/* ===== TEXTO ===== */
.lead-table .lead-name {
  font-weight: 700;
  color: var(--ink);
}

.lead-table .lead-meta {
  font-size: 12px;
  color: var(--muted);
}

.lead-contact-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: visible;
}

.lead-contact-menu {
  position: relative;
  display: inline-flex;
  overflow: visible;
}

.lead-contact-menu-trigger {
  width: 36px;
  height: 36px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3.5px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: 0.18s ease;
  list-style: none;
}

.lead-contact-menu-trigger::-webkit-details-marker {
  display: none;
}

.lead-contact-menu-trigger span {
  width: 3.5px;
  height: 3.5px;
  display: block;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
}

.lead-contact-menu-trigger:hover,
.lead-contact-menu[open] .lead-contact-menu-trigger {
  color: var(--primary-color);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.lead-contact-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 2000;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}

.lead-contact-menu:not([open]) .lead-contact-menu-panel {
  display: none;
}

.lead-contact-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.lead-contact-menu-item:hover {
  background: var(--primary-light);
  color: var(--primary-color);
}

.lead-contact-menu-item.danger {
  color: #dc2626;
}

.lead-contact-menu-item.danger:hover {
  background: rgba(220, 38, 38, 0.1);
}

.notification-list {
  display: grid;
  gap: 10px;
  min-width: 220px;
}

.notification-list .notification-item {
  margin-bottom: 2px;
}

.notification-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.notification-meta {
  font-size: 11px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-badge.alert-badge {
  border-radius: 999px;
  padding: 3px 6px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 70px;
  justify-content: center;
}

.status-badge.alert-badge.critical {
  background: rgba(255, 95, 95, 0.18) !important;
  color: #ff8a8a !important;
}

.status-badge.alert-badge.attention {
  background: rgba(255, 214, 0, 0.18) !important;
  color: #f6d54a !important;
}

.status-badge.alert-badge.ok {
  background: rgba(37, 201, 114, 0.18) !important;
  color: #6df0a5 !important;
}

.status-badge.alert-badge.client {
  background: rgba(37, 201, 114, 0.4) !important;
  color: #6df0a5 !important;
  border-color: rgba(37, 201, 114, 0.65) !important;
}

.status-badge.alert-badge.prospect {
  background: rgba(255, 214, 0, 0.22) !important;
  color: #f6d54a !important;
  border-color: rgba(255, 214, 0, 0.45) !important;
}

.notification-list .status-badge.alert-badge.critical {
  background: rgba(255, 95, 95, 0.28) !important;
  color: #ff8a8a !important;
  border-color: rgba(255, 95, 95, 0.45) !important;
}

.notification-list .status-badge.alert-badge.attention {
  background: rgba(255, 214, 0, 0.28) !important;
  color: #f6d54a !important;
  border-color: rgba(255, 214, 0, 0.45) !important;
}

.notification-list .status-badge.alert-badge.ok {
  background: rgba(37, 201, 114, 0.28) !important;
  color: #6df0a5 !important;
  border-color: rgba(37, 201, 114, 0.45) !important;
}

:root[data-theme-mode="light"] .status-badge.alert-badge {
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: none;
}

:root[data-theme-mode="light"] .status-badge.alert-badge.critical,
:root[data-theme-mode="light"] .notification-list .status-badge.alert-badge.critical {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #b42318 !important;
  border-color: rgba(239, 68, 68, 0.22) !important;
}

:root[data-theme-mode="light"] .status-badge.alert-badge.attention,
:root[data-theme-mode="light"] .notification-list .status-badge.alert-badge.attention {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #92400e !important;
  border-color: rgba(245, 158, 11, 0.22) !important;
}

:root[data-theme-mode="light"] .status-badge.alert-badge.ok,
:root[data-theme-mode="light"] .notification-list .status-badge.alert-badge.ok {
  background: rgba(34, 197, 94, 0.12) !important;
  color: #166534 !important;
  border-color: rgba(34, 197, 94, 0.22) !important;
}

:root[data-theme-mode="light"] .status-badge.alert-badge.client {
  background: rgba(34, 197, 94, 0.14) !important;
  color: #166534 !important;
  border-color: rgba(34, 197, 94, 0.24) !important;
}

:root[data-theme-mode="light"] .status-badge.alert-badge.prospect {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #92400e !important;
  border-color: rgba(245, 158, 11, 0.22) !important;
}

.alert-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}

.alert-strip.is-hidden {
  display: none;
}

.insurance-status {
  margin-top: 10px;
}

.insurance-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.insurance-check {
  font-weight: 800;
}

.panel-section {
  margin-bottom: 18px;
  display: grid;
  gap: 10px;
}

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.section-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.section-info-popover {
  position: relative;
}

.section-info-trigger {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: transparent;
  color: var(--primary-color);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.section-info-trigger::-webkit-details-marker {
  display: none;
}

.section-info-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: min(280px, 70vw);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--surface-elevated);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.18);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
}

.field-help {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.preference-toggle-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.preference-toggle-list--channels {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}

.preference-toggle-list--channels > * {
  min-width: 0;
}

.panel-section--preferences {
  gap: 8px;
}

.preference-heading-copy {
  display: grid;
  gap: 6px;
}

.preference-reminder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 18px;
  padding: 0;
}

.preference-reminder-row span:last-child {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.preference-reminder-row--language {
  margin-top: 2px;
}

.preference-toggle-row {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--soft);
}

.preference-toggle-row--channel {
  justify-content: center;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.preference-toggle-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.preference-toggle-row span,
.preference-language-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.preference-toggle-copy span:last-child,
.preference-language-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preference-language-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--soft);
}

.preference-language-stack {
  display: grid;
  gap: 6px;
}

.preference-language-row--inline {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  justify-content: flex-start;
}

.preference-language-label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--soft);
  cursor: pointer;
  flex-shrink: 0;
}

.language-switch-option {
  min-width: 36px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease;
}

.language-switch-option.is-active {
  background: rgba(59, 130, 246, 0.14);
  color: var(--primary-color);
}

@media (max-width: 760px) {
  .preference-toggle-list {
    grid-template-columns: 1fr;
  }

  .notification-subtabs-bar {
    grid-template-columns: 1fr;
  }
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-kicker {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.notification-tabset {
  gap: 10px;
}

.notification-subtabs-bar {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.notification-subtab {
  min-height: 24px;
  padding: 0 2px 4px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--primary-color);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.62;
  transition: color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.notification-subtab:hover {
  color: var(--primary-color);
  opacity: 0.88;
  transform: translateY(-1px);
}

.notification-subtab.is-active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  opacity: 1;
}

.notification-subpanel {
  display: grid;
  gap: 10px;
}

.notification-subpanel[hidden] {
  display: none !important;
}

.notification-preference-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.preference-summary-chip {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--soft);
}

.preference-summary-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.automation-rows {
  display: grid;
  gap: 10px;
}

.automation-grid {
  display: grid;
  gap: 12px;
}

.automation-banner {
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 95, 95, 0.18);
  background: rgba(255, 95, 95, 0.08);
  color: var(--ink);
  font-size: 12px;
}

.automation-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--soft);
}

.automation-card-top,
.automation-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.automation-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.automation-card-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.automation-card-icon {
  width: 24px;
  height: 24px;
}

.automation-card-icon svg {
  width: 17px;
  height: 17px;
}

.automation-card-statuses {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.automation-card-inline-action {
  min-height: 30px;
  min-width: 112px;
  padding: 0 14px;
  font-size: 11px;
  white-space: nowrap;
  max-width: none;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.3);
  color: #166534;
}

.automation-card-inline-action:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.42);
}

.automation-card-live-status {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.automation-card-live-status.is-active {
  color: #22c55e;
}

.automation-card-live-status.is-paused {
  color: #ff8a8a;
}

.automation-card-meta {
  font-size: 12px;
  color: var(--muted);
}

.automation-card-meta-stack {
  display: grid;
  gap: 6px;
}

.automation-card-meta--appointment {
  gap: 2px;
}

.automation-card-meta-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-color);
}

.automation-card-meta-value {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.automation-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.automation-card-meta-row .btn-secondary {
  margin-left: auto;
}

.automation-card-footer:empty {
  display: none;
}

.automation-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: 10px;
  align-items: center;
  background: rgba(31, 95, 255, 0.03);
  border: 1px solid rgba(10, 37, 64, 0.1);
  border-radius: 12px;
  padding: 10px 12px;
}

.automation-label {
  font-size: 13px;
  font-weight: 600;
}

.automation-meta {
  font-size: 12px;
  color: var(--muted);
}

.btn-secondary {
  background: rgba(31, 95, 255, 0.045);
  border: 1px solid rgba(10, 37, 64, 0.14);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(31, 95, 255, 0.09);
  border-color: var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.automation-card-meta-row .automation-card-inline-action {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.3);
  color: #166534;
}

.automation-card-meta-row .automation-card-inline-action:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.42);
}

.automation-card-meta-row .automation-card-inline-action:disabled {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.3);
  color: #166534;
}

.reminder-summary {
  display: grid;
  gap: 10px;
}

.reminder-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reminder-stat-card {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--soft);
  min-width: 0;
}

.reminder-stat-card:last-child {
  grid-column: 1 / -1;
}

.reminder-stat-card strong {
  font-size: 18px;
  color: var(--ink);
}

.reminder-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.reminder-next-list {
  display: grid;
  gap: 8px;
}

.reminder-next-card,
.reminder-next-row,
.reminder-empty-state {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--soft);
  min-width: 0;
}

.reminder-next-card strong,
.reminder-empty-state strong {
  color: var(--ink);
  font-size: 13px;
}

.reminder-next-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.reminder-next-label,
.reminder-next-type {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.reminder-next-date,
.reminder-next-card span:last-child,
.reminder-empty-state span {
  font-size: 12px;
  color: var(--muted);
}

.reminder-next-type {
  min-width: 0;
}

.reminder-next-date {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.mini-table th,
.mini-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mini-table th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: var(--muted);
}

.reminder-rules {
  font-size: 12px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.reminder-rule-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.rule-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--soft);
  padding: 6px 10px;
  font-size: 11px;
  color: var(--muted);
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
}

@media (max-width: 520px) {
  .reminder-overview {
    grid-template-columns: 1fr;
  }

  .reminder-stat-card:last-child {
    grid-column: auto;
  }

  .reminder-next-row {
    grid-template-columns: 1fr;
  }

  .reminder-next-date {
    justify-self: start;
    text-align: left;
    white-space: normal;
  }
}

/* ===== Dashboard Refresh ===== */
.dashboard-page-grid {
  gap: 20px;
}

.dashboard-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.dashboard-topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-left: auto;
}

.dashboard-welcome-title {
  margin-bottom: 6px;
}

.dashboard-search-field {
  min-width: min(360px, 100%);
}

.dashboard-search-field--scope {
  width: 100%;
  min-width: 0;
  margin: -2px 0 0;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: none;
}

.dashboard-global-header {
  align-items: flex-start;
}

.dashboard-global-header-actions {
  margin-left: auto;
  min-width: min(360px, 100%);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-search-field--global {
  width: 100%;
}

.dashboard-global-admin-trigger[aria-expanded="true"] {
  background: var(--primary-color);
  color: #fff;
  border-color: transparent;
}

.dashboard-global-admin-panel {
  display: grid;
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--stroke);
}

.dashboard-global-admin-copy {
  display: grid;
  gap: 6px;
}

.dashboard-global-admin-copy h4 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.dashboard-global-admin-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.dashboard-global-admin-form {
  margin: 0;
}

.dashboard-global-admin-table {
  margin-top: 0;
}

.dashboard-actions-heading {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  min-width: 170px;
}

.dashboard-create-client-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.dashboard-create-client-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.dashboard-global-admin-user {
  margin-bottom: 4px;
}

.dashboard-client-edit-modal[hidden] {
  display: none;
}

.dashboard-client-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.dashboard-client-edit-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.dashboard-client-edit-dialog {
  position: relative;
  width: min(620px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--stroke);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.dashboard-client-edit-dialog--create {
  width: min(760px, 100%);
}

.dashboard-client-edit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dashboard-client-edit-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--primary-color);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-client-edit-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
}

.dashboard-client-edit-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.dashboard-client-edit-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.dashboard-client-edit-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-client-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

body.dashboard-client-edit-open {
  overflow: hidden;
}

.dashboard-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: 20px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.dashboard-workspace--global {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
}

.dashboard-main-column,
.dashboard-side-column {
  display: grid;
  gap: 20px;
  min-width: 0;
  max-width: 100%;
  align-self: start;
  overflow: hidden;
}

.dashboard-main-column > .panel,
.dashboard-side-column > .panel {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.dashboard-main-column--global {
  align-content: start;
}

.dashboard-side-column--global {
  display: flex;
  flex-direction: column;
  align-content: start;
  align-items: stretch;
  gap: 20px;
  min-width: 0;
  width: 100%;
}

.dashboard-side-column--global .panel + .panel {
  margin-top: 0;
}

.dashboard-side-column--global > .dashboard-global-panel {
  width: 100%;
  margin: 0;
}

.dashboard-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-stat-card {
  gap: 10px;
}

.dashboard-stat-card--whatsapp_unanswered {
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(236, 253, 245, 0.96), var(--surface-elevated));
}

.dashboard-stat-card--whatsapp_unanswered .analytics-metric-icon {
  color: #16a34a;
}

.dashboard-stat-card--whatsapp_unanswered .analytics-metric-icon svg {
  width: 22px;
  height: 22px;
}

.dashboard-main-column--global .dashboard-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-global-table-wrap {
  margin-top: 18px;
  max-width: 100%;
  overflow-x: auto;
}

.dashboard-global-panel {
  gap: 16px;
  min-width: 0;
  overflow: visible;
}

.dashboard-global-summary-list,
.dashboard-global-plan-list {
  display: grid;
  gap: 12px;
}

.dashboard-global-summary-item,
.dashboard-global-plan-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 88%, transparent), color-mix(in srgb, var(--soft) 92%, transparent)),
    var(--soft);
}

.dashboard-global-summary-copy,
.dashboard-global-plan-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard-global-summary-copy span,
.dashboard-global-plan-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.dashboard-global-summary-copy strong,
.dashboard-global-plan-copy strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}

.dashboard-global-plan-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  max-width: 100%;
  flex-shrink: 0;
  padding: 10px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-light) 72%, var(--surface));
  color: var(--primary-color);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.dashboard-global-summary-copy strong {
  padding: 0;
  min-width: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-size: 28px;
  font-weight: 800;
}

.dashboard-global-plan-share strong {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.dashboard-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-trend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.dashboard-trend svg {
  width: 14px;
  height: 14px;
}

.dashboard-trend--up {
  color: var(--primary-color);
}

.dashboard-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.95fr);
  gap: 20px;
}

.dashboard-chart-wrap {
  height: 320px;
}

.dashboard-donut-shell {
  display: grid;
  gap: 18px;
}

.dashboard-donut-wrap {
  position: relative;
  height: 260px;
}

.dashboard-donut-legend {
  display: grid;
  gap: 10px;
}

.dashboard-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
}

.dashboard-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: auto;
}

.dashboard-legend-dot--0 {
  background: var(--primary-color);
}

.dashboard-legend-dot--1 {
  background: var(--primary-glow);
}

.dashboard-table-date {
  display: grid;
  gap: 2px;
}

.dashboard-table-date strong {
  color: var(--ink);
  font-size: 13px;
}

.dashboard-table-date span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-table-action {
  white-space: nowrap;
}

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

.dashboard-profile-panel {
  gap: 16px;
  overflow: hidden;
}

.dashboard-doctor-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.dashboard-doctor-avatar {
  width: clamp(220px, 100%, 260px);
  height: clamp(240px, 28vw, 320px);
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: var(--primary-light);
  color: var(--primary-color);
  border: 1px solid var(--primary-glow);
  font-weight: 800;
  letter-spacing: 0.03em;
  overflow: hidden;
  flex-shrink: 0;
}

.dashboard-doctor-avatar.has-photo {
  background: transparent;
  color: transparent;
}

.dashboard-doctor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dashboard-doctor-copy {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.dashboard-doctor-copy h4 {
  margin: 0;
  font-size: 16px;
  color: var(--ink);
}

.dashboard-doctor-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-doctor-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-doctor-metric,
.dashboard-doctor-detail {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--soft);
}

.dashboard-doctor-metric span,
.dashboard-doctor-detail span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.dashboard-doctor-metric strong,
.dashboard-doctor-detail strong {
  font-size: 13px;
  color: var(--ink);
}

.dashboard-doctor-details {
  display: grid;
  gap: 10px;
}

.dashboard-patient-list {
  display: grid;
  gap: 10px;
}

.dashboard-patient-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--soft);
}

.dashboard-patient-avatar {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.78), rgba(124, 58, 237, 0.72));
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.dashboard-patient-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.dashboard-patient-copy strong {
  color: var(--ink);
  font-size: 13px;
}

.dashboard-patient-copy span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-patient-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dashboard-patient-actions a {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--primary-color);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.dashboard-patient-actions a:hover {
  border-color: rgba(37, 99, 235, 0.34);
  color: #1d4ed8;
  transform: translateY(-1px);
}

.dashboard-patient-actions svg {
  width: 15px;
  height: 15px;
}

.dashboard-empty-state {
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed var(--stroke-strong);
  color: var(--muted);
  font-size: 13px;
  background: var(--soft);
}

.dashboard-commercial-grid {
  align-items: stretch;
}

.dashboard-commercial-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-commercial-summary-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: var(--soft);
}

.dashboard-commercial-summary-card span,
.dashboard-commercial-summary-card small,
.dashboard-commercial-list-kicker {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-commercial-summary-card strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1.1;
}

.dashboard-commercial-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.dashboard-commercial-list,
.dashboard-commercial-discipline {
  display: grid;
  gap: 12px;
}

.dashboard-commercial-list-row,
.dashboard-commercial-discipline-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--soft);
}

.dashboard-commercial-list-row {
  grid-template-columns: minmax(0, 1fr) minmax(90px, 0.8fr) auto;
  align-items: center;
}

.dashboard-commercial-list-row--exec {
  grid-template-columns: minmax(0, 1fr) auto;
}

.dashboard-commercial-list-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.dashboard-commercial-list-copy strong {
  color: var(--ink);
  font-size: 13px;
}

.dashboard-commercial-list-copy span,
.dashboard-commercial-list-row small,
.dashboard-commercial-list-stats span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-commercial-list-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.dashboard-commercial-list-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-glow));
}

.dashboard-commercial-list-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-commercial-discipline-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.dashboard-commercial-summary-grid--widgets .dashboard-commercial-summary-card--widget {
  position: relative;
  padding-bottom: 48px;
}

.dashboard-commercial-summary-card--widget .status-badge {
  position: absolute;
  right: 16px;
  bottom: 16px;
}

.dashboard-commercial-brief-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: var(--soft);
}

.dashboard-commercial-brief-headline {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.4;
}

.dashboard-commercial-brief-summary {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.dashboard-commercial-brief-list {
  display: grid;
  gap: 10px;
}

.dashboard-commercial-brief-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}

.dashboard-commercial-brief-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-commercial-connection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-commercial-connection-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: var(--soft);
}

.dashboard-commercial-connection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-commercial-connection-card strong {
  color: var(--ink);
}

.dashboard-commercial-connection-card p,
.dashboard-commercial-connection-card small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.dashboard-today-pill,
.dashboard-greeting-action,
.dashboard-mini-button,
.dashboard-agenda-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.dashboard-today-pill svg,
.dashboard-greeting-action svg,
.dashboard-mini-button svg {
  width: 16px;
  height: 16px;
  color: var(--primary-color);
}

.dashboard-greeting-panel {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(255, 255, 255, 0.72)),
    var(--surface);
}

.dashboard-greeting-kicker {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.dashboard-greeting-panel p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.dashboard-greeting-action,
.dashboard-mini-button--primary,
.dashboard-agenda-submit {
  border-color: rgba(37, 99, 235, 0.22);
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.dashboard-greeting-action svg,
.dashboard-mini-button--primary svg {
  color: currentColor;
}

.dashboard-panel-header-with-action {
  align-items: flex-start;
  gap: 16px;
}

.dashboard-panel-header-with-action > .dashboard-mini-button,
.dashboard-panel-header-with-action > button.dashboard-mini-button,
.dashboard-panel-header-with-action > a.dashboard-mini-button {
  margin-left: auto;
  flex: 0 0 auto;
}

.dashboard-stat-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dashboard-stat-card--followup {
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(239, 246, 255, 0.96), var(--surface-elevated));
}

.dashboard-stat-card--overview {
  background:
    radial-gradient(circle at top right, rgba(124, 58, 237, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(245, 243, 255, 0.96), var(--surface-elevated));
}

.dashboard-stat-card {
  align-content: start;
  min-height: 116px;
  padding: 18px;
}

.dashboard-stat-head {
  justify-content: flex-start;
  gap: 10px;
}

.dashboard-stat-head .analytics-metric-label {
  color: var(--ink);
  font-size: 11px;
  line-height: 1.25;
}

.dashboard-stat-card .analytics-metric-value {
  margin-top: 2px;
  font-size: 30px;
  line-height: 1;
}

.dashboard-stat-card .dashboard-trend {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
}

.dashboard-task-panel,
.dashboard-pipeline-panel,
.dashboard-activity-panel {
  overflow: visible;
}

.dashboard-priority-brief-grid,
.dashboard-pipeline-agenda-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.98fr);
  gap: 18px;
  align-items: stretch;
}

.dashboard-priority-brief-grid > .panel,
.dashboard-pipeline-agenda-grid > .panel {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.dashboard-count-pill {
  margin-left: auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  font-size: 12px;
  font-weight: 900;
}

.dashboard-task-list,
.dashboard-brief-insights,
.dashboard-agenda-mini-list {
  display: grid;
  gap: 10px;
}

.dashboard-task-row,
.dashboard-brief-insight,
.dashboard-agenda-mini-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--soft);
}

.dashboard-task-row strong,
.dashboard-brief-insight strong,
.dashboard-agenda-mini-item strong {
  color: var(--ink);
  font-size: 14px;
}

.dashboard-task-row span,
.dashboard-brief-insight span,
.dashboard-agenda-phone {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.dashboard-task-row time {
  color: #dc2626;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.dashboard-task-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dashboard-task-row strong,
.dashboard-task-row span:not(.dashboard-task-icon):not(.dashboard-task-badge) {
  display: block;
}

.dashboard-task-icon,
.dashboard-brief-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--primary-color);
  background: rgba(37, 99, 235, 0.1);
}

.dashboard-task-icon svg,
.dashboard-brief-icon svg {
  width: 19px;
  height: 19px;
}

.dashboard-task-icon--call {
  color: #e11d48;
  background: rgba(244, 63, 94, 0.12);
}

.dashboard-task-icon--whatsapp {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.12);
}

.dashboard-task-icon--new {
  color: #f97316;
  background: rgba(249, 115, 22, 0.12);
}

.dashboard-task-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  min-width: 26px;
  justify-content: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  font-size: 11px;
  font-weight: 900;
}

.dashboard-task-badge--warm {
  background: rgba(249, 115, 22, 0.12);
  color: #ea580c;
}

.dashboard-task-footer,
.dashboard-ai-task-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.05);
  color: var(--primary-color);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.dashboard-task-footer svg,
.dashboard-ai-task-button svg {
  width: 16px;
  height: 16px;
}

.dashboard-ai-brief-panel {
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(37, 99, 235, 0.04)),
    var(--surface);
}

.dashboard-brief-insights {
  padding: 12px;
  border: 1px solid rgba(124, 58, 237, 0.1);
  border-radius: 16px;
  background: rgba(124, 58, 237, 0.04);
}

.dashboard-brief-insight {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  border-color: transparent;
  background: transparent;
  padding: 6px 0;
}

.dashboard-brief-insight > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dashboard-brief-insight strong,
.dashboard-brief-insight span:not(.dashboard-brief-icon) {
  display: block;
}

.dashboard-brief-icon--spark {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
}

.dashboard-brief-icon--phone {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
}

.dashboard-brief-icon--people {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

.dashboard-ai-task-button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-color), #4f46e5);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.dashboard-pipeline-lanes {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-pipeline-lane {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 112px;
  padding: 15px 10px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--soft);
  text-align: center;
}

.dashboard-pipeline-lane b {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.dashboard-pipeline-lane strong {
  color: var(--ink);
  font-size: 11px;
  line-height: 1.2;
}

.dashboard-pipeline-lane > span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-pipeline-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  height: 18px;
  margin-bottom: -7px;
  overflow: visible;
  background: transparent;
}

.dashboard-pipeline-track span {
  position: relative;
  display: block;
  align-self: center;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
}

.dashboard-pipeline-track span::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -4px;
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  border-radius: 999px;
  transform: translateY(-50%);
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.14);
}

.dashboard-pipeline-track span:nth-child(1) { background: #2563eb; }
.dashboard-pipeline-track span:nth-child(2) { background: #7c3aed; }
.dashboard-pipeline-track span:nth-child(3) { background: #f97316; }
.dashboard-pipeline-track span:nth-child(4) { background: #16a34a; }
.dashboard-pipeline-track span:nth-child(5) { background: #0ea5e9; }
.dashboard-pipeline-track span:nth-child(6) { background: #94a3b8; }
.dashboard-pipeline-track span:nth-child(1)::after { background: #2563eb; }
.dashboard-pipeline-track span:nth-child(2)::after { background: #7c3aed; }
.dashboard-pipeline-track span:nth-child(3)::after { background: #f97316; }
.dashboard-pipeline-track span:nth-child(4)::after { background: #16a34a; }
.dashboard-pipeline-track span:nth-child(5)::after { background: #0ea5e9; }
.dashboard-pipeline-track span:nth-child(6)::after { background: #94a3b8; }

.dashboard-pipeline-total {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.04);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.dashboard-agenda-card-body {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
}

.dashboard-agenda-date-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  min-height: 96px;
  border-radius: 14px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: rgba(37, 99, 235, 0.08);
}

.dashboard-agenda-date-card span,
.dashboard-agenda-date-card small {
  color: var(--primary-color);
  font-size: 11px;
  font-weight: 900;
}

.dashboard-agenda-date-card strong {
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.dashboard-agenda-mini-item {
  grid-template-columns: 1fr;
  gap: 8px;
}

.dashboard-agenda-mini-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.dashboard-agenda-mini-head time {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.dashboard-agenda-phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dashboard-agenda-phone svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.dashboard-pipeline-icon,
.dashboard-inline-title-icon,
.dashboard-activity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
  flex: 0 0 auto;
}

.dashboard-pipeline-icon svg,
.dashboard-inline-title-icon svg,
.dashboard-activity-icon svg {
  width: 16px;
  height: 16px;
}

.dashboard-inline-title-icon {
  width: 26px;
  height: 26px;
  margin-right: 7px;
  vertical-align: middle;
}

.dashboard-pipeline-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.dashboard-pipeline-meter span {
  display: block;
  height: 100%;
  min-width: 12px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-glow));
}

.dashboard-activity-list {
  display: grid;
  gap: 10px;
}

.dashboard-activity-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--soft);
}

.dashboard-activity-item div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dashboard-activity-item strong {
  color: var(--ink);
  font-size: 13px;
}

.dashboard-activity-item span:not(.dashboard-activity-icon) {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-activity-item time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.dashboard-appointment-mix-panel .dashboard-donut-shell {
  grid-template-columns: minmax(130px, 0.9fr) minmax(110px, 0.8fr);
  align-items: center;
}

.dashboard-appointment-mix-panel .dashboard-donut-wrap {
  height: 190px;
}

.dashboard-appointment-mix-panel .dashboard-legend-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: start;
  gap: 8px 10px;
  border: 0;
  background: transparent;
  padding: 8px 0;
}

.dashboard-appointment-mix-panel .dashboard-legend-item strong {
  grid-column: 2;
  color: var(--ink);
  font-size: 16px;
}

.dashboard-agenda-modal[hidden] {
  display: none;
}

.dashboard-agenda-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: grid;
  place-items: center;
  padding: 24px;
}

.dashboard-agenda-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.dashboard-agenda-dialog {
  position: relative;
  width: min(900px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--stroke);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.dashboard-agenda-header,
.dashboard-month-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-agenda-header {
  margin-bottom: 18px;
}

.dashboard-agenda-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
}

.dashboard-agenda-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.dashboard-agenda-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 18px;
}

.dashboard-month-card,
.dashboard-agenda-form {
  padding: 16px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: var(--soft);
}

.dashboard-month-head {
  align-items: center;
  margin-bottom: 14px;
}

.dashboard-month-head strong {
  color: var(--ink);
  font-size: 15px;
  text-transform: capitalize;
}

.dashboard-icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.dashboard-icon-button svg {
  width: 18px;
  height: 18px;
}

.dashboard-calendar-weekdays,
.dashboard-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.dashboard-calendar-weekdays {
  margin-bottom: 7px;
}

.dashboard-calendar-weekdays span {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.dashboard-calendar-day {
  aspect-ratio: 1;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.dashboard-calendar-day.is-empty {
  border-color: transparent;
  background: transparent;
}

.dashboard-calendar-day.is-today {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.dashboard-calendar-day.is-selected {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.dashboard-agenda-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-agenda-status[data-tone="ok"] {
  color: #16a34a;
}

.dashboard-agenda-status[data-tone="error"] {
  color: #dc2626;
}

@media (max-width: 1280px) {
  .dashboard-workspace,
  .dashboard-workspace--global {
    grid-template-columns: 1fr;
  }

  .dashboard-main-column--global {
    order: 2;
  }

  .dashboard-side-column--global {
    order: 1;
  }

  .dashboard-side-column {
    grid-template-columns: 1fr;
  }

  .dashboard-side-column--global {
    display: flex;
    flex-direction: column;
  }

  .dashboard-main-column--global .dashboard-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-commercial-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-stat-grid,
  .dashboard-priority-brief-grid,
  .dashboard-pipeline-agenda-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-commercial-connection-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .dashboard-chart-grid,
  .dashboard-stat-grid,
  .dashboard-doctor-metrics,
  .dashboard-side-column,
  .dashboard-commercial-summary-grid,
  .dashboard-commercial-split,
  .dashboard-commercial-connection-grid,
  .dashboard-priority-brief-grid,
  .dashboard-pipeline-agenda-grid,
  .dashboard-pipeline-lanes,
  .dashboard-agenda-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-appointment-mix-panel .dashboard-donut-shell,
  .dashboard-agenda-card-body {
    grid-template-columns: 1fr;
  }

  .dashboard-greeting-panel,
  .dashboard-panel-header-with-action {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-panel-header-with-action > .dashboard-mini-button,
  .dashboard-panel-header-with-action > button.dashboard-mini-button,
  .dashboard-panel-header-with-action > a.dashboard-mini-button {
    margin-left: 0;
    align-self: flex-start;
  }

  .dashboard-main-column--global .dashboard-stat-grid,
  .dashboard-side-column--global {
    grid-template-columns: 1fr;
  }

  .dashboard-global-header,
  .dashboard-global-header-actions {
    width: 100%;
  }

  .dashboard-global-header-actions {
    justify-content: stretch;
  }

  .dashboard-search-field {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .dashboard-doctor-avatar {
    width: min(100%, 240px);
    height: clamp(220px, 58vw, 300px);
  }

  .dashboard-global-summary-item,
  .dashboard-global-plan-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .dashboard-global-plan-share {
    justify-self: start;
  }

  .dashboard-commercial-brief-actions {
    flex-direction: column;
  }
}

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.contact-icon svg {
  width: 16px;
  height: 16px;
  color: var(--primary-color);
}

.contact-icon.disabled {
  opacity: 0.35;
  pointer-events: none;
}

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

.analytics-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.metric-card,
.analytics-metric-card {
  background: linear-gradient(135deg, var(--primary-light), var(--surface-elevated));
  border-radius: var(--radius-card);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 6px;
  box-shadow: 0 0 26px var(--neon-glow);
  transition: 0.3s;
}

.metric-card::before,
.analytics-metric-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.metric-card:hover,
.analytics-metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 34px var(--neon-glow);
}

.analytics-metric-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  background: var(--primary-light);
  border: 1px solid var(--primary-glow);
  color: var(--primary-color);
}

.analytics-metric-icon svg {
  width: 16px;
  height: 16px;
}

.analytics-metric-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-metric-value {
  font-size: 26px;
  color: var(--ink);
  line-height: 1.15;
}

.analytics-metric-sub {
  font-size: 12px;
  color: var(--muted);
}

.analytics-chart-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.analytics-range-btn {
  border: 1px solid var(--stroke);
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #2c6dff 0%, #1f5fff 55%, #194edc 100%);
  border-radius: 12px;
  padding: 10px 18px;
  color: white;
  font-weight: 700;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-primary:hover {
  box-shadow: 0 14px 30px rgba(31, 95, 255, 0.36);
}

.analytics-range-btn.active,
.analytics-range-btn:hover {
  border-color: var(--primary-glow);
  background: linear-gradient(135deg, #2f70ff, #1f5fff);
  color: #fff;
}

.analytics-chart-wrap {
  position: relative;
  height: 320px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: linear-gradient(150deg, var(--surface), var(--surface-elevated));
  padding: 12px;
  box-shadow: inset 0 0 0 1px var(--stroke), 0 0 28px var(--neon-glow);
}

.pipeline-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pipeline-card {
  border-radius: var(--radius-card);
  padding: 14px;
  border: 1px solid var(--stroke);
  background: linear-gradient(145deg, rgba(148, 163, 184, 0.12), var(--surface));
  display: grid;
  gap: 6px;
  box-shadow: 0 0 20px var(--neon-glow);
}

.pipeline-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pipeline-value {
  font-size: 28px;
  line-height: 1;
  color: var(--primary-color);
}

.campaign-table {
  min-width: 680px;
}

.table-modern {
  background: var(--surface-elevated);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  padding: 4px;
  box-shadow: inset 0 0 0 1px var(--stroke), 0 0 22px var(--neon-glow);
}

.stat-card {
  background: linear-gradient(155deg, var(--surface-elevated) 0%, var(--surface) 62%, var(--stat-tail) 100%);
  border: 1px solid var(--stroke-strong);
  border-radius: 18px;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  box-shadow: inset 0 1px 0 var(--stroke), 0 16px 30px rgba(10, 37, 64, 0.08);
  transition: 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-glow);
}

.stat-card span {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-card strong {
  font-size: 22px;
  color: var(--primary-color);
}

.workspace-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.workspace-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(148, 163, 184, 0.12);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.workspace-chip:hover {
  border-color: var(--primary-glow);
  background: linear-gradient(135deg, var(--primary-light), rgba(148, 163, 184, 0.08));
  color: var(--primary-color);
}

.lead-avatar,
.team-avatar {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  color: var(--ink);
  font-weight: 600;
}

.lead-avatar img,
.team-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lead-avatar .fallback,
.team-avatar .fallback {
  position: absolute;
}

.lead-avatar.no-image img,
.team-avatar.no-image img {
  display: none;
}

.icon-btn {
  border: 1px solid var(--stroke-strong);
  background: rgba(148, 163, 184, 0.12);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--ink);
  transition: 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--primary-glow);
  color: var(--primary-color);
}

.icon-btn.mini {
  font-size: 12px;
  line-height: 1;
}

.muted {
  color: var(--muted);
}

.clients-panel-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.clients-search-field {
  height: 42px;
  width: 44px;
  min-width: 44px;
  max-width: min(360px, 42vw);
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0 12px;
  border: 1px solid var(--stroke);
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  overflow: hidden;
  cursor: text;
  transition:
    width 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    min-width 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.clients-search-field:focus-within,
.clients-search-field:has(input:not(:placeholder-shown)) {
  width: min(360px, 42vw);
  min-width: min(300px, 36vw);
  gap: 10px;
  background: transparent;
  border-color: rgba(37, 99, 235, 0.38);
  box-shadow: none;
}

.clients-search-field svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.clients-search-field input {
  width: 260px;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.24s ease, transform 0.35s ease;
}

.clients-search-field:focus-within input,
.clients-search-field:has(input:not(:placeholder-shown)) input {
  opacity: 1;
  transform: translateX(0);
}

.clients-search-field input::placeholder {
  color: #94a3b8;
}

.clients-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  white-space: nowrap;
}

.clients-add-button span {
  font-size: 18px;
  line-height: 1;
}

.popup-card .icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.popup-card .icon-button svg {
  width: 18px;
  height: 18px;
}

.popup-card .icon-button:hover {
  color: var(--ink);
  border-color: var(--primary-glow);
}

.client-form-modal {
  padding-top: 58px;
  background:
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.12), transparent 32%),
    rgba(15, 23, 42, 0.48);
}

.client-form-card {
  width: min(760px, calc(100vw - 36px)) !important;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
  background: #ffffff;
}

.client-form-header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #e5edf8;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
}

.client-form-header__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #2563eb;
  background: #eef5ff;
}

.client-form-header__icon svg {
  width: 23px;
  height: 23px;
}

.client-form-eyebrow,
.client-form-section__title {
  display: block;
  margin-bottom: 4px;
  color: #2563eb;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.client-form-header h3 {
  margin: 0;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.15;
}

.client-form-header p {
  max-width: 560px;
  margin: 7px 0 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.45;
}

.client-form-card .lead-popup-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-height: min(68vh, 680px);
  padding: 20px 24px 0;
  overflow-y: auto;
}

.client-form-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
  border-bottom: 0;
}

.client-form-section__title {
  grid-column: 1 / -1;
  margin-bottom: 0;
  color: #475569;
}

.client-form-field {
  display: block;
}

.client-form-field--wide {
  grid-column: 1 / -1;
}

.client-form-field span {
  display: none;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.client-form-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-size: 14px;
  padding: 0 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.client-form-field input:focus {
  border-color: rgba(37, 99, 235, 0.48);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.client-form-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  margin: 18px -24px 0;
  padding: 16px 24px 20px;
  background: rgba(255, 255, 255, 0.94);
  border-top: 0;
  backdrop-filter: blur(12px);
}

.client-form-footer .btn-primary {
  min-width: 190px;
  min-height: 46px;
}

.popup {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 18, 0.6);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 24px 48px;
  z-index: 9999;
  overflow-y: auto;
}

.popup.open {
  display: flex;
}

.popup-card {
  width: min(520px, 100%);
  background: linear-gradient(150deg, var(--surface), var(--surface-elevated));
  border-radius: var(--radius-shell);
  padding: 20px;
  box-shadow: var(--shadow), 0 0 34px var(--neon-glow);
  border: 1px solid var(--stroke-strong);
}

.lead-form {
  display: grid;
  gap: 12px;
}

.lead-form .field {
  display: grid;
  gap: 6px;
}

.lead-form .field-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  position: relative;
  padding-left: 22px;
}

.lead-form .field-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.04);
}

.lead-form .field.field-complete .field-label::before {
  border-color: rgba(35, 211, 176, 0.7);
  background: rgba(35, 211, 176, 0.2);
}

.lead-form .field.field-complete .field-label::after {
  content: "✓";
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-58%);
  font-size: 12px;
  color: rgba(35, 211, 176, 0.95);
}

#lead-detail-form .detail-tab-panel .field-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 0;
}

#lead-detail-form .detail-tab-panel .field-label::before {
  content: none;
  display: none;
}

#lead-detail-form .detail-tab-panel .field.field-complete .field-label::before {
  content: none;
  display: none;
}

#lead-detail-form .detail-tab-panel .field.field-complete .field-label::after {
  content: "✓";
  position: static;
  left: auto;
  top: auto;
  transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  color: rgba(35, 211, 176, 0.98);
  font-size: 13px;
  font-weight: 800;
}

.lead-form.vertical input,
.lead-form.vertical select,
.lead-form.vertical button {
  width: 100%;
}

.lead-form input,
.lead-form select {
  border: 1px solid var(--stroke-strong);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: inherit;
  background: var(--surface-elevated);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.lead-form input:focus,
.lead-form select:focus,
.lead-input:focus,
.chat-input:focus,
.search-input:focus {
  outline: none;
  border-color: var(--primary-glow);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.lead-input {
  border: 1px solid var(--stroke-strong);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: inherit;
  background: var(--surface-elevated);
  color: var(--ink);
  width: 100%;
}

.money-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--surface-elevated);
  overflow: hidden;
}

.money-field .money-prefix {
  padding: 10px 12px;
  color: var(--muted);
  border-right: 1px solid var(--stroke);
  font-size: 13px;
}

.money-field input {
  border: none;
  background: transparent;
  padding: 10px 12px;
  color: var(--ink);
}

.referral-date-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-top: 0;
  padding-left: 12px;
}

.referral-date-row .check-row {
  width: 100%;
}

.referral-date-row input[type="date"] {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 6px 8px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 12px;
}

.referral-date-row input[type="date"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lead-form button {
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-depth));
  border: 1px solid var(--primary-glow);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.35), 0 0 0 1px var(--primary-glow);
  transition: 0.22s ease;
}

.lead-form button:hover {
  transform: translateY(-2px);
  filter: saturate(1.1);
  box-shadow: 0 16px 30px rgba(2, 6, 23, 0.38), 0 0 0 1px var(--primary-glow);
}

.settings-main {
  padding-bottom: 64px;
}

.settings-stack {
  display: grid;
  gap: 20px;
}

.tab-bar {
  display: inline-flex;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-elevated) 100%);
  border-radius: 22px;
  border: 1px solid var(--stroke);
  padding: 8px;
  gap: 8px;
  box-shadow: var(--shadow-soft);
}

.tab-button {
  border: 1px solid rgba(10, 37, 64, 0.08);
  background: rgba(31, 95, 255, 0.04);
  padding: 8px 16px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  transition: 0.2s ease;
}

.tab-button.active {
  background: linear-gradient(135deg, #2f70ff 0%, #1f5fff 48%, #194edc 100%);
  border: 1px solid rgba(31, 95, 255, 0.35);
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(10, 37, 64, 0.25);
  box-shadow:
    0 12px 28px rgba(31, 95, 255, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -10px 18px rgba(15, 60, 190, 0.28);
}

.settings-main .tab-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  padding: 8px;
  border-radius: 20px;
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-elevated) 100%);
  overflow-x: auto;
}

.settings-main .settings-hub-tabs {
  margin-bottom: 16px;
}

.settings-main .tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 14px 12px;
  border-radius: 16px;
  text-align: center;
  white-space: nowrap;
  line-height: 1.15;
  position: relative;
}

.settings-main .tab-button::after {
  content: none;
}

.settings-main .tab-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  color: currentColor;
  opacity: 0.72;
}

.settings-main .tab-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.settings-main .tab-button span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.title-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  background: var(--soft);
  border: 1px solid var(--stroke);
  color: var(--ink);
  flex: 0 0 32px;
}

.title-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.title-icon svg path,
.settings-main .tab-icon svg path,
.contact-icon svg path {
  fill: currentColor;
}

.tab-panel {
  display: none;
}

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

.integration-tabs-compact {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.integration-brand-mark {
  position: relative;
  overflow: hidden;
}

.integration-brand-mark.has-icon {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.integration-brand-mark svg {
  width: 66%;
  height: 66%;
  display: block;
}

.integration-brand-mark.service-facebook,
.integration-brand-mark.service-twilio_whatsapp,
.integration-brand-mark.service-telegram,
.integration-brand-mark.service-monday {
  background: transparent;
  border: none;
  box-shadow: none;
}

.integration-brand-mark.service-facebook svg,
.integration-brand-mark.service-twilio_whatsapp svg,
.integration-brand-mark.service-telegram svg,
.integration-brand-mark.service-monday svg {
  width: 100%;
  height: 100%;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.appearance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.appearance-field-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.appearance-option {
  position: relative;
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: linear-gradient(135deg, var(--soft), var(--surface));
  color: var(--ink);
  cursor: pointer;
  transition: 0.24s ease;
}

.appearance-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.appearance-option-swatch {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid var(--surface-elevated);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22);
}

.appearance-option:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.45);
}

.appearance-option input:checked + .appearance-option-swatch {
  box-shadow: 0 0 0 2px var(--primary-color), 0 0 14px var(--primary-glow);
}

.appearance-option:has(input:checked) {
  border-color: var(--primary-glow);
  background: var(--primary-light);
}

.appearance-option.is-selected {
  border-color: var(--primary-glow);
  background: var(--primary-light);
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.24), 0 0 18px var(--neon-glow), 0 0 0 1px var(--primary-glow);
}

.appearance-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(140deg, rgba(148, 163, 184, 0.1), var(--surface));
  box-shadow: inset 0 0 0 1px var(--stroke), 0 0 22px var(--neon-glow);
}

.appearance-preview-card {
  display: inline-grid;
  gap: 2px;
}

.appearance-preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary-color);
  box-shadow: 0 0 0 6px var(--primary-light);
}

.appearance-preview-btn {
  border: 1px solid var(--primary-glow);
  border-radius: 10px;
  padding: 8px 12px;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary-color), var(--bg-3));
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.24), 0 0 24px var(--neon-glow), 0 0 0 1px var(--primary-glow);
}

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

.appearance-status.success {
  color: #85efb4;
}

.appearance-status.error {
  color: #ff9c9c;
}

.settings-card {
  background: linear-gradient(145deg, rgba(148, 163, 184, 0.1), var(--surface));
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow-soft), 0 0 22px var(--neon-glow);
}

.settings-card h4 {
  margin: 0 0 12px;
  font-family: "Roboto", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
}

.module-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.module-summary-card {
  display: grid;
  gap: 6px;
  min-height: 126px;
  align-content: start;
}

.module-summary-card--inactive {
  border-color: rgba(248, 113, 113, 0.34);
}

.module-summary-card--auto {
  border-color: rgba(59, 130, 246, 0.34);
}

.module-summary-card--optional {
  border-color: rgba(244, 114, 182, 0.28);
}

.module-summary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.module-summary-value {
  font-size: 32px;
  line-height: 1;
  font-family: "Roboto", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
}

.module-summary-note {
  font-size: 12px;
  color: var(--muted);
}

.module-section-card,
.module-section-block {
  margin-bottom: 18px;
}

.module-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.module-section-header h4 {
  margin: 0;
}

.module-section-header p {
  margin: 6px 0 0;
}

.module-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.module-base-chip {
  background: rgba(34, 197, 94, 0.14);
  color: #b7f7ca;
}

.module-grid {
  align-items: stretch;
}

.module-card {
  display: grid;
  gap: 14px;
  border-color: rgba(148, 163, 184, 0.18);
  min-height: 220px;
}

.module-card--enabled {
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(34, 197, 94, 0.16);
}

.module-card--disabled {
  opacity: 0.96;
}

.module-card--auto {
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.module-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.module-card-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.module-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 56px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(15, 23, 42, 0.2));
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.module-card-copy {
  min-width: 0;
}

.module-card-copy h4 {
  margin: 0 0 6px;
}

.module-card-copy p {
  margin: 0;
}

.module-card-eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.module-state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.module-state-badge--enabled {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

.module-state-badge--disabled {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.module-state-badge--auto {
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
}

.module-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.module-chip-positive {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

.module-chip-muted {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

.module-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  flex-wrap: wrap;
}

.module-toggle,
.module-toggle-static {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.62);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

.module-toggle {
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.module-toggle:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.32);
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.18);
}

.module-toggle:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.module-toggle-indicator {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 12px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.module-toggle-indicator--on {
  background: #22c55e;
}

.module-toggle-indicator--off {
  background: #94a3b8;
}

.module-empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
}

.integration-heading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.integration-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary-light), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: var(--primary-color);
  flex: 0 0 30px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 18px rgba(2, 6, 23, 0.24);
}

.integration-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.integration-icon-monday svg {
  width: 19px;
  height: 19px;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px dashed var(--stroke);
  font-size: 13px;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-label {
  color: var(--muted);
  min-width: 0;
}

.settings-value {
  font-weight: 600;
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.settings-value.editing {
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--stroke-strong);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.16);
}

.settings-value.editing input,
.settings-value.editing select {
  width: 100%;
  text-align: left;
  border: 1px solid var(--stroke-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  caret-color: var(--primary-color);
}

:root[data-theme-mode="light"] .settings-value.editing,
:root[data-theme-mode="light"] .settings-value.editing input,
:root[data-theme-mode="light"] .settings-value.editing select {
  background: #ffffff !important;
  color: #0a2540 !important;
}

.settings-value.editing input::placeholder {
  color: var(--muted);
}

.settings-value.editing input:focus,
.settings-value.editing select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.users-table .user-identity {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.users-table .user-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.users-company-groups {
  display: grid;
  gap: 18px;
}

.users-company-group {
  padding: 18px;
}

.users-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.users-group-header h4 {
  margin: 0;
}

.users-group-header p {
  margin: 4px 0 0;
}

.user-avatar.small {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-size: 12px;
}

.user-avatar.small::before,
.user-avatar.small::after,
.user-avatar.small .status-dot {
  display: none;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.status-badge.admin {
  background: rgba(255, 214, 0, 0.15);
  color: #f6d54a;
}

.status-badge.standard {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.status-badge.active {
  background: rgba(37, 201, 114, 0.15);
  color: #6df0a5;
}

.status-badge.inactive {
  background: rgba(255, 95, 95, 0.15);
  color: #ff8a8a;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink);
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
}

.lead-form.vertical .checkbox-row input {
  width: 16px;
  height: 16px;
}

.checkbox-row span {
  min-width: 0;
}

.team-header {
  display: grid;
  grid-template-columns: 52px minmax(160px, 1.3fr) repeat(8, minmax(90px, 1fr)) minmax(180px, 1.5fr) 40px;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: var(--muted);
}

.team-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.team-card {
  display: grid;
  grid-template-columns: 52px minmax(160px, 1.3fr) repeat(8, minmax(90px, 1fr)) minmax(180px, 1.5fr) 40px;
  gap: 8px;
  align-items: center;
  padding: 12px 8px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--soft);
}

.team-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-actions {
  display: inline-flex;
  justify-content: flex-end;
}

.team-delete {
  color: #ffb4b4;
}

.team-field {
  font-size: 13px;
}

.team-notes {
  font-size: 13px;
}

.clients-panel {
  overflow: hidden;
}

.clients-panel-title {
  margin: 0;
}

.clients-panel-subtitle {
  margin: 6px 0 0;
}

.clients-table-scroll {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.35) transparent;
}

.clients-table-scroll::-webkit-scrollbar {
  height: 8px;
}

.clients-table-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.clients-table-scroll::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.35);
  border-radius: 999px;
}

.clients-table-scroll .team-header,
.clients-table-scroll .team-card {
  min-width: 1180px;
  grid-template-columns:
    52px
    minmax(180px, 1.35fr)
    minmax(110px, 0.8fr)
    minmax(110px, 0.8fr)
    minmax(190px, 1.15fr)
    minmax(130px, 0.9fr)
    minmax(120px, 0.85fr)
    minmax(120px, 0.85fr)
    minmax(120px, 0.85fr)
    minmax(132px, 0.9fr)
    minmax(190px, 1.25fr)
    48px;
}

.clients-table-scroll .team-header {
  align-items: center;
  padding: 12px 14px;
  margin-top: 10px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--soft);
}

.clients-table-scroll .team-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.clients-table-scroll .team-grid {
  min-width: 1180px;
}

.clients-table-scroll .team-card {
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--surface);
}

.clients-table-scroll .team-card:hover {
  border-color: var(--primary-glow);
  background: var(--surface-elevated);
}

.clients-table-scroll .team-avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
}

.clients-table-scroll .team-value {
  font-weight: 800;
  color: var(--ink);
}

.clients-table-scroll .team-field,
.clients-table-scroll .team-notes {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.clients-table-scroll .team-actions .icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  text-decoration: none;
}

.record-action-menu {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
  z-index: 5;
}

.record-action-trigger {
  width: 38px;
  height: 38px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--stroke);
  border-radius: 13px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: 0.18s ease;
}

.record-action-trigger span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
}

.record-action-trigger:hover,
.record-action-trigger[aria-expanded="true"] {
  color: var(--primary-color);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.13);
}

.record-action-dropdown {
  position: fixed;
  z-index: 10000;
  min-width: 176px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.2);
}

.record-action-dropdown.is-open {
  display: grid;
}

.record-action-dropdown[hidden] {
  display: none;
}

.record-action-item {
  width: 100%;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.record-action-item svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--primary-color);
}

.record-action-item:hover {
  background: var(--primary-light);
  color: var(--primary-color);
}

.record-action-item.danger,
.record-action-item.danger svg {
  color: #dc2626;
}

.record-action-item.danger:hover {
  background: rgba(220, 38, 38, 0.1);
}

.fade-in {
  animation: fade-in 0.4s ease forwards;
}

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

@media (max-width: 1100px) {
  .whatsapp-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
    grid-template-areas:
      "detail chat"
      "progress progress";
  }

  .whatsapp-layout > .detail-panel {
    grid-area: detail;
  }

  .whatsapp-layout > .chat-panel {
    grid-area: chat;
  }

  .whatsapp-layout > .progress-panel {
    grid-area: progress;
  }

  .page-hero-grid {
    grid-template-columns: 1fr;
  }

  .workspace-surface-grid,
  .workspace-surface-action-grid,
  .workspace-surface-stat-grid {
    grid-template-columns: 1fr;
  }

  .shell {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow-y: visible;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 12px;
    gap: 8px;
    overflow-x: auto;
    border-radius: 18px;
  }

  .sidebar-industry,
  .nav-label {
    display: none;
  }

  .logo-link {
    margin: 0 2px 0 0;
  }

  .nav-dot {
    width: 46px;
    min-width: 46px;
    min-height: 46px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }

  .nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
  }

  .main {
    padding: 6px 0 18px;
  }

  .pipeline-summary-grid {
    grid-template-columns: 1fr;
  }

  .analytics-chart-toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .chat-panel {
    min-height: auto;
  }

  .lead-layout {
    grid-template-columns: 1fr;
  }

  .whatsapp-layout {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .detail-panel .two-col {
    grid-template-columns: 1fr;
  }

  .detail-tabs {
    width: 100%;
    margin-left: 0;
  }

  .team-header {
    display: none;
  }

  .clients-table-scroll,
  .clients-table-scroll .team-grid {
    min-width: 0;
    overflow-x: visible;
  }

  .team-card {
    grid-template-columns: 60px 1fr;
    grid-auto-rows: auto;
  }

  .clients-search-field {
    width: 100%;
    min-width: 100%;
  }

  .client-form-header,
  .client-form-section {
    grid-template-columns: 1fr;
  }

  .client-form-header {
    padding: 20px;
  }

  .client-form-header__icon {
    display: none;
  }

  .client-form-section,
  .client-form-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .clients-table-scroll .team-card {
    min-width: 0;
    grid-template-columns: 56px 1fr;
    padding: 14px;
  }

  .clients-table-scroll .team-field,
  .clients-table-scroll .team-notes {
    white-space: normal;
  }
}

@media (max-width: 720px) {
  .workspace-surface-action-links {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-surface-action-links .integration-quick-button,
  .workspace-connection-card .integration-quick-button {
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .panel {
    padding: 16px;
    border-radius: 18px;
  }

  .page-hero-card {
    padding: 18px;
  }

  .tab-bar {
    width: 100%;
    justify-content: space-between;
  }

  .settings-main .tab-bar {
    width: 100%;
    grid-template-columns: repeat(5, minmax(132px, 1fr));
    justify-content: flex-start;
  }

  .data-table {
    min-width: 720px;
  }

  .pipeline-board {
    grid-template-columns: 1fr;
  }

  .settings-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .settings-value {
    text-align: left;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .user-chip {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
  }

  .topbar:not(.app-topbar) .user-chip-actions {
    position: static;
    transform: none;
    margin-left: auto;
  }

  .analytics-chart-wrap {
    height: 260px;
  }

  .analytics-range-btn {
    font-size: 10px;
    padding: 6px 10px;
  }
}

/* ===== MERGED FROM dashboard-superadmin.css ===== */

.superadmin-kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.superadmin-kpi {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: linear-gradient(150deg, var(--surface), var(--surface-elevated));
  padding: 14px;
}

.superadmin-kpi-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.superadmin-kpi-value {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}

.superadmin-kpi-meta {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.superadmin-chart-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.superadmin-chart-box {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--surface);
  padding: 12px;
}

.superadmin-chart-wrap {
  position: relative;
  height: 220px;
}

.superadmin-breakdown {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.superadmin-breakdown li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.superadmin-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}

.superadmin-status.is-active {
  color: #9be8c3;
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(34, 197, 94, 0.42);
}

.superadmin-status.is-inactive {
  color: #f9c9a3;
  background: rgba(234, 88, 12, 0.16);
  border-color: rgba(249, 115, 22, 0.42);
}

.scope-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.scope-badge a {
  color: var(--primary-color);
  text-decoration: none;
}

.superadmin-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.superadmin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  color: var(--ink);
  text-decoration: none;
  background: var(--soft);
  font-size: 11px;
  font-weight: 700;
}

.company-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.company-cell-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, var(--surface), var(--surface-elevated));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(10, 37, 64, 0.08);
}

.company-cell-logo {
  width: auto;
  height: auto;
  max-width: 30px;
  max-height: 30px;
  object-fit: contain;
  padding: 0;
  display: block;
  background: transparent;
}

.company-cell-avatar.is-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.84), rgba(16, 185, 129, 0.76));
}

.company-cell-name {
  font-weight: 700;
  color: var(--ink);
}

@media (max-width: 980px) {
  .superadmin-chart-grid {
    grid-template-columns: 1fr;
  }

  .whatsapp-layout.followup-layout {
    grid-template-columns: 1fr;
  }
}

/* ===== MERGED FROM leaddetail.css ===== */

.patient-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 0 18px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid var(--stroke-strong);
  background: linear-gradient(180deg, var(--surface), var(--surface-elevated));
  box-shadow: var(--shadow-soft);
}

.lead-title-status {
  margin-top: 10px;
}

.lead-title-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.workspace-topbar-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.workspace-topbar-heading .title {
  margin: 0;
}

.patient-control-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.patient-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.18);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.patient-status-chip--inline {
  padding: 7px 11px;
  font-size: 11px;
  line-height: 1;
}

.patient-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.patient-status-chip.is-inactive .patient-status-dot {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
}

.patient-quick-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.patient-action-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ink);
  border-radius: 14px;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  text-decoration: none;
}

.patient-action-btn--compact {
  min-width: 92px;
  padding: 9px 12px;
  font-size: 12px;
  border-radius: 12px;
}

.patient-action-btn:hover {
  transform: translateY(-1px);
  border-color: var(--stroke-strong);
  background: rgba(255, 255, 255, 0.08);
}

.patient-action-btn.is-primary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.patient-action-btn.is-success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.24);
}

.patient-action-btn.is-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.22);
}

.patient-action-btn.is-disabled,
.patient-action-btn[aria-disabled="true"] {
  opacity: 0.48;
  pointer-events: none;
  box-shadow: none;
}

.progress-card--actionable {
  display: grid;
  gap: 14px;
}

.journey-timeline {
  position: relative;
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 2px 0;
}

.journey-timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 16px;
  bottom: 16px;
  width: 2px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
}

.journey-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(148, 163, 184, 0.04));
}

.journey-marker {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  margin-left: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.32);
  border: 2px solid rgba(148, 163, 184, 0.44);
}

.journey-marker::after {
  content: none;
}

.journey-item:last-child .journey-marker::after {
  display: none;
}

.journey-item.is-complete .journey-marker {
  background: rgba(34, 197, 94, 0.9);
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

.journey-item.is-complete {
  border-color: rgba(34, 197, 94, 0.28);
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.04));
}

.journey-item.is-pending .journey-marker {
  background: rgba(245, 158, 11, 0.9);
  border-color: rgba(245, 158, 11, 0.44);
}

.journey-item.is-pending {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
}

.journey-item.is-issue .journey-marker {
  background: rgba(239, 68, 68, 0.9);
  border-color: rgba(239, 68, 68, 0.44);
}

.journey-item.is-issue {
  border-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.04));
}

.journey-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.journey-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.journey-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.journey-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.journey-step-number,
.journey-state {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.journey-step-number {
  background: rgba(148, 163, 184, 0.12);
  color: rgba(226, 232, 240, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.journey-state.is-complete {
  background: rgba(34, 197, 94, 0.14);
  color: #7ef0a5;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.journey-state.is-pending {
  background: rgba(245, 158, 11, 0.14);
  color: #f6c66a;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.journey-state.is-issue {
  background: rgba(239, 68, 68, 0.14);
  color: #fda4a4;
  border: 1px solid rgba(239, 68, 68, 0.18);
}

.progress-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.progress-action-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border-radius: 12px;
  padding: 9px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.progress-action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(138, 180, 248, 0.34);
  background: rgba(138, 180, 248, 0.1);
}

.progress-action-btn.is-danger:hover {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
}

.progress-card .status-badge.alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 12px;
}

.chat-ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chat-suggestion-chip {
  appearance: none;
  border: 1px solid var(--stroke-strong);
  background: var(--soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.chat-suggestion-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(138, 180, 248, 0.28);
  background: rgba(138, 180, 248, 0.12);
}

.chat-suggestion-chip.is-loading {
  opacity: 0.68;
  pointer-events: none;
}

.chat-bubble.ai {
  border-color: rgba(14, 165, 233, 0.28);
  background: linear-gradient(180deg, rgba(8, 47, 73, 0.92), rgba(8, 18, 34, 0.96));
}

.chat-sender {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.chat-sender::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.chat-bubble.incoming .chat-sender::before {
  background: rgba(34, 197, 94, 0.78);
}

.chat-bubble.incoming .chat-sender {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.2);
  color: #bbf7d0;
}

.chat-bubble.outgoing .chat-sender::before {
  background: rgba(255, 255, 255, 0.48);
}

.chat-bubble.staff .chat-sender,
.chat-bubble.outgoing .chat-sender {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.24);
  color: #dbeafe;
}

.chat-bubble.ai .chat-sender::before {
  background: rgba(14, 165, 233, 0.92);
}

.chat-bubble.ai .chat-sender {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(14, 165, 233, 0.28);
  color: #bae6fd;
}

/* ===== Theme Consistency Fixes ===== */
:root[data-theme-mode="light"] .sidebar,
:root[data-theme-mode="light"] .panel,
:root[data-theme-mode="light"] .progress-card,
:root[data-theme-mode="light"] .chat-panel,
:root[data-theme-mode="light"] .topbar,
:root[data-theme-mode="light"] .user-chip,
:root[data-theme-mode="light"] .settings-card {
  background: linear-gradient(180deg, #ffffff, #ffffff) !important;
  color: var(--ink) !important;
  border-color: var(--stroke-strong) !important;
}

:root[data-theme-mode="light"] .integrations-summary-bar,
:root[data-theme-mode="light"] .integration-section-card,
:root[data-theme-mode="light"] .integration-saas-card,
:root[data-theme-mode="light"] .integration-sidebar-card {
  background: linear-gradient(145deg, #ffffff, #ffffff) !important;
  border-color: var(--stroke-strong) !important;
  box-shadow: var(--shadow-soft) !important;
}

:root[data-theme-mode="light"] .integration-quick-button,
:root[data-theme-mode="light"] .integration-summary-chip,
:root[data-theme-mode="light"] .integration-status-badge {
  background: var(--soft) !important;
  color: var(--ink) !important;
  border-color: var(--stroke) !important;
}

:root[data-theme-mode="light"] .integration-activity-item p,
:root[data-theme-mode="light"] .journey-title,
:root[data-theme-mode="light"] .lead-table .lead-name,
:root[data-theme-mode="light"] .chat-suggestion-chip,
:root[data-theme-mode="light"] .patient-status-chip {
  color: var(--ink) !important;
}

@media (max-width: 1200px) {
  .patient-control-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .patient-quick-actions {
    justify-content: flex-start;
  }

  .detail-quick-actions {
    grid-template-columns: 1fr;
  }

  .patient-appointment-card {
    min-height: auto;
    width: 100%;
  }

  .detail-quick-actions .patient-quick-actions {
    justify-self: stretch;
    flex-direction: row;
    flex-wrap: wrap;
    min-width: 0;
  }
}

/* ===== App-wide Visual Consistency ===== */
.topbar,
.panel,
.progress-card,
.chat-panel,
.user-chip,
.settings-card,
.page-hero-card,
.popup-card,
.pipeline-lane,
.metric-card,
.analytics-metric-card,
.stat-card,
.table-modern {
  background: var(--surface) !important;
  border: 1px solid var(--stroke) !important;
  box-shadow: none !important;
}

.topbar:hover,
.panel:hover,
.settings-card:hover,
.metric-card:hover,
.analytics-metric-card:hover,
.stat-card:hover,
.pipeline-ticket:hover,
.hero-action-button:hover,
.chip:hover,
.icon-btn:hover,
.chat-open:hover {
  background: var(--surface-elevated) !important;
  transform: translateY(-2px);
}

.sidebar,
.detail-tabs,
.tab-bar,
.settings-main .tab-bar,
.search-field,
.chat-stack,
.chat-contact,
.money-field {
  background: var(--surface) !important;
  border: 1px solid var(--stroke-strong) !important;
  box-shadow: none !important;
}

.nav-dot:hover:not(.active),
.workspace-chip:hover,
.appearance-option:hover,
.search-field:focus-within {
  background: var(--surface-elevated) !important;
  box-shadow: none !important;
}

.integration-section-card,
.integration-sidebar-card {
  background: var(--surface) !important;
  border: 1px solid var(--stroke) !important;
  box-shadow: none !important;
}

.integration-quick-button,
.chip,
.workspace-chip,
.analytics-range-btn,
.chat-suggestion-chip,
.icon-btn,
.chat-open,
.tab-button,
.detail-tabs .tab-button {
  background: transparent !important;
  border: 1px solid var(--stroke-strong) !important;
  color: var(--muted) !important;
  box-shadow: none !important;
}

.integration-quick-button.primary,
.action-chip,
.btn-primary,
.hero-action-button.primary,
.integration-card-button.primary,
.lead-form button,
.appearance-preview-btn {
  background: linear-gradient(180deg, var(--surface-elevated), var(--surface)) !important;
  color: var(--ink) !important;
  border: 1px solid var(--stroke-strong) !important;
  text-shadow: none !important;
  box-shadow: var(--shadow-soft) !important;
}

.tab-button.active,
.detail-tabs .tab-button.active,
.analytics-range-btn.active {
  background: var(--soft) !important;
  color: var(--ink) !important;
  border: 1px solid var(--stroke-strong) !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

.hero-action-button.secondary,
.integration-card-button.secondary,
.integration-card-button.ghost {
  background: transparent !important;
  border: 1px solid var(--stroke-strong) !important;
  color: var(--muted) !important;
}

.search-input,
.lead-input,
.chat-input,
.lead-form input,
.lead-form select,
.money-field,
.referral-date-row input[type="date"] {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border-color: var(--stroke) !important;
}

.search-input::placeholder,
.lead-form input::placeholder,
.chat-input::placeholder {
  color: var(--muted) !important;
}

.lead-table .lead-item,
.data-table tbody tr,
.pipeline-ticket,
.patient-status-card,
.journey-card {
  background: var(--surface) !important;
  border-color: var(--stroke) !important;
  box-shadow: none !important;
}

.lead-table .lead-item:hover,
.data-table tbody tr:hover,
.lead-table .lead-item.active,
.lead-table .lead-item:focus-within {
  background: var(--surface-elevated) !important;
}

.hero-eyebrow,
.hero-stat-chip,
.hero-note-chip,
.pipeline-ticket-chip,
.chat-pill {
  background: var(--soft) !important;
  border-color: var(--stroke) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

.title,
.page-hero-title,
.panel-header h3,
.integration-saas-copy h5,
.lead-table .lead-name,
.analytics-metric-value,
.pipeline-value,
.stat-card strong,
.user-name {
  color: var(--ink) !important;
}

.subtitle,
.page-hero-copy,
.hero-side-head p,
.muted,
.lead-table .lead-meta,
.pipeline-ticket-meta,
.pipeline-ticket-footer,
.analytics-metric-sub,
.analytics-metric-label,
.panel-header p,
.logout-link,
.settings-row .settings-label {
  color: var(--muted) !important;
}

.user-chip-icon-btn,
.integration-saas-logo,
.title-icon,
.analytics-metric-icon,
.nav-icon {
  background: var(--soft) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

.sidebar-brand-copy span,
.sidebar-industry,
.sidebar-section-title,
.nav-dot,
.nav-dot-sub .nav-label,
.settings-main .tab-button,
.detail-tabs .tab-button,
.tab-button,
.icon-btn,
.user-chip-icon-btn,
.logout-link,
.muted {
  color: var(--muted) !important;
}

.sidebar-brand-copy strong,
.nav-dot.active,
.nav-dot.active .nav-label,
.nav-dot.active svg,
.title-icon svg,
.settings-main .tab-button.active,
.detail-tabs .tab-button.active,
.tab-button.active,
.search-input,
.lead-form input,
.lead-form select {
  color: var(--ink) !important;
}

.nav-dot.active {
  background: var(--soft) !important;
  border-left: 3px solid var(--stroke-strong) !important;
  border-top: 1px solid transparent !important;
  border-right: 1px solid transparent !important;
  border-bottom: 1px solid transparent !important;
  border-radius: 12px !important;
}

.nav-dot.active .nav-icon {
  background: transparent !important;
}

:root[data-theme-mode="light"] .sidebar,
:root[data-theme-mode="light"] .detail-tabs,
:root[data-theme-mode="light"] .tab-bar,
:root[data-theme-mode="light"] .settings-main .tab-bar,
:root[data-theme-mode="light"] .search-field,
:root[data-theme-mode="light"] .chat-stack,
:root[data-theme-mode="light"] .chat-contact,
:root[data-theme-mode="light"] .money-field,
:root[data-theme-mode="light"] .topbar,
:root[data-theme-mode="light"] .panel,
:root[data-theme-mode="light"] .progress-card,
:root[data-theme-mode="light"] .chat-panel,
:root[data-theme-mode="light"] .user-chip,
:root[data-theme-mode="light"] .settings-card,
:root[data-theme-mode="light"] .page-hero-card,
:root[data-theme-mode="light"] .popup-card,
:root[data-theme-mode="light"] .pipeline-lane,
:root[data-theme-mode="light"] .metric-card,
:root[data-theme-mode="light"] .analytics-metric-card,
:root[data-theme-mode="light"] .stat-card,
:root[data-theme-mode="light"] .table-modern,
:root[data-theme-mode="light"] .integration-section-card,
:root[data-theme-mode="light"] .integration-sidebar-card {
  box-shadow: var(--shadow-soft) !important;
}

.lead-popup-card {
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 96px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}

.lead-popup-card .panel-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: inherit;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stroke);
}

.lead-popup-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  overflow-y: auto;
  max-height: calc(100vh - 190px);
  padding: 2px 6px 4px 2px;
}

.lead-popup-form input[name="client_name"],
.lead-popup-form input[name="notes"],
.lead-popup-form button[type="submit"] {
  grid-column: 1 / -1;
}

.lead-popup-form button[type="submit"] {
  min-height: 48px;
  margin-top: 4px;
}

@media (max-width: 760px) {
  .popup {
    padding: 28px 14px;
  }

  .lead-popup-card {
    width: min(100%, calc(100vw - 28px));
    max-height: calc(100vh - 56px);
  }

  .lead-popup-form {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 150px);
  }
}

.patient-workspace {
  display: grid;
  gap: 22px;
  padding: 24px;
}

.patient-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 22px 24px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(148, 163, 184, 0.03));
}

.patient-header-copy {
  display: grid;
  gap: 8px;
}

.patient-header-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.patient-header-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.patient-header-main h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2.05rem);
  line-height: 1.05;
}

.patient-header-status-row {
  display: flex;
  align-items: center;
}

.patient-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.patient-intake-header {
  margin-bottom: 14px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(96, 165, 250, 0.16);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 34%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.04), rgba(148, 163, 184, 0.03));
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.18);
}

.patient-intake-summary {
  margin: 0;
  max-width: 58ch;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.patient-intake-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.patient-intake-stat {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.74), rgba(15, 23, 42, 0.58));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.patient-intake-stat-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.88);
}

.patient-intake-stat strong {
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.patient-intake-stat--switcher {
  grid-column: span 1;
}

.patient-intake-stat--switcher select {
  min-width: 0;
}

:root[data-theme-mode="light"] .patient-intake-header {
  border-color: rgba(148, 163, 184, 0.22);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 34%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.96));
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

:root[data-theme-mode="light"] .patient-intake-stat,
:root[data-theme-mode="light"] .detail-tab-panel,
:root[data-theme-mode="light"] .progress-card-inline {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

:root[data-theme-mode="light"] .patient-intake-summary,
:root[data-theme-mode="light"] .patient-intake-stat-label,
:root[data-theme-mode="light"] .detail-panel .field-label {
  color: #64748b;
}

.whatsapp-layout.followup-layout > .detail-panel,
.whatsapp-layout.followup-layout > .progress-panel {
  display: grid;
  gap: 16px;
  align-content: start;
  background: linear-gradient(180deg, rgba(7, 11, 20, 0.9), rgba(5, 7, 12, 0.94)) !important;
  border: 1px solid rgba(148, 163, 184, 0.14) !important;
  box-shadow: none !important;
}

.detail-section-heading {
  display: grid;
  gap: 5px;
  padding: 2px 2px 0;
}

.detail-section-heading--tabs {
  margin-top: 2px;
}

.detail-section-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.88);
}

.detail-section-heading h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
}

.detail-section-title {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.detail-section-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--primary-color);
  background: var(--primary-light);
  border: 1px solid var(--primary-glow);
  box-shadow: 0 8px 18px rgba(31, 95, 255, 0.12);
}

.detail-section-title-icon svg {
  width: 20px;
  height: 20px;
}

.detail-panel .progress-card-inline {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(8, 13, 24, 0.94)) !important;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.18) !important;
}

.detail-quick-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 16px;
  align-items: start;
  margin-bottom: 4px;
}

.detail-quick-actions > * {
  min-width: 0;
}

.patient-intake-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.patient-intake-identity {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
  padding: 2px 2px 0 0;
}

.patient-intake-identity strong {
  font-size: clamp(1.95rem, 2.9vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 0.95;
  text-wrap: balance;
}

.patient-intake-email {
  font-size: 13px;
  color: rgba(226, 232, 240, 0.8);
  line-height: 1.45;
  word-break: break-word;
}

.patient-intake-identity .patient-intake-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.88);
}

.patient-appointment-card {
  appearance: none;
  display: grid;
  gap: 12px;
  align-content: space-between;
  min-height: auto;
  width: 100%;
  max-width: none;
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid rgba(96, 165, 250, 0.3);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.92), rgba(29, 78, 216, 0.96));
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

#patient-appointment-card {
  border: 1px solid rgba(96, 165, 250, 0.3) !important;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.92), rgba(29, 78, 216, 0.96)) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24) !important;
}

.patient-appointment-card:hover {
  transform: translateY(-1px);
  border-color: rgba(147, 197, 253, 0.42);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.3);
}

#patient-appointment-card:hover {
  border-color: rgba(147, 197, 253, 0.42) !important;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
  color: #ffffff !important;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.3) !important;
}

.patient-appointment-card.is-empty {
  opacity: 0.88;
}

.patient-appointment-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.88);
}

.patient-appointment-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}

.patient-appointment-date {
  display: grid;
  gap: 1px;
  min-width: 64px;
}

.patient-appointment-month {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.88);
}

.patient-appointment-day {
  font-size: clamp(2.2rem, 3vw, 2.8rem);
  font-weight: 800;
  line-height: 0.92;
  color: var(--ink);
}

.patient-appointment-time-block {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.patient-appointment-time-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.88);
}

.patient-appointment-time {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}

.detail-quick-actions .patient-quick-actions {
  align-self: center;
  justify-self: end;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  width: 100%;
  min-width: 104px;
}

.detail-quick-actions .patient-action-btn {
  justify-content: center;
}

.detail-quick-actions .patient-action-btn--compact {
  min-width: 88px;
  padding: 8px 11px;
  font-size: 11px;
  border-radius: 11px;
}

.detail-panel .detail-tab-panel {
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.76), rgba(8, 13, 24, 0.72)) !important;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.16) !important;
}

.detail-panel .detail-tabs .tab-button {
  background: rgba(59, 130, 246, 0.12) !important;
  border-color: rgba(59, 130, 246, 0.18) !important;
  color: #dbeafe !important;
  box-shadow: none !important;
}

.detail-panel .detail-tabs .tab-button:hover {
  background: rgba(59, 130, 246, 0.18) !important;
  border-color: rgba(59, 130, 246, 0.26) !important;
  color: #eff6ff !important;
}

.detail-panel .detail-tabs .tab-button.active {
  background: linear-gradient(135deg, var(--primary-color), #1d4ed8) !important;
  border-color: rgba(96, 165, 250, 0.34) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24) !important;
}

.detail-quick-actions .patient-action-btn {
  background: linear-gradient(135deg, var(--primary-color), #1d4ed8) !important;
  border-color: rgba(96, 165, 250, 0.28) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2) !important;
}

.detail-quick-actions .patient-action-btn:hover {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
  border-color: rgba(147, 197, 253, 0.38) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.26) !important;
}

:root[data-theme-mode="light"] .whatsapp-layout.followup-layout > .detail-panel,
:root[data-theme-mode="light"] .whatsapp-layout.followup-layout > .progress-panel,
:root[data-theme-mode="light"] .detail-panel .progress-card-inline,
:root[data-theme-mode="light"] .detail-panel .detail-tab-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98)) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
}

:root[data-theme-mode="light"] .detail-tabs,
:root[data-theme-mode="light"] .detail-tabs.tab-bar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98)) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05) !important;
}

:root[data-theme-mode="light"] .detail-tabs .tab-button {
  background: rgba(148, 163, 184, 0.08) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  color: var(--muted) !important;
}

:root[data-theme-mode="light"] .detail-tabs .tab-button.active {
  background: rgba(15, 23, 42, 0.04) !important;
  color: var(--ink) !important;
  border-color: rgba(71, 85, 105, 0.2) !important;
  box-shadow: none !important;
}

:root[data-theme-mode="light"] .detail-panel .detail-tabs .tab-button {
  background: rgba(59, 130, 246, 0.08) !important;
  border-color: rgba(59, 130, 246, 0.16) !important;
  color: #1d4ed8 !important;
}

:root[data-theme-mode="light"] .detail-panel .detail-tabs .tab-button:hover {
  background: rgba(59, 130, 246, 0.12) !important;
  border-color: rgba(59, 130, 246, 0.22) !important;
  color: #1d4ed8 !important;
}

:root[data-theme-mode="light"] .detail-panel .detail-tabs .tab-button.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.94), rgba(29, 78, 216, 0.96)) !important;
  border-color: rgba(59, 130, 246, 0.24) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.16) !important;
}

:root[data-theme-mode="light"] .patient-action-btn {
  background: #ffffff;
  border-color: rgba(71, 85, 105, 0.18);
  color: var(--ink);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
}

:root[data-theme-mode="light"] .patient-action-btn:hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(71, 85, 105, 0.24);
  color: var(--ink);
}

:root[data-theme-mode="light"] .patient-action-btn.is-primary {
  color: var(--ink);
  background: #ffffff;
  border-color: rgba(71, 85, 105, 0.2);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
}

:root[data-theme-mode="light"] .detail-quick-actions .patient-action-btn {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.96), rgba(29, 78, 216, 0.96)) !important;
  border-color: rgba(59, 130, 246, 0.24) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.14) !important;
}

:root[data-theme-mode="light"] .detail-quick-actions .patient-action-btn:hover {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.18) !important;
}

#patient-call-action,
#patient-email-action {
  background: linear-gradient(135deg, var(--primary-color), #1d4ed8) !important;
  border-color: rgba(96, 165, 250, 0.28) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2) !important;
}

#patient-call-action:hover,
#patient-email-action:hover {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
  border-color: rgba(147, 197, 253, 0.38) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.26) !important;
}

:root[data-theme-mode="light"] #patient-call-action,
:root[data-theme-mode="light"] #patient-email-action {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.96), rgba(29, 78, 216, 0.96)) !important;
  border-color: rgba(59, 130, 246, 0.24) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.14) !important;
}

:root[data-theme-mode="light"] #patient-call-action:hover,
:root[data-theme-mode="light"] #patient-email-action:hover {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.18) !important;
}

:root[data-theme-mode="light"] .patient-appointment-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.96), rgba(29, 78, 216, 0.98));
  border-color: rgba(59, 130, 246, 0.24);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

:root[data-theme-mode="light"] #patient-appointment-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.96), rgba(29, 78, 216, 0.98)) !important;
  border-color: rgba(59, 130, 246, 0.24) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18) !important;
}

:root[data-theme-mode="light"] .patient-appointment-card:hover {
  border-color: rgba(96, 165, 250, 0.34);
}

:root[data-theme-mode="light"] #patient-appointment-card:hover {
  border-color: rgba(96, 165, 250, 0.34) !important;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
  color: #ffffff !important;
}

:root[data-theme-mode="light"] .patient-intake-identity strong,
:root[data-theme-mode="light"] .patient-appointment-day,
:root[data-theme-mode="light"] .patient-appointment-time {
  color: var(--ink);
}

:root[data-theme-mode="light"] .patient-intake-email,
:root[data-theme-mode="light"] .patient-intake-identity .patient-intake-label,
:root[data-theme-mode="light"] .patient-appointment-kicker,
:root[data-theme-mode="light"] .patient-appointment-month,
:root[data-theme-mode="light"] .patient-appointment-time-label {
  color: #475569;
}

.patient-appointment-card .patient-appointment-kicker,
.patient-appointment-card .patient-appointment-month,
.patient-appointment-card .patient-appointment-time-label {
  color: rgba(239, 246, 255, 0.96) !important;
  text-shadow: 0 1px 0 rgba(15, 23, 42, 0.12);
}

.patient-appointment-card .patient-appointment-day,
.patient-appointment-card .patient-appointment-time {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
}

:root[data-theme-mode="light"] .patient-appointment-card .patient-appointment-kicker,
:root[data-theme-mode="light"] .patient-appointment-card .patient-appointment-month,
:root[data-theme-mode="light"] .patient-appointment-card .patient-appointment-time-label {
  color: rgba(239, 246, 255, 0.98) !important;
}

:root[data-theme-mode="light"] .patient-appointment-card .patient-appointment-day,
:root[data-theme-mode="light"] .patient-appointment-card .patient-appointment-time {
  color: #ffffff !important;
}

#patient-appointment-month,
#patient-appointment-day,
#patient-appointment-time {
  color: #ffffff !important;
}

#patient-appointment-card .patient-appointment-time-label,
#patient-appointment-card .patient-appointment-kicker {
  color: rgba(239, 246, 255, 0.96) !important;
}

/* Unified patient intake card: change this block only */
.detail-quick-actions.patient-card {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
  width: 100%;
  padding: 2px 0 0;
  align-items: stretch !important;
}

.detail-quick-actions.patient-card .top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 16px;
}

.detail-quick-actions.patient-card .patient-intake-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  justify-items: start;
  align-content: start;
}

.detail-quick-actions.patient-card .label {
  display: block;
  width: 100%;
  margin-bottom: 2px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  color: #777;
}

.detail-quick-actions.patient-card .patient-name-display {
  font-size: clamp(2.1rem, 3vw, 2.9rem);
  line-height: 0.96;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #ffffff;
  text-wrap: balance;
}

.detail-quick-actions.patient-card .status.active {
  padding-top: 4px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  color: #22c55e;
}

.detail-quick-actions.patient-card .appointment-card {
  margin: 0;
  width: 100%;
  padding: 18px 18px 17px;
  border-radius: 18px;
}

.detail-quick-actions.patient-card .patient-appointment-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.detail-quick-actions.patient-card .appointment-card .small {
  font-size: 12px;
  opacity: 0.82;
}

.detail-quick-actions.patient-card .patient-appointment-kicker-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: rgba(239, 246, 255, 0.96);
  flex-shrink: 0;
}

.detail-quick-actions.patient-card .patient-appointment-kicker-icon svg {
  width: 18px;
  height: 18px;
}

.detail-quick-actions.patient-card .patient-appointment-layout {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.detail-quick-actions.patient-card .patient-appointment-date {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
  min-width: 0;
  justify-items: start;
  align-content: start;
  padding-right: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.detail-quick-actions.patient-card .patient-appointment-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: rgba(255, 255, 255, 0.96);
  box-shadow: none;
  align-self: start;
  margin-top: 2px;
}

.detail-quick-actions.patient-card .patient-appointment-icon svg {
  width: 30px;
  height: 30px;
}

.detail-quick-actions.patient-card .patient-appointment-date-copy {
  display: grid;
  gap: 4px;
  align-items: start;
  justify-items: start;
}

.detail-quick-actions.patient-card .patient-appointment-month {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  line-height: 1;
}

.detail-quick-actions.patient-card .patient-appointment-day,
#patient-appointment-card #patient-appointment-day {
  font-size: clamp(2.5rem, 3.4vw, 3.1rem) !important;
  line-height: 0.88;
}

.detail-quick-actions.patient-card .patient-appointment-meta {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 8px;
  margin-left: 0;
  padding-left: 0;
  border-left: none;
  align-self: start;
  min-width: 0;
  width: 100%;
}

.detail-quick-actions.patient-card .patient-appointment-time-block,
.detail-quick-actions.patient-card .patient-appointment-location-block {
  display: grid;
  gap: 5px;
  align-self: start;
  min-width: 0;
  align-content: start;
}

.detail-quick-actions.patient-card .patient-appointment-time-block {
  padding-left: 0;
  border-left: none;
}

.detail-quick-actions.patient-card .patient-appointment-time-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(239, 246, 255, 0.96);
}

.detail-quick-actions.patient-card .patient-appointment-time-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.detail-quick-actions.patient-card .patient-appointment-time {
  font-size: clamp(2rem, 2.8vw, 2.5rem);
  line-height: 0.92;
  white-space: nowrap;
}

.detail-quick-actions.patient-card .patient-appointment-location {
  font-size: 13px;
  line-height: 1.18;
  font-weight: 500;
  color: #ffffff;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  max-width: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.detail-quick-actions.patient-card .patient-appointment-time-suffix {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(239, 246, 255, 0.86);
}

:root[data-theme-mode="light"] .detail-quick-actions.patient-card .patient-appointment-location {
  color: #ffffff;
}

@media (max-width: 640px) {
  .detail-quick-actions.patient-card .patient-appointment-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .detail-quick-actions.patient-card .patient-appointment-date {
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    padding-bottom: 12px;
  }

  .detail-quick-actions.patient-card .patient-appointment-meta {
    width: 100%;
    gap: 12px;
  }
}

.detail-quick-actions.patient-card .patient-primary-action,
#patient-schedule-action {
  width: 100%;
  min-height: 44px;
  background: linear-gradient(135deg, var(--primary-color), #1d4ed8) !important;
  border: 1px solid rgba(96, 165, 250, 0.28) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2) !important;
}

.detail-quick-actions.patient-card .patient-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.detail-quick-actions.patient-card .patient-action-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.detail-quick-actions.patient-card .patient-action-btn span {
  line-height: 1;
}

.detail-quick-actions.patient-card .patient-quick-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.detail-quick-actions.patient-card #patient-call-action,
.detail-quick-actions.patient-card #patient-email-action {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
  box-shadow: none !important;
}

.detail-quick-actions.patient-card #patient-call-action:hover,
.detail-quick-actions.patient-card #patient-email-action:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

:root[data-theme-mode="light"] .detail-quick-actions.patient-card .label {
  color: #64748b;
}

:root[data-theme-mode="light"] .detail-quick-actions.patient-card .patient-name-display {
  color: var(--ink);
}

:root[data-theme-mode="light"] .detail-quick-actions.patient-card .status.active {
  color: #15803d;
}

:root[data-theme-mode="light"] .detail-quick-actions.patient-card .patient-appointment-icon {
  background: transparent;
  color: rgba(255, 255, 255, 0.98);
}

:root[data-theme-mode="light"] .detail-quick-actions.patient-card #patient-call-action,
:root[data-theme-mode="light"] .detail-quick-actions.patient-card #patient-email-action {
  background: transparent !important;
  border-color: rgba(148, 163, 184, 0.3) !important;
  color: #334155 !important;
}

:root[data-theme-mode="light"] .detail-quick-actions.patient-card #patient-call-action:hover,
:root[data-theme-mode="light"] .detail-quick-actions.patient-card #patient-email-action:hover {
  background: rgba(15, 23, 42, 0.04) !important;
  border-color: rgba(148, 163, 184, 0.42) !important;
  color: var(--ink) !important;
}

:root[data-theme-mode="light"] .detail-quick-actions.patient-card .patient-appointment-time-label {
  color: rgba(239, 246, 255, 0.98);
}

:root[data-theme-mode="light"] .detail-quick-actions.patient-card .patient-appointment-time-suffix {
  color: rgba(239, 246, 255, 0.88);
}

.patient-appointment-modal[hidden] {
  display: none !important;
}

.patient-appointment-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.patient-appointment-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.56);
  backdrop-filter: blur(6px);
}

.patient-appointment-modal__dialog {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  margin: 10vh auto 0;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(8, 13, 24, 0.98));
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.34);
}

.patient-appointment-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.patient-appointment-modal__title-group {
  display: grid;
  gap: 4px;
}

.patient-appointment-modal__heading-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.patient-appointment-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.9);
}

.patient-appointment-modal__eyebrow-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--primary-color);
}

.patient-appointment-modal__eyebrow-icon svg {
  width: 16px;
  height: 16px;
}

.patient-appointment-modal__header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #f8fafc;
}

.patient-appointment-modal__close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--primary-color) !important;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.patient-appointment-modal__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.patient-appointment-modal__field {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: #cbd5e1;
}

.patient-appointment-modal__field-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.patient-appointment-modal__field-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--primary-color);
}

.patient-appointment-modal__field-icon svg {
  width: 16px;
  height: 16px;
}

.patient-appointment-modal__field input,
.patient-appointment-modal__field select {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  padding: 0 12px;
}

.patient-appointment-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.patient-appointment-modal__secondary,
.patient-appointment-modal__primary {
  min-height: 42px;
  border-radius: 12px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.patient-appointment-modal__secondary {
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.96), rgba(29, 78, 216, 0.96));
  color: #ffffff;
}

.patient-appointment-modal__primary {
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
  color: #ffffff;
}

.patient-appointment-modal__button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.patient-appointment-modal__button-icon svg {
  width: 20px;
  height: 20px;
}

body.patient-appointment-modal-open {
  overflow: hidden;
}

:root[data-theme-mode="light"] .patient-appointment-modal__dialog {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.99));
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

:root[data-theme-mode="light"] .patient-appointment-modal__header h3,
:root[data-theme-mode="light"] .patient-appointment-modal__field {
  color: var(--ink);
}

:root[data-theme-mode="light"] .patient-appointment-modal__eyebrow {
  color: #64748b;
}

:root[data-theme-mode="light"] .patient-appointment-modal__close {
  background: transparent !important;
  color: var(--primary-color) !important;
}

:root[data-theme-mode="light"] .patient-appointment-modal__field input,
:root[data-theme-mode="light"] .patient-appointment-modal__field select {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--ink);
}

@media (max-width: 640px) {
  .patient-appointment-modal__body {
    grid-template-columns: 1fr;
  }
}

:root[data-theme-mode="light"] .progress-panel-heading p {
  color: #475569;
}

:root[data-theme-mode="light"] .progress-panel-heading-kicker {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
}

:root[data-theme-mode="light"] .detail-panel input[type="text"],
:root[data-theme-mode="light"] .detail-panel input[type="email"],
:root[data-theme-mode="light"] .detail-panel input[type="date"],
:root[data-theme-mode="light"] .detail-panel input[type="time"],
:root[data-theme-mode="light"] .detail-panel select,
:root[data-theme-mode="light"] .detail-panel textarea {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(148, 163, 184, 0.18);
}

:root[data-theme-mode="light"] .detail-panel input[type="text"]:focus,
:root[data-theme-mode="light"] .detail-panel input[type="email"]:focus,
:root[data-theme-mode="light"] .detail-panel input[type="date"]:focus,
:root[data-theme-mode="light"] .detail-panel input[type="time"]:focus,
:root[data-theme-mode="light"] .detail-panel select:focus,
:root[data-theme-mode="light"] .detail-panel textarea:focus {
  background: #fff;
}

.progress-panel-heading {
  display: grid;
  gap: 5px;
  padding: 2px 2px 0;
}

.progress-panel-heading-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: rgba(59, 130, 246, 0.12);
  color: #dbeafe;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.progress-panel-heading h3 {
  margin: 0;
  font-size: 1.16rem;
  font-weight: 800;
  line-height: 1.12;
  color: var(--ink);
}

.progress-panel-heading p {
  margin: 0;
  max-width: 46ch;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.76);
}

.patient-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.74fr) minmax(280px, 1.02fr) minmax(320px, 1.34fr);
  gap: 20px;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
}

.workspace-card {
  display: grid;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
  min-height: 100%;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(17, 24, 39, 0.86));
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.workspace-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workspace-card-header h3 {
  margin: 0;
  font-size: 1rem;
}

.workspace-meta {
  color: var(--muted);
  font-size: 12px;
}

.profile-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-field {
  display: grid;
  gap: 8px;
}

.profile-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.patient-profile-card input,
.workspace-chat-input input {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(2, 6, 23, 0.76);
  color: var(--ink);
}

.patient-profile-card input[readonly] {
  cursor: default;
}

.profile-stack {
  display: grid;
  gap: 10px;
}

.profile-inline-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-inline-stat span {
  font-size: 12px;
  color: var(--muted);
}

.profile-inline-stat strong {
  font-size: 13px;
  color: var(--ink);
}

.patient-action-btn--block {
  width: 100%;
  justify-content: center;
}

.conversation-item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.conversation-item-head strong {
  font-size: 13px;
  color: var(--ink);
}

.conversation-item-head span,
.conversation-item p,
.conversation-empty {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.workspace-journey {
  gap: 12px;
}

.clinical-panel {
  display: grid;
  gap: 14px;
}

.clinical-tabs-card {
  gap: 16px;
  padding: 14px;
}

.workspace-subcard {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
}

.workspace-subcard-highlight {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(15, 23, 42, 0.92));
}

.workspace-subcard-header {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workspace-subcard-header h4 {
  margin: 0;
  font-size: 0.98rem;
}

.workspace-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(62, 166, 255, 0.18);
  color: #93c5fd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.workspace-badge-warning {
  background: rgba(250, 204, 21, 0.16);
  color: #facc15;
}

.workspace-badge-success {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

.workspace-badge-muted {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.clinical-agenda {
  display: grid;
  gap: 10px;
}

.clinical-agenda-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.clinical-agenda-row span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.clinical-agenda-row strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
}

.clinical-tabbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.clinical-tab-button {
  min-height: 44px;
  justify-content: center;
  border-radius: 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.clinical-tab-button.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(29, 78, 216, 0.9));
  border-color: rgba(147, 197, 253, 0.28);
  color: #eff6ff !important;
  box-shadow: 0 12px 26px rgba(29, 78, 216, 0.28);
}

.clinical-tab-panels {
  display: grid;
  min-height: 258px;
}

.clinical-tab-panel {
  display: none;
  gap: 14px;
  padding: 2px;
}

.clinical-tab-panel.active {
  display: grid;
}

.clinical-tab-panel[hidden] {
  display: none !important;
}

.clinical-panel-meta {
  display: flex;
  justify-content: flex-end;
}

.clinical-process-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.clinical-process-grid > div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.clinical-process-grid label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.clinical-process-grid b {
  font-size: 14px;
  color: var(--ink);
}

.appointment {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.clinical-calendar-card {
  display: grid;
  gap: 14px;
}

.clinical-calendar-meta {
  justify-content: flex-start;
}

.date {
  display: flex;
  align-items: flex-end;
  align-content: center;
  font-weight: 800;
  line-height: 1;
}

.date span {
  display: inline-block;
}

.appointment-main-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.appointment-month {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.appointment-day {
  font-size: 42px;
  font-weight: 800;
  color: var(--ink);
  line-height: 0.9;
}

.appointment-time {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  display: inline-flex !important;
  align-items: flex-start;
  gap: 0;
  margin-left: 8px;
}

.appointment-time-main {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

#clinical-appointment-time {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.follow {
  min-width: 120px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.follow label,
.product-status label,
.summary label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.follow b,
.product-status b {
  font-size: 14px;
  color: var(--ink);
}

.clinical-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.product-status,
.summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-status > div,
.summary > div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.next-step {
  margin-top: 8px;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.14);
  color: #fde68a;
  font-size: 13px;
  font-weight: 600;
}

.summary p {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.workspace-chat-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: clamp(520px, calc(100vh - 240px), 760px);
  min-height: 0;
  overflow: hidden;
}

.workspace-chat-card .chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.workspace-chat-card .chat-header strong,
.workspace-chat-card .chat-header span {
  display: block;
}

.workspace-chat-card .chat-header strong {
  font-size: 15px;
}

.workspace-chat-card .chat-header span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.chat-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.16);
}

.whatsapp-layout .chat-contact {
  gap: 8px;
  padding: 7px 9px;
  border-radius: 12px;
  align-items: center;
}

.whatsapp-layout .chat-header {
  display: flex;
  margin-bottom: 0;
}

.whatsapp-layout .chat-header p {
  margin: 3px 0 0;
}

.whatsapp-layout .chat-contact .chat-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 10px;
}

.whatsapp-layout .chat-contact .chat-avatar-initials {
  font-size: 12px;
}

.whatsapp-layout .chat-name {
  gap: 5px;
  font-size: 13px;
  line-height: 1.05;
  min-height: 30px;
  align-items: center;
}

.whatsapp-layout .chat-contact .whatsapp-badge {
  width: 16px;
  height: 16px;
}

.whatsapp-layout .chat-contact .whatsapp-badge::before {
  width: 10px;
  height: 10px;
}


.workspace-chat-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 6px 4px 0;
}

.workspace-chat-body .msg {
  max-width: 82%;
  margin-bottom: 0;
  padding: 12px 14px;
  border-radius: 16px;
}

.workspace-chat-body .msg.user {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
}

.workspace-chat-body .msg.staff {
  align-self: flex-end;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #eff6ff;
}

.msg-meta {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.75;
}

.msg-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.5;
}

.workspace-chat-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-top: 6px;
  padding-bottom: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  align-items: center;
  gap: 10px;
  margin-top: auto;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.94) 24%);
}

.workspace-chat-input .chat-input {
  min-width: 0;
}

.workspace-chat-input .chat-send {
  min-width: 112px;
  white-space: nowrap;
}

.workspace-chat-input .chat-send:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.workspace-secondary {
  display: grid;
  gap: 16px;
}

.workspace-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.workspace-tab-panels {
  display: grid;
}

.workspace-tab-panel {
  display: none;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.72);
}

.workspace-tab-panel.active {
  display: block;
}

.secondary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1180px) {
  .patient-grid {
    grid-template-columns: 1fr;
  }

  .workspace-chat-card {
    height: 520px;
  }
}

@media (max-width: 760px) {
  .patient-workspace {
    padding: 18px;
  }

  .patient-header {
    padding: 18px;
  }

  .patient-intake-meta {
    grid-template-columns: 1fr;
  }

  .patient-header,
  .workspace-card-header,
  .conversation-item-head {
    display: grid;
    justify-content: stretch;
  }

  .patient-header-actions,
  .profile-row,
  .secondary-grid,
  .clinical-process-grid,
  .product-status,
  .summary {
    grid-template-columns: 1fr;
  }

  .clinical-tabbar {
    grid-template-columns: 1fr;
  }

  .patient-header-actions {
    display: grid;
  }

  .detail-tab-panel {
    padding: 14px;
  }

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

  .workspace-chat-body .msg {
    max-width: 100%;
  }
}

/* ===== Lead Detail Medical Hierarchy Refresh ===== */

.lead-detail-progress-panel {
  gap: 16px;
}

.lead-detail-progress-panel .progress-card--actionable {
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.94), rgba(10, 16, 30, 0.96)) !important;
  box-shadow: 0 16px 38px rgba(2, 6, 23, 0.28) !important;
}

.lead-detail-progress-panel .progress-title {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.lead-detail-progress-panel .workspace-card-header h4,
.lead-detail-progress-panel .workspace-subcard-header h4 {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 700;
  line-height: 1.2;
}

.lead-detail-progress-panel .workspace-badge {
  padding: 6px 11px;
  font-size: 10px;
  letter-spacing: 0.07em;
  font-weight: 800;
}

.lead-detail-progress-panel .journey-process-card {
  border-color: rgba(59, 130, 246, 0.28) !important;
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 40%),
    linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(10, 16, 30, 0.96)),
    linear-gradient(165deg, rgba(15, 23, 42, 0.94), rgba(10, 16, 30, 0.96)) !important;
}

.lead-detail-progress-panel .journey-process-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.lead-detail-progress-panel .journey-process-toggle-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.lead-detail-progress-panel .journey-process-toggle-copy p {
  margin: 0;
  max-width: 52ch;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.82);
}

.lead-detail-progress-panel .journey-process-toggle-meta {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.lead-detail-progress-panel .journey-process-toggle-count {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: rgba(2, 6, 23, 0.42);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #dbeafe;
}

.lead-detail-progress-panel .journey-process-toggle-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: rgba(2, 6, 23, 0.42);
  display: inline-grid;
  place-items: center;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.lead-detail-progress-panel .journey-process-toggle-icon::before {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(219, 234, 254, 0.92);
  border-bottom: 2px solid rgba(219, 234, 254, 0.92);
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 0.18s ease;
}

.lead-detail-progress-panel .journey-process-card.is-collapsed .journey-process-toggle-icon::before {
  transform: rotate(-45deg) translate(-1px, 1px);
}

.lead-detail-progress-panel .journey-process-card.is-collapsed .journey-process-toggle-icon {
  background: rgba(15, 23, 42, 0.62);
  border-color: rgba(148, 163, 184, 0.22);
}

.lead-detail-progress-panel .journey-process-accordion {
  display: grid;
  gap: 14px;
  margin-top: 2px;
}

.lead-detail-progress-panel .journey-process-shell {
  display: grid;
  gap: 14px;
}

.lead-detail-progress-panel .journey-process-header-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.lead-detail-progress-panel .journey-process-head {
  display: grid;
  gap: 7px;
}

.lead-detail-progress-panel .journey-process-head p {
  margin: 0;
  max-width: 48ch;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.82);
}

.lead-detail-progress-panel .journey-process-heading-row {
  justify-content: space-between;
}

.lead-detail-progress-panel .journey-process-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.lead-detail-progress-panel .journey-process-stat {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(96, 165, 250, 0.16);
  background: rgba(2, 6, 23, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.lead-detail-progress-panel .journey-process-stat-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.88);
}

.lead-detail-progress-panel .journey-process-stat strong {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  color: #ffffff;
}

.lead-detail-progress-panel .journey-process-progressbar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.lead-detail-progress-panel .journey-process-progressbar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.34);
  transition: width 0.24s ease;
}

.lead-detail-progress-panel .journey-process-card .medical-progress-step-list {
  counter-reset: medical-step;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 4px;
  border-top: 0;
  background: transparent;
  padding: 0;
}

.lead-detail-progress-panel .journey-process-card .medical-progress-step-list::before {
  display: none;
}

.lead-detail-progress-panel .journey-process-card .medical-progress-step-list .progress-step-item {
  counter-increment: medical-step;
  min-height: 60px;
  padding: 14px 16px 14px 56px;
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.34);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.16);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.lead-detail-progress-panel .journey-process-card .medical-progress-step-list .progress-step-item:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.28);
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.24);
}

.lead-detail-progress-panel .journey-process-card .medical-progress-step-list .progress-step-item::before {
  content: counter(medical-step);
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.38);
  background: rgba(15, 23, 42, 0.82);
  color: rgba(226, 232, 240, 0.88);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.lead-detail-progress-panel .journey-process-card .medical-progress-step-list .progress-step-item.active {
  border-color: rgba(59, 130, 246, 0.48);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(30, 64, 175, 0.14));
  color: #ffffff;
  box-shadow: 0 18px 34px rgba(30, 64, 175, 0.22);
}

.lead-detail-progress-panel .journey-process-card .medical-progress-step-list .progress-step-item.active::before {
  content: "✓";
  border-color: rgba(96, 165, 250, 0.66);
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.38);
}

.lead-detail-progress-panel .journey-process-card .medical-progress-step-list .progress-step-item.active::after {
  display: none;
}

.lead-detail-progress-panel .journey-card-panel {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(8, 13, 24, 0.96)),
    linear-gradient(165deg, rgba(15, 23, 42, 0.94), rgba(8, 13, 24, 0.98)) !important;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.18) !important;
}

.lead-detail-progress-panel .journey-card-shell {
  display: grid;
  gap: 18px;
}

.lead-detail-progress-panel .journey-card-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.lead-detail-progress-panel .journey-card-copy {
  display: grid;
  gap: 8px;
}

.lead-detail-progress-panel .journey-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.18);
  color: #dbeafe;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lead-detail-progress-panel .journey-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.lead-detail-progress-panel .journey-heading-row h4 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.lead-detail-progress-panel .journey-card-copy p {
  margin: 0;
  max-width: 46ch;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.74);
}

.lead-detail-progress-panel .journey-mini-stat {
  display: grid;
  gap: 5px;
  min-width: 168px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.lead-detail-progress-panel .journey-mini-stat-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.88);
}

.lead-detail-progress-panel .journey-mini-stat strong {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
}

.lead-detail-progress-panel .journey-timeline {
  gap: 14px;
  margin-top: 0;
  padding-top: 4px;
}

.lead-detail-progress-panel .journey-timeline::before {
  display: none;
}

.lead-detail-progress-panel .journey-tabs-shell {
  display: grid;
  gap: 14px;
}

.lead-detail-progress-panel .journey-tab-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px;
  gap: 10px;
}

.lead-detail-progress-panel .journey-tab-btn {
  appearance: none;
  display: grid;
  gap: 7px;
  text-align: left;
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.lead-detail-progress-panel .journey-tab-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.lead-detail-progress-panel .journey-tab-btn.active {
  border-color: rgba(59, 130, 246, 0.18);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(37, 99, 235, 0.2));
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.12);
}

.lead-detail-progress-panel .journey-tab-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.lead-detail-progress-panel .journey-tab-step {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.88);
}

.lead-detail-progress-panel .journey-tab-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  color: #ffffff;
}

.lead-detail-progress-panel .journey-tab-state {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-detail-progress-panel .journey-tab-state.is-complete {
  background: rgba(34, 197, 94, 0.14);
  color: #7ef0a5;
}

.lead-detail-progress-panel .journey-tab-state.is-pending {
  background: rgba(245, 158, 11, 0.14);
  color: #f6c66a;
}

.lead-detail-progress-panel .journey-tab-state.is-issue {
  background: rgba(239, 68, 68, 0.14);
  color: #fda4a4;
}

.lead-detail-progress-panel .journey-tab-panels {
  display: grid;
}

.lead-detail-progress-panel .journey-tab-panel {
  display: none;
}

.lead-detail-progress-panel .journey-tab-panel.active {
  display: block;
}

.lead-detail-progress-panel .journey-item {
  grid-template-columns: 32px 1fr;
  gap: 14px;
  padding: 14px 16px 14px 14px;
  border-radius: 16px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.14);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.lead-detail-progress-panel .journey-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 30px rgba(2, 6, 23, 0.2);
}

.lead-detail-progress-panel .journey-marker {
  width: 16px;
  height: 16px;
  margin-top: 5px;
  margin-left: 8px;
}

.lead-detail-progress-panel .journey-copy {
  gap: 8px;
}

.lead-detail-progress-panel .journey-step-number {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(255, 255, 255, 0.08);
}

.lead-detail-progress-panel .journey-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #ffffff;
}

.lead-detail-progress-panel .journey-note {
  margin-top: 0;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.74);
}

.lead-detail-progress-panel .clinical-panel {
  gap: 15px;
}

.lead-detail-progress-panel .clinical-panel-heading {
  display: grid;
  gap: 6px;
  padding: 4px 2px 2px;
}

.lead-detail-progress-panel .clinical-panel-heading h4 {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.lead-detail-progress-panel .clinical-panel-heading p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.lead-detail-progress-panel .agenda-card-panel {
  border-color: rgba(59, 130, 246, 0.28);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.16), rgba(10, 16, 30, 0.96)),
    linear-gradient(165deg, rgba(15, 23, 42, 0.94), rgba(10, 16, 30, 0.96));
}

.lead-detail-progress-panel .treatment-card-panel {
  border-color: rgba(34, 197, 94, 0.3);
  background:
    linear-gradient(180deg, rgba(34, 197, 94, 0.12), rgba(10, 16, 30, 0.96)),
    linear-gradient(165deg, rgba(15, 23, 42, 0.94), rgba(10, 16, 30, 0.96));
}

.lead-detail-progress-panel .summary-card-panel {
  border-color: rgba(250, 204, 21, 0.3);
  background:
    linear-gradient(180deg, rgba(250, 204, 21, 0.11), rgba(10, 16, 30, 0.96)),
    linear-gradient(165deg, rgba(15, 23, 42, 0.94), rgba(10, 16, 30, 0.96));
}

.lead-detail-progress-panel .agenda-card-panel .calendar-head strong {
  font-size: 15px;
}

.lead-detail-progress-panel .agenda-card-panel .calendar-head span {
  font-size: 13px;
  color: rgba(226, 232, 240, 0.88);
}

.lead-detail-progress-panel .clinical-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.lead-detail-progress-panel .treatment-card-panel .clinical-actions,
.lead-detail-progress-panel .summary-card-panel .clinical-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lead-detail-progress-panel .progress-action-btn {
  min-height: 38px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.lead-detail-progress-panel .product-status,
.lead-detail-progress-panel .summary {
  gap: 10px;
}

.lead-detail-progress-panel .product-status > div,
.lead-detail-progress-panel .summary > div {
  padding: 12px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.38);
  border-color: rgba(148, 163, 184, 0.24);
}

.lead-detail-progress-panel .summary label,
.lead-detail-progress-panel .product-status label,
.lead-detail-progress-panel .follow label {
  margin-bottom: 5px;
  font-size: 10px;
  letter-spacing: 0.09em;
}

.lead-detail-progress-panel .summary p {
  font-size: 13px;
  line-height: 1.45;
}

.lead-detail-progress-panel #medical-diagnosis-summary,
.lead-detail-progress-panel #medical-treatment-summary {
  font-weight: 600;
  color: rgba(241, 245, 249, 0.98);
}

.lead-detail-progress-panel .next-step {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1380px) {
  .lead-detail-progress-panel .journey-process-toggle {
    grid-template-columns: 1fr;
  }

  .lead-detail-progress-panel .journey-process-toggle-meta {
    justify-items: start;
    grid-template-columns: auto auto;
    align-items: center;
  }

  .lead-detail-progress-panel .journey-process-header-row {
    grid-template-columns: 1fr;
  }

  .lead-detail-progress-panel .clinical-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .lead-detail-progress-panel .clinical-actions,
  .lead-detail-progress-panel .treatment-card-panel .clinical-actions,
  .lead-detail-progress-panel .summary-card-panel .clinical-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .lead-detail-progress-panel .progress-card--actionable {
    padding: 15px;
    border-radius: 14px;
  }

  .lead-detail-progress-panel .journey-process-stats {
    grid-template-columns: 1fr;
  }

  .lead-detail-progress-panel .journey-card-intro {
    grid-template-columns: 1fr;
  }

  .lead-detail-progress-panel .journey-mini-stat {
    min-width: 0;
  }

  .lead-detail-progress-panel .journey-tab-list {
    gap: 6px;
  }

  .lead-detail-progress-panel .journey-tab-btn {
    min-width: 150px;
    max-width: 190px;
  }
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .progress-card--actionable {
  background: linear-gradient(180deg, #ffffff, #ffffff) !important;
  border-color: rgba(148, 163, 184, 0.34) !important;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08) !important;
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-process-card .medical-progress-step-list .progress-step-item {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-process-card .medical-progress-step-list .progress-step-item::before {
  background: #ffffff;
  color: #334155;
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-process-head p {
  color: #475569;
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-process-toggle-copy p {
  color: #475569;
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-process-stat {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-process-toggle-count,
:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-process-toggle-icon {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(148, 163, 184, 0.22);
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-process-toggle-count {
  color: #1d4ed8;
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-process-toggle-icon::before {
  border-right-color: #1e293b;
  border-bottom-color: #1e293b;
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-process-stat strong {
  color: var(--ink);
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-process-progressbar {
  background: rgba(226, 232, 240, 0.9);
  border-color: rgba(148, 163, 184, 0.18);
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-note,
:root[data-theme-mode="light"] .lead-detail-progress-panel #medical-diagnosis-summary,
:root[data-theme-mode="light"] .lead-detail-progress-panel #medical-treatment-summary {
  color: var(--ink);
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-kicker {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-heading-row h4,
:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-mini-stat strong,
:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-title,
:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-tab-title {
  color: var(--ink);
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-card-copy p {
  color: #475569;
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-tab-btn,
:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-mini-stat,
:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-item {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-tab-btn.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.14));
  border-color: rgba(59, 130, 246, 0.18);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-step-number {
  background: rgba(241, 245, 249, 0.95);
  color: #334155;
}

:root[data-theme-mode="light"] .lead-detail-progress-panel .journey-tab-step {
  color: #64748b;
}

/* ===== Sport Health Form ===== */

.sport-health-form-page {
  --sport-health-form-bg: #eef7f5;
  --sport-health-form-panel: #ffffff;
  --sport-health-form-ink: #13251f;
  --sport-health-form-muted: #587067;
  --sport-health-form-stroke: #d6e6df;
  --sport-health-form-accent: #0f766e;
  --sport-health-form-accent-2: #22c55e;
  --sport-health-form-soft: rgba(15, 118, 110, 0.08);
  --sport-health-form-danger: #b42318;
  --sport-health-form-danger-bg: #fff1ef;
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--sport-health-form-ink);
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.16), transparent 36%),
    radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.18), transparent 34%),
    var(--sport-health-form-bg);
}

.sport-health-form-page *,
.sport-health-form-page *::before,
.sport-health-form-page *::after {
  box-sizing: border-box;
}

.sport-health-form__wrap {
  width: min(980px, 94vw);
  margin: 28px auto 36px;
  display: grid;
  gap: 18px;
}

.sport-health-form__hero,
.sport-health-form__card {
  border: 1px solid var(--sport-health-form-stroke);
  border-radius: 24px;
  background: var(--sport-health-form-panel);
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.08);
}

.sport-health-form__hero {
  padding: 24px;
  display: grid;
  gap: 14px;
}

.sport-health-form__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.sport-health-form__brand img {
  max-width: 160px;
  max-height: 52px;
  object-fit: contain;
}

.sport-health-form__eyebrow {
  width: fit-content;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--sport-health-form-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sport-health-form__title {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.04;
  color: var(--sport-health-form-ink);
}

.sport-health-form__sub {
  margin: 0;
  max-width: 70ch;
  color: var(--sport-health-form-muted);
}

.sport-health-form__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sport-health-form__meta-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--sport-health-form-soft);
  color: var(--sport-health-form-accent);
  font-size: 12px;
  font-weight: 700;
}

.sport-health-form__card {
  padding: 24px;
}

.sport-health-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.sport-health-form__field {
  display: grid;
  gap: 7px;
}

.sport-health-form__field--full {
  grid-column: 1 / -1;
}

.sport-health-form__field label {
  font-size: 12px;
  font-weight: 700;
  color: #476056;
}

.sport-health-form__input,
.sport-health-form__textarea,
.sport-health-form__select {
  width: 100%;
  border: 1px solid var(--sport-health-form-stroke);
  border-radius: 12px;
  background: #fcfffe;
  color: var(--sport-health-form-ink);
  font-size: 15px;
  padding: 11px 12px;
  font-family: "Manrope", sans-serif;
}

.sport-health-form__textarea {
  min-height: 110px;
  resize: vertical;
}

.sport-health-form__input:focus,
.sport-health-form__textarea:focus,
.sport-health-form__select:focus {
  outline: none;
  border-color: var(--sport-health-form-accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.sport-health-form__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
  color: var(--sport-health-form-muted);
  font-size: 13px;
}

.sport-health-form__actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.sport-health-form__btn {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.sport-health-form__btn--primary {
  background: linear-gradient(180deg, var(--sport-health-form-accent-2), var(--sport-health-form-accent));
  color: #fff;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.22);
}

.sport-health-form__btn-link {
  color: var(--sport-health-form-accent);
  text-decoration: none;
  font-weight: 700;
}

.sport-health-form__error-box {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--sport-health-form-danger-bg);
  color: var(--sport-health-form-danger);
  border: 1px solid rgba(180, 35, 24, 0.15);
}

.sport-health-form__field-error {
  color: var(--sport-health-form-danger);
  font-size: 12px;
}

.sport-health-form__field-error--consent {
  margin-top: 8px;
}

.sport-health-form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

@media (max-width: 760px) {
  .sport-health-form__grid {
    grid-template-columns: 1fr;
  }

  .sport-health-form__card,
  .sport-health-form__hero {
    padding: 18px;
  }
}

/* ===== LeadsFlows New Design Baseline ===== */
:root[data-theme-mode="light"] body {
  background: linear-gradient(180deg, #ffffff 0%, #eef4fb 100%);
}

.shell {
  gap: 24px;
}

.main {
  min-width: 0;
}

.sidebar,
.topbar,
.panel,
.progress-card,
.chat-panel,
.user-chip,
.settings-card,
.page-hero-card,
.popup-card,
.metric-card,
.analytics-metric-card,
.stat-card,
.table-modern,
.integration-section-card,
.integration-sidebar-card,
.pipeline-lane,
.search-field,
.detail-tabs,
.tab-bar,
.settings-main .tab-bar {
  border-radius: 20px;
}

.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.topbar,
.panel,
.progress-card,
.chat-panel,
.user-chip,
.settings-card,
.page-hero-card,
.popup-card,
.metric-card,
.analytics-metric-card,
.stat-card,
.table-modern,
.integration-section-card,
.integration-sidebar-card,
.pipeline-lane {
  background: var(--surface) !important;
  border: 1px solid var(--stroke) !important;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06) !important;
}

.topbar {
  min-height: 76px;
  align-items: center;
}

.title,
.panel-header h3,
.page-hero-title,
.pipeline-lane-title strong,
.team-value,
.lead-name,
.settings-value strong,
.metric-value,
.analytics-metric-value {
  letter-spacing: 0;
  color: var(--ink);
}

.subtitle,
.muted,
.panel-header p,
.page-hero-copy,
.team-field,
.lead-meta,
.settings-value span {
  color: var(--muted) !important;
}

.search-field,
.lead-input,
.search-input,
.chat-input,
.lead-form input,
.lead-form select,
.lead-form textarea,
.detail-panel input[type="text"],
.detail-panel input[type="email"],
.detail-panel input[type="date"],
.detail-panel input[type="time"],
.detail-panel select,
.detail-panel textarea {
  min-height: 44px;
  border-radius: 12px !important;
  background: var(--surface-elevated) !important;
  border: 1px solid var(--stroke) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

.chip,
.icon-btn,
.hero-action-button,
.btn-secondary,
.integration-card-button,
.integration-quick-button,
.company-action-btn,
.control-action,
.tab-button,
.detail-tabs .tab-button {
  min-height: 40px;
  border-radius: 12px !important;
  box-shadow: none !important;
}

.action-chip,
.btn-primary,
.hero-action-button.primary,
.integration-card-button.primary,
.integration-quick-button.primary,
.company-action-btn.primary,
.control-action.primary,
.lead-form button[type="submit"] {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  border-color: rgba(37, 99, 235, 0.18) !important;
}

.nav-dot,
.nav-dot-sub {
  border-radius: 12px;
}

.logo-link.has-image {
  width: 42px !important;
  height: 42px !important;
  border-radius: 14px !important;
  padding: 3px !important;
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06) !important;
}

.logo-link.has-image .logo-mark {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 12px !important;
}

.logo-link.has-fallback {
  width: 42px !important;
  height: 42px !important;
  border-radius: 14px !important;
  padding: 0 !important;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(124, 58, 237, 0.14)) !important;
  border-color: rgba(37, 99, 235, 0.16) !important;
  color: var(--ink) !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06) !important;
}

.logo-link.has-fallback .logo-fallback {
  display: flex !important;
}

.logo-link--company.has-image {
  width: 64px !important;
  height: 44px !important;
  border-radius: 16px !important;
  padding: 4px 6px !important;
  background: #ffffff !important;
}

.logo-link--company.has-image .logo-mark {
  padding: 0 !important;
  border-radius: 10px !important;
  object-fit: contain !important;
}

.nav-dot.active,
.nav-dot:hover:not(.active) {
  background: rgba(37, 99, 235, 0.08) !important;
  border-color: rgba(37, 99, 235, 0.12) !important;
  color: var(--ink) !important;
}

.data-table,
.lead-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.data-table tbody tr,
.lead-table tbody tr,
.pipeline-ticket,
.team-card {
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.data-table tbody tr:hover,
.lead-table tbody tr:hover,
.pipeline-ticket:hover,
.team-card:hover {
  transform: translateY(-1px);
}

@media (max-width: 980px) {
  .shell {
    gap: 16px;
  }

  .sidebar {
    position: relative;
    top: auto;
    max-height: none;
  }
}

/* ===== LeadsFlows App-Wide UI Unification ===== */
:root[data-theme-mode="light"] body {
  background:
    linear-gradient(180deg, #ffffff 0%, #eef4fb 100%) !important;
}

body::before,
body::after {
  display: none !important;
}

.shell {
  grid-template-columns: 260px minmax(0, 1fr) !important;
  gap: 24px !important;
  padding: 18px 24px 24px !important;
}

.main,
.content-grid,
.dashboard-page-grid,
.lead-layout,
.settings-main,
.campaigns-main,
.social-main,
.whatsapp-main {
  min-width: 0 !important;
}

.sidebar {
  width: 260px !important;
  min-width: 260px !important;
  height: calc(100vh - 36px) !important;
  max-height: calc(100vh - 36px) !important;
  padding: 18px 12px !important;
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 22px !important;
  color: var(--ink) !important;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08) !important;
  font-family: "Roboto", "Segoe UI", Arial, sans-serif !important;
}

.sidebar-brand {
  min-height: 54px !important;
  padding: 0 6px 14px !important;
  gap: 12px !important;
  border-bottom: 0 !important;
}

.sidebar-brand-copy strong {
  color: var(--ink) !important;
  font-size: 18px !important;
  font-family: "Roboto", "Segoe UI", Arial, sans-serif !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
}

.sidebar-brand-copy span,
.sidebar-section-title,
.sidebar-industry {
  color: #64748b !important;
  font-family: "Roboto", "Segoe UI", Arial, sans-serif !important;
}

.sidebar-section-title {
  padding: 12px 10px 4px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0.04em !important;
}

.sidebar-nav-shell,
.nav-group,
.nav-group-children {
  gap: 4px !important;
}

.nav-dot,
.nav-dot-sub {
  min-height: 44px !important;
  border-radius: 12px !important;
  padding: 0 12px !important;
  background: transparent !important;
  border-color: transparent !important;
  color: #475569 !important;
  box-shadow: none !important;
  font-family: "Roboto", "Segoe UI", Arial, sans-serif !important;
  font-weight: 500 !important;
  letter-spacing: 0.01em !important;
}

.nav-dot-sub {
  min-height: 40px !important;
  padding-left: 32px !important;
}

.nav-dot .nav-icon,
.nav-dot i,
.nav-dot svg {
  color: currentColor !important;
}

.nav-dot.active,
.nav-dot.is-active,
.nav-dot:hover:not(.active) {
  background: #eef4ff !important;
  border-color: transparent !important;
  color: #2563eb !important;
}

.nav-dot.active .nav-label,
.nav-dot.is-active .nav-label {
  color: #2563eb !important;
  font-weight: 700 !important;
}

.topbar {
  min-height: 84px !important;
  width: 100% !important;
  margin-bottom: 18px !important;
  padding: 18px 20px !important;
  align-items: center !important;
  gap: 18px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 22px !important;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06) !important;
}

.title,
.dashboard-welcome-title,
.page-hero-title,
.panel-header h3,
.clients-panel-title,
.settings-section-title,
.integration-section-title h4 {
  color: var(--ink) !important;
  letter-spacing: -0.02em !important;
}

.subtitle,
.muted,
.page-hero-copy,
.panel-header p,
.clients-panel-subtitle,
.settings-section-copy,
.integration-section-title p {
  color: #64748b !important;
}

.panel,
.progress-card,
.chat-panel,
.settings-card,
.page-hero-card,
.metric-card,
.analytics-metric-card,
.stat-card,
.table-modern,
.team-card,
.integration-section-card,
.integration-sidebar-card,
.integration-saas-card,
.pipeline-lane,
.control-sidebar,
.popup-card,
.lead-popup-card,
.clients-panel {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 22px !important;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06) !important;
  color: var(--ink) !important;
}

.user-chip,
.search-field,
.chip,
.icon-btn,
.user-chip-icon-btn,
.btn-secondary,
.hero-action-button,
.integration-card-button,
.integration-quick-button,
.company-action-btn,
.control-action,
.tab-button,
.settings-main .tab-button,
.detail-tabs .tab-button {
  border-radius: 14px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: #ffffff !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

.action-chip,
.btn-primary,
.hero-action-button.primary,
.integration-card-button.primary,
.integration-quick-button.primary,
.company-action-btn.primary,
.control-action.primary,
.lead-form button[type="submit"] {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-color: rgba(37, 99, 235, 0.18) !important;
  color: #ffffff !important;
}

.search-input,
.lead-input,
.chat-input,
.lead-form input,
.lead-form select,
.lead-form textarea,
.settings-value input,
.settings-value select {
  min-height: 44px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  background: #ffffff !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

.search-input:focus,
.lead-input:focus,
.chat-input:focus {
  outline: none !important;
  border-color: rgba(37, 99, 235, 0.42) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10) !important;
}

.data-table,
.lead-table {
  color: var(--ink) !important;
}

.data-table thead th,
.lead-table thead th,
.team-label {
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
}

.data-table tbody tr,
.lead-table tbody tr {
  background: #ffffff !important;
}

.clients-table-scroll,
.table-wrap,
.dashboard-global-table-wrap {
  border-radius: 18px !important;
}

.lead-popup {
  z-index: 9999 !important;
}

.lead-popup-card {
  max-width: min(720px, calc(100vw - 32px)) !important;
}

/* Clients page: flat settings-style surface, fewer nested white layers. */
.clients-topbar-flat.app-topbar,
:root[data-theme-mode="light"] .clients-topbar-flat.app-topbar {
  padding: 0 0 16px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.clients-topbar-flat.app-topbar:hover {
  border-color: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.clients-page-surface {
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.clients-page-surface > .panel-header {
  margin-bottom: 18px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.clients-page-surface .clients-panel-title {
  color: #0f172a;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.clients-page-surface .clients-panel-actions {
  gap: 12px;
}

.clients-page-surface .chip {
  min-height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.68);
  color: #475569;
  box-shadow: none;
}

.clients-page-surface .clients-table-scroll {
  padding: 0 0 8px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.clients-page-surface .team-header {
  min-width: 1180px;
  margin-bottom: 10px;
  padding: 0 18px 10px !important;
  border: 0 !important;
  background: transparent !important;
}

.clients-page-surface .team-grid {
  gap: 10px !important;
  margin-top: 0 !important;
}

.clients-page-surface .team-card {
  min-width: 1180px;
  padding: 14px 18px !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.78) !important;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.055) !important;
}

.clients-page-surface .team-card:hover {
  border-color: rgba(37, 99, 235, 0.22) !important;
  background: #ffffff !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.075) !important;
}

.clients-page-surface .team-avatar {
  background: #eef5ff !important;
  color: #2563eb !important;
}

.clients-page-surface .record-action-trigger {
  background: rgba(248, 250, 252, 0.9) !important;
}

.clients-page-subtitle {
  margin-top: 6px !important;
}

.clients-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 16px;
  margin: 2px 0 20px;
}

.clients-kpi-card {
  min-height: 104px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.055);
}

.clients-kpi-card span {
  display: block;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.clients-kpi-card strong {
  display: block;
  margin-top: 3px;
  color: #0f172a;
  font-size: 27px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.clients-kpi-card small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.clients-kpi-icon {
  width: 52px;
  height: 52px;
  display: grid !important;
  place-items: center;
  border-radius: 50%;
}

.clients-kpi-icon svg {
  width: 27px;
  height: 27px;
}

.clients-kpi-card.is-purple .clients-kpi-icon { background: #ede9fe; color: #4f46e5; }
.clients-kpi-card.is-amber .clients-kpi-icon { background: #fef3c7; color: #f59e0b; }
.clients-kpi-card.is-green .clients-kpi-icon { background: #dcfce7; color: #16a34a; }
.clients-kpi-card.is-blue .clients-kpi-icon { background: #dbeafe; color: #2563eb; }

.clients-kpi-chart {
  width: 70px;
  height: 42px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, transparent 18%, rgba(79, 70, 229, 0.18) 18% 24%, transparent 24% 38%, rgba(79, 70, 229, 0.25) 38% 44%, transparent 44% 58%, rgba(79, 70, 229, 0.28) 58% 64%, transparent 64%),
    radial-gradient(circle at 80% 25%, rgba(79, 70, 229, 0.28), transparent 34%);
}

.clients-toolbar {
  align-items: center !important;
  gap: 16px !important;
}

.clients-toolbar-meta {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  color: #344767;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.clients-filter-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: #0f172a;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}

.clients-filter-button svg {
  width: 16px;
  height: 16px;
  color: #334155;
}

.clients-page-surface .clients-search-field {
  width: min(340px, 32vw) !important;
  min-width: 260px !important;
  max-width: 360px !important;
  height: 44px !important;
  gap: 10px !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.78) !important;
}

.clients-page-surface .clients-search-field input {
  width: 100% !important;
  opacity: 1 !important;
  transform: none !important;
}

.clients-page-surface .team-header,
.clients-page-surface .team-card {
  min-width: 1160px !important;
  grid-template-columns:
    34px
    minmax(250px, 1.45fr)
    minmax(128px, 0.7fr)
    minmax(150px, 0.88fr)
    minmax(140px, 0.8fr)
    minmax(190px, 1fr)
    minmax(220px, 1.1fr) !important;
}

.clients-page-surface .team-header {
  margin: 8px 0 0 !important;
  padding: 14px 14px !important;
  border-top: 1px solid rgba(148, 163, 184, 0.16) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
  border-radius: 0 !important;
  background: rgba(248, 250, 252, 0.52) !important;
}

.clients-page-surface .team-grid {
  gap: 0 !important;
  min-width: 1160px !important;
}

.clients-page-surface .team-card {
  padding: 22px 14px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.clients-page-surface .team-card:hover {
  border-color: rgba(148, 163, 184, 0.16) !important;
  background: rgba(255, 255, 255, 0.52) !important;
  box-shadow: none !important;
}

.client-check-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.client-check-cell input {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

.client-profile-cell {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.clients-page-surface .team-avatar {
  width: 50px !important;
  height: 50px !important;
  border-radius: 50% !important;
  font-weight: 900;
}

.clients-page-surface .team-avatar.avatar-tone-one { background: linear-gradient(135deg, #ddd6fe, #e0e7ff) !important; color: #4f46e5 !important; }
.clients-page-surface .team-avatar.avatar-tone-two { background: linear-gradient(135deg, #dbeafe, #e0f2fe) !important; color: #2563eb !important; }
.clients-page-surface .team-avatar.avatar-tone-three { background: linear-gradient(135deg, #dcfce7, #ccfbf1) !important; color: #15803d !important; }
.clients-page-surface .team-avatar.avatar-tone-four { background: linear-gradient(135deg, #fce7f3, #fae8ff) !important; color: #db2777 !important; }
.clients-page-surface .team-avatar.avatar-tone-five { background: linear-gradient(135deg, #ffedd5, #fef3c7) !important; color: #ea580c !important; }

.clients-page-surface .team-info {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.clients-page-surface .team-value {
  color: #0f172a !important;
  font-size: 15px;
  font-weight: 900;
}

.client-contact-line,
.client-subtle {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #475569;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-mini-channel {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-left: 6px;
  border-radius: 999px;
  color: #16a34a;
  font-size: 16px;
  line-height: 1;
}

.client-status-pill,
.client-priority-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 10px;
  background: #dcfce7;
  color: #15803d !important;
  font-size: 13px;
  font-weight: 900;
}

.client-contact-method {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
  font-weight: 850;
}

.client-contact-method svg {
  width: 18px;
  height: 18px;
  color: #16a34a;
}

.client-priority-pill {
  background: transparent;
  color: #2563eb !important;
  padding-left: 0;
}

.client-priority-pill svg {
  width: 18px;
  height: 18px;
}

.client-priority-pill.is-high {
  color: #16a34a !important;
}

.client-priority-pill.is-medium {
  color: #f59e0b !important;
}

.client-priority-pill.is-low {
  color: #64748b !important;
}

.clients-page-surface .team-actions {
  justify-content: flex-start;
  gap: 8px;
}

.client-action-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  text-decoration: none;
}

.client-action-icon svg {
  width: 18px;
  height: 18px;
}

.client-action-icon.is-whatsapp {
  background: #dcfce7;
  color: #16a34a;
}

.client-action-icon.is-sms {
  background: #ede9fe;
  color: #6d28d9;
}

.client-action-icon.is-calendar {
  background: #dbeafe;
  color: #2563eb;
}

.client-action-icon.is-email {
  background: #eff6ff;
  color: #0f62fe;
}

.client-hidden-field {
  display: none;
}

.clients-pagination-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 10px 0;
  color: #344767;
  font-size: 14px;
  font-weight: 750;
}

.clients-pagination {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.clients-pagination button {
  min-width: 38px;
  height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: #ffffff;
  color: #475569;
  font-weight: 850;
}

.clients-pagination button.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.nav-dot[data-nav-key] .nav-icon,
.nav-dot[data-nav-key] .nav-icon svg,
.nav-dot[data-nav-key] .nav-icon i {
  color: #2563eb !important;
}

.nav-dot[data-nav-key="team"] .nav-icon,
.nav-dot[data-nav-key="clients"] .nav-icon {
  color: #4f46e5 !important;
}

.nav-dot[data-nav-key="leads"] .nav-icon {
  color: #2563eb !important;
}

.nav-dot[data-nav-key="whatsapp"] .nav-icon {
  color: #16a34a !important;
}

.nav-dot[data-nav-key="dynamic-commercial_sales_followup"] .nav-icon {
  color: #16a34a !important;
}

.nav-dot[data-nav-key="settings"] .nav-icon {
  color: #0f62fe !important;
}

.nav-dot[data-nav-key="campaigns"] .nav-icon,
.nav-dot[data-nav-key="social_media"] .nav-icon {
  color: #f97316 !important;
}

.nav-dot[data-nav-key="documents"] .nav-icon {
  color: #7c3aed !important;
}

.nav-dot[data-nav-key="reports"] .nav-icon,
.nav-dot[data-nav-key="analytics"] .nav-icon {
  color: #0891b2 !important;
}

.sidebar-footer-actions {
  display: grid;
  gap: 4px;
  align-self: end;
  margin-top: 24px;
  padding: 10px 2px 2px;
}

.sidebar-footer-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
  box-shadow: none;
}

.sidebar-footer-link:hover {
  border-color: rgba(37, 99, 235, 0.14);
  background: rgba(37, 99, 235, 0.06);
  color: #2563eb;
}

.sidebar-footer-link.is-upgrade {
  background: transparent;
  color: #2563eb;
  box-shadow: none;
}

.sidebar-footer-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
}

.sidebar-footer-icon svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 1180px) {
  .clients-kpi-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 720px) {
  .clients-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* Plans page */
.plans-public-shell {
  min-height: 100vh;
  padding: 28px clamp(18px, 4vw, 64px) 64px;
  background:
    radial-gradient(circle at 18% 8%, rgba(37, 99, 235, 0.12), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(16, 185, 129, 0.10), transparent 28%),
    #f8fafc;
}

.plans-public-shell .plans-public-nav {
  max-width: 1180px;
  margin: 0 auto 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.plans-public-shell .plans-public-brand,
.plans-public-shell .plans-public-links {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.plans-public-shell .plans-public-brand {
  color: #0f172a;
  font-weight: 900;
  text-decoration: none;
}

.plans-public-shell .plans-public-brand span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
}

.plans-public-shell .plans-public-links a,
.plans-public-shell .plans-public-links button {
  border: 0;
  background: transparent;
  color: #334155;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.plans-hero {
  max-width: 880px;
  margin: 0 auto 34px;
  text-align: center;
}

.plans-kicker {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 8px 13px;
  border-radius: 999px;
  background: #e0ecff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.plans-hero h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.plans-hero p {
  max-width: 680px;
  margin: 18px auto 0;
  color: #475569;
  font-size: 17px;
  line-height: 1.6;
}

.plans-toggle {
  width: fit-content;
  margin: 26px auto 0;
  display: inline-flex;
  padding: 5px;
  border-radius: 14px;
  background: #ecebe8;
}

.plans-toggle button {
  min-width: 142px;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #6b7280;
  font-weight: 900;
}

.plans-toggle button.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.1);
}

.plans-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 18px;
}

.plan-card {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 22px 42px rgba(15, 23, 42, 0.08);
}

.plan-card.is-featured {
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 26px 54px rgba(37, 99, 235, 0.14);
}

.plan-card-icon {
  width: 58px;
  height: 58px;
  margin-bottom: 24px;
  color: #111827;
}

.plan-card h2 {
  margin: 0;
  color: #111827;
  font-size: 26px;
  font-weight: 950;
}

.plan-card p {
  min-height: 48px;
  margin: 7px 0 24px;
  color: #374151;
  font-size: 15px;
  line-height: 1.45;
}

.plan-price {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 20px;
}

.plan-price strong {
  color: #111827;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.plan-price span {
  color: #374151;
  font-size: 12px;
  line-height: 1.1;
}

.plan-note {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.13);
  border-radius: 12px;
  color: #111827;
}

.plan-note span {
  color: #475569;
  font-size: 13px;
}

.plan-action {
  min-height: 48px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 12px;
  background: #111827;
  color: #ffffff;
  font-weight: 900;
  text-decoration: none;
}

.plan-features {
  margin: auto -28px -28px;
  padding: 22px 28px 28px;
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  list-style: none;
  display: grid;
  gap: 12px;
}

.plan-features li {
  color: #374151;
  font-size: 14px;
}

.plan-features li::before {
  content: "✓";
  margin-right: 9px;
  color: #16a34a;
}

.plans-admin-panel {
  max-width: 1180px;
  margin: 28px auto 0;
  padding: 26px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.07);
}

.plans-admin-header span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.plans-admin-header h2 {
  margin: 6px 0;
  color: #0f172a;
  font-size: 26px;
  font-weight: 950;
}

.plans-admin-header p {
  margin: 0 0 18px;
  color: #64748b;
}

.plans-admin-table-wrap {
  overflow-x: auto;
}

.plans-admin-table {
  width: 100%;
  border-collapse: collapse;
}

.plans-admin-table th,
.plans-admin-table td {
  padding: 14px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  text-align: left;
}

.plans-admin-table th {
  color: #64748b;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.plans-admin-table td strong,
.plans-admin-table td small {
  display: block;
}

.plans-admin-table select {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: #ffffff;
  font-weight: 850;
}

.plan-status-pill {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 12px;
  font-weight: 900;
}

.plans-save-state {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.plans-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.plans-module-grid article {
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.75);
}

.plans-module-grid span,
.plans-module-grid small {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.plans-module-grid strong {
  display: block;
  margin: 5px 0;
  color: #0f172a;
}

.plans-login-modal[hidden] {
  display: none;
}

.plans-login-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
}

.plans-login-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.45);
}

.plans-login-card {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
  padding: 28px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.25);
}

.plans-login-card input {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
}

.plans-login-card button[type="submit"] {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 900;
}

.plans-login-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 50%;
  background: #ffffff;
}

@media (max-width: 1120px) {
  .plans-grid,
  .plans-module-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 720px) {
  .plans-grid,
  .plans-module-grid {
    grid-template-columns: 1fr;
  }

  .plans-public-shell .plans-public-nav {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .clients-page-surface > .panel-header,
  .clients-page-surface .clients-panel-actions {
    align-items: stretch;
  }

  .clients-page-surface .clients-panel-actions {
    width: 100%;
  }

  .clients-page-surface .clients-panel-title {
    font-size: 23px;
  }
}

/* Collapsible search: icon first, slow reveal on intent. */
.search-field {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  max-width: min(360px, 58vw) !important;
  padding: 0 13px !important;
  gap: 0 !important;
  overflow: hidden !important;
  border-radius: 16px !important;
  cursor: text !important;
  transition:
    width 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    min-width 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease !important;
}

.search-field:hover,
.search-field:focus-within,
.search-field:has(.search-input:not(:placeholder-shown)) {
  width: min(360px, 58vw) !important;
  min-width: min(260px, 58vw) !important;
  gap: 10px !important;
}

.search-icon {
  flex: 0 0 20px !important;
  width: 20px !important;
  height: 20px !important;
  color: #0f2745 !important;
}

.search-input {
  width: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0 !important;
  transform: translateX(-8px);
  transition:
    width 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease 0.12s,
    transform 0.38s ease 0.08s !important;
}

.search-field:hover .search-input,
.search-field:focus-within .search-input,
.search-field:has(.search-input:not(:placeholder-shown)) .search-input {
  width: 100% !important;
  opacity: 1 !important;
  transform: translateX(0);
}

.dashboard-search-field {
  width: min(420px, 100%) !important;
  min-width: min(320px, 100%) !important;
  max-width: 420px !important;
  height: 42px !important;
  padding: 0 14px !important;
  gap: 10px !important;
  overflow: visible !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.78) !important;
  box-shadow: none !important;
  transform: none !important;
}

.dashboard-search-field:hover,
.dashboard-search-field:focus-within,
.dashboard-search-field:has(.search-input:not(:placeholder-shown)) {
  width: min(420px, 100%) !important;
  min-width: min(320px, 100%) !important;
  gap: 10px !important;
}

.dashboard-search-field svg {
  flex: 0 0 18px !important;
  width: 18px !important;
  height: 18px !important;
}

.dashboard-search-field .search-input {
  width: 100% !important;
  opacity: 1 !important;
  transform: none !important;
}

.dashboard-topbar.app-topbar {
  flex-wrap: wrap !important;
  overflow: visible !important;
}

.dashboard-topbar .app-topbar-copy {
  flex: 1 1 420px !important;
  min-width: 260px !important;
}

.dashboard-topbar-actions.app-topbar-actions {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin-left: auto !important;
  justify-content: flex-end !important;
}

.dashboard-topbar .user-chip {
  max-width: min(420px, calc(100vw - 320px)) !important;
  min-width: 0 !important;
  overflow: visible !important;
  flex-shrink: 1 !important;
}

.dashboard-topbar .user-chip-profile-link {
  min-width: 0 !important;
}

.dashboard-topbar .user-chip-profile-link > a {
  min-width: 0 !important;
  overflow: hidden !important;
}

.dashboard-topbar .user-chip-profile-link > a > div:last-child {
  min-width: 0 !important;
  overflow: hidden !important;
}

.dashboard-topbar .user-name {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.dashboard-topbar .user-chip-inline-logout {
  display: inline-flex !important;
  color: #2563eb !important;
  margin-left: 8px !important;
}

@media (max-width: 1180px) {
  .dashboard-topbar .user-chip {
    max-width: 100% !important;
  }

  .dashboard-topbar-actions.app-topbar-actions {
    width: 100% !important;
  }
}

@media (max-width: 1120px) {
  .shell {
    grid-template-columns: 1fr !important;
    padding: 12px !important;
  }

  .sidebar {
    position: relative !important;
    top: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
  }

  .topbar {
    flex-wrap: wrap !important;
  }
}

/* ===== LeadsFlows Clean Panel Theme =====
   Base visual global para nuevas pantallas y migraciones. Clientes es la
   referencia: superficies planas, KPIs compactos, toolbar limpia y tablas sin
   tarjetas anidadas. */
.lf-clean-theme .main,
.main.lf-page {
  background: transparent !important;
}

.lf-page {
  display: grid;
  gap: 22px;
}

.lf-page-stack {
  display: grid !important;
  gap: 22px !important;
  width: 100% !important;
  background: transparent !important;
}

.lf-page-header,
.lf-clean-theme .app-topbar.lf-page-header {
  padding: 0 0 16px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.lf-clean-theme .lf-surface,
.lf-clean-theme .panel.lf-surface,
.lf-clean-theme .clients-page-surface.lf-surface {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.lf-clean-theme .plans-public-wrap {
  padding-top: 18px !important;
}

.lf-clean-theme .plans-admin-panel {
  max-width: none !important;
  margin: 0 !important;
}

.lf-clean-theme .plans-admin-table-wrap,
.lf-clean-theme .plans-module-grid article,
.lf-clean-theme .plans-public-card {
  background: transparent !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  box-shadow: none !important;
}

.lf-clean-theme .plans-admin-table-wrap {
  border-radius: 16px !important;
  overflow-x: auto !important;
}

.billing-clean-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(320px, 1.35fr);
  gap: 16px;
  align-items: stretch;
}

.billing-overview-panel {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.035), transparent 32%),
    rgba(255, 255, 255, 0.38);
  box-shadow: none;
}

.billing-overview-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.25fr);
  gap: 0;
  align-items: stretch;
  padding: 24px;
}

.billing-plan-layout-v2 {
  grid-template-columns: minmax(260px, 0.78fr) minmax(360px, 1.05fr) minmax(420px, 1.12fr);
  grid-template-areas:
    "plan includes info"
    "detail usage usage";
  gap: 0;
}

.billing-plan-summary,
.billing-includes-summary,
.billing-info-summary,
.billing-feature-detail-panel {
  min-width: 0;
}

.billing-plan-summary {
  grid-area: plan;
  position: relative;
  display: grid;
  align-content: start;
  gap: 18px;
  padding-right: 28px;
  border-left: 0;
  border-right: 1px solid rgba(148, 163, 184, 0.18);
}

.billing-usage-panel {
  grid-area: usage;
  padding-left: 30px;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
}

.billing-info-summary {
  grid-area: info;
  padding-left: 30px;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
}

.billing-includes-summary {
  grid-area: includes;
  padding: 0 30px;
  border-top: 0;
}

.billing-usage-panel {
  padding-top: 30px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.billing-feature-detail-panel {
  grid-area: detail;
  padding-top: 30px;
  padding-right: 28px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.billing-compact-comparison {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.billing-plan-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.billing-plan-title-row h2 {
  margin: 0;
  color: #0f172a;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.045em;
}

.billing-renewal-line {
  display: grid;
  gap: 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 750;
}

.billing-renewal-line strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 950;
}

.billing-icon-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.billing-icon-label svg,
.billing-definition-list dt svg {
  width: 16px;
  height: 16px;
  color: #64748b;
}

.billing-plan-watermark {
  position: absolute;
  right: 24px;
  bottom: 44px;
  width: 86px;
  color: rgba(148, 163, 184, 0.16);
  pointer-events: none;
}

.billing-info-summary .billing-definition-list div {
  min-height: 46px;
}

.billing-info-summary .billing-definition-list dt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.billing-usage-panel {
  display: grid;
  gap: 20px;
}

.billing-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
}

.billing-plan-card,
.billing-usage-card {
  grid-row: span 2;
}

.billing-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.billing-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #2563eb;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.billing-card h2,
.billing-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 21px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.billing-price-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 0 4px;
}

.billing-price-row strong {
  color: #0f172a;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.06em;
}

.billing-price-row span,
.billing-definition-list dt,
.billing-usage-row span,
.billing-comparison-list dt {
  color: #64748b;
  font-size: 13px;
  font-weight: 750;
}

.billing-definition-list,
.billing-comparison-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.billing-definition-list div,
.billing-comparison-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.billing-definition-list div:last-child,
.billing-comparison-list div:last-child {
  border-bottom: 0;
}

.billing-definition-list dd,
.billing-comparison-list dd {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
  text-align: right;
}

.billing-feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 22px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.billing-feature-list li {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #334155;
  font-size: 15px;
  font-weight: 900;
}

.billing-feature-list li::before {
  content: none;
}

.billing-check-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border: 2px solid #16a34a;
  border-radius: 999px;
  color: #16a34a;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

.billing-feature-detail-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.billing-feature-detail-list li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon title check"
    "icon copy check";
  align-items: center;
  gap: 2px 14px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.billing-feature-detail-list li:last-child {
  border-bottom: 0;
}

.billing-feature-detail-list strong {
  grid-area: title;
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
}

.billing-feature-detail-list small {
  grid-area: copy;
  color: #52637a;
  font-size: 13px;
  font-weight: 750;
}

.billing-feature-detail-list .billing-check-icon {
  grid-area: check;
}

.billing-feature-icon {
  grid-area: icon;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.billing-feature-icon svg {
  width: 22px;
  height: 22px;
}

.billing-feature-icon.is-whatsapp { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.billing-feature-icon.is-ai,
.billing-feature-icon.is-users { background: rgba(124, 58, 237, 0.11); color: #6d28d9; }
.billing-feature-icon.is-auto,
.billing-feature-icon.is-integrations,
.billing-feature-icon.is-api,
.billing-feature-icon.is-support,
.billing-feature-icon.is-storage { background: rgba(79, 70, 229, 0.1); color: #4f46e5; }

.billing-usage-list {
  display: grid;
  gap: 16px;
}

.billing-usage-panel .billing-usage-list {
  grid-template-columns: 1fr;
  gap: 14px;
}

.billing-usage-row {
  display: grid;
  gap: 8px;
}

.billing-usage-panel .billing-usage-row {
  padding: 0;
  border-left: 0;
}

.billing-usage-panel .billing-usage-row:first-child {
  padding-left: 0;
  border-left: 0;
}

.billing-usage-panel .billing-usage-row:last-child {
  padding-right: 0;
}

.billing-usage-main {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.billing-usage-row strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.billing-usage-row small {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.billing-usage-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
}

.billing-usage-icon svg {
  width: 22px;
  height: 22px;
}

.billing-usage-icon-1 {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
}

.billing-usage-icon-2 {
  background: rgba(34, 197, 94, 0.13);
  color: #16a34a;
}

.billing-usage-icon-3 {
  background: rgba(79, 70, 229, 0.12);
  color: #4f46e5;
}

.billing-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.billing-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #16a34a);
}

.billing-usage-note {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.billing-current-pill {
  display: inline-flex;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  font-size: 12px;
  font-weight: 950;
}

.billing-primary-button,
.billing-secondary-button {
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  justify-self: start;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

.billing-primary-button {
  background: #2563eb;
  color: #ffffff;
}

.billing-secondary-button {
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: transparent;
  color: #2563eb;
}

.billing-inline-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.billing-upgrade-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(22, 163, 74, 0.05));
}

.billing-secondary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.plans-admin-price-input {
  width: 120px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: transparent;
  color: #0f172a;
  font-weight: 850;
}

.plans-admin-price-input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.billing-invoice-modal[hidden] {
  display: none;
}

.billing-invoice-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 24px;
}

.billing-invoice-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(10px);
}

.billing-invoice-card {
  position: relative;
  width: min(760px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
}

.billing-invoice-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(22, 163, 74, 0.04));
}

.billing-invoice-close {
  display: inline-grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
}

.billing-invoice-close svg {
  width: 18px;
  height: 18px;
}

.billing-invoice-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.045em;
}

.billing-invoice-header p {
  margin: 8px 0 0;
  color: #475569;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.billing-invoice-body {
  display: grid;
  gap: 18px;
  padding: 26px;
}

.billing-invoice-summary,
.billing-invoice-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.billing-invoice-summary {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.billing-invoice-summary > div {
  flex: 1 1 auto;
  min-width: 0;
}

.billing-invoice-summary strong {
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
}

.billing-invoice-summary span {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
  font-weight: 850;
}

.billing-invoice-summary-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.09);
  color: #2563eb;
}

.billing-invoice-summary-icon svg {
  width: 21px;
  height: 21px;
}

.billing-invoice-lines {
  display: grid;
  overflow: hidden;
  border: 0;
  border-radius: 0;
}

.billing-invoice-line {
  display: grid;
  grid-template-columns: 1fr 120px 140px;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  color: #0f172a;
  font-size: 14px;
  font-weight: 850;
}

.billing-invoice-line span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.billing-invoice-line:last-child {
  border-bottom: 0;
}

.billing-invoice-line.is-head {
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.billing-invoice-line.is-current {
  background: rgba(37, 99, 235, 0.045);
}

.billing-invoice-month-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  position: relative;
}

.billing-invoice-month-icon::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  background: #2563eb;
}

.billing-invoice-line span:not(:first-child) {
  text-align: right;
}

.billing-invoice-total {
  padding: 16px 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 0;
  background: transparent;
}

.billing-invoice-total span {
  color: #475569;
  font-size: 13px;
  font-weight: 850;
}

.billing-invoice-total strong {
  color: #0f172a;
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.05em;
}

.billing-invoice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.billing-edit-modal {
  width: min(640px, 100%);
}

.billing-edit-body {
  display: grid;
  gap: 16px;
  padding: 26px;
}

.billing-edit-body label {
  display: grid;
  gap: 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.billing-edit-body input,
.billing-edit-body textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #0f172a;
  font: inherit;
  font-weight: 850;
  text-transform: none;
}

.billing-edit-body textarea {
  padding-top: 12px;
  resize: vertical;
}

.billing-edit-body input:focus,
.billing-edit-body textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.billing-autosave-state {
  margin: 0;
  color: #16a34a;
  font-size: 12px;
  font-weight: 950;
}

.billing-plan-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.billing-plan-choice-grid label {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.55);
  cursor: pointer;
}

.billing-plan-choice-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.billing-plan-choice-grid label:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.38);
  background: rgba(37, 99, 235, 0.08);
}

.billing-plan-choice-grid span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.billing-plan-choice-grid strong {
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
}

.plans-public-card-stack--compact {
  gap: 0 !important;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.plans-public-card-stack--compact .plans-public-card {
  grid-template-columns: minmax(90px, 0.45fr) minmax(260px, 1.3fr) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 8px;
  border: 0 !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.plans-public-card-mark {
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  font-size: 11px;
  font-weight: 950;
}

.plans-public-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.plans-public-card-meta span {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.plans-comparison-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.plans-capacity-card,
.plans-comparison-panel {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.plans-capacity-card {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 520px;
  padding: 28px 24px;
  background:
    radial-gradient(circle at 90% 72%, rgba(45, 212, 191, 0.22), transparent 22%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.82), rgba(236, 253, 245, 0.64));
}

.plans-capacity-card h2,
.plans-comparison-header h2 {
  margin: 0;
  color: #0f172a;
  font-weight: 950;
  letter-spacing: -0.045em;
}

.plans-capacity-card h2 {
  font-size: 24px;
}

.plans-capacity-card p,
.plans-comparison-header p {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 500;
}

.plans-capacity-card ul {
  display: grid;
  gap: 12px;
  margin: 2px 0 12px;
  padding: 0;
  list-style: none;
}

.plans-capacity-card li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #334155;
  font-size: 13px;
  font-weight: 850;
}

.plans-capacity-card li::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
  font-size: 11px;
  font-weight: 950;
}

.plans-rocket-mark {
  position: absolute;
  right: -14px;
  bottom: -18px;
  width: 145px;
  color: #14b8a6;
  transform: rotate(-8deg);
  pointer-events: none;
}

.plans-comparison-panel {
  padding: 26px 4px 0;
}

.plans-comparison-header {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: 0 auto 22px;
  text-align: center;
}

.plans-comparison-header h2 {
  font-size: clamp(34px, 3vw, 46px);
  line-height: 1.08;
}

.plans-comparison-header p {
  max-width: 680px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.65;
}

.plans-billing-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.plans-billing-toggle--center {
  display: flex;
  width: fit-content;
  justify-content: center;
  margin: 8px auto 34px;
}

.plans-billing-toggle button {
  min-height: 44px;
  min-width: 128px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.plans-billing-toggle button.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.plans-comparison-table {
  display: grid;
  min-width: 980px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  overflow: hidden;
  background: transparent;
}

.plans-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.05fr) repeat(3, minmax(190px, 1fr));
  min-height: 64px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.plans-row:last-child {
  border-bottom: 0;
}

.plans-row > div {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 12px 18px;
  border-left: 1px solid rgba(148, 163, 184, 0.14);
  color: #1e293b;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.plans-row > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-items: start;
  border-left: 0;
  color: #475569;
  font-size: 17px;
  font-weight: 800;
  text-align: left;
  text-transform: none;
}

.plans-row-head {
  min-height: 166px;
  background: rgba(248, 250, 252, 0.32);
}

.plans-row-head > div {
  position: relative;
  align-content: center;
  color: #0f172a;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.015em;
}

.plans-row-head > div:first-child {
  font-size: 18px;
  color: #334155;
  text-transform: none;
  letter-spacing: 0;
}

.plans-row-head strong {
  font-size: 20px;
  font-weight: 900;
}

.plans-row-head span {
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.plans-row > .is-popular,
.plans-row-head > .is-popular {
  margin: 0;
  border-left: 0;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.18), rgba(124, 58, 237, 0.07));
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.08);
}

.plans-row-head em {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: none;
  translate: -50% 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6d28d9, #8b5cf6);
  color: #ffffff;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.plans-plan-icon,
.plans-feature-icon {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
}

.plans-plan-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
}

.plans-plan-icon svg {
  width: 24px;
  height: 24px;
}

.plans-plan-icon.is-basic { background: rgba(34, 197, 94, 0.14); color: #16a34a; }
.plans-plan-icon.is-pro { background: rgba(96, 165, 250, 0.14); color: #2563eb; }
.plans-plan-icon.is-premium { background: rgba(124, 58, 237, 0.14); color: #6d28d9; }
.plans-plan-icon.is-platinum { background: rgba(245, 158, 11, 0.16); color: #d97706; }

.plans-feature-icon {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
}

.plans-feature-icon svg {
  width: 17px;
  height: 17px;
}

.plans-feature-icon.is-users,
.plans-feature-icon.is-ai,
.plans-feature-icon.is-auto,
.plans-feature-icon.is-integrations,
.plans-feature-icon.is-api,
.plans-feature-icon.is-support,
.plans-feature-icon.is-reports,
.plans-feature-icon.is-target {
  background: rgba(79, 70, 229, 0.10);
  color: #4f46e5;
}

.plans-feature-icon.is-whatsapp {
  background: rgba(34, 197, 94, 0.13);
  color: #16a34a;
}

.plans-feature-icon.is-storage {
  background: rgba(59, 130, 246, 0.11);
  color: #2563eb;
}

@media (max-width: 1100px) {
  .billing-overview-panel,
  .billing-usage-panel .billing-usage-list,
  .billing-clean-grid,
  .plans-comparison-shell,
  .plans-public-card-stack--compact .plans-public-card {
    grid-template-columns: 1fr;
  }

  .plans-comparison-panel {
    overflow-x: auto;
  }

  .plans-capacity-card {
    min-height: auto;
  }

  .billing-includes-summary,
  .billing-info-summary,
  .billing-usage-panel {
    padding: 22px 0 0;
    border-left: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
  }

  .billing-plan-summary {
    padding: 22px 0 0;
    border-left: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
  }

  .billing-usage-panel .billing-usage-row {
    padding: 16px 0 0;
    border-left: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
  }

  .billing-usage-panel .billing-usage-row:first-child {
    padding-top: 0;
    border-top: 0;
  }

  .billing-plan-card,
  .billing-usage-card {
    grid-row: auto;
  }
}

.lf-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.lf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 16px;
}

.lf-table-surface {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.lf-clean-theme .sidebar-nav-shell {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

.lf-clean-theme .sidebar-footer-actions {
  margin-top: auto !important;
  align-self: stretch !important;
}

@media (max-width: 1180px) {
  .lf-kpi-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 720px) {
  .lf-toolbar {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .lf-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-client-flat-theme .dashboard-stat-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (max-width: 1280px) {
  .dashboard-client-flat-theme .dashboard-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .dashboard-client-flat-theme .dashboard-stat-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-greeting-action,
  .dashboard-mini-button,
  .dashboard-agenda-submit {
    width: 100%;
  }

  .dashboard-agenda-modal {
    padding: 12px;
  }

  .dashboard-agenda-dialog {
    padding: 18px;
    border-radius: 18px;
  }
}

.dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) > .dashboard-main-column {
  display: contents;
  overflow: visible;
}

.dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) > .dashboard-side-column {
  display: grid;
  grid-column: 10 / -1;
  grid-row: 2 / span 3;
  gap: 18px;
  align-self: start;
  overflow: visible;
}

.dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-main-column > .panel,
.dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-side-column > .panel {
  margin-top: 0;
}

.dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-stat-grid {
  grid-column: 1 / -1;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dashboard-client-flat-theme .dashboard-stat-card {
  min-height: 126px;
  align-content: start;
}

.dashboard-client-flat-theme .dashboard-stat-head {
  align-items: center;
  min-height: 46px;
}

.dashboard-client-flat-theme .dashboard-stat-card .analytics-metric-label {
  line-height: 1.25;
}

.dashboard-client-flat-theme .dashboard-stat-card .analytics-metric-value {
  margin-top: 8px;
}

.dashboard-client-flat-theme .dashboard-stat-card .dashboard-trend {
  margin-top: 8px;
}

.app-topbar-followup .app-header-title-icon,
.app-header-title-icon--followup {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.12);
}

.dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-priority-brief-grid {
  grid-column: 1 / 10;
  grid-row: 2;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
}

.dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-appointment-mix-panel {
  grid-column: auto;
  grid-row: auto;
  min-height: auto;
}

.dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-pipeline-agenda-grid {
  grid-column: 1 / 10;
  grid-row: 3 / span 2;
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 0.95fr);
}

.dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-side-column > .panel:nth-child(2) {
  grid-column: auto;
  grid-row: auto;
}

.dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-side-column > .dashboard-activity-panel {
  grid-column: auto;
  grid-row: auto;
}

.dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-commercial-grid {
  grid-column: 1 / 10;
}

.dashboard-client-flat-theme .dashboard-appointment-mix-panel .dashboard-donut-shell {
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
}

.dashboard-client-flat-theme .dashboard-donut-legend {
  display: none;
}

.dashboard-client-flat-theme .dashboard-pipeline-lanes {
  grid-template-columns: repeat(6, minmax(74px, 1fr));
}

.dashboard-client-flat-theme .dashboard-agenda-card-body {
  grid-template-columns: 72px minmax(0, 1fr);
}

.dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-appointment-mix-panel {
  align-self: start;
  display: grid;
  gap: 8px;
  height: fit-content;
  min-height: auto;
  padding: 16px 18px;
  align-content: start;
}

.dashboard-client-flat-theme .dashboard-appointment-mix-panel .panel-header {
  margin-bottom: 0;
}

.dashboard-client-flat-theme .dashboard-appointment-mix-panel .dashboard-donut-shell {
  gap: 0;
}

.dashboard-client-flat-theme .dashboard-appointment-mix-panel .dashboard-donut-wrap {
  width: 132px;
  height: 118px;
  min-height: 0;
}

.dashboard-client-flat-theme .dashboard-appointment-mix-panel canvas {
  display: block;
  max-height: 118px;
}

.dashboard-client-flat-theme .dashboard-quote-clients-panel {
  align-self: start;
  height: fit-content;
  padding: 18px;
}

.dashboard-client-flat-theme .dashboard-quote-clients-panel .panel-header {
  margin-bottom: 10px;
}

.dashboard-client-flat-theme .dashboard-quote-clients-panel .panel-header p {
  margin-top: 4px;
}

.dashboard-client-flat-theme .dashboard-quote-clients-panel .dashboard-patient-list {
  gap: 8px;
}

.dashboard-client-flat-theme .dashboard-quote-clients-panel .dashboard-patient-item {
  padding: 10px 12px;
  border-radius: 12px;
}

.dashboard-activity-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.dashboard-activity-links a {
  color: var(--primary-color);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.dashboard-activity-links a:hover {
  text-decoration: underline;
}

@media (max-width: 1440px) {
  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-priority-brief-grid,
  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-pipeline-agenda-grid,
  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) > .dashboard-side-column {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-appointment-mix-panel,
  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-side-column > .panel:nth-child(2),
  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-side-column > .dashboard-activity-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-commercial-grid {
    grid-column: 1 / -1;
  }

  .dashboard-client-flat-theme .dashboard-appointment-mix-panel .dashboard-donut-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) {
    grid-template-columns: 1fr;
  }

  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-stat-grid,
  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-priority-brief-grid,
  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-pipeline-agenda-grid,
  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) > .dashboard-side-column,
  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-appointment-mix-panel,
  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-side-column > .panel:nth-child(2),
  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-side-column > .dashboard-activity-panel,
  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-commercial-grid {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-stat-grid,
  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-priority-brief-grid,
  .dashboard-client-flat-theme .dashboard-workspace:not(.dashboard-workspace--global) .dashboard-pipeline-agenda-grid,
  .dashboard-client-flat-theme .dashboard-appointment-mix-panel .dashboard-donut-shell,
  .dashboard-client-flat-theme .dashboard-agenda-card-body {
    grid-template-columns: 1fr;
  }

  .dashboard-client-flat-theme .dashboard-pipeline-lanes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Dashboard white-fill cleanup.
   Keep the base dashboard layer from forcing legacy white cards over the clean app theme. */
body.dashboard-client-flat-theme,
body[data-company-theme] > .shell {
  background: #f7f9fc !important;
}

body.dashboard-client-flat-theme :is(
  .sidebar,
  .topbar,
  .panel,
  .progress-card,
  .chat-panel,
  .settings-card,
  .page-hero-card,
  .metric-card,
  .analytics-metric-card,
  .stat-card,
  .table-modern,
  .team-card,
  .integration-section-card,
  .integration-sidebar-card,
  .integration-saas-card,
  .pipeline-lane,
  .control-sidebar,
  .popup-card,
  .lead-popup-card,
  .clients-panel,
  .clients-page-surface,
  .plans-admin-panel,
  .plans-admin-table-wrap,
  .billing-overview-panel,
  .billing-feature-detail-panel,
  .billing-usage-panel,
  .billing-card,
  .billing-usage-card,
  .billing-upgrade-card,
  .billing-invoice-card,
  .dashboard-global-panel,
  .dashboard-global-table-wrap,
  .dashboard-global-stat,
  .dashboard-global-summary-item,
  .dashboard-global-plan-item
),
body[data-company-theme] > .shell :is(
  .sidebar,
  .topbar,
  .panel,
  .progress-card,
  .chat-panel,
  .settings-card,
  .page-hero-card,
  .metric-card,
  .analytics-metric-card,
  .stat-card,
  .table-modern,
  .team-card,
  .integration-section-card,
  .integration-sidebar-card,
  .integration-saas-card,
  .pipeline-lane,
  .control-sidebar,
  .popup-card,
  .lead-popup-card,
  .clients-panel,
  .clients-page-surface,
  .plans-admin-panel,
  .plans-admin-table-wrap,
  .billing-overview-panel,
  .billing-feature-detail-panel,
  .billing-usage-panel,
  .billing-card,
  .billing-usage-card,
  .billing-upgrade-card,
  .billing-invoice-card,
  .dashboard-global-panel,
  .dashboard-global-table-wrap,
  .dashboard-global-stat,
  .dashboard-global-summary-item,
  .dashboard-global-plan-item
) {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

body.dashboard-client-flat-theme :is(
  .user-chip,
  .search-field,
  .chip,
  .icon-btn,
  .user-chip-icon-btn,
  .btn-secondary,
  .hero-action-button,
  .integration-card-button,
  .integration-quick-button,
  .company-action-btn,
  .control-action,
  .tab-button,
  .settings-main .tab-button,
  .detail-tabs .tab-button,
  .search-input,
  .lead-input,
  .chat-input,
  .lead-form input,
  .lead-form select,
  .lead-form textarea,
  .settings-value input,
  .settings-value select,
  .plans-admin-table select,
  .plans-admin-price-input
),
body[data-company-theme] > .shell :is(
  .user-chip,
  .search-field,
  .chip,
  .icon-btn,
  .user-chip-icon-btn,
  .btn-secondary,
  .hero-action-button,
  .integration-card-button,
  .integration-quick-button,
  .company-action-btn,
  .control-action,
  .tab-button,
  .settings-main .tab-button,
  .detail-tabs .tab-button,
  .search-input,
  .lead-input,
  .chat-input,
  .lead-form input,
  .lead-form select,
  .lead-form textarea,
  .settings-value input,
  .settings-value select,
  .plans-admin-table select,
  .plans-admin-price-input
) {
  background: rgba(248, 250, 252, 0.78) !important;
  background-color: rgba(248, 250, 252, 0.78) !important;
  box-shadow: none !important;
}

body.dashboard-client-flat-theme :is(.data-table tbody tr, .lead-table tbody tr),
body[data-company-theme] > .shell :is(.data-table tbody tr, .lead-table tbody tr) {
  background: transparent !important;
}

body.dashboard-client-flat-theme :is(.logo-link.has-image, .logo-link--company.has-image),
body[data-company-theme] > .shell :is(.logo-link.has-image, .logo-link--company.has-image) {
  background: transparent !important;
}
