/* ==========================================================================
   suPAR Health — shared design-system component library
   ==========================================================================
   Portal chrome (top bar, sidebar, content shell, footer) + the .ds-* data
   components (table, pills, tabs, search, pagination, buttons), stat cards,
   forms, banners, steppers, modal and toast.

   Semantic, un-prefixed class names by design: these are SHARED components,
   reusable across the supar-app interfaces (NOT virogates-specific). Built on
   the repo's design tokens (static/src/input.css @theme -> static/css/output.css).

   First round ships this as a standalone stylesheet linked from the virogates
   base layout. A later round can fold these rules into the Tailwind build with
   @apply (see the design handoff COMPONENTS.md) without changing the markup.
   ========================================================================== */

/* Tokens the components reference that are not in the Tailwind @theme yet.
   --font-mono and --color-supar-* / --color-supargray-* come from output.css. */
:root {
  --font-sans: 'TWKLausanne', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --motion-hover-duration: 120ms;
  --motion-chevron-duration: 180ms;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font-sans);
  color: #3f3f3f;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ----- Layout shell ------------------------------------------------------ */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.container { max-width: 1440px; margin-inline: auto; width: 100%; padding-inline: 16px; }

/* ----- Top bar ----------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 24px 0;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* White-label brand slot — holds the tenant logo image */
.brand-slot {
  display: inline-flex; align-items: center;
  text-decoration: none; line-height: 0; margin-left: 8px;
}
.topbar-logo { display: block; width: 150px; height: auto; }

/* Mobile hamburger — shown <1024px in place of the account cluster */
.topbar-burger {
  display: none; margin-left: auto;
  align-items: center; justify-content: center;
  width: 40px; height: 34px;
  border: 1px solid #e2e2e2; border-radius: 5px;
  background: #fff; color: #3f3f3f; cursor: pointer; font-size: 18px;
}
@media (max-width: 1023.98px) {
  .topbar-right { display: none; }
  .topbar-burger { display: inline-flex; }
}

/* Account selector + dropdown */
.acct { position: relative; }
.acct-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 12px; border: 1px solid transparent;
  background: none; cursor: pointer; font-family: inherit;
  transition: background var(--motion-hover-duration) ease;
}
.acct-trigger:hover { background: rgba(61,62,82,0.07); }
.acct-name { font-size: 14px; font-weight: 500; color: #2b2c3a; }
.acct-badge {
  font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 999px;
  background: rgba(61,62,82,0.10); color: #3d3e52; text-transform: lowercase;
}
.acct-chevron { width: 14px; height: 14px; color: #5b5b66; transition: transform var(--motion-chevron-duration) ease; }
.acct.open .acct-chevron { transform: rotate(180deg); }

.acct-menu {
  position: absolute; top: calc(100% + 8px); right: 0; width: 288px; z-index: 40;
  background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 16px;
  box-shadow: 0 18px 40px -12px rgba(61,62,82,0.28); overflow: hidden;
  opacity: 0; transform: translateY(-6px) scale(0.98); pointer-events: none;
  transition: opacity .18s cubic-bezier(.4,0,.2,1), transform .18s cubic-bezier(.4,0,.2,1);
}
.acct.open .acct-menu { opacity: 1; transform: none; pointer-events: auto; }
.acct-group { padding: 10px 0 4px; }
.acct-group + .acct-group { border-top: 1px solid rgba(0,0,0,0.05); }
.acct-group-label {
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: #b9b9c0; padding: 0 16px 6px;
}
.acct-option { display: flex; align-items: center; gap: 12px; padding: 8px 14px; text-decoration: none; transition: background var(--motion-hover-duration) ease; }
.acct-option:hover { background: #f7f7f7; }
.acct-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; font-weight: 500;
}
.av-blue { background: #dbe7ef; color: #3a6f86; }
.av-purple { background: #e7dcea; color: #6d5770; }
.av-teal { background: #d2e7e4; color: #3f7d75; }
.av-dark { background: #d9dae1; color: #3d3e52; }
.acct-option-main { flex: 1; min-width: 0; text-align: left; }
.acct-option-name { display: block; font-size: 13.5px; font-weight: 500; color: #2b2c3a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-option-sub { display: block; font-size: 12px; color: #b9b9c0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-dot { width: 7px; height: 7px; border-radius: 50%; background: #9a9aa3; flex-shrink: 0; }

.topbar-divider { width: 1px; height: 18px; background: rgba(61,62,82,0.20); margin: 0 6px; }
.logout {
  display: inline-flex; align-items: center; gap: 8px; background: none; border: none;
  cursor: pointer; font-family: inherit; font-size: 13px; color: #3f3f3f; padding: 6px 8px;
}
.logout:hover { color: #2b2c3a; }

/* ----- Shell: sidebar + content ----------------------------------------- */
.shell { display: flex; gap: 24px; align-items: stretch; padding-bottom: 0; }

/* ----- Footer (mirrors the clinic page-footer) -------------------------- */
.page-footer { margin-top: 20px; padding-bottom: 48px; }
.page-footer-inner { background: #fff; border-radius: 8px; padding: 32px; }
.page-footer-logo { width: 10rem; height: auto; display: block; }
.page-footer-address { padding-top: 24px; font-size: 14px; line-height: 1.5; color: #3f3f3f; font-weight: 200; }
.page-footer-address a { color: #000; text-decoration: none; }
.page-footer-address a:hover { text-decoration: underline; }
.page-footer-legal { padding-top: 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.page-footer-copyright { font-size: 12px; color: #808080; }
.page-footer-links { display: flex; flex-direction: row; font-size: 12px; gap: 20px; }
.page-footer-links a { color: #000; text-decoration: none; }
.page-footer-links a:hover { text-decoration: underline; }
@media (min-width: 1024px) { .page-footer-legal { flex-direction: row; } }

/* Sidebar — mirrors the clinic .menu behaviour exactly:
     <1024px   off-canvas drawer, hidden until the topbar burger toggles it
     1024–1279 collapsed 64px icon-only rail
     ≥1280px   full 280px rail with text labels                              */
.sidebar {
  display: none;
  flex-direction: column;
  background: #fff;
  flex-shrink: 0;
}
.sidebar.is-open {
  display: flex;
  position: fixed;
  z-index: 60;
  inset: 0 0 0 auto;
  width: 21rem;
  padding: 16px;
  border-radius: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 12px 32px rgba(61,62,82,0.16);
  overflow-y: auto;
}
@media (min-width: 1024px) {
  .sidebar {
    display: flex;
    position: relative;
    inset: auto;
    width: 64px;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(61,62,82,0.04), 0 4px 12px rgba(61,62,82,0.04);
  }
}
@media (min-width: 1280px) {
  .sidebar { width: 280px; }
}

.sidebar nav { display: flex; flex-direction: column; }

/* Mobile-only chrome inside the drawer */
.sidebar-mobile-head { display: flex; justify-content: flex-end; padding-bottom: 24px; }
.sidebar-mobile-close { background: none; border: 0; cursor: pointer; color: #3f3f3f; font-size: 18px; padding: 0; }
.sidebar-mobile-foot { margin-top: auto; padding-top: 16px; text-align: right; }
.sidebar-mobile-logout { background: none; border: 0; padding: 0; color: #3f3f3f; font: inherit; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
@media (min-width: 1024px) { .sidebar-mobile-head, .sidebar-mobile-foot { display: none; } }

.navitem {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  border-radius: 7px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: -0.35px;
  color: #3f3f3f;
  text-decoration: none;
  transition: background var(--motion-hover-duration) ease;
}
.navitem i { width: 24px; text-align: center; font-size: 14px; color: inherit; }
.navitem:hover { background: var(--color-supargray-50, #f7f7f7); }
.navitem.current, .navitem.current:hover { background: var(--color-supar-beige); font-weight: 500; }
.navdivide { height: 1px; background: var(--color-supar-beige); margin: 10px 6px; }

/* lg rail: icon-only 40×40 squares (matches clinic collapsed rail) */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .sidebar { padding: 8px; }
  .navitem {
    justify-content: center;
    width: 40px; height: 40px;
    padding: 0; margin: 0 auto; gap: 0;
  }
  .navitem i { width: auto; }
  .navitem span { display: none; }
  .navdivide { width: 32px; margin: 4px auto; }
}

/* Off-canvas backdrop (mobile only) */
.menu-backdrop { position: fixed; inset: 0; background: rgba(17,24,39,0.5); z-index: 50; }
.menu-backdrop.hidden { display: none; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card-page { background: #fff; border-radius: 12px; padding: 32px; flex: 1; }

/* Page header */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 28px; flex-wrap: wrap; }
.page-titlewrap { display: flex; align-items: baseline; gap: 10px; }
.page-title { font-size: 24px; font-weight: 200; letter-spacing: -0.6px; color: #3f3f3f; margin: 0; }
.page-kicker { font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: #808080; }
.page-count { font-size: 12px; font-weight: 200; color: #bfbfbf; }
.page-head-actions { display: flex; align-items: center; gap: 10px; }
.section-title { font-size: 15px; font-weight: 500; letter-spacing: -0.2px; color: #3f3f3f; margin: 0 0 14px; }
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: #5193a8; margin: 0 0 10px; }
.muted { color: #808080; }
.crumb { font-size: 13px; color: #808080; margin-bottom: 12px; }
.crumb a { color: #808080; text-decoration: none; border-bottom: 1px solid #d8d8d8; }
.crumb a:hover { color: #3f3f3f; }
.crumb .sep { margin: 0 8px; color: #cfcfcf; }

/* ----- ds-* data components --------------------------------------------- */
.ds-card { background: #fff; border-radius: 8px; border: 1px solid #e2e2e2; overflow: hidden; }
.ds-card + .ds-card { margin-top: 20px; }
/* Cards laid out side-by-side in a grid must not inherit the stacked-card top margin
   (it breaks top-alignment and equal-height stretch). */
.grid-2 > .ds-card + .ds-card, .grid-3 > .ds-card + .ds-card, .grid-4 > .ds-card + .ds-card { margin-top: 0; }
.ds-ttop { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: .5px solid #e2e2e2; flex-wrap: wrap; }
.ds-ttop h2 { font-size: 14px; font-weight: 500; margin: 0; display: flex; align-items: center; gap: 9px; }
.ds-ttop h2 i { color: #808080; font-size: 14px; }
.ds-ttop .sub { font-size: 12px; color: #808080; margin: 2px 0 0; font-weight: 200; }
.ds-ttop-count { font-family: var(--font-mono); font-size: 12px; color: #808080; }

.ds-btn-add { height: 34px; padding: 0 15px; background: #3d3e52; color: #fff; border: none; border-radius: 7px; font-family: inherit; font-size: 12px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.ds-btn-add:hover { background: #2e2f3f; }
.ds-btn-add i { font-size: 12px; }
.ds-btn-ghost { height: 34px; padding: 0 15px; background: #fff; color: #3f3f3f; border: 1px solid #e2e2e2; border-radius: 7px; font-family: inherit; font-size: 12px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.ds-btn-ghost:hover { background: #f7f7f7; border-color: #bfbfbf; }
.ds-btn-add:disabled, .ds-btn-add[disabled] { background: #bfbfbf; cursor: not-allowed; }
.ds-btn-danger { height: 34px; padding: 0 15px; background: #c0392b; color: #fff; border: none; border-radius: 7px; font-family: inherit; font-size: 12px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.ds-btn-danger:hover { background: #a93226; }
.ds-btn-danger i { font-size: 12px; }

.ds-search-wrap { position: relative; display: flex; align-items: center; }
.ds-search-wrap input { width: 220px; height: 34px; padding: 0 10px 0 30px; border: 1px solid #E2E2E2; border-radius: 8px; font-size: 13px; letter-spacing: -0.25px; font-weight: 200; color: #3F3F3F; background: #fff; outline: none; font-family: inherit; }
.ds-search-wrap input:focus { border: 2px solid #3D3E52; padding: 0 9px 0 29px; }
.ds-search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #808080; pointer-events: none; font-size: 12px; }

.ds-filter-bar { display: flex; align-items: center; padding: 10px 16px; gap: 6px; border-bottom: .5px solid #e2e2e2; background: #fff; flex-wrap: wrap; }
.ds-tab { height: 32px; padding: 0 12px; border: 1px solid #E2E2E2; background: #fff; font-size: 13px; font-weight: 200; color: #808080; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; transition: color 100ms, border-color 100ms, background 100ms; border-radius: 8px; font-family: inherit; }
.ds-tab-count { font-size: 11px; font-weight: 500; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 38px; background: #F0EBE7; color: #808080; display: inline-flex; align-items: center; justify-content: center; line-height: 1; box-sizing: border-box; }
.ds-tab:hover { color: #3f3f3f; background: #FAFAFA; border-color: #BFBFBF; }
.ds-tab.on { color: #fff; font-weight: 500; background: #3D3E52; border-color: #3D3E52; }
.ds-tab.on .ds-tab-count { background: rgba(255,255,255,0.18); color: #fff; }
.ds-filter-spacer { margin-left: auto; }
.ds-select { height: 32px; padding: 0 28px 0 12px; border: 1px solid #E2E2E2; border-radius: 8px; font-size: 13px; font-weight: 200; color: #3f3f3f; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%23808080' stroke-width='1.8' stroke-linecap='round'%3E%3Cpolyline points='4,6 8,10 12,6'/%3E%3C/svg%3E") no-repeat right 10px center; -webkit-appearance: none; appearance: none; font-family: inherit; cursor: pointer; }

.ds-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ds-table thead tr { background: #f6f6f6; }
.ds-table thead th { height: 50px; padding: 0 12px; text-align: left; font-size: 14px; font-weight: 500; letter-spacing: -.035px; color: #3f3f3f; border-bottom: .5px solid #e2e2e2; white-space: nowrap; vertical-align: middle; font-family: inherit; }
.ds-table tbody tr { border-bottom: .5px solid #e2e2e2; transition: background 80ms; }
.ds-table tbody tr:last-child { border-bottom: none; }
.ds-table tbody tr.clickable { cursor: pointer; }
.ds-table tbody tr.clickable:hover { background: #f6f6f6; }
.ds-table tbody td { height: 52px; padding: 0 12px; vertical-align: middle; font-size: 14px; font-weight: 200; color: #3f3f3f; font-family: inherit; }
.ds-table td.num, .ds-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ds-table td.center, .ds-table th.center { text-align: center; }
.ds-mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: -0.2px; }
.ds-cname { font-weight: 500; color: #5193a8; text-decoration: none; }
.ds-cname:hover { text-decoration: underline; }
.ds-sub { font-size: 12px; color: #808080; font-weight: 200; }

/* Pills */
.ds-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 6rem; padding: 6px 10px; border-radius: 5px; font-size: 10px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; font-family: inherit; }
.ds-p-optimal { background: #62cf95; color: #000; }
.ds-p-normal { background: #aacf84; color: #000; }
.ds-p-elevated { background: #f5d072; color: #000; }
.ds-p-high { background: #e9865c; color: #fff; }
.ds-p-severe { background: #e26e4e; color: #fff; }
.ds-p-approved { background: #d8efe1; color: #1f7a4d; }
.ds-p-pending { background: #f0ebe7; color: #8a7b56; }
.ds-p-invoiced { background: #d8efe1; color: #1f7a4d; }
.ds-p-failed { background: #f3dcd7; color: #b5321e; }
.ds-pill-wait { display: inline-flex; align-items: center; justify-content: center; min-width: 6rem; padding: 6px 10px; border-radius: 5px; background: #f6f6f6; color: #808080; border: .5px solid #e2e2e2; font-size: 10px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; font-family: inherit; }
.ds-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 5px; background: #eeeeea; color: #4a4a52; font-size: 11px; font-weight: 200; font-family: var(--font-mono); }

/* Row action buttons */
.ds-acts { display: flex; gap: 4px; justify-content: flex-end; }
.ds-abtn { position: relative; width: 30px; height: 30px; border-radius: 7px; border: .5px solid #e2e2e2; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #767676; transition: all 100ms; font-family: inherit; }
.ds-abtn:hover { background: #3d3e52; border-color: #3d3e52; color: #fff; }

.ds-pag { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-top: .5px solid #e2e2e2; }
.ds-pag-info { font-size: 14px; font-weight: 200; color: #767676; }
.ds-pag-btns { display: flex; gap: 4px; }
.ds-pbtn { width: 34px; height: 34px; border-radius: 5px; border: .5px solid #e2e2e2; background: #fff; font-size: 12px; font-weight: 500; color: #3f3f3f; cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: inherit; }
.ds-pbtn.on { background: #3d3e52; border-color: #3d3e52; color: #fff; }
.ds-pbtn:hover:not(.on) { background: #f6f6f6; }

.ds-empty { padding: 40px; text-align: center; color: #808080; font-weight: 200; font-size: 14px; }

/* ----- Stat cards -------------------------------------------------------- */
.stat-grid { display: grid; gap: 16px; }
.stat-card { background: #fff; border: 1px solid #e2e2e2; border-radius: 8px; padding: 18px 20px; }
.stat-label { font-size: 12px; color: #808080; font-weight: 200; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.stat-label i { color: #5193a8; font-size: 13px; }
.stat-value { font-size: 30px; font-weight: 800; letter-spacing: -1px; color: #2b2c3a; line-height: 1; }
.stat-value .unit { font-size: 13px; font-weight: 400; color: #808080; letter-spacing: 0; margin-left: 4px; }
.stat-foot { font-size: 12px; color: #808080; font-weight: 200; margin-top: 8px; }
.stat-foot.ok { color: #1f7a4d; }
.stat-foot.err { color: #b5321e; }

/* ----- Forms ------------------------------------------------------------- */
.form-grid { display: grid; gap: 18px 20px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label, .field .label { font-size: 13px; font-weight: 500; color: #3f3f3f; }
.field .req { color: #dc2215; }
.field .hint { font-size: 12px; color: #808080; font-weight: 200; }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid #e2e2e2; border-radius: 8px;
  font-family: inherit; font-size: 14px; font-weight: 200; color: #3f3f3f; background: #fff; outline: none;
  transition: border-color 120ms ease;
}
.textarea { height: auto; padding: 11px 12px; resize: vertical; min-height: 80px; }
.input:focus, .select:focus, .textarea:focus { border: 2px solid #3d3e52; padding-left: 11px; }
.input:disabled, .input[readonly] { background: #f7f7f7; color: #767676; }
.input.error { border: 2px solid #dc2215; }
.input::placeholder, .textarea::placeholder { color: #b3b3b3; opacity: 1; }
.select { -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none' stroke='%23808080' stroke-width='1.8' stroke-linecap='round'%3E%3Cpolyline points='4,6 8,10 12,6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field-row { display: flex; gap: 10px; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix .select { width: 96px; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none; }
.input-prefix .input { border-top-left-radius: 0; border-bottom-left-radius: 0; }

.radio-group { display: flex; gap: 22px; padding-top: 4px; }
.radio { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; font-weight: 200; }
.radio input { width: 18px; height: 18px; accent-color: #3d3e52; cursor: pointer; }

.form-section { padding: 22px 0; border-top: 1px solid #ededed; }
.form-section:first-child { border-top: none; padding-top: 4px; }
.form-section-title { font-size: 13px; font-weight: 500; color: #2b2c3a; margin: 0 0 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 22px; border-top: 1px solid #ededed; margin-top: 4px; }

/* Inline banners */
.banner { display: flex; gap: 10px; padding: 12px 14px; border-radius: 8px; font-size: 13px; font-weight: 200; align-items: flex-start; }
.banner i { margin-top: 1px; flex-shrink: 0; }
.banner-warn { background: #faf3df; color: #8a6d2f; border: 1px solid #ecdcae; }
.banner-err { background: #f8e7e3; color: #b5321e; border: 1px solid #eecbc3; }
.banner-ok { background: #e3f3ea; color: #1f7a4d; border: 1px solid #c5e6d3; }
.banner-info { background: #e8eef7; color: #2c5ba8; border: 1px solid #cdd9ee; }

/* Steps */
.stepper { display: flex; align-items: center; margin: 4px 0 28px; }
.step { display: inline-flex; align-items: center; gap: 10px; padding: 4px 2px; background: none; border: none; font-family: inherit; cursor: pointer; }
.step:disabled { opacity: .55; cursor: not-allowed; }
.step-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 500; border: 1px solid #e2e2e2; background: #fff; color: #808080; }
.step.active .step-num, .step.done .step-num { background: #3d3e52; border-color: #3d3e52; color: #fff; }
.step-label { font-size: 14px; color: #808080; }
.step.active .step-label { color: #2b2c3a; font-weight: 500; }
.step-line { flex: 1; height: 1px; background: #e2e2e2; margin: 0 14px; max-width: 90px; }

/* Definition lists */
.dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 24px; }
.dl > div .dt { font-size: 11px; color: #808080; margin-bottom: 4px; font-weight: 200; }
.dl > div .dd { font-size: 14px; color: #3f3f3f; }
.dl > div .dd.mono { font-family: var(--font-mono); font-size: 13px; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: #2b2c3a; color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 13px; box-shadow: 0 12px 30px -8px rgba(0,0,0,0.4); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 80; display: flex; align-items: center; gap: 9px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast i { color: #62cf95; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(43,44,58,0.55); display: none; align-items: center; justify-content: center; z-index: 60; padding: 24px; }
.modal-backdrop.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 560px; max-width: 100%; max-height: 90vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid #ededed; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 500; }
.modal-close { background: none; border: none; cursor: pointer; color: #808080; font-size: 16px; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid #ededed; }

/* Utility */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.link { color: #5193a8; text-decoration: none; font-weight: 500; cursor: pointer; background: none; border: none; font-family: inherit; font-size: inherit; padding: 0; }
.link:hover { text-decoration: underline; }

@media (max-width: 1000px) {
  .dl, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid-2, .dl, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ----- API documentation page ------------------------------------------- */
/* (Defined inline in the prototype; folded into the design system here.) */
.api-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.api-list li { display:flex; align-items:center; gap:12px; font-size:13px; padding:8px 10px; border:1px solid #eee; border-radius:8px; }
.api-method { font-size:10px; font-weight:600; letter-spacing:.06em; padding:3px 7px; border-radius:5px; font-family:var(--font-mono); }
.api-method.get { background:#e8eef7; color:#2c5ba8; }
.api-method.post { background:#e3f3ea; color:#1f7a4d; }
.code-block { font-family:var(--font-mono); font-size:12.5px; line-height:1.7; background:#f7f7f7; border:1px solid #ececec; border-radius:8px; padding:16px 18px; color:#3f3f3f; overflow:auto; margin:0; }

/* ----- Lab User Portal additions ---------------------------------------- */
/* (Shared design system; defined inline in the lab prototype, folded in here.) */

/* Footer "powered by" line */
.page-footer-powered { padding-top: 20px; font-size: 12px; color: #808080; font-weight: 200; display: flex; align-items: center; gap: 7px; }
.page-footer-powered img { height: 13px; width: auto; display: block; opacity: .85; }

/* Numeric result value in tables */
.ds-score { font-weight: 500; font-variant-numeric: tabular-nums; }

/* Selected-sample header chip (Register result) */
.selected-client { display:flex; align-items:center; gap:14px; padding:14px 16px; background:#f7f7f7; border-radius:8px; margin-bottom:8px; }
.selected-client .acct-avatar { width:40px; height:40px; border-radius:8px; display:grid; place-items:center; }
.selected-client .acct-avatar i { font-size:16px; }

/* Small inline table button */
.ds-btn-sm { height:30px; padding:0 12px; font-size:12px; border-radius:6px; gap:7px; }
.ds-btn-sm i { font-size:11px; }

/* Empty-state row inside a table */
.empty-row { display:flex; align-items:center; justify-content:center; gap:10px; padding:34px 16px; color:#808080; font-size:13px; font-weight:200; }
.empty-row i { color:#bfbfbf; font-size:15px; }

/* Logo upload (Settings -> Report logo) */
.logo-upload { display:flex; align-items:center; gap:20px; }
.logo-preview { width:120px; height:80px; border:1.5px dashed #d8d8d8; border-radius:8px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; color:#bfbfbf; flex-shrink:0; }
.logo-preview i { font-size:20px; }
.logo-preview span { font-size:10px; }
.logo-preview img { max-width:100%; max-height:100%; object-fit:contain; }

/* Documentation tiles */
.doc-tile { display:flex; flex-direction:column; gap:6px; padding:20px; border:1px solid #e2e2e2; border-radius:10px; text-decoration:none; color:#3f3f3f; background:#fff; transition:border-color 120ms,background 120ms; }
.doc-tile:hover { border-color:#bfbfbf; background:#fafafa; }
.doc-tile i { font-size:20px; color:#5193a8; margin-bottom:4px; }
.doc-title { font-size:14px; font-weight:500; }
.doc-sub { font-size:12px; font-weight:200; color:#808080; }

/* ----- Lab User Portal v12 additions ------------------------------------ */
/* Two-step stepper (ol.stepper > li.step[.on|.done] > span.step-num) */
.stepper { display:flex; align-items:center; gap:10px; list-style:none; margin:0 0 20px; padding:0; }
.stepper .step { display:inline-flex; align-items:center; gap:9px; font-size:13px; font-weight:500; color:#a8a8a8; }
.stepper .step + .step::before { content:''; width:28px; height:1px; background:#e2e2e2; margin-right:10px; }
.stepper .step-num { width:24px; height:24px; border-radius:50%; display:grid; place-items:center; font-size:11px; font-weight:500; background:#f0f0f0; color:#a8a8a8; }
.stepper .step.on { color:#3f3f3f; }
.stepper .step.on .step-num { background:#3d3e52; color:#fff; }
.stepper .step.done { color:#3f3f3f; }
.stepper .step.done .step-num { background:#e6efe9; color:#3d7a55; }

/* Delivery cell (API / PDF) */
.ds-delivery { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:500; color:#6b6b6b; }
.ds-delivery i { font-size:13px; color:#9a9a9a; }

/* Icon-only button (download) */
.ds-icon-btn { width:32px; height:32px; border-radius:6px; border:.5px solid #e2e2e2; background:#fff; color:#6b6b6b; cursor:pointer; display:inline-grid; place-items:center; font-size:13px; }
.ds-icon-btn:hover { background:#f5f5f5; color:#3f3f3f; }

/* Clickable table row */
.row-link { cursor:pointer; }
.row-link:hover td { background:#fafafa; }

/* Stat value separator (API/PDF) */
.stat-sep { color:#c4c4c4; margin:0 2px; font-weight:200; }

/* Definition list (result detail) */
.cd-info { display:grid; grid-template-columns:1fr; gap:0; margin:0; }
.cd-info > div { display:flex; justify-content:space-between; gap:16px; padding:13px 0; border-bottom:1px solid #ededed; }
.cd-info > div:last-child { border-bottom:0; }
.cd-info dt { font-size:13px; color:#808080; font-weight:200; }
.cd-info dd { font-size:14px; color:#3f3f3f; margin:0; text-align:right; }
.cd-info dd.mono { font-size:13px; font-variant-numeric:tabular-nums; font-family:var(--font-mono); }

/* Logo upload hint */
.logo-hint { font-size:12px; color:#808080; font-weight:200; margin-top:8px; }
