/* Small additions on top of aurora.css to support Django-rendered chrome
   (login page, message stack, htmx swap states). Lift more from aurora.css
   if you need it.
*/

/* Login layout */
.auth-shell {
  min-height: 100vh; display: grid; place-items: center;
  padding: var(--s-6); background: var(--bg-page);
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(99,102,241,.10), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, rgba(217,70,239,.06), transparent 60%);
}
.auth-card {
  width: 100%; max-width: 420px; padding: var(--s-8);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-2xl); box-shadow: var(--shadow-lg);
}
.auth-card__brand { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-6); }
.auth-card__brand .mark {
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--grad-primary); color: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow-glow);
}
.auth-card h1 { font-size: var(--text-2xl); font-family: var(--font-display); }
.auth-card .sub { color: var(--text-3); font-size: var(--text-sm); margin-top: 4px; margin-bottom: var(--s-6); }
.auth-form { display: flex; flex-direction: column; gap: var(--s-4); }
.auth-form .field { gap: 6px; }
.auth-form .btn { width: 100%; justify-content: center; padding: 12px 16px; }
.auth-error { background: var(--danger-bg); color: var(--danger); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); font-size: var(--text-sm); }

/* Message stack (Django messages) */
.msg-stack {
  position: fixed; top: 80px; right: 24px; z-index: 200;
  display: flex; flex-direction: column; gap: var(--s-2); max-width: 360px;
}
.msg {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--r-md); padding: var(--s-3) var(--s-4);
  box-shadow: var(--shadow-md); font-size: var(--text-sm);
  animation: msgIn .25s ease-out;
}
.msg--success { border-left-color: var(--success); }
.msg--error, .msg--danger { border-left-color: var(--danger); }
.msg--warning { border-left-color: var(--warn); }
@keyframes msgIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* HTMX request indicator (faint progress bar at top) */
.htmx-request body { cursor: progress; }

/* Code blocks for stub pages */
pre.code { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-4); font-family: var(--font-mono); font-size: 12px; overflow: auto; }

[x-cloak] { display: none !important; }

.se-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  animation: seModalIn .18s ease-out;
}
.se-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
}
.se-modal__panel {
  position: relative; z-index: 1;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-2xl); box-shadow: var(--shadow-lg);
  width: min(420px, calc(100vw - 32px));
  padding: var(--s-6) var(--s-6) var(--s-5);
  text-align: center;
}
.se-modal__icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--warn-bg); color: var(--warn);
  display: grid; place-items: center;
  margin: 0 auto var(--s-4);
}
.se-modal__title {
  font-family: var(--font-display); font-size: var(--text-2xl);
  font-weight: 800; margin-bottom: var(--s-2);
}
.se-modal__msg {
  color: var(--text-3); font-size: var(--text-sm);
  margin-bottom: var(--s-5);
}
.se-modal__actions { display: flex; justify-content: center; gap: var(--s-3); }
.se-modal__actions .btn { min-width: 140px; justify-content: center; }
@keyframes seModalIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.confirm-modal__icon--danger {
  background: var(--danger-bg, #fee2e2) !important;
  color: var(--danger, #b91c1c) !important;
}
.confirm-modal__btn--danger {
  background: var(--danger, #b91c1c) !important;
  border-color: var(--danger, #b91c1c) !important;
  color: #fff !important;
}
.confirm-modal__btn--danger:hover { filter: brightness(0.95); }

/* ---------------------------------------------------------------------- *
 * Client journey stepper — horizontal pipeline rendered on the Overview
 * tab. Each booking gets one card; each card has 5 stages connected by a
 * progress line. States: done (filled), current (highlighted ring),
 * pending (outlined), failed (red).
 * ---------------------------------------------------------------------- */
.cv-journey { margin: 0 0 24px; }
.cv-journey__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px;
}
.cv-journey__card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.cv-journey__title {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.cv-journey__progress { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.cv-journey__progress-bar {
  flex: 1; height: 6px; background: var(--bg-soft); border-radius: 3px;
  overflow: hidden; min-width: 120px;
}
.cv-journey__progress-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--primary, #6366f1), var(--success, #10b981));
  transition: width .4s ease;
}
.cv-journey__progress-lbl {
  font-size: 12px; font-weight: 700; color: var(--text-2);
  font-family: var(--font-display);
}
.cv-journey__actions {
  display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end;
  flex-wrap: wrap;
}

/* Aggregated-journey summary band — sits below the stepper, says what's
 * currently bottlenecking + a CTA into the right tab. */
.cv-journey__summary {
  display: flex; align-items: center; gap: 12px;
  margin-top: 18px; padding: 12px 14px;
  background: var(--bg-soft); border-radius: var(--r-md);
  border: 1px dashed var(--border);
}
.cv-journey__summary-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  display: grid; place-items: center; flex-shrink: 0;
}
.cv-journey__summary-text {
  font-size: 13px; color: var(--text-1); font-weight: 600;
}

.cv-stepper {
  list-style: none; padding: 0; margin: 8px 0 4px;
  display: grid; grid-template-columns: repeat(5, 1fr);
  position: relative; gap: 0;
}
.cv-stepper__item {
  position: relative; padding: 0 8px; text-align: center;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
}
/* Connector line — drawn from the centre of each circle to the next */
.cv-stepper__item::before {
  content: ""; position: absolute; top: 22px; left: 50%; right: -50%;
  height: 3px; background: var(--border); z-index: 0;
  border-radius: 2px;
}
.cv-stepper__item:last-child::before { display: none; }

.cv-stepper__node {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-soft); border: 2px solid var(--border);
  display: grid; place-items: center; position: relative; z-index: 1;
  transition: transform .15s ease, box-shadow .15s ease;
}
.cv-stepper__icon { font-size: 18px; line-height: 1; }
.cv-stepper__label {
  font-size: 12px; font-weight: 700; color: var(--text-2);
  margin-top: 4px; line-height: 1.3;
}
.cv-stepper__when {
  font-size: 11px; color: var(--text-3); line-height: 1.3;
}
.cv-stepper__sub {
  font-size: 11px; color: var(--text-3); margin-top: 2px;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}

/* Done — filled green */
.cv-stepper__item.is-done .cv-stepper__node {
  background: var(--success-bg, #d1fae5);
  border-color: var(--success, #10b981);
  color: var(--success, #065f46);
}
.cv-stepper__item.is-done::before { background: var(--success, #10b981); }
.cv-stepper__item.is-done .cv-stepper__label { color: var(--text-1); }

/* Current — purple ring, slight lift */
.cv-stepper__item.is-current .cv-stepper__node {
  background: var(--bg-card); border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .15);
  transform: scale(1.05);
}
.cv-stepper__item.is-current .cv-stepper__label {
  color: var(--primary, #6366f1);
}

/* Pending — muted */
.cv-stepper__item.is-pending .cv-stepper__node {
  background: var(--bg-soft); border-color: var(--border);
  opacity: 0.6;
}
.cv-stepper__item.is-pending .cv-stepper__label,
.cv-stepper__item.is-pending .cv-stepper__when,
.cv-stepper__item.is-pending .cv-stepper__sub {
  color: var(--text-3);
}

/* Failed — red ring (used when send-to-client failed) */
.cv-stepper__item.is-failed .cv-stepper__node {
  background: var(--danger-bg, #fee2e2);
  border-color: var(--danger, #b91c1c);
  color: var(--danger, #b91c1c);
}
.cv-stepper__item.is-failed::before { background: var(--danger, #b91c1c); }
.cv-stepper__item.is-failed .cv-stepper__label { color: var(--danger, #b91c1c); }

@media (max-width: 768px) {
  .cv-stepper { grid-template-columns: 1fr; gap: 12px; }
  .cv-stepper__item { flex-direction: row; text-align: left; gap: 12px; padding: 0; }
  .cv-stepper__item::before {
    top: 44px; left: 22px; right: auto; bottom: -16px;
    width: 3px; height: auto;
  }
  .cv-stepper__item:last-child::before { display: none; }
  .cv-stepper__label, .cv-stepper__when, .cv-stepper__sub { text-align: left; }
  .cv-stepper__node { flex-shrink: 0; }
}

.booking-loader {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
  animation: seModalIn .18s ease-out;
}
.booking-loader__panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-2xl); box-shadow: var(--shadow-lg);
  width: min(380px, calc(100vw - 32px));
  padding: var(--s-6) var(--s-6) var(--s-5);
  text-align: center;
}
.booking-loader__spinner {
  width: 48px; height: 48px; margin: 0 auto var(--s-4);
  border-radius: 50%;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  animation: bookingSpin .9s linear infinite;
}
.booking-loader__title {
  font-family: var(--font-display); font-size: var(--text-lg);
  font-weight: 700; margin-bottom: var(--s-2);
}
.booking-loader__msg {
  color: var(--text-3); font-size: var(--text-sm);
}
@keyframes bookingSpin {
  to { transform: rotate(360deg); }
}

.cv-header {
  display: grid; grid-template-columns: auto 1fr auto; gap: 20px;
  padding: 24px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-2xl); box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.cv-avatar {
  width: 72px; height: 72px; border-radius: 50%; background: var(--grad-primary);
  color: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 800;
  font-family: var(--font-display); box-shadow: var(--shadow-glow);
}
.cv-name-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cv-name { font-size: 22px; font-weight: 800; font-family: var(--font-display); }
.cv-meta-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px 24px; margin-top: 12px;
}
.cv-meta__lbl {
  font-size: 11px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .5px; font-weight: 600;
}
.cv-meta__val { font-size: 14px; font-weight: 600; margin-top: 2px; }
.cv-actions { display: flex; flex-direction: column; gap: 8px; }
.cv-tabs {
  display: flex; gap: 4px; padding: 4px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm); margin-bottom: 16px; overflow-x: auto;
}
.cv-tab {
  background: transparent; border: 0; padding: 10px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  transition: background 120ms ease, color 120ms ease;
}
.cv-tab:hover { background: var(--bg-soft); color: var(--text-1); }
.cv-tab.is-active { background: var(--grad-primary); color: #fff; }
.cv-tab .count {
  background: rgba(255,255,255,0.25); border-radius: 999px;
  padding: 1px 8px; font-size: 11px;
}
.cv-tab:not(.is-active) .count { background: var(--bg-soft); color: var(--text-3); }
.cv-tab-body {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-2xl); box-shadow: var(--shadow-sm);
  padding: 20px; min-height: 360px;
}
.cv-stat-row {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px; margin-bottom: 16px;
}
.cv-stat {
  padding: 14px; background: var(--bg-soft); border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.cv-stat__lbl {
  font-size: 11px; color: var(--text-3); text-transform: uppercase;
  font-weight: 600; letter-spacing: .5px;
}
.cv-stat__val {
  font-size: 22px; font-weight: 800; font-family: var(--font-display);
  margin-top: 4px;
}
.cv-timeline { display: flex; flex-direction: column; gap: 0; }
.cv-timeline__item {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.cv-timeline__item:last-child { border-bottom: 0; }
.cv-timeline__dot {
  width: 32px; height: 32px; border-radius: 50%; background: var(--bg-soft);
  display: grid; place-items: center; flex-shrink: 0; font-size: 13px;
}
.cv-timeline__body { flex: 1; }
.cv-timeline__when { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.cv-placeholder {
  padding: 60px 20px; text-align: center; color: var(--text-3);
}
.cv-placeholder__icon {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%;
  background: var(--bg-soft); display: grid; place-items: center; font-size: 28px;
}
.cv-placeholder__title {
  font-family: var(--font-display); font-size: var(--text-lg);
  font-weight: 700; color: var(--text-1); margin-bottom: 6px;
}
@media (max-width: 768px) {
  .cv-header { grid-template-columns: 1fr; text-align: center; }
  .cv-avatar { margin: 0 auto; }
  .cv-meta-grid { grid-template-columns: repeat(2, 1fr); }
  .cv-stat-row { grid-template-columns: repeat(2, 1fr); }
  .cv-actions { flex-direction: row; justify-content: center; }
}

.biomarker-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--bg-card);
}
.biomarker-table thead th {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg-soft); color: var(--text-3);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.biomarker-table tbody td {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  font-size: 13px; vertical-align: middle;
}
.biomarker-table tbody tr.biomarker-row:hover {
  background: rgba(99,102,241,.04);
}
.biomarker-table tbody tr.biomarker-row--untested td {
  background: rgba(0,0,0,.015);
}
.biomarker-table input[type="text"],
.biomarker-table input[type="date"],
.biomarker-table select {
  border: 1px solid transparent; background: transparent;
  border-radius: var(--r-sm); transition: border-color 120ms, background 120ms;
}
.biomarker-table input[type="text"]:hover,
.biomarker-table input[type="date"]:hover,
.biomarker-table select:hover {
  border-color: var(--border); background: var(--bg-card);
}
.biomarker-table input[type="text"]:focus,
.biomarker-table input[type="date"]:focus,
.biomarker-table select:focus {
  outline: 0; border-color: var(--primary);
  background: var(--bg-card); box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.biomarker-profile-header td {
  background: linear-gradient(90deg, rgba(99,102,241,.06), rgba(99,102,241,0));
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.biomarker-profile-header__name {
  font-size: 11px; font-weight: 800; letter-spacing: .8px;
  text-transform: uppercase; color: var(--text-2);
}
.biomarker-profile-header__count {
  font-size: 11px; color: var(--text-3); margin-left: 10px;
}

.biomarker-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: capitalize;
  border: 1px solid transparent;
}
.biomarker-pill--normal     { background: #dcfce7; color: #14532d; border-color: #bbf7d0; }
.biomarker-pill--borderline { background: #fef3c7; color: #78350f; border-color: #fde68a; }
.biomarker-pill--abnormal   { background: #fee2e2; color: #7f1d1d; border-color: #fecaca; }
.biomarker-pill--unknown    { background: var(--bg-soft); color: var(--text-3); border-color: var(--border); }
.biomarker-pill--untested   { background: transparent; color: var(--text-3); border-color: var(--border); }

.biomarker-save-btn {
  display: none;
  align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 6px; border: 0;
  background: var(--grad-primary); color: #fff;
  font-size: 11px; font-weight: 700; cursor: pointer;
  box-shadow: 0 1px 2px rgba(99,102,241,.3);
  transition: transform 100ms, box-shadow 100ms;
}
.biomarker-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(99,102,241,.4);
}
.biomarker-row.is-dirty .biomarker-save-btn {
  display: inline-flex;
  animation: biomarkerSaveIn .15s ease-out;
}
.biomarker-row.is-dirty {
  background: rgba(252,211,77,.08);
}
.biomarker-row.is-dirty .biomarker-delete-btn {
  display: none;
}
@keyframes biomarkerSaveIn {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* === Biomarker-review layout (port from ui/static/mockups/biomarker_review.html) === */
.review-shell {
  display: grid; grid-template-columns: 220px 1fr; gap: 16px;
  margin: 12px auto; padding: 0; max-width: 1380px;
}
.review-banner {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #78350f;
  padding: 6px 12px; border-radius: 8px; font-size: 11px; font-weight: 600;
  margin-bottom: 4px;
}
.review-side {
  position: sticky; top: 12px; align-self: start;
  max-height: calc(100vh - 24px); overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; box-shadow: var(--shadow-sm);
}
.review-side__test {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-weight: 800; font-size: 13px;
  margin-bottom: 4px;
}
.review-side__client { font-size: 12px; color: var(--text-2); font-weight: 600; }
.review-side__sub { font-size: 11px; color: var(--text-3); margin-bottom: 12px; }
.review-side__legend {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 0; border-top: 1px dashed var(--border);
  font-size: 10px; color: var(--text-3); margin-bottom: 4px;
}
.legend-chip { display: inline-flex; align-items: center; gap: 6px; }
.legend-chip::before {
  content: ''; width: 10px; height: 10px; border-radius: 3px; border: 1px solid transparent;
}
.legend-chip--normal::before     { background: #dcfce7; border-color: #bbf7d0; }
.legend-chip--borderline::before { background: #fef3c7; border-color: #fde68a; }
.legend-chip--abnormal::before   { background: #fee2e2; border-color: #fecaca; }
.legend-chip--missing::before    { background: #ffedd5; border-color: #fed7aa; }
.review-side__nav { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.review-side__nav-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-3); font-weight: 700; padding: 6px 0 4px;
}
.review-side__nav-link {
  display: grid; grid-template-columns: 1fr auto;
  gap: 8px; align-items: center;
  padding: 6px 8px; border-radius: 6px;
  text-decoration: none; color: var(--text-1);
  font-size: 12px; font-weight: 600;
  border-left: 3px solid transparent;
  transition: background 100ms;
}
.review-side__nav-link:hover { background: var(--bg-soft); }
.review-side__nav-link.is-active {
  background: rgba(99,102,241,.08);
  border-left-color: var(--primary);
  color: var(--primary);
}
.review-side__nav-count {
  font-size: 10px; font-family: var(--font-mono);
  color: var(--text-3);
}
.review-side__nav-link.has-missing .review-side__nav-count {
  color: #b45309; font-weight: 700;
}
.review-side__nav-link.is-empty { opacity: .35; pointer-events: none; }
.review-side__nav-link.is-empty .review-side__nav-count { color: var(--text-3); }

.review-main { min-width: 0; }
.review-toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-sm);
  position: sticky; top: 12px; z-index: 10;
}
.review-toolbar input[type="search"] {
  flex: 1; min-width: 180px; padding: 6px 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 8px;
}
.filter-pill {
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; font-size: 11px; font-weight: 700; cursor: pointer;
}
.filter-pill.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.stat-mini { text-align: center; padding: 0 8px; border-left: 1px solid var(--border); }
.stat-mini__val { font-family: var(--font-display); font-weight: 800; font-size: 16px; line-height: 1; }
.stat-mini__lbl { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); margin-top: 2px; }
.stat-mini--missing .stat-mini__val { color: #b45309; }
.stat-mini--abnormal .stat-mini__val { color: #b91c1c; }

.profile-group {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-sm); margin-bottom: 12px; overflow: hidden;
  scroll-margin-top: 80px;
}
.profile-group__head {
  display: grid; grid-template-columns: auto 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 8px 14px;
  background: linear-gradient(90deg, rgba(99,102,241,.07), rgba(99,102,241,0));
  border-bottom: 1px solid var(--border);
}
.profile-group__icon {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(99,102,241,.12); font-size: 14px;
}
.profile-group__name {
  font-weight: 800; font-size: 12px;
  text-transform: uppercase; letter-spacing: .8px;
}
.profile-group__count { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }
.pill-missing-mini {
  padding: 2px 8px; border-radius: 999px;
  background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa;
  font-size: 10px; font-weight: 800;
}

.profile-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  table-layout: fixed;
}
.profile-table col.col-sno    { width: 36px;  }
.profile-table col.col-name   { width: 28%;   }
.profile-table col.col-level  { width: 96px;  }
.profile-table col.col-unit   { width: 130px; }
.profile-table col.col-status { width: 96px;  }
.profile-table col.col-ref    { width: 100px; }
.profile-table col.col-mode   { width: 96px;  }
.profile-table col.col-act    { width: 110px; }
.profile-table th {
  background: var(--bg-soft); color: var(--text-3);
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  padding: 5px 8px; text-align: left; border-bottom: 1px solid var(--border);
}
.profile-table td {
  padding: 4px 8px; border-bottom: 1px solid var(--border); font-size: 12.5px;
  vertical-align: middle;
}
.profile-table tr:last-child td { border-bottom: 0; }
.profile-table tr:hover { background: rgba(99,102,241,.04); }
.profile-table tr.is-missing td { color: var(--text-3); }
.profile-table tr.is-missing td.name-cell { color: var(--text-2); }

.sno {
  display: inline-block; min-width: 24px; padding: 1px 5px; border-radius: 5px;
  background: var(--bg-soft); color: var(--text-3); font-size: 10.5px;
  font-family: var(--font-mono); text-align: center;
}
.bm-name { font-weight: 600; font-size: 12.5px; line-height: 1.25; }
.bm-name-sub { font-size: 10.5px; color: var(--text-3); margin-top: 1px; }

.input-cell input, .input-cell select {
  width: 100%; padding: 3px 6px; font-size: 12px;
  border: 1px solid transparent; background: transparent; border-radius: 5px;
}
.input-cell input:hover, .input-cell select:hover {
  border-color: var(--border); background: var(--bg-card);
}
.input-cell input:focus, .input-cell select:focus {
  outline: 0; border-color: var(--primary); background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.level-input { font-family: var(--font-mono); font-weight: 700; }

.pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 800; text-transform: capitalize;
  border: 1px solid transparent;
}
.pill-normal     { background: #dcfce7; color: #14532d; border-color: #bbf7d0; }
.pill-borderline { background: #fef3c7; color: #78350f; border-color: #fde68a; }
.pill-abnormal   { background: #fee2e2; color: #7f1d1d; border-color: #fecaca; }
.pill-unknown    { background: var(--bg-soft); color: var(--text-3); border-color: var(--border); }
.pill-missing    { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }

.ref-text { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }

.add-mini-btn {
  padding: 2px 8px; border-radius: 5px; border: 1px dashed var(--primary);
  background: transparent; color: var(--primary);
  font-size: 11px; font-weight: 700; cursor: pointer;
}
.add-mini-btn:hover { background: rgba(99,102,241,.06); }
.save-mini-btn {
  display: none;
  padding: 3px 9px; border-radius: 5px; border: 0;
  background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff;
  font-size: 10.5px; font-weight: 700; cursor: pointer;
}
tr.is-dirty .save-mini-btn { display: inline-block; }
tr.is-dirty { background: rgba(252,211,77,.10) !important; }
tr.is-dirty .delete-mini-btn { display: none; }
.delete-mini-btn {
  padding: 3px 6px; border-radius: 5px; border: 1px solid var(--border);
  background: transparent; color: var(--text-3); cursor: pointer;
}
.delete-mini-btn:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }

.profile-table tr.is-search-miss { opacity: .22; }
.profile-table tr.is-search-hit  { background: rgba(250,204,21,.12); }

@media (max-width: 900px) {
  .review-shell { grid-template-columns: 1fr; }
  .review-side { position: static; max-height: none; }
}

.attention-fold {
  border-radius: var(--r-2xl);
  background: linear-gradient(135deg, #fef3c7 0%, #fee2e2 100%);
  border: 1px solid #fecaca; overflow: hidden;
}
.attention-fold__summary {
  list-style: none; cursor: pointer;
  display: flex; gap: 12px; align-items: center;
  padding: 12px 16px; color: #7f1d1d;
}
.attention-fold__summary::-webkit-details-marker { display: none; }
.attention-fold__icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(220,38,38,.12); color: #b91c1c;
  display: grid; place-items: center; flex-shrink: 0;
}
.attention-fold__title { font-weight: 700; font-size: 14px; color: #7f1d1d; }
.attention-fold__sub { font-size: 12px; color: #991b1b; opacity: .8; }
.attention-fold__chev { transition: transform 200ms ease; color: #7f1d1d; }
.attention-fold[open] > .attention-fold__summary > .attention-fold__chev {
  transform: rotate(180deg);
}
.attention-fold__body {
  padding: 16px; background: var(--bg-card);
}
