:root {
  --font-base: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --bg: #eef5fb;
  --bg-secondary: #f7fbff;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --line: rgba(17, 44, 76, 0.08);
  --line-strong: rgba(17, 44, 76, 0.15);
  --text: #12304d;
  --muted: #6d8299;
  --primary: #1d71f2;
  --primary-dark: #0e4db1;
  --teal: #18b8a7;
  --amber: #ff9f43;
  --rose: #ff6b81;
  --purple: #8d6ef7;
  --success-bg: rgba(24, 184, 167, 0.12);
  --blue-bg: rgba(29, 113, 242, 0.1);
  --amber-bg: rgba(255, 159, 67, 0.16);
  --card-gradient: linear-gradient(135deg, rgba(29, 113, 242, 0.14), rgba(24, 184, 167, 0.08));
  --sidebar: #0f2642;
  --sidebar-accent: #183c66;
  --sidebar-text: #e7f2ff;
}

body[data-theme="dark"] {
  --bg: #081521;
  --bg-secondary: #0c1f30;
  --panel: rgba(10, 24, 38, 0.9);
  --panel-strong: #10273c;
  --line: rgba(188, 216, 255, 0.08);
  --line-strong: rgba(188, 216, 255, 0.16);
  --text: #e4f2ff;
  --muted: #99b3ca;
  --primary: #56a3ff;
  --primary-dark: #1d71f2;
  --teal: #29d2bf;
  --amber: #ffb35d;
  --rose: #ff8a9c;
  --purple: #ad94ff;
  --success-bg: rgba(41, 210, 191, 0.15);
  --blue-bg: rgba(86, 163, 255, 0.18);
  --amber-bg: rgba(255, 179, 93, 0.18);
  --card-gradient: linear-gradient(135deg, rgba(86, 163, 255, 0.15), rgba(41, 210, 191, 0.08));
  --sidebar: #07131d;
  --sidebar-accent: #0f2233;
  --sidebar-text: #d8ecff;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-base);
  background: radial-gradient(circle at top left, rgba(24, 184, 167, 0.16), transparent 28%), radial-gradient(circle at bottom right, rgba(29, 113, 242, 0.14), transparent 35%), var(--bg);
  color: var(--text);
}

body,
input,
select,
textarea,
button {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  outline: none;
}

code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
  background: rgba(29, 113, 242, 0.08);
  padding: 2px 7px;
  border-radius: 8px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: right;
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

thead th {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  background: rgba(29, 113, 242, 0.04);
}

tbody tr:hover {
  background: rgba(29, 113, 242, 0.06);
}

.is-hidden {
  display: none !important;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
}

.app-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(29, 113, 242, 0.03), transparent 36%), linear-gradient(240deg, rgba(24, 184, 167, 0.05), transparent 42%);
}

.login-screen,
.app-shell {
  position: relative;
  z-index: 1;
}

.login-screen {
  min-height: 100vh;
  padding: 32px;
}

.login-screen__brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.login-screen__grid {
  display: grid;
  grid-template-columns: minmax(320px, 520px) 1fr;
  gap: 24px;
  align-items: stretch;
}

.brand-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 22px 60px rgba(15, 55, 102, 0.12);
}

.hero-panel,
.login-card {
  background: var(--panel);
  border: 1px solid rgba(17, 44, 76, 0.08);
  border-radius: 24px;
  box-shadow: 0 16px 36px rgba(14, 40, 87, 0.08);
  padding: 32px;
  backdrop-filter: blur(12px);
}

.hero-panel {
  min-height: 620px;
  background: linear-gradient(135deg, rgba(15, 38, 66, 0.94), rgba(29, 113, 242, 0.86)), radial-gradient(circle at top, rgba(255, 255, 255, 0.18), transparent 34%);
  color: #fff;
  overflow: hidden;
  position: relative;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -80px -100px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(10px);
}

.hero-panel__content {
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}

.hero-panel h2 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.2;
}

.hero-panel .muted {
  color: rgba(255, 255, 255, 0.84);
  max-width: 680px;
  font-size: 1.05rem;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  padding: 24px;
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-accent));
  color: var(--sidebar-text);
  border-radius: 32px;
  padding: 20px;
  box-shadow: 0 22px 60px rgba(15, 55, 102, 0.12);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar__head, .sidebar__brand, .sidebar__tenant-meta, .sidebar__footer {
  display: flex;
  align-items: center;
}

.sidebar__head {
  justify-content: space-between;
}

.sidebar__brand {
  gap: 14px;
}

.sidebar__brand small, .sidebar__tenant small, .sidebar__footer small {
  color: rgba(231, 242, 255, 0.72);
}

.sidebar__tenant {
  background: var(--panel);
  border: 1px solid rgba(17, 44, 76, 0.08);
  border-radius: 24px;
  box-shadow: 0 16px 36px rgba(14, 40, 87, 0.08);
  padding: 18px;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.sidebar__tenant-meta {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.sidebar__tenant-meta span {
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar__nav {
  display: grid;
  gap: 8px;
}

.sidebar__footer {
  margin-top: auto;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar__logout {
  margin-inline-start: auto;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
}

.tenant-progress {
  margin-top: 14px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.tenant-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffffff, #7fe7dd);
}

.nav-link {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: right;
  padding: 14px 16px;
  border-radius: 18px;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.nav-link span,
.nav-link small {
  display: block;
}

.nav-link span {
  font-weight: 700;
}

.nav-link small {
  color: rgba(231, 242, 255, 0.68);
  font-size: 0.84rem;
}

.nav-link:hover, .nav-link.is-active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(127, 231, 221, 0.12));
  transform: translateX(-4px);
}

.main-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.topbar {
  background: var(--panel);
  border: 1px solid rgba(17, 44, 76, 0.08);
  border-radius: 24px;
  box-shadow: 0 16px 36px rgba(14, 40, 87, 0.08);
  padding: 18px 22px;
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar__start, .topbar__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 20px;
}

.mobile-sidebar-overlay,
.sidebar__close,
.mobile-only {
  display: none;
}

@media (max-width: 1100px) {
  .login-screen__grid,
.app-shell,
.section-grid,
.section-grid--split,
.section-grid--analytics,
.section-grid--tables,
.section-grid--hero {
    grid-template-columns: 1fr;
  }
  .app-shell {
    padding: 16px;
  }
  .sidebar {
    position: fixed;
    top: 16px;
    bottom: 16px;
    right: 16px;
    width: calc(100vw - 32px);
    max-width: 320px;
    transform: translateX(calc(100% + 24px));
    transition: transform 180ms ease;
    z-index: 30;
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 15, 26, 0.4);
    backdrop-filter: blur(6px);
    z-index: 20;
  }
  .mobile-sidebar-overlay.is-visible {
    display: block;
  }
  .sidebar__close,
.mobile-only {
    display: inline-flex;
  }
}

@media (max-width: 720px) {
  .login-screen {
    padding: 18px;
  }
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .topbar__actions {
    flex-wrap: wrap;
  }
}

.card {
  background: var(--panel);
  border: 1px solid rgba(17, 44, 76, 0.08);
  border-radius: 24px;
  box-shadow: 0 16px 36px rgba(14, 40, 87, 0.08);
  padding: 24px;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(29, 113, 242, 0), rgba(29, 113, 242, 0.18), rgba(24, 184, 167, 0));
  pointer-events: none;
}

.glass {
  background: rgba(255, 255, 255, 0.78);
}

.btn,
.chip,
.icon-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn {
  padding: 12px 18px;
  font-weight: 700;
  border: 1px solid transparent;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  box-shadow: 0 16px 28px rgba(29, 113, 242, 0.22);
}

.btn--ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.52);
  color: var(--text);
}

.btn--lg {
  min-height: 54px;
}

.chip {
  padding: 11px 16px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
}

.chip--soft {
  background: var(--blue-bg);
  color: var(--primary);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(29, 113, 242, 0.12);
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 700;
}

.badge--success {
  background: var(--success-bg);
  color: var(--teal);
}

.feature-pills,
.hero-stats,
.legend,
.summary-list,
.assistant-actions,
.branch-list,
.plans-grid {
  display: grid;
  gap: 14px;
}

.feature-pills {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  font-weight: 700;
}

.metric-card,
.stat-card,
.summary-item,
.plan-tile,
.branch-item,
.service-item,
.insight-item,
.flash,
.empty-state {
  border-radius: 18px;
}

.metric-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.metric-card span,
.metric-card small {
  display: block;
}

.metric-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 1.6rem;
}

.metric-card small {
  color: rgba(255, 255, 255, 0.78);
}

.form-grid,
.info-grid,
.booking-review {
  display: grid;
  gap: 16px;
}

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

.field {
  display: grid;
  gap: 10px;
}

.field span {
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  padding: 14px 16px;
  box-shadow: inset 0 1px 2px rgba(15, 38, 66, 0.04);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(29, 113, 242, 0.28);
  box-shadow: 0 0 0 4px rgba(29, 113, 242, 0.08);
  background: rgba(255, 255, 255, 0.98);
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.field--full {
  grid-column: 1 / -1;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}

.login-card h2 {
  margin: 0;
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
}

.login-card__badge {
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--blue-bg);
  color: var(--primary);
  font-weight: 700;
}

.login-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  grid-column: 1 / -1;
}

.flash {
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: 0 16px 36px rgba(14, 40, 87, 0.08);
}

.flash--success {
  background: rgba(24, 184, 167, 0.12);
  border-color: rgba(24, 184, 167, 0.18);
}

.flash--error {
  background: rgba(255, 107, 129, 0.12);
  border-color: rgba(255, 107, 129, 0.18);
}

.search-field {
  width: 100%;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.search-field input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  min-height: 48px;
}

.section-grid,
.stats-grid {
  display: grid;
  gap: 20px;
}

.section-grid {
  grid-template-columns: repeat(12, 1fr);
}

.section-grid--hero {
  grid-template-columns: 2fr 1fr;
}

.section-grid--analytics,
.section-grid--tables,
.section-grid--split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

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

.section-head h3 {
  margin: 0;
  font-size: 1.35rem;
}

.section-head p {
  letter-spacing: 0.01em;
}

.hero-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: var(--card-gradient);
}

.hero-card h3 {
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
  max-width: 840px;
  line-height: 1.35;
}

.hero-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.plan-card {
  display: grid;
  gap: 16px;
  align-content: start;
}

.plan-card__numbers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.plan-card__numbers div {
  padding: 16px;
  border-radius: 18px;
  background: var(--bg-secondary);
}

.plan-card__numbers strong,
.plan-card__numbers span {
  display: block;
}

.plan-card__numbers strong {
  font-size: 1.8rem;
}

.plan-card__numbers span {
  color: var(--muted);
}

.stat-card {
  padding: 22px;
  border: 1px solid rgba(17, 44, 76, 0.08);
  background: var(--panel);
  box-shadow: 0 16px 36px rgba(14, 40, 87, 0.08);
}

.stat-card span,
.stat-card strong,
.stat-card small {
  display: block;
}

.stat-card strong {
  margin: 8px 0 6px;
  font-size: 1.9rem;
}

.stat-card small {
  color: var(--muted);
}

.stat-card--blue {
  background: linear-gradient(135deg, rgba(29, 113, 242, 0.12), rgba(255, 255, 255, 0.9));
}

.stat-card--green {
  background: linear-gradient(135deg, rgba(24, 184, 167, 0.14), rgba(255, 255, 255, 0.9));
}

.stat-card--amber {
  background: linear-gradient(135deg, rgba(255, 159, 67, 0.18), rgba(255, 255, 255, 0.9));
}

.stat-card--teal {
  background: linear-gradient(135deg, rgba(141, 110, 247, 0.16), rgba(255, 255, 255, 0.9));
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.45);
}

.table-actions,
.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-actions form,
.inline-form form {
  margin: 0;
}

.inline-form select {
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  padding: 8px 12px;
}

.table-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: #fff;
  font-weight: 800;
}

.avatar--sm {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.avatar--lg {
  width: 68px;
  height: 68px;
  border-radius: 24px;
  font-size: 1.4rem;
}

.summary-list,
.service-list,
.insight-list,
.schedule-list,
.plan-list,
.timeline,
.chat-box,
.setup-steps {
  display: grid;
  gap: 12px;
}

.summary-item,
.service-item,
.insight-item,
.schedule-item,
.plan-item,
.branch-item {
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--bg-secondary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-item strong {
  font-size: 1.6rem;
}

.donut-card__body {
  display: grid;
  place-items: center;
  gap: 24px;
}

.donut {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.donut__center {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel-strong);
  text-align: center;
}

.donut__center strong,
.donut__center span {
  display: block;
}

.donut__center strong {
  font-size: 2rem;
  line-height: 1;
}

.legend__item {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 12px;
  align-items: center;
}

.legend__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.line-chart {
  width: 100%;
  height: 260px;
}

.line-chart__point {
  filter: drop-shadow(0 0 0.8rem rgba(29, 113, 242, 0.32));
}

.spotlight-card__content,
.spotlight-card__head {
  display: grid;
  gap: 18px;
}

.spotlight-card__head {
  grid-template-columns: auto 1fr;
  align-items: center;
}

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

.info-grid div {
  padding: 14px;
  border-radius: 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
}

.info-grid span,
.info-grid strong {
  display: block;
}

.info-grid span {
  color: var(--muted);
  margin-bottom: 6px;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(29, 113, 242, 0.06);
}

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.step {
  flex: 1 1 180px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--bg-secondary);
}

.step strong,
.step span {
  display: block;
}

.step strong {
  margin-bottom: 4px;
}

.step.is-done {
  background: var(--success-bg);
}

.step.is-active {
  background: var(--blue-bg);
  border-color: rgba(29, 113, 242, 0.24);
}

.booking-review {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.booking-review div {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--bg-secondary);
}

.booking-review span,
.booking-review strong {
  display: block;
}

.booking-review span {
  color: var(--muted);
}

.notice {
  padding: 18px;
  border-radius: 18px;
  background: rgba(29, 113, 242, 0.08);
  border: 1px solid rgba(29, 113, 242, 0.12);
  color: var(--text);
}

.notice--warning {
  background: rgba(255, 159, 67, 0.14);
  border-color: rgba(255, 159, 67, 0.2);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.schedule-item,
.plan-item,
.branch-item,
.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.teeth-map {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

.tooth {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  min-height: 60px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  font-weight: 700;
}

.tooth.is-highlighted {
  background: linear-gradient(135deg, rgba(29, 113, 242, 0.14), rgba(141, 110, 247, 0.18));
  border-color: rgba(29, 113, 242, 0.22);
}

.teeth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.panel-form {
  align-content: start;
}

.empty-state {
  padding: 28px;
}

.setup-steps {
  margin: 18px 0 0;
  padding-inline-start: 18px;
}

.chat-box {
  min-height: 280px;
}

.chat-bubble {
  max-width: 90%;
  padding: 14px 16px;
  border-radius: 20px;
  line-height: 1.8;
}

.chat-bubble--assistant {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  justify-self: start;
}

.chat-bubble--user {
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: #fff;
  justify-self: end;
}

.plan-tile {
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--bg-secondary);
}

.plan-tile--featured {
  background: linear-gradient(135deg, rgba(29, 113, 242, 0.12), rgba(24, 184, 167, 0.12));
  border-color: rgba(29, 113, 242, 0.18);
}

@media (max-width: 720px) {
  .search-field {
    min-width: 100%;
  }
  .booking-review,
.info-grid,
.plan-card__numbers,
.form-grid {
    grid-template-columns: 1fr;
  }
  .teeth-map {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.summary-card,
.spotlight-card,
.assistant-card,
.chart-card,
.donut-card {
  min-height: 100%;
}

.examination-grid {
  align-items: start;
}

.exam-hero {
  display: grid;
  gap: 22px;
  background: linear-gradient(135deg, rgba(29, 113, 242, 0.12), rgba(24, 184, 167, 0.08)), var(--panel);
}

.exam-hero__content {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.exam-patient-switch {
  width: 100%;
  max-width: 340px;
}

.exam-hero__stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.mini-stat {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.mini-stat span,
.mini-stat strong,
.mini-stat small {
  display: block;
}

.mini-stat span,
.mini-stat small {
  color: var(--muted);
}

.mini-stat strong {
  margin: 8px 0 4px;
  font-size: 1.15rem;
}

.odontogram-card {
  min-height: 100%;
}

.odontogram-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.legend-pill--planned {
  background: rgba(255, 159, 67, 0.14);
  color: #cc7a1d;
}

.legend-pill--progress {
  background: rgba(29, 113, 242, 0.12);
  color: var(--primary);
}

.legend-pill--completed {
  background: rgba(24, 184, 167, 0.14);
  color: var(--teal);
}

.odontogram-shell {
  position: relative;
  padding: 28px;
  border-radius: 30px;
  background: radial-gradient(circle at 50% 0%, rgba(29, 113, 242, 0.12), transparent 38%), radial-gradient(circle at 50% 100%, rgba(24, 184, 167, 0.1), transparent 34%), linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 247, 255, 0.94));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -24px 40px rgba(29, 113, 242, 0.04);
}

.odontogram-shell::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 24px;
  border: 1px dashed rgba(29, 113, 242, 0.12);
  pointer-events: none;
}

.dental-arch {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 26px;
}

.dental-arch + .dental-arch {
  margin-top: 20px;
}

.dental-quadrant {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
}

.dental-quadrant--left {
  direction: ltr;
}

.dental-centerline {
  position: relative;
  height: 40px;
  margin: 20px auto;
  width: 2px;
  background: linear-gradient(180deg, rgba(29, 113, 242, 0), rgba(29, 113, 242, 0.32), rgba(29, 113, 242, 0));
}

.dental-centerline::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(29, 113, 242, 0.14);
  box-shadow: 0 0 0 8px rgba(29, 113, 242, 0.05);
}

.dental-arch__label {
  display: grid;
  place-items: center;
  min-width: 94px;
}

.dental-arch__label span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.tooth-node {
  --tooth-edge: rgba(180, 197, 221, 0.9);
  --tooth-shadow: rgba(38, 71, 122, 0.18);
  --tooth-highlight: rgba(255, 255, 255, 0.98);
  --tooth-fill-top: #ffffff;
  --tooth-fill-bottom: #dfeeff;
  --tooth-accent: rgba(29, 113, 242, 0.16);
  --tooth-accent-strong: #1d71f2;
  --tooth-glow: rgba(29, 113, 242, 0.16);
  --tooth-node-shift: 0px;
  --tooth-node-rotate: 0deg;
  border: 1px solid rgba(194, 210, 232, 0.9);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 247, 255, 0.94));
  min-height: 172px;
  padding: 12px 8px 14px;
  display: grid;
  grid-template-rows: minmax(104px, auto) auto;
  align-content: start;
  gap: 10px;
  text-align: center;
  box-shadow: 0 16px 24px rgba(15, 55, 102, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
  transform: translateY(var(--tooth-node-shift)) rotate(var(--tooth-node-rotate));
}

.tooth-node:hover {
  transform: translateY(calc(var(--tooth-node-shift) - 4px)) rotate(var(--tooth-node-rotate)) scale(1.02);
  box-shadow: 0 22px 30px rgba(15, 55, 102, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.7) inset;
  border-color: rgba(29, 113, 242, 0.22);
}

.tooth-node__visual {
  position: relative;
  min-height: 108px;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.tooth-node__glow {
  position: absolute;
  inset: 8px 18px 16px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--tooth-glow), rgba(255, 255, 255, 0));
  filter: blur(10px);
  opacity: 0.95;
}

.tooth-node__tooth {
  position: relative;
  width: 60px;
  height: 74px;
  border-radius: 22px 22px 18px 18px;
  background: linear-gradient(180deg, var(--tooth-highlight) 0%, var(--tooth-fill-top) 30%, var(--tooth-fill-bottom) 100%);
  border: 1px solid var(--tooth-edge);
  box-shadow: 0 16px 18px -10px var(--tooth-shadow), inset 0 10px 16px rgba(255, 255, 255, 0.82), inset 0 -10px 14px rgba(166, 193, 230, 0.28);
  clip-path: polygon(16% 10%, 27% 3%, 41% 11%, 50% 6%, 59% 11%, 73% 3%, 84% 10%, 92% 29%, 89% 56%, 75% 79%, 25% 79%, 11% 56%, 8% 29%);
  z-index: 2;
}

.tooth-node__tooth::before, .tooth-node__tooth::after {
  content: "";
  position: absolute;
  bottom: -22px;
  width: 20px;
  height: 34px;
  background: linear-gradient(180deg, #fefefe, #d8e8fb);
  border: 1px solid var(--tooth-edge);
  box-shadow: inset 0 8px 10px rgba(255, 255, 255, 0.7);
  z-index: -1;
}

.tooth-node__tooth::before {
  left: 12px;
  border-radius: 0 0 14px 18px;
  transform: skewX(9deg);
  clip-path: polygon(35% 0, 100% 0, 72% 100%, 10% 100%);
}

.tooth-node__tooth::after {
  right: 12px;
  border-radius: 0 0 18px 14px;
  transform: skewX(-9deg);
  clip-path: polygon(0 0, 65% 0, 90% 100%, 28% 100%);
}

.tooth-node__reflection {
  position: absolute;
  top: 18px;
  width: 18px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
  transform: translateX(-12px) rotate(12deg);
  opacity: 0.8;
  z-index: 3;
}

.tooth-node__status-mark {
  position: absolute;
  top: 18px;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translateX(20px);
  background: var(--tooth-accent-strong);
  box-shadow: 0 0 0 6px var(--tooth-accent);
  z-index: 4;
}

.tooth-node__meta {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.tooth-node__code {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 34px;
  padding: 0 10px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--tooth-accent-strong);
  border: 1px solid rgba(29, 113, 242, 0.12);
  box-shadow: 0 8px 14px rgba(29, 113, 242, 0.08);
  font-weight: 800;
}

.tooth-node__label {
  display: block;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text);
  font-weight: 700;
}

.tooth-node__hint {
  font-size: 0.71rem;
  color: var(--muted);
}

.tooth-node--planned {
  --tooth-fill-top: #fff8ef;
  --tooth-fill-bottom: #ffe3c4;
  --tooth-accent: rgba(255, 159, 67, 0.18);
  --tooth-accent-strong: #d78522;
  --tooth-edge: rgba(225, 173, 105, 0.75);
  --tooth-glow: rgba(255, 159, 67, 0.2);
  border-color: rgba(225, 173, 105, 0.4);
  background: linear-gradient(180deg, rgba(255, 251, 243, 0.98), rgba(255, 244, 229, 0.95));
}

.tooth-node--in_progress {
  --tooth-fill-top: #eef6ff;
  --tooth-fill-bottom: #cfe2ff;
  --tooth-accent: rgba(29, 113, 242, 0.18);
  --tooth-accent-strong: #1d71f2;
  --tooth-edge: rgba(126, 170, 235, 0.78);
  --tooth-glow: rgba(29, 113, 242, 0.22);
  border-color: rgba(126, 170, 235, 0.42);
  background: linear-gradient(180deg, rgba(244, 249, 255, 0.98), rgba(234, 243, 255, 0.95));
}

.tooth-node--completed {
  --tooth-fill-top: #effcf8;
  --tooth-fill-bottom: #c9f3ea;
  --tooth-accent: rgba(24, 184, 167, 0.18);
  --tooth-accent-strong: #18b8a7;
  --tooth-edge: rgba(112, 205, 191, 0.72);
  --tooth-glow: rgba(24, 184, 167, 0.2);
  border-color: rgba(112, 205, 191, 0.42);
  background: linear-gradient(180deg, rgba(244, 255, 252, 0.98), rgba(233, 251, 247, 0.95));
}

.dental-arch--upper .dental-quadrant .tooth-node:nth-child(1),
.dental-arch--upper .dental-quadrant .tooth-node:nth-child(8) {
  --tooth-node-shift: 24px;
}

.dental-arch--upper .dental-quadrant .tooth-node:nth-child(2),
.dental-arch--upper .dental-quadrant .tooth-node:nth-child(7) {
  --tooth-node-shift: 14px;
}

.dental-arch--upper .dental-quadrant .tooth-node:nth-child(3),
.dental-arch--upper .dental-quadrant .tooth-node:nth-child(6) {
  --tooth-node-shift: 8px;
}

.dental-arch--upper .dental-quadrant .tooth-node:nth-child(1) {
  --tooth-node-rotate: -14deg;
}

.dental-arch--upper .dental-quadrant .tooth-node:nth-child(2) {
  --tooth-node-rotate: -10deg;
}

.dental-arch--upper .dental-quadrant .tooth-node:nth-child(3) {
  --tooth-node-rotate: -6deg;
}

.dental-arch--upper .dental-quadrant .tooth-node:nth-child(6) {
  --tooth-node-rotate: 6deg;
}

.dental-arch--upper .dental-quadrant .tooth-node:nth-child(7) {
  --tooth-node-rotate: 10deg;
}

.dental-arch--upper .dental-quadrant .tooth-node:nth-child(8) {
  --tooth-node-rotate: 14deg;
}

.dental-arch--lower .dental-quadrant .tooth-node:nth-child(1),
.dental-arch--lower .dental-quadrant .tooth-node:nth-child(8) {
  --tooth-node-shift: -24px;
}

.dental-arch--lower .dental-quadrant .tooth-node:nth-child(2),
.dental-arch--lower .dental-quadrant .tooth-node:nth-child(7) {
  --tooth-node-shift: -14px;
}

.dental-arch--lower .dental-quadrant .tooth-node:nth-child(3),
.dental-arch--lower .dental-quadrant .tooth-node:nth-child(6) {
  --tooth-node-shift: -8px;
}

.dental-arch--lower .dental-quadrant .tooth-node:nth-child(1) {
  --tooth-node-rotate: 14deg;
}

.dental-arch--lower .dental-quadrant .tooth-node:nth-child(2) {
  --tooth-node-rotate: 10deg;
}

.dental-arch--lower .dental-quadrant .tooth-node:nth-child(3) {
  --tooth-node-rotate: 6deg;
}

.dental-arch--lower .dental-quadrant .tooth-node:nth-child(6) {
  --tooth-node-rotate: -6deg;
}

.dental-arch--lower .dental-quadrant .tooth-node:nth-child(7) {
  --tooth-node-rotate: -10deg;
}

.dental-arch--lower .dental-quadrant .tooth-node:nth-child(8) {
  --tooth-node-rotate: -14deg;
}

.treatment-form-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 255, 0.94));
}

.records-card {
  margin-top: 4px;
}

.branch-list,
.plans-grid {
  margin-top: 8px;
}

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

.service-list,
.branch-list,
.insight-list {
  margin-top: 14px;
}

@media (max-width: 900px) {
  .hero-stats {
    grid-template-columns: 1fr;
  }
  .exam-hero__content,
.dental-arch {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .exam-hero__content {
    display: grid;
  }
  .exam-patient-switch {
    width: 100%;
  }
  .exam-hero__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dental-arch__label {
    order: -1;
    margin-bottom: 8px;
  }
  .tooth-node {
    min-height: 154px;
  }
}

@media (max-width: 720px) {
  .exam-hero__stats,
.dental-quadrant {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .odontogram-shell {
    padding: 16px;
  }
  .tooth-node {
    --tooth-node-shift: 0px !important;
    --tooth-node-rotate: 0deg !important;
    min-height: 148px;
  }
  .tooth-node__tooth {
    width: 54px;
    height: 66px;
  }
}
