/* Gardenia Lab — Patient Login, Registration & Dashboard Styles (Arabic RTL) */
:root {
  --g-red: #ae0018;
  --g-darkred: #73000c;
  --g-gold: #e3b234;
  --g-gold-dark: #b68316;
  --g-ivory: #fffaf4;
  --g-ink: #361317;
  --g-muted: #6e5255;
  font-family: "Cairo", "Tajawal", Tahoma, Arial, sans-serif;
  font-synthesis: none;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body.gardenia-portal-body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  direction: rtl;
  color: var(--g-ink);
  background: linear-gradient(160deg, #fffaf4 0%, #ffffff 48%, #fdf5ea 100%);
  overflow-x: hidden;
}

button, a, input, select, textarea {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible, a:focus-visible {
  outline: 3px solid #c39228;
  outline-offset: 3px;
}

/* ==================== PORTAL TOP HEADER ==================== */
.portal-header {
  background: #ffffff;
  border-bottom: 1.5px solid #f0e1d0;
  box-shadow: 0 2px 14px rgba(90, 0, 12, 0.05);
  padding: clamp(10px, 1.5vw, 16px) max(16px, calc((100vw - 1220px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  width: clamp(144px, 38vw, 240px);
  min-height: 44px;
  text-decoration: none;
  flex-shrink: 0;
}

.portal-brand img {
  display: block;
  width: 100%;
  height: auto;
  max-height: clamp(46px, 7vw, 80px);
  object-fit: contain;
  object-position: right center;
  mix-blend-mode: multiply;
}

.portal-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-nav-link {
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #ead8c3;
  background: #fffaf3;
  color: #8f0013;
  font-size: 13.5px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.portal-nav-link:hover {
  background: #faeedb;
  border-color: #d6a438;
}

.portal-logout-btn {
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #e5c6c9;
  background: #fff5f6;
  color: #9e0015;
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
  transition: background-color 0.18s ease;
}

.portal-logout-btn:hover {
  background: #fde4e7;
}

/* ==================== AUTHENTICATION PAGES (/login & /register) ==================== */
.auth-main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4.5vw, 56px) clamp(14px, 3.5vw, 32px);
}

.auth-shell {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  border-radius: clamp(20px, 2.8vw, 28px);
  background: #ffffff;
  border: 1.5px solid #ead5b7;
  box-shadow: 0 22px 56px rgba(68, 0, 10, 0.11);
  overflow: hidden;
}

/* Brand Showcase Panel */
.auth-Aside {
  background: linear-gradient(145deg, #6e000c 0%, #9e0015 52%, #590009 100%);
  color: #ffffff;
  padding: clamp(24px, 4vw, 44px) clamp(20px, 3.8vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid #dfb244;
}

.auth-Aside::after {
  content: "";
  position: absolute;
  top: -90px;
  left: -90px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(245, 202, 80, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.auth-aside-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fae094;
  font-size: 13px;
  font-weight: 800;
}

.auth-aside-kicker::before {
  content: "";
  width: 24px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, #fff5be, #d9a126);
}

.auth-aside-title {
  margin: 10px 0 12px;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 900;
  line-height: 1.22;
  color: #ffffff;
  text-wrap: balance;
}

.auth-aside-gold {
  color: #f8d26a;
}

.auth-aside-desc {
  margin: 0;
  font-size: clamp(14px, 1.5vw, 16px);
  line-height: 1.75;
  color: #fcefe4;
}

.auth-aside-points {
  margin: 0;
  padding: 16px 0 0;
  border-top: 1px solid rgba(246, 209, 115, 0.26);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: #faebd7;
}

.auth-aside-points li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-aside-points .mark {
  color: #f6cd62;
  font-weight: 900;
}

/* Form Panel */
.auth-card {
  padding: clamp(22px, 4vw, 44px) clamp(18px, 4vw, 42px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.auth-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 12px;
  background: #faf3ea;
  border: 1px solid #ead8c3;
  margin-bottom: 20px;
}

.auth-tab-link {
  flex: 1 1 0;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 9px;
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  color: #6e4e50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.auth-tab-link.is-active {
  background: linear-gradient(95deg, #940013, #be001d);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(148, 0, 19, 0.22);
}

.auth-intent-banner {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 11px;
  background: #fff8ea;
  border: 1px solid #ebd19a;
  color: #704305;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.auth-intent-banner[hidden] {
  display: none;
}

.auth-heading {
  margin: 0 0 6px;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 900;
  color: #9e0015;
}

.auth-subtitle {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--g-muted);
  line-height: 1.65;
}

.auth-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.auth-field label {
  font-size: 13.5px;
  font-weight: 800;
  color: #4c2327;
}

.auth-req {
  color: #b8001b;
  margin-right: 2px;
}

.auth-opt {
  font-size: 11.5px;
  font-weight: 700;
  color: #8b7274;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-field input,
.auth-field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1.5px solid #e4d2c8;
  background: #fffdfb;
  color: #35141a;
  font-size: 15px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-field input[type="tel"],
.auth-field input[type="date"],
.auth-field input[type="email"] {
  direction: ltr;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.auth-input-wrap input[type="password"],
.auth-input-wrap input[data-password-input="true"] {
  padding-left: 76px;
}

.auth-pw-toggle {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 36px;
  min-width: 60px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: #fff1e3;
  color: #920019;
  font-size: 12.5px;
  font-weight: 800;
}

.auth-pw-toggle:hover {
  background: #fde4cb;
}

.auth-field input:focus,
.auth-field select:focus {
  border-color: #c39228;
  box-shadow: 0 0 0 3px rgba(217, 171, 56, 0.2);
  background: #ffffff;
}

.auth-field input[aria-invalid="true"],
.auth-field select[aria-invalid="true"] {
  border-color: #c91b2b;
  background: #fff8f8;
}

.auth-field-error {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #b41120;
  line-height: 1.4;
}

.auth-field-error:empty {
  display: none;
}

.auth-alert {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: 11px;
  background: #fff2f2;
  border: 1px solid #edc2c6;
  color: #9e111f;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.6;
}

.auth-alert[data-type="success"] {
  background: #eef9f1;
  border-color: #c9e6d1;
  color: #155a33;
}

.auth-alert[hidden] {
  display: none;
}

.auth-submit-btn {
  margin-top: 18px;
  width: 100%;
  min-height: 50px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1.5px solid #e5b849;
  background: linear-gradient(95deg, #8e0012 0%, #be001d 55%, #840010 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 22px rgba(158, 0, 21, 0.24);
  transition: filter 0.18s ease, transform 0.15s ease;
}

.auth-submit-btn:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.auth-submit-btn:disabled {
  opacity: 0.68;
  cursor: wait;
}

.auth-footer-links {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #f2e6da;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--g-muted);
}

.auth-switch-link {
  color: #9e0015;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.auth-home-link {
  color: #6b4b4d;
  text-decoration: none;
  font-weight: 800;
}

.auth-home-link:hover {
  color: #9e0015;
}

/* ==================== PATIENT DASHBOARD (/patient/dashboard) ==================== */
.dash-main {
  flex: 1 1 auto;
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 3.8vw, 44px) clamp(14px, 3vw, 28px) clamp(40px, 6vw, 72px);
}

/* Welcome Banner */
.dash-welcome {
  border-radius: clamp(18px, 2.4vw, 24px);
  background: linear-gradient(135deg, #6e000c 0%, #9b0015 52%, #590009 100%);
  border: 1.5px solid rgba(235, 190, 82, 0.58);
  box-shadow: 0 16px 40px rgba(74, 0, 10, 0.15);
  padding: clamp(20px, 3.5vw, 34px) clamp(18px, 3.5vw, 36px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: clamp(22px, 3.5vw, 32px);
}

.dash-welcome-copy {
  min-width: 0;
}

.dash-welcome-kicker {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 800;
  color: #fae094;
  margin-bottom: 4px;
}

.dash-welcome-title {
  margin: 0 0 8px;
  font-size: clamp(22px, 3.4vw, 32px);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.25;
}

.dash-welcome-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fcecd2;
}

.dash-welcome-meta .ltr-val {
  direction: ltr;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.dash-welcome-sep {
  color: rgba(246, 205, 98, 0.55);
}

.dash-welcome-cta {
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 2px solid #fff2ba;
  background: linear-gradient(135deg, #fff5bf 0%, #f1c349 46%, #c88b12 92%, #fbe28e 100%);
  color: #5e000a;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(28, 0, 4, 0.28);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.dash-welcome-cta:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* Dashboard Sections Grid */
.dash-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(18px, 2.8vw, 26px);
}

.dash-section-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1.5px solid #ead8c3;
  border-top: 4px solid #c9972c;
  box-shadow: 0 10px 30px rgba(68, 0, 10, 0.06);
  padding: clamp(18px, 2.8vw, 26px);
  min-width: 0;
}

.dash-section-card[hidden] {
  display: none !important;
}

.dash-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid #f2e5d9;
}

.dash-section-title {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 900;
  color: #9e0015;
}

.dash-section-count {
  font-size: 13px;
  font-weight: 800;
  color: #8c5d0b;
  font-variant-numeric: tabular-nums;
}

.dash-records-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.dash-record-item {
  padding: 14px 16px;
  border-radius: 13px;
  background: #fdfaf5;
  border: 1px solid #ede0d1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-record-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-record-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 900;
  color: #3a1417;
}

.dash-record-status {
  font-size: 12.5px;
  font-weight: 800;
  color: #8c5d0b;
}

.dash-record-status.is-approved {
  color: #166037;
}

.dash-record-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #5c3e40;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.dash-record-tests {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding-top: 8px;
  border-top: 1px solid #efe4d8;
  font-size: 12.5px;
  font-weight: 700;
  color: #523235;
}

.dash-empty-box {
  padding: 20px 16px;
  border-radius: 13px;
  background: #fdf9f3;
  border: 1px dashed #e5cfb4;
  text-align: center;
  color: #6e5255;
  font-size: 14px;
  line-height: 1.7;
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */
@media (max-width: 359px) {
  .portal-header {
    padding: 8px 12px;
  }
  .portal-brand {
    width: 132px;
  }
  .portal-nav-link,
  .portal-logout-btn {
    padding: 6px 10px;
    font-size: 12.5px;
  }
  .auth-card,
  .auth-Aside {
    padding: 18px 14px;
  }
}

@media (min-width: 560px) {
  .auth-form-grid.is-two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .auth-field.is-full {
    grid-column: 1 / -1;
  }
}

@media (min-width: 860px) {
  .auth-shell {
    grid-template-columns: 0.92fr 1.08fr;
  }
  .auth-Aside {
    border-bottom: 0;
    border-left: 3px solid #dfb244;
  }
  .dash-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-section-card.is-full {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-submit-btn,
  .dash-welcome-cta,
  .portal-nav-link {
    transition: none;
  }
}

/* ==================== DASHBOARD TABS & PROFILE ==================== */
.dash-tabs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 6px;
  margin-bottom: clamp(18px, 2.8vw, 26px);
  border-radius: 14px;
  background: #ffffff;
  border: 1.5px solid #ead8c3;
  box-shadow: 0 6px 20px rgba(68, 0, 10, 0.05);
}

.dash-tab-btn {
  flex: 1 1 auto;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 10px;
  color: #6b4548;
  font-size: 13.5px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.dash-tab-btn:hover {
  background: #fdf3e4;
  color: #960014;
}

.dash-tab-btn.is-active {
  background: linear-gradient(95deg, #940013, #be001d);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(148, 0, 19, 0.2);
}

.dash-section-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-new-booking-btn {
  min-height: 36px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid #dcb04b;
  background: #fff9ef;
  color: #8f0013;
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dash-new-booking-btn:hover {
  background: #fdf0d5;
}

.dash-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}

.dash-profile-field {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fdfaf5;
  border: 1px solid #ede0d1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-profile-label {
  font-size: 12px;
  font-weight: 800;
  color: #7c5c5f;
}

.dash-profile-val {
  font-size: 14.5px;
  font-weight: 900;
  color: #361317;
  word-break: break-word;
}

.dash-profile-val.is-ltr {
  direction: ltr;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dash-report-card {
  padding: clamp(16px, 2.4vw, 22px);
  border-radius: 16px;
  background: #fffaf4;
  border: 1.5px solid #e8d5bd;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.dash-report-card[data-report-state="approved"] {
  background: linear-gradient(155deg, #ffffff 0%, #fffaf2 100%);
  border-color: #d9a838;
  box-shadow: 0 8px 24px rgba(110, 0, 12, 0.06);
}

.dash-report-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-report-card-lead {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1 1 240px;
}

.dash-report-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fdf2df;
  border: 1px solid #e6c98e;
  color: #a60018;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-report-card[data-report-state="approved"] .dash-report-icon-box {
  background: linear-gradient(135deg, #a60018 0%, #7d0011 100%);
  border-color: #d9a838;
  color: #fae094;
}

.dash-report-icon-box svg {
  width: 22px;
  height: 22px;
  display: block;
}

.dash-report-heading-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.dash-report-card-title {
  margin: 0;
  font-size: clamp(16px, 2vw, 18.5px);
  font-weight: 900;
  color: #361317;
  line-height: 1.35;
}

.dash-report-card[data-report-state="approved"] .dash-report-card-title {
  color: #8f0013;
}

.dash-report-card-desc {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: #5e4144;
  line-height: 1.65;
}

.dash-report-state-badge {
  font-size: 12.5px;
  font-weight: 800;
  color: #8c5d0b;
  padding: 4px 10px;
  border-radius: 8px;
  background: #fcf3e1;
  border: 1px solid #e5c98b;
  white-space: nowrap;
  align-self: flex-start;
}

.dash-report-state-badge.is-approved {
  color: #145932;
  background: #edf8f1;
  border-color: #bfe2cc;
}

.dash-report-state-badge.is-pending {
  color: #7c4d05;
  background: #fff6e3;
  border-color: #e6c687;
}

.dash-report-state-badge.is-unavailable {
  color: #7a2730;
  background: #fdf2f3;
  border-color: #e6c5c9;
}

.dash-empty-state-card {
  padding: clamp(24px, 3.5vw, 34px) clamp(16px, 2.5vw, 24px);
  border-radius: 16px;
  background: #fffaf4;
  border: 1.5px dashed #e2caa9;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dash-empty-state-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #fdf2df;
  border: 1px solid #e6c98e;
  color: #a60018;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.dash-empty-state-icon svg {
  width: 24px;
  height: 24px;
}

.dash-empty-state-title {
  margin: 0;
  font-size: clamp(16.5px, 2.2vw, 19px);
  font-weight: 900;
  color: #361317;
}

.dash-empty-state-desc {
  margin: 0;
  max-width: 480px;
  font-size: 14px;
  font-weight: 700;
  color: #6e5255;
  line-height: 1.65;
}

.dash-report-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed #ead8c3;
}

.dash-report-btn {
  min-height: 40px;
  padding: 7px 16px;
  border-radius: 10px;
  border: 1.5px solid #dcb04b;
  background: #fff9ef;
  color: #8f0013;
  font-size: 13.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.16s ease, filter 0.16s ease, opacity 0.16s ease;
}

.dash-report-btn.is-primary {
  background: linear-gradient(95deg, #a60018, #be001d);
  border-color: #d9a838;
  color: #ffffff;
}

.dash-report-btn.is-refresh {
  background: #fffdf9;
  border-color: #dec089;
  color: #6b222a;
}

.dash-report-btn:hover:not(:disabled) {
  background: #faeed6;
}

.dash-report-btn.is-primary:hover:not(:disabled) {
  background: linear-gradient(95deg, #a60018, #be001d);
  filter: brightness(1.08);
}

.dash-report-btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.dash-btn-spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(166, 0, 24, 0.25);
  border-top-color: #a60018;
  animation: gardeniaPdfSpin 0.75s linear infinite;
  flex-shrink: 0;
}

.dash-btn-spinner[hidden] {
  display: none !important;
}

.dash-adapter-notice {
  margin: 12px 0 0;
  padding: 11px 14px;
  border-radius: 11px;
  background: #fff8eb;
  border: 1px solid #ebd29d;
  color: #704305;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.65;
}

.dash-adapter-notice[data-notice-type="error"] {
  background: #fff2f2;
  border-color: #e8bec3;
  color: #8f0d1b;
}

.dash-adapter-notice[data-notice-type="success"] {
  background: #eef9f1;
  border-color: #c5e3ce;
  color: #155a33;
}

.dash-adapter-notice[hidden] {
  display: none;
}

/* ==================== ACCESSIBLE PDF.JS VIEWER MODAL ==================== */
.pdf-modal-shade {
  position: fixed;
  inset: 0;
  z-index: 1250;
  background: rgba(32, 6, 10, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(6px, 2vw, 24px);
  box-sizing: border-box;
}

.pdf-modal-shade[hidden] {
  display: none !important;
}

.pdf-modal {
  width: min(980px, 100%);
  max-width: 100%;
  height: min(90vh, 880px);
  max-height: calc(100dvh - 12px);
  background: #fffdf9;
  border-radius: clamp(12px, 2vw, 18px);
  border: 2px solid #d9a838;
  box-shadow: 0 24px 64px rgba(24, 0, 4, 0.42);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.pdf-modal-header {
  padding: clamp(10px, 2vw, 14px) clamp(12px, 2.5vw, 20px);
  background: linear-gradient(135deg, #6e000c 0%, #9b0015 55%, #590009 100%);
  border-bottom: 1.5px solid rgba(235, 190, 82, 0.55);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.pdf-modal-heading-wrap {
  min-width: 0;
}

.pdf-modal-kicker {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #fae094;
  margin-bottom: 2px;
}

.pdf-modal-title {
  margin: 0;
  font-size: clamp(15px, 2.2vw, 20px);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.3;
  word-break: break-word;
}

.pdf-modal-meta {
  margin: 3px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: #fcecd2;
}

.pdf-modal-meta[hidden] {
  display: none;
}

.pdf-modal-icon-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 240, 194, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pdf-modal-icon-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.pdf-modal-toolbar {
  padding: 8px clamp(10px, 2.2vw, 18px);
  background: #fdf6ea;
  border-bottom: 1px solid #ead8c3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.pdf-modal-toolbar[hidden] {
  display: none !important;
}

.pdf-toolbar-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-page-count {
  font-size: 12.5px;
  font-weight: 800;
  color: #5a2227;
  background: #fffdf9;
  border: 1px solid #e6d1b3;
  padding: 4px 10px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

.pdf-toolbar-zoom {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pdf-zoom-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #dcb04b;
  background: #ffffff;
  color: #8f0013;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pdf-zoom-btn:hover:not(:disabled) {
  background: #faeed6;
}

.pdf-zoom-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pdf-zoom-label {
  min-width: 48px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 900;
  color: #3d1619;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}

.pdf-zoom-reset-btn {
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #d7c2aa;
  background: #fffdf9;
  color: #5c3235;
  font-size: 12px;
  font-weight: 800;
}

.pdf-zoom-reset-btn:hover:not(:disabled) {
  background: #f8efe2;
}

.pdf-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  background: #eee6da;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pdf-modal-loading {
  margin: auto;
  padding: 24px 16px;
  text-align: center;
  color: #5c282d;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.pdf-modal-loading[hidden] {
  display: none !important;
}

.pdf-loading-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #ead4b0;
  border-top-color: #9e0015;
  animation: gardeniaPdfSpin 0.8s linear infinite;
}

@keyframes gardeniaPdfSpin {
  to {
    transform: rotate(360deg);
  }
}

.pdf-modal-error {
  margin: auto;
  max-width: 520px;
  padding: 18px 20px;
  border-radius: 14px;
  background: #fff2f2;
  border: 1.5px solid #e6b8be;
  color: #8f0d1b;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.7;
  text-align: center;
}

.pdf-modal-error[hidden] {
  display: none !important;
}

.pdf-canvas-container {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: clamp(10px, 2.2vw, 22px) clamp(8px, 2vw, 20px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2vw, 20px);
}

.pdf-canvas-container[hidden] {
  display: none !important;
}

.pdf-page-card {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #dfd1be;
  box-shadow: 0 6px 20px rgba(42, 10, 14, 0.12);
  padding: clamp(4px, 1vw, 10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  box-sizing: border-box;
}

.pdf-page-card.is-zoomed {
  max-width: none;
}

.pdf-page-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #ffffff;
}

.pdf-page-card.is-zoomed .pdf-page-canvas {
  max-width: none;
}

.pdf-page-badge {
  font-size: 11.5px;
  font-weight: 800;
  color: #7c585b;
  font-variant-numeric: tabular-nums;
}

.pdf-modal-footer {
  padding: clamp(10px, 1.8vw, 12px) clamp(12px, 2.5vw, 20px);
  background: #fffaf2;
  border-top: 1px solid #ead8c3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.pdf-btn-download {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1.5px solid #d9a838;
  background: linear-gradient(95deg, #940013, #be001d);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.pdf-btn-download:hover:not(:disabled) {
  filter: brightness(1.08);
}

.pdf-btn-download:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.pdf-btn-close {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1.5px solid #d7c2aa;
  background: #ffffff;
  color: #4f2c30;
  font-size: 13px;
  font-weight: 800;
}

.pdf-btn-close:hover {
  background: #f8efe2;
}

@media (max-width: 480px) {
  .pdf-modal-shade {
    padding: 6px;
  }
  .pdf-modal {
    height: calc(100dvh - 12px);
    border-radius: 14px;
  }
  .pdf-modal-toolbar {
    padding: 6px 10px;
    gap: 6px;
  }
  .pdf-zoom-reset-btn {
    padding: 4px 8px;
    font-size: 11.5px;
  }
  .pdf-modal-footer {
    justify-content: stretch;
  }
  .pdf-btn-download,
  .pdf-btn-close {
    flex: 1 1 auto;
    text-align: center;
  }
}

.dash-pkg-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dash-pkg-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 12px;
}

.dash-branch-details {
  padding: 10px 14px;
  border-radius: 11px;
  background: #fdf9f2;
  border: 1px solid #ead8bc;
  font-size: 13px;
  color: #4e2f32;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.dash-branch-details[hidden] {
  display: none;
}

.dash-branch-details a {
  color: #960014;
  font-weight: 800;
  text-decoration: underline;
}

.dash-pkg-form-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 4px;
}

/* ==================== MINIMAL FOOTER ==================== */
.site-footer {
  background: #fffaf4;
  border-top: 1px solid #eadccf;
  padding: 14px 16px;
  text-align: center;
  margin-top: auto;
}

.site-footer-meta {
  margin: 0;
  color: #7a5256;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

/* ==================== LANGUAGE SWITCHER & LTR ADAPTATION ==================== */
.header-lang-slot {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.gardenia-lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.gardenia-lang-trigger {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 10px;
  background: #fffaf3;
  border: 1px solid var(--g-gold, #e3b234);
  color: #a60018;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(166, 0, 24, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
}

.gardenia-lang-trigger:hover,
.gardenia-lang-switcher.is-open .gardenia-lang-trigger {
  background: #fdf2df;
  border-color: #c69222;
  color: #76000c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(166, 0, 24, 0.11);
}

.gardenia-lang-trigger:active {
  transform: translateY(0);
}

.gardenia-lang-trigger:focus-visible {
  outline: 3px solid var(--g-gold, #e3b234);
  outline-offset: 2px;
}

.gardenia-lang-globe-icon {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.gardenia-lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  z-index: 80;
  min-width: 176px;
  max-width: calc(100vw - 20px);
  padding: 6px;
  border-radius: 12px;
  background: #fffdf9;
  border: 1px solid var(--g-gold, #e3b234);
  box-shadow: 0 14px 34px rgba(74, 0, 10, 0.16), 0 2px 8px rgba(74, 0, 10, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gardenia-lang-dropdown[hidden] {
  display: none !important;
}

html[dir="rtl"] .gardenia-lang-dropdown {
  left: 0;
  right: auto;
}

html[dir="ltr"] .gardenia-lang-dropdown {
  right: 0;
  left: auto;
}

.gardenia-lang-option {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3a1414;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: start;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.gardenia-lang-option:hover,
.gardenia-lang-option:focus-visible {
  background: #fdf2df;
  color: #980014;
  outline: none;
}

.gardenia-lang-option.is-active {
  background: linear-gradient(95deg, #fff5e2, #fdf0d5);
  color: #980014;
  font-weight: 800;
}

.gardenia-lang-option-label {
  white-space: nowrap;
}

.gardenia-lang-option-check {
  opacity: 0;
  color: #a60018;
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
}

.gardenia-lang-option.is-active .gardenia-lang-option-check {
  opacity: 1;
}

html[dir="ltr"] body.gardenia-portal-body {
  direction: ltr;
}

@media (min-width: 768px) {
  html[dir="ltr"] .portal-brand img {
    object-position: left center;
  }
}

html[dir="ltr"] .auth-field input[type="tel"],
html[dir="ltr"] .auth-field input[type="email"],
html[dir="ltr"] .auth-field input[type="date"],
html[dir="ltr"] .auth-field input[data-password-input="true"],
html[dir="ltr"] .dash-profile-val.is-ltr,
html[dir="ltr"] .dash-record-meta .ltr-val {
  text-align: left;
}

html[dir="ltr"] .auth-input-wrap input {
  padding-left: 13px;
  padding-right: 72px;
}

html[dir="ltr"] .auth-pw-toggle {
  left: auto;
  right: 6px;
}

/* ==================== INTERNAL PAGE HAMBURGER BUTTON & DRAWER ==================== */
.portal-menu-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #ead8c3;
  background: #fffaf3;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.portal-menu-btn:hover {
  background: #faeedb;
  border-color: #d6a438;
}

.portal-menu-btn span {
  display: block;
  width: 22px;
  height: 2.5px;
  border-radius: 99px;
  background: #a60018;
}

.drawer-shade {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(34, 6, 8, 0.52);
  backdrop-filter: blur(2px);
  display: none;
}

.drawer-shade.show {
  display: block;
}

.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(310px, 86vw);
  max-width: calc(100vw - 24px);
  height: 100%;
  overflow-y: auto;
  background: #fffdf9;
  padding: 20px 18px 28px;
  box-shadow: 0 20px 48px rgba(48, 0, 8, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

html[dir="ltr"] .drawer {
  inset: 0 0 0 auto;
}

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid #efe0cc;
}

.drawer-brand {
  display: inline-flex;
  align-items: center;
  width: 146px;
  text-decoration: none;
}

.drawer-brand img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 52px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.drawer-close {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #ead8c3;
  background: #fffaf3;
  color: #8f0013;
  font-size: 16px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer > button {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #f2e6d8;
  border-radius: 8px;
  background: transparent;
  color: #3a1414;
  font-size: 15px;
  font-weight: 800;
  text-align: start;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.drawer > button:hover {
  background: #fdf3e1;
  color: #980014;
}

.drawer > button.drawer-logout-item {
  color: #9e0015;
  margin-top: 4px;
}

/* ==================== DRAWER EXPANDABLE LANGUAGE SELECTOR ==================== */
.drawer-lang-slot {
  width: 100%;
}

.gardenia-drawer-lang {
  width: 100%;
  border-bottom: 1px solid #f2e6d8;
  padding: 2px 0;
}

.drawer-lang-toggle {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #3a1414;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: start;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.drawer-lang-toggle:hover,
.gardenia-drawer-lang.is-open .drawer-lang-toggle {
  background: #fff8ec;
  border-color: #e3b234;
  color: #980014;
}

.drawer-lang-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fffaf3;
  border: 1px solid #e3b234;
  color: #a60018;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer-lang-icon .gardenia-lang-globe-icon {
  width: 17px;
  height: 17px;
}

.drawer-lang-toggle-label {
  flex: 1 1 auto;
}

.drawer-lang-chevron {
  font-size: 13px;
  color: #8f0013;
  transition: transform 0.18s ease;
}

.gardenia-drawer-lang.is-open .drawer-lang-chevron {
  transform: rotate(180deg);
}

.drawer-lang-menu {
  margin: 6px 0 8px;
  padding: 6px;
  border-radius: 10px;
  background: #fffaf3;
  border: 1px solid #ead5b5;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.drawer-lang-menu[hidden] {
  display: none !important;
}

.drawer-lang-option {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3a1414;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: start;
}

.drawer-lang-option:hover,
.drawer-lang-option:focus-visible {
  background: #fdf0d8;
  color: #980014;
  outline: none;
}

.drawer-lang-option.is-active {
  background: linear-gradient(95deg, #fff5e2, #fdf0d5);
  color: #980014;
  font-weight: 800;
}

.drawer-lang-option-check {
  opacity: 0;
  color: #a60018;
  font-weight: 900;
}

.drawer-lang-option.is-active .drawer-lang-option-check {
  opacity: 1;
}

/* ==================== INTERNAL PAGE MOBILE HEADER RULES (<= 767px) ==================== */
/* Official logo on the right, compact hamburger menu & essential navigation on the left,
   no Globe icon outside the drawer, zero clipping at 320px, 360px, 375px, 390px, 430px */
@media (max-width: 767px) {
  .portal-header {
    direction: rtl;
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .portal-brand {
    width: clamp(112px, 33vw, 152px);
    min-width: 0;
    flex-shrink: 1;
  }
  .portal-brand img {
    object-position: right center;
    max-height: 48px;
  }
  .portal-header-actions {
    direction: rtl;
    gap: 6px;
    flex-wrap: nowrap;
    flex-shrink: 0;
    min-width: 0;
  }
  .portal-header .header-lang-slot,
  .portal-header .gardenia-lang-switcher {
    display: none !important;
  }
  .portal-nav-link,
  .portal-logout-btn {
    padding: 6px 9px;
    font-size: 12px;
    min-height: 40px;
    max-width: 126px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .portal-menu-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
  }
}

@media (max-width: 374px) {
  .portal-header {
    padding: 7px 9px;
    gap: 6px;
  }
  .portal-brand {
    width: clamp(98px, 30vw, 124px);
  }
  .portal-header-actions {
    gap: 5px;
  }
  .portal-nav-link,
  .portal-logout-btn {
    padding: 5px 7px;
    font-size: 11px;
    min-height: 38px;
    max-width: 102px;
  }
  .portal-menu-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 7px;
  }
}

/* ==================== BIDIRECTIONAL TEXT & VERBATIM API DATA ==================== */
[dir="auto"],
[data-medical-verbatim="true"] {
  unicode-bidi: isolate;
}

.pkg-modal-description {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fdf9f2;
  border: 1px solid #ead8bc;
  color: #4a2428;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.65;
}

.dash-results-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid #ead8c3;
  background: #ffffff;
}

.dash-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.dash-results-table th,
.dash-results-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0e3d3;
  text-align: start;
  vertical-align: middle;
}

.dash-results-table th {
  background: #fdf6ea;
  color: #5c282d;
  font-weight: 800;
}

.dash-results-table tr:last-child td {
  border-bottom: none;
}

.dash-test-shortcut {
  color: #7c585b;
  font-size: 12px;
  font-weight: 700;
}
