@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

/* ==========================================================================
   EffectStats — Unified Stylesheet
   ==========================================================================
   Combined styles for the EffectStats Dash application.

   TABLE OF CONTENTS
   -----------------
   1. Design tokens
   2. Base reset & typography
   3. Layout helpers
   4. Controls (buttons, inputs, forms)
   5. Utility classes
   6. Public shell (landing, header)
   7. Auth page
   8. App shell (header, sidebar, profile)
   9. App landing (study explorer, data explorer, upload)
   10. Enrollment & placeholder pages
   11. Dashboard pages (study, adverse events, efficacy, patient profile, labs)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  --bg: #d9d9d9;
  --card: #fff;
  --text: #0f172a;
  --muted: #6b7280;
  --border: rgb(15 23 42 / 10%);
  --shadow: 0 10px 24px rgb(15 23 42 / 10%);
  --primary: #2563eb;
  --primary-2: #06b6d4;
  --success: #22c55e;
  --warning: #f97316;
  --danger: #ef4444;
  --nav-active: #34b27f;
  --header-accent: #2b6cb0;
  --radius: 16px;
  --radius-sm: 12px;
}

/* TFL Factory shell — align the embedded workspace with dashboard pages. */
.tfl-factory-page {
  padding: 0 16px 12px;
}

.tfl-factory-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 140px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  box-shadow: 0 8px 20px rgb(15 23 42 / 7%);
}

/* --------------------------------------------------------------------------
   2. Base reset & typography
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: #e0f2fe; /* light blue page background */
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  line-height: 1.45;

  /* Keep a stable viewport width across routes (landing has no scroll,
       auth often does). This prevents responsive breakpoint flicker that
       can change the logo size/position between pages. */
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

/* Sticky controls above large tables (Excel-like freeze-pane behavior) */
.ae-sticky-controls {
  position: sticky;
  top: 12px;
  z-index: 50;
  background: var(--card);
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* TEAE table: lock column widths to avoid header/body misalignment and overlap
   when using multi-row headers + fixed rows/columns + dynamic hide/show. */
#adverse-events-common-teae-table
  .dash-spreadsheet-container
  .dash-spreadsheet-inner
  td,
#adverse-events-common-teae-table
  .dash-spreadsheet-container
  .dash-spreadsheet-inner
  th {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* TEAE table: keep fixed header aligned with body when a vertical scrollbar is present.
   Dash renders fixed headers in a separate container; adding padding compensates for
   the scrollbar gutter in the scrollable body on Windows. */
#adverse-events-common-teae-table .dash-fixed-row {
  /* Default to 0; `assets/effectstats.js` measures and applies an exact value. */
  padding-right: 0;
  box-sizing: border-box;
}

/* TEAE table: ensure scroll containers reserve stable space for scrollbars.
   This helps keep the far-right columns reachable and reduces drift/snap
   when combined with a sticky first column. */
#adverse-events-common-teae-table .dash-spreadsheet-container {
  scrollbar-gutter: stable;
  box-sizing: border-box;
}

#adverse-events-common-teae-table
  .dash-spreadsheet-container
  .dash-spreadsheet-inner {
  box-sizing: border-box;

  /* Let the inner content grow to the sum of column widths so the horizontal
     scrollbar can reach the final (far-right) columns. */
  min-width: max-content;
}

/* TEAE table: enforce deterministic column sizing across header/body tables.
   This reduces header/body drift during horizontal scrolling on some browsers. */
#adverse-events-common-teae-table .dash-spreadsheet-container table {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}

/* AG Grid replacement skin: keep migrated tables visually close to the old
   Dash DataTable treatment while using the modern grid component. */
.effectstats-ag-grid.ag-theme-alpine {
  --ag-font-family:
    inter, ui-sans-serif, system-ui, -apple-system, segoe ui, roboto, helvetica,
    arial, sans-serif;
  --ag-font-size: 14px;
  --ag-border-color: #e2e8f0;
  --ag-secondary-border-color: #e2e8f0;
  --ag-header-background-color: #e9ecef;
  --ag-header-foreground-color: #0f172a;
  --ag-odd-row-background-color: transparent;
  --ag-row-hover-color: transparent;
  --ag-selected-row-background-color: #eff6ff;
  --ag-range-selection-border-color: #3b82f6;
  --ag-wrapper-border-radius: 0;
  --effectstats-ag-grid-row-bg: #fff;
  --effectstats-ag-grid-row-color: #111827;
  --effectstats-ag-grid-odd-row-bg: rgb(248 248 248);
  --effectstats-ag-grid-header-font-family: var(--ag-font-family);
  --effectstats-ag-grid-header-font-size: var(--ag-font-size);
  --effectstats-ag-grid-header-font-weight: 700;
  --effectstats-ag-grid-header-line-height: 1.25;
  --effectstats-ag-grid-header-padding: 10px;
  --effectstats-ag-grid-header-white-space: normal;
  --effectstats-ag-grid-header-justify: flex-start;
  --effectstats-ag-grid-filter-bg: #fff;
  --effectstats-ag-grid-filter-color: #0f172a;
  --effectstats-ag-grid-filter-font-family: var(--ag-font-family);
  --effectstats-ag-grid-filter-font-size: 12px;
  --effectstats-ag-grid-filter-font-weight: 400;
  --effectstats-ag-grid-filter-border: 1px solid #e2e8f0;
  --effectstats-ag-grid-filter-border-bottom: var(
    --effectstats-ag-grid-filter-border
  );
  --effectstats-ag-grid-filter-padding: 4px 6px;
  --effectstats-ag-grid-cell-border-right: 1px solid #d1d5db;
  --effectstats-ag-grid-row-border-bottom: 1px solid #d1d5db;
  --effectstats-ag-grid-cell-focus-bg: rgb(255 65 54 / 20%);
  --effectstats-ag-grid-cell-focus-border: hotpink;

  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 0;
  overflow: hidden;
}

.effectstats-ag-grid .ag-root-wrapper {
  border: 0;
  border-radius: inherit;
  overflow: hidden;
}

.effectstats-ag-grid .ag-header,
.effectstats-ag-grid .ag-header-cell,
.effectstats-ag-grid .ag-header-group-cell {
  background-color: var(--ag-header-background-color);
  color: var(--ag-header-foreground-color);
  font-family: var(--effectstats-ag-grid-header-font-family);
  font-size: var(--effectstats-ag-grid-header-font-size);
  font-weight: var(--effectstats-ag-grid-header-font-weight);
  line-height: var(--effectstats-ag-grid-header-line-height);
  white-space: var(--effectstats-ag-grid-header-white-space);
}

.effectstats-ag-grid .ag-header-cell,
.effectstats-ag-grid .ag-header-group-cell {
  padding: var(--effectstats-ag-grid-header-padding);
  border: var(--effectstats-ag-grid-header-border, 0);
  border-bottom: var(
    --effectstats-ag-grid-header-border-bottom,
    var(--effectstats-ag-grid-header-border, 1px solid #e2e8f0)
  );
  border-right: var(--effectstats-ag-grid-cell-border-right);
}

.effectstats-ag-grid .ag-header-cell-label,
.effectstats-ag-grid .ag-header-group-cell-label {
  justify-content: var(--effectstats-ag-grid-header-justify);
}

.effectstats-ag-grid .ag-cell {
  display: flex;
  align-items: center;
  background-color: inherit;
  color: inherit;
  line-height: 1.35;
  font-weight: inherit;
  border-right: var(--effectstats-ag-grid-cell-border-right);
}

.effectstats-ag-grid .ag-cell.ag-cell-auto-height {
  display: block;
}

.effectstats-ag-grid .ag-cell.ag-cell-auto-height .ag-cell-value {
  display: flex;
  align-items: center;
  min-height: 100%;
  width: 100%;
}

.effectstats-ag-grid .ag-row {
  background-color: var(--effectstats-ag-grid-row-bg);
  color: var(--effectstats-ag-grid-row-color);
  border-bottom: var(--effectstats-ag-grid-row-border-bottom);
}

.effectstats-ag-grid .ag-row.effectstats-ag-grid-row-odd {
  background-color: var(--effectstats-ag-grid-odd-row-bg);
}

.effectstats-ag-grid .ag-row:hover,
.effectstats-ag-grid .ag-row:hover .ag-cell {
  background-color: #f8fafc;
}

.effectstats-ag-grid .ag-row-selected .ag-cell {
  background-color: var(--ag-selected-row-background-color);
}

.effectstats-ag-grid .ag-cell.ag-cell-focus,
.effectstats-ag-grid .ag-cell.ag-cell-range-selected,
.effectstats-ag-grid .ag-cell.ag-cell-range-single-cell,
.effectstats-ag-grid .ag-cell:focus {
  background-color: var(--effectstats-ag-grid-cell-focus-bg) !important;
  box-shadow: inset 0 0 0 1px var(--effectstats-ag-grid-cell-focus-border) !important;
  outline: none;
}

.effectstats-ag-grid.effectstats-ag-grid-list-view,
.effectstats-ag-grid-list-view .ag-root-wrapper {
  --effectstats-ag-grid-cell-border-right: 0;
  --effectstats-ag-grid-row-border-bottom: 1px solid #e2e8f0;
}

.effectstats-ag-grid-list-view .ag-cell,
.effectstats-ag-grid-list-view .ag-header-cell,
.effectstats-ag-grid-list-view .ag-header-group-cell {
  border-right: 0;
}

.effectstats-ag-grid .ag-paging-panel {
  min-height: 42px;
  padding: 6px 10px;
  color: #475569;
  border-top: 1px solid #e2e8f0;
}

.effectstats-ag-grid .ag-floating-filter {
  background-color: var(--effectstats-ag-grid-filter-bg);
  color: var(--effectstats-ag-grid-filter-color);
  font-family: var(--effectstats-ag-grid-filter-font-family);
  font-size: var(--effectstats-ag-grid-filter-font-size);
  font-weight: var(--effectstats-ag-grid-filter-font-weight);
  border: var(--effectstats-ag-grid-filter-border);
  border-bottom: var(--effectstats-ag-grid-filter-border-bottom);
  padding: var(--effectstats-ag-grid-filter-padding);
}

.effectstats-ag-grid .ag-floating-filter-body,
.effectstats-ag-grid .ag-floating-filter-input,
.effectstats-ag-grid .ag-floating-filter-input input,
.effectstats-ag-grid .ag-input-field-input {
  width: 100%;
  min-height: 28px;
  font-family: var(--effectstats-ag-grid-filter-font-family);
  font-size: var(--effectstats-ag-grid-filter-font-size);
  color: var(--effectstats-ag-grid-filter-color);
}

.effectstats-ag-grid .ag-filter-toolpanel-search,
.effectstats-ag-grid .ag-floating-filter-input,
.effectstats-ag-grid input[class^="ag-"],
.effectstats-ag-grid .ag-input-field-input {
  border-radius: 8px;
}

.effectstats-ag-grid-report.ag-theme-alpine {
  --ag-header-background-color: #e9ecef;
  --effectstats-ag-grid-cell-border-right: 0;
  --effectstats-ag-grid-row-border-bottom: 1px solid #e2e8f0;

  border-radius: 12px;
}

.effectstats-ag-grid-baseline-summary .ag-root-wrapper,
.effectstats-ag-grid-baseline-summary .ag-root,
.effectstats-ag-grid-baseline-summary .ag-body-viewport,
.effectstats-ag-grid-baseline-summary .ag-center-cols-viewport {
  overflow: visible;
}

.effectstats-ag-grid-report .ag-header-cell,
.effectstats-ag-grid-report .ag-header-group-cell,
.effectstats-ag-grid-report .ag-cell {
  border-right: 0;
}

.effectstats-ag-grid-baseline-summary .ag-paging-panel {
  display: none;
}

.effectstats-ag-grid-baseline-summary .ag-center-cols-container,
.effectstats-ag-grid-baseline-summary .ag-header-container {
  min-width: 100%;
}

/* Toggle Columns menu: make long labels wrap cleanly and keep consistent spacing. */
#adverse-events-common-teae-toggle-columns-menu .dropdown-menu {
  min-width: 300px;
  max-width: 420px;
  padding: 0.25rem 0;
  white-space: normal;
}

#adverse-events-common-teae-toggle-columns-menu .ae-toggle-columns-menu {
  max-height: min(60vh, 560px);
  overflow-y: auto;
}

.ae-toggle-columns-checklist label {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 2px;
  line-height: 1.15;
}

.ae-toggle-columns-checklist input {
  margin-top: 1px;
  flex: 0 0 auto;
}

.ae-toggle-columns-checklist label:last-child {
  margin-bottom: 0;
}

/* Dash checklist markup is <label><input/><span>text</span></label>.
   Make the span flexible so wrapped lines stay aligned under the text. */
.ae-toggle-columns-checklist label > span {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
}

/* Headers: allow wrapping so group labels aren't truncated */
#adverse-events-common-teae-table
  .dash-spreadsheet-container
  .dash-spreadsheet-inner
  thead
  th {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.15;
}

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

button,
input,
select {
  font: inherit;
}

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */
.container {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.surface {
  background: rgb(255 255 255 / 95%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgb(15 23 42 / 8%);
  border-radius: var(--radius);
}

.muted {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgb(255 255 255 / 65%);
}

/* --------------------------------------------------------------------------
   4. Controls (buttons, inputs, forms)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease,
    border-color 120ms ease;
  user-select: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgb(15 23 42 / 10%);
  border-color: rgb(37 99 235 / 30%);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn.primary {
  border: 0;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 18px rgb(37 99 235 / 22%);
}

.btn.primary:hover {
  box-shadow: 0 16px 30px rgb(37 99 235 / 28%);
}

.btn.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: white;
  filter: none;
}

.btn.danger:hover:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
  filter: brightness(0.95);
}

.btn.warning,
.admin-page .btn.warning {
  border-color: var(--warning);
  background: var(--warning);
  color: white;
  filter: none;
}

.btn.warning:hover:not(:disabled),
.admin-page .btn.warning:hover:not(:disabled) {
  background: var(--warning);
  border-color: var(--warning);
  color: white;
  filter: brightness(0.95);
}

.btn.ghost {
  background: transparent;
}

.field {
  display: grid;
  gap: 8px;
}

.label {
  font-size: 13px;
  color: rgb(15 23 42 / 75%);
}

.input {
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
  outline: none;

  /* Ensure text + password inputs render the same height across browsers. */
  appearance: none;
  line-height: 1.45; /* match `body` */
  height: 47px;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.input:focus {
  border-color: rgb(37 99 235 / 55%);
  box-shadow: 0 0 0 4px rgb(37 99 235 / 12%);
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  color: rgb(15 23 42 / 55%);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: rgb(15 23 42 / 10%);
}

/* Base layout responsive */
@media (width <= 720px) {
  .container {
    width: min(1120px, calc(100% - 28px));
  }
}

/* --------------------------------------------------------------------------
   5. Utility classes
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   6. Public shell (landing page, public header)
   -------------------------------------------------------------------------- */
.public {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.public-header {
  height: 82px;
  background: #fff;
  border-bottom: 0;
  box-shadow: 0 4px 4px rgb(0 0 0 / 25%);
}

.public-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
  position: relative;
}

.public-header .public-inner .public-brand {
  position: absolute;
  left: 39px;
  top: 14px;
  width: 136px;
  height: 52px;
  display: block;
  padding-bottom: 6px;
  font-weight: 700;
  color: rgb(15 23 42 / 85%);
}

.public-header .public-inner .public-brand:focus-visible {
  outline: 3px solid rgb(37 99 235 / 35%);
  outline-offset: 6px;
  border-radius: 10px;
}

.public-header .public-inner .public-logo {
  width: 136px;
  height: 52px;
  display: block;
  object-fit: contain;
}

@media (width <= 980px) {
  .public-header .public-inner .public-brand {
    left: 62px;
  }
}

@media (width <= 520px) {
  .public-header .public-inner .public-brand {
    left: 56px;
    top: 20px;
    width: 100px;
    height: 38px;
  }

  .public-header .public-inner .public-logo {
    width: 100px;
    height: 38px;
  }
}

.actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.public-main {
  flex: 1 0 auto;
  padding: 18px 0 92px;
}

/* Landing page (public, pre-login) */
.landing-public .panel {
  background: #fff;
  border: 1px solid rgb(15 23 42 / 10%);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgb(15 23 42 / 10%);
  margin-top: 14px;
}

/* Session loader (first-paint) */
.session-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(255 255 255 / 65%);
  backdrop-filter: blur(8px);
}

.session-loader-square {
  width: min(360px, calc(100vw - 48px));
  height: min(360px, calc(100vh - 48px));
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius-sm);
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.session-loader-square .progress {
  width: 100%;
}

.landing-public .panel-inner {
  padding: 22px;
  display: grid;
  gap: 12px;
  max-width: 720px;
}

.landing-public .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgb(15 23 42 / 10%);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgb(15 23 42 / 2%);
  width: fit-content;
  font-weight: 700;
  font-size: 12px;
}

.landing-public .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--nav-active);
}

.landing-public .title {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.02em;
}

.landing-public .subtitle {
  margin: 0;
  font-size: 14px;
}

.landing-public .cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   7. Auth page
   -------------------------------------------------------------------------- */
.auth-wrap {
  min-height: calc(100vh - 82px);
  display: grid;
  place-items: center;
  padding: 36px 16px 56px;
}

.auth-wrap .form {
  overflow: hidden;
  width: min(520px, 100%);
  box-shadow: 0 4px 4px rgb(0 0 0 / 25%);
}

.auth-wrap .tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgb(15 23 42 / 3%);
  border-bottom: 1px solid rgb(15 23 42 / 8%);
}

.auth-wrap .tab {
  padding: 14px 16px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  color: rgb(15 23 42 / 70%);
}

.auth-wrap .tab.active {
  color: rgb(15 23 42 / 92%);
  background: white;
  box-shadow: inset 0 -2px 0 rgb(37 99 235 / 35%);
}

.auth-wrap .body {
  padding: 22px;
  display: grid;
  gap: 10px;
}

.auth-wrap .title {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.auth-wrap .subtitle {
  margin: 0;
  font-size: 14px;
}

.auth-wrap .stack {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.auth-wrap .stack .btn.primary {
  width: 100%;
  margin-top: 4px;
}

.auth-wrap .alert {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgb(15 23 42 / 10%);
  font-size: 13px;
}

.auth-wrap .alert.danger {
  background: rgb(239 68 68 / 8%);
  border-color: rgb(239 68 68 / 18%);
}

.auth-wrap .alert.success {
  background: rgb(34 197 94 / 9%);
  border-color: rgb(34 197 94 / 18%);
}

.auth-wrap .help ul {
  margin: 0;
  padding-left: 16px;
}

.auth-wrap .help li {
  margin: 4px 0;
}

/* Secondary actions: Register + Microsoft stacked (industry standard: Forgot password? is by password field) */
.auth-wrap .auth-actions-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 0;
}

/* Forgot password? — below Sign in, small helper link (placed after primary button to avoid misclicks) */
.auth-wrap .auth-link-forgot {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  padding: 0;
  margin-top: 4px;
}

.auth-wrap .auth-link-forgot:hover {
  color: var(--primary);
}

.auth-wrap .auth-link-sep {
  color: var(--muted);
  font-weight: 400;
  font-size: 14px;
  user-select: none;
  pointer-events: none;
  margin: 0 2px;
}

/* Standard login link style: text-only, readable weight, underline on hover */
.auth-wrap .auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    color 0.15s ease,
    text-decoration 0.15s ease;
}

.auth-wrap .auth-link:hover {
  transform: none;
  box-shadow: none;
  background: transparent;
  color: #1d4ed8;
  text-decoration: underline;
}

.auth-wrap .auth-link:active {
  transform: none;
}

.auth-wrap .auth-mfa-methods {
  display: grid;
  gap: 8px;
}

.auth-wrap .auth-mfa-method-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-size: 14px;
  color: var(--text);
}

.auth-wrap .auth-mfa-method-input {
  flex: 0 0 auto;
}

.auth-wrap .auth-mfa-email-actions {
  display: grid;
  gap: 6px;
}

.auth-wrap .auth-mfa-hint {
  font-size: 12px;
}

.auth-wrap .auth-policy-field {
  margin-top: -4px;
}

.auth-wrap .auth-policy-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-top: -6px;
  color: #64748b;
  font-size: 10.5px;
  line-height: 1.3;
  text-align: right;
}

.auth-wrap .auth-policy-separator {
  color: #94a3b8;
}

.auth-wrap .auth-policy-checklist {
  margin: 0;
}

.auth-wrap .auth-policy-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
}

.auth-wrap .auth-policy-input {
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: var(--primary);
}

.auth-wrap .auth-policy-link {
  color: var(--primary);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.terms-privacy-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.terms-privacy-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 23 42 / 56%);
}

.terms-privacy-modal-content {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid rgb(148 163 184 / 45%);
  border-radius: 8px;
  background: #fff;
  box-shadow:
    0 24px 60px rgb(15 23 42 / 24%),
    0 2px 10px rgb(15 23 42 / 10%);
}

.cookie-consent-modal-content {
  width: min(560px, 100%);
}

.terms-privacy-modal-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.terms-privacy-modal-title {
  margin: 12px 0 8px;
  color: #111827;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
}

.terms-privacy-modal-copy {
  margin: 0 0 16px;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.5;
}

.terms-privacy-modal-checklist {
  margin: 0;
}

.terms-privacy-modal-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.86rem;
  line-height: 1.45;
  cursor: pointer;
}

.terms-privacy-modal-label:has(.terms-privacy-modal-input:checked) {
  border-color: rgb(37 99 235 / 55%);
  background: #eff6ff;
  color: #1e3a8a;
}

.terms-privacy-modal-label:has(.terms-privacy-modal-input:focus-visible) {
  outline: 3px solid rgb(37 99 235 / 18%);
  outline-offset: 2px;
}

.terms-privacy-modal-label > span {
  flex: 1 1 auto;
  min-width: 0;
}

.terms-privacy-modal-input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  appearance: auto;
  accent-color: var(--primary);
  cursor: pointer;
}

.terms-privacy-modal-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.terms-privacy-modal-status {
  min-height: 20px;
  margin: 10px 0;
  color: #b91c1c;
  font-size: 0.82rem;
  font-weight: 600;
}

.terms-privacy-modal-submit {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  font-weight: 700;
}

.cookie-consent {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.auth-wrap .auth-cookie-consent {
  padding: 12px;
}

.auth-wrap .auth-cookie-consent .cookie-consent-head {
  margin-bottom: 8px;
}

.auth-wrap .auth-cookie-consent .cookie-consent-title {
  font-size: 0.86rem;
}

.auth-wrap .auth-cookie-consent .cookie-consent-copy {
  font-size: 0.72rem;
}

.auth-wrap .auth-cookie-consent .cookie-consent-required {
  padding: 8px;
}

.cookie-consent-head {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.cookie-consent-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  color: #1e293b;
}

.cookie-consent-copy {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #475569;
}

.cookie-consent-body {
  display: grid;
  gap: 10px;
}

.cookie-consent-required {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
}

.cookie-consent-required-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1d4ed8;
}

.cookie-consent-required-desc {
  font-size: 0.76rem;
  line-height: 1.4;
  color: #334155;
}

.cookie-consent-checklist {
  display: grid;
  gap: 8px;
  margin: 0;
}

.cookie-consent-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 24px;
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #334155;
}

.cookie-consent-input {
  flex: 0 0 auto;
  margin-top: 2px;
}

.cookie-banner {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1200;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(
    180deg,
    rgb(248 250 252 / 0%) 0%,
    rgb(241 245 249 / 72%) 50%,
    rgb(226 232 240 / 88%) 100%
  );
  pointer-events: none;
}

.cookie-banner-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(250px, 0.85fr) minmax(560px, 1.45fr) 172px;
  gap: 18px;
  align-items: center;
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 22px 24px 20px;
  overflow: hidden;
  border: 1px solid rgb(148 163 184 / 38%);
  border-radius: 8px;
  background: #fff;
  box-shadow:
    0 18px 44px rgb(15 23 42 / 16%),
    0 2px 8px rgb(15 23 42 / 8%);
  pointer-events: auto;
}

.cookie-banner-panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #0891b2, #0f766e);
}

.cookie-banner-head {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.cookie-banner-kicker {
  width: fit-content;
  padding: 3px 8px;
  border: 1px solid rgb(13 148 136 / 28%);
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.cookie-banner-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.18;
  color: #111827;
}

.cookie-banner-copy {
  margin: 0;
  max-width: 38ch;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #475569;
}

.cookie-banner-options {
  display: grid;
  gap: 10px;
  min-width: 0;
  grid-template-columns: minmax(210px, 0.82fr) minmax(280px, 1.18fr);
}

.cookie-banner-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 132px;
  padding: 12px;
  border: 1px solid rgb(148 163 184 / 42%);
  border-radius: 8px;
  background: #f8fafc;
}

.cookie-banner-required {
  background: #eef7ff;
  border-color: #93c5fd;
}

.cookie-banner-card-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e6eef4;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.cookie-banner-required .cookie-banner-card-label {
  background: #dbeafe;
  color: #1e40af;
}

.cookie-banner-required-text {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.cookie-banner-optional-card {
  background: #f7fdfa;
  border-color: #a7f3d0;
}

.cookie-banner-optional {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.cookie-banner-option {
  position: relative;
  box-sizing: border-box;
  display: grid;
  gap: 7px;
  min-width: 0;
  min-height: 92px;
  padding: 12px 13px;
  border: 1px solid rgb(148 163 184 / 50%);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.cookie-banner-option:hover {
  border-color: rgb(8 145 178 / 48%);
  background: #f0f9ff;
  box-shadow: 0 1px 7px rgb(22 78 99 / 10%);
}

.cookie-banner-option:has(.cookie-consent-input:checked) {
  border-color: rgb(15 118 110 / 78%);
  background: linear-gradient(180deg, #ecfdf5 0%, #f0fdfa 100%);
  box-shadow:
    inset 0 0 0 1px rgb(15 118 110 / 22%),
    0 4px 14px rgb(15 118 110 / 10%);
}

.cookie-banner-option:has(.cookie-consent-input:checked)::after {
  content: "Selected";
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.2;
}

.cookie-banner-option:has(.cookie-consent-input:focus-visible) {
  outline: 3px solid rgb(14 165 233 / 28%);
  outline-offset: 2px;
}

.cookie-banner-option .cookie-consent-input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: #0f766e;
  cursor: pointer;
}

.cookie-banner-option-checklist {
  margin: 0;
}

.cookie-banner-option-label {
  min-height: 20px;
  padding-right: 0;
  font-size: 0.81rem;
  font-weight: 700;
  line-height: 1.25;
  color: #111827;
  cursor: pointer;
  transition: color 0.18s ease;
}

.cookie-banner-option:has(.cookie-consent-input:checked)
  .cookie-banner-option-label {
  padding-right: 68px;
  color: #064e3b;
}

.cookie-banner-option-desc {
  font-size: 0.75rem;
  line-height: 1.38;
  color: #475569;
}

.cookie-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  position: relative;
  z-index: 1;
  min-width: 160px;
}

.cookie-banner-actions .btn {
  width: 100%;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.cookie-banner-btn-secondary {
  color: #334155;
  border-color: #cbd5e1;
  background: #f8fafc;
}

.cookie-banner-btn {
  color: #0f172a;
  border-color: #7dd3fc;
  background: #f0f9ff;
}

.cookie-banner-btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
  border-color: transparent;
  box-shadow: 0 8px 20px rgb(8 145 178 / 28%);
}

.cookie-banner-enter {
  animation: cookie-banner-backdrop-in 280ms ease-out both;
}

.cookie-banner-enter .cookie-banner-panel {
  animation: cookie-banner-panel-in 440ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cookie-banner-exit {
  pointer-events: none;
  animation: cookie-banner-backdrop-out 260ms ease-in both;
}

.cookie-banner-exit .cookie-banner-panel {
  animation: cookie-banner-panel-out 260ms cubic-bezier(0.7, 0, 0.84, 0) both;
}

@keyframes cookie-banner-backdrop-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes cookie-banner-backdrop-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes cookie-banner-panel-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cookie-banner-panel-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(18px) scale(0.99);
  }
}

@media (width <= 900px) {
  .cookie-banner-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-items: stretch;
    width: min(680px, calc(100% - 20px));
    max-height: calc(100vh - 48px - env(safe-area-inset-bottom));
    overflow: hidden;
  }

  .cookie-banner-options {
    grid-template-columns: 1fr;
    overflow: auto;
    padding-right: 2px;
  }

  .cookie-banner-actions {
    flex-flow: row wrap;
    justify-content: flex-start;
    min-width: 0;
  }

  .cookie-banner-actions .btn {
    width: auto;
    flex: 1 1 150px;
  }
}

@media (width <= 560px) {
  .cookie-banner {
    padding: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .cookie-banner-panel {
    max-height: min(520px, calc(84vh - env(safe-area-inset-bottom)));
    padding: 14px;
    gap: 12px;
    box-shadow:
      0 18px 46px rgb(15 23 42 / 20%),
      0 2px 8px rgb(15 23 42 / 10%);
  }

  .cookie-banner-head {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 6px;
  }

  .cookie-banner-kicker {
    padding: 2px 7px;
    font-size: 10px;
  }

  .cookie-banner-title {
    font-size: 16px;
    line-height: 1.1;
  }

  .cookie-banner-copy {
    grid-column: 1 / -1;
    max-width: none;
    font-size: 12px;
    line-height: 1.4;
  }

  .cookie-banner-options {
    gap: 8px;
  }

  .cookie-banner-card {
    gap: 7px;
    min-height: 0;
    padding: 10px;
  }

  .cookie-banner-card-label {
    min-height: 17px;
    padding: 2px 7px;
    font-size: 10px;
  }

  .cookie-consent-required-label,
  .cookie-banner-option-label {
    font-size: 12px;
    line-height: 1.2;
  }

  .cookie-consent-required-desc,
  .cookie-banner-option-desc {
    font-size: 11px;
    line-height: 1.3;
  }

  .cookie-banner-required .cookie-consent-required-desc {
    display: none;
  }

  .cookie-banner-optional {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cookie-banner-option {
    min-height: 0;
    align-content: center;
    padding: 9px;
  }

  .cookie-banner-option:has(.cookie-consent-input:checked)::after {
    content: "On";
    top: 6px;
    right: 6px;
    padding: 2px 6px;
    font-size: 10px;
  }

  .cookie-banner-option-desc {
    display: none;
  }

  .cookie-banner-option:has(.cookie-consent-input:checked)
    .cookie-banner-option-label {
    padding-right: 28px;
  }

  .cookie-banner-actions .btn {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 11px;
    flex: 1 1 calc(50% - 4px);
  }

  .cookie-banner-actions .cookie-banner-btn-primary {
    order: -1;
    flex-basis: 100%;
  }
}

@media (height <= 520px) {
  .cookie-banner-panel {
    max-height: calc(100vh - 20px - env(safe-area-inset-bottom));
  }

  .cookie-banner-head {
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 8px;
  }

  .cookie-banner-title {
    font-size: 16px;
  }

  .cookie-banner-copy {
    grid-column: 1 / -1;
    font-size: 12px;
  }

  .cookie-banner-required .cookie-consent-required-desc {
    display: none;
  }

  .cookie-banner-options {
    gap: 7px;
  }

  .cookie-banner-card {
    min-height: 0;
    padding: 8px;
  }

  .cookie-banner-optional {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .cookie-banner-option {
    min-height: 48px;
    align-content: center;
    padding: 8px;
  }

  .cookie-banner-option-desc {
    display: none;
  }

  .cookie-banner-option-label {
    font-size: 12px;
    line-height: 1.15;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner-enter,
  .cookie-banner-enter .cookie-banner-panel,
  .cookie-banner-exit,
  .cookie-banner-exit .cookie-banner-panel {
    animation: none;
  }
}

/* Microsoft: same link treatment, distinct color — stacked under Register on left */
.auth-wrap .auth-link-ms {
  display: inline-flex;
  margin: 0;
  padding: 0;
  color: #0078d4;
  font-size: 14px;
  font-weight: 500;
}

.auth-wrap .auth-link-ms:hover {
  color: #106ebe;
  text-decoration: underline;
}

.auth-wrap .auth-link-ms[disabled],
.auth-wrap .auth-link-ms[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  color: #0078d4;
}

.auth-wrap .ms {
  border: 1px solid rgb(0 120 212 / 85%);
  background: rgb(0 120 212 / 90%);
  color: #fff;
  box-shadow: 0 4px 4px rgb(0 0 0 / 12%);
}

.auth-wrap .ms .muted {
  color: rgb(255 255 255 / 85%);
}

.auth-wrap .ms:hover {
  border-color: rgb(0 120 212 / 100%);
  background: rgb(0 120 212 / 100%);
  box-shadow: 0 6px 8px rgb(0 0 0 / 14%);
}

.auth-wrap .ms[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 4px rgb(0 0 0 / 10%);
}

.auth-wrap .guest {
  background: rgb(15 23 42 / 4%);
  border-color: rgb(15 23 42 / 14%);
  color: rgb(15 23 42 / 78%);
}

.auth-wrap .guest:hover {
  background: rgb(15 23 42 / 6%);
  border-color: rgb(15 23 42 / 18%);
  box-shadow: 0 6px 10px rgb(0 0 0 / 10%);
}

/* --------------------------------------------------------------------------
   8. App shell (header, sidebar, profile, navigation)
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 82px;
  background: #fff;
  border-bottom: 0;
  box-shadow: 0 4px 4px rgb(0 0 0 / 25%);
  z-index: 1000;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: relative;
}

.header .brand {
  position: absolute;
  left: 39px;
  top: 14px;
  width: 136px;
  height: 52px;
  display: block;
  padding-bottom: 6px;
  background: transparent;
  border: 0;
  padding-left: 0;
  padding-right: 0;
  cursor: pointer;
}

.header .brand:focus-visible {
  outline: 3px solid rgb(37 99 235 / 35%);
  outline-offset: 6px;
  border-radius: 10px;
}

.header .logo {
  width: 136px;
  height: 52px;
  display: block;
  object-fit: contain;
}

.profile-wrap {
  position: absolute;
  right: 39px;
  top: 18px;
  width: 46px;
}

.app-version-badge {
  display: block;
  padding: 10px 16px 4px;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  text-align: center;
  letter-spacing: 0.02em;
  border-top: 1px solid #e2e8f0;
  margin-top: 6px;
  user-select: none;
}

.profile-btn {
  width: 46px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  color: #1f4d7a;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.profile-btn:hover {
  opacity: 0.9;
}

.profile-btn:active {
  transform: scale(0.98);
}

.profile-btn:focus-visible {
  outline: 3px solid rgb(37 99 235 / 35%);
  outline-offset: 6px;
  border-radius: 10px;
}

.profile {
  width: 46px;
  height: 38.56px;
  display: block;
  object-fit: contain;
}

.name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

/* Profile popover – enterprise menu: controlled visibility, no mount/unmount glitch */
.popover {
  position: absolute;
  top: 54px;
  right: 0;
  width: 260px;
  min-width: 220px;
  max-height: min(420px, calc(100vh - 100px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow:
    0 4px 6px -1px rgb(15 23 42 / 8%),
    0 12px 28px -4px rgb(15 23 42 / 12%);
  padding: 0 0 10px;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transform-origin: top right;
  transition:
    opacity 0.18s ease,
    visibility 0.18s step-end,
    transform 0.18s ease;
  pointer-events: none;
}

.profile-wrap[data-open="true"] .popover,
.popover.popover--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition:
    opacity 0.18s ease,
    visibility 0.18s step-start,
    transform 0.18s ease;
}

.popover-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.popover-user {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #1e293b;
}

.popover-sub {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
}

.popover-spacer {
  height: 12px;
  flex-shrink: 0;
}

.popover-label {
  padding: 0 16px 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: #334155;
  cursor: pointer;
  transition:
    background 0.1s ease,
    color 0.1s ease;
  box-sizing: border-box;
  text-decoration: none;
}

.popover a.menu-item {
  color: inherit;
}

.menu-item:hover {
  background: #f8fafc;
  color: #0f172a;
}

/* Performance metrics panel */
.perf-metrics-shell {
  position: relative;
  display: flex;
  align-items: flex-end;
}

.perf-metrics-viewport-anchor {
  position: fixed !important;
  inset: auto 18px 18px auto !important;
  transform: none !important;
  margin: 0 !important;
  z-index: 1400 !important;
}

.perf-metrics-shell--hidden {
  display: none;
}

.perf-metrics-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(15 23 42 / 16%);
  background: rgb(15 23 42 / 92%);
  color: #fff;
  border-radius: 999px;
  min-width: 48px;
  height: 42px;
  padding: 0 12px;
  box-shadow: 0 16px 30px rgb(15 23 42 / 24%);
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.perf-metrics-launcher .fa-solid,
.perf-metrics-launcher .fas,
.perf-metrics-launcher .fa {
  font-size: 18px;
  line-height: 1;
}

.perf-metrics-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(360px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  overflow: auto;
  border: 1px solid rgb(15 23 42 / 10%);
  border-radius: 18px;
  background: rgb(255 255 255 / 98%);
  box-shadow: 0 24px 48px rgb(15 23 42 / 20%);
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  pointer-events: none;
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    visibility 120ms step-end;
}

.perf-metrics-panel--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    visibility 120ms step-start;
}

.perf-metrics-header {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.perf-metrics-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.perf-metrics-subtitle {
  font-size: 12px;
  color: #64748b;
}

.perf-metrics-content {
  display: grid;
  gap: 14px;
}

.perf-metrics-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 10px;
}

.perf-metric-card {
  border: 1px solid rgb(15 23 42 / 8%);
  border-radius: 14px;
  padding: 10px 12px;
  background: #f8fafc;
}

.perf-metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.perf-metric-value {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.perf-metric-detail {
  margin-top: 4px;
  font-size: 12px;
  color: #475569;
  overflow-wrap: anywhere;
}

.perf-why-summary {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgb(37 99 235 / 8%);
  color: #1e3a8a;
  font-size: 12px;
  line-height: 1.5;
}

.perf-section {
  display: grid;
  gap: 8px;
}

.perf-issue-item {
  padding: 10px 12px;
  border: 1px solid rgb(15 23 42 / 8%);
  border-radius: 14px;
  background: #fffaf0;
}

.perf-issue-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.perf-issue-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.perf-issue-badge--high {
  background: rgb(239 68 68 / 14%);
  color: #b91c1c;
}

.perf-issue-badge--medium {
  background: rgb(249 115 22 / 14%);
  color: #c2410c;
}

.perf-issue-badge--info {
  background: rgb(37 99 235 / 10%);
  color: #1d4ed8;
}

.perf-issue-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.perf-issue-detail {
  margin-top: 6px;
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
}

.perf-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.perf-event-list {
  display: grid;
  gap: 8px;
}

.perf-event-item {
  padding: 10px 12px;
  border: 1px solid rgb(15 23 42 / 8%);
  border-radius: 14px;
  background: #fff;
}

.perf-event-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.perf-inline-flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.perf-inline-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.perf-inline-flag--high {
  background: rgb(239 68 68 / 14%);
  color: #b91c1c;
}

.perf-inline-flag--medium {
  background: rgb(249 115 22 / 14%);
  color: #c2410c;
}

.perf-inline-flag--info {
  background: rgb(37 99 235 / 10%);
  color: #1d4ed8;
}

.perf-event-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.perf-event-duration {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
}

.perf-event-meta,
.perf-event-path,
.perf-empty {
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
  overflow-wrap: anywhere;
}

@media (width <= 720px) {
  .perf-metrics-viewport-anchor {
    inset: auto 12px 12px auto !important;
  }

  .perf-metrics-panel {
    right: 0;
    bottom: calc(100% + 10px);
    width: min(360px, calc(100vw - 24px));
    max-height: min(65vh, 520px);
  }
}

.menu-item:active {
  background: #f1f5f9;
}

.menu-item:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
}

.menu-item--action {
  color: #64748b;
  font-weight: 500;
}

.menu-item--action:hover {
  color: #dc2626;
  background: #fef2f2;
}

.nav-toggle {
  display: none;
  position: absolute;
  left: 14px;
  top: 24px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
}

.nav-toggle:hover {
  background: rgb(15 23 42 / 3%);
}

.nav-toggle:focus-visible {
  outline: 3px solid rgb(37 99 235 / 25%);
  outline-offset: 3px;
}

.hamburger {
  width: 16px;
  height: 12px;
  display: inline-block;
  background:
    linear-gradient(#364153, #364153) 0 0 / 100% 2px no-repeat,
    linear-gradient(#364153, #364153) 0 50% / 100% 2px no-repeat,
    linear-gradient(#364153, #364153) 0 100% / 100% 2px no-repeat;
}

@media (width <= 980px) {
  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .header .brand {
    left: 62px;
  }

  .profile-wrap {
    right: 16px;
  }
}

@media (width <= 520px) {
  /* On very small widths, absolute positioning can cause hit-target overlap
       (hamburger/profile “crossing”). Use a 3-column grid to guarantee separation. */
  .header .header-inner {
    display: grid;
    grid-template-columns: 46px 1fr 46px;
    align-items: center;
    justify-content: initial; /* grid handles spacing */
  }

  .nav-toggle {
    position: static;
    place-self: center start;
  }

  .header .brand {
    position: static;
    place-self: center;
    left: auto;
    top: auto;
    width: 100px;
    height: 38px;
  }

  .profile-wrap {
    position: static;
    place-self: center end;
    right: auto;
    top: auto;
    width: 40px;
  }

  .header .logo {
    width: 100px;
    height: 38px;
  }

  .profile-btn {
    width: 40px;
  }

  .profile {
    width: 40px;
    height: 33px;
  }

  .name {
    font-size: 12px;
  }

  .popover {
    width: 220px;
    right: -8px;
  }
}

/* App shell layout */
.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.shell .body {
  flex: 1 0 auto;
  padding-top: 82px; /* keep content below fixed header */
  padding-bottom: 92px;
}

.shell .body .app-landing {
  padding-top: 0; /* tab bar sits right under the header */
}

.shell .body-inner {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.shell .content {
  flex: 1;
  min-width: 0;
  padding: 16px 0 0;
}

.shell .content h1,
.shell .content h2 {
  margin-top: 0;
}

.shell .content.with-sidebar {
  margin-left: 205px; /* match sidebar width */
}

@media (width <= 980px) {
  .shell .body-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .shell .content {
    margin-left: 0;
    width: 100%;
  }

  .shell .content.with-sidebar {
    margin-left: 0;
  }

  .shell .backdrop {
    display: block;
  }
}

.shell .backdrop {
  display: none;
  position: fixed;
  inset: 82px 0 0;
  background: rgb(15 23 42 / 35%);
  z-index: 1100;
}

/* Sidebar */
.sidebar {
  width: 205px;
  background: linear-gradient(#fff, #fbfbfb);
  padding: 105px 12px 50px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  box-shadow: none;
  border-right: 0.66px solid #e2e8f0;
  z-index: 10; /* below header */
  overflow: hidden auto;
}

/* Desktop fixed sidebar */
.sidebar.fixed {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
}

/* Mobile drawer sidebar (hidden by default) */
.sidebar.drawer {
  position: fixed;
  top: 82px;
  left: 0;
  bottom: 0;
  padding-top: 23px;
  transform: translateX(-110%);
  transition: transform 180ms ease;
  will-change: transform;
  z-index: 1200;
}

.sidebar.drawer.open {
  transform: translateX(0);
}

@media (width <= 980px) {
  .sidebar.fixed {
    display: none;
  }
}

@media (width >= 981px) {
  .sidebar.drawer {
    display: none;
  }
}

.sidebar-meta {
  display: grid;
  gap: 12px;
}

.study {
  position: relative;
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgb(15 23 42 / 8%);
  padding: 8px 12px;
  box-shadow: 0 2px 5px rgb(226 232 240 / 50%);
  overflow: hidden;
}

.study-selector-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.study-selector-link:hover {
  color: inherit;
  text-decoration: none;
  border-color: rgb(14 165 164 / 35%);
  box-shadow: 0 4px 10px rgb(15 118 110 / 12%);
  transform: translateY(-1px);
}

.study-selector-link:focus-visible {
  outline: 3px solid rgb(14 165 164 / 25%);
  outline-offset: 2px;
}

.study-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: none;
  flex-shrink: 0;
}

.study-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
  overflow: visible;
}

.study-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 500; /* medium */
  color: #90a1b9;
  line-height: 1;
}

.study-value {
  font-weight: 600; /* semibold */
  color: rgb(51 65 85 / 95%);
  font-size: 14px;
  line-height: 1.25;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
}

.sidebar .nav {
  position: relative;
  display: grid;
  gap: 10px;
}

.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10.62px;
  height: 33.39px;
  padding: 0 10px;
  text-align: left;
  cursor: pointer;
  background: transparent;
  color: #364153; /* default (unselected) */
}

.sidebar .nav-item:hover {
  background: rgb(15 23 42 / 3%);
}

.sidebar .nav-item.active {
  background: linear-gradient(90deg, #00bc7d 0%, #00bba7 100%);
  color: #fff;
  box-shadow: 0 10px 18px rgb(0 0 0 / 18%);
}

.sidebar .icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: rgb(51 65 85 / 95%);
  flex: none;
}

.sidebar .nav-item.active .icon {
  color: #fff;
}

.sidebar .sidebar-icon-glyph {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}

.sidebar .label {
  font-weight: 700;
  font-size: 10.62px;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   9. App landing (study explorer, data explorer, upload wizard)
   -------------------------------------------------------------------------- */
.app-landing {
  background: #e0f2fe; /* light blue page background */
  min-height: calc(100vh - 82px);
  display: flex;
  flex-direction: column;
}

.app-landing .top-tabs-wrap {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 24px 0;
}

.app-landing .top-tabs {
  width: min(980px, 100%);
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 0 0 12px;
  margin: 0 auto;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.app-landing .top-tab {
  position: relative;
  border: 0;
  background: transparent;
  padding: 10px 14px;
  font-weight: 800;
  color: rgb(51 65 85 / 76%);
  cursor: pointer;
  border-radius: 12px;
  transition:
    background 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.app-landing .top-tab:hover {
  background: rgb(15 23 42 / 3%);
  color: rgb(15 23 42 / 90%);
}

.app-landing .top-tab:focus-visible {
  outline: 3px solid rgb(37 99 235 / 25%);
  outline-offset: 4px;
  border-radius: 10px;
}

.app-landing .top-tab.active {
  color: #1f4d7a;
  background: rgb(15 23 42 / 2%);
}

.app-landing .top-tab.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -12px;
  height: 2px;
  background: linear-gradient(90deg, #00bc7d 0%, #00bba7 100%);
  border-radius: 999px;
}

.app-landing .content {
  flex: 1;
  padding: 28px 24px 32px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Study Explorer – enterprise layout */
.app-landing .explorer-section {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-top: 0;
  gap: 0;
}

.app-landing .explorer-section-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.app-landing .explorer-section-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: #1e293b;
}

.app-landing .explorer-section-sub {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: #64748b;
}

/* Upload – enterprise wizard */
.app-landing .upload-view {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.app-landing .upload-card-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: #1e293b;
}

.app-landing .upload-card {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgb(15 23 42 / 6%);
  overflow: visible;
}

.app-landing .upload-card-inner {
  padding: 32px 36px 36px;
  overflow: visible;
}

.app-landing .upload-step-badge {
  display: inline-block;
  margin-bottom: 16px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.app-landing .upload-prompt {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  line-height: 1.45;
}

.app-landing .upload-step-content {
  overflow: visible;
}

.app-landing .upload-step-content .field {
  margin-bottom: 24px;
  width: 100%;
  max-width: 360px;
  min-width: 0;
}

.app-landing .upload-step-content .upload-study-field,
.app-landing .upload-step-content .upload-cutoff-date-field {
  width: 100% !important;
  max-width: none !important;
}

.app-landing .upload-step-content .field.field-date {
  width: 100%;
  min-width: 200px;
  max-width: 360px;
  overflow: visible;
}

.app-landing .upload-step-content .upload-cutoff-date-field {
  max-width: none !important;
}

.app-landing .upload-study-dropdown,
.app-landing .upload-cutoff-date-input {
  width: 100% !important;
  min-width: 200px !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

.app-landing .upload-study-dropdown .Select-control,
.app-landing .upload-cutoff-date-input {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  min-height: 44px !important;
  height: 44px !important;
  border-radius: 10px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  box-shadow: none !important;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

.app-landing .upload-study-dropdown .Select-control {
  padding: 0 14px !important;
  padding-right: 36px !important;
}

.app-landing .upload-cutoff-date-input {
  padding: 0 14px !important;
  padding-right: 36px !important;
  color: #334155 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 44px !important;
  appearance: auto !important;
}

.app-landing .upload-study-dropdown .Select-control:hover,
.app-landing .upload-cutoff-date-input:hover {
  border-color: #cbd5e1 !important;
}

.app-landing .upload-study-dropdown.is-focused .Select-control,
.app-landing .upload-cutoff-date-input:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgb(59 130 246 / 15%) !important;
  outline: none !important;
}

.app-landing .upload-study-dropdown .Select-placeholder,
.app-landing .upload-study-dropdown .Select-value {
  line-height: 44px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #334155 !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.app-landing .upload-study-dropdown .Select-input {
  height: 44px !important;
  line-height: 44px !important;
}

.app-landing .upload-study-dropdown .Select-input > input {
  line-height: 44px !important;
  font-size: 14px !important;
}

.app-landing .upload-study-dropdown .Select-arrow-zone {
  position: absolute !important;
  right: 6px !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  background: transparent !important;
}

.app-landing .upload-validation-message-wrap,
.app-landing .upload-actions {
  width: 100%;
  max-width: none;
}

.app-landing .upload-selection-summary {
  width: 100%;
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.app-landing .upload-summary-title {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}

.app-landing .upload-summary-grid {
  display: grid;
  gap: 8px;
}

.app-landing .upload-summary-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.app-landing .upload-summary-label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.app-landing .upload-summary-value {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.app-landing .upload-date-select {
  width: 100%;
  min-width: 200px;
}

.app-landing .upload-date-select .Select-control {
  min-height: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 0 14px;
  padding-right: 36px;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
  overflow: visible;
}

.app-landing .upload-date-select .Select-control:hover {
  border-color: #cbd5e1;
}

.app-landing .upload-date-select.is-focused .Select-control {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgb(59 130 246 / 15%);
}

.app-landing .upload-date-select .Select-placeholder,
.app-landing .upload-date-select .Select-value {
  line-height: 44px;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  overflow: visible;
  text-overflow: clip;
}

.app-landing .upload-date-select .Select-value-label {
  overflow: visible;
  text-overflow: clip;
}

.app-landing .upload-date-select .Select-input {
  height: 44px;
  line-height: 44px;
}

.app-landing .upload-date-select .Select-input > input {
  line-height: 44px;
  font-size: 14px;
}

.app-landing .upload-date-select .Select-arrow-zone {
  position: absolute;
  right: 6px;
  top: 0;
  bottom: 0;
  width: 28px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
}

.app-landing .upload-date-select .Select-arrow-zone .Select-arrow {
  margin: 0;
  padding: 0;
  display: block;
  line-height: 0;
  border-top-color: #64748b;
}

.app-landing .upload-date-select .Select-menu-outer {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgb(15 23 42 / 10%);
  margin-top: 4px;
}

.app-landing .upload-step-content .field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 10px;
  display: block;
}

.app-landing .upload-radio {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-landing .upload-radio label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  line-height: 1.4;
}

.app-landing .upload-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.app-landing .upload-btn-back {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease;
}

.app-landing .upload-btn-back:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.app-landing .upload-btn-next,
.app-landing .upload-btn-submit {
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  border: 0;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 1px 3px rgb(37 99 235 / 30%);
  transition:
    background 0.12s ease,
    box-shadow 0.12s ease,
    transform 0.12s ease;
}

.app-landing .upload-btn-next:hover,
.app-landing .upload-btn-submit:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgb(37 99 235 / 35%);
  transform: translateY(-1px);
}

.app-landing .upload-btn-next:focus-visible,
.app-landing .upload-btn-submit:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.app-landing .upload-browse {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  transition:
    border-color 0.12s ease,
    background 0.12s ease;
  margin-bottom: 0;
  max-width: 420px;
}

.app-landing .upload-browse:hover {
  border-color: #3b82f6;
  background: #f0f9ff;
}

.app-landing .upload-browse-text {
  font-weight: 600;
  font-size: 14px;
  color: #2563eb;
}

.app-landing .upload-filename {
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
}

.app-landing .upload-status-loading-wrap {
  min-height: 44px;
  margin-top: 8px;
}

.app-landing .upload-status-loading {
  min-height: 44px;
}

/* Upload Progress Indicator */
.app-landing .upload-progress-block {
  margin: 24px 0;
  padding: 24px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.app-landing .upload-progress-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 20px;
  text-align: center;
}

.app-landing .progress-steps-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.app-landing .progress-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.app-landing .progress-step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #94a3b8;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.app-landing .progress-step.active .progress-step-number {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 0 0 4px rgb(37 99 235 / 20%);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.app-landing .progress-step.complete .progress-step-number {
  background: #22c55e;
  color: #fff;
}

.app-landing .progress-step.error .progress-step-number {
  background: #ef4444;
  color: #fff;
}

.app-landing .progress-step-label {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  text-align: center;
}

.app-landing .progress-step.active .progress-step-label {
  color: #1e293b;
  font-weight: 600;
}

.app-landing .progress-step.complete .progress-step-label {
  color: #059669;
}

.app-landing .progress-step.error .progress-step-label {
  color: #dc2626;
}

.app-landing .upload-progress-message {
  text-align: center;
  font-size: 13px;
  color: #475569;
  font-weight: 500;
  min-height: 20px;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.app-landing .study-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 4px 4px rgb(0 0 0 / 25%);
  width: min(980px, 100%);
}

.app-landing .study-tab {
  border: 0;
  background: #fff;
  padding: 14px 10px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 140ms ease,
    color 140ms ease;
}

.app-landing .study-tab + .study-tab {
  border-left: 1px solid #e2e8f0;
}

.app-landing .study-tab:hover {
  background: rgb(15 23 42 / 4%);
}

.app-landing .study-tab:focus-visible {
  outline: 3px solid rgb(37 99 235 / 25%);
  outline-offset: -3px;
}

.app-landing .study-tab.active {
  background: rgb(37 99 235 / 10%);
  color: rgb(31 77 122 / 95%);
  box-shadow: inset 0 0 0 2px rgb(37 99 235 / 22%);
}

.app-landing .study-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  margin-bottom: 16px;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--border);
}

.app-landing .study-toolbar-left,
.app-landing .study-toolbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-landing .study-toolbar-left {
  flex: 1 1 360px;
  justify-content: flex-start;
  min-width: min(100%, 280px);
}

.app-landing .study-toolbar-right {
  flex: 0 1 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.app-landing .study-pager {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.app-landing .study-pager-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-landing .study-pager-bottom {
  display: flex;
  justify-content: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.app-landing .study-view-toggle {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #334155;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

.app-landing .study-view-toggle:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

.app-landing .study-view-toggle:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.app-landing .study-view-toggle:disabled:hover {
  background: #fff;
  border-color: #e2e8f0;
  color: #334155;
}

/* Study Explorer toolbar buttons: use the global .btn theme but keep them compact */
.app-landing .study-toolbar-btn {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  border: 0;
  color: #fff;
  background: var(--nav-active);
  box-shadow: 0 10px 18px rgb(15 23 42 / 12%);
}

.app-landing .study-toolbar-btn:hover {
  transform: none; /* avoid toolbar jitter */
  filter: brightness(0.95);
}

.app-landing .study-toolbar-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

.app-landing .study-toolbar-btn:disabled:hover {
  border-color: var(--border);
  box-shadow: none;
}

.app-landing .study-view-toggle:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.app-landing .study-count-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-landing .study-count-wrap.pill {
  padding: 6px 10px;
}

.app-landing .study-count-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #64748b;
  white-space: nowrap;
}

.app-landing .study-search-input {
  width: clamp(280px, 38vw, 440px);
  max-width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgb(15 23 42 / 4%);
}

.app-landing .study-search-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.app-landing .study-search-input:focus {
  border-color: #93c5fd;
  outline: 0;
  box-shadow: 0 0 0 3px rgb(59 130 246 / 14%);
}

.app-landing .study-count-test {
  min-width: 80px;
}

.app-landing .study-count-test .Select-control {
  min-height: 38px;
  min-width: 88px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  border-color: #e2e8f0;
  overflow: visible;
}

.app-landing .study-count-test .Select-control:hover {
  border-color: #cbd5e1;
}

.app-landing .study-count-test .Select-value,
.app-landing .study-count-test .Select-value-label {
  overflow: visible;
  text-overflow: clip;
  color: #334155;
}

/* Study table – enterprise data grid */
.app-landing .study-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgb(15 23 42 / 6%);
  table-layout: fixed;
}

.app-landing .study-table tbody td {
  padding: 0;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  overflow: visible;
}

.app-landing .study-table tr:last-child td {
  border-bottom: 0;
}

.app-landing .study-table-th {
  padding: 14px 20px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1.3;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  box-sizing: border-box;
}

.app-landing .study-table-th-study {
  width: 56%;
}

.app-landing .study-table-th-company {
  width: 44%;
}

.app-landing .study-table-row {
  transition: background 0.12s ease;
}

.app-landing .study-table-row:hover {
  background: #f8fafc;
}

.app-landing .study-table-row.active {
  background: rgb(52 178 127 / 8%);
}

.app-landing .study-table-row.active .study-table-cell {
  box-shadow: inset 3px 0 0 var(--nav-active);
}

.app-landing .study-table-row.active .study-table-cell-company {
  box-shadow: none;
}

.app-landing .study-table-cell {
  padding: 0;
  overflow: visible;
}

.app-landing .study-table-cell-company {
  padding: 0;
}

.app-landing .study-table-btn {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.45;
  color: #334155;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease;
  box-sizing: border-box;
  overflow: visible;
  overflow-wrap: anywhere;
}

.app-landing .study-table-company {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  box-sizing: border-box;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: #475569;
  overflow-wrap: anywhere;
}

.app-landing .study-table-btn:hover {
  background: transparent;
  color: #1e293b;
}

.app-landing .study-table-row.active .study-table-btn {
  color: var(--text);
  font-weight: 700;
}

.app-landing .study-table-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.app-landing .study-collection {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  width: 100%;
}

.app-landing .study-card {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 84px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow:
    0 1px 2px rgb(15 23 42 / 3.5%),
    0 10px 22px rgb(15 23 42 / 3%);
  cursor: pointer;
  padding: 0;
  text-align: left;
  overflow: hidden;
  transition:
    background 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease,
    transform 0.14s ease;
}

.app-landing .study-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: transparent;
  transition: background 0.14s ease;
}

.app-landing .study-card:hover {
  background: #f8fafc;
  border-color: #b6c3d4;
  box-shadow: 0 10px 24px rgb(15 23 42 / 9%);
  transform: translateY(-1px);
}

.app-landing .study-card:hover::before {
  background: #94a3b8;
}

.app-landing .study-card:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.app-landing .study-company-groups {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
}

.app-landing .study-company-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.app-landing .study-company-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  padding: 0 2px 9px;
  border-bottom: 1px solid #e2e8f0;
}

.app-landing .study-company-header::before {
  content: "";
  flex: 0 0 auto;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--nav-active);
}

.app-landing .study-company-heading {
  margin: 0;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: #1e293b;
  overflow-wrap: anywhere;
}

.app-landing .study-company-footer {
  display: flex;
  justify-content: flex-end;
  padding: 2px 2px 0;
}

.app-landing .study-company-count {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: #475569;
}

.app-landing .study-card.active {
  background: #f4fbf8;
  border-color: var(--nav-active);
  box-shadow: 0 10px 24px rgb(15 23 42 / 10%);
}

.app-landing .study-card.active::before {
  background: var(--nav-active);
}

.app-landing .study-card-inner {
  min-height: 84px;
  padding: 14px 16px 12px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  box-sizing: border-box;
}

.app-landing .study-card-title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: #334155;
  overflow-wrap: anywhere;
}

.app-landing .study-card.active .study-card-title {
  font-weight: 600;
  color: var(--text);
}

.app-landing .study-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 0;
}

.app-landing .study-card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: #475569;
  white-space: nowrap;
}

.app-landing .study-card-action::after {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 1.5px solid currentcolor;
  border-right: 1.5px solid currentcolor;
  transform: rotate(45deg);
  margin-left: 1px;
}

.app-landing .study-card:hover .study-card-action,
.app-landing .study-card.active .study-card-action {
  color: var(--nav-active);
}

.app-landing .study-card-sub {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  line-height: 1.4;
}

/* Study load modal – enterprise dialog */
.app-landing .study-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  animation: study-modal-fade-in 0.2s ease-out;
}

@keyframes study-modal-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.app-landing .study-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 23 42 / 48%);
  border: none;
  cursor: pointer;
  padding: 0;
}

.app-landing .study-modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow:
    0 4px 6px -1px rgb(15 23 42 / 8%),
    0 20px 40px -8px rgb(15 23 42 / 15%);
  animation: study-modal-scale-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes study-modal-scale-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.app-landing .study-modal-inner {
  padding: 28px 32px 32px;
  position: relative;
}

.app-landing .study-modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}

.app-landing .study-modal-close-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

.app-landing .study-modal-close-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.app-landing .study-modal-title {
  margin: 0 44px 24px 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: #1e293b;
}

.app-landing .study-modal-message {
  margin: 0;
  color: #475569;
  line-height: 1.5;
}

.app-landing .study-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-landing .study-modal-actions .field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 8px;
  display: block;
}

.app-landing .study-modal-actions .field {
  width: 100%;
}

.app-landing .study-modal-actions .study-load-date-select {
  width: 100%;
  min-width: 0;
}

.app-landing .study-modal-actions .study-load-date-select .Select-value,
.app-landing .study-modal-actions .study-load-date-select .Select-value-label,
.app-landing .study-modal-actions .study-load-date-select .Select-option {
  white-space: normal;
  line-height: 1.35;
}

.app-landing .study-modal-actions .study-load-date-select .Select-control {
  min-height: 40px;
  height: auto;
}

.app-landing .study-modal-actions .study-load-date-select .Select-value,
.app-landing .study-modal-actions .study-load-date-select .Select-placeholder {
  line-height: 40px;
}

.app-landing .study-modal-actions .load {
  margin-top: 4px;
  margin-right: 0;
  height: 34px;
  padding: 0 16px;
  border-radius: 10px;
  border: 0;
  background: linear-gradient(90deg, #00bc7d 0%, #00bba7 100%);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 12px rgb(0 0 0 / 12%);
  transition:
    transform 120ms ease,
    box-shadow 120ms ease;
}

.app-landing .study-modal-actions .study-modal-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.app-landing .study-modal-actions .load:hover {
  background: linear-gradient(90deg, #00a86b 0%, #00a392 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgb(0 0 0 / 14%);
}

.app-landing .study-modal-actions .load:active {
  transform: translateY(0);
  box-shadow: 0 6px 12px rgb(0 0 0 / 12%);
}

.app-landing .study-modal-actions .load:focus-visible {
  outline: 3px solid rgb(0 187 167 / 35%);
  outline-offset: 4px;
}

.app-landing .banner {
  margin-top: 14px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgb(51 65 85 / 85%);
  width: min(980px, 100%);
  box-shadow: 0 4px 4px rgb(0 0 0 / 25%);
}

.app-landing .pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #00bc7d;
}

.app-landing .banner-strong {
  color: rgb(15 23 42 / 92%);
  font-weight: 800;
}

.app-landing .empty {
  margin-top: 16px;
  padding: 20px 18px;
  border: 1px dashed rgb(226 232 240 / 100%);
  border-radius: 12px;
  background: rgb(255 255 255 / 82%);
  width: min(980px, 100%);
}

.app-landing .empty-title {
  font-weight: 800;
  color: rgb(15 23 42 / 88%);
}

.app-landing .empty-sub {
  margin-top: 6px;
  font-size: 13px;
}

.app-landing .card {
  margin-top: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 4px rgb(0 0 0 / 25%);
  width: min(980px, 100%);
}

.app-landing .card-inner {
  padding: 18px;
}

.app-landing .hint {
  font-size: 12px;
  color: rgb(51 65 85 / 75%);
  margin-bottom: 10px;
}

.app-landing .row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.app-landing .field {
  display: grid;
  gap: 6px;
  width: 280px;
}

.app-landing .field-label {
  font-size: 12px;
  font-weight: 700;
  color: rgb(51 65 85 / 85%);
}

.app-landing .select {
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgb(15 23 42 / 18%);
  padding: 0 34px 0 10px;
  background: #fff;
  color: rgb(15 23 42 / 90%);
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgb(15 23 42 / 55%) 50%),
    linear-gradient(135deg, rgb(15 23 42 / 55%) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 16px) 14px,
    calc(100% - 11px) 14px,
    100% 0;
  background-size:
    5px 5px,
    5px 5px,
    2.5em 2.5em;
  background-repeat: no-repeat;
}

.app-landing .select:focus {
  outline: none;
  border-color: rgb(0 187 167 / 65%);
  box-shadow: 0 0 0 4px rgb(0 187 167 / 18%);
}

/* Dash `dcc.Dropdown` — remove native .select triangle so only react-select arrow shows */
.app-landing .dd-select.Select,
.app-landing .dd-select.select {
  background-image: none;
  background-position: unset;
  background-size: unset;
  background-repeat: unset;
}

.app-landing .dd-select .Select-control {
  height: 34px;
  min-width: 100px;
  border-radius: 10px;
  border: 1px solid rgb(15 23 42 / 18%);
  background: #fff;
  box-shadow: none;
  overflow: visible;
}

.app-landing .dd-select.is-focused .Select-control {
  border-color: rgb(0 187 167 / 65%);
  box-shadow: 0 0 0 4px rgb(0 187 167 / 18%);
}

.app-landing .dd-select .Select-placeholder,
.app-landing .dd-select .Select-value {
  line-height: 34px;
  overflow: visible;
  text-overflow: clip;
}

.app-landing .dd-select .Select-input {
  height: 34px;
}

.app-landing .dd-select .Select-input > input {
  line-height: 34px;
}

.app-landing .dd-select .Select-value-label {
  color: rgb(15 23 42 / 90%);
  overflow: visible;
  text-overflow: clip;
}

.app-landing .dd-select .Select-arrow-zone {
  padding-right: 10px;
}

.app-landing .dd-select .Select-menu-outer {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgb(15 23 42 / 12%);
  box-shadow: 0 10px 24px rgb(15 23 42 / 10%);
}

/* Upload wizard Data Date dropdown — !important overrides react-select inline/default styles */
#upload-date-wrapper {
  width: 100% !important;
  min-width: 200px !important;
}

#upload-date-wrapper .Select-control {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  min-height: 44px !important;
  height: 44px !important;
  min-width: 200px !important;
  border-radius: 10px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  padding: 0 14px !important;
  padding-right: 36px !important;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
  overflow: visible !important;
}

#upload-date-wrapper .Select-control:hover {
  border-color: #cbd5e1 !important;
}

#upload-date-wrapper .Select.is-focused .Select-control {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgb(59 130 246 / 15%) !important;
}

#upload-date-wrapper .Select-placeholder,
#upload-date-wrapper .Select-value {
  line-height: 44px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #334155 !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

#upload-date-wrapper .Select-value-label {
  overflow: visible !important;
  text-overflow: clip !important;
}

#upload-date-wrapper .Select-input {
  height: 44px !important;
  line-height: 44px !important;
}

#upload-date-wrapper .Select-input > input {
  line-height: 44px !important;
  font-size: 14px !important;
}

#upload-date-wrapper .Select-arrow-zone {
  position: absolute !important;
  right: 6px !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  background: transparent !important;
}

#upload-date-wrapper .Select-arrow-zone .Select-arrow {
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  line-height: 0 !important;
  border-top-color: #64748b !important;
}

#upload-date-wrapper .Select-menu-outer {
  border-radius: 10px !important;
  overflow: hidden !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 12px rgb(15 23 42 / 10%) !important;
  margin-top: 4px !important;
}

.app-landing .load {
  min-height: 38px;
  padding: 0 18px;
  border-radius: 10px;
  border: 0;
  background: #3b82f6;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.12s ease,
    box-shadow 0.12s ease;
}

.app-landing .load:hover {
  background: #2563eb;
}

.app-landing .load:active {
  background: #1d4ed8;
}

.app-landing .load:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Data Explorer – enterprise grid */
.app-landing .data-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}

.app-landing .data-grid .card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgb(15 23 42 / 6%);
  width: auto;
  margin-top: 0;
}

.app-landing .objectives-inner {
  padding: 20px;
  display: grid;
  gap: 8px;
}

.app-landing .obj-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}

.app-landing .obj-btn {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

.app-landing .obj-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

.app-landing .obj-btn.active {
  background: #f0f9ff;
  border-color: #3b82f6;
  color: #1e40af;
  font-weight: 600;
}

.app-landing .obj-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.app-landing .details-inner {
  padding: 24px;
}

.app-landing .details-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: #1e293b;
}

.app-landing .details-body {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: #64748b;
}

.app-landing .details-hint {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.45;
}

@media (width <= 680px) {
  .app-landing .content {
    padding: 14px 14px 0;
  }

  .app-landing .top-tabs-wrap {
    padding: 12px 14px 0;
  }

  .app-landing .top-tabs {
    gap: 12px;
    padding-bottom: 10px;
  }

  .app-landing .study-tabs {
    grid-template-columns: 1fr;
  }

  .app-landing .study-tab + .study-tab {
    border-left: 0;
    border-top: 1px solid #e2e8f0;
  }

  .app-landing .study-collection .study-card {
    min-width: 100%;
    max-width: 100%;
  }

  .app-landing .field {
    width: 100%;
  }

  .app-landing .data-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   10. Enrollment & placeholder pages
   -------------------------------------------------------------------------- */
.enrollment-page .wrap {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.enrollment-page .panel {
  background: #fff;
  border: 1px solid rgb(15 23 42 / 10%);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgb(15 23 42 / 10%);
}

.enrollment-page .panel-inner {
  padding: 18px;
}

.enrollment-page .head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.enrollment-page .title {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.enrollment-page .sub {
  font-size: 13px;
  margin-top: 2px;
}

.enrollment-page .date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgb(15 23 42 / 10%);
  background: rgb(15 23 42 / 2%);
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}

.enrollment-page .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2fbf71;
}

.enrollment-page .kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.enrollment-page .kpi {
  border-radius: 14px;
  padding: 14px;
  color: white;
  position: relative;
  overflow: hidden;
  min-height: 96px;
}

.enrollment-page .kpi::after {
  content: "";
  position: absolute;
  top: -24px;
  right: -24px;
  width: 74px;
  height: 74px;
  border-radius: 999px;
  background: rgb(255 255 255 / 18%);
}

.enrollment-page .kpi-top {
  display: flex;
  justify-content: flex-start;
}

.enrollment-page .kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgb(255 255 255 / 18%);
  border: 1px solid rgb(255 255 255 / 22%);
  font-size: 13px;
}

.enrollment-page .kpi-value {
  margin-top: 10px;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.enrollment-page .kpi-label {
  opacity: 0.9;
  font-weight: 800;
  font-size: 12px;
}

.enrollment-page .kpi.blue {
  background: linear-gradient(
    135deg,
    rgb(94 171 227 / 95%),
    rgb(66 153 225 / 85%)
  );
}

.enrollment-page .kpi.navy {
  background: linear-gradient(135deg, rgb(32 66 98 / 95%), rgb(15 23 42 / 85%));
}

.enrollment-page .kpi.green {
  background: linear-gradient(
    135deg,
    rgb(74 222 128 / 95%),
    rgb(34 197 94 / 85%)
  );
}

.enrollment-page .kpi.orange {
  background: linear-gradient(
    135deg,
    rgb(249 115 22 / 95%),
    rgb(245 158 11 / 85%)
  );
}

.enrollment-page .bars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.enrollment-page .bar-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
}

.enrollment-page .val {
  font-weight: 900;
  color: rgb(15 23 42 / 88%);
}

.enrollment-page .track {
  height: 6px;
  border-radius: 999px;
  background: rgb(15 23 42 / 8%);
  overflow: hidden;
  margin-top: 8px;
}

.enrollment-page .fill {
  height: 100%;
  border-radius: 999px;
}

.enrollment-page .section {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.enrollment-page .chart {
  position: relative;
  height: 240px;
  border-radius: 14px;
  border: 1px solid rgb(15 23 42 / 8%);
  background: rgb(255 255 255 / 70%);
  overflow: hidden;
}

.enrollment-page .grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
}

.enrollment-page .line {
  border-right: 1px solid rgb(15 23 42 / 5%);
}

.enrollment-page .spark {
  position: absolute;
  inset: 28px 16px 16px;
}

/* When the sparkline is an <img>, make it behave like the Vue <svg>. */
.enrollment-page img.spark {
  width: 100%;
  height: 100%;
  display: block;
}

@media (width <= 1100px) {
  .enrollment-page .kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .enrollment-page .bars {
    grid-template-columns: 1fr;
  }
}

/* Placeholder page */
.placeholder-page .wrap {
  padding: 16px;
}

.placeholder-page .panel {
  background: #fff;
  border: 1px solid rgb(15 23 42 / 10%);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgb(15 23 42 / 10%);
}

.placeholder-page .panel-inner {
  padding: 18px 18px 16px;
}

.placeholder-page .title {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: -0.02em;
  text-transform: capitalize;
}

/* --------------------------------------------------------------------------
   11. Dashboard pages
   (Study dashboard, Adverse events, Efficacy, Patient profile, Labs)
   -------------------------------------------------------------------------- */

/* Dashboard base — typography & layout */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  color: #1a1a1a;
}

.main-container {
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
  font-family: Inter, sans-serif;
  color: #2c3e50;
}

/* Demo page: keep filters visible while scrolling */
.demo-filters-sticky {
  position: sticky;
  top: 12px;
  z-index: 50;
  backdrop-filter: blur(6px);
}

/* Demo page: floating expandable filters box */
.demo-filters-float {
  position: fixed;
  top: auto !important;
  bottom: 18px !important;
  right: 18px;
  width: 360px;
  max-width: calc(100vw - 36px);
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 12px 40px rgb(0 0 0 / 18%);
  z-index: 2500;
}

.demo-filters-float:not(.open) {
  /* collapsed: header-only pill look */
  box-shadow: 0 10px 30px rgb(0 0 0 / 18%);
}

.demo-filters-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border: none;
  background: linear-gradient(135deg, #1d4ed8 0%, #06b6d4 100%);
  color: #fff;
  text-align: left;
  border-radius: 18px;
}

.demo-filters-float.open .demo-filters-toggle {
  border-radius: 0 0 18px 18px;
}

.demo-filters-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-filters-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(255 255 255 / 22%);
  box-shadow: 0 10px 20px rgb(0 0 0 / 12%);
  font-size: 18px;
}

.demo-filters-toggle:focus {
  outline: none;
}

.demo-filters-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.demo-filters-title {
  font-weight: 700;
  font-size: 18px;
  line-height: 1.1;
}

.demo-filters-subtitle {
  font-size: 12px;
  opacity: 0.95;
}

.demo-filters-caret {
  font-size: 18px;
  opacity: 0.95;
  margin-left: 12px;
  transition: transform 160ms ease;
}

.demo-filters-caret.open {
  transform: rotate(180deg);
}

.demo-filters-body {
  background: #fff;
  padding: 16px 16px 18px;
  border: 1px solid rgb(15 23 42 / 8%);
  border-bottom: none;
  border-radius: 18px 18px 0 0;

  /* Fit within viewport when expanded */
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.demo-filters-section-title {
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
  background: #f1f5f9;
  border: 1px solid rgb(15 23 42 / 8%);
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.demo-filter-row {
  margin-bottom: 12px;
}

.demo-filter-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #334155;
  text-transform: uppercase;
  margin-bottom: 6px;
}

@media (width <= 576px) {
  .demo-filters-float {
    top: auto !important;
    bottom: 10px !important;
    right: 10px;
    width: auto;
  }
}

.dash-slider-container {
  gap: 32px !important;
}

/* Cards */
.custom-card {
  background: #fff;
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgb(0 0 0 / 5%);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;

  /* Base z-index */
}

/* Ensure cards with dropdowns that are being interacted with appear on top */
.custom-card:focus-within {
  z-index: 10;
}

/* Specifically for the study selector card which is at the top */
.study-selector-card {
  z-index: 5;
}

.custom-card:hover {
  box-shadow: 0 8px 30px rgb(0 0 0 / 8%);
}

.card-header-custom {
  background: #fff;
  padding: 1.5rem;
  border-bottom: 1px solid #edf2f7;
  border-radius: 16px 16px 0 0;

  /* Keep header clipped to card radius */
}

.card-title-custom {
  margin: 0;
  font-size: 1.25rem;
  color: #2d3748;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body-custom {
  padding: 1.5rem;
}

/* Dashboard dropdowns */
.main-container .Select-control {
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  padding: 2px !important;
  box-shadow: none !important;
  background-color: #f8fafc !important;
}

.main-container .Select-control:hover {
  border-color: #cbd5e0 !important;
}

.main-container .Select-menu-outer {
  border-radius: 8px !important;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 10%) !important;
  border: 1px solid #e2e8f0 !important;
  margin-top: 4px !important;
  z-index: 1000 !important;
  background-color: #fff !important;
}

.main-container .dash-dropdown .Select-value-label {
  color: #4a5568 !important;
}

/* Metric Items */
.metric-container {
  padding: 10px;
  border-radius: 8px;
  background-color: #f8fafc;
  border: 1px solid #edf2f7;
  height: 100%;
}

.metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #718096;
  margin-bottom: 4px;
  font-weight: 600;
}

.metric-value {
  font-size: 1rem;
  font-weight: 500;
  color: #2d3748;
}

.metric-value.highlight-red {
  color: #e53e3e;
  font-weight: 700;
}

.metric-value.highlight-green {
  color: #38a169;
  font-weight: 700;
}

/* Graph Container */
.graph-container {
  background: #fff;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 4px 20px rgb(0 0 0 / 5%);
}

/* Animations */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fade-in 0.5s ease-out forwards;
}

/* Utility */
.mb-custom {
  margin-bottom: 1.5rem;
}

.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #e2e8f0, transparent);
  margin: 2rem 0;
}

/* Patient profile — metric cards */
.patient-metric-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 2px 12px rgb(0 0 0 / 4%);
  position: relative;
  overflow: hidden;
  height: 100%;
  border: 1px solid rgb(0 0 0 / 3%);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.patient-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgb(0 0 0 / 8%);
}

.patient-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 20px;
}

.patient-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8c9097;
  margin-bottom: 8px;
}

.patient-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a202c;
  line-height: 1.2;
}

.patient-card-decoration {
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0.1;
  z-index: 0;
}

/* Patient profile — color themes */

/* Blue - Patient ID */
.theme-blue .patient-icon-circle {
  background-color: #3b82f6;
  color: white;
  box-shadow: 0 4px 12px rgb(59 130 246 / 30%);
}

.theme-blue .patient-card-decoration {
  background-color: #3b82f6;
}

/* Purple - Age */
.theme-purple .patient-icon-circle {
  background-color: #8b5cf6;
  color: white;
  box-shadow: 0 4px 12px rgb(139 92 246 / 30%);
}

.theme-purple .patient-card-decoration {
  background-color: #8b5cf6;
}

/* Pink - Sex */
.theme-pink .patient-icon-circle {
  background-color: #ec4899;
  color: white;
  box-shadow: 0 4px 12px rgb(236 72 153 / 30%);
}

.theme-pink .patient-card-decoration {
  background-color: #ec4899;
}

/* Orange - Race */
.theme-orange .patient-icon-circle {
  background-color: #f97316;
  color: white;
  box-shadow: 0 4px 12px rgb(249 115 22 / 30%);
}

.theme-orange .patient-card-decoration {
  background-color: #f97316;
}

/* Green - Consent */
.theme-green .patient-icon-circle {
  background-color: #10b981;
  color: white;
  box-shadow: 0 4px 12px rgb(16 185 129 / 30%);
}

.theme-green .patient-card-decoration {
  background-color: #10b981;
}

/* Teal - Completion */
.theme-teal .patient-icon-circle {
  background-color: #06b6d4;
  color: white;
  box-shadow: 0 4px 12px rgb(6 182 212 / 30%);
}

.theme-teal .patient-card-decoration {
  background-color: #06b6d4;
}

/* New Accents for Adverse Events dashboard */
.theme-crimson .patient-icon-circle {
  background-color: #e74c3c;
  color: white;
  box-shadow: 0 4px 12px rgb(231 76 60 / 30%);
}

.theme-crimson .patient-card-decoration {
  background-color: #e74c3c;
}

.theme-navy .patient-icon-circle {
  background-color: #1f2937;
  color: white;
  box-shadow: 0 4px 12px rgb(31 41 55 / 30%);
}

.theme-navy .patient-card-decoration {
  background-color: #1f2937;
}

.theme-amber .patient-icon-circle {
  background-color: #f59e0b;
  color: white;
  box-shadow: 0 4px 12px rgb(245 158 11 / 30%);
}

.theme-amber .patient-card-decoration {
  background-color: #f59e0b;
}

.theme-tealbright .patient-icon-circle {
  background-color: #10b981;
  color: white;
  box-shadow: 0 4px 12px rgb(16 185 129 / 30%);
}

.theme-tealbright .patient-card-decoration {
  background-color: #10b981;
}

.theme-violet .patient-icon-circle {
  background-color: #7c3aed;
  color: white;
  box-shadow: 0 4px 12px rgb(124 58 237 / 30%);
}

.theme-violet .patient-card-decoration {
  background-color: #7c3aed;
}

.theme-cyan .patient-icon-circle {
  background-color: #06b6d4;
  color: white;
  box-shadow: 0 4px 12px rgb(6 182 212 / 30%);
}

.theme-cyan .patient-card-decoration {
  background-color: #06b6d4;
}

/* Patient profile — header */
.patient-header-title {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0;
}

.patient-status-badge {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  margin-right: 8px;
}

.patient-status-text {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

/* Patient profile — medical history */
.medical-history-card .card-body-custom {
  padding: 1.5rem;
}

.medical-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.history-item-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 2px 10px rgb(0 0 0 / 4%);
  height: 100%;
}

.history-item-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.history-item-date {
  font-size: 0.9rem;
  color: #6b7280;
}

.history-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
  border: 1px solid transparent;
}

.history-pill.severity-mild {
  color: #0f9b6c;
  background: #ecfdf3;
  border-color: #a7f3d0;
}

.history-pill.severity-moderate {
  color: #c27803;
  background: #fff7ed;
  border-color: #fcd9bd;
}

.history-pill.severity-severe {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecdd3;
}

.history-pill.severity-unknown {
  color: #4b5563;
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.medical-history-empty {
  padding: 4px 0;
  font-weight: 500;
}

/* Adverse events — floating filter */
.adverse-events-page .floating-filter-container {
  position: fixed;
  top: 140px;
  right: 48px;
  z-index: 1200;
}

.adverse-events-page .floating-filter-button {
  background-color: #fff !important;
  color: #0f172a !important;
  border: none !important;
  border-radius: 999px;
  box-shadow: 0 20px 45px rgb(15 23 42 / 25%);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.adverse-events-page .floating-filter-button:hover,
.adverse-events-page .floating-filter-button:focus {
  box-shadow: 0 24px 50px rgb(15 23 42 / 30%);
  transform: translateY(-2px);
}

.adverse-events-page .floating-filter-offcanvas.offcanvas {
  --bs-offcanvas-width: 380px;

  background: transparent;
  border: none;
}

.adverse-events-page .floating-filter-offcanvas .offcanvas-body {
  padding: 0;
  background: transparent;
}

.adverse-events-page .floating-filter-card {
  margin-bottom: 0;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgb(15 23 42 / 18%);
}

.adverse-events-page .floating-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border: none;
}

.adverse-events-page .floating-filter-close-btn {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0 !important;
  background-color: #f8fafc !important;
  color: #475569 !important;
}

.adverse-events-page .floating-filter-body {
  padding-top: 1rem;
}

@media (width <= 1199.98px) {
  .adverse-events-page .floating-filter-container {
    top: 100px;
    right: 32px;
  }
}

@media (width <= 767.98px) {
  .adverse-events-page .floating-filter-container {
    top: 80px;
    right: 16px;
  }

  .adverse-events-page .floating-filter-button {
    padding: 0.6rem 1.2rem;
  }

  .adverse-events-page .floating-filter-offcanvas.offcanvas {
    --bs-offcanvas-width: min(94vw, 360px);
  }
}

/* Study dashboard */

/* Colorful Top Stats Cards */
.stat-card {
  border-radius: 16px;
  padding: 24px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 10px 15px -3px rgb(0 0 0 / 10%),
    0 4px 6px -2px rgb(0 0 0 / 5%);
  transition: transform 0.2s;
  height: 100%;
  container-type: inline-size;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card.blue {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

.stat-card.orange {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.stat-card.green {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.stat-card.red {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

.stat-card.purple {
  background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
}

.stat-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 1.5rem;
  opacity: 0.8;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-decoration {
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgb(255 255 255 / 20%);
  pointer-events: none;
}

/* Rate/Progress Section below cards */
.rate-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 10%);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rate-label {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 4px;
  font-weight: 600;
}

.rate-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.rate-change {
  font-size: 0.875rem;
  font-weight: 600;
}

.rate-change.positive {
  color: #10b981;
}

.rate-change.negative {
  color: #ef4444;
}

.custom-progress {
  height: 6px;
  background-color: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  margin-top: auto;
}

.custom-progress-bar {
  height: 100%;
  border-radius: 999px;
}

/* --------------------------------------------------------------------------
   12. Admin page & modals (world-class layout, tables, badges, alerts)
   -------------------------------------------------------------------------- */
.admin-page {
  padding: 32px 24px 48px;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 82px);
  background: transparent;
}

/* Page hero */
.admin-hero {
  margin-bottom: 32px;
  padding: 0 0 24px;
  border-bottom: 1px solid #e2e8f0;
}

.admin-hero-title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: #0f172a;
}

.admin-hero-sub {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: #64748b;
  max-width: 560px;
}

/* Section cards */
.admin-section-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgb(15 23 42 / 6%);
  overflow: hidden;
  margin-bottom: 24px;
}

.admin-section-card:last-of-type {
  margin-bottom: 0;
}

.admin-section-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
}

.admin-section-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: #1e293b;
}

.admin-section-sub {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: #64748b;
}

/* Admin section header actions (e.g., Activity Logs toolbar) */
.admin-page .admin-section-header--with-actions .admin-section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.admin-page .admin-section-header--with-actions .admin-section-title {
  margin: 0;
}

.admin-page .admin-section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-page .activity-clear-btn {
  padding: 8px 12px;
  border-radius: 12px;
}

.admin-section-body {
  padding: 24px;
}

.admin-page .study-access-settings-body {
  padding: 16px 24px 20px;
}

.admin-page .study-access-settings-control {
  display: grid;
  gap: 14px;
  width: 100%;
}

.admin-page .study-access-toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  align-items: start;
  gap: 12px 28px;
}

.admin-page .study-access-setting-row {
  display: grid;
  grid-template-columns: minmax(250px, 1.1fr) minmax(180px, 0.75fr) minmax(
      300px,
      1.4fr
    );
  align-items: center;
  gap: 12px 28px;
}

.admin-page .study-access-setting-row > label,
.admin-page .study-access-setting-row > p,
.admin-page .study-access-setting-row .admin-toggle-list {
  margin: 0;
}

.admin-page .study-access-setting-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-page .admin-toggle-list {
  margin: 0;
  padding-top: 6px;
}

.admin-page .admin-toggle-label {
  display: block;
  min-height: 0;
  margin: 0;
  font-size: inherit;
  font-weight: 400;
  line-height: 1.45;
  color: #1e293b;
}

.admin-page .admin-toggle-input {
  width: auto;
  height: auto;
  margin: 0 6px 0 0;
  vertical-align: middle;
}

.admin-page .study-access-save-btn {
  min-height: 36px;
  padding: 8px 14px;
}

@media (width <= 1050px) {
  .admin-page .study-access-toggle-grid {
    grid-template-columns: 1fr;
  }

  .admin-page .study-access-setting-row {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 1fr);
  }

  .admin-page .study-access-setting-row > p,
  .admin-page .study-access-setting-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (width <= 700px) {
  .admin-page .study-access-setting-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .admin-page .study-access-setting-row > p,
  .admin-page .study-access-setting-actions {
    grid-column: 1;
  }
}

.admin-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-form-row:last-child {
  margin-bottom: 0;
}

.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.admin-form-group .label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #475569;
}

/* Status alerts */
.admin-page #admin-status-message {
  margin-bottom: 16px;
}

.admin-page #admin-status-message:empty {
  display: none;
  margin-bottom: 0;
}

.admin-page #admin-status-message:not(:empty) {
  margin-bottom: 12px;
}

.admin-page .alert {
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-page .alert.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.admin-page .alert.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* Badges for registration status & role */
.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.admin-badge--pending {
  background: #fef3c7;
  color: #b45309;
}

.admin-badge--approved {
  background: #d1fae5;
  color: #065f46;
}

.admin-badge--denied {
  background: #fee2e2;
  color: #b91c1c;
}

.admin-badge--in_review {
  background: #e0e7ff;
  color: #3730a3;
}

.admin-badge--role {
  background: #f1f5f9;
  color: #475569;
}

.admin-badge--activity-auth {
  background: #dbeafe;
  color: #1d4ed8;
}

.admin-badge--activity-users {
  background: #dcfce7;
  color: #166534;
}

.admin-badge--activity-companies {
  background: #fce7f3;
  color: #be185d;
}

.admin-badge--activity-studies {
  background: #fef3c7;
  color: #b45309;
}

.admin-badge--activity-platform {
  background: #e2e8f0;
  color: #334155;
}

.admin-badge--sponsor {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #e2e8f0;
}

/* Tables */
.admin-page .card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgb(15 23 42 / 6%);
  overflow: hidden;
}

.admin-page .study-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  table-layout: fixed;
}

.admin-page .study-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
}

/* Users table: explicit column widths */
.admin-page .study-table.users-table thead th:first-child {
  width: 5%;
}

.admin-page .study-table.users-table thead th:nth-child(2) {
  width: 16%;
}

.admin-page .study-table.users-table thead th:nth-child(3) {
  width: 20%;
}

.admin-page .study-table.users-table thead th:nth-child(4),
.admin-page .study-table.users-table thead th:nth-child(5) {
  width: 5%;
}

.admin-page .study-table.users-table thead th:nth-child(6) {
  width: 6%;
}

.admin-page .study-table.users-table thead th:nth-child(7) {
  width: 12%;
}

.admin-page .study-table.users-table thead th:nth-child(8) {
  width: 8%;
}

.admin-page .study-table.users-table thead th:nth-child(9) {
  width: 23%;
}

/* Activity log tables: stable, readable column sizing + wrapping */
.admin-page .study-table.activity-log-table {
  width: 100%;
  table-layout: fixed;
}

/* Horizontal scroll container for activity logs (Admin + Profile) */
.admin-page .activity-log-scroll {
  max-width: 100%;
  overflow: auto hidden;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.admin-page .activity-log-scroll .study-table.activity-log-table {
  width: 100%;
}

.admin-page .study-table.activity-log-table--admin {
  min-width: 1120px;
}

.admin-page.profile-page .study-table.activity-log-table--profile {
  min-width: 980px;
}

.admin-page .study-table.activity-log-table thead th,
.admin-page .study-table.activity-log-table tbody td {
  min-width: 0;
  box-sizing: border-box;

  /* Add subtle visual separation between columns */
  border-right: 1px solid #f1f5f9;
}

.admin-page .study-table.activity-log-table thead th {
  padding: 10px 14px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.admin-page .study-table.activity-log-table tbody td {
  padding: 10px 14px;
  vertical-align: top;

  /* Row content wraps within column so it does not flow into the next column */
  white-space: normal;
  overflow-wrap: anywhere;
  overflow: hidden;
}

.admin-page .study-table.activity-log-table thead th:last-child,
.admin-page .study-table.activity-log-table tbody td:last-child {
  border-right: 0;
}

.admin-page .study-table.activity-log-table tbody td > * {
  min-width: 0;
  max-width: 100%;
}

.admin-page .study-table.activity-log-table tbody tr:hover {
  background: #f8fafc;
}

.admin-page .study-table.activity-log-table td.activity-log-cell--role {
  white-space: nowrap;
}

.admin-page .study-table.activity-log-table td.activity-log-cell--access {
  padding-top: 6px;
  padding-bottom: 6px;
}

.admin-page .activity-access {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  line-height: 1.25;
}

.admin-page .activity-access-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-page .activity-access-key {
  color: #64748b;
  font-weight: 700;
  white-space: nowrap;
}

.admin-page .activity-access-val {
  color: #334155;
  font-weight: 600;
}

/* Admin activity logs (8 columns): When, Event, User, Company, IP, Device, Role, Access */
.admin-page .study-table.activity-log-table--admin thead th:nth-child(1) {
  width: 12%;
  min-width: 140px;
}

.admin-page .study-table.activity-log-table--admin thead th:nth-child(2) {
  width: 16%;
  min-width: 140px;
}

.admin-page .study-table.activity-log-table--admin thead th:nth-child(3) {
  width: 15%;
  min-width: 140px;
}

.admin-page .study-table.activity-log-table--admin thead th:nth-child(4) {
  width: 13%;
  min-width: 140px;
}

.admin-page .study-table.activity-log-table--admin thead th:nth-child(5) {
  width: 9%;
  min-width: 110px;
}

.admin-page .study-table.activity-log-table--admin thead th:nth-child(6) {
  width: 13%;
  min-width: 160px;
}

.admin-page .study-table.activity-log-table--admin thead th:nth-child(7) {
  width: 10%;
  min-width: 140px;
}

.admin-page .study-table.activity-log-table--admin thead th:nth-child(8) {
  width: 12%;
  min-width: 150px;
}

/* Profile activity logs (7 columns): When, Event, User, IP, Device, Role, Access */
.admin-page.profile-page
  .study-table.activity-log-table--profile
  thead
  th:nth-child(1) {
  width: 14%;
  min-width: 140px;
}

.admin-page.profile-page
  .study-table.activity-log-table--profile
  thead
  th:nth-child(2) {
  width: 20%;
  min-width: 160px;
}

.admin-page.profile-page
  .study-table.activity-log-table--profile
  thead
  th:nth-child(3) {
  width: 18%;
  min-width: 150px;
}

.admin-page.profile-page
  .study-table.activity-log-table--profile
  thead
  th:nth-child(4) {
  width: 10%;
  min-width: 110px;
}

.admin-page.profile-page
  .study-table.activity-log-table--profile
  thead
  th:nth-child(5) {
  width: 16%;
  min-width: 180px;
}

.admin-page.profile-page
  .study-table.activity-log-table--profile
  thead
  th:nth-child(6) {
  width: 12%;
  min-width: 140px;
}

.admin-page.profile-page
  .study-table.activity-log-table--profile
  thead
  th:nth-child(7) {
  width: 10%;
  min-width: 150px;
}

/* Optional: keep IPs on one line (timestamps may wrap when needed) */
.admin-page .study-table.activity-log-table--admin tbody td:nth-child(5),
.admin-page.profile-page
  .study-table.activity-log-table--profile
  tbody
  td:nth-child(4) {
  white-space: nowrap;
}

/* Pager (match studies pager UX, but for admin/profile pages) */
.admin-page .study-pager {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-page .study-pager-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-page .study-pager-bottom {
  display: flex;
  justify-content: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Match the Studies pager button colors on Admin/Profile pages */
.admin-page .btn.study-toolbar-btn {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  border: 0;
  color: #fff;
  background: var(--nav-active);
  box-shadow: 0 10px 18px rgb(15 23 42 / 12%);
}

.admin-page .btn.study-toolbar-btn:hover {
  transform: none;
  filter: brightness(0.95);
}

.admin-page .btn.study-toolbar-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

.admin-page .btn.study-toolbar-btn:disabled:hover {
  border-color: var(--border);
  box-shadow: none;
}

.admin-page .study-table thead th {
  padding: 6px 8px 5px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1.2;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.admin-page .study-table tbody td {
  padding: 4px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  line-height: 1.3;
}

.admin-page .study-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.admin-page .study-table tbody tr:hover {
  background: #f1f5f9;
}

.admin-page .study-table tbody tr:nth-child(even):hover {
  background: #f1f5f9;
}

.admin-page .study-table tbody tr:last-child td {
  border-bottom: 0;
}

/* Users table: horizontal scroll so Actions column (Approve/Deny) does not overlap border */
.admin-page .admin-user-table-wrapper {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  overflow: auto hidden;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.admin-page .study-table.users-table {
  width: 100%;

  /* Big enough to keep Manage/Approve/Deny on one line; wrapper scrolls on smaller viewports. */
  min-width: 1100px;
}

.admin-page .admin-section-body {
  overflow: visible;
}

.admin-page .study-table.users-table tbody td:last-child {
  /* Actions should never wrap; rely on horizontal scroll instead. */
  white-space: nowrap;
  vertical-align: middle;
}

/* Users table: keep compact action buttons from "lifting" out of the row */
.admin-page
  .study-table.users-table
  .admin-actions--compact
  .btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
}

/* Users table: keep action buttons on one line */
.admin-page .study-table.users-table .admin-actions--compact {
  flex-wrap: nowrap;
}

.admin-page .study-table.users-table .admin-actions--compact .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Company registry table: 4 columns, proper widths and spacing */
.admin-page .study-table.registry-table {
  table-layout: fixed;
}

.admin-page .study-table.registry-table thead th:nth-child(1) {
  width: 22%;
  min-width: 140px;
}

.admin-page .study-table.registry-table thead th:nth-child(2) {
  width: 48%;
  min-width: 200px;
}

.admin-page .study-table.registry-table thead th:nth-child(3) {
  width: 12%;
  min-width: 90px;
}

.admin-page .study-table.registry-table thead th:nth-child(4) {
  width: 18%;
  min-width: 140px;
}

.admin-page .study-table.registry-table thead th {
  padding: 12px 16px;
  font-size: 11px;
  white-space: nowrap;
}

.admin-page .study-table.registry-table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
}

.admin-page .study-table.registry-table .registry-cell-sponsor {
  font-weight: 600;
  color: #1e293b;
}

.admin-page .study-table.registry-table .registry-cell-studies {
  min-width: 0;
  white-space: normal;
}

.admin-page
  .study-table.registry-table
  .registry-cell-studies
  .registry-studies-list {
  max-height: 96px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.admin-page
  .study-table.registry-table
  .registry-cell-studies
  .registry-study-item {
  margin-bottom: 6px;
}

.admin-page
  .study-table.registry-table
  .registry-cell-studies
  .registry-study-item:last-child {
  margin-bottom: 0;
}

.admin-page .study-table.registry-table .registry-cell-manage,
.admin-page .study-table.registry-table .registry-cell-actions {
  white-space: nowrap;
  text-align: right;
}

.admin-page .study-table.registry-table .registry-cell-manage .btn,
.admin-page .study-table.registry-table .registry-cell-actions .btn {
  margin: 0;
}

/* Add breathing room between Manage and Actions columns */
.admin-page .study-table.registry-table .registry-cell-manage {
  padding-right: 10px;
}

.admin-page .study-table.registry-table .registry-cell-actions {
  padding-left: 10px;
}

.admin-page .admin-table-email {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-page .study-table.users-table tbody tr.admin-user-row--deleted td {
  background: #fff7f7;
  color: #64748b;
}

.admin-page .study-table.users-table tbody tr.admin-user-row--deleted:hover td {
  background: #fef2f2;
}

.admin-page .admin-user-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}

.admin-page .admin-user-name {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #1f2937;
}

.admin-page .admin-user-row--deleted .admin-user-name {
  color: #475569;
}

.admin-page .admin-user-status-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.admin-page .admin-user-state-text {
  font-weight: 600;
}

.admin-page .admin-user-state-text--deleted {
  color: #991b1b;
}

.admin-page .admin-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-page .admin-actions-dropdown {
  min-width: 120px;
  font-size: 13px;
}

.admin-page .admin-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.admin-page .admin-actions--compact {
  flex-flow: row nowrap;
  gap: 6px;
}

.admin-page .btn.success {
  background: var(--success, #22c55e);
  border-color: var(--success, #22c55e);
  color: white;
}

/* ==========================================================================
   Profile page — World-class UI/UX
   ========================================================================== */

/* Page container and vertical rhythm */
.profile-page {
  max-width: 1000px;
  margin: 0 auto;
  padding-bottom: 48px;
}

/* Hero: compact, with accent bar */
.profile-page .profile-hero,
.admin-page .profile-hero,
.documentation-page .profile-hero {
  position: relative;
  margin-bottom: 28px;
  padding-top: 24px;
  padding-bottom: 26px;
  padding-left: 20px;
  border-left: 4px solid var(--primary, #2563eb);
}

.admin-page .profile-hero {
  margin-bottom: 18px;
  border-left-color: #2563eb;
}

.profile-page .profile-hero-accent,
.admin-page .profile-hero-accent,
.documentation-page .profile-hero-accent {
  display: none;
}

.profile-page .profile-hero-title,
.admin-page .profile-hero-title,
.documentation-page .profile-hero-title {
  margin: 0 0 6px;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #0f172a;
}

.profile-page .profile-hero-sub,
.admin-page .profile-hero-sub,
.documentation-page .profile-hero-sub {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.5;
  color: #64748b;
  max-width: 42ch;
}

/* Status alerts */
.profile-page .profile-status-wrap {
  margin-bottom: 20px;
}

.profile-page .profile-status-wrap .alert {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-page .profile-status-wrap .alert.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.profile-page .profile-status-wrap .alert.danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

/* Inline alerts inside profile modals (e.g., admin transfer validation)
   Keep these consistent with profile status alerts, since the top-of-page
   banner is hidden behind the modal overlay. */
.admin-modal #profile-company-transfer-admin-inline-message .alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.admin-modal #profile-company-transfer-admin-inline-message .alert.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.admin-modal #profile-company-transfer-admin-inline-message .alert.danger {
  background: #fef2f2;
  border: 1px solid var(--danger);
  border-left-width: 5px;
  color: #b91c1c;
  font-weight: 600;
}

/* Make danger alerts read clearly as errors inside modals */
.admin-modal
  #profile-company-transfer-admin-inline-message
  .alert.danger::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-weight: 800;
  flex: 0 0 auto;
  margin-top: 1px;
}

/* Profile card (avatar + identity) */
.profile-page .profile-card-wrap {
  margin-bottom: 32px;
}

.profile-page .profile-quick-nav {
  position: sticky;
  top: 96px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  margin: 0 0 20px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: rgb(255 255 255 / 90%);
  backdrop-filter: blur(6px);
}

.profile-page .profile-quick-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #d6e1f2;
  background: #f8fbff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.profile-page .profile-quick-link:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.profile-page .profile-card.profile-header-card {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 28px 32px;
  background: linear-gradient(145deg, #fff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgb(15 23 42 / 6%);
}

.profile-page .profile-header-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(145deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgb(37 99 235 / 35%);
}

.profile-page .profile-header-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.profile-page .profile-header-name {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.25;
}

.profile-page .profile-header-email {
  margin: 0;
  font-size: 0.9375rem;
  color: #64748b;
}

.profile-page .profile-header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.profile-page .profile-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.profile-page .profile-badge-role {
  background: #f1f5f9;
  color: #475569;
}

.profile-page .profile-badge-company {
  background: #dbeafe;
  color: #1e40af;
}

/* Content grid: two columns on large screens */
.profile-page .profile-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.profile-page .profile-content-grid > * {
  min-width: 0;
  width: 100%;
}

.profile-page .profile-section-card--full {
  grid-column: 1 / -1;
}

.profile-page .profile-section-card,
.profile-page .profile-section-slot,
.profile-page #profile-company-section {
  scroll-margin-top: 156px;
}

.profile-page .profile-section-slot {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Activity Log: header actions */
.profile-page .profile-section-head--with-actions .profile-section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-page .profile-section-head--with-actions .profile-section-title {
  margin: 0;
}

.profile-page .activity-clear-btn {
  padding: 8px 12px;
  border-radius: 12px;
}

.activity-clear-error {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
}

@media (width <= 768px) {
  .profile-page .profile-quick-nav {
    position: static;
  }

  .profile-page .profile-quick-link {
    flex: 1 1 auto;
    min-width: 100px;
  }

  .profile-page .profile-content-grid {
    grid-template-columns: 1fr;
  }
}

/* Section cards */
.profile-page .profile-section-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgb(15 23 42 / 6%);
  overflow: hidden;
}

.profile-page .profile-section-card + .profile-section-card,
.profile-page .profile-section-slot + .profile-section-card,
.profile-page .profile-section-card + .profile-section-slot {
  margin-top: 0;
}

.profile-page .profile-section-head {
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
}

.profile-page .profile-section-title {
  margin: 0 0 4px;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1e293b;
  line-height: 1.3;
}

.profile-page .profile-section-desc {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  color: #64748b;
}

.profile-page .profile-section-body {
  padding: 24px;
}

/* Account meta list (definition list) */
.profile-page .profile-meta-list {
  margin: 0;
  display: grid;
  gap: 2px 24px;
  grid-template-columns: minmax(140px, 180px) 1fr;
  max-width: 100%;
}

.profile-page .profile-meta-row {
  display: contents;
}

.profile-page .profile-meta-row dt {
  margin: 0;
  font-weight: 600;
  font-size: 0.8125rem;
  color: #64748b;
  padding: 6px 0;
}

.profile-page .profile-meta-row dd {
  margin: 0;
  font-size: 0.9375rem;
  color: #1e293b;
  padding: 6px 0;
  overflow-wrap: anywhere;
}

/* Studies: chips + empty state */
.profile-page .profile-studies-body {
  min-height: 44px;
}

.profile-page .profile-studies-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-page .profile-study-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background: #f1f5f9;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #334155;
  border: 1px solid #e2e8f0;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.profile-page .profile-study-chip:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.profile-page .profile-empty-state,
.profile-page .profile-loading-state {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
}

/* Edit profile form */
.profile-page .profile-edit-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-page .profile-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-page .profile-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.01em;
}

.profile-page .profile-input {
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 0.9375rem;
  line-height: 1.35;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #1e293b;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.profile-page .profile-input::placeholder {
  color: #94a3b8;
}

.profile-page .profile-input:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 12%);
}

.profile-page .profile-cookie-consent-body {
  display: grid;
  gap: 14px;
}

.profile-page .profile-cookie-consent-panel {
  display: grid;
  gap: 12px;
}

.profile-page .profile-cookie-consent {
  max-width: 680px;
}

.profile-page .profile-cookie-consent .cookie-consent-title {
  font-size: 0.92rem;
}

.profile-page .profile-cookie-consent-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: #64748b;
  font-size: 0.78rem;
}

.profile-page .profile-cookie-consent-meta-item {
  overflow-wrap: anywhere;
}

/* Buttons */
.profile-page .profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
  text-decoration: none;
  font-family: inherit;
}

.profile-page .profile-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 25%);
}

.profile-page .profile-btn-primary {
  background: var(--primary, #2563eb);
  color: #fff;
  border-color: var(--primary, #2563eb);
}

.profile-page .profile-btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.profile-page .profile-btn-primary:active {
  transform: scale(0.98);
}

/* Security CTA */
.profile-page .profile-security-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-page .profile-security-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.profile-page .profile-security-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid #f1f5f9;
}

.profile-page .profile-security-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.profile-page .profile-security-row--stacked {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.profile-page .profile-security-heading {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
}

.profile-page .profile-security-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}

.profile-page .profile-security-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.profile-page .profile-security-status--enabled {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.profile-page .profile-security-status--muted {
  color: #475569;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.profile-page .profile-security-status--neutral {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.profile-page .profile-security-copy {
  min-width: 0;
}

.profile-page .profile-security-desc {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.profile-page .profile-security-cta {
  width: fit-content;
}

.profile-page .profile-security-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: center;
  gap: 12px;
}

.profile-page .profile-security-action-grid--compact {
  grid-template-columns: minmax(180px, 260px) auto;
}

.profile-page .profile-security-action-grid .profile-btn {
  width: fit-content;
  min-width: 128px;
}

.profile-page .profile-security-subsection {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.profile-page .profile-security-subsection--danger {
  border-color: #fecaca;
  background: #fff7f7;
}

.profile-page .profile-btn-danger {
  color: #fff;
  background: var(--danger, #ef4444);
  border-color: var(--danger, #ef4444);
}

.profile-page .profile-btn-danger:hover {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
}

.profile-page .profile-mfa-setup-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.profile-page .profile-mfa-qr {
  width: 156px;
  height: 156px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.profile-page .profile-mfa-setup-fields,
.profile-page .profile-mfa-confirm-row,
.profile-page .profile-mfa-disable-row,
.profile-page .profile-mfa-recovery-retrieve-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-page .profile-mfa-disable-row {
  gap: 16px;
}

.profile-page .profile-mfa-manual-key {
  display: block;
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.profile-page .profile-mfa-code-input {
  max-width: 260px;
}

.profile-page .profile-mfa-password-input {
  max-width: 260px;
}

.profile-page .profile-mfa-recovery-panel {
  padding: 16px;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: #f0fdf4;
}

.profile-page .profile-mfa-recovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.profile-page .profile-mfa-recovery-code {
  display: block;
  padding: 8px 10px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #fff;
  color: #14532d;
  font-size: 0.8125rem;
  text-align: center;
}

.profile-page .profile-mfa-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.profile-page .profile-mfa-recovery-panel .profile-btn {
  margin-top: 12px;
}

.profile-page .profile-mfa-recovery-actions .profile-btn {
  margin-top: 0;
}

@media (width <= 720px) {
  .profile-page .profile-security-action-grid,
  .profile-page .profile-security-action-grid--compact {
    grid-template-columns: 1fr;
  }

  .profile-page .profile-security-action-grid .profile-btn,
  .profile-page .profile-security-action-grid--compact .profile-btn {
    width: 100%;
  }
}

@media (width <= 480px) {
  .profile-page .profile-security-cta {
    width: 100%;
  }

  .profile-page .profile-security-row {
    align-items: stretch;
    display: flex;
    flex-direction: column;
  }

  .profile-page .profile-security-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .profile-page .profile-mfa-setup-panel {
    grid-template-columns: 1fr;
  }

  .profile-page .profile-mfa-qr {
    width: 148px;
    height: 148px;
  }
}

/* Company management block (in side column) */
.profile-page .profile-company-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-page .profile-company-name {
  font-weight: 600;
  font-size: 1rem;
  color: #1e293b;
}

/* Modals (keep existing behavior) */
.profile-page .profile-manage-note {
  color: #64748b;
  font-size: 0.8125rem;
}

.profile-page .profile-company-studies-in-modal {
  max-height: 120px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.profile-page .profile-company-manage-modal .modal-dialog {
  max-width: 640px;
}

.profile-page .link {
  color: var(--primary, #2563eb);
  text-decoration: underline;
}

.profile-page .link:hover {
  color: #1d4ed8;
}

.admin-page .btn.success:hover {
  filter: brightness(1.05);
}

.admin-page .admin-actions-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-right: 2px;
}

.admin-page .admin-actions .btn {
  white-space: nowrap;
}

.admin-page .admin-actions--compact .btn {
  padding: 5px 10px;
  font-size: 12px;
}

.admin-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease,
    border-color 120ms ease;
}

.admin-page .btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgb(15 23 42 / 8%);
  border-color: rgb(37 99 235 / 30%);
}

.admin-page .btn.primary {
  border: 0;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 2px 8px rgb(37 99 235 / 25%);
}

.admin-page .btn.primary:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgb(37 99 235 / 35%);
}

.admin-page .btn.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: white;
  filter: none;
}

.admin-page .btn.danger:hover:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
  filter: brightness(0.95);
}

.admin-page .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Empty state */
.admin-empty {
  text-align: center;
  padding: 48px 24px;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.admin-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}

/* Admin modals — centered, clear hierarchy */
.admin-modal,
.admin-modal.modal {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 1.75rem;
}

.admin-modal .modal-dialog {
  margin: auto;
  max-width: 420px;
  width: 100%;
}

.admin-modal.admin-manage-modal .modal-dialog {
  max-width: 520px;
}

/* User-manage modal benefits from extra width (lots of controls). */
.admin-modal.admin-user-manage-modal .modal-dialog {
  max-width: 760px;
}

/* Company-manage modal has similar density; match user-manage width. */
.admin-modal.admin-company-manage-modal .modal-dialog {
  max-width: 760px;
}

@media (width <= 720px) {
  .admin-modal.admin-user-manage-modal .modal-dialog {
    max-width: 520px;
  }

  .admin-modal.admin-company-manage-modal .modal-dialog {
    max-width: 520px;
  }
}

.admin-manage-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin: 0 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
}

.admin-modal .modal-content {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow:
    0 8px 24px rgb(15 23 42 / 12%),
    0 24px 48px -12px rgb(15 23 42 / 18%);
  overflow: hidden;
}

.admin-modal .modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.admin-modal .modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: #0f172a;
}

.admin-modal .modal-body {
  padding: 20px 24px;
  background: #fff;
}

/* Manage modals can be tall (many sections). Keep header/footer fixed and
   make the body scroll within the viewport. */
.admin-modal.admin-manage-modal .modal-body {
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.admin-modal .modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  gap: 12px;
}

.admin-modal .stack {
  display: grid;
  gap: 16px;
}

.admin-modal .field {
  display: grid;
  gap: 8px;
}

.admin-modal .label {
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}

.admin-modal .input {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: white;
  outline: none;
  font-size: 14px;
  line-height: 1.4;
  height: 42px;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.admin-modal .input:focus {
  border-color: rgb(37 99 235 / 55%);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 12%);
}

.admin-modal .muted {
  color: var(--muted);
  font-size: 12px;
}

.admin-modal .btn {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}

.admin-modal .btn.primary {
  border: 0;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.admin-modal .btn.primary:hover {
  box-shadow: 0 6px 16px rgb(37 99 235 / 35%);
}

/* Assign studies modal */
.admin-modal .assign-studies-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 48px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/* In the user-manage modal we have more horizontal space, so allow a taller
   list viewport before scrolling to reduce friction. */
.admin-modal.admin-user-manage-modal .assign-studies-list {
  max-height: 340px;
}

.admin-modal.admin-user-manage-modal .assign-study-dropdown {
  min-width: 220px;
}

.admin-modal .assign-study-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

/* Profile → Manage company: member rows should have a header line and a single
   horizontal action bar underneath (never wraps; scrolls horizontally if needed). */
.admin-modal .assign-study-row.profile-company-member-row {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.admin-modal .profile-company-member-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-modal .profile-company-member-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: auto hidden;
  padding-bottom: 2px;
  scrollbar-gutter: stable;
}

/* Buttons: never clip text; allow wrap in member rows */
.admin-modal .btn,
.admin-modal .assign-study-row .btn,
.admin-modal .assign-study-row button,
.profile-page .profile-btn,
.profile-page .btn,
.admin-page .btn {
  white-space: nowrap;
  overflow: visible;
  min-width: max-content;
  flex-shrink: 0;
}

.admin-modal .assign-study-code {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.admin-modal .assign-study-row .assign-study-code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-modal .assign-study-row .assign-study-dropdown {
  flex: 0 0 140px;
  min-width: 140px;
}

.admin-modal.admin-user-manage-modal .assign-study-row .assign-study-dropdown {
  flex-basis: 220px;
}

.admin-modal .assign-study-dropdown {
  flex: 1;
  min-width: 180px;
}

.admin-modal .assign-study-dropdown .Select-control {
  border-radius: 10px;
  border-color: #e2e8f0;
}

.assign-studies-modal .modal-dialog {
  max-width: 500px;
}

/* Danger modal (delete confirmations) */
.admin-modal .modal-header.border-danger {
  border-bottom-color: #fecaca;
  background: #fef2f2;
}

.admin-modal .modal-header.border-danger .modal-title {
  color: #b91c1c;
}

.admin-modal .modal-header.border-warning {
  border-bottom-color: #fed7aa;
  background: #fff7ed;
}

.admin-modal .modal-header.border-warning .modal-title {
  color: #c2410c;
}

/* --------------------------------------------------------------------------
   13. Adverse Events Demographics Table (Baseline Characteristics) - Figma-like styling
   -------------------------------------------------------------------------- */
#adverse-events-demographics-table.dash-table-container
  .dash-spreadsheet-container {
  border-radius: 12px;
  overflow: hidden;
}

#adverse-events-demographics-table .dash-spreadsheet-menu {
  padding: 8px 0 10px;
}

#adverse-events-demographics-table .dash-spreadsheet-menu button,
#adverse-events-demographics-table .dash-spreadsheet-menu .dropdown > button {
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  border-radius: 10px !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 2px rgb(15 23 42 / 6%);
}

#adverse-events-demographics-table .dash-spreadsheet-menu button:hover,
#adverse-events-demographics-table
  .dash-spreadsheet-menu
  .dropdown
  > button:hover {
  background: #f8fafc !important;
}

#adverse-events-demographics-table .dash-filter input {
  border-radius: 10px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  padding: 6px 10px !important;
}

#adverse-events-demographics-table .dash-spreadsheet tr:hover td {
  background-color: #f8fafc !important;
}

/* Demo Efficacy Evaluable Set table */
#demo-efficacy-evaluable-table.dash-table-container
  .dash-spreadsheet-container {
  border-radius: 12px;
  overflow: hidden;
}

#demo-efficacy-evaluable-table .dash-spreadsheet-menu {
  padding: 8px 0 10px;
}

#demo-efficacy-evaluable-table .dash-spreadsheet-menu button,
#demo-efficacy-evaluable-table .dash-spreadsheet-menu .dropdown > button {
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  border-radius: 10px !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 2px rgb(15 23 42 / 6%);
}

#demo-efficacy-evaluable-table .dash-spreadsheet-menu button:hover,
#demo-efficacy-evaluable-table .dash-spreadsheet-menu .dropdown > button:hover {
  background: #f8fafc !important;
}

#datatable-grid .dash-spreadsheet-menu {
  display: none !important;
}

.effectstats-ag-grid-datatable-preview {
  --ag-font-size: 12px;
  --ag-header-background-color: #e9ecef;
  --effectstats-ag-grid-header-font-weight: 600;
  --effectstats-ag-grid-header-padding: 6px;
  --effectstats-ag-grid-cell-border-right: 1px solid #e5e7eb;
}

.effectstats-ag-grid-datatable-preview .ag-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.datatable-quality-action-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.datatable-quality-toggle {
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1 !important;
  background: #fff !important;
  color: #0f172a !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  font-weight: 600;
  box-shadow: 0 1px 2px rgb(15 23 42 / 6%);
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.datatable-quality-toggle:hover {
  background: #f8fafc !important;
}

.datatable-quality-panel {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(260px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: visible;
}

.datatable-quality-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 500px) minmax(320px, 1fr);
  gap: 20px;
  min-height: 245px;
  padding: 24px 28px;
  color: #1f2937;
}

.datatable-quality-controls {
  max-width: 500px;
}

.datatable-quality-intro {
  max-width: 430px;
  color: #637391;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 20px;
}

.datatable-quality-run,
.datatable-quality-check-types,
.datatable-quality-flagged {
  color: #172033;
  font-size: 18px;
  font-weight: 600;
}

.datatable-quality-run .form-check,
.datatable-quality-check-types .form-check,
.datatable-quality-flagged .form-check {
  min-height: 28px;
  margin-bottom: 16px;
}

.datatable-quality-run .form-check-input,
.datatable-quality-check-types .form-check-input,
.datatable-quality-flagged .form-check-input {
  width: 15px;
  height: 15px;
  margin-top: 6px;
  margin-right: 16px;
}

.datatable-quality-run .form-check-input:checked,
.datatable-quality-check-types .form-check-input:checked,
.datatable-quality-flagged .form-check-input:checked {
  background-color: #805ad5;
  border-color: #805ad5;
}

.datatable-quality-divider {
  height: 1px;
  width: 100%;
  margin: 20px 0 22px;
  background: #dbe5f0;
}

.datatable-quality-jump-label {
  display: block;
  color: #637391;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.datatable-quality-issue-select {
  max-width: 500px;
  margin-bottom: 12px;
}

.datatable-quality-next-issue {
  margin-bottom: 12px;
  font-size: 16px !important;
}

.datatable-quality-helper {
  color: #4b5563;
  font-size: 16px;
  font-weight: 500;
}

.datatable-quality-results {
  display: flex;
  align-items: center;
  min-height: 180px;
  color: #637391;
}

.datatable-quality-status {
  color: #637391;
  font-size: 18px;
  font-weight: 600;
}

.datatable-quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  width: 100%;
}

.datatable-quality-metric {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
}

.datatable-quality-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.datatable-quality-value {
  color: #0f172a;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.datatable-quality-detail {
  color: #64748b;
  font-size: 12px;
  margin-top: 2px;
}

.datatable-search-input-wrap {
  position: relative;
}

.datatable-search-input-wrap .datatable-search-input {
  padding-right: 42px;
}

.datatable-search-case-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition:
    color 120ms ease,
    background-color 120ms ease,
    box-shadow 120ms ease;
}

.datatable-search-case-toggle:hover,
.datatable-search-case-toggle:focus-visible {
  color: #ec4899;
  background: rgb(236 72 153 / 10%);
  box-shadow: 0 0 0 2px rgb(236 72 153 / 12%);
  outline: none;
}

.datatable-search-case-toggle.is-active {
  color: #ec4899;
  background: rgb(236 72 153 / 12%);
}

.datatable-quality-toolbar {
  display: flex;
  justify-content: flex-end;
}

.datatable-quality-toggle:hover,
.datatable-quality-toggle:focus-visible {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
  outline: none;
}

.datatable-quality-panel-note {
  margin-bottom: 10px;
  color: #64748b;
  font-size: 0.84rem;
}

.datatable-quality-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.datatable-quality-checklist--secondary {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.datatable-quality-checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #1e293b;
  font-size: 0.9rem;
}

.datatable-quality-summary {
  display: flex;
  align-items: stretch;
}

.datatable-quality-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
}

.datatable-quality-summary-pill {
  min-width: 150px;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #eff6ff;
}

.datatable-quality-summary-label {
  display: block;
  margin-bottom: 4px;
  color: #475569;
  font-size: 0.78rem;
}

.datatable-quality-summary-value {
  color: #0f172a;
  font-size: 1.05rem;
}

.datatable-quality-summary-note {
  display: flex;
  align-items: center;
  min-height: 100%;
  color: #64748b;
  font-size: 0.9rem;
}

@media (width <= 900px) {
  .datatable-quality-panel {
    grid-template-columns: 1fr;
  }
}

#datatable-jump-prev-new-row:disabled,
#datatable-jump-next-new-row:disabled {
  background: #e5e7eb !important;
  border-color: #d1d5db !important;
  color: #9ca3af !important;
  box-shadow: none !important;
  opacity: 1 !important;
  cursor: not-allowed;
}

#datatable-jump-prev-new-row:disabled:hover,
#datatable-jump-next-new-row:disabled:hover {
  background: #e5e7eb !important;
  border-color: #d1d5db !important;
  color: #9ca3af !important;
}

#datatable-grid .effectstats-search-column-highlight {
  background-color: rgb(59 130 246 / 8%) !important;
  box-shadow:
    inset 1px 0 0 rgb(59 130 246 / 18%),
    inset -1px 0 0 rgb(59 130 246 / 18%);
}

#datatable-grid td.effectstats-search-cell-match {
  background-color: rgb(59 130 246 / 16%) !important;
  box-shadow: inset 0 0 0 1px rgb(37 99 235 / 28%) !important;
}

#datatable-grid th.effectstats-search-column-highlight {
  background-color: #eff6ff !important;
}

#demo-efficacy-evaluable-table .dash-spreadsheet tr:hover td {
  background-color: #f8fafc !important;
}

/* --------------------------------------------------------------------------
   14. Adverse Events Dashboard Specific Styles
   -------------------------------------------------------------------------- */

/* Graph Containers */
.ae-graph-container {
  height: 500px;
}

.ae-graph-modebar-left .modebar-container,
.ae-graph-modebar-left .modebar {
  left: 0 !important;
  right: auto !important;
}

.ae-graph-controls {
  padding: 0 15px 10px;
}

.ae-safety-summary-footer {
  width: 100%;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

@media (width <= 1200px) {
  .ae-safety-summary-row {
    flex-wrap: wrap;
  }

  .ae-safety-summary-pane {
    width: 100% !important;
    margin-right: 0 !important;
    margin-bottom: 12px;
  }
}

/* Table Components */
.ae-table-info {
  padding: 0 10px;
}

.ae-page-size-dropdown {
  min-width: 80px;
}

/* Dashboard Display States */
.ae-content-hidden {
  display: none;
}

.ae-content-visible {
  display: block;
}

.dash-datepicker,
.dash-datepicker .SingleDatePicker,
.dash-datepicker .SingleDatePickerInput,
.dash-datepicker .DateInput {
  width: 100% !important;
  display: block !important;
  min-width: 160px !important;
  max-width: 180px !important;
}

.dash-datepicker .DateInput_input {
  font-size: 20px !important;
  padding: 8px 12px !important;
  width: 100% !important;
}

.cutoff-date-picker {
  position: relative;
  z-index: 90;
  overflow: visible;
  isolation: isolate;
}

.cutoff-date-picker .SingleDatePicker,
.cutoff-date-picker .SingleDatePickerInput,
.cutoff-date-picker .DateInput {
  overflow: visible !important;
}

.cutoff-date-picker .DayPicker,
.cutoff-date-picker .DayPicker_transitionContainer,
.cutoff-date-picker .CalendarMonthGrid {
  overflow: visible !important;
}

.cutoff-date-picker .SingleDatePicker_picker {
  z-index: 5001 !important;
}

/* Keep the legacy cutoff input on one compact row, including its clear button. */
.legacy-cutoff-control {
  width: min(100%, 260px);
}

.legacy-cutoff-picker,
.legacy-cutoff-picker .SingleDatePicker,
.legacy-cutoff-picker .SingleDatePickerInput {
  width: 100% !important;
  max-width: 100% !important;
}

.legacy-cutoff-picker .SingleDatePickerInput {
  position: relative;
  display: block !important;
}

.legacy-cutoff-picker .DateInput {
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
}

.legacy-cutoff-picker .DateInput_input {
  box-sizing: border-box;
  height: 38px;
  padding: 7px 32px 7px 10px !important;
  font-size: 14px !important;
  line-height: 22px;
}

.legacy-cutoff-picker .SingleDatePickerInput_clearDate {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  margin: 0;
  padding: 4px;
}

.legacy-cutoff-control > .muted {
  margin-bottom: 0;
  line-height: 1.3;
}

/* Time to Event Analysis Table */

/* TTE Table Scroll Container */
.tte-table-scroll-container {
  overflow: auto;
  max-height: 800px;
  position: relative;
}

.ae-tte-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 14px;
  font-family: Inter, sans-serif;
}

.ae-tte-table th,
.ae-tte-table td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: center;
  vertical-align: middle;
  font-family: Inter, sans-serif;
  font-size: 14px;
  border-top-width: 0;
  border-left-width: 0;
}

.ae-tte-table th:first-child,
.ae-tte-table td:first-child {
  border-left-width: 1px;
}

.ae-tte-table tr:first-child th {
  border-top-width: 1px;
}

.ae-tte-table th {
  background-color: rgb(230 230 230);
  font-weight: bold;
}

/* Sticky header row */
.ae-tte-table thead tr:first-child th,
.ae-tte-table > tr:first-child th {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgb(230 230 230);
  box-shadow: 0 2px 4px 0 rgb(0 0 0 / 10%);
  border-top-width: 1px;
  background-clip: padding-box;
}

.ae-tte-table .tte-row-header {
  text-align: left;
  font-weight: bold;
  background-color: rgb(248 248 248);
  width: 220px;
}

.ae-tte-table .tte-section-header {
  background-color: rgb(230 230 230);
  font-weight: bold;
  text-align: left;
}

.ae-tte-table .tte-km-header {
  background-color: rgb(230 230 230);
  text-align: left;
  font-weight: bold;
  padding-left: 16px;
}

.ae-tte-table .tte-sub-row {
  text-align: left;
  padding-left: 28px;
  background-color: rgb(248 248 248);
  font-style: italic;
}

.ae-tte-table .tte-data-cell {
  background-color: white;
}

.ae-tte-table .tte-km-blank {
  background-color: rgb(230 230 230);
}

/* --------------------------------------------------------------------------
   Documentation hub (authenticated Markdown guides)
   -------------------------------------------------------------------------- */
.profile-page.documentation-page {
  max-width: 1240px;
  position: relative;
  padding-top: 18px;
}

.profile-page.documentation-page::before {
  content: "";
  position: absolute;
  inset: -16px 0 auto;
  height: 280px;
  background:
    radial-gradient(circle at top left, rgb(59 130 246 / 18%), transparent 52%),
    radial-gradient(
      circle at top right,
      rgb(14 165 233 / 16%),
      transparent 44%
    ),
    linear-gradient(180deg, rgb(248 250 252 / 98%), rgb(248 250 252 / 0%));
  pointer-events: none;
  z-index: 0;
}

.documentation-layout {
  display: grid;
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 28px 40px;
  align-items: start;
}

@media (width <= 900px) {
  .documentation-layout {
    grid-template-columns: 1fr;
  }
}

.documentation-hero {
  z-index: 1;
  margin-bottom: 32px;
  padding: 30px 32px 34px !important;
  border: 1px solid rgb(148 163 184 / 20%);
  border-left: 0 !important;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 94%), rgb(248 250 252 / 92%)),
    linear-gradient(135deg, rgb(37 99 235 / 4%), rgb(14 165 233 / 8%));
  box-shadow: 0 24px 60px rgb(15 23 42 / 8%);
  overflow: hidden;
}

.documentation-hero::after {
  content: "";
  position: absolute;
  inset: auto -90px -120px auto;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(
    circle,
    rgb(14 165 233 / 18%),
    rgb(14 165 233 / 0%)
  );
}

.documentation-hero-kicker {
  margin-bottom: 10px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0369a1;
}

.documentation-hero .profile-hero-title {
  max-width: 14ch;
  font-size: clamp(2rem, 3.4vw, 3.15rem);
  letter-spacing: -0.045em;
}

.documentation-hero .profile-hero-sub {
  max-width: 62ch;
  font-size: 1.02rem;
  line-height: 1.7;
  color: #475569;
}

.documentation-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.documentation-hero-stat {
  padding: 16px 18px;
  border-radius: 16px;
  background: rgb(255 255 255 / 72%);
  border: 1px solid rgb(148 163 184 / 18%);
  backdrop-filter: blur(10px);
}

.documentation-hero-stat-label {
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.documentation-hero-stat-value {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: #0f172a;
}

.documentation-main-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.documentation-nav {
  position: sticky;
  top: 88px;
  padding: 22px;
  background: linear-gradient(
    180deg,
    rgb(255 255 255 / 96%),
    rgb(248 250 252 / 94%)
  );
  border-radius: 22px;
  border: 1px solid rgb(148 163 184 / 18%);
  box-shadow: 0 22px 48px rgb(15 23 42 / 7%);
}

.documentation-nav-header {
  margin-bottom: 18px;
}

.documentation-nav-heading {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0369a1;
  margin-bottom: 8px;
}

.documentation-nav-copy,
.documentation-rail-copy,
.documentation-body-subtitle {
  margin: 0;
  color: #64748b;
  line-height: 1.6;
}

.documentation-nav-copy {
  font-size: 0.95rem;
}

.documentation-nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

a.documentation-nav-link {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  color: #1e293b;
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.45;
  border: 1px solid transparent;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

a.documentation-nav-link:hover {
  transform: translateY(-1px);
  background: rgb(37 99 235 / 7%);
  border-color: rgb(37 99 235 / 14%);
  color: var(--primary, #2563eb);
  box-shadow: 0 10px 22px rgb(37 99 235 / 8%);
}

a.documentation-nav-link--active {
  background: linear-gradient(
    135deg,
    rgb(37 99 235 / 14%),
    rgb(14 165 233 / 8%)
  );
  border-color: rgb(37 99 235 / 20%);
  color: #1d4ed8;
  font-weight: 700;
}

.documentation-rail-card,
.documentation-related-card {
  margin-top: 20px;
  padding: 18px;
  border-radius: 18px;
  background: #eff6ff;
  border: 1px solid rgb(96 165 250 / 20%);
}

.documentation-rail-heading {
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1d4ed8;
}

.documentation-home-link,
.documentation-related-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
}

.documentation-home-link {
  margin-top: 14px;
  background: #0f172a;
  color: #fff;
}

.documentation-home-link:hover {
  background: #020617;
}

.documentation-related-list {
  display: grid;
  gap: 10px;
}

.documentation-related-link {
  justify-content: flex-start;
  background: rgb(255 255 255 / 82%);
  border: 1px solid rgb(148 163 184 / 18%);
  color: #0f172a;
}

.documentation-related-link:hover {
  border-color: rgb(37 99 235 / 18%);
  color: #1d4ed8;
}

.documentation-body {
  background: linear-gradient(
    180deg,
    rgb(255 255 255 / 98%),
    rgb(248 250 252 / 96%)
  );
  border-radius: 24px;
  border: 1px solid rgb(148 163 184 / 18%);
  padding: 30px 34px 38px;
  box-shadow: 0 22px 48px rgb(15 23 42 / 8%);
  min-height: 320px;
}

.documentation-body--error {
  border-color: rgb(239 68 68 / 24%);
  background: linear-gradient(
    180deg,
    rgb(255 255 255 / 98%),
    rgb(254 242 242 / 88%)
  );
}

.documentation-body-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgb(148 163 184 / 18%);
}

.documentation-body-eyebrow {
  margin-bottom: 10px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0369a1;
}

.documentation-body-title {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 2.4vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #0f172a;
}

.documentation-body-title--error {
  color: #991b1b;
}

.documentation-error {
  margin: 0;
  color: #b91c1c;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.6;
}

.documentation-markdown {
  font-size: 1rem;
  line-height: 1.75;
  color: #1e293b;
}

.documentation-markdown h1,
.documentation-markdown h2,
.documentation-markdown h3 {
  margin-top: 1.5em;
  margin-bottom: 0.55em;
  line-height: 1.25;
  color: #0f172a;
}

.documentation-markdown h1:first-child,
.documentation-markdown h2:first-child {
  margin-top: 0;
}

.documentation-markdown h1 {
  font-size: 1.8rem;
}

.documentation-markdown h2 {
  font-size: 1.34rem;
  border-bottom: 1px solid rgb(148 163 184 / 16%);
  padding-bottom: 0.45em;
}

.documentation-markdown h3 {
  font-size: 1.08rem;
}

.documentation-markdown p {
  margin: 0.8em 0;
}

.documentation-markdown ul,
.documentation-markdown ol {
  margin: 0.7em 0 1em;
  padding-left: 1.5em;
}

.documentation-markdown li {
  margin: 0.45em 0;
}

.documentation-markdown code {
  font-size: 0.9em;
  background: #e2e8f0;
  padding: 0.18em 0.48em;
  border-radius: 8px;
  color: #0f172a;
}

.documentation-markdown pre {
  background: linear-gradient(180deg, #0f172a, #111827);
  color: #e2e8f0;
  padding: 16px 18px;
  border-radius: 16px;
  overflow-x: auto;
  font-size: 0.9rem;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 5%);
}

.documentation-markdown pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.documentation-markdown table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.2em 0;
  font-size: 0.95rem;
  overflow: hidden;
  border-radius: 14px;
}

.documentation-markdown th,
.documentation-markdown td {
  border: 1px solid rgb(148 163 184 / 18%);
  padding: 11px 14px;
  text-align: left;
}

.documentation-markdown th {
  background: #eff6ff;
  font-weight: 700;
}

.documentation-markdown blockquote {
  margin: 1.2em 0;
  padding: 16px 18px;
  border-left: 4px solid var(--primary, #2563eb);
  border-radius: 0 14px 14px 0;
  background: rgb(37 99 235 / 6%);
  color: #475569;
}

.documentation-markdown a {
  color: #1d4ed8;
  font-weight: 600;
}

.documentation-markdown a:hover {
  color: #1e40af;
}

@media (width <= 900px) {
  .documentation-hero {
    padding: 24px 22px 26px !important;
  }

  .documentation-hero-stats {
    grid-template-columns: 1fr;
  }

  .documentation-nav {
    position: static;
  }
}

@media (width <= 640px) {
  .documentation-body {
    padding: 24px 20px 28px;
  }
}

@container (max-width: 150px) {
  .stat-icon {
    display: none;
  }
}

/* Shared app footer */
.app-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  flex-shrink: 0;
  border-top: 1px solid rgb(15 23 42 / 8%);
  background: linear-gradient(
    180deg,
    rgb(255 255 255 / 96%) 0%,
    rgb(247 249 252 / 98%) 100%
  );
  box-shadow: 0 -6px 18px rgb(15 23 42 / 3%);
  backdrop-filter: blur(8px);
}

.app-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
}

.app-footer-support,
.app-footer-legal {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-footer-label {
  color: rgb(15 23 42 / 54%);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-footer-link,
.app-footer-link:visited,
.app-footer-phone,
.app-footer-copy {
  color: rgb(15 23 42 / 72%);
  font-size: 0.74rem;
}

.app-footer-link,
.app-footer-link:visited {
  text-decoration: none;
}

.app-footer-link:hover,
.app-footer-link:focus-visible {
  color: #0f172a;
  text-decoration: underline;
}

.app-footer-phone,
.app-footer-copy {
  white-space: nowrap;
}

.filter-section-header {
  padding: 0 var(--bs-offcanvas-padding-x);
  margin: 0 calc(-1 * var(--bs-offcanvas-padding-x))
    calc(0.5 * var(--bs-offcanvas-padding-x));
  background-color: var(--bs-body-bg);
}

.filter-section-header .offcanvas-title {
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.5;
}

@media (width <= 720px) {
  .public-main {
    padding-bottom: 104px;
  }

  .shell .body {
    padding-bottom: 104px;
  }

  .app-footer-inner {
    padding: 9px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .app-footer-support,
  .app-footer-legal {
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .app-footer-link,
  .app-footer-link:visited,
  .app-footer-phone,
  .app-footer-copy {
    font-size: 0.7rem;
  }
}
