:root {
  --bg: #f4f7f6;
  --panel: #ffffff;
  --panel-soft: #edf6f3;
  --ink: #17211f;
  --muted: #63716d;
  --line: #dbe5e2;
  --brand: #13795b;
  --brand-dark: #0d5f48;
  --accent: #2d6cdf;
  --warning: #b95d19;
  --shadow: 0 18px 50px rgba(15, 31, 28, 0.1);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

.sidebar {
  background: #102721;
  color: #f7fffb;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 22px;
}

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

.brand-mark {
  align-items: center;
  background: #d9fff1;
  border-radius: 8px;
  color: var(--brand-dark);
  display: inline-flex;
  font-size: 26px;
  font-weight: 800;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand small,
.nav-tab small,
.privacy-note p {
  color: rgba(247, 255, 251, 0.72);
}

.nav-tabs {
  display: grid;
  gap: 10px;
}

.nav-tab {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #f7fffb;
  padding: 14px;
  text-align: left;
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.nav-tab:hover,
.nav-tab.active {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.nav-tab span {
  display: block;
  font-weight: 800;
  margin-bottom: 4px;
}

.privacy-note {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
  padding-top: 18px;
}

.privacy-note strong {
  display: block;
  margin-bottom: 8px;
}

.privacy-note p {
  line-height: 1.5;
  margin: 0;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  padding: 28px;
}

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

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 7px;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  margin-bottom: 0;
}

h2 {
  font-size: 21px;
  line-height: 1.2;
  margin-bottom: 0;
}

h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.top-actions,
.section-heading {
  align-items: center;
  display: flex;
  gap: 12px;
}

.section-heading {
  justify-content: space-between;
}

.primary-button,
.ghost-button {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
}

.primary-button {
  background: var(--brand);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.ghost-button {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.action-link {
  text-decoration: none;
}

.account-pill {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  min-height: 42px;
  padding: 5px 12px;
}

.account-pill span {
  font-size: 14px;
  font-weight: 900;
}

.account-pill small {
  color: var(--muted);
  font-size: 12px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.patient-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
}

.search-panel,
.details-panel,
.wide-panel,
.compact-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel,
.wide-panel,
.compact-panel {
  padding: 22px;
}

.details-panel {
  min-height: 640px;
  overflow: hidden;
}

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

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

input,
select,
textarea {
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 0 12px;
  width: 100%;
}

textarea {
  min-height: 80px;
  padding-top: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(19, 121, 91, 0.22);
  outline-offset: 2px;
}

.doctor-list,
.booking-list,
.pending-list {
  display: grid;
  gap: 12px;
}

.doctor-card {
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  padding: 16px;
  text-align: left;
  width: 100%;
}

.doctor-card:hover,
.doctor-card.active {
  border-color: rgba(19, 121, 91, 0.45);
  box-shadow: 0 10px 28px rgba(15, 31, 28, 0.08);
}

.doctor-meta,
.chip-row,
.slot-grid,
.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.doctor-meta {
  color: var(--muted);
  font-size: 13px;
}

.chip,
.count-pill {
  align-items: center;
  background: var(--panel-soft);
  border-radius: 999px;
  color: var(--brand-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  min-height: 26px;
  padding: 0 10px;
}

.chip.neutral {
  background: #eef1f0;
  color: var(--muted);
}

.chip.warning {
  background: #fff2e8;
  color: var(--warning);
}

.price {
  color: var(--brand-dark);
  font-weight: 900;
  white-space: nowrap;
}

.empty-state {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 640px;
  padding: 36px;
  text-align: center;
}

.empty-icon {
  align-items: center;
  background: var(--panel-soft);
  border-radius: 50%;
  color: var(--brand);
  display: inline-flex;
  font-size: 42px;
  font-weight: 900;
  height: 84px;
  justify-content: center;
  margin-bottom: 18px;
  width: 84px;
}

.doctor-profile {
  display: grid;
  gap: 20px;
}

.profile-cover {
  background:
    linear-gradient(rgba(16, 39, 33, 0.14), rgba(16, 39, 33, 0.16)),
    linear-gradient(135deg, #e2fff4, #d7e8ff);
  min-height: 150px;
  padding: 20px;
}

.profile-avatar {
  align-items: center;
  background: #ffffff;
  border: 4px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(15, 31, 28, 0.16);
  color: var(--brand-dark);
  display: inline-flex;
  font-size: 24px;
  font-weight: 900;
  height: 72px;
  justify-content: center;
  width: 72px;
}

.profile-body {
  display: grid;
  gap: 18px;
  padding: 0 22px 22px;
}

.profile-title {
  display: grid;
  gap: 8px;
  margin-top: -46px;
  padding-top: 56px;
}

.profile-title p,
.booking-card p,
.resource-strip p,
.helper-text {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0;
}

.profile-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding-top: 18px;
}

.profile-section h3 {
  margin-bottom: 0;
}

.location-box {
  background: #eef4f2;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  min-height: 120px;
  padding: 14px;
}

.mini-map {
  background:
    linear-gradient(90deg, rgba(19, 121, 91, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(19, 121, 91, 0.08) 1px, transparent 1px),
    #f8fbfa;
  background-size: 24px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 88px;
  position: relative;
}

.mini-map::after {
  background: var(--brand);
  border: 4px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(15, 31, 28, 0.18);
  content: "";
  height: 18px;
  left: 53%;
  position: absolute;
  top: 43%;
  width: 18px;
}

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

.slot-button {
  background: #f7fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  min-height: 46px;
}

.slot-button:hover,
.slot-button.selected {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.booking-form {
  background: var(--panel-soft);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.consent-row {
  align-items: start;
  color: var(--ink);
  display: grid;
  font-size: 13px;
  gap: 10px;
  grid-template-columns: auto 1fr;
}

.consent-row input {
  min-height: 18px;
  margin-top: 2px;
  width: 18px;
}

.dashboard-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.booking-card,
.pending-list article,
.resource-strip article,
.metrics-grid article {
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.booking-card {
  display: grid;
  gap: 8px;
}

.booking-actions,
.reschedule-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reschedule-form {
  flex: 1 1 320px;
}

.reschedule-form select {
  flex: 1 1 180px;
  min-width: 180px;
  width: auto;
}

.booking-card strong,
.pending-list strong {
  display: block;
}

.booking-card span,
.pending-list span {
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.resource-strip,
.metrics-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
  margin-top: 0;
}

.metrics-grid span {
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}

.metrics-grid strong {
  font-size: 30px;
}

.checklist {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.checklist label {
  align-items: start;
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr;
  padding: 14px;
}

.checklist input {
  min-height: 18px;
  width: 18px;
}

.pending-list {
  margin-top: 18px;
}

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

.toast {
  background: #102721;
  border-radius: 8px;
  bottom: 22px;
  box-shadow: var(--shadow);
  color: #ffffff;
  left: 50%;
  max-width: min(560px, calc(100% - 32px));
  opacity: 0;
  padding: 13px 16px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 16px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.auth-page {
  min-height: 100vh;
}

.auth-shell {
  align-items: center;
  display: grid;
  gap: 24px;
  justify-items: center;
  min-height: 100vh;
  padding: 28px;
}

.auth-brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  gap: 12px;
  text-decoration: none;
}

.auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  max-width: 460px;
  padding: 28px;
  width: 100%;
}

.auth-panel h1 {
  font-size: 30px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form ul {
  margin: 0;
  padding-left: 18px;
}

.auth-form small,
.auth-alternate,
.field-error {
  color: var(--muted);
  line-height: 1.5;
}

.field-error {
  color: #a33b2d;
  font-weight: 800;
}

.form-errors {
  background: #fff2e8;
  border: 1px solid #ffd4b8;
  border-radius: 8px;
  color: #8f390f;
  padding: 12px;
}

.auth-alternate {
  margin-bottom: 0;
}

.auth-alternate a {
  color: var(--brand-dark);
  font-weight: 900;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .nav-tabs,
  .patient-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .details-panel {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .main-content,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .top-actions,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .filters,
  .resource-strip,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

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

  .slot-grid {
    grid-template-columns: 1fr;
  }
}
