.cust-error-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding:
    calc(24px + env(safe-area-inset-top, 0px))
    max(20px, env(safe-area-inset-right, 0px))
    calc(24px + env(safe-area-inset-bottom, 0px))
    max(20px, env(safe-area-inset-left, 0px));
  background: #fff;
  animation: cust-error-page-in 0.45s ease both;
}

.cust-error-page--embedded {
  min-height: min(72vh, 640px);
  width: 100%;
  padding: 28px 16px;
  border-radius: 18px;
  animation: none;
}

@keyframes cust-error-page-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes cust-error-card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cust-error-mark-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.9;
  }
}

.cust-error {
  position: relative;
  width: min(440px, 100%);
  padding: 32px 24px 26px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 32px rgba(11, 31, 58, 0.08);
  text-align: center;
  overflow: hidden;
  animation: cust-error-card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cust-error--compact {
  width: 100%;
  margin: 12px 0;
  padding: 20px 16px;
  box-shadow: none;
  animation: none;
}

.cust-error__glow {
  position: absolute;
  inset: -40% auto auto 30%;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 102, 255, 0.18), transparent 70%);
  pointer-events: none;
}

.cust-error__art {
  margin: 0 auto 10px;
  display: flex;
  justify-content: center;
}

.cust-error__art .care-scene-art {
  width: 168px;
  height: 168px;
  object-fit: contain;
  display: block;
}

.cust-error--compact .cust-error__art .care-scene-art {
  width: 120px;
  height: 120px;
}

.cust-error__mark {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
}

.cust-error__mark-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(0, 102, 255, 0.2);
  animation: cust-error-mark-pulse 2.4s ease-in-out infinite;
}

.cust-error__mark-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0066ff;
  box-shadow: 0 0 0 6px rgba(0, 102, 255, 0.1);
}

.cust-error__brand {
  margin: 0 0 10px;
  font-family:'Inter', 'IBM Plex Sans Arabic', 'Noto Sans Arabic', system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: #0066ff;
}

.cust-error__brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 200px;
  text-transform: none;
  letter-spacing: 0;
}

.cust-error__brand-logo .care-v2-brand-logo__mark {
  max-height: 36px;
  border-radius: 10px;
}

.cust-error__brand-logo .care-v2-brand-logo__word {
  max-height: 32px;
}

.cust-error__title {
  margin: 0;
  font-family:'Inter', 'IBM Plex Sans Arabic', 'Noto Sans Arabic', system-ui, sans-serif;
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0b1f3a;
  line-height: 1.25;
}

.cust-error__body {
  margin: 10px 0 0;
  font-family:'Inter', 'IBM Plex Sans Arabic', 'Noto Sans Arabic', system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #64748b;
}

.cust-error__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

.cust-error__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 999px;
  font-family:'Inter', 'IBM Plex Sans Arabic', 'Noto Sans Arabic', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    color 0.15s ease,
    opacity 0.15s ease;
}

.cust-error__btn--solid {
  background: #0066ff;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 102, 255, 0.28);
}

.cust-error__btn--solid:hover:not(:disabled) {
  background: #0052cc;
  box-shadow: 0 10px 24px rgba(0, 102, 255, 0.34);
}

.cust-error__btn--solid:disabled {
  opacity: 0.72;
  cursor: wait;
  box-shadow: none;
}

.cust-error__btn--ghost {
  background: #fff;
  color: #0b1f3a;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(11, 31, 58, 0.04);
}

.cust-error__btn--ghost:hover:not(:disabled) {
  background: #ebf5ff;
  border-color: color-mix(in srgb, #0066ff 28%, #e2e8f0);
  color: #0066ff;
}

/* Avoid transform/scale on press — that shifts layout and feels like a jerk on mobile. */
.cust-error__btn:active {
  transform: none;
}

.cust-error.is-retrying {
  opacity: 0.96;
}

.cust-offline-banner {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 8px 14px;
  text-align: center;
  font-family:'Inter', 'IBM Plex Sans Arabic', 'Noto Sans Arabic', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0b1f3a;
  background: #ebf5ff;
  border-bottom: 1px solid color-mix(in srgb, #0066ff 18%, #e2e8f0);
}

@media (prefers-reduced-motion: reduce) {
  .cust-error-page,
  .cust-error,
  .cust-error__mark-ring {
    animation: none;
  }
}

.public-print {
  --pp-ink: var(--ec-platform-ink, #0c1a2e);
  --pp-blue: var(--ec-platform-blue, #0360f1);
  --pp-blue-hover: var(--ec-platform-blue-hover, #0250d4);
  --pp-muted: var(--ec-platform-muted, #64748b);
  --pp-line: var(--ec-platform-line, #e8edf3);
  --pp-font: var(--ec-font, 'Inter', system-ui, sans-serif);
  --pp-display: var(--ec-font-display, 'Sora', system-ui, sans-serif);

  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  font-family: var(--pp-font);
  color: var(--pp-ink);
  box-sizing: border-box;
}

.public-print__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(3, 96, 241, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(7, 40, 84, 0.1), transparent 50%),
    linear-gradient(165deg, #f7fafc 0%, #eef3f9 48%, #f8fafc 100%);
  z-index: 0;
}

.public-print__card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--pp-line);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(12, 26, 46, 0.08);
  padding: 28px 28px 22px;
  animation: public-print-in 0.45s ease-out both;
}

@keyframes public-print-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.public-print__brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.public-print__mark {
  font-family: var(--pp-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--pp-ink);
}

.public-print__kind {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pp-blue);
}

.public-print__title {
  margin: 0 0 14px;
  font-family: var(--pp-display);
  font-size: 1.45rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.public-print__meta {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-gap: 6px 14px;
  gap: 6px 14px;
  margin: 0 0 16px;
  font-size: 0.92rem;
}

.public-print__meta dt {
  margin: 0;
  color: var(--pp-muted);
  font-weight: 500;
}

.public-print__meta dd {
  margin: 0;
  font-weight: 600;
}

.public-print__hint {
  margin: 0 0 20px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--pp-muted);
}

.public-print__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.public-print__btn {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--ec-platform-btn-radius, 10px);
  padding: 11px 18px;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.public-print__btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.public-print__btn--primary {
  background: var(--pp-blue);
  color: #fff;
  box-shadow: var(--ec-platform-btn-shadow, 0 4px 12px rgba(3, 96, 241, 0.22));
}

.public-print__btn--primary:hover:not(:disabled) {
  background: var(--pp-blue-hover);
  transform: translateY(-1px);
}

.public-print__btn--ghost {
  background: transparent;
  color: var(--pp-ink);
  border: 1px solid var(--pp-line);
}

.public-print__btn--ghost:hover:not(:disabled) {
  background: #f8fafc;
}

.public-print__muted {
  margin: 8px 0 0;
  color: var(--pp-muted);
  font-size: 0.95rem;
}

.public-print__error {
  margin: 8px 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.9rem;
  line-height: 1.4;
}

.public-print__foot {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--pp-line);
  font-size: 0.75rem;
  color: var(--pp-muted);
  line-height: 1.4;
}

@media (max-width: 480px) {
  .public-print__card {
    padding: 22px 18px 18px;
  }

  .public-print__actions {
    flex-direction: column;
  }

  .public-print__btn {
    width: 100%;
    text-align: center;
  }
}

/* Platform design tokens — CareOS24: Sora (brand/headings) + Inter (UI/body) */
:root {
  --font-sora: 'Sora';
  --font-inter: 'Inter';
  /* Back-compat aliases (older CSS still references Poppins / Space Grotesk vars) */
  --font-poppins: 'Inter';
  --font-space-grotesk: 'Sora';

  --ec-font: var(--font-inter, 'Inter'), var(--font-ibm-plex-arabic, 'IBM Plex Sans Arabic'),
    var(--font-noto-sans-arabic, 'Noto Sans Arabic'), 'saudi_riyal', system-ui, -apple-system, sans-serif;
  --ec-font-display: var(--font-sora, 'Sora'), var(--font-ibm-plex-arabic, 'IBM Plex Sans Arabic'),
    var(--font-noto-sans-arabic, 'Noto Sans Arabic'), 'saudi_riyal', system-ui, sans-serif;
  --ec-font-serif: var(--font-sora, 'Sora'), Georgia, serif;
  --ec-font-data: var(--font-inter, 'Inter'), var(--font-ibm-plex-arabic, 'IBM Plex Sans Arabic'),
    system-ui, sans-serif;

  --ec-platform-ink: #0F172A;
  --ec-platform-navy: #0F172A;
  /* CareOS24 marketplace palette */
  --ec-platform-blue: #0F6CBD;
  --ec-platform-blue-hover: #0d5da3;
  --ec-brand-primary: #0F6CBD;
  --ec-brand-primary-dark: #0F172A;
  --ec-brand-primary-hover: #0d5da3;
  --ec-brand-secondary: #14B8A6;
  --ec-platform-accent-soft: #eff6ff;
  --ec-platform-btn-radius: 10px;
  --ec-platform-btn-shadow: 0 4px 12px rgba(15, 108, 189, 0.22);
  --ec-platform-danger: #dc2626;
  --ec-platform-danger-hover: #b91c1c;
  --ec-platform-mist: #ffffff;
  --ec-platform-paper: #ffffff;
  --ec-platform-line: #e2e8f0;
  --ec-platform-muted: #64748b;
  --ec-platform-card-radius: 10px;
  --ec-platform-card-shadow: 0 1px 3px rgba(12, 26, 46, 0.06);

  /* IPD bed status (ipd.png legend) */
  --ec-ipd-bed-occupied: #0040a0;
  --ec-ipd-bed-available: #b8d8c8;
  --ec-ipd-bed-reserved: #f59e0b;
  --ec-ipd-bed-maintenance: #c6cdd7;
  --ec-ipd-bed-discharged: #93c5fd;

  --ec-sidebar-width: 240px;
  --ec-sidebar-compact-width: 72px;
  /* Light CareOS sidebar — white / mist grey with dark ink */
  --ec-proposal-sidebar-start: #ffffff;
  --ec-proposal-sidebar-end: #f8fafc;
  --ec-proposal-sidebar-bg: #f8fafc;
  --ec-proposal-sidebar-active-bg: rgba(15, 108, 189, 0.1);
  --ec-proposal-sidebar-hover-bg: rgba(23, 43, 58, 0.05);
  --ec-proposal-sidebar-text: #172b3a;
  --ec-proposal-sidebar-text-muted: #64748b;
  --ec-proposal-sidebar-icon: #64748b;
  --ec-proposal-sidebar-border: #e2e8f0;
  --ch-topbar-bg: #ffffff;
  --ch-topbar-text: #0F172A;
  --ec-sidebar-active-bar: #0F6CBD;
  --ec-sidebar-nav-size: 13px;
  --ec-sidebar-sub-size: 12px;
  --ec-sidebar-icon-size: 15px;
  --ec-sidebar-item-py: 9px;
  --ec-sidebar-item-px: 14px;
  --ec-sidebar-item-min-h: 38px;
  --ec-sidebar-sub-indent: 38px;
  --ec-sidebar-brand-size: 12px;
  --ec-sidebar-brand-logo-max: 52px;
  --ec-sidebar-brand-py: 8px;
  --ec-sidebar-brand-px: 10px;
  --ec-sidebar-brand-gap: 4px;
  --ec-sidebar-nav-pt: 4px;
  --ec-sidebar-nav-pb: 12px;
  --ec-proposal-accent: #0F6CBD;
  --ec-proposal-page-bg: #F8FAFC;
  --ec-proposal-card-bg: #ffffff;
  --ec-proposal-card-border: #e2e8f0;
  --ec-proposal-success-bg: #dcfce7;
  --ec-proposal-success-text: #166534;
  --ec-proposal-info-bg: #dbeafe;
  --ec-proposal-info-text: #1e40af;
  --ec-proposal-warn-bg: #ffedd5;
  --ec-proposal-warn-text: #9a3412;
  --ec-proposal-danger-bg: #fee2e2;
  --ec-proposal-danger-text: #991b1b;

  --ec-opd-primary: #0F6CBD;
  --ec-opd-text: #0F172A;
  --ec-opd-muted: #475569;
  --ec-opd-border: #e2e8f0;

  /* OPD appointment status — soft fills used on calendar pills, dashboard, boards */
  --opd-st-schedule-bg: #e8f0fe;
  --opd-st-schedule-ink: #1e3a8a;
  --opd-st-schedule-line: #b6c9f5;
  --opd-st-schedule-accent: #2563eb;

  --opd-st-pending-bg: #fff4e8;
  --opd-st-pending-ink: #9a3412;
  --opd-st-pending-line: #fdba74;
  --opd-st-pending-accent: #ea580c;

  --opd-st-confirmed-bg: #e6fbff;
  --opd-st-confirmed-ink: #155e75;
  --opd-st-confirmed-line: #67e8f9;
  --opd-st-confirmed-accent: #0891b2;

  --opd-st-checkedin-bg: #e8f7ee;
  --opd-st-checkedin-ink: #166534;
  --opd-st-checkedin-line: #86efac;
  --opd-st-checkedin-accent: #2c7a46;

  --opd-st-engaged-bg: #f3eefe;
  --opd-st-engaged-ink: #5b21b6;
  --opd-st-engaged-line: #c4b5fd;
  --opd-st-engaged-accent: #6d28d9;

  --opd-st-checkedout-bg: #f1f5f9;
  --opd-st-checkedout-ink: #334155;
  --opd-st-checkedout-line: #cbd5e1;
  --opd-st-checkedout-accent: #475569;

  --opd-st-noshow-bg: #fcecee;
  --opd-st-noshow-ink: #7f1d1d;
  --opd-st-noshow-line: #f5c2c7;
  --opd-st-noshow-accent: #803e48;

  --opd-st-online-bg: #e8f6fe;
  --opd-st-online-ink: #075985;
  --opd-st-online-line: #7dd3fc;
  --opd-st-online-accent: #0284c7;

  --opd-st-cancelled-bg: #f1f5f9;
  --opd-st-cancelled-ink: #475569;
  --opd-st-cancelled-line: #cbd5e1;
  --opd-st-cancelled-accent: #64748b;

  --opd-st-walkin-bg: #fef9e7;
  --opd-st-walkin-ink: #854d0e;
  --opd-st-walkin-line: #fde047;
  --opd-st-walkin-accent: #ca8a04;

  --opd-st-block-bg: #f1f5f9;
  --opd-st-block-ink: #64748b;
  --opd-st-block-line: #cbd5e1;
  --opd-st-block-accent: #94a3b8;

  --opd-st-triage-bg: #ffedd5;
  --opd-st-triage-ink: #9a3412;
  --opd-st-triage-line: #fdba74;
  --opd-st-triage-accent: #f97316;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--ec-font);
  background: var(--ec-proposal-page-bg);
  color: var(--ec-platform-ink);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/*
 * Global native <select> — CareOS control chrome (chevron, padding, focus).
 * Excludes multi-select / list-box variants. Module CSS may refine sizes.
 */
select:not([multiple]):not([size]) {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-sizing: border-box;
  max-width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--ec-platform-line, #e2e8f0);
  border-radius: 8px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ec-platform-ink, #0f172a);
  background-color: var(--ec-platform-paper, #fff);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1.4 0.6L6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select:not([multiple]):not([size]):hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--ec-platform-blue, #0360f1) 35%, #cbd5e1);
}

select:not([multiple]):not([size]):focus,
select:not([multiple]):not([size]):focus-visible {
  /* Single focus ring — avoid border + outline looking like a double frame */
  outline: none;
  border-color: var(--ec-platform-blue, #0360f1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ec-platform-blue, #0360f1) 22%, transparent);
}

select:not([multiple]):not([size]):disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #fff;
}

html[dir='rtl'] select:not([multiple]):not([size]) {
  padding: 8px 12px 8px 36px;
  background-position: left 12px center;
}

/*
 * Global native text fields — same CareOS chrome as selects (no chevron).
 * Covers bare <input>/<textarea> with no class so browser defaults never show.
 * Module/class rules still override via higher specificity.
 */
input:not([type='checkbox']):not([type='radio']):not([type='button']):not([type='submit']):not([type='reset']):not([type='file']):not([type='hidden']):not([type='image']):not([type='range']):not([type='color']),
textarea {
  -moz-appearance: none;
       appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  max-width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--ec-platform-line, #e2e8f0);
  border-radius: 8px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ec-platform-ink, #0f172a);
  background-color: var(--ec-platform-paper, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.45;
}

input:not([type='checkbox']):not([type='radio']):not([type='button']):not([type='submit']):not([type='reset']):not([type='file']):not([type='hidden']):not([type='image']):not([type='range']):not([type='color']):hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--ec-platform-blue, #0360f1) 35%, #cbd5e1);
}

input:not([type='checkbox']):not([type='radio']):not([type='button']):not([type='submit']):not([type='reset']):not([type='file']):not([type='hidden']):not([type='image']):not([type='range']):not([type='color']):focus,
input:not([type='checkbox']):not([type='radio']):not([type='button']):not([type='submit']):not([type='reset']):not([type='file']):not([type='hidden']):not([type='image']):not([type='range']):not([type='color']):focus-visible,
textarea:focus,
textarea:focus-visible {
  outline: none;
  border-color: var(--ec-platform-blue, #0360f1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ec-platform-blue, #0360f1) 22%, transparent);
}

/*
 * Date / time / datetime: WebKit draws an inner edit frame that stacks with our
 * CareOS border and looks like a double border on every form.
 */
input[type='date'],
input[type='time'],
input[type='datetime-local'],
input[type='month'],
input[type='week'] {
  -moz-appearance: none;
       appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
}

input[type='date']::-webkit-datetime-edit,
input[type='time']::-webkit-datetime-edit,
input[type='datetime-local']::-webkit-datetime-edit,
input[type='month']::-webkit-datetime-edit,
input[type='week']::-webkit-datetime-edit,
input[type='date']::-webkit-datetime-edit-fields-wrapper,
input[type='time']::-webkit-datetime-edit-fields-wrapper,
input[type='datetime-local']::-webkit-datetime-edit-fields-wrapper,
input[type='month']::-webkit-datetime-edit-fields-wrapper,
input[type='week']::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

input[type='date']::-webkit-calendar-picker-indicator,
input[type='time']::-webkit-calendar-picker-indicator,
input[type='datetime-local']::-webkit-calendar-picker-indicator,
input[type='month']::-webkit-calendar-picker-indicator,
input[type='week']::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
  -webkit-margin-start: 4px;
          margin-inline-start: 4px;
}

input:not([type='checkbox']):not([type='radio']):not([type='button']):not([type='submit']):not([type='reset']):not([type='file']):not([type='hidden']):not([type='image']):not([type='range']):not([type='color']):disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #fff;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
  font-weight: 500;
  opacity: 1;
}

/* Checkboxes / radios — theme accent instead of OS default */
input[type='checkbox'],
input[type='radio'] {
  accent-color: var(--ec-platform-blue, #0360f1);
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  vertical-align: middle;
}

input[type='checkbox']:disabled,
input[type='radio']:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ec-app-loading,
.auth-callback {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px))
    max(24px, env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
  text-align: center;
}

.ec-app-loading--animated,
.ec-app-loading--splash {
  background: #ffffff;
  color: var(--ec-platform-ink, #0c1a2e);
}

.ec-app-loading--animated .med-loader,
.ec-app-loading--splash .med-loader {
  padding: 0;
}

.updated-alert {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10070;
  background: var(--ec-proposal-danger-bg);
  color: var(--ec-proposal-danger-text);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.page-wrapper.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.d-block {
  display: block !important;
}

.d-none {
  display: none !important;
}

.text-danger {
  color: #dc2626;
}

/* Dot menu dropdown */
.dots-wrapper {
  position: relative;
}

.dot-dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: #fff;
  border: 1px solid var(--ec-proposal-card-border);
  border-radius: 10px;
  list-style: none;
  margin: 4px 0 0;
  padding: 8px 0;
  min-width: 180px;
  z-index: 100;
  box-shadow: var(--ec-platform-card-shadow);
}

.dot-dropdown-menu li button,
.dot-dropdown-menu li a {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 16px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
}

.dot-dropdown-menu li:hover {
  background: #fff;
}

/* Triage table */
.traige_token_view {
  width: 100%;
  border-collapse: collapse;
}

.traige_token_view th,
.traige_token_view td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.traige_token_view th {
  background: #fff;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0f172a;
}

.triage-appointments {
  cursor: pointer;
}

.triage-appointments:hover {
  background: #fff;
}

.no-doctor-state p {
  color: #64748b;
  font-size: 14px;
  padding: 24px;
}

body.ec-opd-revamp-page .modal.d-block {
  display: block !important;
}

body.ec-opd-revamp-page .modal .modal-content {
  position: relative;
}

@font-face {
  font-family: "saudi_riyal";
  src: url(/_next/static/media/saudi_riyal.6d991251.woff2) format("woff2"),
    url(/_next/static/media/saudi_riyal.57bf7997.woff) format("woff"),
    url(/_next/static/media/saudi_riyal.6477ab53.ttf) format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "saudi_riyal_bold";
  src: url(/_next/static/media/saudi_riyal.bd88fc31.woff2) format("woff2"),
    url(/_next/static/media/saudi_riyal.98299cc0.woff) format("woff"),
    url(/_next/static/media/saudi_riyal.747f7cd5.ttf) format("truetype");
  font-weight: bold;
  font-style: normal;
}

/* Ensure the icon class correctly loads the Riyal symbol */
.icon-saudi_riyal::before {
  content: "\e900";
  font-family: "saudi_riyal" !important;
  font-size: inherit;
  color: inherit;
}

.icon-saudi_riyal_bold::before {
  content: "\e900";
  font-family: "saudi_riyal_bold" !important;
  font-size: inherit;
  color: inherit;
}

.icon-saudi_riyal_new::after {
  content: "\20c1";
  font-family: "saudi_riyal" !important;
  font-size: inherit;
  color: inherit;
}

.icon-saudi_riyal_bold_new::after {
  content: "\20c1";
  font-family: "saudi_riyal_bold" !important;
  font-size: inherit;
  color: inherit;
}


/**
 * Phone-app style screen transitions (slide / fade) for compact + native shells.
 *
 * IMPORTANT: do not leave a lasting `transform` / `will-change: transform` on the
 * wrapper — that creates a containing block and breaks position:fixed bottom
 * action bars (they scroll away with the page).
 */

.ch-page-transition {
  width: 100%;
  min-height: 100%;
}

/* Clip horizontal travel while a screen is sliding in */
body.ch-no-sidebar .ch-page-transition--push,
body.ch-no-sidebar .ch-page-transition--pop,
body.ch-native-app .ch-page-transition--push,
body.ch-native-app .ch-page-transition--pop,
.care .ch-page-transition--push,
.care .ch-page-transition--pop,
.pp .ch-page-transition--push,
.pp .ch-page-transition--pop {
  overflow-x: clip;
}

/* Strong slide on phone / Capacitor / Care / Patient */
body.ch-no-sidebar .ch-page-transition--push,
body.ch-native-app .ch-page-transition--push,
.care .ch-page-transition--push,
.pp .ch-page-transition--push {
  animation: ch-page-push-in 320ms cubic-bezier(0.32, 0.72, 0, 1) both;
}

body.ch-no-sidebar .ch-page-transition--pop,
body.ch-native-app .ch-page-transition--pop,
.care .ch-page-transition--pop,
.pp .ch-page-transition--pop {
  animation: ch-page-pop-in 300ms cubic-bezier(0.32, 0.72, 0, 1) both;
}

body.ch-no-sidebar .ch-page-transition--fade,
body.ch-native-app .ch-page-transition--fade,
.care .ch-page-transition--fade,
.pp .ch-page-transition--fade {
  animation: ch-page-fade-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Staff desktop only — Care / Patient keep the phone slides above. */
body:not(.ch-no-sidebar):not(.ch-native-app):not(:has(.care)):not(:has(.pp))
  .ch-page-transition--push,
body:not(.ch-no-sidebar):not(.ch-native-app):not(:has(.care)):not(:has(.pp))
  .ch-page-transition--pop,
body:not(.ch-no-sidebar):not(.ch-native-app):not(:has(.care)):not(:has(.pp))
  .ch-page-transition--fade {
  animation: ch-page-fade-in 160ms ease-out forwards;
}

/* Care: iOS-style stack even on a wide window */
body .care .ch-page-transition--push {
  animation: care-screen-push 380ms cubic-bezier(0.32, 0.72, 0, 1) both;
}

body .care .ch-page-transition--pop {
  animation: care-screen-pop 340ms cubic-bezier(0.32, 0.72, 0, 1) both;
}

body .care .ch-page-transition--fade {
  animation: ch-page-fade-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body .care.care--phone .ch-page-transition--push {
  animation: ch-page-push-in 420ms cubic-bezier(0.32, 0.72, 0, 1) both;
}

body .care.care--phone .ch-page-transition--pop {
  animation: ch-page-pop-in 380ms cubic-bezier(0.32, 0.72, 0, 1) both;
}

[dir='rtl'] body .care.care--phone .ch-page-transition--push {
  animation-name: ch-page-push-in-rtl;
}

[dir='rtl'] body .care.care--phone .ch-page-transition--pop {
  animation-name: ch-page-pop-in-rtl;
}

@keyframes care-screen-push {
  from {
    opacity: 1;
    transform: translate3d(28%, 0, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes care-screen-pop {
  from {
    opacity: 1;
    transform: translate3d(-18%, 0, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

[dir='rtl'] body .care .ch-page-transition--push {
  animation-name: care-screen-push-rtl;
}

[dir='rtl'] body .care .ch-page-transition--pop {
  animation-name: care-screen-pop-rtl;
}

@keyframes care-screen-push-rtl {
  from {
    opacity: 1;
    transform: translate3d(-28%, 0, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes care-screen-pop-rtl {
  from {
    opacity: 1;
    transform: translate3d(18%, 0, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ch-page-push-in {
  from {
    opacity: 0.96;
    transform: translate3d(100%, 0, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ch-page-pop-in {
  from {
    opacity: 0.96;
    transform: translate3d(-100%, 0, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ch-page-fade-in {
  from {
    opacity: 0.96;
  }
  to {
    opacity: 1;
  }
}

/* RTL: reverse horizontal slides */
[dir='rtl'] body.ch-no-sidebar .ch-page-transition--push,
[dir='rtl'] body.ch-native-app .ch-page-transition--push,
[dir='rtl'] .care .ch-page-transition--push,
[dir='rtl'] .pp .ch-page-transition--push {
  animation-name: ch-page-push-in-rtl;
}

[dir='rtl'] body.ch-no-sidebar .ch-page-transition--pop,
[dir='rtl'] body.ch-native-app .ch-page-transition--pop,
[dir='rtl'] .care .ch-page-transition--pop,
[dir='rtl'] .pp .ch-page-transition--pop {
  animation-name: ch-page-pop-in-rtl;
}

@keyframes ch-page-push-in-rtl {
  from {
    opacity: 1;
    transform: translate3d(-100%, 0, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ch-page-pop-in-rtl {
  from {
    opacity: 1;
    transform: translate3d(100%, 0, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.ch-no-sidebar .ch-page-transition--push,
  body.ch-no-sidebar .ch-page-transition--pop,
  body.ch-no-sidebar .ch-page-transition--fade,
  body.ch-native-app .ch-page-transition--push,
  body.ch-native-app .ch-page-transition--pop,
  body.ch-native-app .ch-page-transition--fade,
  body:not(.ch-no-sidebar) .ch-page-transition--push,
  body:not(.ch-no-sidebar) .ch-page-transition--pop,
  body:not(.ch-no-sidebar) .ch-page-transition--fade,
  .care .ch-page-transition--push,
  .care .ch-page-transition--pop,
  .care .ch-page-transition--fade,
  body .care .ch-page-transition--push,
  body .care .ch-page-transition--pop,
  body .care .ch-page-transition--fade,
  .pp .ch-page-transition--push,
  .pp .ch-page-transition--pop,
  .pp .ch-page-transition--fade {
    animation: none !important;
  }
}

/* Dedicated SPA sign-in — CareOS brand-first, patient-simple */
.spa-login {
  --login-ink: #07192f;
  --login-mist: #e8f0fa;
  --login-accent: #0a7ea4;
  --login-accent-deep: #0360f1;
  --login-paper: rgba(255, 255, 255, 0.92);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  color: var(--login-ink);
  font-family: var(--ec-font);
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

.spa-login__atmosphere {
  position: absolute;
  inset: 0;
  background: #fff;
  z-index: 0;
}

.spa-login__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  opacity: 0.55;
  animation: spa-login-drift 14s ease-in-out infinite alternate;
}

.spa-login__orb--a {
  width: min(48vw, 280px);
  height: min(48vw, 280px);
  top: -6%;
  left: -8%;
  background: #fff;
}

.spa-login__orb--b {
  width: min(42vw, 240px);
  height: min(42vw, 240px);
  right: -6%;
  bottom: 18%;
  background: radial-gradient(circle, rgba(10, 180, 190, 0.28), transparent 70%);
  animation-delay: -4s;
  animation-duration: 18s;
}

@keyframes spa-login-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(18px, 24px, 0) scale(1.08);
  }
}

.spa-login__top,
.spa-login__main {
  position: relative;
  z-index: 1;
}

.spa-login__top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 20px clamp(20px, 4vw, 48px) 0;
}

.spa-login__top:has(.spa-login__back) {
  justify-content: space-between;
}

.spa-login__back {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(7, 25, 47, 0.1);
  border-radius: 999px;
  background: #fff;
  color: var(--login-ink);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px;
}

.spa-login__back:active {
  transform: scale(0.96);
  background: rgba(10, 126, 164, 0.08);
}

[dir='rtl'] .spa-login__back span {
  display: inline-block;
  transform: scaleX(-1);
}

.spa-login__locale {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(7, 25, 47, 0.08);
}

.spa-login__locale button {
  border: 0;
  background: transparent;
  color: var(--login-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.spa-login__locale button.is-active {
  background: #072854;
  color: #fff;
}

.spa-login__main {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  padding: 8px clamp(20px, 4vw, 40px) 36px;
}

.spa-login__hero {
  text-align: center;
  margin-bottom: 22px;
  animation: spa-login-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes spa-login-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spa-login__logo-wrap {
  position: relative;
  width: min(148px, 42vw);
  height: min(148px, 42vw);
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
}

.spa-login__logo-ring {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(10, 126, 164, 0.2));
  box-shadow:
    0 18px 40px rgba(7, 25, 47, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  animation: spa-login-pulse 2.8s ease-in-out infinite;
}

@keyframes spa-login-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 18px 40px rgba(7, 25, 47, 0.22),
      0 0 0 0 rgba(10, 126, 164, 0.28);
  }
  50% {
    transform: scale(1.03);
    box-shadow:
      0 22px 48px rgba(7, 25, 47, 0.28),
      0 0 0 12px rgba(10, 126, 164, 0);
  }
}

.spa-login__logo {
  position: relative;
  z-index: 1;
  width: min(140px, 42vw);
  height: auto;
  aspect-ratio: 1;
  max-height: 140px;
  border-radius: 22px;
  object-fit: cover;
  background: transparent;
  animation: spa-login-float 4.5s ease-in-out infinite;
}

@keyframes spa-login-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.spa-login__brand-kicker {
  margin: 0 0 6px;
  font-family: var(--ec-font-display);
  font-size: clamp(1.75rem, 5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--login-ink);
}

.spa-login__title {
  margin: 0 0 8px;
  font-family: var(--ec-font-display);
  font-size: clamp(1.15rem, 3.6vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.spa-login__privacy {
  margin: 10px auto 0;
  max-width: 34ch;
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(7, 25, 47, 0.62);
}

.spa-login__consent {
  display: flex !important;
  grid-template-columns: none;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500 !important;
  font-size: 0.8125rem !important;
  line-height: 1.4;
}

.spa-login__consent input {
  width: auto !important;
  margin-top: 3px;
  flex-shrink: 0;
}

.spa-login__form {
  display: grid;
  grid-gap: 14px;
  gap: 14px;
  padding: 18px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 24px 50px rgba(7, 25, 47, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
}

.spa-login__panel {
  animation: spa-login-panel-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes spa-login-panel-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.spa-login__phone {
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(7, 25, 47, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.spa-login__phone:focus-within {
  border-color: var(--login-accent);
  box-shadow: 0 0 0 3px rgba(10, 126, 164, 0.2);
}

.spa-login__phone.is-locked {
  background: rgba(7, 25, 47, 0.04);
}

.spa-login__dial {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: rgba(7, 25, 47, 0.72);
  background: rgba(10, 126, 164, 0.08);
  -webkit-border-end: 1px solid rgba(7, 25, 47, 0.1);
          border-inline-end: 1px solid rgba(7, 25, 47, 0.1);
  white-space: nowrap;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.spa-login__phone input {
  flex: 1 1;
  min-width: 0;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent !important;
}

.spa-login__mode button {
  transition:
    background 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}

.spa-login__mode button:active {
  transform: scale(0.98);
}

.spa-login__submit {
  transition:
    transform 0.2s ease,
    box-shadow 0.25s ease,
    opacity 0.2s ease;
}

.spa-login__submit:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(3, 96, 241, 0.34);
}

.spa-login__submit:not(:disabled):active {
  transform: translateY(0) scale(0.99);
}

.spa-login__logo-wrap {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.spa-login__hero:hover .spa-login__logo-wrap {
  transform: scale(1.03);
}

.spa-login__error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(180, 35, 24, 0.1);
  color: #8e1f16;
  font-size: 0.875rem;
  animation: spa-login-shake 0.4s ease both;
}

@keyframes spa-login-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

.spa-login__field {
  display: grid;
  grid-gap: 6px;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.spa-login__field input {
  width: 100%;
  border: 1px solid rgba(7, 25, 47, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-weight: 500;
  /* iOS Safari zooms when a focused input is smaller than 16px. */
  font-size: 16px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--login-ink);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.spa-login__field input:focus {
  outline: 2px solid rgba(10, 126, 164, 0.35);
  border-color: var(--login-accent);
}

.spa-login__field input:-moz-read-only {
  background: rgba(7, 25, 47, 0.04);
}

.spa-login__field input:read-only {
  background: rgba(7, 25, 47, 0.04);
}

.spa-login__optional {
  font-style: normal;
  font-weight: 500;
  color: rgba(7, 25, 47, 0.5);
}

.spa-login__resume {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(7, 25, 47, 0.08);
}

.spa-login__resume p {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(7, 25, 47, 0.55);
}

.spa-login__resume button {
  border: 0;
  background: #fff;
  color: var(--login-ink);
  font: inherit;
  font-weight: 600;
  text-align: start;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(7, 25, 47, 0.06);
}

.spa-login__mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 6px;
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(7, 25, 47, 0.08);
}

.spa-login__mode button {
  border: 0;
  background: transparent;
  color: rgba(7, 25, 47, 0.7);
  font: inherit;
  font-weight: 600;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
}

.spa-login__mode button.is-active {
  background: #fff;
  color: var(--login-ink);
  box-shadow: 0 6px 16px rgba(7, 25, 47, 0.1);
}

.spa-login__hint {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: rgba(7, 25, 47, 0.7);
}

.spa-login__hint--soft {
  color: var(--login-accent);
  font-weight: 600;
}

.spa-login__alt {
  border: 0;
  background: transparent;
  color: rgba(7, 25, 47, 0.65);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.spa-login__alt:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.spa-login__password {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.spa-login__password input {
  flex: 1 1;
}

.spa-login__password button {
  border: 1px solid rgba(7, 25, 47, 0.14);
  background: #fff;
  border-radius: 12px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.spa-login__submit {
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, #0a7ea4 0%, #0360f1 100%);
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(3, 96, 241, 0.28);
}

.spa-login__submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.spa-login__staff-link {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border: 1.4px solid var(--login-accent-deep, #2563eb);
  border-radius: 14px;
  background: #fff;
  color: #1e3a5f;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .spa-login__orb,
  .spa-login__logo,
  .spa-login__logo-ring,
  .spa-login__hero,
  .spa-login__form,
  .spa-login__panel,
  .spa-login__error {
    animation: none !important;
  }

  .spa-login__submit,
  .spa-login__mode button,
  .spa-login__logo-wrap {
    transition: none !important;
  }
}

[dir='rtl'] .spa-login__main {
  text-align: right;
}

[dir='rtl'] .spa-login__hero {
  text-align: center;
}

@media (max-width: 991px) {
  .spa-login__top {
    padding: 12px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  }
}

@media (max-width: 420px) {
  .spa-login__title {
    font-size: 1.1rem;
  }
}

/* —— Web Hub desktop layout —— */
.spa-login__web-aside {
  display: none;
  margin: 14px 0 0;
  max-width: 36ch;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(7, 25, 47, 0.62);
}

.spa-login__web-aside a,
.spa-login__demo-cta a {
  color: var(--login-accent-deep);
  font-weight: 650;
  text-decoration: none;
}

.spa-login__web-aside a:hover,
.spa-login__demo-cta a:hover {
  text-decoration: underline;
}

.spa-login__demo-cta {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(7, 25, 47, 0.72);
}

.spa-login__orb--c {
  width: min(52vw, 640px);
  height: min(52vw, 640px);
  top: 12%;
  left: 58%;
  background: radial-gradient(circle, rgba(3, 96, 241, 0.18), transparent 68%);
  animation-delay: -1.4s;
}

.spa-login__stage {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.spa-login__panel-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

@media (min-width: 960px) {
  .spa-login--web {
    --login-ink: #07192f;
  }

  .spa-login--web .spa-login__main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px clamp(32px, 5vw, 72px) 56px;
    justify-content: center;
    flex: 1 1;
  }

  .spa-login--web .spa-login__stage {
    display: grid;
    grid-template-columns: minmax(280px, 1.05fr) minmax(340px, 0.95fr);
    grid-gap: clamp(36px, 6vw, 72px);
    gap: clamp(36px, 6vw, 72px);
    align-items: center;
    min-height: min(640px, calc(100dvh - 96px));
  }

  .spa-login--web .spa-login__hero {
    text-align: start;
    margin-bottom: 0;
  }

  .spa-login--web .spa-login__logo-wrap {
    margin: 0 0 18px;
    width: min(160px, 100%);
    height: 160px;
  }

  .spa-login--web .spa-login__logo {
    width: min(140px, 100%);
    max-height: 140px;
  }

  .spa-login--web .spa-login__brand-kicker {
    font-size: clamp(2.1rem, 3.2vw, 2.75rem);
  }

  .spa-login--web .spa-login__title {
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    max-width: 18ch;
  }

  .spa-login--web .spa-login__lead {
    max-width: 34ch;
  }

  .spa-login--web .spa-login__web-aside {
    display: block;
  }

  .spa-login--web .spa-login__form {
    padding: 28px 26px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow:
      0 28px 64px rgba(7, 25, 47, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.7);
  }

  .spa-login--web .spa-login__mode {
    max-width: none;
  }

  [dir='rtl'] .spa-login--web .spa-login__hero {
    text-align: start;
  }
}

@media (min-width: 1200px) {
  .spa-login--web .spa-login__main {
    padding-top: 40px;
  }
}

@media (max-width: 767px) {
  .spa-login {
    --login-ink: #0f172a;
    --login-accent: #2563eb;
    --login-accent-deep: #1e3a5f;
  }

  .spa-login.spa-login--web {
    background: linear-gradient(135deg, #2563eb, #1e3a5f);
  }

  .spa-login.spa-login--web .spa-login__atmosphere {
    background: transparent;
  }

  .spa-login.spa-login--web .spa-login__title,
  .spa-login.spa-login--web .spa-login__lead,
  .spa-login.spa-login--web .spa-login__brand-kicker {
    color: #fff;
  }

  .spa-login.spa-login--web .spa-login__lead {
    color: rgba(255, 255, 255, 0.82);
  }

  .spa-login__top {
    padding: 12px 16px 0;
  }

  .spa-login__back {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .spa-login__locale button {
    min-height: 48px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 14px;
  }

  .spa-login__main {
    max-width: none;
    padding: 8px 16px 28px;
    justify-content: flex-start;
  }

  .spa-login__title {
    font-size: 1.45rem;
  }

  .spa-login__lead,
  .spa-login__hint {
    font-size: 15px;
  }

  .spa-login__mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 8px;
    gap: 8px;
    margin-bottom: 14px;
    padding: 4px;
    overflow: visible;
    flex-wrap: unset;
    border-radius: 14px;
    background: #fff;
  }

  .spa-login__mode .staff-phone-chip,
  .spa-login__mode button {
    width: 100%;
    min-height: 48px !important;
    justify-content: center;
    padding: 0 12px !important;
    border-radius: 14px !important;
    font-size: 15px !important;
    font-weight: 700;
  }

  .spa-login__mode .staff-phone-chip.is-active,
  .spa-login__mode button.is-active {
    background: #eff6ff;
    color: #1e3a5f;
  }

  .spa-login__form,
  .spa-login__panel {
    padding: 18px 16px;
    border-radius: 14px;
  }

  .spa-login__field {
    font-size: 15px;
  }

  .spa-login__field input,
  .spa-login__phone {
    min-height: 48px;
    border-radius: 14px;
    font-size: 16px;
  }

  .spa-login__password button {
    min-height: 48px;
    border-radius: 14px;
  }

  .spa-login__submit,
  .spa-login__staff-link,
  .spa-login__alt,
  .spa-login__resume button {
    min-height: 48px;
    border-radius: 14px;
    font-size: 15px;
  }

  .spa-login__error.staff-phone-error,
  .spa-login__error {
    margin: 0 0 12px;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 15px;
  }
}


  html.ch-native-app .spa-login__mode .staff-phone-chip,
  html.ch-native-app .spa-login__mode button {
    min-height: 48px !important;
    border-radius: 14px !important;
    font-size: 15px !important;
  }

  html.ch-native-app .spa-login__back,
  html.ch-native-app .spa-login__locale button {
    min-height: 48px;
    width: auto;
  }

  html.ch-native-app .spa-login__back {
    width: 48px;
    height: 48px;
  }


/* Shared Platform UI primitives used across OPD and future modules */

.ec-panel-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--ec-platform-paper);
  border: 1px solid var(--ec-platform-line);
  border-radius: var(--ec-platform-card-radius);
  box-shadow: var(--ec-platform-card-shadow);
  overflow: hidden;
}

.ec-panel-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ec-platform-line);
}

.ec-panel-card__title {
  margin: 0;
  font-family: var(--ec-font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ec-platform-ink);
  letter-spacing: -0.01em;
}

.ec-panel-card__body {
  padding: 14px 16px;
  flex: 1 1;
  min-height: 0;
}

.ec-panel-card__foot {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--ec-platform-line);
}

.ec-stat-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--ec-platform-line);
  background: var(--ec-platform-mist);
  text-align: center;
  min-width: 0;
}

.ec-stat-chip__value {
  font-family: var(--ec-font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ec-platform-ink);
  line-height: 1.1;
}

.ec-stat-chip__label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ec-platform-muted);
}

.ec-stat-chip--info {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.ec-stat-chip--success {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.ec-stat-chip--warn {
  border-color: #fed7aa;
  background: #fff7ed;
}

.ec-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-gap: 10px;
  gap: 10px;
  margin-bottom: 14px;
}

.ec-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  line-height: 1.2;
}

.ec-status-pill--success {
  background: var(--ec-proposal-success-bg);
  color: var(--ec-proposal-success-text);
}

.ec-status-pill--info {
  background: var(--ec-proposal-info-bg);
  color: var(--ec-proposal-info-text);
}

.ec-status-pill--warn {
  background: var(--ec-proposal-warn-bg);
  color: var(--ec-proposal-warn-text);
}

.ec-status-pill--danger {
  background: var(--ec-proposal-danger-bg);
  color: var(--ec-proposal-danger-text);
}

.ec-kpi-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  background: var(--ec-platform-paper);
  border: 1px solid var(--ec-platform-line);
  border-radius: var(--ec-platform-card-radius);
  box-shadow: var(--ec-platform-card-shadow);
}

.ec-kpi-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dbeafe;
  color: var(--ec-platform-blue);
  flex-shrink: 0;
  font-size: 1.1rem;
}

.ec-kpi-card__label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ec-platform-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ec-kpi-card__value {
  margin: 4px 0 0;
  font-family: var(--ec-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ec-platform-ink);
  letter-spacing: -0.02em;
}

.ec-kpi-card__meta {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--ec-proposal-success-text);
  font-weight: 600;
}

.ec-platform-page {
  padding: 8px 0 28px;
  background: #fff;
}

/* Kill leftover silver/mist page shells across modules */
.page-wrapper--platform,
.hospital-platform-page,
.platform-page__body,
.ec-platform-page,
.page-wrapper--platform .ec-platform-page {
  background-color: #fff;
}

.ec-platform-page__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

/* Title lives in the topbar; keep subtitle/actions compact when H1 is absent. */
.ec-platform-page__toolbar:not(:has(.ec-platform-page__title)) {
  align-items: center;
  margin-bottom: 12px;
}

.ec-platform-page__title {
  margin: 0;
  font-family: var(--ec-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--ec-platform-ink);
  overflow: visible;
}

.ec-platform-page__sub {
  margin: 4px 0 0;
  font-size: 0.875rem;
  color: var(--ec-platform-muted);
}

.ec-platform-page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* OPD (and similar): keep filter/actions in the toolbar on phone instead of bottom dock */
body.ch-no-sidebar .ec-platform-page--actions-top.ec-platform-page--has-actions,
html.ch-native-app .ec-platform-page--actions-top.ec-platform-page--has-actions {
  padding-bottom: 0;
}

body.ch-no-sidebar .ec-platform-page--actions-top .ec-platform-page__actions,
html.ch-native-app .ec-platform-page--actions-top .ec-platform-page__actions {
  position: static !important;
  inset: auto !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  z-index: auto !important;
}

@media (max-width: 991px) {
  /*
   * Single bottom-chrome system (phone).
   * --ch-mobile-bottom-chrome is the only padding reservation pages should use.
   * Default = compact actions dock; modules with bottom nav override the token.
   */
  body.ch-no-sidebar {
    --ch-mobile-header-offset: calc(56px + env(safe-area-inset-top, 0px));
    --ch-opd-filter-bar: 56px;
    --ch-mobile-nav-height: 64px;
    --ch-mobile-actions-dock: 56px;
    --ch-mobile-actions-offset: calc(var(--ch-mobile-actions-dock) + env(safe-area-inset-bottom, 0px));
    --ch-mobile-bottom-chrome: var(--ch-mobile-actions-offset);
  }

  /* Module bottom nav alone */
  body.ch-no-sidebar .has-module-bottom-nav,
  body.ch-no-sidebar .opd-has-bottom-nav,
  body.ch-no-sidebar .ipd-has-bottom-nav {
    --ch-mobile-bottom-chrome: calc(var(--ch-mobile-nav-height) + env(safe-area-inset-bottom, 0px));
  }

  /* Bottom nav + page actions: one combined band; actions sit above the nav */
  body.ch-no-sidebar .has-module-bottom-nav.ec-platform-page--has-actions,
  body.ch-no-sidebar .has-module-bottom-nav .ec-platform-page--has-actions,
  body.ch-no-sidebar .opd-has-bottom-nav.ec-platform-page--has-actions,
  body.ch-no-sidebar .ipd-has-bottom-nav.ec-platform-page--has-actions {
    --ch-mobile-bottom-chrome: calc(
      var(--ch-mobile-nav-height) + var(--ch-mobile-actions-dock) + env(safe-area-inset-bottom, 0px)
    );
  }

  .ec-platform-page {
    padding: 6px 0 20px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .ec-platform-page__toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }

  .ec-platform-page__title {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  .ec-platform-page__actions {
    width: 100%;
  }

  .ec-platform-page__actions > *,
  .ec-platform-page__actions .rad-shot-btn {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }

  /* Phone web / no-sidebar: mirror native fixed chrome */
  body.ch-no-sidebar.ec-b2b-theme.ec-sidebar-layout .ec-app-topbar.ec-app-topbar--compact {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1200;
  }

  body.ch-no-sidebar.ec-b2b-theme.ec-sidebar-layout .ec-app-content {
    padding-top: calc(12px + var(--ch-mobile-header-offset)) !important;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.ch-no-sidebar .ec-platform-page--has-actions {
    padding-bottom: var(--ch-mobile-bottom-chrome);
  }

  body.ch-no-sidebar .ec-platform-page__actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: var(--ch-mobile-actions-dock);
    margin: 0;
    padding: 8px max(12px, env(safe-area-inset-right, 0px))
      calc(8px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
    border-top: 1px solid var(--ec-proposal-card-border, #e2e8f0);
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Sit the action dock above the module bottom nav when both are present */
  body.ch-no-sidebar .has-module-bottom-nav .ec-platform-page__actions,
  body.ch-no-sidebar .has-module-bottom-nav.ec-platform-page .ec-platform-page__actions,
  body.ch-no-sidebar .opd-has-bottom-nav .ec-platform-page__actions,
  body.ch-no-sidebar .ipd-has-bottom-nav .ec-platform-page__actions {
    bottom: calc(var(--ch-mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: 8px;
    z-index: 1090;
  }

  body.ch-no-sidebar .ec-platform-page__actions > *,
  body.ch-no-sidebar .ec-platform-page__actions .rad-shot-btn,
  body.ch-no-sidebar .ec-platform-page__actions .ec-btn {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-height: 44px;
    justify-content: center;
  }

  body.ch-no-sidebar .ch-bottom-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1250;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: var(--ch-mobile-actions-dock);
    margin: 0 !important;
    padding: 8px max(12px, env(safe-area-inset-right, 0px))
      calc(8px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
    border-top: 1px solid var(--ec-proposal-card-border, #e2e8f0);
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.ch-no-sidebar .has-module-bottom-nav .ch-bottom-actions,
  body.ch-no-sidebar .opd-has-bottom-nav .ch-bottom-actions,
  body.ch-no-sidebar .ipd-has-bottom-nav .ch-bottom-actions {
    bottom: calc(var(--ch-mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: 8px;
  }

  body.ch-no-sidebar .ch-bottom-actions > * {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    justify-content: center;
  }

  body.ch-no-sidebar .page-wrapper:has(.ch-bottom-actions-spacer),
  body.ch-no-sidebar .rad-shot-detail:has(.ch-bottom-actions-spacer),
  body.ch-no-sidebar article:has(.ch-bottom-actions-spacer),
  body.ch-no-sidebar .inv-form:has(.ch-bottom-actions-spacer),
  body.ch-no-sidebar .page-wrapper:has(.ch-bottom-actions),
  body.ch-no-sidebar .rad-shot-detail:has(.ch-bottom-actions),
  body.ch-no-sidebar article:has(.ch-bottom-actions),
  body.ch-no-sidebar .inv-form:has(.ch-bottom-actions) {
    padding-bottom: var(--ch-mobile-bottom-chrome);
  }

  /* Phone web: same content-only scrollport as native (sticky chrome, no document PTR). */
  html:has(body.ch-no-sidebar) {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
  }

  body.ch-no-sidebar,
  body.ch-no-sidebar.ec-b2b-theme {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
  }

  body.ch-no-sidebar.ec-b2b-theme.ec-sidebar-layout .ec-app-shell,
  body.ch-no-sidebar.ec-b2b-theme.ec-sidebar-layout .ec-app-main {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden !important;
  }

  body.ch-no-sidebar.ec-b2b-theme.ec-sidebar-layout .ec-app-content {
    height: 100%;
    max-height: 100%;
    min-height: 0 !important;
    overflow-x: clip !important;
    overflow-y: auto !important;
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
    overflow-anchor: none;
  }

  body.ch-no-sidebar .ec-platform-page,
  body.ch-no-sidebar .page-wrapper,
  body.ch-no-sidebar .page-wrapper--platform {
    overflow-x: clip !important;
    overflow-y: visible !important;
  }

}

html.ch-native-app .ec-platform-page,
body.ch-no-sidebar .ec-platform-page {
  max-width: 100%;
  overflow-x: clip;
}

.ec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-family: var(--ec-font);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.ec-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.ec-btn--primary {
  color: #fff;
  background: var(--ec-platform-blue);
  border-color: var(--ec-platform-blue);
  box-shadow: 0 4px 12px rgba(3, 96, 241, 0.25);
}

.ec-btn--primary:hover {
  color: #fff;
  background: #0250d4;
  filter: brightness(1.02);
}

.ec-btn--ghost {
  color: var(--ec-platform-navy);
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(30, 58, 95, 0.2);
}

.ec-platform-grid {
  display: grid;
  grid-gap: 16px;
  gap: 16px;
}

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

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

.ec-platform-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ec-platform-grid--main-side {
  grid-template-columns: minmax(0, 1fr) 320px;
}

@media (max-width: 1199px) {
  .ec-platform-grid--3,
  .ec-platform-grid--4,
  .ec-platform-grid--main-side {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991px) {
  .ec-platform-grid--2 {
    grid-template-columns: 1fr;
  }

  .ec-stat-row {
    grid-template-columns: 1fr;
  }
}

.ec-filter-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  padding: 5px;
  border: 1px solid color-mix(in srgb, var(--ec-platform-blue, #0360f1) 22%, #c7d7f5);
  border-radius: 14px;
  background: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 1px 2px rgba(7, 40, 84, 0.04);
}

.ec-filter-tabs__btn {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ec-platform-navy, #072854);
  border-radius: 10px;
  padding: 7px 13px;
  font-family: var(--ec-font, 'Inter', sans-serif);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.015em;
  cursor: pointer;
  opacity: 0.78;
  transition:
    color 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease;
}

.ec-filter-tabs__btn:hover {
  opacity: 1;
  color: var(--ec-platform-blue, #0360f1);
  background: rgba(255, 255, 255, 0.72);
}

.ec-filter-tabs__btn.is-active {
  opacity: 1;
  color: #fff;
  background: #fff;
  border-color: color-mix(in srgb, var(--ec-platform-navy, #072854) 35%, var(--ec-platform-blue, #0360f1));
  box-shadow:
    0 2px 5px rgba(3, 96, 241, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.ec-text-link {
  color: var(--ec-platform-blue);
  font-weight: 600;
  font-size: 0.8125rem;
  text-decoration: none;
}

.ec-text-link:hover {
  text-decoration: underline;
}

.ec-module-table {
  width: 100%;
  border-collapse: collapse;
}

.ec-module-table th {
  background: #fff;
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ec-platform-line);
}

.ec-module-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #475569;
  font-size: 0.875rem;
  vertical-align: middle;
}

.ec-module-table a {
  color: var(--ec-platform-blue);
  font-weight: 600;
}

/* Shared CareOS UI primitives — usable across all SPA modules */

.ui-form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.875rem;
  color: #334155;
}

.ui-form-field__label {
  font-weight: 600;
  color: #0f172a;
}

.ui-form-field__required {
  color: #dc2626;
  -webkit-margin-start: 2px;
          margin-inline-start: 2px;
}

.ui-form-field__hint {
  font-size: 0.78rem;
  color: #64748b;
}

.ui-form-field__error {
  font-size: 0.78rem;
  color: #b91c1c;
}

.ui-form-field.has-error input,
.ui-form-field.has-error select,
.ui-form-field.has-error textarea {
  border-color: #f87171;
}

.ui-form-field input,
.ui-form-field select,
.ui-form-field textarea {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.ui-multi-check {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.ui-multi-check.is-disabled {
  opacity: 0.65;
  pointer-events: none;
}

.ui-multi-check__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
}

.ui-multi-check__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ui-multi-check__search {
  flex: 1 1 140px;
  min-width: 120px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
}

.ui-multi-check__action {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.ui-multi-check__action:hover:not(:disabled) {
  background: #fff;
}

.ui-multi-check__list {
  max-height: 180px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-gap: 4px 10px;
  gap: 4px 10px;
}

.ui-multi-check__item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.85rem;
  cursor: pointer;
}

.ui-multi-check__empty,
.ui-multi-check__count {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
}

.ui-empty-state {
  text-align: center;
  padding: 28px 16px;
  color: #64748b;
}

.ui-empty-state__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
}

.ui-empty-state__hint {
  margin: 6px 0 0;
  font-size: 0.85rem;
}

.ui-empty-state__action {
  margin-top: 12px;
}

/* Buttons: see careos-module.css (.ui-btn aliased there). */

.ui-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.ui-section-nav__tab {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 0.85rem;
  color: #475569;
  cursor: pointer;
}

.ui-section-nav__tab.is-active {
  background: var(--ec-platform-blue, #0360f1);
  border-color: var(--ec-platform-blue, #0360f1);
  color: #fff;
  font-weight: 600;
}

.ui-flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.ui-flash--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.ui-flash--info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.ui-flash--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.ui-flash__text {
  margin: 0;
  flex: 1 1;
}

.ui-flash__dismiss {
  border: 0;
  background: transparent;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
}

/* .ui-btn* → careos-module.css */

.ui-confirm-modal .inv-modal__title {
  font-weight: 700;
}

.ui-confirm-modal--error .inv-modal__title {
  color: #b91c1c;
}

.ui-flash-modal__text {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
}

.ui-flash-modal__list,
.ui-flash__list {
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.55;
}

.ui-flash-modal__list li + li,
.ui-flash__list li + li {
  margin-top: 0.35rem;
}

/* —— Module page chrome —— moved to careos-module.css (imported before module dashboards).
 * Keep form/flash helpers below; page headers, KPIs, and buttons are shared there.
 */

/* Portaled module dialogs — always above CareOS sidebar (z-index 1000). */
.careos-portal-modal {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: grid;
  place-items: center;
  padding: 16px;
  box-sizing: border-box;
}

body.careos-portal-modal-open {
  overflow: hidden;
}


/* Shared shimmer skeleton — admin SPA */

.ch-skel {
  --ch-skel-base: color-mix(in srgb, var(--ec-platform-line, #e2e8f0) 70%, #fff);
  --ch-skel-shine: color-mix(in srgb, #fff 55%, var(--ec-platform-line, #e2e8f0));
  display: block;
  background: linear-gradient(
    105deg,
    var(--ch-skel-base) 0%,
    var(--ch-skel-base) 38%,
    var(--ch-skel-shine) 50%,
    var(--ch-skel-base) 62%,
    var(--ch-skel-base) 100%
  );
  background-size: 220% 100%;
  animation: ch-skel-shimmer 1.35s ease-in-out infinite;
  border-radius: 8px;
}

html[dir='rtl'] .ch-skel {
  animation-name: ch-skel-shimmer-rtl;
}

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

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

@media (prefers-reduced-motion: reduce) {
  .ch-skel {
    animation: none;
    background: var(--ch-skel-base);
  }
}

.ch-skel--circle { border-radius: 999px; }
.ch-skel--pill { border-radius: 999px; }

.ch-skel-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 2px 0 8px;
}

.ch-skel-page__hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
}

.ch-skel-page__hero-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: min(100%, 280px);
  flex: 1 1;
}

.ch-skel-page__hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ch-skel-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  grid-gap: 12px;
  gap: 12px;
}

.ch-skel-kpi {
  border: 1px solid var(--ec-platform-line, #e2e8f0);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: color-mix(in srgb, #fff 88%, var(--ec-platform-line, #e2e8f0));
}

.ch-skel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-gap: 16px;
  gap: 16px;
}

@media (max-width: 900px) {
  .ch-skel-grid { grid-template-columns: 1fr; }
}

.ch-skel-card {
  border: 1px solid var(--ec-platform-line, #e2e8f0);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 160px;
}

.ch-skel-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.ch-skel-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ch-skel-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.7fr 0.7fr;
  grid-gap: 12px;
  gap: 12px;
  align-items: center;
}

@media (max-width: 720px) {
  .ch-skel-row { grid-template-columns: 1fr 1fr; }
}

.ch-skel-table {
  border: 1px solid var(--ec-platform-line, #e2e8f0);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.ch-skel-table__head,
.ch-skel-table__row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 0.8fr 0.8fr 0.7fr;
  grid-gap: 12px;
  gap: 12px;
  padding: 12px 14px;
  align-items: center;
}

.ch-skel-table__head {
  background: color-mix(in srgb, var(--ec-platform-line, #e2e8f0) 35%, #fff);
  border-bottom: 1px solid var(--ec-platform-line, #e2e8f0);
}

.ch-skel-table__row + .ch-skel-table__row {
  border-top: 1px solid color-mix(in srgb, var(--ec-platform-line, #e2e8f0) 70%, transparent);
}

@media (max-width: 720px) {
  .ch-skel-table__head,
  .ch-skel-table__row {
    grid-template-columns: 1.4fr 1fr 0.8fr;
  }
  .ch-skel-table__head > :nth-child(n + 4),
  .ch-skel-table__row > :nth-child(n + 4) {
    display: none;
  }
}

.ch-skel-form {
  border: 1px solid var(--ec-platform-line, #e2e8f0);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  display: grid;
  grid-gap: 14px;
  gap: 14px;
}

.ch-skel-form__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ch-skel-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* RTL / LTR layout — mirrors Rails css/locale_rtl.scss for the admin SPA */

html[dir='rtl'] body {
  direction: rtl;
  text-align: right;
  font-family: 'Noto Sans Arabic', var(--ec-font);
}

html[dir='ltr'] body {
  direction: ltr;
  text-align: left;
}

/* Keep locale toggle readable (EN | AR) */
html[dir='rtl'] .ec-locale-switcher,
html[dir='ltr'] .ec-locale-switcher {
  direction: ltr;
}

/* -------------------------------------------------------------------------- */
/* App shell                                                                  */
/* -------------------------------------------------------------------------- */

html[dir='rtl'] body.ec-b2b-theme.ec-sidebar-layout .ec-app-shell {
  direction: rtl;
}

html[dir='rtl'] body.ec-b2b-theme.ec-sidebar-layout .ec-sidebar-menu-list > li.open > a,
html[dir='rtl'] body.ec-b2b-theme.ec-sidebar-layout .ec-sidebar-menu-list > li.active > a {
  /* Mirror LTR inset accent bar (shell.css uses inset 3px 0 0). */
  box-shadow: inset -3px 0 0 var(--ec-sidebar-active-bar, var(--ec-platform-blue, #0360f1));
}

/* Mirror LTR edge shadow from shell.css — keep the same softness, flip X only.
   Previous RTL override used -4px/24px @ 0.18 and looked like a heavy smear. */
html[dir='rtl'] body.ec-b2b-theme.ec-sidebar-layout .ec-app-sidebar {
  box-shadow: -1px 0 0 rgba(12, 26, 46, 0.04), -4px 0 18px rgba(12, 26, 46, 0.04);
}

html[dir='rtl'] .ec-platform-grid--main-side {
  grid-template-columns: 320px minmax(0, 1fr);
}

@media (max-width: 1199px) {
  html[dir='rtl'] .ec-platform-grid--main-side {
    grid-template-columns: 1fr;
  }
}

html[dir='rtl'] .page-wrapper .left-aside {
  border-right: none;
}

html[dir='rtl'] .dot-dropdown-menu {
  right: auto;
  left: 0;
}

html[dir='rtl'] .dot-dropdown-menu li button,
html[dir='rtl'] .dot-dropdown-menu li a {
  text-align: right;
}


html[dir='rtl'] body.ec-b2b-theme.ec-sidebar-layout .ec-sidebar-menu-arrow {
  margin-left: 0;
  -webkit-margin-start: auto;
          margin-inline-start: auto;
}

html[dir='rtl'] body.ec-b2b-theme.ec-sidebar-layout .ec-sidebar-menu-list .sub-menu a {
  padding-block: 8px;
  padding-inline: 40px 16px !important;
}

html[dir='rtl'] body.ec-b2b-theme.ec-sidebar-layout .ec-sidebar-toggle {
  -webkit-border-end: none;
          border-inline-end: none;
  -webkit-border-start: 1px solid var(--ec-proposal-card-border);
          border-inline-start: 1px solid var(--ec-proposal-card-border);
}

/* Compact rail — mirror Rails admin_rtl_layout compact flyouts */
html[dir='rtl'] body.ec-b2b-theme.ec-sidebar-layout.ec-sidebar-compact .ec-sidebar-has-submenu > a > .ec-sidebar-menu-arrow {
  right: auto;
  left: 6px;
}

html[dir='rtl'] body.ec-b2b-theme.ec-sidebar-layout.ec-sidebar-compact .ec-sidebar-menu-list > li.open > .sub-menu {
  left: auto !important;
  right: 100% !important;
  border-radius: 8px 0 0 8px !important;
  /* Mirror LTR compact flyout (shell.css: 4px 4px 16px @ 0.1). */
  box-shadow: -4px 4px 16px rgba(15, 23, 42, 0.1) !important;
}

/* -------------------------------------------------------------------------- */
/* Top navigation                                                             */
/* -------------------------------------------------------------------------- */

/* Keep base navigation.css justify-content: flex-end — in RTL that packs the
   Create/actions cluster to the physical LEFT (mirror of LTR). Do NOT force
   flex-start here; that pins the whole header chrome back to the right. */

html[dir='rtl'] .ec-app-topbar .create-list-btn > li {
  padding: 6px 18px 6px 12px;
  margin-right: 0;
  margin-left: 20px;
}

html[dir='rtl'] .ec-app-topbar .create-list-btn > li span.arrow {
  right: auto;
  left: 20px;
}

html[dir='rtl'] .ec-app-topbar .create-sub-menu {
  right: auto;
  left: -9px;
}

html[dir='rtl'] .ec-app-topbar .more-actions {
  padding-left: 0;
  padding-right: 15px;
}

html[dir='rtl'] .ec-app-topbar .user-wrap {
  margin-left: 0;
  margin-right: 10px;
}

html[dir='rtl'] .ec-app-topbar .user-img {
  padding-right: 0;
  padding-left: 16px;
}

html[dir='rtl'] .ec-app-topbar .down-arrow {
  right: auto;
  left: 0;
}

html[dir='rtl'] .ec-app-topbar .user-dropdown {
  right: auto;
  left: -30px;
}

/* -------------------------------------------------------------------------- */
/* OPD page layout                                                            */
/* -------------------------------------------------------------------------- */

html[dir='rtl'] .page-wrapper {
  direction: rtl;
}

html[dir='rtl'] .page-wrapper .left-aside {
  border-right: none;
  border-left: 1px solid var(--ec-platform-line);
}

html[dir='rtl'] .page-wrapper .department-select,
html[dir='rtl'] .page-wrapper .department-dropdown {
  margin-right: 0;
  margin-left: 20px;
}

html[dir='rtl'] .page-wrapper button.show-share {
  margin-right: 0;
  margin-left: 20px;
}

html[dir='rtl'] .page-wrapper .add-patient svg,
html[dir='rtl'] .page-wrapper .add-patient img {
  margin-left: 0;
  margin-right: 8px;
}

html[dir='rtl'] .page-wrapper .three-dot-btn {
  margin-left: 0;
  margin-right: 8px;
}

html[dir='rtl'] .page-wrapper .walkin-section h4 {
  padding-left: 0;
  padding-right: 16px;
}

@media (max-width: 991px) {
  html[dir='rtl'] .page-wrapper .left-aside {
    border-left: none;
  }
}

/* -------------------------------------------------------------------------- */
/* OPD panels (walk-in, tokens, date picker)                                  */
/* -------------------------------------------------------------------------- */

html[dir='rtl'] .walk-in-items-list li > span {
  left: auto;
  right: 7px;
}

html[dir='rtl'] .walk-in-items-list .panel-heading {
  margin-left: 0;
  margin-right: 20px;
}

html[dir='rtl'] .walk-in-items-list .drag-btn {
  right: auto;
  left: 33px;
}

html[dir='rtl'] .walk-in-items-list .appt-btn {
  right: auto;
  left: 15px;
}

/* -------------------------------------------------------------------------- */
/* Modals & forms                                                             */
/* -------------------------------------------------------------------------- */

html[dir='rtl'] .close-reschedule-modal-btn,
html[dir='rtl'] .bulk-close,
html[dir='rtl'] .close-leave-btn,
html[dir='rtl'] .closeicon,
html[dir='rtl'] .closeicon-slot,
html[dir='rtl'] .close-btn {
  right: auto;
  left: 12px;
}

html[dir='rtl'] .closeicon-slot {
  left: -5px;
}

html[dir='rtl'] .appointment-modal .procedure-parent label,
html[dir='rtl'] .appointment-modal .vital-field label {
  text-align: right;
}

html[dir='rtl'] .appointment-modal .accordion.accordion-appt {
  text-align: right;
}

html[dir='rtl'] .leave-modal-wrapper .heading {
  padding-right: 0;
  padding-left: 24px;
}

html[dir='rtl'] .modal input[type='text'],
html[dir='rtl'] .modal input[type='number'],
html[dir='rtl'] .modal input[type='date'],
html[dir='rtl'] .modal input[type='time'],
html[dir='rtl'] .modal select,
html[dir='rtl'] .modal textarea {
  text-align: right;
}

html[dir='rtl'] .modal input[type='number'] {
  direction: ltr;
  text-align: end;
}

/* -------------------------------------------------------------------------- */
/* Dropdowns & alerts                                                         */
/* -------------------------------------------------------------------------- */

html[dir='rtl'] .dot-dropdown-menu {
  right: auto;
  left: 0;
}

html[dir='rtl'] .dot-dropdown-menu li button,
html[dir='rtl'] .dot-dropdown-menu li a {
  text-align: right;
}

html[dir='rtl'] .updated-alert {
  right: auto;
  left: 20px;
}

/* -------------------------------------------------------------------------- */
/* Calendar                                                                   */
/* -------------------------------------------------------------------------- */

html[dir='rtl'] .full-calendar-wrapper {
  direction: rtl;
}

html[dir='rtl'] .full-calendar-wrapper .opd-event-status-menu__dropdown {
  right: auto;
  left: 0;
}

html[dir='rtl'] .full-calendar-wrapper .opd-event-status-menu__option {
  text-align: right;
}

html[dir='rtl'] .full-calendar-wrapper .fc-v-event.CheckedIn,
html[dir='rtl'] .full-calendar-wrapper .fc-h-event.CheckedIn,
html[dir='rtl'] .full-calendar-wrapper .fc-daygrid-event.CheckedIn,
html[dir='rtl'] .full-calendar-wrapper .fc-timeline-event.CheckedIn {
  border-left: none !important;
  border-right: 4px solid #2c7a46 !important;
}

html[dir='rtl'] .full-calendar-wrapper .fc-v-event.NoShow,
html[dir='rtl'] .full-calendar-wrapper .fc-h-event.NoShow,
html[dir='rtl'] .full-calendar-wrapper .fc-daygrid-event.NoShow,
html[dir='rtl'] .full-calendar-wrapper .fc-timeline-event.NoShow {
  border-left: none !important;
  border-right: 4px solid #803e48 !important;
}

html[dir='rtl'] .full-calendar-wrapper .fc-v-event.CheckedOut,
html[dir='rtl'] .full-calendar-wrapper .fc-v-event.Engaged,
html[dir='rtl'] .full-calendar-wrapper .fc-h-event.CheckedOut,
html[dir='rtl'] .full-calendar-wrapper .fc-h-event.Engaged,
html[dir='rtl'] .full-calendar-wrapper .fc-daygrid-event.CheckedOut,
html[dir='rtl'] .full-calendar-wrapper .fc-daygrid-event.Engaged,
html[dir='rtl'] .full-calendar-wrapper .fc-timeline-event.CheckedOut,
html[dir='rtl'] .full-calendar-wrapper .fc-timeline-event.Engaged {
  border-left: none !important;
  border-right: 4px solid var(--ec-platform-navy) !important;
}

html[dir='rtl'] .full-calendar-wrapper .fc-v-event.Schedule,
html[dir='rtl'] .full-calendar-wrapper .fc-v-event.Confirmed,
html[dir='rtl'] .full-calendar-wrapper .fc-h-event.Schedule,
html[dir='rtl'] .full-calendar-wrapper .fc-h-event.Confirmed,
html[dir='rtl'] .full-calendar-wrapper .fc-daygrid-event.Schedule,
html[dir='rtl'] .full-calendar-wrapper .fc-daygrid-event.Confirmed,
html[dir='rtl'] .full-calendar-wrapper .fc-timeline-event.Schedule,
html[dir='rtl'] .full-calendar-wrapper .fc-timeline-event.Confirmed {
  border-left: none !important;
  border-right: 4px solid var(--ec-opd-primary) !important;
}

html[dir='rtl'] .general-doctor-col-header__share-panel ul {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

html[dir='rtl'] .token-date-nav button svg {
  transform: scaleX(-1);
}

/* -------------------------------------------------------------------------- */
/* Token / consultation features                                              */
/* -------------------------------------------------------------------------- */

html[dir='rtl'] .token-slot.CheckedIn {
  border-left: none;
  border-right: 4px solid #2c7a46;
}

html[dir='rtl'] .token-slot.NoShow {
  border-left: none;
  border-right: 4px solid #803e48;
}

html[dir='rtl'] .token-slot.CheckedOut,
html[dir='rtl'] .token-slot.Engaged {
  border-left: none;
  border-right: 4px solid var(--ec-platform-navy);
}

html[dir='rtl'] .token-slot.Schedule,
html[dir='rtl'] .token-slot.Confirmed {
  border-left: none;
  border-right: 4px solid var(--ec-platform-blue);
}

html[dir='rtl'] .queue-modal-wrapper,
html[dir='rtl'] .queue-display-list {
  direction: rtl;
  text-align: right;
}

html[dir='rtl'] .patient-search-results {
  direction: rtl;
}

html[dir='rtl'] .patient-search-results li button {
  text-align: right;
}

/* -------------------------------------------------------------------------- */
/* Utility: embedded LTR islands (phone numbers, codes, times)                */
/* -------------------------------------------------------------------------- */

html[dir='rtl'] .dir-ltr,
html[dir='rtl'] [dir='ltr'] {
  direction: ltr;
  text-align: left;
}

/* Final Platform theme force — wins over leftover legacy rules */

body.ec-admin-theme-platform,
body.ec-b2b-theme {
  background: var(--ec-platform-mist) !important;
  color: var(--ec-platform-ink);
  font-family: var(--ec-font);
}

body.ec-admin-theme-platform button,
body.ec-admin-theme-platform .btn,
body.ec-admin-theme-platform input,
body.ec-admin-theme-platform select,
body.ec-admin-theme-platform textarea,
body.ec-admin-theme-platform .ec-searchable-select__control,
body.ec-b2b-theme button,
body.ec-b2b-theme .btn,
body.ec-b2b-theme input,
body.ec-b2b-theme select,
body.ec-b2b-theme textarea,
body.ec-b2b-theme .ec-searchable-select__control {
  border-radius: var(--ec-platform-btn-radius, 10px);
}

body.ec-admin-theme-platform .add-patient,
body.ec-admin-theme-platform .create-list-btn > li,
body.ec-admin-theme-platform .ec-btn--primary,
body.ec-admin-theme-platform .ui-btn--primary,
body.ec-admin-theme-platform button.primary,
body.ec-admin-theme-platform .btn-primary,
body.ec-b2b-theme .add-patient,
body.ec-b2b-theme .create-list-btn > li,
body.ec-b2b-theme .ec-btn--primary,
body.ec-b2b-theme .ui-btn--primary,
body.ec-b2b-theme button.primary,
body.ec-b2b-theme .btn-primary,
/* Module primary CTAs — always CareOS blue + white text (never white-on-white) */
body.ec-admin-theme-platform .hr-btn--primary,
body.ec-admin-theme-platform .pref-btn--primary,
body.ec-admin-theme-platform .ot-btn--primary,
body.ec-admin-theme-platform .er-btn--primary,
body.ec-admin-theme-platform .amb-btn--primary,
body.ec-admin-theme-platform .opd-btn--primary,
body.ec-admin-theme-platform .ehr-shot-btn--primary,
body.ec-admin-theme-platform .lab-shot-btn--primary,
body.ec-admin-theme-platform .rad-shot-btn--primary,
body.ec-admin-theme-platform .ipd-shot-btn--primary,
body.ec-admin-theme-platform .pat-shot-btn--primary,
body.ec-admin-theme-platform .users-shot-btn--primary,
body.ec-admin-theme-platform .pharm-shot-btn--primary,
body.ec-admin-theme-platform .pharm-btn--primary,
body.ec-admin-theme-platform .ums__btn--primary,
body.ec-b2b-theme .hr-btn--primary,
body.ec-b2b-theme .pref-btn--primary,
body.ec-b2b-theme .ot-btn--primary,
body.ec-b2b-theme .er-btn--primary,
body.ec-b2b-theme .amb-btn--primary,
body.ec-b2b-theme .opd-btn--primary,
body.ec-b2b-theme .ehr-shot-btn--primary,
body.ec-b2b-theme .lab-shot-btn--primary,
body.ec-b2b-theme .rad-shot-btn--primary,
body.ec-b2b-theme .ipd-shot-btn--primary,
body.ec-b2b-theme .pat-shot-btn--primary,
body.ec-b2b-theme .users-shot-btn--primary,
body.ec-b2b-theme .pharm-shot-btn--primary,
body.ec-b2b-theme .pharm-btn--primary,
body.ec-b2b-theme .ums__btn--primary,
body.ec-admin-theme-platform a.hr-btn--primary,
body.ec-admin-theme-platform a.pref-btn--primary,
body.ec-admin-theme-platform a.ot-btn--primary,
body.ec-admin-theme-platform a.ehr-shot-btn--primary,
body.ec-admin-theme-platform a.lab-shot-btn--primary,
body.ec-admin-theme-platform a.rad-shot-btn--primary,
body.ec-b2b-theme a.hr-btn--primary,
body.ec-b2b-theme a.pref-btn--primary,
body.ec-b2b-theme a.ot-btn--primary,
body.ec-b2b-theme a.ehr-shot-btn--primary,
body.ec-b2b-theme a.lab-shot-btn--primary,
body.ec-b2b-theme a.rad-shot-btn--primary {
  background: var(--ec-platform-blue, #0360f1) !important;
  background-color: var(--ec-platform-blue, #0360f1) !important;
  border-color: var(--ec-platform-blue, #0360f1) !important;
  color: #fff !important;
  border-radius: var(--ec-platform-btn-radius, 10px) !important;
  box-shadow: var(--ec-platform-btn-shadow, 0 4px 12px rgba(3, 96, 241, 0.22));
}

body.ec-admin-theme-platform .hr-btn--primary:hover,
body.ec-admin-theme-platform .pref-btn--primary:hover,
body.ec-admin-theme-platform .ot-btn--primary:hover,
body.ec-admin-theme-platform .er-btn--primary:hover,
body.ec-admin-theme-platform .amb-btn--primary:hover,
body.ec-admin-theme-platform .ehr-shot-btn--primary:hover,
body.ec-admin-theme-platform .lab-shot-btn--primary:hover,
body.ec-admin-theme-platform .rad-shot-btn--primary:hover,
body.ec-b2b-theme .hr-btn--primary:hover,
body.ec-b2b-theme .pref-btn--primary:hover,
body.ec-b2b-theme .ot-btn--primary:hover,
body.ec-b2b-theme .er-btn--primary:hover,
body.ec-b2b-theme .amb-btn--primary:hover,
body.ec-b2b-theme .ehr-shot-btn--primary:hover,
body.ec-b2b-theme .lab-shot-btn--primary:hover,
body.ec-b2b-theme .rad-shot-btn--primary:hover {
  background: var(--ec-platform-blue-hover, #0250d4) !important;
  background-color: var(--ec-platform-blue-hover, #0250d4) !important;
  border-color: var(--ec-platform-blue-hover, #0250d4) !important;
  color: #fff !important;
}

/* Departments hero sits on blue — keep inverted white primary there */
body.ec-admin-theme-platform .pref-dept__hero-actions .pref-btn--primary,
body.ec-b2b-theme .pref-dept__hero-actions .pref-btn--primary {
  background: #fff !important;
  background-color: #fff !important;
  border-color: #fff !important;
  color: var(--ec-platform-navy, #072854) !important;
  box-shadow: none !important;
}

body.ec-admin-theme-platform .pref-dept__hero-actions .pref-btn:not(.pref-btn--primary),
body.ec-b2b-theme .pref-dept__hero-actions .pref-btn:not(.pref-btn--primary) {
  background: rgba(255, 255, 255, 0.12) !important;
  background-color: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  color: #fff !important;
}

/* Secondary / default module buttons: never white text on white fill */
body.ec-admin-theme-platform .hr-btn:not(.hr-btn--primary):not(.hr-btn--danger),
body.ec-admin-theme-platform .pref-btn:not(.pref-btn--primary):not(.pref-btn--danger),
body.ec-admin-theme-platform .ot-btn:not(.ot-btn--primary),
body.ec-admin-theme-platform .er-btn:not(.er-btn--primary),
body.ec-admin-theme-platform .amb-btn:not(.amb-btn--primary):not(.amb-btn--danger),
body.ec-admin-theme-platform .rad-shot-btn--ghost,
body.ec-admin-theme-platform .ehr-shot-btn--ghost,
body.ec-admin-theme-platform .lab-shot-btn--ghost,
body.ec-b2b-theme .hr-btn:not(.hr-btn--primary):not(.hr-btn--danger),
body.ec-b2b-theme .pref-btn:not(.pref-btn--primary):not(.pref-btn--danger),
body.ec-b2b-theme .ot-btn:not(.ot-btn--primary),
body.ec-b2b-theme .er-btn:not(.er-btn--primary),
body.ec-b2b-theme .amb-btn:not(.amb-btn--primary):not(.amb-btn--danger),
body.ec-b2b-theme .rad-shot-btn--ghost,
body.ec-b2b-theme .ehr-shot-btn--ghost,
body.ec-b2b-theme .lab-shot-btn--ghost,
body.ec-admin-theme-platform a.hr-btn:not(.hr-btn--primary):not(.hr-btn--danger),
body.ec-b2b-theme a.hr-btn:not(.hr-btn--primary):not(.hr-btn--danger) {
  background: #f1f5f9 !important;
  background-color: #f1f5f9 !important;
  border-color: rgba(7, 40, 84, 0.22) !important;
  color: var(--ec-platform-navy, #072854) !important;
  box-shadow: none !important;
}

body.ec-admin-theme-platform .modal-content,
body.ec-admin-theme-platform .dot-dropdown-menu,
body.ec-admin-theme-platform .user-dropdown {
  border-radius: 12px !important;
  border: 1px solid var(--ec-platform-line) !important;
  box-shadow: var(--ec-platform-card-shadow) !important;
}

body.ec-admin-theme-platform .fc .fc-button-primary {
  background: #fff !important;
  border: 1px solid var(--ec-platform-line) !important;
  border-radius: 10px !important;
  color: var(--ec-platform-navy, #072854) !important;
  box-shadow: none !important;
}

body.ec-admin-theme-platform .fc .fc-button-primary .fc-icon {
  color: inherit !important;
}

body.ec-admin-theme-platform .fc .fc-today-button {
  background: var(--ec-platform-blue) !important;
  border-color: var(--ec-platform-blue) !important;
  color: #fff !important;
}

body.ec-admin-theme-platform .fc .fc-today-button .fc-icon {
  color: #fff !important;
}

body.ec-admin-theme-platform .fc .fc-prev-button,
body.ec-admin-theme-platform .fc .fc-next-button {
  color: var(--ec-platform-blue) !important;
}

body.ec-admin-theme-platform .fc .fc-prev-button .fc-icon,
body.ec-admin-theme-platform .fc .fc-next-button .fc-icon {
  color: var(--ec-platform-blue) !important;
}

body.ec-admin-theme-platform .fc .fc-button-primary:not(:disabled).fc-button-active,
body.ec-admin-theme-platform .fc .fc-button-primary:not(:disabled):active {
  background: var(--ec-platform-blue) !important;
  border-color: var(--ec-platform-blue) !important;
  color: #fff !important;
}

body.ec-admin-theme-platform .fc .fc-button-primary:not(:disabled).fc-button-active .fc-icon,
body.ec-admin-theme-platform .fc .fc-button-primary:not(:disabled):active .fc-icon {
  color: #fff !important;
}

body.ec-admin-theme-platform .fc-theme-standard td,
body.ec-admin-theme-platform .fc-theme-standard th,
body.ec-admin-theme-platform .fc-theme-standard .fc-scrollgrid {
  border-color: var(--ec-platform-line) !important;
}

body.ec-admin-theme-platform .fc .fc-col-header-cell-cushion,
body.ec-admin-theme-platform .fc .fc-timegrid-slot-label-cushion {
  color: var(--ec-platform-ink) !important;
}

/* Kill leftover sharp corners on OPD chrome */
body.ec-admin-theme-platform .page-wrapper .left-aside,
body.ec-admin-theme-platform .page-wrapper .right-aside {
  border-radius: var(--ec-platform-card-radius) !important;
  border: 1px solid var(--ec-platform-line) !important;
  box-shadow: var(--ec-platform-card-shadow) !important;
  background: var(--ec-platform-paper) !important;
}

body.ec-admin-theme-platform .opd-inline-date-wrap {
  padding: 0 0 8px !important;
}

body.ec-admin-theme-platform .opd-inline-date-input {
  border: 1px solid var(--ec-platform-line) !important;
  border-radius: 10px !important;
  color: var(--ec-platform-ink) !important;
}

body.ec-admin-theme-platform .current-token-section .heading-area .heading,
body.ec-admin-theme-platform .walkin-section h4 {
  color: var(--ec-platform-ink) !important;
  font-weight: 600 !important;
}

/* Radiology filter / section pills — active = primary blue */
body.ec-admin-theme-platform .rad-shot-pill.is-all.is-active,
body.ec-b2b-theme .rad-shot-pill.is-all.is-active {
  background: var(--ec-platform-blue, #0360f1) !important;
  border-color: var(--ec-platform-blue, #0360f1) !important;
  color: #fff !important;
}

/* Pagination active page */
body.ec-admin-theme-platform .rad-shot-page.is-active,
body.ec-b2b-theme .rad-shot-page.is-active {
  background: var(--ec-platform-blue, #0360f1) !important;
  border-color: var(--ec-platform-blue, #0360f1) !important;
  color: #fff !important;
}

/**
 * Nested overlay stacking:
 * - Page sticky bars hide while any overlay is open
 * - Buried overlays hide their sticky footers so only the top sheet’s actions show
 */

/* Portaled page footers (StickyBottomActions → body) must not cover modals */
body.ch-overlay-open > .ch-bottom-actions,
body.ch-overlay-open > .ec-platform-page__actions,
body.careos-portal-modal-open > .ch-bottom-actions,
body.careos-portal-modal-open > .ec-platform-page__actions,
body.careos-modal-open > .ch-bottom-actions,
body.careos-modal-open > .ec-platform-page__actions,
body.inv-modal-open > .ch-bottom-actions,
body.inv-modal-open > .ec-platform-page__actions,
body:has(.ec-patient-modal) > .ch-bottom-actions,
body:has(.ec-patient-modal) > .ec-platform-page__actions,
body:has(.hr-modal-backdrop) > .ch-bottom-actions,
body:has(.hr-modal-backdrop) > .ec-platform-page__actions {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Module bottom nav stays under overlays (already z-index 1180); hide while overlay open */
body.ch-overlay-open .module-bottom-nav,
body.careos-portal-modal-open .module-bottom-nav,
body.careos-modal-open .module-bottom-nav,
body.inv-modal-open .module-bottom-nav,
body:has(.ec-patient-modal) .module-bottom-nav {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Previous modal sticky action rows — replaced by the top sheet */
[data-ch-overlay-buried] .ehr-modal__footer,
[data-ch-overlay-buried] .ehr-modal__actions,
[data-ch-overlay-buried] .lab-shot-modal__footer,
[data-ch-overlay-buried] .lab-shot-modal__actions,
[data-ch-overlay-buried] .rad-shot-modal__footer,
[data-ch-overlay-buried] .rad-shot-modal__actions,
[data-ch-overlay-buried] .ipd-shot-modal__footer,
[data-ch-overlay-buried] .ipd-shot-modal__actions,
[data-ch-overlay-buried] .inv-modal__actions,
[data-ch-overlay-buried] .inv-modal__footer,
[data-ch-overlay-buried] .hr-modal__actions,
[data-ch-overlay-buried] .ec-patient-modal__actions,
[data-ch-overlay-buried] .amb-modal__actions,
[data-ch-overlay-buried] .er-modal__actions,
[data-ch-overlay-buried] .bb-modal__actions,
[data-ch-overlay-buried] .ot-modal__actions,
[data-ch-overlay-buried] .opd-create-form__footer,
[data-ch-overlay-buried] .footer-area,
[data-ch-overlay-buried] .sticky-btn-group,
[data-ch-overlay-buried] .save-and-print,
[data-ch-overlay-buried] .opd-attach__footer,
[data-ch-overlay-buried] .opd-sms__footer,
[data-ch-overlay-buried] .opd-bulk-footer,
[data-ch-overlay-buried] .opd-care-transition__actions,
[data-ch-overlay-buried] .opd-care-transition__confirm-actions,
[data-ch-overlay-buried] .ch-bottom-actions,
[data-ch-overlay-buried] .pharm-shot-modal__actions,
[data-ch-overlay-buried] .pharm-shot-sheet__actions,
[data-ch-overlay-buried] .lab-shot-print-modal__actions,
[data-ch-overlay-buried] .ehr-pack-builder-modal__foot,
[data-ch-overlay-buried] .ehr-tpl-composer__footer,
[data-ch-overlay-buried] .ehr-tpl-snippet-modal__footer {
  visibility: hidden !important;
  pointer-events: none !important;
}

/**
 * Care + Patient chrome — square full-bleed bars.
 * Must load last.
 */
@media (max-width: 991px) {
  body .care-top,
  body .care-top__inner,
  body .care-top__row,
  body .care-top__row--brand,
  body .care-top__lead,
  body .care-top__tools,
  body .care-top__back,
  body .care-top__search-btn,
  body .care-top__more,
  body .care-top__logo,
  body .care-top__logo-link,
  body .care-top__title,
  body .care-top .ch-theme-toggle,
  body .pp-top,
  body .pp-top__actions,
  body .pp-top .ch-theme-toggle,
  html.ch-native-app .care-top,
  html.ch-native-app .care-top *,
  html.ch-native-app .pp-top {
    border-radius: 0 !important;
  }

  body nav.care-tabs,
  body .care-tabs,
  body .care-tabs .care-tabs__btn,
  body .care-tabs button,
  body .care-tabs button.is-active,
  body .care-tabs *,
  body .pp-tabs,
  body .pp-tabs a,
  body .pp-tabs a.is-active,
  html.ch-native-app nav.care-tabs,
  html.ch-native-app .care-tabs,
  html.ch-native-app .care-tabs .care-tabs__btn,
  html.ch-native-app .care-tabs button,
  html.ch-native-app .care-tabs *,
  html.ch-native-app .pp-tabs,
  html.ch-native-app .pp-tabs a,
  html.ch-native-app body nav.care-tabs,
  html.ch-native-app body .care-tabs .care-tabs__btn {
    border-radius: 0 !important;
  }

  body nav.care-tabs,
  body .care-tabs,
  body .care-top,
  body .pp-top,
  body .pp-tabs,
  html.ch-native-app nav.care-tabs,
  html.ch-native-app .care-tabs,
  html.ch-native-app .care-top,
  html.ch-native-app .pp-top,
  html.ch-native-app .pp-tabs {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    inset-inline: 0 !important;
  }
}

html.ch-native-app .care-top,
html.ch-native-app nav.care-tabs,
html.ch-native-app .care-tabs,
html.ch-native-app .care-tabs .care-tabs__btn,
html.ch-native-app .care-tabs button,
html.ch-native-app .pp-top,
html.ch-native-app .pp-tabs,
html.ch-native-app .pp-tabs a {
  border-radius: 0 !important;
}

/* Care + Patient marketplace: square tiles, photos, and invented icons.
   Beats the global phone rule that circles every avatar / classless img. */
@media (max-width: 991px) {
  body .care img,
  body .pp img,
  body .care [class*='avatar'],
  body .care [class*='Avatar'],
  body .pp [class*='avatar'],
  body .pp [class*='Avatar'],
  body .care-mico,
  body .care-mico-art,
  body .care-dept,
  body .care-dept__media,
  body .care-catalog-thumb,
  body .care-promo,
  body .care-market-hero,
  body .care-market-page-hero,
  body .pp-market-hero,
  body .pp-dash__stat,
  body .pp-dash__stat-media,
  body .pp-row__thumb,
  body .pp-pharmacy-card__thumb,
  body .care-scan-card,
  body .care-service-tile,
  body .care-service-tile__media,
  body .care-door,
  body .care-door__thumb,
  body .care-center,
  body .care-center__logo,
  body .care-doc,
  body .care-avatar,
  body .care-spec-chip,
  body .care-shelf-card,
  body .pp-doctor-avatar,
  html.ch-native-app .care img,
  html.ch-native-app .pp img,
  html.ch-native-app .care [class*='avatar'],
  html.ch-native-app .pp [class*='avatar'] {
    border-radius: 0 !important;
  }
}

