:root {
  --ink: #17211e;
  --muted: #69766f;
  --line: #d9e1dc;
  --panel: rgba(255, 255, 255, 0.92);
  --page: #eef3ef;
  --accent: #25735d;
  --accent-strong: #124c3e;
  --accent-soft: #e5f2ec;
  --sidebar: #13231f;
  --sidebar-soft: #1f352f;
  --cream: #fbfaf5;
  --gold: #b5822f;
  --gold-soft: #fff4df;
  --danger: #aa3f46;
  --danger-soft: #fae9eb;
  --slate: #495766;
  --slate-soft: #e9edf1;
  --shadow: 0 24px 70px rgba(24, 39, 34, 0.14);
  --shadow-soft: 0 12px 36px rgba(24, 39, 34, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(238, 243, 239, 0.98), rgba(247, 246, 239, 0.92) 48%, rgba(231, 239, 235, 0.95)),
    url("https://images.unsplash.com/photo-1587854692152-cbe660dbde88?auto=format&fit=crop&w=1800&q=80");
  background-attachment: fixed;
  background-size: cover;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.hidden {
  display: none !important;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  padding: 30px;
}

.auth-brand,
.patient-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand {
  align-self: start;
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.55fr);
  gap: 28px;
  align-items: center;
  width: min(1180px, 100%);
  margin: 28px auto 0;
}

.auth-hero {
  min-height: 560px;
  padding: 42px;
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(18, 32, 28, 0.92), rgba(18, 32, 28, 0.68), rgba(18, 32, 28, 0.18)),
    url("https://images.unsplash.com/photo-1588776814546-1ffcf47267a5?auto=format&fit=crop&w=1500&q=80");
  background-position: center;
  background-size: cover;
  color: #fff;
  box-shadow: var(--shadow);
}

.auth-hero .eyebrow,
.auth-hero p {
  color: rgba(255, 255, 255, 0.78);
}

.auth-hero h1 {
  max-width: 680px;
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(42px, 6vw, 76px);
}

.auth-hero p {
  max-width: 560px;
  line-height: 1.7;
}

.auth-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.auth-proof span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  font-size: 13px;
  font-weight: 800;
}

.pricing-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 720px;
  margin-top: 24px;
}

.pricing-strip article {
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.pricing-strip strong,
.pricing-strip span {
  display: block;
}

.pricing-strip strong {
  color: #fff;
  font-size: 20px;
}

.pricing-strip span {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  line-height: 1.45;
}

.auth-panel {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-mode-tabs {
  display: grid;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef3ef;
}

.auth-mode-tabs {
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 10px;
  background: #17211e;
  border-color: rgba(23, 33, 30, 0.16);
}

.auth-mode-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.auth-mode-tab {
  color: rgba(255, 255, 255, 0.68);
}

.auth-mode-tab.active {
  background: #fff;
  color: var(--accent-strong);
  box-shadow: var(--shadow-soft);
}

.login-form {
  display: none;
  gap: 15px;
  padding: 22px 4px 4px;
}

.login-form.active {
  display: grid;
}

.login-form h2 {
  font-size: 24px;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(19, 35, 31, 0.98), rgba(14, 25, 23, 0.98)),
    url("https://images.unsplash.com/photo-1505751172876-fa1923c5c528?auto=format&fit=crop&w=900&q=80");
  background-size: cover;
  background-blend-mode: multiply;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fbf8;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #f7ddb0 0%, #d0a24c 54%, #25735d 100%);
  box-shadow: 0 10px 24px rgba(18, 76, 62, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: hidden;
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.logo-card {
  fill: #fffaf0;
  opacity: 0.94;
}

.logo-rings {
  fill: none;
  stroke: #d0a24c;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-monogram {
  fill: #10231e;
}

.logo-check-circle {
  fill: var(--accent);
}

.logo-check {
  fill: none;
  stroke: #fffaf0;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.brand strong {
  font-size: 16px;
}

.brand span {
  margin-top: 3px;
  color: rgba(248, 251, 248, 0.68);
  font-size: 13px;
}

.sidebar-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sidebar-card strong {
  line-height: 1.25;
}

.sidebar-card span {
  color: rgba(248, 251, 248, 0.66);
  font-size: 13px;
  line-height: 1.5;
}

.sidebar-card .sidebar-address {
  padding-top: 2px;
  color: rgba(248, 251, 248, 0.82);
  font-weight: 700;
}

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

.nav-item,
.icon-button,
.primary-button,
.secondary-button,
.whatsapp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.nav-item {
  justify-content: flex-start;
  width: 100%;
  padding: 11px 12px;
  background: transparent;
  color: rgba(248, 251, 248, 0.62);
  font-weight: 700;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: inset 3px 0 0 #d6ad5a;
}

.lucide {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
  flex: 0 0 auto;
}

.clinic-panel {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.clinic-panel strong {
  color: #fff;
  font-size: 15px;
}

.clinic-panel span {
  color: rgba(248, 251, 248, 0.72);
  font-size: 13px;
  line-height: 1.45;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  outline: 0;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 115, 93, 0.13);
}

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

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.title-block {
  display: grid;
  gap: 10px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: rgba(248, 251, 248, 0.48);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: #121b18;
  font-size: clamp(34px, 4.8vw, 56px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.25;
}

.topbar-meta,
.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-select {
  width: auto;
  min-width: 190px;
  min-height: 42px;
  border-color: rgba(37, 115, 93, 0.18);
  background: rgba(255, 255, 255, 0.86);
  font-weight: 800;
}

.soft-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(37, 115, 93, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.icon-button {
  width: 44px;
  min-width: 44px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  border: 1px solid rgba(217, 225, 220, 0.9);
  box-shadow: var(--shadow-soft);
}

.primary-button,
.whatsapp-button {
  padding: 0 16px;
  background: linear-gradient(135deg, #25735d, #134f40);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 14px 26px rgba(19, 79, 64, 0.2);
}

.primary-button:hover,
.whatsapp-button:hover {
  background: linear-gradient(135deg, #2f846c, #124c3e);
  transform: translateY(-1px);
}

.secondary-button {
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.full {
  width: 100%;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.care-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 20px;
  align-items: end;
  min-height: 210px;
  margin-bottom: 18px;
  padding: 26px;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(18, 32, 28, 0.9), rgba(18, 32, 28, 0.72) 45%, rgba(18, 32, 28, 0.16)),
    url("https://images.unsplash.com/photo-1576091160550-2173dba999ef?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
  color: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.care-hero .eyebrow,
.care-hero p,
.care-hero small {
  color: rgba(255, 255, 255, 0.76);
}

.care-hero h2 {
  max-width: 680px;
  margin-bottom: 10px;
  font-size: clamp(24px, 3.1vw, 40px);
  line-height: 1.05;
}

.care-hero p {
  max-width: 620px;
  margin-bottom: 0;
  line-height: 1.6;
}

.hero-metric {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.hero-metric span {
  display: block;
  font-size: 68px;
  font-weight: 900;
  line-height: 0.9;
}

.hero-metric small {
  max-width: 120px;
  text-align: right;
}

.subscription-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.45fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(37, 115, 93, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.subscription-panel h2,
.subscription-panel p {
  margin: 0;
}

.subscription-panel p:not(.eyebrow) {
  margin-top: 6px;
  color: var(--muted);
}

.subscription-meter {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.subscription-meter div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3ebe6;
}

.subscription-meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.growth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.growth-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 160px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.growth-card h2 {
  margin-bottom: 6px;
  font-size: 38px;
  line-height: 1;
}

.donut {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: conic-gradient(var(--accent) calc(var(--value) * 1%), #e3e9e5 0);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  width: 68px;
  height: 68px;
  border-radius: inherit;
  background: #fff;
}

.donut span {
  position: relative;
  z-index: 1;
  font-size: 18px;
  font-weight: 900;
}

.sparkline {
  display: flex;
  align-items: end;
  gap: 6px;
  width: 118px;
  height: 84px;
}

.sparkline span {
  flex: 1;
  min-width: 10px;
  border-radius: 999px 999px 3px 3px;
  background: linear-gradient(180deg, #d7af5b, var(--accent));
}

.mini-bars {
  display: grid;
  gap: 10px;
  width: 150px;
}

.mini-bar-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 20px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.mini-bar-row div {
  height: 8px;
  border-radius: 999px;
  background: #e5ebe7;
  overflow: hidden;
}

.mini-bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.mini-bar-row i.pending {
  background: var(--gold);
}

.mini-bar-row i.missed {
  background: var(--danger);
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
  margin-bottom: 18px;
}

.chart-panel {
  min-height: 300px;
}

.bar-chart {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  min-height: 220px;
  padding: 24px 20px 18px;
}

.bar-column {
  display: grid;
  justify-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.bar-column strong {
  color: var(--ink);
  font-size: 13px;
}

.bar-column span {
  display: block;
  width: min(42px, 70%);
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #d7af5b, #25735d);
  box-shadow: 0 14px 22px rgba(37, 115, 93, 0.14);
}

.bar-column small {
  font-size: 12px;
  font-weight: 800;
}

.service-list {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.service-row {
  display: grid;
  gap: 8px;
}

.service-row div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.service-row strong {
  font-size: 14px;
}

.service-row span {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: #e5ebe7;
  overflow: hidden;
}

.service-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #d7af5b);
}

.stat-card,
.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.stat-card {
  display: block;
  position: relative;
  width: 100%;
  text-align: left;
  min-height: 154px;
  padding: 18px;
  overflow: hidden;
  color: inherit;
  cursor: pointer;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), rgba(181, 130, 47, 0.65));
}

.stat-card:hover,
.stat-card.selected {
  transform: translateY(-2px);
  border-color: rgba(37, 115, 93, 0.34);
  box-shadow: var(--shadow);
}

.stat-card.selected::after {
  height: 5px;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.stat-icon.warning {
  background: var(--danger-soft);
  color: var(--danger);
}

.stat-icon.gold {
  background: var(--gold-soft);
  color: var(--gold);
}

.stat-icon.slate {
  background: var(--slate-soft);
  color: var(--slate);
}

.stat-card span,
.status-pill {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin: 7px 0 5px;
  font-size: 38px;
  line-height: 0.95;
}

.kpi-detail-panel {
  display: none;
  margin-bottom: 18px;
}

.kpi-detail-panel.visible {
  display: block;
}

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

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(340px, 0.72fr);
  gap: 18px;
  align-items: start;
}

.requests-panel {
  margin-top: 18px;
}

.request-item {
  background: rgba(255, 252, 244, 0.66);
}

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(217, 225, 220, 0.78);
  background: rgba(255, 255, 255, 0.45);
}

.queue-header-actions {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: min(460px, 100%);
}

.form-stack {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.schedule-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 250, 245, 0.78);
}

.schedule-preview:empty {
  display: none;
}

.schedule-preview .eyebrow {
  margin-bottom: 0;
}

.schedule-preview div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.schedule-preview span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.schedule-preview span.next {
  background: var(--accent-soft);
  border-color: #bfddcf;
  color: var(--accent-strong);
}

.schedule-preview span.done {
  background: var(--slate-soft);
  color: var(--slate);
}

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

.list {
  display: grid;
}

.empty-state {
  padding: 30px 18px;
  color: var(--muted);
}

.queue-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid rgba(217, 225, 220, 0.78);
  background: rgba(255, 255, 255, 0.52);
}

.queue-footer span {
  margin-right: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.queue-footer button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.followup-item,
.timeline-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 17px 18px;
  border-bottom: 1px solid rgba(217, 225, 220, 0.72);
  background: rgba(255, 255, 255, 0.42);
}

.followup-item:hover,
.timeline-item:hover {
  background: rgba(251, 250, 245, 0.9);
}

.followup-item:last-child,
.timeline-item:last-child {
  border-bottom: 0;
}

.item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-weight: 850;
}

.item-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-weight: 800;
}

.small-button:hover {
  border-color: rgba(37, 115, 93, 0.32);
  box-shadow: 0 8px 18px rgba(24, 39, 34, 0.08);
}

.small-button.done {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: #bfddcf;
}

.small-button.delete {
  color: var(--danger);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  white-space: nowrap;
}

.status-pill.overdue {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill.soon {
  background: var(--gold-soft);
  color: var(--gold);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid rgba(217, 225, 220, 0.78);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

tr:hover td {
  background: rgba(251, 250, 245, 0.75);
}

.search {
  max-width: 270px;
}

.timeline {
  display: grid;
}

.message-preview-panel {
  min-height: 100%;
}

.message-preview {
  display: block;
  width: calc(100% - 36px);
  min-height: 250px;
  margin: 18px;
  background: #fbfaf5;
  line-height: 1.65;
}

.message-send-note {
  margin: -4px 18px 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.whatsapp-button {
  width: calc(100% - 36px);
  margin: 0 18px 18px;
}

dialog {
  width: min(680px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(14, 24, 20, 0.5);
  backdrop-filter: blur(3px);
}

.dialog-card {
  background: #fff;
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
}

.dialog-header {
  border-bottom: 1px solid var(--line);
}

.dialog-actions {
  border-top: 1px solid var(--line);
}

.inline-manager {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf5;
}

.inline-manager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-manager-header h3 {
  margin: 0;
  font-size: 16px;
}

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

.managed-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #e2e8e4;
  border-radius: var(--radius);
  background: #fff;
}

.managed-row.branch-row label:nth-child(3) {
  grid-column: 1 / -2;
}

.managed-row.category-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.patient-app {
  min-height: 100vh;
}

.patient-topbar {
  justify-content: space-between;
  padding: 22px 30px;
}

.patient-main {
  width: min(1040px, calc(100% - 36px));
  margin: 0 auto;
  padding-bottom: 40px;
}

.patient-hero {
  min-height: 260px;
  padding: 34px;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(18, 32, 28, 0.9), rgba(18, 32, 28, 0.62)),
    url("https://images.unsplash.com/photo-1579684385127-1ef15d508118?auto=format&fit=crop&w=1500&q=80");
  background-position: center;
  background-size: cover;
  color: #fff;
  box-shadow: var(--shadow);
}

.patient-hero h1 {
  max-width: 760px;
  color: #fff;
}

.patient-hero p,
.patient-hero .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.patient-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.patient-card {
  padding: 22px;
}

.patient-card h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.patient-card p {
  color: var(--muted);
  line-height: 1.6;
}

.patient-card.wide {
  grid-column: 1 / -1;
  padding: 0;
}

.patient-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.patient-plan {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.patient-plan p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.patient-plan div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.patient-plan span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.patient-plan span.next {
  border-color: rgba(22, 105, 83, 0.35);
  background: #e5f5ee;
  color: var(--green-dark);
}

.patient-plan span.done {
  background: #f2f1e9;
  color: #7c827b;
  text-decoration: line-through;
}

.patient-plan small {
  color: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.patient-note {
  margin: 0;
  padding: 22px;
}

@media (max-width: 1000px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .pricing-strip {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    min-height: 440px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .sidebar-card,
  .clinic-panel {
    display: none;
  }

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

  .nav-item {
    justify-content: center;
  }

  .workspace-grid,
  .growth-grid,
  .analytics-grid,
  .subscription-panel {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 18px 14px 28px;
  }

  .topbar,
  .panel-header,
  .followup-item,
  .timeline-item {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .queue-header-actions {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .topbar-actions,
  .item-actions,
  .queue-footer {
    justify-content: stretch;
  }

  .queue-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .queue-footer span {
    margin-right: 0;
  }

  .topbar-actions .primary-button {
    flex: 1;
  }

  .nav-list,
  .workspace-grid,
  .growth-grid,
  .analytics-grid,
  .subscription-panel,
  .managed-row,
  .two-col,
  .care-hero,
  .patient-grid {
    grid-template-columns: 1fr;
  }

  .managed-row.branch-row label:nth-child(3) {
    grid-column: auto;
  }

  .growth-card {
    grid-template-columns: 1fr;
  }

  .mini-bars,
  .sparkline {
    width: 100%;
  }

  .auth-screen {
    padding: 18px 14px 28px;
  }

  .auth-hero {
    min-height: 420px;
    padding: 26px;
  }

  .auth-grid {
    gap: 16px;
  }

  .care-hero {
    min-height: 250px;
    padding: 22px;
  }

  .hero-metric {
    justify-items: start;
  }

  .hero-metric small {
    text-align: left;
  }

  .nav-item {
    justify-content: flex-start;
  }

  .search {
    max-width: none;
  }
}
