/* ═══════════════════════════════════════════════════════════════
   HMS DESIGN SYSTEM v11 — EXECUTIVE CHAMPAGNE
   Application-wide white presentation layer loaded by shell.php.
   Scope: CSS only. No business logic, DOM ownership, forms or events.
   Palette: pearl white + ivory + deep navy + restrained champagne.
   ═══════════════════════════════════════════════════════════════ */

body.hms-executive-ui {
  color-scheme: light;

  /* Core surfaces */
  --hms-canvas: #f6f3ed;
  --hms-canvas-soft: #faf8f4;
  --hms-surface: #ffffff;
  --hms-surface-soft: #fbfaf7;
  --hms-surface-warm: #fffaf0;
  --hms-border: #e8e1d6;
  --hms-border-strong: #d9cdbb;

  /* Text */
  --hms-ink: #172033;
  --hms-ink-soft: #344054;
  --hms-muted: #6f6a63;
  --hms-faint: #9a948b;

  /* Brand and semantic */
  --hms-primary: #c08a32;
  --hms-primary-strong: #b77f2a;
  --hms-primary-dark: #815016;
  --hms-primary-soft: #fff8e8;
  --hms-primary-hover: #fff1d3;
  --hms-primary-border: #ead3a3;
  --hms-info: #2563eb;
  --hms-info-soft: #eff6ff;
  --hms-info-border: #bfdbfe;
  --hms-teal: #0f766e;
  --hms-teal-soft: #ecfdf5;
  --hms-success: #15803d;
  --hms-warning: #d97706;
  --hms-danger: #dc2626;

  /* Shadows and motion */
  --hms-shadow-xs: 0 1px 2px rgba(61, 48, 30, .045);
  --hms-shadow-sm: 0 5px 16px rgba(61, 48, 30, .065);
  --hms-shadow-md: 0 14px 34px rgba(61, 48, 30, .09);
  --hms-shadow-lg: 0 28px 72px rgba(45, 35, 22, .16);
  --hms-focus: 0 0 0 3px rgba(192, 138, 50, .18);

  /* Remap legacy tokens so old module CSS inherits this system. */
  --bg-a: var(--hms-canvas);
  --bg-b: var(--hms-canvas-soft);
  --bg-c: #ffffff;
  --g0: rgba(255,255,255,.72);
  --g1: rgba(255,255,255,.86);
  --g2: rgba(255,255,255,.96);
  --g3: #ffffff;
  --g4: #ffffff;
  --bl: rgba(217,205,187,.82);
  --bm: rgba(217,205,187,.92);
  --bs: rgba(217,205,187,.78);
  --bd: rgba(183,164,136,.72);
  --t1: var(--hms-ink);
  --t2: var(--hms-ink-soft);
  --t3: var(--hms-muted);
  --ti: var(--hms-ink);
  --ti2: var(--hms-muted);
  --blue: var(--hms-info);
  --green: var(--hms-success);
  --amber: var(--hms-warning);
  --red: var(--hms-danger);
  --teal: var(--hms-teal);
  --br1: #ead5a7;
  --br2: var(--hms-primary);
  --br3: var(--hms-primary-dark);
  --brg: rgba(192,138,50,.22);
  --sh1: var(--hms-shadow-sm);
  --sh2: var(--hms-shadow-md);
  --sh3: var(--hms-shadow-lg);
  --panel: var(--hms-surface);
  --panel2: var(--hms-surface-soft);
  --glass: var(--hms-surface);
  --glass2: var(--hms-surface-soft);
  --border: var(--hms-border);
  --border2: var(--hms-border-strong);
  --shadow: var(--hms-shadow-md);
  --shadow2: var(--hms-shadow-lg);
  --text: var(--hms-ink);
  --muted: var(--hms-muted);
  --bronze1: #ead5a7;
  --bronze2: var(--hms-primary);
  --bronze3: var(--hms-primary-dark);
  --accent: var(--hms-primary);

  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(192,138,50,.065), transparent 29%),
    radial-gradient(circle at 94% 16%, rgba(129,80,22,.035), transparent 27%),
    linear-gradient(180deg, #fffdf9 0%, var(--hms-canvas) 64%, #f9f7f2 100%) !important;
  color: var(--hms-ink) !important;
  font-family: "DM Sans", "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  letter-spacing: -.004em;
}

body.hms-executive-ui ::selection {
  background: rgba(192,138,50,.22);
  color: var(--hms-ink);
}

body.hms-executive-ui,
body.hms-executive-ui * {
  scrollbar-color: #d4c9b8 transparent;
  scrollbar-width: thin;
}
body.hms-executive-ui *::-webkit-scrollbar { width: 10px; height: 10px; }
body.hms-executive-ui *::-webkit-scrollbar-track { background: transparent; }
body.hms-executive-ui *::-webkit-scrollbar-thumb {
  background: #d4c9b8;
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
body.hms-executive-ui *::-webkit-scrollbar-thumb:hover { background-color: #b7a990; }

/* ── Global patient search ───────────────────────────────────── */
body.hms-executive-ui .global-shell-bar {
  position: sticky !important;
  top: 0 !important;
  z-index: 12000 !important;
  margin: 0 0 12px !important;
  padding: 8px 14px !important;
  background: rgba(255,255,255,.985) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--hms-border) !important;
  box-shadow: 0 5px 18px rgba(61,48,30,.055) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.hms-executive-ui .global-shell-search { gap: 16px !important; }
body.hms-executive-ui .global-shell-search .meta { position: relative; padding-left: 30px; }
body.hms-executive-ui .global-shell-search .meta::before {
  content: '+';
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hms-primary-border);
  border-radius: 8px;
  background: var(--hms-primary-soft);
  color: var(--hms-primary-dark);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}
body.hms-executive-ui .global-shell-search .label {
  color: var(--hms-primary-dark) !important;
  font-size: 10.5px !important;
  letter-spacing: .12em !important;
}
body.hms-executive-ui .global-shell-search .hint { color: var(--hms-muted) !important; }
body.hms-executive-ui .global-shell-search .search-wrap { max-width: 560px !important; }
body.hms-executive-ui .global-shell-results {
  top: 44px !important;
  background: var(--hms-surface) !important;
  border-color: var(--hms-border) !important;
  border-radius: 14px !important;
  box-shadow: var(--hms-shadow-lg) !important;
}
body.hms-executive-ui .global-shell-option {
  color: var(--hms-ink) !important;
  border-color: #f1ece4 !important;
  transition: background-color .14s ease, color .14s ease !important;
}
body.hms-executive-ui .global-shell-option:hover,
body.hms-executive-ui .global-shell-option.active {
  background: var(--hms-primary-soft) !important;
  color: var(--hms-primary-dark) !important;
}

/* ── Application workspace ───────────────────────────────────── */
body.hms-executive-ui .shell {
  width: calc(100% - var(--hms-workspace-gutter,16px) - var(--hms-workspace-gutter,16px)) !important;
  max-width: var(--hms-workspace-max,1200px) !important;
  margin: 14px auto 34px !important;
  padding: 16px 18px 22px !important;
  border: 1px solid rgba(217,205,187,.92) !important;
  border-radius: 24px !important;
  background: rgba(255,255,255,.97) !important;
  box-shadow: 0 18px 50px rgba(61,48,30,.09) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible !important;
}
body.hms-executive-ui .shell::before {
  display: block !important;
  inset: 0 !important;
  border-radius: inherit !important;
  background: linear-gradient(180deg, rgba(255,248,232,.72), rgba(255,255,255,0) 128px) !important;
  opacity: 1 !important;
  pointer-events: none !important;
}
body.hms-executive-ui .shell::after { display: none !important; }
body.hms-executive-ui .shell > .phx-wrap,
body.hms-executive-ui .shell .phx-wrap {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.hms-executive-ui .shell > .phx-wrap { padding: 0 !important; }
body.hms-executive-ui .page,
body.hms-executive-ui .admin-wrap,
body.hms-executive-ui .wrap,
body.hms-executive-ui .lifecycle-page,
body.hms-executive-ui .audit-wrap {
  background: transparent !important;
  color: var(--hms-ink) !important;
}

/* ── Typography and links ────────────────────────────────────── */
body.hms-executive-ui h1,
body.hms-executive-ui h2,
body.hms-executive-ui h3,
body.hms-executive-ui h4,
body.hms-executive-ui h5,
body.hms-executive-ui h6 {
  color: var(--hms-ink) !important;
  letter-spacing: -.025em;
}
body.hms-executive-ui h1 { font-weight: 850; }
body.hms-executive-ui h2 { font-weight: 820; }
body.hms-executive-ui h3,
body.hms-executive-ui h4 { font-weight: 780; }
body.hms-executive-ui a:not(.btn):not(.tab):not(.rx-tab):not(.phx-tab):not(.rx-btn):not(.phx-btn) {
  color: var(--hms-primary-dark);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
body.hms-executive-ui .small,
body.hms-executive-ui .muted,
body.hms-executive-ui .phx-note,
body.hms-executive-ui .rx-muted,
body.hms-executive-ui .kpiSub,
body.hms-executive-ui .meta-line {
  color: var(--hms-muted) !important;
}
body.hms-executive-ui .mono,
body.hms-executive-ui td,
body.hms-executive-ui .kpiValue,
body.hms-executive-ui .metric-value,
body.hms-executive-ui .phx-v {
  font-variant-numeric: tabular-nums;
}

/* ── Navigation and top bars ─────────────────────────────────── */
body.hms-executive-ui .topbar,
body.hms-executive-ui .rx-topbar {
  top: 64px !important;
  z-index: 60 !important;
  gap: 10px !important;
  border: 1px solid var(--hms-border) !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,.99) !important;
  box-shadow: var(--hms-shadow-sm) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.hms-executive-ui .brand,
body.hms-executive-ui .rx-brand {
  color: var(--hms-ink) !important;
  opacity: 1 !important;
  font-size: 11.5px !important;
  letter-spacing: .10em !important;
  font-weight: 850 !important;
}
body.hms-executive-ui .subbar,
body.hms-executive-ui .rx-subtabs {
  background: var(--hms-surface-soft) !important;
  border-color: var(--hms-border) !important;
}
body.hms-executive-ui .tabs,
body.hms-executive-ui .rx-tabs,
body.hms-executive-ui .phx-tabs { gap: 6px !important; }
body.hms-executive-ui .phx-tabs {
  margin: 6px 0 14px !important;
  padding: 8px !important;
  border: 1px solid var(--hms-border) !important;
  border-radius: 16px !important;
  background: var(--hms-surface) !important;
  box-shadow: var(--hms-shadow-sm) !important;
}
body.hms-executive-ui .tab,
body.hms-executive-ui .rx-tab,
body.hms-executive-ui .phx-tab {
  min-height: 36px;
  padding: 7px 12px !important;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--hms-ink-soft) !important;
  font-size: 12.5px !important;
  font-weight: 730 !important;
  transition: color .14s ease, background-color .14s ease, border-color .14s ease, box-shadow .14s ease, transform .10s ease !important;
}
body.hms-executive-ui .tab:hover,
body.hms-executive-ui .rx-tab:hover,
body.hms-executive-ui .phx-tab:hover {
  color: var(--hms-primary-dark) !important;
  background: var(--hms-primary-soft) !important;
  border-color: var(--hms-primary-border) !important;
  box-shadow: 0 5px 14px rgba(192,138,50,.10) !important;
  transform: translateY(-1px) !important;
}
body.hms-executive-ui .tab.active,
body.hms-executive-ui .rx-tab.active,
body.hms-executive-ui .phx-tab.active {
  color: var(--hms-primary-dark) !important;
  background: linear-gradient(180deg, #fffaf0, #fff1d3) !important;
  border-color: var(--hms-primary-border) !important;
  box-shadow: inset 0 -2px 0 var(--hms-primary), 0 5px 14px rgba(192,138,50,.11) !important;
  font-weight: 820 !important;
  transform: none !important;
}
body.hms-executive-ui .topbar .tabs > span[style*="width:1px"] {
  background: var(--hms-border-strong) !important;
  opacity: .75 !important;
}

/* ── Buttons ─────────────────────────────────────────────────── */
body.hms-executive-ui .btn,
body.hms-executive-ui .phx-btn,
body.hms-executive-ui .rx-btn,
body.hms-executive-ui .lx-btn,
body.hms-executive-ui .audit-btn,
body.hms-executive-ui .saveBtn,
body.hms-executive-ui .secondary,
body.hms-executive-ui .icon-btn,
body.hms-executive-ui .phx-date-trigger,
body.hms-executive-ui .phx-date-cancel,
body.hms-executive-ui .phx-date-apply,
body.hms-executive-ui .soft-approve,
body.hms-executive-ui .soft-reject,
body.hms-executive-ui .paid-toggle-btn,
body.hms-executive-ui .day-btn {
  border: 1px solid var(--hms-border-strong) !important;
  border-radius: 10px !important;
  background: var(--hms-surface) !important;
  color: var(--hms-ink-soft) !important;
  box-shadow: var(--hms-shadow-xs) !important;
  font-family: inherit !important;
  font-weight: 730 !important;
  transition: transform .10s ease, box-shadow .14s ease, border-color .14s ease, background-color .14s ease, color .14s ease !important;
}
body.hms-executive-ui .btn:hover,
body.hms-executive-ui .phx-btn:hover,
body.hms-executive-ui .rx-btn:hover,
body.hms-executive-ui .lx-btn:hover,
body.hms-executive-ui .audit-btn:hover,
body.hms-executive-ui .saveBtn:hover,
body.hms-executive-ui .secondary:hover,
body.hms-executive-ui .icon-btn:hover,
body.hms-executive-ui .phx-date-trigger:hover,
body.hms-executive-ui .phx-date-cancel:hover,
body.hms-executive-ui .phx-date-apply:hover,
body.hms-executive-ui .soft-approve:hover,
body.hms-executive-ui .soft-reject:hover,
body.hms-executive-ui .paid-toggle-btn:hover,
body.hms-executive-ui .day-btn:hover {
  border-color: #b7a990 !important;
  background: #ffffff !important;
  color: var(--hms-ink) !important;
  box-shadow: var(--hms-shadow-sm) !important;
  transform: translateY(-1px) !important;
}
body.hms-executive-ui .btn:active,
body.hms-executive-ui .phx-btn:active,
body.hms-executive-ui .rx-btn:active,
body.hms-executive-ui .lx-btn:active,
body.hms-executive-ui .audit-btn:active,
body.hms-executive-ui .saveBtn:active,
body.hms-executive-ui .secondary:active,
body.hms-executive-ui .icon-btn:active,
body.hms-executive-ui .phx-date-trigger:active,
body.hms-executive-ui .phx-date-cancel:active,
body.hms-executive-ui .phx-date-apply:active,
body.hms-executive-ui .soft-approve:active,
body.hms-executive-ui .soft-reject:active,
body.hms-executive-ui .paid-toggle-btn:active,
body.hms-executive-ui .day-btn:active {
  transform: translateY(0) scale(.985) !important;
  box-shadow: var(--hms-shadow-xs) !important;
}

/* Primary actions */
body.hms-executive-ui .btn.primary,
body.hms-executive-ui .btn-primary,
body.hms-executive-ui .btn.btnPrimary,
body.hms-executive-ui .btn.bronze,
body.hms-executive-ui .phx-btn.primary,
body.hms-executive-ui .phx-btn.phx-btn-primary,
body.hms-executive-ui .rx-btn.primary,
body.hms-executive-ui .lx-btn:not(.-ghost),
body.hms-executive-ui .audit-btn.primary,
body.hms-executive-ui .saveBtn,
body.hms-executive-ui .phx-date-apply,
body.hms-executive-ui button.primary,
body.hms-executive-ui input[type="submit"].primary {
  color: #2d1b05 !important;
  border-color: #aa7424 !important;
  background: linear-gradient(135deg, #ead5a7 0%, #d6ad62 48%, var(--hms-primary) 100%) !important;
  box-shadow: 0 8px 20px rgba(192,138,50,.23) !important;
}
body.hms-executive-ui .btn.primary:hover,
body.hms-executive-ui .btn-primary:hover,
body.hms-executive-ui .btn.btnPrimary:hover,
body.hms-executive-ui .btn.bronze:hover,
body.hms-executive-ui .phx-btn.primary:hover,
body.hms-executive-ui .phx-btn.phx-btn-primary:hover,
body.hms-executive-ui .rx-btn.primary:hover,
body.hms-executive-ui .lx-btn:not(.-ghost):hover,
body.hms-executive-ui .audit-btn.primary:hover,
body.hms-executive-ui .saveBtn:hover,
body.hms-executive-ui .phx-date-apply:hover {
  color: #241605 !important;
  border-color: #9d681d !important;
  background: linear-gradient(135deg, #e5c98e 0%, #cea252 50%, var(--hms-primary-strong) 100%) !important;
  box-shadow: 0 12px 28px rgba(192,138,50,.29) !important;
}

/* Secondary and semantic actions */
body.hms-executive-ui .lx-btn.-ghost,
body.hms-executive-ui .phx-date-cancel,
body.hms-executive-ui .secondary,
body.hms-executive-ui .btn.ghost {
  color: var(--hms-ink-soft) !important;
  background: #ffffff !important;
  border-color: var(--hms-border-strong) !important;
}
body.hms-executive-ui .btn.blue {
  color: #1d4ed8 !important;
  background: var(--hms-info-soft) !important;
  border-color: var(--hms-info-border) !important;
}
body.hms-executive-ui .btn.success,
body.hms-executive-ui .btn.good,
body.hms-executive-ui .btn-success,
body.hms-executive-ui .soft-approve,
body.hms-executive-ui .paid-toggle-btn.is-paid {
  color: #166534 !important;
  background: #f0fdf4 !important;
  border-color: #bbf7d0 !important;
}
body.hms-executive-ui .btn.danger,
body.hms-executive-ui .btn.bad,
body.hms-executive-ui .btn-danger,
body.hms-executive-ui .btn.btnDanger,
body.hms-executive-ui .phx-btn.danger,
body.hms-executive-ui .phx-btn.phx-btn-danger,
body.hms-executive-ui .soft-reject,
body.hms-executive-ui .icon-btn.danger {
  color: #b91c1c !important;
  background: #fff7f7 !important;
  border-color: #fecaca !important;
}
body.hms-executive-ui .btn.warn {
  color: #92400e !important;
  background: #fffbeb !important;
  border-color: #fde68a !important;
}
body.hms-executive-ui .phx-date-preset {
  border: 0 !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: var(--hms-ink-soft) !important;
  box-shadow: none !important;
}
body.hms-executive-ui .phx-date-preset:hover,
body.hms-executive-ui .phx-date-preset.active {
  background: var(--hms-primary-soft) !important;
  color: var(--hms-primary-dark) !important;
  box-shadow: inset 0 0 0 1px var(--hms-primary-border) !important;
}
body.hms-executive-ui .paid-toggle-btn.not-paid,
body.hms-executive-ui .day-btn,
body.hms-executive-ui .day-btn.clear {
  color: var(--hms-ink-soft) !important;
  background: var(--hms-surface-soft) !important;
  border-color: var(--hms-border) !important;
}
body.hms-executive-ui .icon-btn:hover {
  background: var(--hms-primary-soft) !important;
  color: var(--hms-primary-dark) !important;
  border-color: var(--hms-primary-border) !important;
}
body.hms-executive-ui .icon-btn.danger:hover,
body.hms-executive-ui .soft-reject:hover {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border-color: #fca5a5 !important;
}
body.hms-executive-ui .soft-approve:hover,
body.hms-executive-ui .paid-toggle-btn.is-paid:hover {
  background: #dcfce7 !important;
  color: #166534 !important;
  border-color: #86efac !important;
}
body.hms-executive-ui .btn:disabled,
body.hms-executive-ui .phx-btn:disabled,
body.hms-executive-ui .rx-btn:disabled,
body.hms-executive-ui .lx-btn:disabled,
body.hms-executive-ui button:disabled {
  opacity: .48 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* ── Forms ───────────────────────────────────────────────────── */
body.hms-executive-ui .input,
body.hms-executive-ui .phx-input,
body.hms-executive-ui .phx-in,
body.hms-executive-ui .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]),
body.hms-executive-ui .field select,
body.hms-executive-ui .field textarea,
body.hms-executive-ui .shell input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]),
body.hms-executive-ui .shell select,
body.hms-executive-ui .shell textarea {
  border: 1px solid var(--hms-border-strong) !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: var(--hms-ink) !important;
  box-shadow: inset 0 1px 0 rgba(61,48,30,.018) !important;
  font-family: inherit !important;
  font-weight: 620 !important;
  transition: border-color .14s ease, box-shadow .14s ease, background-color .14s ease !important;
}
body.hms-executive-ui .shell input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]):hover:not(:disabled),
body.hms-executive-ui .shell select:hover:not(:disabled),
body.hms-executive-ui .shell textarea:hover:not(:disabled) {
  border-color: #b7a990 !important;
}
body.hms-executive-ui .shell input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]):focus,
body.hms-executive-ui .shell select:focus,
body.hms-executive-ui .shell textarea:focus,
body.hms-executive-ui .input:focus,
body.hms-executive-ui .phx-input:focus,
body.hms-executive-ui .phx-in:focus,
body.hms-executive-ui .field input:focus,
body.hms-executive-ui .field select:focus,
body.hms-executive-ui .field textarea:focus {
  outline: none !important;
  border-color: var(--hms-primary) !important;
  box-shadow: var(--hms-focus) !important;
}
body.hms-executive-ui .shell input::placeholder,
body.hms-executive-ui .shell textarea::placeholder {
  color: var(--hms-faint) !important;
  opacity: 1 !important;
}
body.hms-executive-ui .shell input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]):disabled,
body.hms-executive-ui .shell select:disabled,
body.hms-executive-ui .shell textarea:disabled {
  background: #f3f0ea !important;
  color: var(--hms-muted) !important;
}
body.hms-executive-ui input[type=checkbox],
body.hms-executive-ui input[type=radio] { accent-color: var(--hms-primary) !important; }
body.hms-executive-ui .field label,
body.hms-executive-ui .form-label,
body.hms-executive-ui .small-label {
  color: var(--hms-muted) !important;
  font-weight: 760 !important;
}

/* ── Cards, sections and notices ─────────────────────────────── */
body.hms-executive-ui .card,
body.hms-executive-ui .phx-card,
body.hms-executive-ui .section-box,
body.hms-executive-ui .sec-panel,
body.hms-executive-ui .tablePanel,
body.hms-executive-ui .metric,
body.hms-executive-ui .kpi,
body.hms-executive-ui .kpiCard,
body.hms-executive-ui .cm-card,
body.hms-executive-ui .phx-comment-box {
  border: 1px solid var(--hms-border) !important;
  border-radius: 16px !important;
  background: var(--hms-surface) !important;
  box-shadow: var(--hms-shadow-sm) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.hms-executive-ui .card::before,
body.hms-executive-ui .card::after,
body.hms-executive-ui .phx-card::before,
body.hms-executive-ui .phx-card::after {
  background: none !important;
  pointer-events: none !important;
}
body.hms-executive-ui .card,
body.hms-executive-ui .phx-card,
body.hms-executive-ui .section-box,
body.hms-executive-ui .sec-panel,
body.hms-executive-ui .tablePanel {
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease !important;
}
body.hms-executive-ui .card:hover,
body.hms-executive-ui .phx-card:hover,
body.hms-executive-ui .section-box:hover,
body.hms-executive-ui .sec-panel:hover,
body.hms-executive-ui .tablePanel:hover,
body.hms-executive-ui .card:focus-within,
body.hms-executive-ui .phx-card:focus-within {
  border-color: var(--hms-primary-border) !important;
  box-shadow: var(--hms-shadow-md) !important;
}
body.hms-executive-ui .section,
body.hms-executive-ui hr,
body.hms-executive-ui hr.sep { border-color: var(--hms-border) !important; }
body.hms-executive-ui .section-title,
body.hms-executive-ui .card-title,
body.hms-executive-ui .sec-panel-hd h2,
body.hms-executive-ui .phx-h { color: var(--hms-ink) !important; }
body.hms-executive-ui .section-count,
body.hms-executive-ui .sec-panel-hd .cnt {
  background: var(--hms-surface-soft) !important;
  border-color: var(--hms-border) !important;
  color: var(--hms-muted) !important;
}
body.hms-executive-ui .section-box.blue-border,
body.hms-executive-ui .sec-panel,
body.hms-executive-ui .tablePanel,
body.hms-executive-ui .tpBlue { border-left-color: var(--hms-primary) !important; }
body.hms-executive-ui .section-box.green-border,
body.hms-executive-ui .tpGreen { border-left-color: var(--hms-success) !important; }
body.hms-executive-ui .section-box.orange-border,
body.hms-executive-ui .tpOrange { border-left-color: var(--hms-warning) !important; }
body.hms-executive-ui .section-box.red-border,
body.hms-executive-ui .tpRed { border-left-color: var(--hms-danger) !important; }
body.hms-executive-ui .alert,
body.hms-executive-ui .notice,
body.hms-executive-ui .flash-message {
  border: 1px solid var(--hms-border) !important;
  border-radius: 12px !important;
  background: var(--hms-surface-soft) !important;
  color: var(--hms-ink-soft) !important;
  box-shadow: none !important;
}
body.hms-executive-ui .alert-success,
body.hms-executive-ui .notice.success,
body.hms-executive-ui .flash-message.success {
  background: #f0fdf4 !important;
  border-color: #bbf7d0 !important;
  color: #166534 !important;
}
body.hms-executive-ui .alert-danger,
body.hms-executive-ui .notice.danger,
body.hms-executive-ui .flash-message.error {
  background: #fff1f2 !important;
  border-color: #fecdd3 !important;
  color: #be123c !important;
}
body.hms-executive-ui .alert-info,
body.hms-executive-ui .notice.info {
  background: var(--hms-info-soft) !important;
  border-color: var(--hms-info-border) !important;
  color: #1e40af !important;
}
body.hms-executive-ui .alert-warn,
body.hms-executive-ui .alert-warning,
body.hms-executive-ui .notice.warn {
  background: #fffbeb !important;
  border-color: #fde68a !important;
  color: #92400e !important;
}

/* ── KPI and dashboard cards ─────────────────────────────────── */
body.hms-executive-ui .kpiCard,
body.hms-executive-ui .metric,
body.hms-executive-ui .kpi,
body.hms-executive-ui .phx-kpi {
  position: relative;
  overflow: hidden;
  border-left: 1px solid var(--hms-border) !important;
  box-shadow: var(--hms-shadow-sm) !important;
  transition: transform .14s ease, box-shadow .16s ease, border-color .16s ease !important;
}
body.hms-executive-ui .kpiCard::after,
body.hms-executive-ui .metric::after,
body.hms-executive-ui .kpi::after,
body.hms-executive-ui .phx-kpi::after {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--hms-primary), #e5c98e 72%, transparent);
  pointer-events: none;
}
body.hms-executive-ui .phx-kpi::before { display: block !important; }
body.hms-executive-ui .kpiCard:hover,
body.hms-executive-ui .metric:hover,
body.hms-executive-ui .kpi:hover,
body.hms-executive-ui .phx-kpi:hover {
  transform: translateY(-2px) !important;
  border-color: var(--hms-primary-border) !important;
  box-shadow: 0 16px 34px rgba(61,48,30,.11) !important;
}
body.hms-executive-ui .kpiIcon,
body.hms-executive-ui .phx-kpi .phx-ico {
  border-color: var(--hms-primary-border) !important;
  background: var(--hms-primary-soft) !important;
  color: var(--hms-primary-dark) !important;
}
body.hms-executive-ui .kpiLabel,
body.hms-executive-ui .metric-label,
body.hms-executive-ui .kpi .k { color: var(--hms-muted) !important; }
body.hms-executive-ui .kpiValue,
body.hms-executive-ui .metric-value,
body.hms-executive-ui .kpi .v,
body.hms-executive-ui .phx-v {
  color: var(--hms-ink) !important;
  font-weight: 830 !important;
}

/* ── Tables ──────────────────────────────────────────────────── */
body.hms-executive-ui .table,
body.hms-executive-ui table.phx-table,
body.hms-executive-ui table.intel-table,
body.hms-executive-ui table.cm-table {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: 1px solid var(--hms-border) !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: var(--hms-shadow-xs) !important;
  overflow: hidden !important;
}
body.hms-executive-ui .table th,
body.hms-executive-ui table.phx-table th,
body.hms-executive-ui table.intel-table th,
body.hms-executive-ui table.cm-table th {
  padding: 9px 10px !important;
  border-bottom: 1px solid var(--hms-border) !important;
  background: var(--hms-surface-soft) !important;
  color: #756d63 !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: .055em !important;
}
body.hms-executive-ui .table td,
body.hms-executive-ui table.phx-table td,
body.hms-executive-ui table.intel-table td,
body.hms-executive-ui table.cm-table td {
  padding: 9px 10px !important;
  border-top: 0 !important;
  border-bottom: 1px solid #f0ebe4 !important;
  background: #ffffff;
  color: var(--hms-ink-soft) !important;
  font-size: 12.5px !important;
  transition: background-color .13s ease, color .13s ease, box-shadow .13s ease !important;
}
body.hms-executive-ui .table tbody tr:last-child td,
body.hms-executive-ui table.phx-table tbody tr:last-child td,
body.hms-executive-ui table.intel-table tbody tr:last-child td,
body.hms-executive-ui table.cm-table tbody tr:last-child td { border-bottom: 0 !important; }
body.hms-executive-ui .table tbody tr:hover td,
body.hms-executive-ui table.phx-table tbody tr:hover td,
body.hms-executive-ui table.intel-table tbody tr:hover td,
body.hms-executive-ui table.cm-table tbody tr:hover td,
body.hms-executive-ui .table tbody tr:focus-within td,
body.hms-executive-ui table.phx-table tbody tr:focus-within td {
  background: var(--hms-primary-soft) !important;
  color: var(--hms-ink) !important;
}
body.hms-executive-ui .table tbody tr:has(input[type="checkbox"]:checked) td,
body.hms-executive-ui table.phx-table tbody tr:has(input[type="checkbox"]:checked) td,
body.hms-executive-ui table.intel-table tbody tr:has(input[type="checkbox"]:checked) td {
  background: #fff4dc !important;
  box-shadow: inset 0 1px 0 #f2dfb7, inset 0 -1px 0 #f2dfb7;
}
body.hms-executive-ui .table tbody tr:has(input[type="checkbox"]:checked) td:first-child,
body.hms-executive-ui table.phx-table tbody tr:has(input[type="checkbox"]:checked) td:first-child,
body.hms-executive-ui table.intel-table tbody tr:has(input[type="checkbox"]:checked) td:first-child {
  box-shadow: inset 3px 0 0 var(--hms-primary), inset 0 1px 0 #f2dfb7, inset 0 -1px 0 #f2dfb7;
}
body.hms-executive-ui .table td a,
body.hms-executive-ui table.phx-table td a,
body.hms-executive-ui table.intel-table td a {
  color: var(--hms-primary-dark) !important;
  font-weight: 720 !important;
}
body.hms-executive-ui .tbl-wrap,
body.hms-executive-ui .table-wrap { border-radius: 14px !important; }

/* Due/high-risk rows retain semantic urgency. */
body.hms-executive-ui .ph-patient-due-row > td,
body.hms-executive-ui .dr-patient-due-row > td,
body.hms-executive-ui .bill-history-due-row > td { background: #fff7f7 !important; }
body.hms-executive-ui .ph-patient-due-row > td:first-child,
body.hms-executive-ui .dr-patient-due-row > td:first-child,
body.hms-executive-ui .bill-history-due-row > td:first-child {
  box-shadow: inset 3px 0 0 var(--hms-danger) !important;
}
body.hms-executive-ui .ph-patient-due-row:hover > td,
body.hms-executive-ui .dr-patient-due-row:hover > td,
body.hms-executive-ui .bill-history-due-row:hover > td { background: #feecec !important; }
body.hms-executive-ui .ph-patient-due-badge,
body.hms-executive-ui .dr-patient-due-badge {
  background: #fff1f2 !important;
  border-color: #fecdd3 !important;
  color: #be123c !important;
}

/* ── Badges and states ───────────────────────────────────────── */
body.hms-executive-ui .badge,
body.hms-executive-ui [class^="badge-"],
body.hms-executive-ui [class*=" badge-"],
body.hms-executive-ui .pill,
body.hms-executive-ui .phx-pill,
body.hms-executive-ui .phx-badge,
body.hms-executive-ui .stateChip,
body.hms-executive-ui .waitChip,
body.hms-executive-ui .s-pill,
body.hms-executive-ui .th-chip,
body.hms-executive-ui .day-badge {
  border-radius: 999px !important;
  box-shadow: none !important;
}
body.hms-executive-ui .pill,
body.hms-executive-ui .badge,
body.hms-executive-ui .phx-pill,
body.hms-executive-ui .phx-badge {
  background: var(--hms-surface-soft) !important;
  border-color: var(--hms-border) !important;
  color: var(--hms-ink-soft) !important;
}
body.hms-executive-ui .badge.good,
body.hms-executive-ui .badge.done,
body.hms-executive-ui .pill.ok,
body.hms-executive-ui .phx-pill.done,
body.hms-executive-ui .phx-pill.ready,
body.hms-executive-ui .phx-badge.ok,
body.hms-executive-ui .badge-ready,
body.hms-executive-ui .badge-ready_for_pharmacy,
body.hms-executive-ui .badge-billing_done,
body.hms-executive-ui .badge-completed,
body.hms-executive-ui .s-pill.s-done,
body.hms-executive-ui .waitChip.w-green {
  background: #f0fdf4 !important;
  border-color: #bbf7d0 !important;
  color: #166534 !important;
}
body.hms-executive-ui .badge.warn,
body.hms-executive-ui .pill.warn,
body.hms-executive-ui .phx-pill.wait,
body.hms-executive-ui .phx-badge.warn,
body.hms-executive-ui .badge-waiting,
body.hms-executive-ui .badge-in_queue,
body.hms-executive-ui .s-pill.s-new,
body.hms-executive-ui .waitChip.w-amber {
  background: #fffbeb !important;
  border-color: #fde68a !important;
  color: #92400e !important;
}
body.hms-executive-ui .badge.bad,
body.hms-executive-ui .pill.bad,
body.hms-executive-ui .badge-cancelled,
body.hms-executive-ui .s-pill.s-bad,
body.hms-executive-ui .waitChip.w-red {
  background: #fff1f2 !important;
  border-color: #fecdd3 !important;
  color: #be123c !important;
}
body.hms-executive-ui .badge.blue,
body.hms-executive-ui .phx-badge.info,
body.hms-executive-ui .s-pill.s-blue,
body.hms-executive-ui .stateChip.live {
  background: var(--hms-info-soft) !important;
  border-color: var(--hms-info-border) !important;
  color: #1e40af !important;
}
body.hms-executive-ui .badge-pharmacy_editing,
body.hms-executive-ui .th-chip--pharmacy {
  background: var(--hms-teal-soft) !important;
  border-color: #a7f3d0 !important;
  color: #0f766e !important;
}

/* ── Filters and stock navigation ────────────────────────────── */
body.hms-executive-ui .filter-bar,
body.hms-executive-ui .phx-stockNav {
  border: 1px solid var(--hms-border) !important;
  border-radius: 16px !important;
  background: var(--hms-surface-soft) !important;
  box-shadow: none !important;
}
body.hms-executive-ui .phx-stockNav { padding: 14px 16px !important; }
body.hms-executive-ui .phx-stockGroup-label {
  color: var(--hms-muted) !important;
  letter-spacing: .08em !important;
}
body.hms-executive-ui .phx-stockNav h2 { color: var(--hms-ink) !important; }
body.hms-executive-ui .phx-stockBtns .phx-btn,
body.hms-executive-ui .phx-stockBtns .btn { background: #ffffff !important; }
body.hms-executive-ui .phx-stockBtns .phx-btn.primary,
body.hms-executive-ui .phx-stockBtns .btn.primary {
  color: #2d1b05 !important;
  background: linear-gradient(135deg, #ead5a7, var(--hms-primary)) !important;
}

/* ── Billing Summary dock ────────────────────────────────────── */
body.hms-executive-ui .billing-discount-dock {
  border: 1px solid var(--hms-border-strong) !important;
  border-top: 3px solid var(--hms-primary) !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  color: var(--hms-ink) !important;
  box-shadow: 0 24px 60px rgba(45,35,22,.18) !important;
}
body.hms-executive-ui .billing-discount-dock__title {
  color: var(--hms-ink) !important;
  letter-spacing: -.025em;
}
body.hms-executive-ui .billing-discount-dock__toggle {
  border-color: var(--hms-primary-border) !important;
  background: var(--hms-primary-soft) !important;
  color: var(--hms-primary-dark) !important;
  box-shadow: none !important;
}
body.hms-executive-ui .billing-discount-dock__toggle:hover,
body.hms-executive-ui .billing-discount-dock__toggle:focus-visible {
  background: var(--hms-primary-hover) !important;
  outline: none !important;
  box-shadow: var(--hms-focus) !important;
}
body.hms-executive-ui .billing-discount-dock__hint,
body.hms-executive-ui .billing-discount-dock__head { color: var(--hms-muted) !important; }
body.hms-executive-ui .billing-discount-dock__row,
body.hms-executive-ui .billing-discount-dock__extra { border-color: var(--hms-border) !important; }
body.hms-executive-ui .billing-discount-dock__nav { color: var(--hms-ink) !important; }
body.hms-executive-ui .billing-discount-dock__nav:hover,
body.hms-executive-ui .billing-discount-dock__nav:focus-visible {
  background: var(--hms-primary-soft) !important;
  color: var(--hms-primary-dark) !important;
  outline: none !important;
  box-shadow: inset 0 0 0 1px var(--hms-primary-border) !important;
}
body.hms-executive-ui .billing-discount-dock .dock-discount-input {
  border-color: var(--hms-border-strong) !important;
  background: #ffffff !important;
  color: var(--hms-ink) !important;
}
body.hms-executive-ui .billing-discount-dock .dock-discount-input:focus {
  border-color: var(--hms-primary) !important;
  box-shadow: var(--hms-focus) !important;
}
body.hms-executive-ui .billing-discount-dock__total {
  background: var(--hms-surface-soft) !important;
  border-color: var(--hms-border) !important;
}
body.hms-executive-ui .billing-discount-dock__grand { color: var(--hms-ink) !important; }
body.hms-executive-ui .billing-discount-dock__due {
  color: #c81e1e !important;
  border-color: #fecaca !important;
}
body.hms-executive-ui .billing-discount-dock__collapsed {
  background: #fff7f7 !important;
  border-color: #fecaca !important;
}

/* Preserve the production billing workspace geometry. */
@media (min-width: 1301px) {
  body.hms-executive-ui.billing-dock-active:not(.billing-dock-minimized) .shell {
    width: min(1080px, calc(100vw - 372px)) !important;
    max-width: none !important;
    margin: 14px 354px 34px auto !important;
  }
  body.hms-executive-ui.billing-dock-active.billing-dock-minimized .shell {
    width: min(var(--hms-workspace-max,1200px), calc(100vw - 232px)) !important;
    max-width: none !important;
    margin: 14px 214px 34px auto !important;
  }
}

/* ── Modals ──────────────────────────────────────────────────── */
body.hms-executive-ui .modal,
body.hms-executive-ui .modal-backdrop,
body.hms-executive-ui .patient-due-modal__backdrop {
  background: rgba(23,32,51,.50) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.hms-executive-ui .modal .box,
body.hms-executive-ui .modal-box,
body.hms-executive-ui .cm-box,
body.hms-executive-ui .cm-box2,
body.hms-executive-ui .patient-due-modal__panel,
body.hms-executive-ui #diffModal .box,
body.hms-executive-ui #whyKpiModal .box {
  border: 1px solid var(--hms-border-strong) !important;
  border-top: 3px solid var(--hms-primary) !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  box-shadow: var(--hms-shadow-lg) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.hms-executive-ui .patient-due-modal__panel { border-top-color: var(--hms-danger) !important; }
body.hms-executive-ui .patient-due-modal__ack {
  border-color: #b91c1c !important;
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 20px rgba(220,38,38,.20) !important;
}
body.hms-executive-ui #whyKpiModal .box::before,
body.hms-executive-ui #diffModal .box::before { display: none !important; }
body.hms-executive-ui #whyKpiModal .box > div:first-child,
body.hms-executive-ui #diffModal .box > div:first-child {
  background: var(--hms-surface-soft) !important;
  border-bottom: 1px solid var(--hms-border) !important;
  box-shadow: none !important;
}
body.hms-executive-ui #whyKpiModal .card,
body.hms-executive-ui #diffModal .card {
  background: #ffffff !important;
  border-color: var(--hms-border) !important;
  border-radius: 16px !important;
  box-shadow: var(--hms-shadow-sm) !important;
}
body.hms-executive-ui #whyKpiModal .diffTable,
body.hms-executive-ui #diffModal .diffTable {
  background: #ffffff !important;
  border-color: var(--hms-border) !important;
  border-radius: 14px !important;
}
body.hms-executive-ui #whyKpiModal .diffTable th,
body.hms-executive-ui #diffModal .diffTable th {
  background: var(--hms-surface-soft) !important;
  border-color: var(--hms-border) !important;
  color: var(--hms-muted) !important;
}

/* ── Helper system ───────────────────────────────────────────── */
body.hms-executive-ui .hms-help-trigger {
  border-color: var(--hms-primary-border) !important;
  background: var(--hms-primary-soft) !important;
  color: var(--hms-primary-dark) !important;
  box-shadow: none !important;
}
body.hms-executive-ui .hms-help-trigger:hover,
body.hms-executive-ui .hms-help-trigger:focus-visible {
  background: var(--hms-primary-hover) !important;
  box-shadow: var(--hms-focus) !important;
}
body.hms-executive-ui .hms-help-pop {
  border-color: #2b3446 !important;
  background: #172033 !important;
  color: #fffdf8 !important;
  box-shadow: var(--hms-shadow-lg) !important;
}
body.hms-executive-ui button.hms-help-target::after,
body.hms-executive-ui a.hms-help-target::after,
body.hms-executive-ui .tab.hms-help-target::after,
body.hms-executive-ui .btn.hms-help-target::after,
body.hms-executive-ui label.hms-help-target::after,
body.hms-executive-ui h1.hms-help-target::after,
body.hms-executive-ui h2.hms-help-target::after,
body.hms-executive-ui h3.hms-help-target::after,
body.hms-executive-ui h4.hms-help-target::after {
  border-bottom-color: rgba(192,138,50,.28) !important;
}

/* ── Miscellaneous operational components ───────────────────── */
body.hms-executive-ui .kv,
body.hms-executive-ui .tile,
body.hms-executive-ui .cm-chip,
body.hms-executive-ui .stateChip,
body.hms-executive-ui .waitChip,
body.hms-executive-ui details.module {
  border-color: var(--hms-border) !important;
  background: var(--hms-surface-soft) !important;
  box-shadow: none !important;
}
body.hms-executive-ui .empty-state {
  color: var(--hms-muted) !important;
  background: linear-gradient(180deg, rgba(251,250,247,.75), rgba(255,255,255,.97));
  border-radius: 14px;
}
body.hms-executive-ui details { border-color: var(--hms-border); }
body.hms-executive-ui summary {
  cursor: pointer;
  color: var(--hms-ink-soft);
  transition: color .14s ease, background-color .14s ease;
}
body.hms-executive-ui details[open] > summary { color: var(--hms-primary-dark) !important; }
body.hms-executive-ui :focus-visible {
  outline: 2px solid var(--hms-primary) !important;
  outline-offset: 2px !important;
}

/* ── Responsive behavior ─────────────────────────────────────── */
@media (max-width: 880px) {
  body.hms-executive-ui .topbar,
  body.hms-executive-ui .rx-topbar { top: 104px !important; }
  body.hms-executive-ui .global-shell-search { gap: 8px !important; }
  body.hms-executive-ui .shell {
    width: calc(100% - 16px) !important;
    margin: 8px auto 24px !important;
    padding: 12px !important;
    border-radius: 18px !important;
  }
  body.hms-executive-ui .phx-tabs {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
  body.hms-executive-ui .phx-tab { flex: 0 0 auto; }
}

@media (max-width: 640px) {
  body.hms-executive-ui .global-shell-bar { padding: 7px 8px !important; }
  body.hms-executive-ui .global-shell-search .meta { padding-left: 0; }
  body.hms-executive-ui .global-shell-search .meta::before { display: none; }
  body.hms-executive-ui .topbar,
  body.hms-executive-ui .rx-topbar { top: 112px !important; border-radius: 14px !important; }
  body.hms-executive-ui .card,
  body.hms-executive-ui .phx-card,
  body.hms-executive-ui .section-box,
  body.hms-executive-ui .sec-panel,
  body.hms-executive-ui .tablePanel { border-radius: 14px !important; }
}

@media (prefers-reduced-motion: reduce) {
  body.hms-executive-ui *,
  body.hms-executive-ui *::before,
  body.hms-executive-ui *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  body.hms-executive-ui { background: #ffffff !important; }
  body.hms-executive-ui .global-shell-bar { display: none !important; }
  body.hms-executive-ui .shell,
  body.hms-executive-ui .card,
  body.hms-executive-ui .phx-card,
  body.hms-executive-ui .table,
  body.hms-executive-ui table.phx-table {
    background: #ffffff !important;
    box-shadow: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   HMS DESIGN SYSTEM v12 — OPERATIONAL REFINEMENT
   Reduces visual noise, standardizes navigation and improves scan speed.
   ═══════════════════════════════════════════════════════════════ */

/* Consistent dependency-free SVG icons. */
body.hms-executive-ui .hms-ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: inline-block;
  vertical-align: -2px;
  color: currentColor;
}
body.hms-executive-ui .hms-module-brand {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: var(--hms-ink) !important;
  font-size: 11.5px !important;
  font-weight: 850 !important;
  letter-spacing: .10em !important;
}
body.hms-executive-ui .hms-module-brand > .hms-ui-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  color: var(--hms-primary-dark);
}
body.hms-executive-ui .tab,
body.hms-executive-ui .rx-tab,
body.hms-executive-ui .phx-tab {
  gap: 7px !important;
}
body.hms-executive-ui .tab > span,
body.hms-executive-ui .rx-tab > span,
body.hms-executive-ui .phx-tab > span {
  min-width: 0;
}
body.hms-executive-ui .phx-module-head {
  min-height: 38px;
  margin-bottom: 6px !important;
  padding: 0 2px;
}
body.hms-executive-ui .hms-user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--hms-border);
  border-radius: 10px;
  background: var(--hms-surface-soft);
  color: var(--hms-muted);
  font-size: 12px;
  font-weight: 700;
}

/* Module navigation: one quiet, predictable rhythm. */
body.hms-executive-ui .topbar,
body.hms-executive-ui .rx-topbar,
body.hms-executive-ui .phx-tabs {
  box-shadow: 0 3px 12px rgba(61,48,30,.055) !important;
}
body.hms-executive-ui .topbar .tabs,
body.hms-executive-ui .rx-topbar .rx-tabs,
body.hms-executive-ui .phx-tabs {
  align-items: center !important;
}
body.hms-executive-ui .topbar .right,
body.hms-executive-ui .rx-right,
body.hms-executive-ui .phx-top {
  color: var(--hms-muted) !important;
}
body.hms-executive-ui .pillbar .pill,
body.hms-executive-ui .rx-pill {
  background: var(--hms-surface-soft) !important;
  border-color: var(--hms-border) !important;
  box-shadow: none !important;
}

/* Static containers must not pretend to be clickable. */
body.hms-executive-ui .card,
body.hms-executive-ui .phx-card,
body.hms-executive-ui .section-box,
body.hms-executive-ui .sec-panel,
body.hms-executive-ui .tablePanel,
body.hms-executive-ui .metric,
body.hms-executive-ui .kpi,
body.hms-executive-ui .kpiCard,
body.hms-executive-ui .cm-card,
body.hms-executive-ui .phx-comment-box {
  box-shadow: 0 2px 8px rgba(61,48,30,.045) !important;
}
body.hms-executive-ui .card:hover,
body.hms-executive-ui .phx-card:hover,
body.hms-executive-ui .section-box:hover,
body.hms-executive-ui .sec-panel:hover,
body.hms-executive-ui .tablePanel:hover,
body.hms-executive-ui .card:focus-within,
body.hms-executive-ui .phx-card:focus-within {
  transform: none !important;
  border-color: var(--hms-border) !important;
  box-shadow: 0 2px 8px rgba(61,48,30,.045) !important;
}
body.hms-executive-ui a.card:hover,
body.hms-executive-ui button.card:hover,
body.hms-executive-ui .card[onclick]:hover,
body.hms-executive-ui a.kpiCard:hover,
body.hms-executive-ui button.kpiCard:hover,
body.hms-executive-ui .kpiCard[onclick]:hover,
body.hms-executive-ui .kpiLink:hover {
  border-color: var(--hms-primary-border) !important;
  box-shadow: var(--hms-shadow-sm) !important;
  transform: translateY(-1px) !important;
}
body.hms-executive-ui .kpiCard:hover,
body.hms-executive-ui .metric:hover,
body.hms-executive-ui .kpi:hover,
body.hms-executive-ui .phx-kpi:hover {
  transform: none !important;
  border-color: var(--hms-border) !important;
  box-shadow: 0 2px 8px rgba(61,48,30,.045) !important;
}
body.hms-executive-ui .card .card,
body.hms-executive-ui .card .phx-card,
body.hms-executive-ui .phx-card .phx-card,
body.hms-executive-ui .section-box .card,
body.hms-executive-ui .sec-panel .card,
body.hms-executive-ui .tablePanel .card {
  background: var(--hms-surface-soft) !important;
  border-color: #eee8df !important;
  box-shadow: none !important;
}

/* Typography: improve long-shift readability and hierarchy. */
body.hms-executive-ui .table th,
body.hms-executive-ui table.phx-table th,
body.hms-executive-ui table.intel-table th,
body.hms-executive-ui table.cm-table th {
  font-size: 11.5px !important;
  line-height: 1.32 !important;
  letter-spacing: .025em !important;
  text-transform: none !important;
  color: #696159 !important;
}
body.hms-executive-ui .table td,
body.hms-executive-ui table.phx-table td,
body.hms-executive-ui table.intel-table td,
body.hms-executive-ui table.cm-table td {
  font-size: 13px !important;
  line-height: 1.42 !important;
}
body.hms-executive-ui .small,
body.hms-executive-ui .phx-note,
body.hms-executive-ui .muted {
  line-height: 1.48 !important;
}

/* Repeated row actions are intentionally quieter than page-level actions. */
body.hms-executive-ui table .btn.primary,
body.hms-executive-ui table .phx-btn.primary,
body.hms-executive-ui .table .btn.primary,
body.hms-executive-ui .phx-table .phx-btn.primary {
  color: var(--hms-primary-dark) !important;
  border-color: var(--hms-primary-border) !important;
  background: var(--hms-primary-soft) !important;
  box-shadow: none !important;
}
body.hms-executive-ui table .btn.primary:hover,
body.hms-executive-ui table .phx-btn.primary:hover,
body.hms-executive-ui .table .btn.primary:hover,
body.hms-executive-ui .phx-table .phx-btn.primary:hover {
  color: #5c390d !important;
  border-color: #d5b469 !important;
  background: var(--hms-primary-hover) !important;
  box-shadow: var(--hms-shadow-xs) !important;
}

/* Keep contextual help, remove the dotted decoration and generic title noise. */
body.hms-executive-ui button.hms-help-target::after,
body.hms-executive-ui a.hms-help-target::after,
body.hms-executive-ui .tab.hms-help-target::after,
body.hms-executive-ui .btn.hms-help-target::after,
body.hms-executive-ui label.hms-help-target::after,
body.hms-executive-ui h1.hms-help-target::after,
body.hms-executive-ui h2.hms-help-target::after,
body.hms-executive-ui h3.hms-help-target::after,
body.hms-executive-ui h4.hms-help-target::after {
  display: none !important;
}
body.hms-executive-ui .hms-help-trigger {
  width: 17px !important;
  height: 17px !important;
  margin-left: 5px !important;
  font-size: 10px !important;
  opacity: .78;
}

/* Shared row-action menu used by data-heavy history screens. */
body.hms-executive-ui .hms-row-actions {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}
body.hms-executive-ui .hms-action-more {
  min-width: 86px;
  position: relative;
}
body.hms-executive-ui .hms-action-more > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--hms-border-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--hms-ink-soft);
  font-weight: 730;
  cursor: pointer;
  user-select: none;
}
body.hms-executive-ui .hms-action-more > summary::-webkit-details-marker { display: none; }
body.hms-executive-ui .hms-action-more[open] > summary {
  color: var(--hms-primary-dark) !important;
  border-color: var(--hms-primary-border) !important;
  background: var(--hms-primary-soft) !important;
}
body.hms-executive-ui .hms-action-more__panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 210px;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--hms-border);
  border-radius: 12px;
  background: var(--hms-surface-soft);
  box-shadow: none;
}
body.hms-executive-ui .hms-action-more__panel .btn,
body.hms-executive-ui .hms-action-more__panel .phx-btn {
  width: 100%;
  min-height: 32px;
  padding: 6px 8px !important;
  justify-content: flex-start;
  box-shadow: none !important;
}

/* Stock intelligence: compact navigation and clear operational severity. */
body.hms-executive-ui .phx-stockNav {
  display: grid !important;
  grid-template-columns: minmax(220px, .72fr) minmax(0, 1.8fr) !important;
  gap: 18px !important;
  align-items: start !important;
}
body.hms-executive-ui .phx-stockTabs {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px 14px !important;
}
body.hms-executive-ui .phx-stockGroup { min-width: 0 !important; }
body.hms-executive-ui .phx-stockBtns { gap: 6px !important; }
body.hms-executive-ui .phx-stockBtns .phx-btn {
  min-height: 36px !important;
  padding: 0 11px !important;
}
body.hms-executive-ui .stock-intel-help {
  margin-top: 6px;
  max-width: 760px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.hms-executive-ui .stock-intel-help > summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--hms-primary-dark) !important;
  font-size: 12.5px;
  font-weight: 730;
}
body.hms-executive-ui .stock-intel-help__body {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--hms-border);
  border-radius: 12px;
  background: var(--hms-surface-soft);
  color: var(--hms-muted);
  font-size: 12.5px;
  line-height: 1.5;
}
body.hms-executive-ui .stock-use {
  display: block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--hms-ink-soft);
}
body.hms-executive-ui .stock-use.is-empty { color: var(--hms-faint); font-style: italic; }
body.hms-executive-ui .stock-number { font-weight: 780; font-variant-numeric: tabular-nums; }
body.hms-executive-ui .stock-number.is-negative,
body.hms-executive-ui .stock-number.is-out { color: #c81e1e !important; }
body.hms-executive-ui .stock-number.is-low { color: #b45309 !important; }
body.hms-executive-ui .stock-number.is-good { color: #15803d !important; }
body.hms-executive-ui .stock-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--hms-border);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
body.hms-executive-ui .stock-status.is-critical,
body.hms-executive-ui .stock-status.is-out {
  color: #b91c1c;
  background: #fff1f2;
  border-color: #fecdd3;
}
body.hms-executive-ui .stock-status.is-low {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}
body.hms-executive-ui .stock-status.is-good {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}
body.hms-executive-ui .stock-intel-heading {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 18px;
  align-items: end;
}
body.hms-executive-ui .stock-intel-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr)) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--hms-border);
  border-radius: 14px;
  background: var(--hms-surface-soft);
}
body.hms-executive-ui .stock-intel-filters label {
  display: grid;
  gap: 5px;
  color: var(--hms-muted);
  font-size: 11.5px;
  font-weight: 730;
}
body.hms-executive-ui .stock-intel-filters .phx-in {
  width: 100% !important;
  min-width: 0;
}
body.hms-executive-ui .stock-intel-filters .phx-btn {
  min-height: 40px;
  padding-inline: 16px !important;
}
body.hms-executive-ui .stock-low-card { border-color: #f3d3d3 !important; }
body.hms-executive-ui .stock-low-table { min-width: 1050px; }
body.hms-executive-ui .stock-low-table td:nth-child(3) { min-width: 220px; }

/* Doctor patient workspace: only the global shell and doctor navigation remain sticky. */
body.hms-executive-ui .doctorPatientPage .dpTopbar {
  position: relative !important;
  top: auto !important;
  min-height: 54px !important;
  padding: 8px 10px !important;
}
body.hms-executive-ui .doctorPatientPage .dpTopSearch {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 0 0 auto !important;
  padding: 8px 12px !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  background: var(--hms-surface-soft) !important;
  border-color: var(--hms-border) !important;
}
body.hms-executive-ui .doctorPatientPage .dpTopSearch .dpSearchText {
  font-size: 12.5px;
  font-weight: 730;
}
body.hms-executive-ui .doctorPatientPage #dp-jump-nav {
  position: relative !important;
  top: auto !important;
  z-index: 1 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  padding: 6px !important;
  border: 1px solid var(--hms-border) !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,.985) !important;
  box-shadow: 0 2px 8px rgba(61,48,30,.045) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.hms-executive-ui .doctorPatientPage #dp-jump-nav a {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  min-height: 32px !important;
  padding: 5px 10px !important;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: var(--hms-ink-soft) !important;
  text-decoration: none !important;
  font-size: 12px !important;
  font-weight: 730 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.hms-executive-ui .doctorPatientPage #dp-jump-nav a:hover,
body.hms-executive-ui .doctorPatientPage #dp-jump-nav a:focus-visible {
  color: var(--hms-primary-dark) !important;
  background: var(--hms-primary-soft) !important;
  border-color: var(--hms-primary-border) !important;
}
body.hms-executive-ui .doctorPatientPage .dpSidebar { top: 148px !important; }
body.hms-executive-ui .doctorPatientPage .dpGlass {
  background: var(--hms-surface) !important;
  border: 1px solid var(--hms-border) !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 8px rgba(61,48,30,.045) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.hms-executive-ui .doctorPatientPage .dpGlass::before { display: none !important; }
body.hms-executive-ui .doctorPatientPage .dpIcon {
  width: 40px !important;
  height: 40px !important;
  color: var(--hms-primary-dark) !important;
  background: var(--hms-primary-soft) !important;
  border: 1px solid var(--hms-primary-border) !important;
}
body.hms-executive-ui .doctorPatientPage .dpIcon .hms-ui-icon,
body.hms-executive-ui .doctorPatientPage .dpBackBtn .hms-ui-icon {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
}
body.hms-executive-ui .doctorPatientPage .dpSection { scroll-margin-top: 150px; }

@media (max-width: 1050px) {
  body.hms-executive-ui .stock-intel-heading { grid-template-columns: 1fr; }
  body.hms-executive-ui .stock-intel-filters { grid-template-columns: repeat(3,minmax(0,1fr)) auto; }
}
@media (max-width: 980px) {
  body.hms-executive-ui .phx-stockNav,
  body.hms-executive-ui .phx-stockTabs { grid-template-columns: 1fr !important; }
  body.hms-executive-ui .doctorPatientPage .dpSidebar { top: auto !important; }
}
@media (max-width: 700px) {
  body.hms-executive-ui .stock-intel-filters { grid-template-columns: 1fr; }
  body.hms-executive-ui .stock-intel-filters .phx-btn { width: 100%; }
  body.hms-executive-ui .hms-user-pill { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   HMS DESIGN SYSTEM v13 — INTERACTION + DUE WORK QUEUE
   Visible controls before hover, restrained depth, no nested
   scrolling in the refined operational screens.
   ═══════════════════════════════════════════════════════════════ */

/* Navigation must look interactive before the pointer arrives. */
body.hms-executive-ui .tab,
body.hms-executive-ui .rx-tab,
body.hms-executive-ui .phx-tab {
  border-color: var(--hms-border) !important;
  background: #ffffff !important;
  box-shadow: 0 2px 0 rgba(183,169,144,.46), 0 4px 10px rgba(61,48,30,.045) !important;
}
body.hms-executive-ui .tab:hover,
body.hms-executive-ui .rx-tab:hover,
body.hms-executive-ui .phx-tab:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 3px 0 rgba(192,138,50,.30), 0 8px 18px rgba(61,48,30,.09) !important;
}
body.hms-executive-ui .tab:active,
body.hms-executive-ui .rx-tab:active,
body.hms-executive-ui .phx-tab:active {
  transform: translateY(1px) !important;
  box-shadow: 0 1px 0 rgba(183,169,144,.48), 0 2px 5px rgba(61,48,30,.05) !important;
}
body.hms-executive-ui .tab.active,
body.hms-executive-ui .rx-tab.active,
body.hms-executive-ui .phx-tab.active {
  box-shadow: inset 0 -2px 0 var(--hms-primary), 0 2px 0 rgba(170,116,36,.62), 0 7px 16px rgba(192,138,50,.14) !important;
}

/* Tactile but restrained button depth. */
body.hms-executive-ui .btn,
body.hms-executive-ui .phx-btn,
body.hms-executive-ui .rx-btn,
body.hms-executive-ui .lx-btn,
body.hms-executive-ui .audit-btn,
body.hms-executive-ui .saveBtn,
body.hms-executive-ui .secondary,
body.hms-executive-ui .icon-btn {
  box-shadow: 0 2px 0 rgba(183,169,144,.52), 0 5px 12px rgba(61,48,30,.055) !important;
  transform: translateY(0);
}
body.hms-executive-ui .btn:hover,
body.hms-executive-ui .phx-btn:hover,
body.hms-executive-ui .rx-btn:hover,
body.hms-executive-ui .lx-btn:hover,
body.hms-executive-ui .audit-btn:hover,
body.hms-executive-ui .saveBtn:hover,
body.hms-executive-ui .secondary:hover,
body.hms-executive-ui .icon-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 3px 0 rgba(183,169,144,.42), 0 10px 22px rgba(61,48,30,.105) !important;
}
body.hms-executive-ui .btn:active,
body.hms-executive-ui .phx-btn:active,
body.hms-executive-ui .rx-btn:active,
body.hms-executive-ui .lx-btn:active,
body.hms-executive-ui .audit-btn:active,
body.hms-executive-ui .saveBtn:active,
body.hms-executive-ui .secondary:active,
body.hms-executive-ui .icon-btn:active {
  transform: translateY(1px) scale(.99) !important;
  box-shadow: 0 1px 0 rgba(183,169,144,.52), 0 2px 5px rgba(61,48,30,.06) !important;
}
body.hms-executive-ui .btn.primary,
body.hms-executive-ui .phx-btn.primary,
body.hms-executive-ui .rx-btn.primary,
body.hms-executive-ui .saveBtn {
  box-shadow: 0 3px 0 #8f5c16, 0 9px 20px rgba(192,138,50,.22) !important;
}
body.hms-executive-ui .btn.primary:active,
body.hms-executive-ui .phx-btn.primary:active,
body.hms-executive-ui .rx-btn.primary:active,
body.hms-executive-ui .saveBtn:active {
  box-shadow: 0 1px 0 #8f5c16, 0 3px 7px rgba(192,138,50,.18) !important;
}
body.hms-executive-ui button:disabled,
body.hms-executive-ui .btn.is-disabled,
body.hms-executive-ui .phx-btn.is-disabled,
body.hms-executive-ui .rx-btn.is-disabled {
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Fields read as separate controls even before focus. */
body.hms-executive-ui .shell input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]),
body.hms-executive-ui .shell select,
body.hms-executive-ui .shell textarea {
  border-color: #d8c9b2 !important;
  background: linear-gradient(180deg,#ffffff 0%,#fffdf9 100%) !important;
  box-shadow: inset 0 1px 2px rgba(61,48,30,.045), 0 1px 0 rgba(255,255,255,.95) !important;
}
body.hms-executive-ui .shell input:disabled,
body.hms-executive-ui .shell input[readonly],
body.hms-executive-ui .shell select:disabled,
body.hms-executive-ui .shell textarea:disabled {
  background: #f5f2ec !important;
  color: #746d64 !important;
  border-color: #e2d9cc !important;
}

/* Refined doctor treatment-entry separation. */
body.hms-executive-ui .doctorPatientPage .dpInputGroup {
  border: 1px solid #e6d7bf !important;
  background: linear-gradient(180deg,#fffdf9,#fffaf1) !important;
  box-shadow: inset 0 1px 0 #fff, 0 3px 12px rgba(61,48,30,.045) !important;
}
body.hms-executive-ui .doctorPatientPage .dpField > span,
body.hms-executive-ui .doctorPatientPage .dpEntryAction > .dpToolLabel {
  color: #6d6257 !important;
}
body.hms-executive-ui .doctorPatientPage .dpEntryAction .btn,
body.hms-executive-ui .doctorPatientPage .medEntryAction .btn {
  min-height: 44px !important;
  gap: 7px !important;
}
body.hms-executive-ui .doctorPatientPage .dpSidebar {
  flex-basis: 356px !important;
  max-width: 356px !important;
  min-width: 300px !important;
}
body.hms-executive-ui .doctorPatientPage .dpTableNatural {
  overflow: visible !important;
  max-height: none !important;
}
body.hms-executive-ui .doctorPatientPage .dpTableNatural .table {
  width: 100% !important;
  table-layout: fixed !important;
}

/* Stock navigation uses every column deliberately; Back belongs to context. */
body.hms-executive-ui .phx-stockNav {
  grid-template-columns: minmax(235px,.70fr) minmax(0,2fr) !important;
  gap: 22px !important;
  padding: 16px 18px !important;
}
body.hms-executive-ui .phx-stockNav-desc {
  display: flex !important;
  min-width: 0 !important;
  flex-direction: column !important;
  align-items: flex-start !important;
}
body.hms-executive-ui .phx-stockTabs {
  grid-template-columns: repeat(auto-fit,minmax(185px,1fr)) !important;
  gap: 14px !important;
  align-items: start !important;
}
body.hms-executive-ui .phx-stockGroup {
  padding: 10px !important;
  border: 1px solid #eee5d8 !important;
  border-radius: 13px !important;
  background: rgba(255,255,255,.76) !important;
}
body.hms-executive-ui .phx-stockBtns .phx-btn {
  min-height: 38px !important;
}
body.hms-executive-ui .phx-stockBack {
  margin-top: 14px !important;
}
body.hms-executive-ui .stock-intel-heading {
  align-items: start !important;
}
body.hms-executive-ui .stock-intel-filters {
  width: min(100%,560px);
}

/* No nested scroll area in the visible stock tables. */
body.hms-executive-ui .stock-low-table-wrap,
body.hms-executive-ui .si-dist-panel {
  overflow: visible !important;
  max-height: none !important;
}
body.hms-executive-ui .stock-low-table,
body.hms-executive-ui .stock-snapshot-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}
body.hms-executive-ui .stock-low-table th,
body.hms-executive-ui .stock-low-table td,
body.hms-executive-ui .stock-snapshot-table th,
body.hms-executive-ui .stock-snapshot-table td {
  vertical-align: top !important;
  overflow-wrap: anywhere;
}
body.hms-executive-ui .stock-low-table td:nth-child(3) { min-width: 0 !important; }
body.hms-executive-ui .stock-snapshot-table th:first-child { width: 22%; }
body.hms-executive-ui .stock-snapshot-table th:nth-child(2) { width: 12%; }
body.hms-executive-ui .stock-snapshot-table th:nth-child(3),
body.hms-executive-ui .stock-snapshot-table th:nth-child(4) { width: 15%; }
body.hms-executive-ui .stock-snapshot-table th:nth-child(5) { width: 18%; }
body.hms-executive-ui .stock-snapshot-table th:nth-child(6) { width: 16%; }
body.hms-executive-ui .stock-metric-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  color: var(--hms-ink-soft);
}
body.hms-executive-ui .stock-metric-line small {
  color: var(--hms-muted);
  font-size: 10.5px;
  font-weight: 650;
}
body.hms-executive-ui .stock-metric-line strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
body.hms-executive-ui .stock-snapshot-table .stock-use {
  margin-top: 5px;
  max-width: 100%;
  font-size: 11.5px;
}

/* Due queue shared by Pharmacy, Doctor and Reception; Pharmacy can collect balances inline. */
body.hms-executive-ui .hms-due-page {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}
body.hms-executive-ui .hms-due-hero {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(340px,.78fr);
  gap: 22px;
  align-items: end;
  padding: 20px;
  border: 1px solid var(--hms-border);
  border-radius: 18px;
  background: linear-gradient(135deg,#fffdf9 0%,#ffffff 58%,#fff8e8 100%);
  box-shadow: 0 3px 12px rgba(61,48,30,.055);
}
body.hms-executive-ui .hms-due-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .08em;
  text-transform: uppercase;
}
body.hms-executive-ui .hms-due-hero h1 {
  margin: 5px 0 3px;
  font-size: 28px;
}
body.hms-executive-ui .hms-due-hero p {
  margin: 0;
  color: var(--hms-muted);
  line-height: 1.5;
}
body.hms-executive-ui .hms-due-search {
  display: grid;
  gap: 6px;
}
body.hms-executive-ui .hms-due-search > label {
  color: var(--hms-muted);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: .05em;
  text-transform: uppercase;
}
body.hms-executive-ui .hms-due-search-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto auto;
  gap: 8px;
  align-items: center;
}
body.hms-executive-ui .hms-due-search-row .btn {
  min-height: 40px;
  gap: 6px;
}
body.hms-executive-ui .hms-due-kpis {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
}
body.hms-executive-ui .hms-due-kpi {
  padding: 14px 15px;
  border: 1px solid var(--hms-border);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(61,48,30,.045);
}
body.hms-executive-ui .hms-due-kpi span {
  display: block;
  color: var(--hms-muted);
  font-size: 11px;
  font-weight: 730;
}
body.hms-executive-ui .hms-due-kpi strong {
  display: block;
  margin-top: 5px;
  color: var(--hms-ink);
  font-size: 22px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
body.hms-executive-ui .hms-due-kpi.is-danger {
  border-color: #fecaca;
  background: #fff8f8;
}
body.hms-executive-ui .hms-due-kpi.is-danger strong { color: #c81e1e; }
body.hms-executive-ui .hms-due-list {
  display: grid;
  gap: 10px;
}
body.hms-executive-ui .hms-due-patient {
  border: 1px solid var(--hms-border) !important;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(61,48,30,.045);
  overflow: hidden;
}
body.hms-executive-ui .hms-due-patient > summary {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(230px,1fr) minmax(430px,1.25fr);
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
}
body.hms-executive-ui .hms-due-patient > summary::-webkit-details-marker { display: none; }
body.hms-executive-ui .hms-due-patient > summary:hover {
  background: #fffaf1;
}
body.hms-executive-ui .hms-due-patient[open] > summary {
  background: #fffaf1;
  border-bottom: 1px solid var(--hms-border);
}
body.hms-executive-ui .hms-due-patient-main {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
body.hms-executive-ui .hms-due-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hms-primary-border);
  border-radius: 13px;
  background: var(--hms-primary-soft);
  color: var(--hms-primary-dark);
  font-weight: 850;
}
body.hms-executive-ui .hms-due-patient-main strong,
body.hms-executive-ui .hms-due-patient-main small { display: block; }
body.hms-executive-ui .hms-due-patient-main strong { color: var(--hms-ink); }
body.hms-executive-ui .hms-due-patient-main small {
  margin-top: 3px;
  color: var(--hms-muted);
  line-height: 1.35;
}
body.hms-executive-ui .hms-due-patient-stats {
  display: grid;
  grid-template-columns: .55fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
}
body.hms-executive-ui .hms-due-patient-stats > span:not(.hms-due-expand) {
  display: grid;
  gap: 2px;
}
body.hms-executive-ui .hms-due-patient-stats small {
  color: var(--hms-muted);
  font-size: 10.5px;
  font-weight: 680;
}
body.hms-executive-ui .hms-due-patient-stats strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
body.hms-executive-ui .hms-due-patient-stats .is-danger strong { color: #c81e1e; }
body.hms-executive-ui .hms-due-expand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--hms-primary-dark);
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}
body.hms-executive-ui .hms-due-expand .hms-ui-icon { transition: transform .18s ease; }
body.hms-executive-ui .hms-due-patient[open] .hms-due-expand .hms-ui-icon { transform: rotate(180deg); }
body.hms-executive-ui .hms-due-patient-body {
  padding: 14px 16px 16px;
  animation: hmsDueReveal .20s ease-out both;
}
body.hms-executive-ui .hms-due-contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--hms-muted);
  font-size: 12px;
}
body.hms-executive-ui .hms-due-bills {
  display: grid;
  gap: 8px;
}
body.hms-executive-ui .hms-due-bill {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr .8fr .8fr .8fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #eee8df;
  border-radius: 13px;
  background: var(--hms-surface-soft);
}
body.hms-executive-ui .hms-due-bill > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
body.hms-executive-ui .hms-due-bill small {
  color: var(--hms-muted);
  font-size: 10.5px;
  font-weight: 680;
}
body.hms-executive-ui .hms-due-bill strong {
  color: var(--hms-ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
body.hms-executive-ui .hms-due-bill span {
  overflow: hidden;
  color: var(--hms-muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.hms-executive-ui .hms-due-bill .is-danger strong { color: #c81e1e; }
body.hms-executive-ui .hms-due-bill-action .btn { white-space: nowrap; }
body.hms-executive-ui .hms-due-payment {
  min-width: 118px;
}
body.hms-executive-ui .hms-due-payment > summary {
  list-style: none;
  width: 100%;
  justify-content: center;
  white-space: nowrap;
  cursor: pointer;
}
body.hms-executive-ui .hms-due-payment > summary::-webkit-details-marker { display: none; }
body.hms-executive-ui .hms-due-payment[open] {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 4px;
}
body.hms-executive-ui .hms-due-payment[open] > summary {
  width: max-content;
  min-width: 118px;
  margin-left: auto;
}
body.hms-executive-ui .hms-due-payment-form {
  display: grid;
  grid-template-columns: minmax(180px,.8fr) minmax(150px,.65fr) minmax(240px,1.3fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--hms-primary-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(61,48,30,.06);
  animation: hmsDueReveal .18s ease-out both;
}
body.hms-executive-ui .hms-due-payment-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}
body.hms-executive-ui .hms-due-payment-form label > span,
body.hms-executive-ui .hms-due-payment-head small {
  color: var(--hms-muted);
  font-size: 10.5px;
  font-weight: 760;
}
body.hms-executive-ui .hms-due-payment-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--hms-muted);
  font-size: 12px;
}
body.hms-executive-ui .hms-due-payment-head > span:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
body.hms-executive-ui .hms-due-payment-head strong {
  color: #c81e1e;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
body.hms-executive-ui .hms-due-payment-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}
body.hms-executive-ui .hms-due-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 42px 20px;
  border: 1px dashed var(--hms-border-strong);
  border-radius: 17px;
  background: var(--hms-surface-soft);
  text-align: center;
}
body.hms-executive-ui .hms-due-empty .hms-ui-icon {
  width: 28px;
  height: 28px;
  color: var(--hms-primary-dark);
}
body.hms-executive-ui .hms-due-empty h2,
body.hms-executive-ui .hms-due-empty p { margin: 0; }
body.hms-executive-ui .hms-due-empty p { color: var(--hms-muted); }
body.hms-executive-ui .hms-due-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
body.hms-executive-ui .is-disabled {
  opacity: .45 !important;
  pointer-events: none !important;
}

@keyframes hmsDueReveal {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1050px) {
  body.hms-executive-ui .hms-due-hero { grid-template-columns: 1fr; }
  body.hms-executive-ui .hms-due-patient > summary { grid-template-columns: 1fr; }
  body.hms-executive-ui .hms-due-bill { grid-template-columns: repeat(3,minmax(0,1fr)); }
  body.hms-executive-ui .hms-due-bill-action,
  body.hms-executive-ui .hms-due-payment { grid-column: 1 / -1; }
  body.hms-executive-ui .hms-due-bill-action .btn,
  body.hms-executive-ui .hms-due-payment > summary { width: 100%; }
  body.hms-executive-ui .hms-due-payment[open] > summary { width: 100%; margin-left: 0; }
  body.hms-executive-ui .hms-due-payment-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.hms-executive-ui .hms-due-payment-note { grid-column: 1 / -1; }
  body.hms-executive-ui .hms-due-payment-actions { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  body.hms-executive-ui .hms-due-payment-form { grid-template-columns: 1fr; }
  body.hms-executive-ui .hms-due-payment-form > *,
  body.hms-executive-ui .hms-due-payment-note,
  body.hms-executive-ui .hms-due-payment-actions { grid-column: 1; }
  body.hms-executive-ui .hms-due-payment-head { align-items: flex-start; flex-direction: column; }
  body.hms-executive-ui .hms-due-payment-actions { display: grid; grid-template-columns: 1fr; }
  body.hms-executive-ui .hms-due-payment-actions .btn { width: 100%; }
}

@media (max-width: 900px) {
  body.hms-executive-ui .phx-stockNav,
  body.hms-executive-ui .phx-stockTabs { grid-template-columns: 1fr !important; }
  body.hms-executive-ui .stock-low-table colgroup,
  body.hms-executive-ui .stock-low-table thead,
  body.hms-executive-ui .stock-snapshot-table thead { display: none; }
  body.hms-executive-ui .stock-low-table,
  body.hms-executive-ui .stock-low-table tbody,
  body.hms-executive-ui .stock-snapshot-table,
  body.hms-executive-ui .stock-snapshot-table tbody { display: block; width: 100%; }
  body.hms-executive-ui .stock-low-table tr,
  body.hms-executive-ui .stock-snapshot-table tr {
    display: block;
    margin: 10px 0;
    border: 1px solid var(--hms-border);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(61,48,30,.045);
  }
  body.hms-executive-ui .stock-low-table td,
  body.hms-executive-ui .stock-snapshot-table td {
    display: grid;
    grid-template-columns: 126px minmax(0,1fr);
    gap: 12px;
    align-items: start;
    padding: 9px 11px !important;
    border-bottom: 1px solid #eee8df !important;
    text-align: left !important;
  }
  body.hms-executive-ui .stock-low-table td:last-child,
  body.hms-executive-ui .stock-snapshot-table td:last-child { border-bottom: 0 !important; }
  body.hms-executive-ui .stock-low-table td::before,
  body.hms-executive-ui .stock-snapshot-table td::before {
    content: attr(data-label);
    color: var(--hms-muted);
    font-size: 10.5px;
    font-weight: 780;
  }
  body.hms-executive-ui .stock-low-table .stock-empty-cell { display: block; text-align: center !important; }
  body.hms-executive-ui .stock-low-table .stock-empty-cell::before { display: none; }
  body.hms-executive-ui .stock-use { max-width: none; white-space: normal; }
  body.hms-executive-ui .doctorPatientPage .dpSidebar {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 720px) {
  body.hms-executive-ui .hms-due-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.hms-executive-ui .hms-due-search-row { grid-template-columns: 1fr 1fr; }
  body.hms-executive-ui .hms-due-search-row input { grid-column: 1 / -1; }
  body.hms-executive-ui .hms-due-patient-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.hms-executive-ui .hms-due-expand { justify-self: start; }
  body.hms-executive-ui .hms-due-bill { grid-template-columns: 1fr 1fr; }
  body.hms-executive-ui .hms-due-contact-row { align-items: stretch; flex-direction: column; }
  body.hms-executive-ui .hms-due-contact-row .btn { width: 100%; }
}

@media (max-width: 520px) {
  body.hms-executive-ui .hms-due-kpis,
  body.hms-executive-ui .hms-due-bill { grid-template-columns: 1fr; }
  body.hms-executive-ui .hms-due-hero { padding: 16px; }
  body.hms-executive-ui .stock-low-table td,
  body.hms-executive-ui .stock-snapshot-table td { grid-template-columns: 105px minmax(0,1fr); }
}

@media (prefers-reduced-motion: reduce) {
  body.hms-executive-ui .hms-due-patient-body { animation: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   RECEPTION / DOCTOR / PHARMACY — COMPACT OPERATIONAL DENSITY
   Scope is role-only so Admin and public screens are not changed.
   ═══════════════════════════════════════════════════════════════ */
body.hms-executive-ui.role-reception,
body.hms-executive-ui.role-doctor,
body.hms-executive-ui.role-pharmacy {
  --hms-workspace-gutter: 10px;
}

body.hms-executive-ui.role-reception .global-shell-bar,
body.hms-executive-ui.role-doctor .global-shell-bar,
body.hms-executive-ui.role-pharmacy .global-shell-bar {
  padding: 5px 8px !important;
  margin-bottom: 6px !important;
}
body.hms-executive-ui.role-reception .global-shell-search,
body.hms-executive-ui.role-doctor .global-shell-search,
body.hms-executive-ui.role-pharmacy .global-shell-search {
  width: calc(100% - 16px) !important;
  gap: 7px !important;
}
body.hms-executive-ui.role-reception .global-shell-search .meta,
body.hms-executive-ui.role-doctor .global-shell-search .meta,
body.hms-executive-ui.role-pharmacy .global-shell-search .meta { gap: 0 !important; }
body.hms-executive-ui.role-reception .global-shell-search .search-input,
body.hms-executive-ui.role-doctor .global-shell-search .search-input,
body.hms-executive-ui.role-pharmacy .global-shell-search .search-input {
  height: 34px !important;
  min-height: 34px !important;
}

body.hms-executive-ui.role-reception .shell,
body.hms-executive-ui.role-doctor .shell,
body.hms-executive-ui.role-pharmacy .shell {
  margin: 8px auto 20px !important;
  padding: 10px 12px 16px !important;
  border-radius: 18px !important;
}

body.hms-executive-ui.role-reception .topbar,
body.hms-executive-ui.role-reception .rx-topbar,
body.hms-executive-ui.role-doctor .topbar,
body.hms-executive-ui.role-doctor .rx-topbar,
body.hms-executive-ui.role-pharmacy .topbar,
body.hms-executive-ui.role-pharmacy .rx-topbar {
  gap: 5px !important;
  padding: 6px 9px !important;
  border-radius: 15px !important;
}

body.hms-executive-ui.role-reception .tabs,
body.hms-executive-ui.role-reception .rx-tabs,
body.hms-executive-ui.role-reception .phx-tabs,
body.hms-executive-ui.role-doctor .tabs,
body.hms-executive-ui.role-doctor .rx-tabs,
body.hms-executive-ui.role-doctor .phx-tabs,
body.hms-executive-ui.role-pharmacy .tabs,
body.hms-executive-ui.role-pharmacy .rx-tabs,
body.hms-executive-ui.role-pharmacy .phx-tabs { gap: 4px !important; }

body.hms-executive-ui.role-reception .tab,
body.hms-executive-ui.role-reception .rx-tab,
body.hms-executive-ui.role-reception .phx-tab,
body.hms-executive-ui.role-doctor .tab,
body.hms-executive-ui.role-doctor .rx-tab,
body.hms-executive-ui.role-doctor .phx-tab,
body.hms-executive-ui.role-pharmacy .tab,
body.hms-executive-ui.role-pharmacy .rx-tab,
body.hms-executive-ui.role-pharmacy .phx-tab {
  padding: 5px 10px !important;
  font-size: 12px !important;
  border-radius: 10px !important;
}

body.hms-executive-ui.role-reception .card,
body.hms-executive-ui.role-reception .phx-card,
body.hms-executive-ui.role-reception .phx-wrap,
body.hms-executive-ui.role-reception .section-box,
body.hms-executive-ui.role-reception .sec-panel,
body.hms-executive-ui.role-reception .tablePanel,
body.hms-executive-ui.role-doctor .card,
body.hms-executive-ui.role-doctor .phx-card,
body.hms-executive-ui.role-doctor .phx-wrap,
body.hms-executive-ui.role-doctor .section-box,
body.hms-executive-ui.role-doctor .sec-panel,
body.hms-executive-ui.role-doctor .tablePanel,
body.hms-executive-ui.role-pharmacy .card,
body.hms-executive-ui.role-pharmacy .phx-card,
body.hms-executive-ui.role-pharmacy .phx-wrap,
body.hms-executive-ui.role-pharmacy .section-box,
body.hms-executive-ui.role-pharmacy .sec-panel,
body.hms-executive-ui.role-pharmacy .tablePanel {
  padding: 10px 12px !important;
  border-radius: 14px !important;
}

body.hms-executive-ui.role-reception table th,
body.hms-executive-ui.role-reception table td,
body.hms-executive-ui.role-doctor table th,
body.hms-executive-ui.role-doctor table td,
body.hms-executive-ui.role-pharmacy table th,
body.hms-executive-ui.role-pharmacy table td {
  padding: 6px 8px !important;
  line-height: 1.3 !important;
}

body.hms-executive-ui.role-reception .shell input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]),
body.hms-executive-ui.role-reception .shell select,
body.hms-executive-ui.role-doctor .shell input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]),
body.hms-executive-ui.role-doctor .shell select,
body.hms-executive-ui.role-pharmacy .shell input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]),
body.hms-executive-ui.role-pharmacy .shell select {
  min-height: 34px !important;
  padding: 6px 9px !important;
}
body.hms-executive-ui.role-reception .shell textarea,
body.hms-executive-ui.role-doctor .shell textarea,
body.hms-executive-ui.role-pharmacy .shell textarea {
  padding: 7px 9px !important;
  min-height: 64px;
}

body.hms-executive-ui.role-reception .btn,
body.hms-executive-ui.role-reception .phx-btn,
body.hms-executive-ui.role-doctor .btn,
body.hms-executive-ui.role-doctor .phx-btn,
body.hms-executive-ui.role-pharmacy .btn,
body.hms-executive-ui.role-pharmacy .phx-btn {
  padding: 6px 10px !important;
  min-height: 32px;
  gap: 5px !important;
}

body.hms-executive-ui.role-reception .phx-grid,
body.hms-executive-ui.role-reception .cm-grid,
body.hms-executive-ui.role-reception .mt-grid,
body.hms-executive-ui.role-doctor .phx-grid,
body.hms-executive-ui.role-doctor .cm-grid,
body.hms-executive-ui.role-doctor .mt-grid,
body.hms-executive-ui.role-pharmacy .phx-grid,
body.hms-executive-ui.role-pharmacy .cm-grid,
body.hms-executive-ui.role-pharmacy .mt-grid { gap: 8px !important; }

body.hms-executive-ui.role-reception .section-title,
body.hms-executive-ui.role-reception .sec-panel-hd,
body.hms-executive-ui.role-reception .phx-headline-row,
body.hms-executive-ui.role-doctor .section-title,
body.hms-executive-ui.role-doctor .sec-panel-hd,
body.hms-executive-ui.role-doctor .phx-headline-row,
body.hms-executive-ui.role-pharmacy .section-title,
body.hms-executive-ui.role-pharmacy .sec-panel-hd,
body.hms-executive-ui.role-pharmacy .phx-headline-row {
  margin-bottom: 7px !important;
  gap: 7px !important;
}
body.hms-executive-ui.role-reception hr,
body.hms-executive-ui.role-doctor hr,
body.hms-executive-ui.role-pharmacy hr { margin: 7px 0 !important; }

@media (max-width: 640px) {
  body.hms-executive-ui.role-reception .global-shell-search .meta,
  body.hms-executive-ui.role-doctor .global-shell-search .meta,
  body.hms-executive-ui.role-pharmacy .global-shell-search .meta { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL OPERATIONAL DENSITY + SAFE NAVIGATION STACKING
   Removes the oversized outer gaps across every authenticated screen.
   The global patient bar remains sticky; module bars stay in normal flow
   so they cannot create stacked sticky offsets or cover page controls.
   ═══════════════════════════════════════════════════════════════ */
body.hms-executive-ui {
  --hms-workspace-gutter: 10px;
}
body.hms-executive-ui .global-shell-bar {
  padding: 5px 8px !important;
  margin-bottom: 4px !important;
}
body.hms-executive-ui .global-shell-search {
  width: calc(100% - 16px) !important;
  gap: 8px !important;
}
body.hms-executive-ui .global-shell-search .meta { gap: 0 !important; }
body.hms-executive-ui .global-shell-search .hint { display: none !important; }
body.hms-executive-ui .global-shell-search .search-input,
body.hms-executive-ui .global-shell-search .search-btn,
body.hms-executive-ui .global-shell-action {
  height: 34px !important;
  min-height: 34px !important;
}
body.hms-executive-ui .shell {
  margin: 6px auto 18px !important;
  padding: 10px 12px 16px !important;
  border-radius: 18px !important;
}
body.hms-executive-ui .topbar,
body.hms-executive-ui .rx-topbar,
body.hms-executive-ui .topbar.topbar-sticky,
body.hms-executive-ui .rx-topbar.rx-sticky {
  position: relative !important;
  top: auto !important;
  z-index: 30 !important;
  gap: 5px !important;
  padding: 6px 9px !important;
  border-radius: 14px !important;
}
body.hms-executive-ui .subbar,
body.hms-executive-ui .rx-subbar {
  margin-top: 6px !important;
  padding: 6px 8px !important;
  border-radius: 12px !important;
}
body.hms-executive-ui .tabs,
body.hms-executive-ui .rx-tabs,
body.hms-executive-ui .phx-tabs,
body.hms-executive-ui .rx-subtabs { gap: 4px !important; }
body.hms-executive-ui .tab,
body.hms-executive-ui .rx-tab,
body.hms-executive-ui .phx-tab,
body.hms-executive-ui .rx-subtab {
  min-height: 32px !important;
  padding: 5px 9px !important;
  border-radius: 9px !important;
  font-size: 12px !important;
}
body.hms-executive-ui .pillbar,
body.hms-executive-ui .right,
body.hms-executive-ui .rx-right { gap: 5px !important; }
body.hms-executive-ui .pillbar .pill,
body.hms-executive-ui .rx-pill {
  min-height: 30px !important;
  padding: 5px 8px !important;
}
body.hms-executive-ui .card,
body.hms-executive-ui .phx-card,
body.hms-executive-ui .section-box,
body.hms-executive-ui .sec-panel,
body.hms-executive-ui .tablePanel {
  border-radius: 14px !important;
}
body.hms-executive-ui .section,
body.hms-executive-ui .phx-section { margin-top: 10px !important; }
body.hms-executive-ui hr { margin: 8px 0 !important; }

@media (max-width: 640px) {
  body.hms-executive-ui .global-shell-search .meta { display: none !important; }
  body.hms-executive-ui .shell {
    width: calc(100% - 10px) !important;
    margin: 4px auto 12px !important;
    padding: 8px !important;
    border-radius: 14px !important;
  }
  body.hms-executive-ui .global-shell-search { width: 100% !important; }
}


/* ═══════════════════════════════════════════════════════════════
   APPLICATION-WIDE COMPACT FIELD RHYTHM + PHONE DATA QUALITY
   Reduces empty gaps without changing business flow or form ownership.
   Phone highlighting is presentation-only; no stored value is changed.
   ═══════════════════════════════════════════════════════════════ */
body.hms-executive-ui {
  --hms-field-gap: 7px;
  --hms-field-row-gap: 6px;
  --hms-section-gap: 9px;
}
body.hms-executive-ui .phx-grid,
body.hms-executive-ui .rx-grid,
body.hms-executive-ui .form-grid,
body.hms-executive-ui .field-grid,
body.hms-executive-ui .fields-grid,
body.hms-executive-ui .cm-grid,
body.hms-executive-ui .mt-grid,
body.hms-executive-ui .two-col,
body.hms-executive-ui .three-col,
body.hms-executive-ui .four-col {
  gap: var(--hms-field-gap) !important;
}
body.hms-executive-ui .phx-row,
body.hms-executive-ui .rx-row,
body.hms-executive-ui .form-row,
body.hms-executive-ui .field-row,
body.hms-executive-ui .hms-row-actions,
body.hms-executive-ui .actions {
  column-gap: var(--hms-field-gap) !important;
  row-gap: var(--hms-field-row-gap) !important;
}
body.hms-executive-ui .field,
body.hms-executive-ui .form-field,
body.hms-executive-ui .phx-field,
body.hms-executive-ui .rx-field {
  gap: 3px !important;
}
body.hms-executive-ui .filter-bar,
body.hms-executive-ui .filters,
body.hms-executive-ui .phx-filters,
body.hms-executive-ui .rx-filters {
  gap: var(--hms-field-gap) !important;
  padding: 8px 10px !important;
  margin-bottom: var(--hms-section-gap) !important;
}
body.hms-executive-ui .shell input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]),
body.hms-executive-ui .shell select {
  min-height: 34px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}
body.hms-executive-ui .shell textarea {
  padding-top: 7px !important;
  padding-bottom: 7px !important;
}

body.hms-executive-ui .hms-phone-invalid-row:not(.ph-patient-due-row) > td {
  background: #fff7ed !important;
}
body.hms-executive-ui .hms-phone-invalid-row:not(.ph-patient-due-row) > td:first-child {
  box-shadow: inset 4px 0 0 #ea580c;
}
body.hms-executive-ui td.hms-phone-invalid,
body.hms-executive-ui th.hms-phone-invalid,
body.hms-executive-ui [data-hms-phone].hms-phone-invalid {
  position: relative;
  background: #ffedd5 !important;
  color: #9a3412 !important;
  font-weight: 900 !important;
  box-shadow: inset 0 0 0 2px rgba(234,88,12,.52) !important;
}
body.hms-executive-ui input.hms-phone-invalid,
body.hms-executive-ui textarea.hms-phone-invalid,
body.hms-executive-ui .hms-phone-invalid input,
body.hms-executive-ui .hms-phone-invalid textarea {
  border-color: #ea580c !important;
  background: #fff7ed !important;
  box-shadow: 0 0 0 2px rgba(234,88,12,.16) !important;
}
body.hms-executive-ui .hms-phone-warning {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid rgba(194,65,12,.32);
  border-radius: 999px;
  background: #fff;
  color: #c2410c;
  font-size: 9px;
  font-weight: 1000;
  line-height: 1.2;
  white-space: nowrap;
  vertical-align: middle;
}
body.hms-executive-ui .ph-patient-due-row .hms-phone-invalid {
  background: #fed7aa !important;
  box-shadow: inset 0 0 0 2px rgba(234,88,12,.68) !important;
}


/* 2026-08-27: UI color refinement for tables and navigation tabs */
body.hms-executive-ui .shell .table th,
body.hms-executive-ui .shell .phx-table th,
body.hms-executive-ui .shell .rx-table th,
body.hms-executive-ui .shell .med-table th,
body.hms-executive-ui .shell .intel-table th,
body.hms-executive-ui .shell .cm-table th,
body.hms-executive-ui .shell table.dataTable thead th {
  background: linear-gradient(180deg, #f8ead4 0%, #f1dfc1 100%) !important;
  color: #59432f !important;
  border-color: #ddc5a1 !important;
  box-shadow: inset 0 -1px 0 rgba(125, 82, 35, .08) !important;
}
body.hms-executive-ui .shell .table thead tr + tr th,
body.hms-executive-ui .shell .phx-table thead tr + tr th,
body.hms-executive-ui .shell .rx-table thead tr + tr th,
body.hms-executive-ui .shell .med-table thead tr + tr th,
body.hms-executive-ui .shell .cm-table thead tr + tr th {
  background: #fbf3e7 !important;
}
body.hms-executive-ui .shell .tab,
body.hms-executive-ui .shell .rx-tab,
body.hms-executive-ui .shell .rx-subtab,
body.hms-executive-ui .shell .phx-tab {
  background: linear-gradient(180deg, #fffaf3 0%, #f7ead7 100%) !important;
  color: #654823 !important;
  border-color: #ddc29b !important;
  box-shadow: 0 2px 0 rgba(115, 75, 28, .08), inset 0 1px 0 rgba(255,255,255,.86) !important;
}
body.hms-executive-ui .shell .tab:hover,
body.hms-executive-ui .shell .rx-tab:hover,
body.hms-executive-ui .shell .rx-subtab:hover,
body.hms-executive-ui .shell .phx-tab:hover {
  background: linear-gradient(180deg, #fff4e1 0%, #f0d7b0 100%) !important;
  color: #533816 !important;
  border-color: #cfa86f !important;
}
body.hms-executive-ui .shell .tab.active,
body.hms-executive-ui .shell .rx-tab.active,
body.hms-executive-ui .shell .rx-subtab.active,
body.hms-executive-ui .shell .phx-tab.active,
body.hms-executive-ui .shell .tab[aria-current="page"],
body.hms-executive-ui .shell .rx-tab[aria-current="page"],
body.hms-executive-ui .shell .phx-tab[aria-current="page"] {
  background: linear-gradient(180deg, #e9c486 0%, #d9aa62 100%) !important;
  color: #3f2b13 !important;
  border-color: #c7974d !important;
  box-shadow: 0 2px 0 rgba(111, 70, 24, .16), inset 0 1px 0 rgba(255,255,255,.38) !important;
}
