:root {
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-border-muted: rgba(193, 214, 213, 0.64);
  --glass-surface: rgba(255, 255, 255, 0.76);
  --glass-surface-strong: rgba(255, 255, 255, 0.88);
  --glass-shadow: 0 20px 50px rgba(24, 56, 64, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  --glass-shadow-small: 0 10px 28px rgba(24, 56, 64, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  --surface: var(--glass-surface);
  --line: rgba(193, 214, 213, 0.7);
  --shadow: var(--glass-shadow-small);
}

body {
  background:
    radial-gradient(circle at 82% 8%, var(--brand-glow, rgba(87, 203, 187, 0.17)), transparent 25rem),
    radial-gradient(circle at 14% 90%, rgba(102, 154, 218, 0.14), transparent 28rem),
    linear-gradient(145deg, #f4f9f7, #f5f8fb 55%, #fbf8f1);
  background-attachment: fixed;
}

.app-shell {
  background: transparent;
}

.sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.11);
  background: linear-gradient(165deg, var(--sidebar-from, rgba(10, 49, 53, 0.96)), var(--sidebar-to, rgba(15, 54, 59, 0.91)));
  box-shadow: 14px 0 44px rgba(12, 47, 52, 0.12), inset -1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(28px) saturate(125%);
  -webkit-backdrop-filter: blur(28px) saturate(125%);
}

.brand-mark {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: var(--brand-mark-bg, linear-gradient(145deg, rgba(112, 225, 207, 0.92), rgba(51, 170, 160, 0.88)));
  box-shadow: 0 8px 20px rgba(2, 31, 32, 0.2), inset 0 1px rgba(255, 255, 255, 0.48);
}

.sidebar nav a {
  border: 1px solid transparent;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.sidebar-footer {
  border-color: rgba(255, 255, 255, 0.12);
}

.topbar,
.setup-header {
  border-color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 9px 28px rgba(24, 56, 64, 0.06), inset 0 -1px rgba(193, 214, 213, 0.48);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.content {
  position: relative;
}

.page-header h1,
.setup-card h1,
.login-card h2 {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 720;
  letter-spacing: -0.035em;
}

.page-header h1 {
  font-size: 34px;
}

.eyebrow {
  text-shadow: 0 1px rgba(255, 255, 255, 0.8);
}

.card,
.metric-card,
.metric,
.queue-metrics > div,
.setup-card,
.login-card,
.appointment-popover,
.close-actions > div {
  border: 1px solid var(--glass-border);
  background: var(--glass-surface);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(24px) saturate(128%);
  -webkit-backdrop-filter: blur(24px) saturate(128%);
}

.card,
.setup-card,
.login-card {
  border-radius: 22px;
}

.metric-card,
.metric {
  position: relative;
  min-width: 0;
  min-height: 130px;
  padding: 20px;
  overflow: hidden;
  border-radius: 20px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.metric-card::before,
.metric::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), transparent 44%);
  content: "";
  pointer-events: none;
}

.metric-card:hover,
.metric:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 58px rgba(24, 56, 64, 0.14), inset 0 1px rgba(255, 255, 255, 0.9);
}

.metric-card.mint {
  background: linear-gradient(145deg, rgba(225, 248, 241, 0.84), rgba(255, 255, 255, 0.66));
}

.metric-card.blue {
  background: linear-gradient(145deg, rgba(229, 240, 253, 0.86), rgba(255, 255, 255, 0.66));
}

.metric-card.amber {
  background: linear-gradient(145deg, rgba(255, 243, 216, 0.88), rgba(255, 255, 255, 0.66));
}

.metric-card.rose {
  background: linear-gradient(145deg, rgba(253, 233, 231, 0.86), rgba(255, 255, 255, 0.66));
}

.metric span,
.metric small {
  position: relative;
  display: block;
  color: var(--muted);
}

.metric strong {
  position: relative;
  display: block;
  margin: 13px 0 4px;
  font-size: clamp(24px, 2.3vw, 36px);
  letter-spacing: -0.04em;
}

.metric-card strong,
.collection-total,
.queue-metrics strong {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 720;
  letter-spacing: -0.045em;
}

.dashboard-grid,
.metric-grid {
  gap: 20px;
}

.card-header > a,
.portal-links a {
  border-radius: 999px;
  background: var(--brand-soft, rgba(231, 246, 242, 0.68));
}

.card-header > a {
  padding: 7px 11px;
  font-weight: 650;
}

.portal-links a {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
}

.portal-links a:hover {
  background: rgba(255, 255, 255, 0.86);
}

.btn {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.btn::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), transparent 48%);
  content: "";
  pointer-events: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--brand-button, linear-gradient(145deg, rgba(23, 137, 128, 0.96), rgba(9, 91, 86, 0.97)));
  box-shadow: 0 9px 22px var(--brand-ring, rgba(15, 118, 110, 0.22)), inset 0 1px rgba(255, 255, 255, 0.25);
}

.btn-secondary,
.filter-pill,
.subnav a,
.platform-tabs a {
  border-color: var(--glass-border);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
}

.btn-secondary:hover,
.filter-pill:hover,
.subnav a:hover,
.platform-tabs a:hover {
  border-color: rgba(129, 181, 175, 0.7);
  background: rgba(255, 255, 255, 0.86);
}

.subnav,
.workflow-bar {
  width: fit-content;
  max-width: 100%;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: var(--glass-shadow-small);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
}

.subnav a,
.filter-pill {
  white-space: nowrap;
}

.subnav a.active,
.filter-pill.active,
.platform-tabs a.active {
  border-color: var(--brand-border, rgba(80, 179, 166, 0.3));
  background: var(--brand-tint, rgba(214, 240, 234, 0.82));
  color: var(--primary-dark);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.8), 0 6px 15px rgba(24, 80, 76, 0.08);
}

input,
select,
textarea {
  border-color: rgba(174, 202, 200, 0.74);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(122, 174, 169, 0.78);
}

input:focus,
select:focus,
textarea:focus {
  background: rgba(255, 255, 255, 0.94);
}

.toolbar {
  border-color: rgba(190, 211, 210, 0.58);
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: rgba(239, 248, 246, 0.72);
}

th,
td,
.stock-row,
.schedule-item,
.queue-patient,
.portal-links a {
  border-color: rgba(197, 216, 215, 0.58);
}

.schedule-item {
  padding-right: 10px;
  padding-left: 10px;
  border-radius: 12px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.schedule-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  transform: translateX(2px);
}

.schedule-line {
  box-shadow: 0 0 16px var(--brand-glow, rgba(98, 198, 184, 0.35));
}

.badge,
.status-count,
.queue-number,
.tooth,
.setup-icon {
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.7), 0 5px 14px rgba(24, 56, 64, 0.06);
}

.alert,
.schedule-block-notice {
  border-color: rgba(255, 255, 255, 0.68);
  background: rgba(235, 249, 246, 0.86);
  box-shadow: var(--glass-shadow-small);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.timeline > div,
.message-preview {
  padding: 14px;
  border: 1px solid rgba(197, 216, 215, 0.58);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
}

.timeline > div + div {
  margin-top: 10px;
}

.timeline small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.queue-metrics > div {
  border-radius: 15px;
}

.schedule-board-card {
  overflow: visible;
}

.lane-header,
.lane-body {
  background-color: rgba(255, 255, 255, 0.46);
}

.board-appointment {
  border-color: var(--brand-border, rgba(179, 212, 207, 0.76));
  background: var(--brand-soft, rgba(224, 247, 241, 0.9));
  box-shadow: 0 7px 16px rgba(24, 56, 64, 0.08), inset 0 1px rgba(255, 255, 255, 0.78);
}

.appointment-popover,
.close-actions > div {
  border-radius: 15px;
}

.setup-body {
  background:
    radial-gradient(circle at 82% 12%, rgba(87, 203, 187, 0.2), transparent 28rem),
    radial-gradient(circle at 12% 88%, rgba(102, 154, 218, 0.16), transparent 28rem),
    linear-gradient(145deg, #eff8f5, #f5f8fb 55%, #fbf7ef);
  background-attachment: fixed;
}

.setup-card,
.login-card {
  position: relative;
  overflow: hidden;
}

.setup-card::before,
.login-card::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.46), transparent 36%);
  content: "";
  pointer-events: none;
}

.setup-card > *,
.login-card > * {
  position: relative;
}

.setup-progress,
.platform-tabs {
  border-radius: 18px;
}

.module-choice,
.module-checklist label,
.platform-meta div {
  border-color: var(--glass-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--glass-shadow-small);
}

.module-choice.enabled {
  border-color: var(--brand-border, rgba(122, 190, 180, 0.58));
  background: var(--brand-soft, rgba(226, 246, 240, 0.78));
}

.login-page {
  background:
    radial-gradient(circle at 82% 18%, rgba(87, 203, 187, 0.2), transparent 24rem),
    linear-gradient(145deg, #eff8f5, #f6f9fb);
}

.login-aside {
  background:
    radial-gradient(circle at 18% 10%, rgba(83, 208, 190, 0.24), transparent 26rem),
    linear-gradient(145deg, rgba(8, 57, 60, 0.98), rgba(12, 98, 92, 0.93));
}

.login-panel {
  background: transparent;
}

.login-card {
  width: min(460px, 100%);
  padding: clamp(26px, 4vw, 42px);
}

body > .empty-state {
  width: min(620px, calc(100% - 32px));
  margin: 12vh auto;
  padding: 48px 28px;
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  background: var(--glass-surface);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(24px) saturate(128%);
  -webkit-backdrop-filter: blur(24px) saturate(128%);
}

:focus-visible {
  outline: 3px solid var(--brand-border, rgba(31, 144, 132, 0.34));
  outline-offset: 3px;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar,
  .setup-header,
  .card,
  .metric-card,
  .metric,
  .queue-metrics > div,
  .setup-card,
  .login-card,
  .appointment-popover,
  .close-actions > div,
  .btn-secondary,
  .subnav,
  .workflow-bar {
    background-color: #fff;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .metric-card,
  .metric,
  .schedule-item,
  .sidebar nav a,
  tbody tr {
    transition: none;
  }

  .btn:hover,
  .metric-card:hover,
  .metric:hover,
  .schedule-item:hover,
  .sidebar nav a:hover,
  .sidebar nav a.active {
    transform: none;
  }
}

@media (forced-colors: active) {
  .card,
  .metric-card,
  .metric,
  .setup-card,
  .login-card,
  .btn,
  .subnav,
  .workflow-bar {
    border: 1px solid CanvasText;
    background: Canvas;
    box-shadow: none;
  }
}

@media (max-width: 760px) {
  .page-header h1 {
    font-size: 29px;
  }

  .card,
  .metric-card,
  .metric,
  .setup-card,
  .login-card {
    border-radius: 18px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .subnav,
  .workflow-bar {
    width: 100%;
  }

  .schedule-item {
    padding-right: 4px;
    padding-left: 4px;
  }
}

@media print {
  body,
  .setup-body {
    background: #fff;
  }

  .card,
  .metric-card,
  .metric,
  .setup-card {
    border-color: #bbb;
    background: #fff;
    box-shadow: none;
    backdrop-filter: none;
  }
}
