/*
 * HMS Compact Interactive UI
 * Scope: shell-rendered operational screens only.
 * Safety contract:
 * - presentation only; no DOM ownership, form, event, permission, or data changes
 * - no generic overflow clipping
 * - no transform/filter on structural containers
 * - print output is intentionally untouched
 */

@media screen {
  body.hms-executive-ui.hms-ui-density-compact {
    --hms-workspace-max: 1440px;
    --hms-density-gutter: 8px;
    --hms-density-1: 4px;
    --hms-density-2: 6px;
    --hms-density-3: 8px;
    --hms-density-4: 10px;
    --hms-density-control: 32px;
    --hms-density-radius: 10px;
    --hms-density-card-radius: 13px;
    --hms-ui-transition: 150ms cubic-bezier(.2,.7,.2,1);
    --hms-ui-hover-shadow: 0 8px 20px rgba(61,48,30,.10);
    --hms-ui-press-shadow: 0 2px 6px rgba(61,48,30,.08);
  }

  body.hms-executive-ui.hms-ui-density-compact.layout-wide {
    --hms-workspace-max: 1600px;
  }

  body.hms-executive-ui.hms-ui-density-compact.layout-fluid {
    --hms-workspace-max: none;
  }

  /* Global shell: compact without creating a transformed stacking context. */
  body.hms-executive-ui.hms-ui-density-compact .global-shell-bar {
    padding: 4px 8px !important;
    margin-bottom: 3px !important;
    background: rgba(255,255,255,.985) !important;
    border-bottom-color: var(--hms-border) !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.hms-ui-density-compact .global-shell-search {
    width: calc(100% - 12px) !important;
    max-width: var(--hms-workspace-max) !important;
    gap: 6px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .global-shell-search .meta {
    min-width: 96px !important;
    gap: 0 !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .global-shell-search .label {
    font-size: 10px !important;
    letter-spacing: .055em !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .global-shell-search .search-wrap {
    max-width: 640px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .global-shell-search .search-row,
  body.hms-executive-ui.hms-ui-density-compact .global-shell-actions {
    gap: 5px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .global-shell-search .search-input,
  body.hms-executive-ui.hms-ui-density-compact .global-shell-search .search-btn,
  body.hms-executive-ui.hms-ui-density-compact .global-shell-action {
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 9px !important;
    border-radius: 8px !important;
    font-size: 11.5px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .global-shell-results {
    top: 36px !important;
    border-radius: 10px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .global-shell-option {
    padding: 7px 9px !important;
    transition: background-color var(--hms-ui-transition), color var(--hms-ui-transition) !important;
  }

  /* Workspace: more useful width and less empty framing. */
  body.hms-executive-ui.hms-ui-density-compact .shell {
    width: calc(100% - (var(--hms-density-gutter) * 2)) !important;
    max-width: var(--hms-workspace-max) !important;
    margin: 4px auto 14px !important;
    padding: 8px 10px 12px !important;
    border-radius: 15px !important;
    transform: none !important;
    filter: none !important;
  }

  /* Module navigation: one compact rhythm across all roles. */
  body.hms-executive-ui.hms-ui-density-compact .shell .topbar,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-topbar,
  body.hms-executive-ui.hms-ui-density-compact .shell .subbar,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-subbar,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-tabs {
    gap: 4px !important;
    padding: 5px 7px !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(61,48,30,.05) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .subbar,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-subbar {
    margin-top: 5px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .tabs,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-tabs,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-subtabs,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-tabs,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-row,
  body.hms-executive-ui.hms-ui-density-compact .shell .pillbar,
  body.hms-executive-ui.hms-ui-density-compact .shell .right,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-right {
    gap: 4px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .tab,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-tab,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-subtab,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-tab {
    min-height: 30px !important;
    padding: 4px 8px !important;
    border-radius: 8px !important;
    font-size: 11.75px !important;
    line-height: 1.15 !important;
    transition: color var(--hms-ui-transition), background-color var(--hms-ui-transition), border-color var(--hms-ui-transition), box-shadow var(--hms-ui-transition), transform var(--hms-ui-transition) !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .hms-module-brand,
  body.hms-executive-ui.hms-ui-density-compact .shell .brand,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-brand {
    font-size: 10.75px !important;
    letter-spacing: .075em !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .pillbar .pill,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-pill,
  body.hms-executive-ui.hms-ui-density-compact .shell .hms-user-pill {
    min-height: 28px !important;
    padding: 4px 7px !important;
    border-radius: 8px !important;
    font-size: 11.5px !important;
  }

  /* Cards, sections and dashboard blocks. Static cards do not move. */
  body.hms-executive-ui.hms-ui-density-compact .shell .card,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-card,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-wrap,
  body.hms-executive-ui.hms-ui-density-compact .shell .section-box,
  body.hms-executive-ui.hms-ui-density-compact .shell .sec-panel,
  body.hms-executive-ui.hms-ui-density-compact .shell .tablePanel,
  body.hms-executive-ui.hms-ui-density-compact .shell .cm-card,
  body.hms-executive-ui.hms-ui-density-compact .shell .panel {
    padding: 9px 10px !important;
    border-radius: var(--hms-density-card-radius) !important;
    box-shadow: 0 2px 8px rgba(61,48,30,.045) !important;
    transform: none !important;
    filter: none !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .card .card,
  body.hms-executive-ui.hms-ui-density-compact .shell .card .phx-card,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-card .phx-card,
  body.hms-executive-ui.hms-ui-density-compact .shell .section-box .card,
  body.hms-executive-ui.hms-ui-density-compact .shell .sec-panel .card,
  body.hms-executive-ui.hms-ui-density-compact .shell .tablePanel .card {
    padding: 7px 8px !important;
    border-radius: 10px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .kpi,
  body.hms-executive-ui.hms-ui-density-compact .shell .kpiCard,
  body.hms-executive-ui.hms-ui-density-compact .shell .metric,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-kpi,
  body.hms-executive-ui.hms-ui-density-compact .shell .pfr-kpi {
    padding: 8px 9px !important;
    border-radius: 11px !important;
    min-height: 0 !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .section,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-section {
    margin-top: 8px !important;
    padding-top: 8px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .section-title,
  body.hms-executive-ui.hms-ui-density-compact .shell .sec-panel-hd,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-headline-row,
  body.hms-executive-ui.hms-ui-density-compact .shell .panelTitle,
  body.hms-executive-ui.hms-ui-density-compact .shell .card-title {
    margin-top: 0 !important;
    margin-bottom: 6px !important;
    gap: 6px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell h1,
  body.hms-executive-ui.hms-ui-density-compact .shell h2,
  body.hms-executive-ui.hms-ui-density-compact .shell h3,
  body.hms-executive-ui.hms-ui-density-compact .shell h4 {
    line-height: 1.2 !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell h1 { margin: 0 0 7px !important; }
  body.hms-executive-ui.hms-ui-density-compact .shell h2 { margin: 0 0 6px !important; }
  body.hms-executive-ui.hms-ui-density-compact .shell h3,
  body.hms-executive-ui.hms-ui-density-compact .shell h4 { margin: 0 0 5px !important; }

  body.hms-executive-ui.hms-ui-density-compact .shell hr,
  body.hms-executive-ui.hms-ui-density-compact .shell hr.sep {
    margin: 6px 0 !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .grid,
  body.hms-executive-ui.hms-ui-density-compact .shell .grid2,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-grid,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-grid,
  body.hms-executive-ui.hms-ui-density-compact .shell .form-grid,
  body.hms-executive-ui.hms-ui-density-compact .shell .field-grid,
  body.hms-executive-ui.hms-ui-density-compact .shell .fields-grid,
  body.hms-executive-ui.hms-ui-density-compact .shell .cm-grid,
  body.hms-executive-ui.hms-ui-density-compact .shell .mt-grid,
  body.hms-executive-ui.hms-ui-density-compact .shell .two-col,
  body.hms-executive-ui.hms-ui-density-compact .shell .three-col,
  body.hms-executive-ui.hms-ui-density-compact .shell .four-col,
  body.hms-executive-ui.hms-ui-density-compact .shell .row,
  body.hms-executive-ui.hms-ui-density-compact .shell .actions {
    gap: 7px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .filter-bar,
  body.hms-executive-ui.hms-ui-density-compact .shell .filters,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-filters,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-filters {
    gap: 6px !important;
    padding: 7px 8px !important;
    margin-bottom: 7px !important;
    border-radius: 10px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .alert,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-alert {
    margin: 5px 0 !important;
    padding: 7px 9px !important;
    border-radius: 9px !important;
    font-size: 12px !important;
  }

  /* Form density. File inputs, toggles and hidden inputs retain native behavior. */
  body.hms-executive-ui.hms-ui-density-compact .shell .field,
  body.hms-executive-ui.hms-ui-density-compact .shell .form-field,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-field,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-field {
    gap: 3px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .field > label,
  body.hms-executive-ui.hms-ui-density-compact .shell .form-field > label,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-field > label,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-field > label,
  body.hms-executive-ui.hms-ui-density-compact .shell .small-label,
  body.hms-executive-ui.hms-ui-density-compact .shell .form-label,
  body.hms-executive-ui.hms-ui-density-compact .shell .field > span:first-child {
    font-size: 10.5px !important;
    line-height: 1.25 !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]),
  body.hms-executive-ui.hms-ui-density-compact .shell select {
    min-height: var(--hms-density-control) !important;
    height: var(--hms-density-control) !important;
    padding: 5px 8px !important;
    border-radius: 8px !important;
    font-size: 12.5px !important;
    line-height: 1.25 !important;
    transition: border-color var(--hms-ui-transition), box-shadow var(--hms-ui-transition), background-color var(--hms-ui-transition) !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell textarea {
    min-height: 58px !important;
    padding: 6px 8px !important;
    border-radius: 8px !important;
    font-size: 12.5px !important;
    line-height: 1.35 !important;
    transition: border-color var(--hms-ui-transition), box-shadow var(--hms-ui-transition), background-color var(--hms-ui-transition) !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell input[type=checkbox],
  body.hms-executive-ui.hms-ui-density-compact .shell input[type=radio] {
    width: 15px !important;
    height: 15px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .field:focus-within > label,
  body.hms-executive-ui.hms-ui-density-compact .shell .form-field:focus-within > label,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-field:focus-within > label,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-field:focus-within > label {
    color: var(--hms-primary-dark) !important;
  }

  /* Buttons and controls: clear before hover, tactile on hover/press. */
  body.hms-executive-ui.hms-ui-density-compact .shell .btn,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-btn,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-btn,
  body.hms-executive-ui.hms-ui-density-compact .shell .lx-btn,
  body.hms-executive-ui.hms-ui-density-compact .shell .audit-btn,
  body.hms-executive-ui.hms-ui-density-compact .shell .saveBtn,
  body.hms-executive-ui.hms-ui-density-compact .shell .secondary,
  body.hms-executive-ui.hms-ui-density-compact .shell .icon-btn {
    min-height: 30px !important;
    padding: 4px 9px !important;
    border-radius: 8px !important;
    gap: 5px !important;
    font-size: 11.75px !important;
    line-height: 1.15 !important;
    transition: color var(--hms-ui-transition), background-color var(--hms-ui-transition), border-color var(--hms-ui-transition), box-shadow var(--hms-ui-transition), transform var(--hms-ui-transition) !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell table .btn,
  body.hms-executive-ui.hms-ui-density-compact .shell table .phx-btn,
  body.hms-executive-ui.hms-ui-density-compact .shell table .rx-btn,
  body.hms-executive-ui.hms-ui-density-compact .shell table .lx-btn,
  body.hms-executive-ui.hms-ui-density-compact .shell table .icon-btn {
    min-height: 27px !important;
    padding: 3px 7px !important;
    font-size: 11px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell button:disabled,
  body.hms-executive-ui.hms-ui-density-compact .shell .btn.is-disabled,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-btn.is-disabled,
  body.hms-executive-ui.hms-ui-density-compact .shell [aria-disabled=true] {
    transform: none !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
  }

  /* Compact data tables without forcing a new table layout algorithm. */
  body.hms-executive-ui.hms-ui-density-compact .shell .table-wrap,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-table-wrap,
  body.hms-executive-ui.hms-ui-density-compact .shell .table-scroll,
  body.hms-executive-ui.hms-ui-density-compact .shell .med-scroll,
  body.hms-executive-ui.hms-ui-density-compact .shell [data-table-scroll] {
    max-width: 100% !important;
    overflow-x: auto !important;
    border-radius: 9px !important;
    scrollbar-width: thin;
    scrollbar-color: var(--hms-border-strong) transparent;
    overscroll-behavior-inline: contain;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .table-wrap::-webkit-scrollbar,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-table-wrap::-webkit-scrollbar,
  body.hms-executive-ui.hms-ui-density-compact .shell .table-scroll::-webkit-scrollbar,
  body.hms-executive-ui.hms-ui-density-compact .shell .med-scroll::-webkit-scrollbar,
  body.hms-executive-ui.hms-ui-density-compact .shell [data-table-scroll]::-webkit-scrollbar {
    width: 7px;
    height: 7px;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .table-wrap::-webkit-scrollbar-thumb,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-table-wrap::-webkit-scrollbar-thumb,
  body.hms-executive-ui.hms-ui-density-compact .shell .table-scroll::-webkit-scrollbar-thumb,
  body.hms-executive-ui.hms-ui-density-compact .shell .med-scroll::-webkit-scrollbar-thumb,
  body.hms-executive-ui.hms-ui-density-compact .shell [data-table-scroll]::-webkit-scrollbar-thumb {
    background: var(--hms-border-strong);
    border-radius: 999px;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .table td,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-table td,
  body.hms-executive-ui.hms-ui-density-compact .shell .med-table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .med-table td,
  body.hms-executive-ui.hms-ui-density-compact .shell .cm-table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .cm-table td,
  body.hms-executive-ui.hms-ui-density-compact .shell .tablex th,
  body.hms-executive-ui.hms-ui-density-compact .shell .tablex td,
  body.hms-executive-ui.hms-ui-density-compact .shell .pfr-table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .pfr-table td,
  body.hms-executive-ui.hms-ui-density-compact .shell .lifecycle-table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .lifecycle-table td,
  body.hms-executive-ui.hms-ui-density-compact .shell .approval-table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .approval-table td,
  body.hms-executive-ui.hms-ui-density-compact .shell .audit-table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .audit-table td,
  body.hms-executive-ui.hms-ui-density-compact .shell .detail-table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .detail-table td,
  body.hms-executive-ui.hms-ui-density-compact .shell .hr-board-table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .hr-board-table td {
    padding: 5px 7px !important;
    font-size: 12.25px !important;
    line-height: 1.28 !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .med-table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .cm-table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .tablex th,
  body.hms-executive-ui.hms-ui-density-compact .shell .pfr-table th {
    font-size: 10.75px !important;
    line-height: 1.2 !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell table tbody tr > td {
    transition: background-color var(--hms-ui-transition), box-shadow var(--hms-ui-transition) !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell table td,
  body.hms-executive-ui.hms-ui-density-compact .shell table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .value,
  body.hms-executive-ui.hms-ui-density-compact .shell .metric-value,
  body.hms-executive-ui.hms-ui-density-compact .shell .kpiValue {
    font-variant-numeric: tabular-nums;
  }

  /* Badges and status chips remain legible while using less space. */
  body.hms-executive-ui.hms-ui-density-compact .shell .badge,
  body.hms-executive-ui.hms-ui-density-compact .shell .pill,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-badge,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-pill,
  body.hms-executive-ui.hms-ui-density-compact .shell .s-pill,
  body.hms-executive-ui.hms-ui-density-compact .shell .th-chip,
  body.hms-executive-ui.hms-ui-density-compact .shell .day-badge {
    padding: 2px 6px !important;
    border-radius: 7px !important;
    font-size: 10.5px !important;
    line-height: 1.2 !important;
    gap: 3px !important;
    transition: border-color var(--hms-ui-transition), background-color var(--hms-ui-transition), color var(--hms-ui-transition) !important;
  }

  /* Modal content is denser; positioning, focus, ownership and visibility are untouched. */
  body.hms-executive-ui.hms-ui-density-compact .modal-box,
  body.hms-executive-ui.hms-ui-density-compact .cm-box,
  body.hms-executive-ui.hms-ui-density-compact .modal .box,
  body.hms-executive-ui.hms-ui-density-compact [role=dialog] .card {
    padding: 11px 12px !important;
    border-radius: 14px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .modal-box h2,
  body.hms-executive-ui.hms-ui-density-compact .modal-box h3,
  body.hms-executive-ui.hms-ui-density-compact .cm-box h2,
  body.hms-executive-ui.hms-ui-density-compact .cm-box h3 {
    margin-bottom: 6px !important;
  }

  /* Interactive affordances apply only to actual controls/clickable containers. */
  body.hms-executive-ui.hms-ui-density-compact .shell a.card,
  body.hms-executive-ui.hms-ui-density-compact .shell button.card,
  body.hms-executive-ui.hms-ui-density-compact .shell .card[onclick],
  body.hms-executive-ui.hms-ui-density-compact .shell .card[role=button],
  body.hms-executive-ui.hms-ui-density-compact .shell a.kpiCard,
  body.hms-executive-ui.hms-ui-density-compact .shell button.kpiCard,
  body.hms-executive-ui.hms-ui-density-compact .shell .kpiCard[onclick],
  body.hms-executive-ui.hms-ui-density-compact .shell .kpiLink {
    cursor: pointer !important;
    transition: border-color var(--hms-ui-transition), background-color var(--hms-ui-transition), box-shadow var(--hms-ui-transition), transform var(--hms-ui-transition) !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell details > summary {
    border-radius: 7px;
    transition: color var(--hms-ui-transition), background-color var(--hms-ui-transition), border-color var(--hms-ui-transition) !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell a:not(.btn):not(.phx-btn):not(.rx-btn):not(.tab):not(.rx-tab):not(.rx-subtab):not(.phx-tab) {
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell :focus-visible,
  body.hms-executive-ui.hms-ui-density-compact .global-shell-bar :focus-visible {
    outline: 2px solid var(--hms-primary) !important;
    outline-offset: 2px !important;
  }
}

@media screen and (hover: hover) and (pointer: fine) {
  body.hms-executive-ui.hms-ui-density-compact .shell .btn:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-btn:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-btn:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .lx-btn:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .audit-btn:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .saveBtn:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .secondary:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .icon-btn:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .tab:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-tab:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-subtab:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-tab:hover,
  body.hms-executive-ui.hms-ui-density-compact .global-shell-action:hover {
    transform: translateY(-1px) !important;
    box-shadow: var(--hms-ui-hover-shadow) !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .btn:active,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-btn:active,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-btn:active,
  body.hms-executive-ui.hms-ui-density-compact .shell .lx-btn:active,
  body.hms-executive-ui.hms-ui-density-compact .shell .audit-btn:active,
  body.hms-executive-ui.hms-ui-density-compact .shell .saveBtn:active,
  body.hms-executive-ui.hms-ui-density-compact .shell .secondary:active,
  body.hms-executive-ui.hms-ui-density-compact .shell .icon-btn:active,
  body.hms-executive-ui.hms-ui-density-compact .shell .tab:active,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-tab:active,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-subtab:active,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-tab:active,
  body.hms-executive-ui.hms-ui-density-compact .global-shell-action:active {
    transform: translateY(1px) !important;
    box-shadow: var(--hms-ui-press-shadow) !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell button:disabled:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .btn.is-disabled:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-btn.is-disabled:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell [aria-disabled=true]:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell a.card:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell button.card:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .card[onclick]:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .card[role=button]:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell a.kpiCard:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell button.kpiCard:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .kpiCard[onclick]:hover,
  body.hms-executive-ui.hms-ui-density-compact .shell .kpiLink:hover {
    transform: translateY(-1px) !important;
    border-color: var(--hms-primary-border) !important;
    background: var(--hms-primary-soft) !important;
    box-shadow: var(--hms-ui-hover-shadow) !important;
  }


  body.hms-executive-ui.hms-ui-density-compact .shell details > summary:hover {
    color: var(--hms-primary-dark) !important;
    background: var(--hms-primary-soft) !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell a:not(.btn):not(.phx-btn):not(.rx-btn):not(.tab):not(.rx-tab):not(.rx-subtab):not(.phx-tab):hover {
    text-decoration: underline;
  }
}

@media screen and (max-width: 880px) {
  body.hms-executive-ui.hms-ui-density-compact {
    --hms-density-gutter: 6px;
  }

  body.hms-executive-ui.hms-ui-density-compact .global-shell-search {
    width: 100% !important;
    gap: 5px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .global-shell-search .meta {
    display: none !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .global-shell-actions {
    width: auto !important;
    margin-left: auto;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell {
    margin: 3px auto 10px !important;
    padding: 7px 8px 10px !important;
    border-radius: 13px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .topbar,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-topbar {
    align-items: flex-start !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .tabs,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-tabs,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-subtabs,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-tabs {
    flex-wrap: wrap !important;
    overflow: visible !important;
  }
}

@media screen and (max-width: 640px) {
  body.hms-executive-ui.hms-ui-density-compact {
    --hms-density-control: 38px;
  }

  body.hms-executive-ui.hms-ui-density-compact .global-shell-bar {
    padding: 4px 5px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .global-shell-search .search-wrap {
    order: 1;
    width: 100% !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .global-shell-actions {
    order: 2;
    width: 100% !important;
    justify-content: flex-end !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .global-shell-search .search-input,
  body.hms-executive-ui.hms-ui-density-compact .global-shell-search .search-btn,
  body.hms-executive-ui.hms-ui-density-compact .global-shell-action,
  body.hms-executive-ui.hms-ui-density-compact .shell .btn,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-btn,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-btn,
  body.hms-executive-ui.hms-ui-density-compact .shell .tab,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-tab,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-subtab,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-tab {
    min-height: 38px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .topbar,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-topbar {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    align-items: stretch !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .hms-module-brand {
    display: none !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .topbar .tabs,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-left,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-tabs,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-tabs,
  body.hms-executive-ui.hms-ui-density-compact .shell .topbar .right,
  body.hms-executive-ui.hms-ui-density-compact .shell .topbar .pillbar,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-right {
    width: 100% !important;
    min-width: 0 !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .topbar .right,
  body.hms-executive-ui.hms-ui-density-compact .shell .topbar .pillbar,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-right,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-top {
    justify-content: flex-end !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .card,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-card,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-wrap,
  body.hms-executive-ui.hms-ui-density-compact .shell .section-box,
  body.hms-executive-ui.hms-ui-density-compact .shell .sec-panel,
  body.hms-executive-ui.hms-ui-density-compact .shell .tablePanel,
  body.hms-executive-ui.hms-ui-density-compact .shell .cm-card,
  body.hms-executive-ui.hms-ui-density-compact .shell .panel {
    padding: 9px !important;
    border-radius: 11px !important;
  }

  body.hms-executive-ui.hms-ui-density-compact .shell .table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .table td,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-table td,
  body.hms-executive-ui.hms-ui-density-compact .shell .med-table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .med-table td,
  body.hms-executive-ui.hms-ui-density-compact .shell .cm-table th,
  body.hms-executive-ui.hms-ui-density-compact .shell .cm-table td {
    padding: 6px 7px !important;
  }
}

@media screen and (prefers-contrast: more) {
  body.hms-executive-ui.hms-ui-density-compact .shell .btn,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-btn,
  body.hms-executive-ui.hms-ui-density-compact .shell .rx-btn,
  body.hms-executive-ui.hms-ui-density-compact .shell input,
  body.hms-executive-ui.hms-ui-density-compact .shell select,
  body.hms-executive-ui.hms-ui-density-compact .shell textarea,
  body.hms-executive-ui.hms-ui-density-compact .shell .card,
  body.hms-executive-ui.hms-ui-density-compact .shell .phx-card {
    border-width: 2px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.hms-executive-ui.hms-ui-density-compact {
    --hms-ui-transition: .01ms linear;
  }

  body.hms-executive-ui.hms-ui-density-compact *,
  body.hms-executive-ui.hms-ui-density-compact *::before,
  body.hms-executive-ui.hms-ui-density-compact *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Release 2026-09-05: depth on controls only; no new overlay stacking ancestors. */
:is(.btn,.phx-btn,.ba-btn):not(:disabled){box-shadow:0 3px 0 rgba(114,86,45,.24),0 6px 13px rgba(67,51,28,.08);transition:transform .13s ease,box-shadow .13s ease,background-color .13s ease}
@media(hover:hover){:is(.btn,.phx-btn,.ba-btn):not(:disabled):hover{transform:translateY(-2px);box-shadow:0 5px 0 rgba(114,86,45,.22),0 9px 17px rgba(67,51,28,.12)}}
:is(.btn,.phx-btn,.ba-btn):not(:disabled):active{transform:translateY(2px);box-shadow:0 1px 0 rgba(114,86,45,.22)}
:is(.btn,.phx-btn,.ba-btn):focus-visible{outline:3px solid #739bc4;outline-offset:3px}
.hms-stock-note{margin-top:4px;font-size:12px;line-height:1.5;color:#586778}
.hms-expiry-soon{color:#c52222!important;font-weight:700;opacity:1!important}
@media(prefers-reduced-motion:reduce){:is(.btn,.phx-btn,.ba-btn){transition:none!important;transform:none!important}}
