/* WaterLab bench UI — layout kept; CDN-free; muted dashboard cards.
   Body padding, page background, brand weight, and card chrome come from
   rmw-theme.css when the shared theme is on. These copies apply only when
   RMW_UI_THEME is off (body has no .rmw-theme), so the kill switch still
   looks like the old bench. */
body:not(.rmw-theme) {
  padding-top: 70px;
  background: #f4f6f9;
  color: #1a1d21;
}
body:not(.rmw-theme) .navbar-brand {
  font-weight: 800;
  letter-spacing: 0.02em;
}
body:not(.rmw-theme) .card {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 0;
}

/* Active nav link. Underline follows the RMW accent (old blue if the theme is off). */
.navbar-nav .nav-link.active {
  color: #fff !important;
  font-weight: 600;
  border-bottom: 2px solid var(--rmw-accent, #0d6efd);
}

/* Next-due chip in navbar */
.wl-next-due-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.wl-next-due-chip:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}
.wl-next-due-chip.overdue {
  background: #dc3545;
  border-color: #dc3545;
}
.wl-next-due-chip.clear {
  opacity: 0.75;
}

/* Work-queue urgency row colors (unchanged semantics) */
tr.urgency-overdue {
  background-color: #f8d7da;
}
tr.urgency-due_soon {
  background-color: #fff3cd;
}
tr.urgency-partial {
  background-color: #e7f1ff;
}
/* Dark mode keeps the same meaning: overdue red, due-soon amber, partial blue.
   Cell colour is set too, because Bootstrap paints the background on the td. */
[data-bs-theme="dark"] tr.urgency-overdue > * {
  background-color: #3f2226;
  color: #f8d7da;
}
[data-bs-theme="dark"] tr.urgency-due_soon > * {
  background-color: #3d3418;
  color: #fff3cd;
}
[data-bs-theme="dark"] tr.urgency-partial > * {
  background-color: #1a2e48;
  color: #cfe2ff;
}

/* Clickable queue rows */
tr.wl-queue-row {
  cursor: pointer;
}
tr.wl-queue-row:hover {
  filter: brightness(0.97);
}
tr.wl-queue-row:focus-within {
  outline: 2px solid var(--rmw-accent, #0d6efd);
  outline-offset: -2px;
}
.wl-due-relative {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
}
.wl-due-relative.overdue {
  color: #842029;
}
.wl-due-relative.due_soon {
  color: #664d03;
}
[data-bs-theme="dark"] .wl-due-relative.overdue {
  color: #f1aeb5;
}
[data-bs-theme="dark"] .wl-due-relative.due_soon {
  color: #ffe69c;
}

/* Filter chips */
.wl-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.wl-filter-chips a {
  text-decoration: none;
}
.wl-filter-chips .btn.active {
  font-weight: 600;
}

/* Slightly larger Analyze / primary small buttons for bench touch */
a.btn-sm.btn-primary,
button.btn-sm.btn-primary {
  min-height: 36px;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}

/* Dashboard stat tiles use the rmw_ui hub-tile look (gold icon squares on
   neutral cards, as on the employee dashboard). Status tones stay: red when
   overdue, amber when due soon. */
.wl-stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--rmw-ink, #1a1d21);
}
.wl-warn-text { color: var(--rmw-warning-text, #C2620A) !important; }
[data-bs-theme="dark"] .wl-warn-text { color: #FB9A3C !important; }

/* --- Analyze sticky action bar --- */
.wl-analyze-bar {
  position: sticky;
  top: 56px;
  z-index: 1020;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
}
[data-bs-theme="dark"] .wl-analyze-bar {
  background: var(--bs-tertiary-bg, #2b3035);
  border-color: var(--bs-border-color, #495057);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  color: var(--bs-body-color, #e9ecef);
}
.wl-analyze-bar .wl-analyze-meta {
  font-size: 0.9rem;
  line-height: 1.3;
}
.wl-analyze-bar .wl-analyze-meta strong {
  font-size: 1rem;
}
.wl-analyze-bar .wl-analyze-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.wl-analyze-bar .wl-analyze-dt {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
}
.wl-analyze-bar .wl-analyze-dt .form-label {
  font-size: 0.7rem;
  margin-bottom: 0.15rem;
}
.wl-analyze-bar .wl-analyze-dt .form-control {
  min-width: 8.5rem;
  width: auto;
}

/* Pass / Fail segmented toggles (still radio inputs) */
.wl-passfail {
  display: inline-flex;
  width: 100%;
  max-width: 18rem;
}
.wl-passfail .btn {
  flex: 1;
  min-height: 2.75rem;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
}
.wl-passfail .btn-check:checked + .btn-outline-success {
  background-color: #198754;
  border-color: #198754;
  color: #fff;
}
.wl-passfail .btn-check:checked + .btn-outline-danger {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

/* Intake sections */
.wl-intake-step {
  margin-bottom: 1rem;
}
.wl-intake-step .wl-step-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.wl-intake-step .wl-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--rmw-accent-btn, #1e3a5f);
  color: var(--rmw-on-accent, #fff);
  font-size: 0.8rem;
  font-weight: 700;
}
.wl-intake-step .card-body {
  padding: 1rem 1.1rem;
}
.wl-add-bottle {
  min-height: 2.25rem;
}

@media (max-width: 767.98px) {
  .wl-analyze-bar {
    top: 56px;
  }
  .wl-analyze-bar .wl-analyze-actions .btn {
    flex: 1 1 auto;
  }
}

/* Report email review: plain black text in fields (no gray look) */
.wl-email-review .form-control,
.wl-email-review .form-control-plaintext,
.wl-email-review .form-check-label,
.wl-email-review .wl-email-attach,
.wl-email-review .wl-email-help {
  color: #000;
}
.wl-email-review .form-control::placeholder {
  color: #6c757d;
}
/* Light mode keeps plain black so fields do not look gray. Dark mode
   follows the theme ink so the same rule does not paint black on a dark card. */
[data-bs-theme="dark"] .wl-email-review .form-control,
[data-bs-theme="dark"] .wl-email-review .form-control-plaintext,
[data-bs-theme="dark"] .wl-email-review .form-check-label,
[data-bs-theme="dark"] .wl-email-review .wl-email-attach,
[data-bs-theme="dark"] .wl-email-review .wl-email-help {
  color: var(--bs-body-color, #e9ecef);
}
[data-bs-theme="dark"] .wl-email-review .form-control::placeholder {
  color: #adb5bd;
}
.wl-email-review textarea.form-control {
  font-family: inherit;
  white-space: pre-wrap;
}
