:root {
  --color-primary: #00a8a8;
  --color-primary-dark: #0b2a54;
  --color-primary-light: #e3f7f6;
  --color-accent: #c98a1f;
  --color-accent-light: #fdf3e0;
  --color-danger: #b3261e;
  --color-danger-light: #fbe9e7;
  --color-bg: #f4f6f5;
  --color-card: #ffffff;
  --color-border: #e2e6e3;
  --color-text: #1c2321;
  --color-text-muted: #5c6663;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --spacing: 1rem;
  --shadow-sm: 0 1px 2px rgba(15, 30, 25, 0.06), 0 1px 1px rgba(15, 30, 25, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 30, 25, 0.08), 0 1px 3px rgba(15, 30, 25, 0.06);
  --transition: 150ms ease;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

[dir="rtl"] body { font-family: "Segoe UI", Tahoma, "Noto Kufi Arabic", "Noto Sans Arabic", Arial, sans-serif; }

a { color: var(--color-primary); }
a:hover { color: var(--color-primary-dark); }

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* ---------- Header / navigation ---------- */

header.site-header {
  background: #ffffff;
  color: var(--color-primary-dark);
  padding: 0.7rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 20;
}

header.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary-dark);
  text-decoration: none;
  letter-spacing: 0.01em;
}

header.site-header .brand img {
  height: 2.1rem;
  width: auto;
  display: block;
}

header.site-header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
}

header.site-header nav a {
  color: var(--color-primary-dark);
  text-decoration: none;
  margin-inline-start: 0.2rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
}

header.site-header nav a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

header.site-header nav .nav-link-button {
  color: var(--color-primary-dark);
  text-decoration: none;
  margin-inline-start: 0.2rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.9rem;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

header.site-header nav .nav-link-button:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.nav-toggle-checkbox {
  display: none;
}

.nav-toggle-label {
  display: none;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--color-primary-dark);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.nav-toggle-label:hover { background: var(--color-primary-light); }

@media (max-width: 768px) {
  .nav-toggle-label {
    display: block;
    order: 2;
  }

  header.site-header .brand {
    order: 1;
  }

  header.site-header nav {
    order: 3;
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    margin-top: 0.6rem;
    border-top: 1px solid var(--color-border);
    padding-top: 0.6rem;
  }

  .nav-toggle-checkbox:checked ~ nav {
    display: flex;
  }

  header.site-header nav a,
  header.site-header nav .nav-link-button {
    margin-inline-start: 0;
    font-size: 1rem;
    padding: 0.55rem 0.7rem;
    text-align: start;
  }
}

.nav-badge {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  vertical-align: middle;
  margin-inline-start: 0.15rem;
}

header.site-header .lang-switch {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--color-bg);
  border-radius: 999px;
  padding: 0.2rem;
}

header.site-header .lang-switch a {
  color: var(--color-primary-dark);
  font-size: 0.82rem;
  text-decoration: none;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  transition: background var(--transition), color var(--transition);
}

header.site-header .lang-switch a:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ---------- Cards & sections ---------- */

.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.35rem;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin: 0 0 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-title {
  color: var(--color-primary-dark);
  font-size: 1.4rem;
  margin: 0.25rem 0 1.25rem;
}

/* ---------- Forms ---------- */

.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  color: var(--color-text);
}

.field .hint {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

input[type="text"], input[type="tel"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], select, textarea {
  width: 100%;
  padding: 0.62rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 110, 94, 0.15);
}

textarea { min-height: 5rem; resize: vertical; }

.phone-input-group {
  display: flex;
  align-items: stretch;
}

.phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  border: 1px solid var(--color-border);
  border-inline-end: none;
  border-start-start-radius: var(--radius-sm);
  border-end-start-radius: var(--radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
  white-space: nowrap;
}

.phone-input-group input[type="tel"] {
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

.hint-link {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--color-primary);
  margin-top: 0.35rem;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.address-map {
  width: 100%;
  height: 300px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  margin-top: 0.6rem;
}

/* ---------- Smoking product cards (Form 1 calculator) ---------- */

.smoking-products {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.smoking-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.smoking-card:has(.used-checkbox:checked) {
  border-color: var(--color-primary);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.smoking-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  background: var(--color-surface, #fff);
  margin: 0;
}

.smoking-card:has(.used-checkbox:checked) .smoking-card-header {
  background: var(--color-primary-light);
}

.smoking-card-header .used-checkbox {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  accent-color: var(--color-primary);
}

.smoking-card-title {
  flex: 1;
  font-weight: 600;
}

.smoking-pack-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: #eef1ee;
  font-size: 0.85rem;
  white-space: nowrap;
}

.smoking-card:has(.used-checkbox:checked) .smoking-pack-chip {
  background: #fff;
  color: var(--color-primary-dark);
  font-weight: 600;
}

.smoking-card-body {
  display: none;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding: 0.9rem 1rem 1rem;
  border-top: 1px dashed var(--color-border);
}

.smoking-card-body.open { display: flex; }

.smoking-input {
  flex: 1 1 130px;
  min-width: 130px;
}

.smoking-input label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.3rem;
}

.smoking-input input { width: 100%; }

.smoking-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.9rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.smoking-total strong { font-size: 1.35rem; }

/* ---------- Worklist side menu ---------- */

.worklist-layout {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.worklist-menu {
  flex: 0 0 240px;
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.worklist-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface, #fff);
  cursor: pointer;
  font: inherit;
  text-align: start;
  transition: background 0.15s, border-color 0.15s;
}

.worklist-menu-item:hover { background: var(--color-primary-light); }

.worklist-menu-item.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  font-weight: 600;
}

.worklist-panels { flex: 1; min-width: 0; }

@media (max-width: 800px) {
  /* Stacked on a phone: align-items:flex-start would size the panels to their widest table
     (a 650px row on a 375px screen), so the whole page scrolled sideways. */
  .worklist-layout { flex-direction: column; align-items: stretch; }
  .worklist-panels { width: 100%; min-width: 0; }
  .worklist-menu {
    position: static;
    flex: none;
    width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.4rem;
  }
  .worklist-menu-item { flex: 0 0 auto; width: auto; white-space: nowrap; }
}

.signature-pad {
  display: block;
  width: 100%;
  max-width: 600px;
  height: 200px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: crosshair;
}

.consent-sheet h3 { margin: 1rem 0 0.35rem; font-size: 1.05rem; }
.consent-sheet p, .consent-sheet li { line-height: 1.7; }
.consent-sheet ol.consent-points { padding-inline-start: 1.25rem; }
.consent-sheet ol.consent-points > li { margin-bottom: 0.6rem; }
.consent-sheet ul { padding-inline-start: 1.25rem; margin: 0.35rem 0; }

.checkbox-row, .radio-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.35rem 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

@media (min-width: 640px) {
  .checkbox-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}

.group-label {
  font-weight: 700;
  color: var(--color-primary-dark);
  margin: 1rem 0 0.4rem;
  font-size: 0.95rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn:hover { background: var(--color-primary-dark); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--color-primary-dark); outline-offset: 2px; }

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  box-shadow: none;
}

.btn-secondary:hover { background: var(--color-primary-light); color: var(--color-primary-dark); }

.btn-danger { background: var(--color-danger); }
.btn-danger:hover { background: #8f1e18; }

.btn-sm { padding: 0.42rem 0.85rem; font-size: 0.88rem; }

/* ---------- Alerts ---------- */

.alert {
  padding: 0.85rem 1.05rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  border-inline-start: 4px solid transparent;
}

.alert-error { background: var(--color-danger-light); color: var(--color-danger); border-inline-start-color: var(--color-danger); }
.alert-success { background: var(--color-primary-light); color: var(--color-primary-dark); border-inline-start-color: var(--color-primary); }
.alert-warning { background: var(--color-accent-light); color: #7a5416; border-inline-start-color: var(--color-accent); }

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-eligible, .badge-enrolled, .badge-attended, .badge-completed, .badge-success { background: var(--color-primary-light); color: var(--color-primary-dark); }
.badge-ineligible, .badge-declined, .badge-no-show { background: var(--color-danger-light); color: var(--color-danger); }
.badge-approached, .badge-booked { background: #eef1ee; color: var(--color-text-muted); }
.badge-warning { background: var(--color-accent-light); color: #7a5416; }

/* ---------- Tables ---------- */

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.data-table th, table.data-table td {
  text-align: start;
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid var(--color-border);
}

table.data-table th {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

table.data-table tbody tr { transition: background var(--transition); }
table.data-table tbody tr:hover { background: #fafbfa; }
table.data-table tbody tr:last-child td { border-bottom: none; }

@media (max-width: 720px) {
  table.data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.calc-total {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-primary-dark);
}

/* ---------- Calendar ---------- */

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.calendar-day {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  text-align: center;
  background: #fff;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.calendar-day:hover { box-shadow: var(--shadow-sm); border-color: var(--color-primary); transform: translateY(-1px); }
.calendar-day .avail { font-weight: 700; font-size: 1.2rem; color: var(--color-primary-dark); }
.calendar-day.full { background: var(--color-danger-light); }
.calendar-day.full .avail { color: var(--color-danger); }
.calendar-day.closed { background: #f0f0ee; color: var(--color-text-muted); }
.calendar-day.closed .avail { color: var(--color-text-muted); }

@media (max-width: 720px) {
  .calendar-week { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 460px) {
  .calendar-week { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Stat tiles ---------- */

.stat-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.stat-tile {
  flex: 1 1 160px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1rem;
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
}

.stat-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-tile .value { font-size: 1.9rem; font-weight: 700; color: var(--color-primary-dark); line-height: 1.2; }
.stat-tile .label { font-size: 0.83rem; color: var(--color-text-muted); margin-top: 0.15rem; }
.stat-tile .sub { font-size: 0.78rem; color: var(--color-primary); margin-top: 0.2rem; font-weight: 600; }
.stat-tile.accent .value { color: var(--color-accent); }
.stat-tile.danger .value { color: var(--color-danger); }

/* ---------- CSS-only bar charts ---------- */

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 25%) 1fr auto;
  align-items: center;
  gap: 0.65rem;
}

.bar-label {
  font-size: 0.86rem;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.bar-track {
  background: var(--color-bg);
  border-radius: 999px;
  height: 0.65rem;
  overflow: hidden;
}

.bar-fill {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  height: 100%;
  border-radius: 999px;
  min-width: 3px;
  transition: width 400ms ease;
}

.bar-value {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  min-width: 1.5rem;
  text-align: end;
}

@media (max-width: 480px) {
  .bar-row { grid-template-columns: 1fr; gap: 0.25rem; }
  .bar-value { text-align: start; }
}

.equity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

/* ---------- Dashboard index tile grid ---------- */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.dash-tile {
  display: block;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.dash-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--color-primary); }
.dash-tile .dash-tile-icon { font-size: 1.6rem; margin-bottom: 0.5rem; display: block; }
.dash-tile .dash-tile-title { font-weight: 700; color: var(--color-primary-dark); font-size: 1rem; margin-bottom: 0.3rem; }
.dash-tile .dash-tile-desc { font-size: 0.82rem; color: var(--color-text-muted); }

/* ---------- Empty state ---------- */

.empty-state {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.empty-state .empty-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.4rem;
  opacity: 0.6;
}

/* ---------- Hero (landing page) ---------- */

.hero {
  text-align: center;
  background: linear-gradient(160deg, var(--color-primary-light) 0%, #ffffff 65%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2.75rem 1.5rem;
}

.hero-logo {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto 1.5rem;
}

.hero .hero-eyebrow {
  display: inline-block;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero h1 {
  color: var(--color-primary-dark);
  font-size: 1.85rem;
  margin: 0 0 0.75rem;
  line-height: 1.3;
}

.hero p {
  color: var(--color-text-muted);
  font-size: 1.02rem;
  max-width: 46rem;
  margin: 0 auto 1.5rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---------- Misc ---------- */

.smoking-table th, .smoking-table td { padding: 0.4rem; }
.smoking-table input { width: 6rem; display: inline-block; }

.apply-stepper-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.apply-stepper-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 150px;
}

.apply-stepper-list .step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: #fff;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.apply-stepper-list .step-label {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.apply-stepper-list li.step-done .step-index {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.apply-stepper-list li.step-done .step-label {
  color: var(--color-primary-dark);
  font-weight: 600;
}

.apply-stepper-list li.step-active .step-index {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.apply-stepper-list li.step-active .step-label {
  color: var(--color-primary-dark);
  font-weight: 700;
}

.apply-stepper-compact {
  display: none;
}

@media (min-width: 641px) {
  .apply-stepper-compact { display: none !important; }
}

@media (max-width: 640px) {
  .apply-stepper-list {
    display: none;
  }

  .apply-stepper-compact {
    display: block;
    margin-bottom: 1.5rem;
  }

  .stepper-compact-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary-dark);
  }

  .stepper-compact-sections {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    color: var(--color-text-muted);
  }
}

footer.site-footer {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  padding: 2.5rem 1rem 1.5rem;
}

.footer-staff-link {
  margin-top: 0.4rem;
}

.footer-staff-link a {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-decoration: underline;
}

/* Staff nav language switch (mirrors the public .lang-switch pill) */
header.site-header nav .nav-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-inline-start: 0.6rem;
  padding: 0.15rem 0.35rem;
  border-radius: 999px;
  background: var(--color-bg);
  font-size: 0.85rem;
}
header.site-header nav .nav-lang a {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  color: var(--color-text-muted, #555);
}
header.site-header nav .nav-lang a.active {
  background: var(--color-primary);
  color: #fff;
}
header.site-header nav .nav-lang-sep { color: var(--color-border); }

/* ===================== Staff shell: slim top bar + side menu ===================== */
:root { --sidebar-w: 240px; --topbar-h: 60px; }

.staff-shell .staff-topbar {
  position: sticky; top: 0; z-index: 30; min-height: var(--topbar-h);
  justify-content: space-between;
}
.staff-shell .topbar-right { display: inline-flex; align-items: center; gap: 0.5rem; }

.staff-sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; inset-inline-start: 0;
  width: var(--sidebar-w);
  background: var(--color-surface, #fff);
  border-inline-end: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow-y: auto; z-index: 25;
  padding: 0.75rem 0.6rem;
}
.staff-sidebar nav { display: flex; flex-direction: column; gap: 0.15rem; }
.staff-sidebar nav a {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.8rem; border-radius: 10px;
  color: var(--color-primary-dark); text-decoration: none; font-size: 0.95rem;
  transition: background var(--transition), color var(--transition);
}
.staff-sidebar nav a .ico { width: 1.4rem; text-align: center; font-size: 1rem; opacity: 0.85; }
.staff-sidebar nav a:hover { background: var(--color-primary-light); color: var(--color-primary); }
.staff-sidebar nav a.active { background: var(--color-primary); color: #fff; font-weight: 600; }
.staff-sidebar nav a.active .ico { opacity: 1; }

/* Push page content beside the sidebar (the fragment is a sibling of <main>/<footer>). */
.staff-shell ~ main, .staff-shell ~ footer { margin-inline-start: var(--sidebar-w); }
.staff-shell ~ main.container-wide { max-width: calc(100% - var(--sidebar-w) - 2rem); }

/* Mobile: sidebar slides in via the existing hamburger checkbox. */
@media (max-width: 900px) {
  .staff-sidebar { transform: translateX(var(--sidebar-hide, -100%)); transition: transform 0.2s ease; }
  html[dir="rtl"] .staff-sidebar { --sidebar-hide: 100%; }
  .staff-shell:has(.nav-toggle-checkbox:checked) .staff-sidebar { transform: none; }
  .staff-shell ~ main, .staff-shell ~ footer { margin-inline-start: 0; }
  .staff-shell ~ main.container-wide { max-width: 100%; }
  .staff-shell .topbar-right { display: none; }
}
/* Hamburger shows whenever the sidebar is off-canvas (900px, wider than the public nav's 768px). */
@media (max-width: 900px) { .staff-shell .nav-toggle-label { display: block; } }

/* Build identity: version badge on the landing hero, staff top bar and page footers. */
.version-badge {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.footer-version {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  opacity: 0.85;
}

.nav-version {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .nav-version { display: none; }
}

/* Drag & drop zone for the scan CD (DICOM) and the report document. */
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 110px;
  margin: 0.75rem 0;
  padding: 1rem;
  border: 2px dashed var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-alt, #f8fafc);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--color-primary);
  background: rgba(13, 148, 136, 0.06);
}

/*
 * Wide tables (nodule table, permissions matrix, Form 1 view, Form 5C findings) are wrapped in
 * .table-scroll. The class was in the markup but had no rule, so those tables simply spilled out of
 * their card with no way to reach the clipped columns.
 */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/*
 * Data-entry cards: a scan date, a kVp value and a Lung-RADS category do not each need a full
 * 780px row. Short controls sit side by side so a reading radiologist sees a section at a glance
 * instead of scrolling a six-thousand-pixel page; anything with free text still spans the card.
 */
.card.form-compact .field {
  display: inline-block;
  width: min(300px, 100%);
  margin-inline-end: 1.25rem;
  vertical-align: top;
}

.card.form-compact .field:has(textarea),
.card.form-compact .field.field-wide {
  display: block;
  width: 100%;
  margin-inline-end: 0;
}

.card.form-compact .field textarea {
  width: 100%;
}

/* One editable row per recruitment site on the admin page. */
.site-row {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--color-border);
}

.site-row:last-child {
  border-bottom: 0;
}

/* Recovered-draft banner: sits above the form it belongs to. */
.draft-banner {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Per-item detail inputs that appear beside the box they belong to (Form 2). */
.fh-relative,
.cm-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.fh-age {
  width: 6rem;
}

.cm-detail {
  flex: 1;
  min-width: 140px;
}

/* Per-slot open/close chips on the scheduling day screen. */
.slot-toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.slot-chip {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  background: var(--color-surface, #fff);
}

.slot-chip.slot-open {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.slot-chip.slot-closed {
  background: #f3f4f6;
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.slot-chip.slot-booked {
  background: rgba(13, 148, 136, 0.12);
  border-color: var(--color-primary);
  cursor: not-allowed;
}

/* Home-vs-work time split, shown beside the workplace location in Form 2. */
.share-meter input[type="range"] {
  width: 100%;
  max-width: 420px;
  accent-color: var(--color-primary);
}

.share-readout {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.share-readout strong {
  color: var(--color-primary-dark);
  font-size: 1.05rem;
}

/* Printing the master timeline: chrome off, content only. */
@media print {
  .no-print, .staff-shell, footer.site-footer { display: none !important; }
  .staff-shell ~ main { margin-inline-start: 0 !important; max-width: 100% !important; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}

/* Simple horizontal bars for the experience / enrollment dashboards. */
.chart-bar-track {
  background: var(--color-border);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.chart-bar {
  background: var(--color-primary);
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Civil-ID live indicator (meeting tasks 157/160): one line under the field whose colour and
   icon carry the verdict - green genuine, amber repeat approach (staff), red invalid/enrolled. */
.civil-id-hint { font-weight: 600; }
.civil-id-hint.ok { color: #1b7f4d; }
.civil-id-hint.warn { color: #9a6700; }
.civil-id-hint.err { color: var(--color-danger); }
input.civil-id-ok { border-color: #1b7f4d; box-shadow: 0 0 0 1px #1b7f4d inset; }
input.civil-id-warn { border-color: #d4a72c; box-shadow: 0 0 0 1px #d4a72c inset; }
input.civil-id-err { border-color: var(--color-danger); box-shadow: 0 0 0 1px var(--color-danger) inset; }

/* Test records (task 161): registered by staff with a made-up civil ID - visually unmistakable. */
.badge-test { background: #4a3b8c; color: #fff; }

/* One-tap day picker (meeting task 172): 0-7 pills instead of a number box. */
.day-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.day-pills label { cursor: pointer; margin: 0; }
.day-pills input { position: absolute; opacity: 0; width: 0; height: 0; }
.day-pills span {
  display: inline-block; min-width: 2.6rem; text-align: center; padding: 0.5rem 0;
  border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-card);
  font-weight: 600; transition: background var(--transition), border-color var(--transition);
}
.day-pills input:checked + span { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.day-pills input:focus-visible + span { outline: 2px solid var(--color-primary-dark); }

/* Conditional follow-ups (meeting task 169/170): indented under the checkbox that reveals them. */
.cond-reveal { margin-inline-start: 1.6rem; padding-inline-start: 0.9rem; border-inline-start: 3px solid var(--color-primary-light); }

/* Locked-visit wrapper (task 177): the fieldset is invisible chrome; disabled styling comes free. */
fieldset.lock-wrap { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.lock-wrap:disabled { opacity: 0.75; }

/* Meeting (task 184): "the font needs to be clearer - easy for the doctor filling it in."
   Larger labels and inputs across every staff/public form, without touching the layout. */
.field label { font-size: 1.05rem; }
.checkbox-row, .radio-row label { font-size: 1.02rem; }
.group-label { font-size: 1.05rem; font-weight: 700; }
input[type="text"], input[type="tel"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], select, textarea { font-size: 1.05rem; }
.section-title { font-size: 1.25rem; }
.hint { font-size: 0.88rem; }

/* 1-5 scales as coloured tap-pills (meeting task 187): 1 red through 5 green, one tap each.
   The colour is hinted on the rim always and fills the pill when picked. */
.likert-wrap { margin-top: 0.3rem; }
.likert-pills { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.likert-pills label { cursor: pointer; margin: 0; }
.likert-pills input { position: absolute; opacity: 0; width: 0; height: 0; }
.likert-pills .lp {
  display: inline-block; min-width: 2.9rem; text-align: center; padding: 0.55rem 0;
  border: 2px solid var(--color-border); border-radius: 999px; background: var(--color-card);
  font-weight: 700; font-size: 1.05rem;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.lp-1 { border-color: #d24d43; } .lp-2 { border-color: #e08a3c; } .lp-3 { border-color: #d4b32c; }
.lp-4 { border-color: #7fb95a; } .lp-5 { border-color: #2e9e5b; }
.likert-pills input:checked + .lp-1 { background: #c0392b; border-color: #c0392b; color: #fff; }
.likert-pills input:checked + .lp-2 { background: #d97a26; border-color: #d97a26; color: #fff; }
.likert-pills input:checked + .lp-3 { background: #c7a416; border-color: #c7a416; color: #fff; }
.likert-pills input:checked + .lp-4 { background: #6aa84f; border-color: #6aa84f; color: #fff; }
.likert-pills input:checked + .lp-5 { background: #1e8e4e; border-color: #1e8e4e; color: #fff; }
.likert-pills input:focus-visible + .lp { outline: 2px solid var(--color-primary-dark); }
.likert-ends { display: flex; justify-content: space-between; margin-top: 0.3rem;
  font-size: 0.82rem; color: var(--color-text-muted); max-width: 20rem; }

/* Missing-answer highlight (meeting task 188): the blocked field lights up and the page scrolls to it. */
.field-missing { outline: 2px solid var(--color-danger); outline-offset: 4px;
  border-radius: var(--radius-sm); background: var(--color-danger-light); }

/* ==========================================================================
   Motion design layer (meeting: "professional feel, must not harm the site").
   Rules of the layer: CSS only, opacity/transform only (no layout shift),
   short durations, and everything gated behind prefers-reduced-motion so a
   user who asked their OS for less motion gets a perfectly still site.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {

  /* Cross-document view transitions were tried here and REMOVED: mid-navigation the browser
     cross-fades a snapshot of the old page, and on a slow connection that blend can be caught
     on screen as a garbled frame (seen live on the doctor's demo). The entrance animations
     below give the same polish without touching navigation rendering. */

  html { scroll-behavior: smooth; }

  @keyframes rise-in {
    from { opacity: 0; transform: translateY(14px); }
  }

  /* Page entrance: the title leads, then the cards follow in a quick stagger.
     `backwards` only holds the hidden state during the delay - once finished
     the elements carry no transform at all (Leaflet et al. stay unaffected). */
  main .page-title, main h1 { animation: rise-in 320ms cubic-bezier(.22,.9,.35,1) backwards; }
  main .alert { animation: rise-in 300ms cubic-bezier(.22,.9,.35,1) backwards; }
  main .card, main .stat-tile {
    animation: rise-in 380ms cubic-bezier(.22,.9,.35,1) backwards;
  }
  main .card:nth-child(2), main .stat-tile:nth-child(2) { animation-delay: 45ms; }
  main .card:nth-child(3), main .stat-tile:nth-child(3) { animation-delay: 90ms; }
  main .card:nth-child(4), main .stat-tile:nth-child(4) { animation-delay: 135ms; }
  main .card:nth-child(5), main .stat-tile:nth-child(5) { animation-delay: 180ms; }
  main .card:nth-child(6), main .stat-tile:nth-child(6) { animation-delay: 220ms; }
  main .card:nth-child(n+7), main .stat-tile:nth-child(n+7) { animation-delay: 250ms; }

  /* Micro-interactions: a light lift on hover, a firm press on click. */
  .btn { transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease; }
  .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
  .btn:active { transform: translateY(0) scale(0.985); box-shadow: var(--shadow-sm); }
  .stat-tile, .card { transition: box-shadow 160ms ease, transform 160ms ease; }
  .data-table tbody tr { transition: background 120ms ease; }
  .worklist-menu-item { transition: background 140ms ease, transform 140ms ease; }
  .worklist-menu-item:hover { transform: translateX(-2px); }
  html[dir="ltr"] .worklist-menu-item:hover { transform: translateX(2px); }
  .likert-pills .lp, .day-pills span { transition: transform 120ms ease, background var(--transition), border-color var(--transition), color var(--transition); }
  .likert-pills input:checked + .lp, .day-pills input:checked + span { transform: scale(1.08); }
}

/* Keyboard focus ring - clarity for every user, motion or not. */
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 4px; }

/* Submit feedback: the pressed button shows a spinner and refuses double
   submission - both a polish item and a real data-safety guard. */
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 1.05rem; height: 1.05rem; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: btn-spin 700ms linear infinite;
}
.btn-secondary.btn-loading::after { border-color: rgba(0, 0, 0, 0.2); border-top-color: var(--color-primary-dark); }

/* ==========================================================================
   Data-mode chooser + test-mode banner (meeting: admin picks real vs test
   entry; test mode is unmissable on every staff page).
   ========================================================================== */
.mode-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1.25rem;
  max-width: 46rem;
  margin: 0 auto;
}
.mode-cards form { display: contents; }
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1.5rem;
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.mode-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.mode-card--real:hover { border-color: var(--color-primary); }
.mode-card--test { border-style: dashed; }
.mode-card--test:hover { border-color: #b7791f; }
.mode-card__icon { font-size: 2.4rem; line-height: 1; }
.mode-card__title { font-size: 1.3rem; font-weight: 800; color: var(--color-primary-dark); }
.mode-card__desc { font-size: 0.98rem; color: var(--color-text-muted); line-height: 1.6; max-width: 22rem; }

.test-mode-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem 1rem;
  background: repeating-linear-gradient(45deg, #fff3cd 0 14px, #ffe9a8 14px 28px);
  color: #7a5200;
  border-bottom: 2px solid #d4a72c;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
}
.test-mode-banner a {
  color: #7a5200;
  text-decoration: underline;
  font-weight: 700;
  white-space: nowrap;
}

/* Move banner (meeting): says where the patient just went; the worklist opens on that queue. */
.move-banner { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 0.5rem; }
.move-banner::before { content: "\27A4"; }
.queue-hint { margin-top: -0.35rem; margin-bottom: 0.9rem; }

/* Mode chooser layout (task 196): real entry dominant, tester entry deliberately modest. */
.mode-stack { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; max-width: 34rem; margin: 0 auto; }
.mode-stack form { width: 100%; display: flex; justify-content: center; }
.mode-card--big { width: 100%; padding: 2.5rem 1.5rem; border-width: 3px; }
.mode-card--big .mode-card__icon { font-size: 3rem; }
.mode-card--big .mode-card__title { font-size: 1.5rem; }
.mode-card--small {
  flex-direction: row; align-items: center; gap: 0.7rem; text-align: start;
  width: auto; max-width: 26rem; padding: 0.8rem 1.2rem; opacity: 0.85;
}
.mode-card--small .mode-card__icon { font-size: 1.4rem; }
.mode-card--small .mode-card__title { font-size: 1rem; display: block; }
.mode-card--small .mode-card__desc { font-size: 0.82rem; display: block; }

/* Off-schedule attendance (task 200): the warning and its mandatory reason. */
.off-schedule-box {
  background: #fff8e6; border: 1px solid #d4a72c; border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem; margin-bottom: 0.6rem; max-width: 34rem;
}
.off-schedule-warn { margin: 0 0 0.5rem; font-weight: 700; color: #7a5200; }

/* Doctor's request (2026-09-01): filter row above Upcoming appointments. */
.upcoming-filter { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.9rem; }
.upcoming-filter input, .upcoming-filter select { padding: 0.4rem 0.6rem; border: 1px solid var(--color-border, #dde2e8); border-radius: 8px; font: inherit; }

/* Task 218: screen guide - floating "?" + slide-in drawer with tabs. */
.help-fab { position: fixed; bottom: 22px; inset-inline-end: 22px; width: 52px; height: 52px; border-radius: 50%;
            border: none; background: var(--color-primary, #0d5c63); color: #fff; font-size: 1.6rem; font-weight: 800;
            box-shadow: 0 6px 18px rgba(13,92,99,0.35); cursor: pointer; z-index: 950; transition: transform .15s; }
.help-fab:hover { transform: scale(1.08); }
.help-drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(420px, 94vw); background: #fff;
               box-shadow: -8px 0 28px rgba(0,0,0,0.18); z-index: 960; display: flex; flex-direction: column;
               padding: 1rem 1.1rem; overflow-y: auto; animation: help-in .2s ease-out; }
[dir="ltr"] .help-drawer { box-shadow: 8px 0 28px rgba(0,0,0,0.18); }
@keyframes help-in { from { transform: translateX(var(--help-dir, 30px)); opacity: 0; } to { transform: none; opacity: 1; } }
.help-head { display: flex; justify-content: space-between; align-items: center; font-size: 1.15rem; margin-bottom: .6rem; }
.help-close { border: none; background: #eef1f4; width: 34px; height: 34px; border-radius: 8px; font-size: 1.3rem; cursor: pointer; }
.help-tabs { display: flex; gap: .3rem; margin-bottom: .9rem; border-bottom: 1px solid var(--color-border, #dde2e8); }
.help-tab { flex: 1; border: none; background: none; padding: .55rem .4rem; font: inherit; font-weight: 700; color: #5b6b76; cursor: pointer;
            border-bottom: 3px solid transparent; }
.help-tab.active { color: var(--color-primary, #0d5c63); border-bottom-color: var(--color-primary, #0d5c63); }
.help-pane h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.help-pane p { line-height: 1.7; }
.help-pane ol, .help-pane ul { padding-inline-start: 1.3rem; line-height: 1.75; }
.help-pane ol li { margin-bottom: .35rem; }
.help-tips { margin-top: 1rem; background: #f3f9f8; border-inline-start: 4px solid var(--color-primary, #0d5c63); padding: .6rem .8rem; border-radius: 8px; }
.help-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.25); z-index: 955; }
@media print { .help-fab, .help-drawer, .help-backdrop { display: none !important; } }
.help-drawer[hidden] { display: none; }

/* Field Insert Sheet review badges (admin-only). */
.new-field-badge { display: inline-block; background: #ffe9a8; color: #6b4d00; border: 1px solid #e6c55a; border-radius: 6px;
                   font-size: 0.72rem; font-weight: 800; padding: 1px 7px; margin-inline-start: 0.4rem; vertical-align: middle; letter-spacing: .02em; }
.contact-log-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; align-items: end; }
.contact-log-form label { font-size: 0.8rem; color: var(--color-text-muted, #666); display: block; margin-bottom: 2px; }
.contact-log-form select, .contact-log-form input { width: 100%; }
.deviation-badge { background: #fdeaea; color: #a03030; border-radius: 6px; padding: 1px 7px; font-size: 0.75rem; font-weight: 700; }

/* Task 219: report pages read by AI - filled fields are highlighted for review, never auto-saved */
.ai-read-box { border: 1px dashed var(--color-border); border-radius: 10px; padding: 0.8rem 1rem; margin-bottom: 0.9rem; background: var(--color-surface-alt, #fafafa); }
.ai-filled { background: #fff7c2 !important; outline: 2px solid #f2c94c; outline-offset: 1px; border-radius: 4px; }
label.ai-filled { padding: 0 0.25rem; }

/* v1.18.0 (N) */
/* v1.18.0 (N): WhatsApp channel card on the admin page - the four status badges in one row. */
.whatsapp-counts { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.25rem 0 0.5rem; }
.whatsapp-counts .badge { font-variant-numeric: tabular-nums; }

/* v1.18.0 (R1) */
/* ---- R1 (v1.18.0): report upload page + review of an AI-read draft on Form 6 ---- */
/* Append to main.css. Uses .ai-filled (already at ~line 1486) for the read values. */

/* Upload page: bigger drop target than the DICOM box, the file list under it */
.report-drop-zone { min-height: 160px; cursor: pointer; }
.report-drop-main { font-weight: 600; }
.report-file-list { list-style: none; padding: 0; margin: 0.6rem 0 0; }
.report-file-list li { padding: 0.25rem 0; border-bottom: 1px dashed var(--color-border, #ddd); font-size: 0.95rem; }

/* Review card at the top of Form 6 */
.review-card { border-inline-start: 4px solid #f2c94c; }
.review-summary td.review-missing { color: var(--color-danger, #b42318); font-weight: 600; }
.review-doubt-list { margin: 0.4rem 0 0; padding-inline-start: 1.4rem; }
.review-doubt-list li { margin: 0.35rem 0; }
.review-doubt-list .review-jump { font-weight: 600; margin-inline-end: 0.35rem; }
.review-raw { font-size: 0.9rem; margin-top: 0.15rem; }
.review-raw code { background: #fff; padding: 0.1rem 0.35rem; border-radius: 4px; white-space: pre-wrap; word-break: break-word; }

/* A control the reader has a doubt about: red outline until the radiologist decides */
.needs-decision { outline: 2px solid #d92d20 !important; outline-offset: 1px; border-radius: 4px; }
.needs-decision-flash { box-shadow: 0 0 0 6px rgba(217, 45, 32, 0.25); transition: box-shadow 0.3s; }

/* Sticky Approve bar: always visible while scrolling through the review */
.review-approve-bar { position: sticky; bottom: 0; z-index: 20; margin-top: 1rem;
  background: #fffbe6; border-top: 2px solid #f2c94c; padding: 0.6rem 1rem; }
.review-approve-inner { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.review-approve-inner .btn { margin: 0; }
@media print { .review-approve-bar { display: none; } }

/* v1.18.0 (R2) */
/* R2 (v1.18.0) - Form 5C: read-only lung result from the report (results-consultation.html) */
.report-facts { margin: 0 0 1rem; }
.report-facts-table { max-width: 520px; margin: 0.4rem 0 0; }
.report-facts-table td:first-child { color: #555; width: 55%; }
/* The report view page carries its own print CSS inline (templates/staff/report-view.html). */

/* v1.18.0 (W) */
/* W - v1.18.0 Today's list. NOTHING REQUIRED: the new panel styles are embedded in a <style>
   block at the bottom of templates/staff/worklist.html (same pattern as scheduling-book.html) and
   in scheduling-bulk-reschedule.html, so the pages render correctly without touching main.css.
   If you prefer them centralised, move the two <style> blocks here verbatim and delete them from
   the templates; the selectors are: .today-box, .today-box-title, .today-completed, .bulk-bar,
   .col-check, .id-cell, .actions-cell, .inline-details, .inline-reason-form, .bulk-date,
   .bulk-availability. */
