:root {
  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --ink: #17212b;
  --muted: #657487;
  --line: #dce5ee;
  --primary: #e60000;
  --primary-dark: #a80000;
  --accent: #0f7f83;
  --ok: #1e8e5a;
  --warn: #b7791f;
  --danger: #b42318;
  --shadow: 0 18px 55px rgba(23, 33, 43, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.theme-patient {
  --primary: #e60000;
  --primary-dark: #a80000;
  --accent: #0f7f83;
  --patient-action: #e60000;
  --patient-soft: #fff5f5;
  --patient-line: #d9e1ec;
  --patient-muted: #94a3b8;
}

.theme-doctor {
  --primary: #1267b2;
  --primary-dark: #0a4f8d;
  --accent: #e60000;
}

.theme-manager {
  --primary: #050505;
  --primary-dark: #000000;
  --accent: #1267b2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(230, 0, 0, 0.13), transparent 32rem),
    linear-gradient(135deg, #edf4f7 0%, #f8fbfc 50%, #edf2f0 100%);
}

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

button {
  border: 0;
  cursor: pointer;
}

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

.app-shell.theme-doctor {
  background:
    radial-gradient(circle at 20% 0%, rgba(18, 103, 178, 0.13), transparent 32rem),
    linear-gradient(135deg, #edf5fb 0%, #f8fbfc 50%, #eef4f8 100%);
}

.app-shell.theme-manager {
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 0, 0, 0.1), transparent 32rem),
    linear-gradient(135deg, #f0f2f4 0%, #fbfbfc 50%, #eef0f2 100%);
}

.app-shell.theme-patient {
  background: #fff;
}

.login-page {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(360px, 1fr);
  min-height: 100vh;
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px;
  color: #fff;
  background:
    linear-gradient(rgba(150, 0, 0, 0.76), rgba(105, 0, 0, 0.9)),
    url("https://images.unsplash.com/photo-1576091160550-2173dba999ef?auto=format&fit=crop&w=1200&q=80") center/cover;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.15rem;
}

.brand-logo {
  width: 170px;
  max-width: 48vw;
  height: auto;
  object-fit: contain;
}

.brand-logo.small {
  width: 156px;
  max-width: 44vw;
}

.app-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 7px 12px;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-weight: 950;
  letter-spacing: 0;
}

.app-wordmark-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 7px;
  font-size: 1.2rem;
  line-height: 1;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  font-size: 1.45rem;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin-bottom: 12px;
  border: 1px solid #ccd7e2;
  border-radius: 7px;
  color: #243340;
  background: #fff;
  font-weight: 850;
}

.google-btn::before {
  content: "G";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  background: #d93025;
  font-weight: 900;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.login-copy {
  max-width: 560px;
}

.login-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(2.15rem, 4vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.login-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.08rem;
  line-height: 1.7;
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 30px;
}

.trust-pill {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(10px);
}

.trust-pill strong {
  display: block;
  font-size: 1.24rem;
}

.trust-pill span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
}

.auth-box {
  width: min(100%, 460px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.auth-box h2 {
  margin: 0 0 6px;
  font-size: 1.55rem;
}

.auth-box > p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.45;
}

.pending-box {
  text-align: center;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: #e5eef4;
}

.segmented button {
  min-height: 42px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
}

.segmented button.active {
  color: var(--primary-dark);
  background: #fff;
  box-shadow: 0 6px 16px rgba(12, 124, 134, 0.16);
}

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

.role-choice-list button {
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid #cfdbe6;
  border-radius: 8px;
  color: #263647;
  background: #fff;
  font-size: 1rem;
  font-weight: 850;
  text-align: left;
}

.role-choice-list button:hover {
  border-color: var(--primary);
  background: #fff7f7;
}

.login-legal-footer {
  display: grid;
  gap: 3px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: #627184;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
}

.login-legal-footer strong {
  color: #334155;
  font-size: 0.82rem;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  color: #36485b;
  font-size: 0.88rem;
  font-weight: 750;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cfdbe6;
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
}

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

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 7px;
  font-weight: 800;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-btn {
  width: 100%;
  color: #fff;
  background: var(--primary);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.secondary-btn {
  color: var(--primary-dark);
  background: color-mix(in srgb, var(--primary) 12%, #fff);
}

.ghost-btn {
  color: #365164;
  background: #f0f5f8;
}

.danger-btn {
  color: #fff;
  background: var(--danger);
}

.icon-btn {
  min-width: 42px;
  padding: 8px 11px;
  color: #365164;
  background: #eff5f7;
}

.demo-box {
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  background: #f4f8fb;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.demo-box code {
  color: var(--primary-dark);
  font-weight: 800;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-weight: 900;
  object-fit: cover;
}

img.avatar {
  display: block;
}

.user-badge strong {
  display: block;
  font-size: 0.9rem;
}

.user-badge small {
  display: block;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: 244px 1fr;
  min-height: calc(100vh - 68px);
}

.sidebar {
  padding: 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.nav-button {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 7px;
  color: #405367;
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.nav-button.active {
  color: #fff;
  background: var(--primary);
}

.content {
  padding: 24px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: clamp(1.55rem, 2.5vw, 2.2rem);
  letter-spacing: 0;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.stat {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.stat span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.75rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 18px;
}

.panel,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 30px rgba(23, 33, 43, 0.06);
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2,
.panel h2 {
  margin: 0;
  font-size: 1.1rem;
}

.panel-head p,
.panel > p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.appointment,
.doctor-card,
.message,
.record {
  padding: 14px;
  border: 1px solid #e2eaf1;
  border-radius: 8px;
  background: #fff;
}

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

.doctor-presence {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

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

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #edf4f7;
  color: #486174;
  font-size: 0.8rem;
  font-weight: 800;
}

.tag.ok {
  color: #0b6840;
  background: #dcf5e7;
}

.tag.warn {
  color: #815206;
  background: #fff2d9;
}

.tag.danger {
  color: #a30000;
  background: #ffe2e2;
}

.tag.live {
  color: #fff;
  background: var(--accent);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.manager-chat-preview {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f7fafc;
}

.manager-chat-preview p {
  margin: 0;
}

.external-btn {
  color: #fff;
  background: #151f2b;
  text-decoration: none;
}

.doctor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.doctor-card h3,
.appointment h3,
.record h3 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.doctor-card p,
.appointment p,
.record p,
.message p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  white-space: pre-line;
}

.doctor-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.doctor-top .avatar {
  width: 46px;
  height: 46px;
  background: #204d5b;
}

.profile-photo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid #e2eaf1;
  border-radius: 8px;
  background: #fff;
}

.profile-photo {
  width: 82px;
  height: 82px;
  border-radius: 8px;
  font-size: 1.4rem;
  flex: 0 0 auto;
}

.privacy-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.availability {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 9px;
  border-radius: 7px;
  background: var(--surface-soft);
}

.consult-room {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: stretch;
  min-height: 0;
}

.video-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 440px;
  overflow: hidden;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(rgba(11, 42, 53, 0.74), rgba(11, 42, 53, 0.9)),
    url("https://images.unsplash.com/photo-1582750433449-648ed127bb54?auto=format&fit=crop&w=1200&q=80") center/cover;
}

.video-stage h2 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 2.6rem);
}

.video-stage p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
}

.video-controls {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.video-controls button {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  font-size: 1.12rem;
}

.chat {
  display: flex;
  flex-direction: column;
  height: min(640px, calc(100vh - 170px));
  min-height: 440px;
  overflow: hidden;
}

.chat-body {
  display: grid;
  align-content: start;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding: 12px;
  border: 1px solid #e2eaf1;
  border-radius: 8px;
  background: #f7fafc;
}

.message {
  max-width: 88%;
  padding: 10px 12px;
}

.message.me {
  justify-self: end;
  border-color: #c2e5e8;
  background: #e0f4f5;
}

.message strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.82rem;
}

.message-time {
  display: block;
  margin: -2px 0 6px;
  color: #7b8b9b;
  font-size: 0.72rem;
  font-weight: 700;
}

.chat-form {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 8px;
  margin-top: 10px;
  position: relative;
}

.chat-form input {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #cfdbe6;
  border-radius: 7px;
}

.attach-wrap {
  position: relative;
}

.attach-menu {
  position: absolute;
  left: 0;
  bottom: 50px;
  z-index: 4;
  display: grid;
  gap: 8px;
  min-width: 178px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(23, 33, 43, 0.14);
}

.attach-option {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 7px;
  color: #263746;
  background: #f6f9fb;
  text-align: left;
  font-weight: 800;
}

.attach-option:hover {
  background: color-mix(in srgb, var(--primary) 12%, #fff);
}

.attach-symbol {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  color: #fff;
  background: var(--primary);
}

.attachment-card {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
}

.attachment-card .attach-symbol {
  width: 38px;
  height: 38px;
}

.review-box {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, #fff);
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 7%, #fff);
}

.review-box h3,
.review-box p {
  margin: 0;
}

.review-box p {
  color: var(--muted);
  line-height: 1.4;
}

.star-rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
}

.star-rating input {
  position: absolute;
  opacity: 0;
}

.star-rating span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #bac4cf;
  font-size: 1.6rem;
  cursor: pointer;
}

.star-rating label:hover span,
.star-rating label:hover ~ label span,
.star-rating input:checked ~ span,
.star-rating label:has(input:checked) span,
.star-rating label:has(input:checked) ~ label span {
  color: #f6b51e;
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.table th,
.table td {
  padding: 13px 12px;
  border-bottom: 1px solid #e3ebf2;
  text-align: left;
}

.table th {
  color: #506378;
  background: #f4f8fb;
  font-size: 0.85rem;
}

.empty {
  padding: 28px;
  border: 1px dashed #c8d6e2;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: #f8fbfc;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 25, 34, 0.58);
}

.modal-backdrop.dismissible {
  cursor: pointer;
}

.modal {
  width: min(100%, 620px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-backdrop.dismissible .modal {
  cursor: default;
}

.mevo-modal {
  display: flex;
  flex-direction: column;
  width: min(1180px, calc(100vw - 32px));
  height: min(820px, calc(100vh - 32px));
  padding: 0;
  overflow: hidden;
}

.mevo-modal .modal-head {
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}

.mevo-frame-wrap {
  position: relative;
  flex: 1;
  min-height: 420px;
  background: #f4f7fa;
}

.mevo-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.mevo-patient-box {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--primary) 8%, #fff);
}

.mevo-patient-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--primary-dark);
  font-size: 0.92rem;
}

.mevo-patient-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 12px;
  color: #32465a;
  font-size: 0.86rem;
  line-height: 1.35;
}

.mevo-patient-grid span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mevo-fallback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 0 0 4px;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.notice {
  padding: 12px 14px;
  border-left: 4px solid var(--primary);
  border-radius: 7px;
  background: #eaf6f7;
  color: #234a52;
  line-height: 1.45;
}

.pix-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, #fff);
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 8%, #fff);
}

.pix-box p {
  margin: 5px 0 0;
  color: var(--muted);
}

.pix-key {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.pix-key code {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 11px 12px;
  border-radius: 7px;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 900;
}

.mobile-menu {
  display: none;
}

.patient-app {
  min-height: 100vh;
  padding-bottom: 92px;
  background: #fff;
}

.patient-content {
  width: min(100%, 980px);
  min-height: calc(100vh - 92px);
  margin: 0 auto;
  padding: 34px 34px 28px;
}

.patient-home {
  display: grid;
  gap: 24px;
}

.patient-hero {
  padding: 20px 0 6px;
}

.patient-hero-top,
.patient-more-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 42px;
}

.patient-avatar-group {
  display: flex;
  align-items: center;
}

.patient-main-avatar {
  width: 116px;
  height: 116px;
  border: 8px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #edf2f7;
  font-size: 2.6rem;
  background: #282a2e;
}

.patient-bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  color: #fff;
  background: var(--patient-action);
  font-size: 0;
}

.patient-bell::before {
  content: "!";
  font-size: 2rem;
  font-weight: 950;
}

.patient-bell span {
  position: absolute;
  top: -5px;
  right: -2px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 4px solid #fff;
  border-radius: 50%;
  color: #24272d;
  background: #fff;
  font-size: 1rem;
  font-weight: 950;
}

.patient-hero h1 {
  margin: 0;
  color: #25272d;
  font-size: clamp(3.1rem, 8vw, 5.2rem);
  line-height: 0.98;
  font-weight: 350;
}

.patient-hero h1 strong {
  font-weight: 950;
}

.patient-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 52px;
}

.patient-metrics div {
  display: grid;
  gap: 4px;
}

.patient-metrics span {
  display: block;
  color: var(--patient-action);
  font-size: 3.25rem;
  line-height: 1;
}

.health-pro-icon {
  display: block;
  width: 1em;
  height: 1em;
  color: currentColor;
}

.metric-health-icon {
  width: 1.05em;
  height: 1.05em;
}

.row-health-icon {
  width: 1.45rem;
  height: 1.45rem;
}

.patient-metrics strong {
  color: var(--patient-action);
  font-size: clamp(2.6rem, 9vw, 4.6rem);
  line-height: 0.95;
  font-weight: 950;
}

.patient-metrics small {
  color: #25272d;
  font-size: clamp(1.05rem, 4vw, 1.55rem);
  font-weight: 900;
}

.patient-primary-card,
.patient-info-strip {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 148px;
  padding: 28px 30px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--patient-action), #ff4d4d);
  text-align: left;
  overflow: hidden;
}

.patient-primary-card span,
.patient-primary-card strong {
  display: block;
  position: relative;
  z-index: 1;
  font-size: clamp(2rem, 7vw, 3.2rem);
  line-height: 1.05;
  font-weight: 900;
}

.patient-primary-card strong {
  font-size: clamp(1.5rem, 5.5vw, 2.55rem);
}

.patient-primary-card em {
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.7rem;
  font-style: normal;
  opacity: 0.72;
}

.patient-info-strip {
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  min-height: 112px;
  border: 1px solid #f2c7c7;
  color: #26323f;
  background: #fff;
}

.patient-info-strip span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  color: #fff;
  background: var(--patient-action);
  font-size: 2rem;
  font-weight: 900;
}

.patient-info-strip strong,
.patient-info-strip small {
  grid-column: 2;
}

.patient-info-strip strong {
  font-size: 1.55rem;
  line-height: 1.1;
}

.patient-info-strip small {
  color: #566579;
  font-size: 1rem;
  font-weight: 700;
}

.patient-info-strip em {
  grid-column: 3;
  grid-row: 1 / span 2;
  color: var(--patient-action);
  font-size: 2.3rem;
  font-style: normal;
  font-weight: 950;
}

.patient-screen,
.patient-more {
  display: grid;
  gap: 24px;
}

.patient-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 22px;
}

.patient-title-row h1,
.patient-more-head h1 {
  margin: 0;
  color: #25272d;
  font-size: clamp(2.8rem, 8vw, 4.4rem);
  line-height: 1;
  font-weight: 950;
}

.patient-back {
  width: 48px;
  height: 48px;
  color: var(--patient-muted);
  background: transparent;
  font-size: 4rem;
  line-height: 0.55;
  font-weight: 500;
}

.patient-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-bottom: 1px solid #edf2f7;
}

.patient-tabs button {
  min-height: 76px;
  border-bottom: 4px solid transparent;
  color: #25272d;
  background: #fff;
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 900;
}

.patient-tabs button.active {
  color: var(--patient-action);
  border-bottom-color: var(--patient-action);
}

.patient-filter-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
  border: 2px solid #edf2ff;
  border-radius: 8px;
}

.patient-filter-row button {
  min-height: 78px;
  color: #25272d;
  background: #fff;
  font-size: clamp(1.12rem, 4vw, 1.65rem);
  font-weight: 900;
}

.patient-filter-row button + button {
  border-left: 2px solid #edf2ff;
}

.patient-consult-list {
  display: grid;
  gap: 12px;
}

.patient-consult-item {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 98px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--patient-line);
  color: #25272d;
  background: #fff;
  text-align: left;
}

.patient-row-icon,
.patient-menu-row span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #fff;
  border-radius: 8px;
  background: var(--patient-action);
  font-size: 1.6rem;
  font-weight: 950;
}

.patient-consult-item strong,
.patient-menu-row strong {
  display: block;
  font-size: clamp(1.25rem, 4.5vw, 1.95rem);
  line-height: 1.15;
}

.patient-consult-item small {
  display: block;
  margin-top: 5px;
  color: var(--patient-muted);
  font-size: 1rem;
  font-weight: 700;
}

.patient-consult-item em,
.patient-menu-row em {
  color: var(--patient-action);
  font-size: 2.4rem;
  font-style: normal;
  font-weight: 900;
}

.patient-empty {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 330px;
  text-align: center;
}

.patient-empty p {
  margin: 0;
  color: var(--patient-muted);
  font-size: clamp(1.35rem, 5vw, 2.05rem);
}

.patient-empty button {
  color: var(--patient-action);
  background: transparent;
  font-size: clamp(1.25rem, 4.6vw, 1.8rem);
  font-weight: 950;
  text-decoration: underline;
}

.patient-menu-list {
  display: grid;
  border-top: 1px solid var(--patient-line);
}

.patient-menu-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 22px;
  min-height: 92px;
  padding: 12px 0;
  border-bottom: 1px solid var(--patient-line);
  color: #25272d;
  background: #fff;
  text-align: left;
}

.patient-menu-row.danger span {
  color: #fff;
  background: #e60000;
}

.patient-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: 88px;
  border-top: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.patient-bottom-nav button {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: #a7b4c6;
  background: transparent;
  font-size: 0.96rem;
  font-weight: 700;
}

.patient-bottom-nav button::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: transparent;
}

.patient-bottom-nav button.active {
  color: var(--patient-action);
}

.patient-bottom-nav button.active::before {
  background: var(--patient-action);
}

.patient-bottom-nav span {
  display: grid;
  place-items: center;
  font-size: 2.05rem;
  line-height: 1;
}

.patient-bottom-nav .nav-health-icon {
  width: 1.15em;
  height: 1.15em;
}

@media (max-width: 1060px) {
  .login-page,
  .layout,
  .grid-2,
  .consult-room {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-button {
    min-width: max-content;
  }

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

  .login-brand {
    min-height: 470px;
  }

  .chat {
    height: min(620px, 70vh);
  }

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

@media (max-width: 680px) {
  .login-brand,
  .login-panel,
  .content {
    padding: 20px;
  }

  .trust-row,
  .doctor-grid,
  .stats-grid,
  .row {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    padding: 14px;
  }

  .topbar-left,
  .topbar-right,
  .page-head,
  .appointment {
    align-items: stretch;
    flex-direction: column;
  }

  .page-head {
    display: grid;
  }

  .auth-box {
    padding: 20px;
  }

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

  .table {
    display: block;
    overflow-x: auto;
  }

  .chat {
    height: 68vh;
    min-height: 380px;
  }

  .chat-form {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .mevo-patient-grid {
    grid-template-columns: 1fr;
  }
}
