.mtr-doctors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 24px 0;
}

.mtr-doctor-card,
.mtr-doctor-profile,
.medical-calendar-card,
.medical-calendar-dialog {
  border: 1px solid #d7deee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(20, 32, 55, 0.08);
}

.mtr-doctor-card {
  padding: 18px;
}

.mtr-doctor-card h3 {
  margin: 12px 0 6px;
  color: #10203a;
}

.mtr-doctor-photo,
.mtr-doctor-profile-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: #eef3fb;
}

.mtr-button,
.medical-calendar-form .mtr-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border: 0;
  border-radius: 6px;
  background: #0b64d8;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.mtr-button:hover,
.mtr-button:focus {
  background: #084fae;
  color: #fff;
}

.mtr-input,
.mtr-form input,
.mtr-form textarea,
.medical-calendar-form input,
.medical-calendar-form select,
.medical-calendar-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c9d3e5;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: #111827;
  font: inherit;
}

.mtr-form,
.mtr-search-form {
  display: grid;
  gap: 12px;
}

.mtr-search-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin: 18px 0;
}

.mtr-alert {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 14px;
  background: #f8fafc;
  color: #334155;
}

.mtr-alert--success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.mtr-alert--error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.mtr-doctor-profile {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
  margin: 24px 0;
}

.mtr-profile-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.mtr-doctor-bio {
  margin: 12px 0 0;
  color: #2f3b4f;
  font-size: 20px;
  line-height: 1.45;
}

.mtr-doctor-bio p {
  margin: 0 0 12px;
}

.mtr-doctor-bio p:last-child {
  margin-bottom: 0;
}

.mtr-profile-facts span {
  border: 1px solid #d7deee;
  border-radius: 8px;
  padding: 12px;
  background: #f8fbff;
}

.mtr-profile-facts strong {
  display: block;
  margin-bottom: 4px;
  color: #51627c;
  font-size: 0.84rem;
}

.mtr-services-box {
  margin: 20px 0 24px;
  border: 1px solid #d7deee;
  border-radius: 12px;
  background: #f8fbff;
}

.mtr-services-box h3 {
  margin: 0;
  padding: 18px 20px 12px;
  color: #10203a;
  font-size: 32px;
  line-height: 1.2;
}

.mtr-services-list {
  padding: 0 20px 14px;
}

.mtr-service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid #d9d8d2;
}

.mtr-service-item p {
  margin: 0;
  color: #2f2d2d;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
}

.mtr-service-booking {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 26px;
  border-radius: 999px;
  background: #087f6b;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.mtr-service-booking:hover,
.mtr-service-booking:focus {
  background: #066f5d;
  color: #fff;
}

.mtr-directory {
  max-width: 1440px;
  margin: 0 auto 40px;
  padding: 0 24px;
  color: #141b2b;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mtr-directory-hero {
  padding: 32px 0;
  background: linear-gradient(180deg, #f9f9ff 0%, #ffffff 100%);
}

.mtr-directory-hero-text {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
}

.mtr-directory-hero h1 {
  margin: 0 0 16px;
  color: #141b2b;
  font-size: 48px;
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: 0;
}

.mtr-directory-hero p {
  margin: 0;
  color: #424656;
  font-size: 18px;
  line-height: 1.55;
}

.mtr-directory-search {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 80, 203, 0.08);
}

.mtr-directory-search label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 16px;
  border-right: 1px solid #c2c6d8;
  color: #727687;
}

.mtr-directory-search label:last-of-type {
  border-right: 0;
}

.mtr-directory-search input {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #141b2b;
  font: inherit;
  outline: 0;
}

.mtr-directory-search input:focus {
  box-shadow: none;
}

.mtr-directory-search button,
.mtr-filter-submit,
.mtr-card-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: #0066ff;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.mtr-directory-search button {
  padding: 0 32px;
}

.mtr-directory-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.mtr-directory-filters {
  align-self: start;
  padding: 24px;
  border: 1px solid #c2c6d8;
  border-radius: 16px;
  background: #f1f3ff;
}

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

.mtr-filter-head h3 {
  margin: 0;
  color: #141b2b;
  font-size: 20px;
}

.mtr-filter-head a {
  color: #0050cb;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.mtr-filter-group {
  padding: 14px 0;
  border-top: 1px solid #c2c6d8;
}

.mtr-filter-group:first-of-type {
  border-top: 0;
}

.mtr-filter-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #141b2b;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.mtr-filter-group summary::-webkit-details-marker {
  display: none;
}

.mtr-filter-group[open] summary span {
  transform: rotate(180deg);
}

.mtr-filter-options {
  display: grid;
  gap: 8px;
  max-height: 200px;
  margin-top: 12px;
  overflow: auto;
  padding-right: 4px;
}

.mtr-filter-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: #424656;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

.mtr-filter-group input {
  width: 16px;
  height: 16px;
  accent-color: #0050cb;
}

.mtr-filter-submit {
  width: 100%;
  margin-top: 16px;
}

.mtr-directory-results {
  display: grid;
  gap: 24px;
}

.mtr-results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mtr-results-toolbar p {
  margin: 0;
  color: #424656;
  font-size: 14px;
}

.mtr-results-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #727687;
  font-size: 12px;
  font-weight: 700;
}

.mtr-results-toolbar select {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: #0050cb;
  font-weight: 700;
}

.mtr-directory-card {
  display: flex;
  gap: 24px;
  padding: 24px;
  border: 1px solid #c2c6d8;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.mtr-directory-card:hover {
  border-color: #0050cb;
}

.mtr-directory-photo {
  position: relative;
  flex: 0 0 auto;
}

.mtr-directory-photo .mtr-doctor-photo {
  width: 160px;
  height: 160px;
  border: 4px solid #e1e8fd;
  border-radius: 50%;
  aspect-ratio: auto;
}

.mtr-directory-photo .mtr-doctor-photo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e1e8fd;
  color: #0050cb;
  font-size: 48px;
  font-weight: 800;
}

.mtr-directory-photo span {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #22c55e;
}

.mtr-directory-card-body {
  flex: 1;
  display: grid;
  gap: 16px;
  min-width: 0;
}

.mtr-card-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.mtr-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mtr-card-title h2 {
  margin: 0;
  color: #141b2b;
  font-size: 20px;
  line-height: 1.4;
}

.mtr-card-title span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #0066ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mtr-card-specialty {
  margin: 4px 0;
  color: #0066ff;
  font-size: 14px;
  font-weight: 700;
}

.mtr-card-location {
  margin: 0;
  color: #424656;
  font-size: 14px;
}

.mtr-card-rating {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
}

.mtr-card-rating strong {
  color: #141b2b;
}

.mtr-card-rating small {
  color: #727687;
}

.mtr-card-times p {
  margin: 0 0 8px;
  color: #727687;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mtr-card-times div,
.mtr-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mtr-card-times span,
.mtr-card-times a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 16px;
  border: 1px solid #c2c6d8;
  border-radius: 8px;
  color: #141b2b;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.mtr-card-times a {
  border-color: transparent;
  color: #0066ff;
}

.mtr-card-actions {
  padding-top: 8px;
}

.mtr-card-primary,
.mtr-card-secondary,
.mtr-card-whatsapp {
  padding: 0 32px;
}

.mtr-card-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 12px;
  background: #f1f3ff;
  color: #141b2b;
  font-weight: 800;
  text-decoration: none;
}

.mtr-card-whatsapp {
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #25d366;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.mtr-patient-portal {
  color: #102033;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mtr-patient-portal *,
.mtr-patient-portal *::before,
.mtr-patient-portal *::after {
  box-sizing: border-box;
}

.mtr-patient-login {
  display: grid;
  place-items: center;
  min-height: 520px;
  padding: 32px 16px;
  background: #f9f9ff;
}

.mtr-portal-login-card {
  width: min(460px, 100%);
  padding: 28px;
  border: 1px solid #c2c6d8;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.08);
}

.mtr-portal-login-card h2 {
  margin: 8px 0;
  color: #0f172a;
  font-size: 28px;
  line-height: 1.2;
}

.mtr-portal-login-card p {
  color: #64748b;
}

.mtr-portal-login-card input[type="text"],
.mtr-portal-login-card input[type="password"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c9d3e5;
  border-radius: 10px;
}

.mtr-portal-login-card .button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: #0050cb;
  color: #fff;
  font-weight: 800;
}

.mtr-portal-kicker {
  color: #0050cb;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mtr-emr-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 760px;
  overflow: hidden;
  background: #f9f9ff;
  transition: grid-template-columns 0.2s ease;
}

.mtr-emr-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 100vh;
  padding: 24px 16px;
  border-right: 1px solid #c2c6d8;
  background: #fff;
}

.mtr-emr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  color: #0050cb;
  font-size: 22px;
}

.mtr-emr-brand span,
.mtr-emr-user-card > div {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #dae1ff;
  color: #0050cb;
  font-weight: 900;
}

.mtr-emr-user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding: 14px;
  border-radius: 12px;
  background: #f1f3ff;
}

.mtr-emr-user-card p {
  display: grid;
  gap: 2px;
  margin: 0;
}

.mtr-emr-user-card span {
  color: #64748b;
  font-size: 12px;
}

.mtr-emr-nav {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 0;
}

.mtr-emr-nav a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  height: auto;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: #424656;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.mtr-emr-nav a:hover,
.mtr-emr-nav a:focus,
.mtr-emr-nav a.mtr-emr-nav-link--active {
  background: #f1f3ff;
  color: #0050cb;
}

.mtr-emr-main {
  min-width: 0;
  background: #f9f9ff;
}

.mtr-emr-shell--sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.mtr-emr-shell--sidebar-collapsed .mtr-emr-sidebar {
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  padding-left: 0;
  padding-right: 0;
  border-right: 0;
}

.mtr-portal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 32px;
  border-bottom: 1px solid #c2c6d8;
  background: #f9f9ff;
}

.mtr-emr-sidebar-toggle {
  min-width: 124px;
}

.mtr-portal-header > a:first-child {
  margin-right: auto;
  color: #0050cb;
  font-weight: 900;
  text-decoration: none;
}

.mtr-emr-main > .mtr-alert,
.mtr-emr-hero,
.mtr-emr-actions,
.mtr-emr-card,
.mtr-emr-grid-two {
  margin-left: 32px;
  margin-right: 32px;
}

.mtr-emr-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: 24px;
  margin-top: 32px;
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid #c2c6d8;
  border-radius: 12px;
  background: #fff;
}

.mtr-emr-list-hero {
  align-items: center;
}

.mtr-emr-hero h1 {
  margin: 6px 0 8px;
  color: #141b2b;
  font-size: 34px;
  line-height: 1.15;
}

.mtr-emr-hero p {
  margin: 0;
  color: #64748b;
}

.mtr-emr-patient-top {
  display: flex;
  gap: 24px;
  min-width: 0;
}

.mtr-emr-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 128px;
  height: 128px;
  border-radius: 12px;
  background: #dae1ff;
  color: #0050cb;
  font-size: 34px;
  font-weight: 900;
}

.mtr-emr-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.mtr-emr-title-row h1 {
  margin: 0;
}

.mtr-emr-title-row span {
  border-radius: 999px;
  padding: 5px 10px;
  background: #eafaf5;
  color: #096045;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.mtr-emr-contact-card,
.mtr-emr-fact,
.mtr-emr-empty {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
}

.mtr-emr-contact-card {
  align-content: start;
  color: #0f172a;
  font-weight: 700;
}

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

.mtr-emr-fact span,
.mtr-emr-pill-group > span,
.mtr-emr-field span,
.mtr-emr-form-footer span,
.mtr-emr-empty {
  color: #64748b;
  font-size: 13px;
}

.mtr-emr-fact strong {
  color: #0f172a;
  word-break: break-word;
}

.mtr-emr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.mtr-emr-action,
.mtr-emr-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  background: #0050cb;
  color: #fff;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.mtr-emr-action {
  border: 1px solid rgba(23, 107, 135, 0.16);
  background: #fff;
  color: #176b87;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.mtr-emr-action-form {
  display: inline-flex;
  margin: 0;
}

.mtr-emr-action:hover,
.mtr-emr-action:focus {
  background: #176b87;
  color: #fff;
}

.mtr-emr-action-danger {
  border-color: #fecaca;
  background: #fff5f5;
  color: #991b1b;
}

.mtr-emr-action-danger:hover,
.mtr-emr-action-danger:focus {
  background: #b91c1c;
  color: #fff;
}

.mtr-emr-button-secondary {
  background: #475569;
}

.mtr-emr-button-danger {
  background: #dc2626;
  color: #fff;
}

.mtr-emr-button-danger:hover,
.mtr-emr-button-danger:focus-visible {
  background: #b91c1c;
}

.mtr-modal-open {
  overflow: hidden;
}

.mtr-clinical-modal[hidden] {
  display: none;
}

.mtr-clinical-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.mtr-clinical-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
}

.mtr-clinical-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  padding: 24px;
  border: 1px solid #d7deee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.mtr-clinical-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.mtr-clinical-modal-head h2 {
  margin: 4px 0 0;
  color: #102033;
  font-size: 30px;
  line-height: 1.15;
}

.mtr-clinical-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 28px;
  font-weight: 800;
  cursor: pointer;
}

.mtr-clinical-visits {
  display: grid;
  gap: 12px;
}

.mtr-clinical-visit-card {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid #d7deee;
  border-left: 4px solid #0050cb;
  border-radius: 10px;
  background: #f8fbff;
  color: inherit;
  text-align: left;
}

.mtr-clinical-visit-card-button {
  font: inherit;
  cursor: pointer;
  appearance: none;
}

.mtr-clinical-visit-card-button:hover,
.mtr-clinical-visit-card-button:focus-visible {
  border-color: #84aef5;
  border-left-color: #0050cb;
  background: #f3f7ff;
  box-shadow: 0 14px 28px rgba(0, 80, 203, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.mtr-emr-card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.mtr-emr-card-title h3 {
  margin: 0;
}

.mtr-emr-mini-button,
.mtr-emr-file-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #d7deee;
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  color: #0f6f85;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
}

.mtr-emr-mini-button:hover,
.mtr-emr-mini-button:focus-visible,
.mtr-emr-file-link:hover,
.mtr-emr-file-link:focus-visible {
  border-color: #9eb7d0;
  background: #f8fbff;
  outline: none;
}

.mtr-emr-file-help {
  margin-top: 10px;
  color: #64748b;
  font-size: 13px;
}

.mtr-emr-file-list {
  display: grid;
  gap: 10px;
}

.mtr-emr-file-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #d7deee;
  border-left: 4px solid #0050cb;
  border-radius: 10px;
  background: #f8fbff;
}

.mtr-emr-file-card > div {
  display: grid;
  gap: 4px;
}

.mtr-emr-file-card strong {
  color: #102033;
  font-size: 16px;
}

.mtr-emr-file-card span,
.mtr-emr-file-card p {
  color: #64748b;
}

.mtr-emr-file-card p {
  margin: 0;
  line-height: 1.35;
}

.mtr-clinical-visit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mtr-clinical-visit-head strong {
  color: #102033;
  font-size: 18px;
}

.mtr-clinical-visit-head span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.mtr-clinical-visit-body {
  display: grid;
  gap: 8px;
}

.mtr-clinical-visit-body p {
  display: grid;
  gap: 3px;
  margin: 0;
  color: #0f172a;
  line-height: 1.35;
}

.mtr-clinical-visit-body span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.mtr-visit-detail {
  display: grid;
  gap: 18px;
}

.mtr-visit-detail-date {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef4ff;
  color: #475569;
  font-weight: 800;
}

.mtr-visit-detail-grid {
  display: grid;
  gap: 12px;
}

.mtr-visit-detail-grid section {
  padding: 14px;
  border: 1px solid #d7deee;
  border-radius: 12px;
  background: #f8fbff;
}

.mtr-visit-detail-grid span {
  display: block;
  margin-bottom: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.mtr-visit-detail-grid p {
  margin: 0;
  color: #102033;
  line-height: 1.45;
  white-space: pre-wrap;
}

.mtr-emr-card {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.mtr-emr-card h3 {
  margin-top: 0;
  color: #102033;
}

.mtr-emr-grid-two {
  align-items: start;
  margin-bottom: 32px;
}

.mtr-emr-stack {
  display: grid;
  gap: 24px;
}

.mtr-emr-stack .mtr-emr-card {
  margin-bottom: 0;
}

.mtr-emr-grid-two > .mtr-emr-card {
  margin-left: 0;
  margin-right: 0;
}

.mtr-portal-search {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.mtr-portal-search .mtr-emr-input {
  flex: 1;
}

.mtr-emr-form,
.mtr-emr-form-section {
  display: grid;
  gap: 18px;
}

.mtr-emr-form-section {
  padding-bottom: 18px;
  border-bottom: 1px solid #e2e8f0;
}

.mtr-emr-field {
  display: grid;
  gap: 7px;
}

.mtr-emr-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c9d3e5;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #111827;
  font: inherit;
}

textarea.mtr-emr-input {
  min-height: 96px;
}

.mtr-span-2 {
  grid-column: span 2;
}

.mtr-emr-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.mtr-recurrence-fieldset {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid #d7deee;
  border-radius: 12px;
  background: #f8fbff;
}

.mtr-recurrence-fieldset legend {
  padding: 0 8px;
  color: #102033;
  font-weight: 900;
}

.mtr-recurrence-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.mtr-schedule-blocks {
  display: grid;
  gap: 10px;
}

.mtr-saturday-schedule-blocks {
  margin-top: 10px;
}

.mtr-schedule-block-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.55fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.mtr-schedule-block-row strong {
  color: #0f172a;
  font-weight: 900;
}

.mtr-schedule-block-row label {
  display: grid;
  gap: 6px;
}

.mtr-schedule-block-row label span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.mtr-emr-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mtr-base-schedule-footer {
  flex-direction: column;
  align-items: stretch;
}

.mtr-base-schedule-footer .mtr-emr-button {
  width: 100%;
  max-width: none;
  min-width: 0;
  white-space: normal;
  font-size: 15px;
  line-height: 1.2;
  padding: 14px 16px;
}

.mtr-delete-confirm[hidden] {
  display: none !important;
}

.mtr-delete-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff1f2;
  color: #7f1d1d;
}

.mtr-delete-confirm strong {
  display: block;
  margin-bottom: 3px;
  color: #7f1d1d;
  font-weight: 900;
}

.mtr-delete-confirm span {
  color: #991b1b;
  font-size: 14px;
}

.mtr-delete-confirm > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.mtr-portal-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.mtr-portal-table th,
.mtr-portal-table td {
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.mtr-portal-table a {
  color: #0050cb;
  font-weight: 900;
  text-decoration: none;
}

.mtr-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef7fb;
  color: #176b87;
  font-size: 12px;
  font-weight: 900;
  text-transform: capitalize;
}

.mtr-status-pill--nueva {
  background: #eaf6ff;
  color: #176b87;
}

.mtr-status-pill--confirmada {
  background: #dcfce7;
  color: #166534;
}

.mtr-status-pill--cancelada {
  background: #f1f5f9;
  color: #64748b;
}

.mtr-status-pill--concretada {
  background: #e0e7ff;
  color: #3730a3;
}

.mtr-appointments-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(200px, 1fr) minmax(170px, 0.8fr) minmax(210px, 1fr) auto;
  align-items: center;
}

.mtr-appointments-controls .mtr-emr-input,
.mtr-appointments-controls .mtr-emr-button {
  width: 100%;
  min-width: 0;
  height: 46px;
  min-height: 46px;
  max-height: 46px;
  margin: 0;
  padding: 10px 14px;
  line-height: 1.2;
  white-space: nowrap;
}

.mtr-appointments-controls .mtr-emr-input {
  appearance: auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mtr-appointments-controls .mtr-emr-button {
  width: auto;
  min-width: 96px;
  flex: 0 0 auto;
}

.mtr-appointments-week-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}

.mtr-appointments-week-nav strong {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 10px;
  background: #f8fafc;
  color: #102033;
}

.mtr-appointments-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.mtr-appointments-calendar-wrap {
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 8px;
}

.mtr-appointments-calendar {
  --mtr-hour-row-height: 124px;
  display: grid;
  grid-template-columns: 92px repeat(7, minmax(190px, 1fr));
  min-width: 1420px;
  border: 1px solid #d7deee;
  border-radius: 10px;
  overflow: visible;
  background: #fff;
}

.mtr-appointments-time-head,
.mtr-appointments-day-head,
.mtr-appointments-time-label,
.mtr-appointments-slot {
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.mtr-appointments-day-head {
  display: grid;
  gap: 2px;
  min-height: 62px;
  padding: 12px;
  background: #f8fafc;
  color: #102033;
}

.mtr-appointments-day-head span {
  color: #64748b;
  font-weight: 800;
}

.mtr-appointments-time-label {
  min-height: var(--mtr-hour-row-height);
  padding: 12px 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
}

.mtr-appointments-slot {
  position: relative;
  min-height: var(--mtr-hour-row-height);
  padding: 8px;
  background: #fff;
  cursor: pointer;
  align-content: start;
  overflow: visible;
}

.mtr-appointments-slot:hover {
  background: #f8fbff;
}

.mtr-appointment-card {
  position: absolute;
  top: calc(8px + var(--mtr-appointment-stack-offset, 0px));
  left: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: max(116px, calc((var(--mtr-appointment-card-hour-span, 1) * var(--mtr-hour-row-height)) - 8px));
  min-height: 0;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid #cfe0ff;
  border-left: 4px solid #3b82f6;
  border-radius: 8px;
  background: #f8fbff;
  cursor: pointer;
  outline: 0;
  z-index: 5;
  overflow: visible;
}

.mtr-appointment-card > *:not(.mtr-appointment-tooltip) {
  flex: 0 0 auto;
}

.mtr-appointments-slot-unscheduled .mtr-appointment-card {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  height: auto;
  min-height: 116px;
  margin-bottom: 8px;
}

.mtr-appointment-card:hover,
.mtr-appointment-card:focus-visible {
  z-index: 20;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

.mtr-appointment-card--confirmada {
  border-color: #bbf7d0;
  border-left-color: #22c55e;
  background: #f0fdf4;
}

.mtr-appointment-card--cancelada {
  border-color: #e2e8f0;
  border-left-color: #94a3b8;
  background: #f8fafc;
  opacity: 0.72;
}

.mtr-appointment-card--concretada {
  border-color: #c7d2fe;
  border-left-color: #4f46e5;
  background: #eef2ff;
}

.mtr-appointment-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 0;
}

.mtr-appointment-card-head strong {
  max-width: 52px;
  color: #0f172a;
  font-size: 14px;
  line-height: 1;
}

.mtr-appointment-card-head .mtr-status-pill {
  flex: 0 0 auto;
  max-width: 92px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  line-height: 1;
}

.mtr-appointment-card-visible {
  position: static;
  display: grid;
  gap: 1px;
  margin-top: 3px;
}

.mtr-patient-portal .mtr-appointment-card .mtr-appointment-card-visible h3 {
  margin: 0;
  margin-block: 0;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.mtr-patient-portal .mtr-appointment-card .mtr-appointment-card-visible p {
  margin: 0 !important;
  margin-block: 0 !important;
  color: #475569;
  font-size: 10px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.mtr-patient-portal .mtr-appointment-card .mtr-appointment-card-doctor {
  display: block;
  max-width: 100%;
  min-height: 11px;
  margin: 0 !important;
  margin-block: 0 !important;
  color: #334155;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mtr-appointment-tooltip {
  position: absolute;
  left: 12px;
  top: calc(100% + 10px);
  z-index: 40;
  display: grid;
  gap: 5px;
  min-width: 240px;
  max-width: 300px;
  padding: 12px;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  color: #0f172a;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.mtr-appointment-tooltip::before {
  content: "";
  position: absolute;
  left: 18px;
  top: -7px;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  background: inherit;
}

.mtr-appointment-tooltip strong {
  font-size: 13px;
}

.mtr-appointment-tooltip span {
  color: inherit;
}

.mtr-appointment-tooltip em {
  margin-top: 4px;
  font-style: normal;
  font-weight: 900;
}

.mtr-appointment-card:hover .mtr-appointment-tooltip,
.mtr-appointment-card:focus-visible .mtr-appointment-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.mtr-appointment-card--nueva .mtr-appointment-tooltip {
  background: #dbeafe;
  border: 1px solid #93c5fd;
}

.mtr-appointment-card--confirmada .mtr-appointment-tooltip {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #14532d;
}

.mtr-appointment-card--cancelada .mtr-appointment-tooltip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.mtr-appointment-card--concretada .mtr-appointment-tooltip {
  background: #e0e7ff;
  border: 1px solid #a5b4fc;
  color: #312e81;
}

.mtr-appointments-empty {
  margin-top: 12px;
  padding: 14px;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
}

.mtr-appointments-upcoming {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid #d7deee;
  border-radius: 10px;
  background: #fff;
}

.mtr-appointments-upcoming h2 {
  margin: 0;
  color: #102033;
  font-size: 24px;
  line-height: 1.2;
}

.mtr-appointments-upcoming-head p {
  margin: 0 0 8px;
  color: #64748b;
  font-weight: 800;
}

.mtr-appointments-upcoming-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.mtr-appointments-upcoming-list .mtr-emr-list-row {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.mtr-upcoming-appointment span {
  color: #64748b;
  font-size: 13px;
}

.mtr-internal-appointment-modal .mtr-clinical-modal-dialog {
  max-width: 860px;
}

.mtr-internal-appointment-modal [hidden] {
  display: none !important;
}

.mtr-emr-pill-group {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.mtr-emr-pill-group div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mtr-emr-pill-group b {
  border-radius: 999px;
  padding: 6px 10px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 13px;
}

.mtr-emr-list-row {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.mtr-emr-list-row:last-child {
  border-bottom: 0;
}

.mtr-emr-list-row span {
  color: #64748b;
}

.medical-calendar-page {
  margin: 30px 0;
  color: #10203a;
}

.medical-calendar-header {
  margin-bottom: 18px;
}

.medical-calendar-header h2 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: #10203a;
}

.medical-calendar-header p {
  margin: 0;
  color: #5d6b82;
}

.medical-calendar-card {
  padding: 18px;
}

.medical-calendar-toolbar,
.medical-calendar-modal-head,
.medical-calendar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.medical-calendar-toolbar h3 {
  margin: 0;
  text-transform: capitalize;
}

.medical-calendar-toolbar button,
.medical-calendar-modal-head button,
.medical-calendar-actions button {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid #c9d3e5;
  border-radius: 6px;
  background: #fff;
  color: #10203a;
  font-weight: 700;
  cursor: pointer;
}

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

.medical-calendar-weekdays {
  margin: 18px 0 8px;
  color: #64748b;
  font-weight: 700;
  text-align: center;
}

.medical-calendar-day {
  min-height: 110px;
  border: 1px solid #d7deee;
  border-radius: 8px;
  background: #fff;
  color: #10203a;
  text-align: left;
  padding: 12px;
  cursor: pointer;
}

.medical-calendar-day strong {
  display: block;
  font-size: 1.2rem;
}

.medical-calendar-day span {
  display: block;
  margin-top: 18px;
  color: #64748b;
  font-size: 0.84rem;
}

.medical-calendar-day--available {
  border-color: #93c5fd;
  background: #eff6ff;
}

.medical-calendar-day--limited {
  border-color: #facc15;
  background: #fefce8;
}

.medical-calendar-day--unavailable,
.medical-calendar-day--past {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.medical-calendar-day--today {
  box-shadow: inset 0 0 0 2px #0b64d8;
}

.medical-calendar-day--empty {
  visibility: hidden;
}

.medical-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  color: #64748b;
  font-size: 0.92rem;
}

.medical-calendar-modal[hidden] {
  display: none;
}

.medical-calendar-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.56);
}

.medical-calendar-dialog {
  width: min(680px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 22px;
}

.medical-calendar-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.medical-calendar-form label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-weight: 700;
}

.medical-calendar-form label:nth-last-of-type(1),
.medical-calendar-form .mtr-alert,
.medical-calendar-actions {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  .mtr-doctor-profile,
  .medical-calendar-form,
  .mtr-search-form {
    grid-template-columns: 1fr;
  }

  .mtr-directory {
    padding: 0 16px;
  }

  .mtr-directory-hero h1 {
    font-size: 32px;
    line-height: 1.2;
  }

  .mtr-directory-search,
  .mtr-directory-card,
  .mtr-card-top,
  .mtr-results-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .mtr-directory-search label {
    border-right: 0;
    border-bottom: 1px solid #c2c6d8;
  }

  .mtr-directory-layout {
    grid-template-columns: 1fr;
  }

  .mtr-directory-photo {
    align-self: center;
  }

  .mtr-card-rating {
    align-items: flex-start;
  }

  .mtr-card-primary,
  .mtr-card-secondary {
    flex: 1 1 180px;
  }

  .mtr-services-box h3 {
    font-size: 26px;
  }

  .mtr-service-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .mtr-service-item p {
    font-size: 21px;
  }

  .mtr-service-booking {
    width: 100%;
  }

  .mtr-emr-shell,
  .mtr-emr-hero,
  .mtr-emr-facts,
  .mtr-emr-grid-two,
  .mtr-emr-form-grid {
    grid-template-columns: 1fr;
  }

  .mtr-schedule-block-row {
    grid-template-columns: 1fr;
  }

  .mtr-emr-sidebar {
    min-height: auto;
  }

  .mtr-emr-shell--sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .mtr-portal-header,
  .mtr-emr-patient-top,
  .mtr-emr-form-footer,
  .mtr-portal-search {
    flex-direction: column;
    align-items: stretch;
  }

  .mtr-emr-main > .mtr-alert,
  .mtr-emr-hero,
  .mtr-emr-actions,
  .mtr-emr-card,
  .mtr-emr-grid-two {
    margin-left: 16px;
    margin-right: 16px;
  }

  .mtr-span-2 {
    grid-column: auto;
  }

  .mtr-appointments-controls,
  .mtr-appointments-layout,
  .mtr-appointments-upcoming {
    grid-template-columns: 1fr;
  }

  .mtr-appointments-week-nav {
    align-items: stretch;
  }

  .mtr-appointments-week-nav > * {
    justify-content: center;
    width: 100%;
  }

  .mtr-appointments-calendar {
    min-width: 1180px;
    grid-template-columns: 78px repeat(7, minmax(160px, 1fr));
  }

  .mtr-clinical-modal {
    padding: 12px;
  }

  .mtr-clinical-modal-dialog {
    max-height: 92vh;
    padding: 18px;
  }

  .mtr-clinical-modal-head,
  .mtr-clinical-visit-head {
    flex-direction: column;
  }

  .mtr-clinical-visit-head span {
    text-align: left;
  }

  .medical-calendar-weekdays,
  .medical-calendar-grid {
    gap: 4px;
  }

  .medical-calendar-day {
    min-height: 76px;
    padding: 8px;
  }

  .medical-calendar-day span {
    display: none;
  }
}
