/* AHMIS shared interface components (see static/ux.js). Uses the app's teal/navy palette. */
:root { --ux-teal: #0c8b91; --ux-navy: #14243b; --ux-line: rgba(20, 36, 59, .12); --ux-muted: #5b6b80; }

/* command palette and dialogs */
.ux-palette { position: fixed; inset: 0; z-index: 2000; background: rgba(12, 22, 38, .45); display: flex;
  align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; backdrop-filter: blur(3px); }
.ux-palette[hidden] { display: none; }
.ux-palette-box { width: min(640px, 100%); background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(12, 22, 38, .3);
  padding: 14px; max-height: 76vh; display: flex; flex-direction: column; }
.ux-palette-list { list-style: none; margin: 10px 0 0; padding: 0; overflow-y: auto; }
.ux-palette-list li[role=option] { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px;
  border-radius: 10px; cursor: pointer; }
.ux-palette-list li[aria-selected=true] { background: var(--ux-teal); color: #fff; }
.ux-palette-list li[aria-selected=true] .ux-opt-group { color: #dff6f6; }
.ux-opt-label { font-weight: 600; }
.ux-opt-group { color: var(--ux-muted); font-size: .85em; white-space: nowrap; }
.ux-palette-foot { color: var(--ux-muted); font-size: .8rem; padding: 10px 4px 0; border-top: 1px solid var(--ux-line); margin-top: 8px; }
.ux-empty { color: var(--ux-muted); padding: 12px; list-style: none; }
.ux-help dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 12px 0 16px; }
.ux-help dt { font-family: ui-monospace, monospace; background: #eef3f8; border-radius: 6px; padding: 2px 8px; }
.ux-help dd { margin: 0; }
body.ux-modal-open { overflow: hidden; }
.ux-palette-trigger { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.ux-palette-trigger kbd { white-space: nowrap; background: #eef3f8; color: var(--ux-navy); border-radius: 5px; padding: 1px 6px; font-size: .75rem; }

/* skeleton placeholders: same height as a result row, so nothing jumps when results arrive */
.ux-skeleton { list-style: none; height: 42px; margin: 4px 0; border-radius: 10px;
  background: linear-gradient(90deg, #edf1f6 25%, #f7f9fc 50%, #edf1f6 75%); background-size: 200% 100%;
  animation: ux-shimmer 1.2s infinite linear; }
@keyframes ux-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .ux-skeleton { animation: none; } }

/* live search suggestions */
.ux-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1500; list-style: none; margin: 0; padding: 6px;
  background: #fff; border-radius: 14px; box-shadow: 0 14px 40px rgba(12, 22, 38, .2); max-width: 520px; }
.ux-suggest[hidden] { display: none; }
.ux-suggest a { display: flex; gap: 8px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ux-navy); }
.ux-suggest a:hover, .ux-suggest a:focus { background: #e9f6f6; outline: none; }
.ux-suggest span { color: var(--ux-muted); }

/* toasts and offline banner */
.ux-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 2100; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.ux-toast { background: var(--ux-navy); color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); transition: opacity .4s; }
.ux-toast-ok { background: #13795b; } .ux-toast-warn { background: #9a6700; } .ux-toast-err { background: #b42318; }
.ux-hide { opacity: 0; }
.ux-offline { position: fixed; left: 50%; transform: translateX(-50%); top: 12px; z-index: 2200; background: #9a6700; color: #fff;
  padding: 10px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); max-width: calc(100vw - 32px); text-align: center; }
.ux-offline.ux-online { background: #13795b; }
.ux-offline[hidden] { display: none; }

/* forms */
.ux-save-status { color: var(--ux-muted); margin-left: 10px; }
.ux-busy { opacity: .65; cursor: progress; pointer-events: none; }
.ux-busy::after { content: " …"; }

/* smart tables */
.ux-table-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.ux-table-bar input[type=search] { max-width: 260px; }
.ux-cols { position: relative; }
.ux-cols summary { list-style: none; }
.ux-cols summary::-webkit-details-marker { display: none; }
.ux-cols-panel { position: absolute; z-index: 1200; top: calc(100% + 4px); right: 0; background: #fff; border-radius: 12px; padding: 10px 14px;
  box-shadow: 0 14px 40px rgba(12, 22, 38, .2); min-width: 200px; display: flex; flex-direction: column; gap: 4px; }
.ux-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.ux-sortable::after { content: " ↕"; color: #a3b0c0; font-size: .8em; }
.ux-sortable[aria-sort=ascending]::after { content: " ↑"; color: var(--ux-teal); }
.ux-sortable[aria-sort=descending]::after { content: " ↓"; color: var(--ux-teal); }
.ux-sel { width: 34px; }
.ux-done { opacity: .55; }
@media print { .ux-print-hide, .ux-sel, .ux-table-bar { display: none !important; } }

/* error pages */
.error-page { text-align: center; max-width: 620px; margin: 6vh auto; padding: 32px 20px; background: rgba(255, 255, 255, .8);
  border-radius: 24px; box-shadow: 0 18px 50px rgba(12, 22, 38, .12); }
.error-code { font-size: clamp(56px, 12vw, 104px); font-weight: 900; line-height: 1; color: var(--ux-teal); letter-spacing: -2px; }

/* visible keyboard focus everywhere (WCAG 2.2 focus indicators) */
:focus-visible { outline: 3px solid #f2b01e !important; outline-offset: 2px; }

/* phones: palette full width near the top, bigger touch targets */
@media (max-width: 576px) {
  .ux-palette { padding-top: 12px; }
  .ux-palette-list li[role=option] { padding: 14px 12px; }
  .ux-table-bar input[type=search] { max-width: none; flex: 1 1 100%; }
}

/* ---------- Legible scrollbars ----------
   Wide, high-contrast and always visible (styled scrollbars do not auto-hide on macOS/iOS either).
   Page and panels: teal handle on a light track. Dark sidebar: bright handle on a dark track. */
html { scrollbar-width: auto; scrollbar-color: #0c8b91 #dbe3ec; overflow-y: scroll; }
* { scrollbar-width: auto; scrollbar-color: #0c8b91 #dbe3ec; }
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: #dbe3ec; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #0c8b91; border-radius: 10px; border: 3px solid #dbe3ec; min-height: 48px; }
::-webkit-scrollbar-thumb:hover { background: #086d72; }
::-webkit-scrollbar-thumb:active { background: #14243b; }
::-webkit-scrollbar-corner { background: #dbe3ec; }

.sidebar nav, .sidebar { scrollbar-width: auto !important; scrollbar-color: #7fe0e3 #0f1d30 !important; }
.sidebar nav::-webkit-scrollbar, .sidebar::-webkit-scrollbar { width: 14px; }
.sidebar nav::-webkit-scrollbar-track, .sidebar::-webkit-scrollbar-track { background: #0f1d30; border-radius: 10px; }
.sidebar nav::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb { background: #7fe0e3; border: 3px solid #0f1d30; border-radius: 10px; min-height: 48px; }
.sidebar nav::-webkit-scrollbar-thumb:hover, .sidebar::-webkit-scrollbar-thumb:hover { background: #b6f0f1; }
.sidebar nav { padding-right: 6px !important; }

@media (forced-colors: active) { * { scrollbar-color: auto; } }

/* ---------- Legible pricing figures ----------
   style.css greys every <span> in .plan-price, which also caught the amount itself. */
.plan-price .amt { color: #14243b !important; font-weight: 900; font-size: 44px; line-height: 1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums lining-nums; }
.plan-price .cur { color: #0c6f74 !important; font-weight: 800; font-size: 22px; }
.plan-price > span { color: #2f3f55 !important; font-weight: 600; font-size: 16px; }
/* dark public pricing and landing pages */
.spatial-public .plan-price .amt { color: #ffffff !important; font-size: 54px; text-shadow: 0 2px 14px rgba(0, 0, 0, .35); }
.spatial-public .plan-price .cur { color: #8ff0e6 !important; font-size: 24px; }
.spatial-public .plan-price > span { color: #e3f6f4 !important; font-size: 17px; }
@media (max-width: 576px) { .spatial-public .plan-price .amt { font-size: 46px; } .plan-price .amt { font-size: 38px; } }

/* ---- Facility logo and banner (Facility settings → Logo and banner) ---- */
img.brand-logo{object-fit:contain;background:#fff;padding:3px;box-shadow:0 6px 14px -6px rgba(0,0,0,.45)}
img.welcome-logo{object-fit:contain;background:#fff!important;padding:6px;border-radius:18px!important}
.welcome-banner.has-banner,.spatial-app .welcome-banner.has-banner{
  min-height:190px;background-color:#0f2a47;
  background-image:linear-gradient(90deg,rgba(10,30,52,.9) 0%,rgba(10,30,52,.72) 42%,rgba(10,30,52,.18) 75%,rgba(10,30,52,.05) 100%),var(--banner);
  background-size:cover;background-position:center}
.spatial-app .welcome-banner.has-banner::after{background:radial-gradient(90% 90% at 8% -10%,rgba(255,255,255,.14),transparent 55%)}
.welcome-banner.has-banner .welcome-text,.welcome-banner.has-banner .welcome-meta{text-shadow:0 1px 3px rgba(0,0,0,.55)}
.welcome-banner.has-banner .welcome-meta{background:rgba(10,30,52,.45);padding:10px 14px;border-radius:14px;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.branding-grid{display:grid;grid-template-columns:minmax(220px,1fr) minmax(320px,2fr);gap:22px}
.branding-item{display:flex;flex-direction:column;gap:10px}
.branding-preview{border:2px dashed #b9c6d6;border-radius:16px;background:repeating-conic-gradient(#eef2f7 0 25%,#fff 0 50%) 0 0/16px 16px;
  display:grid;place-items:center;overflow:hidden;color:#4b5a6e;font-size:13px;text-align:center;padding:10px}
.branding-logo{height:150px}.branding-logo img{max-width:130px;max-height:130px;object-fit:contain}
.branding-banner{height:150px;padding:0}.branding-banner img{width:100%;height:100%;object-fit:cover}
.branding-preview span{padding:0 14px}
@media(max-width:820px){.branding-grid{grid-template-columns:1fr}}
@media print{.welcome-banner.has-banner{background-image:none!important}}
/* the welcome banner is always dark (colour or picture), so its heading stays white */
.spatial-app .content .welcome-banner h2,.welcome-banner h2{color:#fff}
