:root {
  --bg: #f5f9fc;
  --surface: #ffffff;
  --surface-soft: #eef7fb;
  --line: #d7e7ef;
  --text: #123044;
  --muted: #607487;
  --blue: #0f7ccf;
  --blue-strong: #07599b;
  --blue-soft: #dff2ff;
  --green: #18a87b;
  --green-soft: #dbf7ee;
  --coral: #ee6c5f;
  --amber: #c98b1f;
  --shadow: 0 18px 45px rgba(30, 82, 122, 0.14);
  --radius: 8px;
  --font: Inter, "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(223, 242, 255, 0.92) 0, rgba(245, 249, 252, 0.96) 420px),
    var(--bg);
  font-family: var(--font);
}

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

button {
  cursor: pointer;
}

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

svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 3rem;
  line-height: 1.02;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.2;
}

h3 {
  font-size: 1rem;
  line-height: 1.3;
}

label {
  display: grid;
  gap: 0.42rem;
  color: #33536a;
  font-size: 0.84rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid #cfe0e9;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(15, 124, 207, 0.14);
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.app-frame {
  width: min(1440px, 100%);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 2rem;
  border-bottom: 1px solid rgba(215, 231, 239, 0.9);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), #29b7c7);
  box-shadow: 0 12px 28px rgba(15, 124, 207, 0.28);
}

.brand-mark span,
.brand-mark::before {
  content: "";
  position: absolute;
  display: block;
  border-radius: 999px;
  background: #fff;
}

.brand-mark span {
  width: 1.22rem;
  height: 0.35rem;
}

.brand-mark::before {
  width: 0.35rem;
  height: 1.22rem;
}

.brand-name {
  font-size: 1.08rem;
  font-weight: 900;
}

.main-nav,
.account-strip,
.account-pill,
.support-line,
.inline-actions,
.chip-row,
.rating-row,
.price-row {
  display: flex;
  align-items: center;
}

.main-nav {
  justify-content: center;
  gap: 0.35rem;
}

.nav-link {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  color: var(--blue-strong);
  background: var(--blue-soft);
}

.account-strip {
  gap: 0.55rem;
}

.account-pill {
  max-width: 16rem;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  overflow: hidden;
}

.account-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.auth-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.48fr);
  gap: 1.5rem;
  width: min(1280px, 100%);
  margin: 0 auto;
  align-items: stretch;
}

.auth-copy,
.auth-card,
.panel,
.metric-card,
.patient-hero,
.doctor-profile-band {
  border: 1px solid rgba(215, 231, 239, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-copy {
  min-height: 40rem;
  padding: 2rem;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.72)),
    url("/assets/hero-telemedicine.png") center right / cover;
}

.auth-brand {
  margin-bottom: 5rem;
}

.auth-card {
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: 1.15rem;
}

.login-form,
.booking-form {
  display: grid;
  gap: 0.85rem;
}

.auth-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

.auth-switch a {
  color: var(--blue-strong);
  text-decoration: none;
}

.auth-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.auth-form-actions a {
  color: var(--blue-strong);
  font-weight: 800;
  text-decoration: none;
}

.account-role-note {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.3rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-strong);
  font-weight: 900;
  text-decoration: none;
}

.link-button:hover {
  color: var(--blue);
}

.link-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.verification-card {
  align-self: center;
}

.otp-input {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.35rem;
  text-align: center;
}

.verification-actions {
  align-items: center;
}

.dashboard-shell {
  min-height: calc(100vh - 8rem);
  padding: 2rem;
}

.page-head {
  margin-bottom: 1.2rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--blue-strong);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  max-width: 62rem;
  margin: 1rem 0 1.4rem;
  color: #34576f;
  font-size: 1.05rem;
  line-height: 1.65;
}

.lead.small {
  font-size: 1rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric-card {
  display: flex;
  gap: 0.85rem;
  padding: 1rem;
}

.metric-card span,
.metric-card small,
.report-card span,
.report-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 0.1rem 0;
  font-size: 1.55rem;
}

.metric-icon {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue-strong);
}

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

.dashboard-grid > .panel:only-child {
  grid-column: 1 / -1;
}

.admin-dashboard-grid .panel:last-child,
.doctor-dashboard-grid .panel:last-child,
.patient-dashboard-grid .panel:first-child,
.patient-dashboard-grid .panel:last-child {
  grid-column: 1 / -1;
}

.panel {
  padding: 1.05rem;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.primary-button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.55rem;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.primary-button:disabled,
.small-button:disabled,
.slot-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.primary-button {
  padding: 0.7rem 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #16a4bc);
  box-shadow: 0 14px 28px rgba(15, 124, 207, 0.24);
}

.small-button {
  padding: 0.55rem 0.75rem;
  color: var(--blue-strong);
  background: #e9f6ff;
}

.danger-button {
  color: #9a3d34;
  background: #fff2f0;
}

.primary-button:hover,
.small-button:hover {
  transform: translateY(-1px);
}

.notice,
.empty-state {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  color: #38586d;
}

.empty-state.compact {
  padding: 0.7rem;
  font-size: 0.86rem;
}

.empty-state {
  display: grid;
  gap: 0.35rem;
  min-height: 4rem;
  align-content: center;
}

.error-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-check-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.spinner {
  width: 1.15rem;
  height: 1.15rem;
  border: 3px solid #d5eaf6;
  border-top-color: var(--blue);
  border-radius: 999px;
  animation: spin 760ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.notice.danger {
  border-color: rgba(238, 108, 95, 0.38);
  background: #fff2f0;
  color: #9a3d34;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(18, 48, 68, 0.48);
  backdrop-filter: blur(10px);
}

.terms-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(42rem, 100%);
  max-height: min(44rem, calc(100vh - 2rem));
  overflow: hidden;
  border: 1px solid rgba(215, 231, 239, 0.95);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 70px rgba(18, 48, 68, 0.24);
}

.terms-modal-head,
.terms-actions {
  padding: 1rem;
}

.terms-modal-head {
  border-bottom: 1px solid var(--line);
}

.terms-modal-head p:last-child {
  margin: 0.65rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.terms-scroll {
  overflow: auto;
  padding: 1rem;
  color: #38586d;
  line-height: 1.6;
}

.terms-scroll h3 {
  margin-top: 1rem;
  color: var(--text);
}

.terms-scroll h3:first-child {
  margin-top: 0;
}

.terms-scroll p {
  margin: 0.35rem 0 0;
}

.terms-actions {
  display: grid;
  gap: 0.85rem;
  border-top: 1px solid var(--line);
  background: #f8fcff;
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  color: #33536a;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.45;
}

.consent-check input {
  width: 1.05rem;
  min-height: 1.05rem;
  flex: 0 0 auto;
  margin-top: 0.16rem;
  accent-color: var(--blue);
}

.signup-consent {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcff;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  background: #fff;
}

th,
td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #34576f;
  background: #f4fbff;
  font-size: 0.78rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.inline-actions {
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: var(--green-soft);
  color: #087758;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-suspended,
.status-requested,
.status-upcoming,
.status-pending {
  background: #fff6df;
  color: var(--amber);
}

.status-completed,
.status-confirmed,
.status-paid,
.status-approved,
.status-verified,
.status-waived {
  background: #e8f3ff;
  color: var(--blue-strong);
}

.status-cancelled,
.status-rejected,
.status-unverified,
.status-inactive {
  background: #fff2f0;
  color: #9a3d34;
}

.status-expired {
  background: #eef3f7;
  color: #526879;
}

.muted-cell {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.report-grid,
.record-grid,
.doctor-grid {
  display: grid;
  gap: 1rem;
}

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

.report-card,
.record-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.report-card strong {
  display: block;
  margin: 0.2rem 0;
  font-size: 1.8rem;
}

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

.record-card p {
  color: #38586d;
  line-height: 1.55;
}

.doctor-profile-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, 0.38fr);
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
}

.profile-band-avatar,
.profile-photo-preview,
.doctor-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-weight: 950;
}

.profile-band-avatar {
  width: 4.4rem;
  height: 4.4rem;
}

.profile-band-avatar img,
.profile-photo-preview img,
.doctor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-summary {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcff;
  color: var(--muted);
  line-height: 1.55;
}

.patient-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  overflow: hidden;
}

.patient-hero img {
  width: 100%;
  max-height: 15rem;
  border-radius: var(--radius);
  object-fit: cover;
}

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

.compact-grid {
  margin-top: 1rem;
}

.availability-grid {
  align-items: stretch;
}

.availability-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 28px rgba(30, 82, 122, 0.08);
}

.availability-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.doctor-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
}

.doctor-avatar {
  width: 3.2rem;
  height: 3.2rem;
  flex: 0 0 auto;
  border: 1px solid rgba(15, 124, 207, 0.16);
}

.availability-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.doctor-card-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcff;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.doctor-card-meta strong {
  color: var(--text);
}

.doctor-card-meta.secondary {
  background: #fff;
}

.doctor-bio {
  margin: 0;
  color: #38586d;
  line-height: 1.55;
}

.selected-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.selected-day span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.slot-button {
  display: inline-flex;
  min-height: 2.35rem;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.55rem;
  border: 1px solid #b9d7e8;
  border-radius: 8px;
  background: #f8fcff;
  color: var(--blue-strong);
  font-size: 0.86rem;
  font-weight: 900;
}

.slot-button:hover,
.slot-button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.slot-button.unavailable {
  border-color: #e5c5bf;
  background: #fff5f3;
  color: #9a3d34;
}

.slot-button.readonly {
  cursor: default;
}

.weekly-schedule {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.15rem;
}

.weekly-schedule span,
.weekly-schedule.empty {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.weekly-schedule strong {
  color: var(--text);
}

.booking-submit {
  width: 100%;
}

.compact-field {
  min-width: 12rem;
}

.booking-note-field {
  margin-bottom: 1rem;
}

.booking-flow-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 0.42fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.doctor-selector-list {
  display: grid;
  gap: 0.65rem;
}

.booking-doctor-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  width: 100%;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  color: inherit;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.booking-doctor-option:hover,
.booking-doctor-option.active {
  border-color: rgba(15, 124, 207, 0.36);
  background: #fff;
  box-shadow: 0 14px 30px rgba(25, 83, 125, 0.1);
  transform: translateY(-1px);
}

.booking-doctor-option.active {
  box-shadow: inset 3px 0 0 var(--blue), 0 14px 30px rgba(25, 83, 125, 0.1);
}

.booking-doctor-copy {
  display: grid;
  min-width: 0;
  gap: 0.14rem;
}

.booking-doctor-copy strong,
.booking-doctor-copy span,
.booking-doctor-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booking-doctor-copy span,
.booking-doctor-copy small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.booking-calendar-shell {
  display: grid;
  gap: 0.85rem;
}

.calendar-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.calendar-title {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  text-align: center;
}

.calendar-title strong {
  font-size: 1.05rem;
}

.calendar-title span,
.calendar-selection {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.calendar-nav-button {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.calendar-nav-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

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

.calendar-weekdays span {
  color: #678294;
  font-size: 0.75rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  display: grid;
  min-height: 4rem;
  aspect-ratio: 1;
  align-content: center;
  justify-items: center;
  gap: 0.1rem;
  border: 1px solid rgba(204, 225, 236, 0.95);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-weight: 900;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.calendar-day small {
  color: var(--blue-strong);
  font-size: 0.68rem;
  font-weight: 900;
}

.calendar-day:hover:not(:disabled),
.calendar-day.is-selected {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  transform: translateY(-1px);
}

.calendar-day:hover:not(:disabled) small,
.calendar-day.is-selected small {
  color: #fff;
}

.calendar-day.is-today:not(.is-selected) {
  border-color: rgba(15, 124, 207, 0.44);
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.calendar-day.outside-month {
  color: #8ba0ad;
  background: #f8fcff;
}

.calendar-day.is-disabled {
  cursor: not-allowed;
  color: #a7b6c0;
  background: #f1f6f9;
  opacity: 0.72;
}

.calendar-selection {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcff;
}

.calendar-selection strong {
  color: var(--text);
}

.slot-panel {
  display: grid;
  gap: 0.85rem;
}

.slot-panel > .availability-card {
  box-shadow: none;
}

.slot-panel-empty span {
  color: var(--muted);
  font-weight: 800;
}

.tiny-spinner {
  width: 0.9rem;
  height: 0.9rem;
  border-width: 2px;
}

.booking-notes {
  display: block;
  max-width: 18rem;
  color: #38586d;
  line-height: 1.45;
}

.profile-form,
.availability-editor {
  display: grid;
  gap: 0.85rem;
}

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

.profile-form-wide,
.form-actions {
  grid-column: 1 / -1;
}

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

.schedule-manager {
  display: grid;
  gap: 1.1rem;
}

.schedule-toolbar,
.schedule-blocks > div:first-child {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.schedule-toolbar h3,
.schedule-blocks h3 {
  margin: 0.15rem 0 0;
}

.schedule-toolbar span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
}

.schedule-rule-form {
  display: grid;
  gap: 0.8rem;
}

.weekday-schedule-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  overflow: hidden;
}

.weekday-schedule-card summary {
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  color: var(--text);
  font-weight: 900;
}

.weekday-schedule-card summary strong {
  color: var(--muted);
  font-size: 0.82rem;
}

.weekday-rule-list {
  display: grid;
  gap: 0.7rem;
  padding: 0 1rem 0.85rem;
}

.schedule-rule-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(7.5rem, 1fr)) auto auto;
  gap: 0.7rem;
  align-items: end;
  padding: 0.8rem;
  border: 1px solid rgba(206, 226, 237, 0.95);
  border-radius: var(--radius);
  background: #fff;
}

.toggle-field {
  display: inline-flex;
  min-height: 2.7rem;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-weight: 900;
}

.toggle-field input {
  width: auto;
}

.weekday-schedule-card > .small-button {
  margin: 0 1rem 1rem;
}

.schedule-blocks {
  display: grid;
  gap: 0.85rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(215, 231, 239, 0.75);
}

.availability-block-form {
  display: grid;
  grid-template-columns: minmax(9rem, 0.8fr) auto repeat(2, minmax(7rem, 0.7fr)) minmax(10rem, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcff;
}

.availability-block-reason {
  min-width: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.profile-photo-field {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcff;
}

.profile-photo-preview {
  width: 5.2rem;
  height: 5.2rem;
  flex: 0 0 auto;
  border: 1px solid rgba(15, 124, 207, 0.16);
}

.profile-photo-field label span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.profile-readiness {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.85rem;
  border: 1px solid rgba(201, 139, 31, 0.25);
  border-radius: var(--radius);
  background: #fffaf0;
  color: #70501a;
}

.profile-readiness.complete {
  border-color: rgba(24, 168, 123, 0.25);
  background: #f0fbf7;
  color: #087758;
}

.profile-readiness span {
  color: inherit;
  font-size: 0.9rem;
  font-weight: 700;
}

.admin-action-stack {
  display: grid;
  min-width: 20rem;
  gap: 0.55rem;
}

.reject-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
}

.doctor-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 28px rgba(30, 82, 122, 0.08);
}

.doctor-photo {
  min-height: 12rem;
  background-image: url("/assets/doctor-profiles.png");
  background-repeat: no-repeat;
  background-size: 200% 200%;
  background-position: var(--avatar-x) var(--avatar-y);
}

.large-avatar {
  min-height: 9rem;
  border-radius: var(--radius);
}

.doctor-body {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
}

.doctor-body p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.rating-row,
.price-row,
.chip-row {
  flex-wrap: wrap;
  gap: 0.45rem;
}

.rating-row {
  color: #856015;
  font-weight: 900;
}

.rating-row svg {
  color: #e2a72e;
  fill: #e2a72e;
}

.price-row {
  justify-content: space-between;
}

.price-row span,
.rating-row small {
  color: var(--muted);
}

.chip-row span {
  display: inline-flex;
  min-height: 1.65rem;
  align-items: center;
  padding: 0.28rem 0.48rem;
  border: 1px solid #d7e7ef;
  border-radius: 999px;
  background: #f8fcff;
  color: #426275;
  font-size: 0.75rem;
  font-weight: 800;
}

.booking-form {
  grid-template-columns: minmax(0, 1fr) 14rem;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 2rem 1.6rem;
  color: var(--muted);
}

.footer strong,
.footer span {
  display: inline-block;
}

.support-line {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 120;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: #123044;
  color: #fff;
  box-shadow: 0 16px 40px rgba(18, 48, 68, 0.25);
  opacity: 0;
  transform: translateY(0.5rem);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.dashboard-app {
  display: grid;
  grid-template-columns: 17.5rem minmax(0, 1fr);
  width: 100%;
  max-width: none;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f8fcff 0, #eef6fb 42rem),
    var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.15rem;
  border-right: 1px solid rgba(202, 222, 233, 0.85);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.sidebar-brand {
  padding: 0.45rem 0.25rem 1rem;
}

.brand-copy {
  display: grid;
  gap: 0.12rem;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.sidebar-section {
  display: grid;
  gap: 0.5rem;
}

.sidebar-secondary {
  padding-top: 0.85rem;
  border-top: 1px solid rgba(215, 231, 239, 0.82);
}

.sidebar-label {
  padding: 0 0.45rem;
  color: #7890a0;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  gap: 0.28rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.65rem;
  border: 1px solid transparent;
  font-size: 0.92rem;
}

.nav-link svg {
  flex: 0 0 auto;
}

.nav-link.active {
  border-color: rgba(15, 124, 207, 0.18);
  box-shadow: inset 3px 0 0 var(--blue), 0 10px 22px rgba(25, 83, 125, 0.08);
}

.sidebar-card {
  display: grid;
  gap: 0.45rem;
  margin-top: auto;
  padding: 0.9rem;
  border: 1px solid rgba(199, 223, 236, 0.9);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f7fcff, #edf8ff);
}

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

.sidebar-card small {
  color: var(--muted);
  line-height: 1.45;
}

.sidebar-account {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.account-avatar {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 0.82rem;
  font-weight: 950;
}

.account-meta {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
}

.account-meta strong,
.account-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-meta span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.icon-button {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.icon-button:hover {
  border-color: rgba(15, 124, 207, 0.35);
  color: var(--blue-strong);
  background: #f4fbff;
}

.workspace {
  min-width: 0;
}

.dashboard-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.6rem 1rem;
  border-bottom: 1px solid rgba(215, 231, 239, 0.82);
  background: rgba(248, 252, 255, 0.88);
  backdrop-filter: blur(18px);
}

.dashboard-topbar h1 {
  font-size: 2rem;
  line-height: 1.08;
}

.dashboard-topbar .lead {
  margin: 0.45rem 0 0;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.7rem;
}

.dashboard-shell {
  min-height: auto;
  padding: 1.4rem 1.6rem 1.8rem;
}

.footer {
  margin: 0 1.6rem 1.4rem;
  padding: 1rem;
  border: 1px solid rgba(204, 225, 236, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(25, 83, 125, 0.07);
}

.footer-brand,
.footer-support {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-brand-copy,
.footer-support {
  display: grid;
  gap: 0.15rem;
}

.footer-brand small,
.footer-support > span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.footer-mark {
  width: 2rem;
  height: 2rem;
  box-shadow: none;
}

.support-line {
  color: var(--blue-strong);
  font-weight: 900;
  text-decoration: none;
}

.section-stack {
  display: grid;
  gap: 1rem;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  gap: 0.75rem;
}

.quick-action-card {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  min-height: 6.1rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcff;
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.quick-action-card:hover {
  border-color: rgba(15, 124, 207, 0.32);
  background: #fff;
  box-shadow: 0 14px 30px rgba(25, 83, 125, 0.11);
  transform: translateY(-1px);
}

.quick-action-card strong,
.compact-list-item strong,
.status-summary strong {
  display: block;
}

.quick-action-card small,
.compact-list-item span,
.status-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.45;
}

.compact-list {
  display: grid;
  gap: 0.65rem;
}

.compact-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.status-summary {
  display: grid;
  gap: 0.6rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcff;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  gap: 0.85rem;
}

.metric-card,
.panel,
.patient-hero,
.doctor-profile-band,
.auth-card,
.auth-copy {
  border-color: rgba(204, 225, 236, 0.9);
  box-shadow: 0 16px 38px rgba(25, 83, 125, 0.09);
}

.metric-card {
  position: relative;
  overflow: hidden;
  align-items: flex-start;
  min-height: 7.1rem;
  background: #fff;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 4rem;
  height: 4rem;
  border-top-left-radius: 100%;
  background: rgba(223, 242, 255, 0.8);
}

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

.metric-card strong {
  font-size: 1.75rem;
}

.panel {
  padding: 1.15rem;
  background: rgba(255, 255, 255, 0.96);
}

.panel-head {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(215, 231, 239, 0.75);
}

.dashboard-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-grid > .panel {
  grid-column: span 6;
}

.dashboard-grid > .panel:only-child,
.admin-dashboard-grid .panel:last-child,
.doctor-dashboard-grid .panel:last-child,
.patient-dashboard-grid .panel:first-child,
.patient-dashboard-grid .panel:last-child {
  grid-column: 1 / -1;
}

.doctor-grid {
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.availability-card {
  align-content: start;
  border-color: rgba(206, 226, 237, 0.92);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.availability-card:hover {
  border-color: rgba(15, 124, 207, 0.28);
  box-shadow: 0 18px 38px rgba(25, 83, 125, 0.12);
  transform: translateY(-1px);
}

.doctor-card-meta {
  grid-template-columns: minmax(0, 1fr) auto;
}

.doctor-card-meta span:nth-child(2) {
  justify-self: end;
}

.doctor-card-meta strong {
  grid-column: 1 / -1;
  font-size: 1.1rem;
}

.doctor-bio {
  color: #46677b;
  font-size: 0.94rem;
}

.selected-day {
  border: 1px solid rgba(199, 223, 236, 0.78);
  background: #f4fbff;
}

.slot-grid {
  grid-template-columns: repeat(auto-fit, minmax(5.4rem, 1fr));
}

.slot-button {
  border-color: rgba(15, 124, 207, 0.22);
  background: #fff;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.slot-button:hover,
.slot-button.active {
  color: #fff;
  background: var(--blue);
  transform: translateY(-1px);
}

.slot-button.unavailable:hover {
  transform: none;
}

.weekly-schedule {
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

.weekly-schedule span,
.weekly-schedule.empty {
  background: #f8fcff;
}

.booking-note-field span,
.form-helper {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.form-helper {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcff;
}

.profile-form,
.availability-editor {
  grid-template-columns: repeat(2, minmax(12rem, 1fr));
}

.profile-form label,
.availability-editor label,
.booking-note-field {
  align-content: start;
}

.primary-button,
.small-button,
.icon-button {
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.primary-button:focus-visible,
.small-button:focus-visible,
.icon-button:focus-visible,
.slot-button:focus-visible,
.nav-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 124, 207, 0.18);
  outline-offset: 2px;
}

.primary-button:hover:not(:disabled) {
  box-shadow: 0 16px 32px rgba(15, 124, 207, 0.27);
}

.small-button:hover:not(:disabled) {
  box-shadow: 0 8px 18px rgba(25, 83, 125, 0.12);
}

.table-wrap {
  border-color: rgba(206, 226, 237, 0.95);
  background: #fff;
}

.data-table th {
  background: #f7fbfe;
  color: #426275;
  letter-spacing: 0.03em;
}

.data-table tbody tr {
  transition: background 140ms ease;
}

.data-table tbody tr:hover {
  background: #f8fcff;
}

.status-badge {
  border: 1px solid transparent;
}

.status-pending,
.status-upcoming {
  border-color: rgba(201, 139, 31, 0.25);
}

.status-approved,
.status-confirmed,
.status-completed,
.status-paid,
.status-verified,
.status-waived {
  border-color: rgba(15, 124, 207, 0.18);
}

.status-cancelled,
.status-rejected,
.status-unverified,
.status-inactive {
  border-color: rgba(238, 108, 95, 0.25);
}

.status-expired {
  border-color: rgba(82, 104, 121, 0.22);
}

.loading-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.skeleton-grid span {
  min-height: 5rem;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #edf6fb 0, #f9fdff 45%, #edf6fb 100%);
  background-size: 220% 100%;
  animation: shimmer 1.15s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.table-empty {
  display: grid;
  justify-items: start;
  gap: 0.4rem;
}

.table-empty svg {
  color: var(--blue-strong);
}

.doctor-profile-band {
  border-left: 4px solid var(--blue);
}

.patient-hero {
  padding: 1.2rem;
}

@media (max-width: 1120px) {
  .metric-grid,
  .doctor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-hero,
  .dashboard-grid,
  .booking-flow-grid,
  .patient-hero,
  .doctor-profile-band,
  .profile-form,
  .availability-editor {
    grid-template-columns: 1fr;
  }

  .schedule-rule-row,
  .availability-block-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 980px) {
  .dashboard-app {
    display: block;
  }

  .sidebar {
    position: sticky;
    z-index: 30;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(202, 222, 233, 0.85);
  }

  .sidebar-card {
    display: none;
  }

  .sidebar-secondary {
    display: none;
  }

  .sidebar-nav {
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  }

  .sidebar-account {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .dashboard-topbar {
    position: static;
  }

  .dashboard-grid > .panel {
    grid-column: 1 / -1;
  }

  .compact-list-item {
    align-items: flex-start;
  }

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

@media (max-width: 780px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 0.85rem 1rem;
  }

  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .sidebar {
    padding: 0.85rem;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .sidebar-nav .nav-link {
    flex: 0 0 auto;
  }

  .dashboard-topbar {
    flex-direction: column;
    padding: 1rem;
  }

  .account-strip {
    justify-content: space-between;
  }

  .auth-page,
  .dashboard-shell,
  .footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .footer {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .dashboard-shell {
    padding-top: 1rem;
  }

  .auth-hero,
  .metric-grid,
  .report-grid,
  .record-grid,
  .doctor-grid,
  .booking-form,
  .doctor-profile-band,
  .profile-form,
  .availability-editor,
  .availability-block-form,
  .schedule-rule-row,
  .doctor-card-meta,
  .reject-row,
  .slot-grid {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .availability-head,
  .schedule-toolbar,
  .schedule-blocks > div:first-child,
  .selected-day,
  .error-state {
    align-items: stretch;
    flex-direction: column;
  }

  .weekday-schedule-card summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .schedule-toolbar .primary-button,
  .availability-block-form .form-actions,
  .availability-block-form .small-button {
    width: 100%;
    justify-content: center;
  }

  .calendar-grid,
  .calendar-weekdays {
    gap: 0.25rem;
  }

  .calendar-day {
    min-height: 3.1rem;
    font-size: 0.86rem;
  }

  .auth-copy {
    min-height: 31rem;
    padding: 1.2rem;
  }

  .auth-brand {
    margin-bottom: 3rem;
  }

  h1 {
    font-size: 2.25rem;
  }

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

  .support-line {
    justify-content: flex-start;
  }

  .compact-list-item,
  .footer-brand,
  .footer-support {
    align-items: flex-start;
  }
}
