/* Safety landing */
.safety-home-body {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.92), transparent 34rem),
    var(--ground);
}

.safety-home-container {
  width: min(100%, var(--page-safety));
  padding-top: 36px;
}

.safety-hero {
  margin: 0 0 1.35rem;
}

.safety-hero h1 {
  font-size: clamp(1.7rem, 3vw, 2.1rem);
}

.safety-hero > p:last-child {
  margin: 0.42rem 0 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.module-card {
  position: relative;
  min-height: 116px;
  padding: 1.2rem 1.35rem;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
  border: 1px solid #e6e9eb;
  border-left: 5px solid var(--module-color);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.module-card:hover {
  border-color: color-mix(in srgb, var(--module-color) 55%, var(--line));
  box-shadow: 0 14px 30px rgba(21, 29, 34, 0.12);
  transform: translateY(-2px);
}

.module-card:active {
  transform: translateY(0);
}

.module-incident {
  --module-color: var(--incident);
}

.module-hazard {
  --module-color: var(--hazard);
}

.module-checklist {
  --module-color: var(--checklist);
}

.module-actions {
  --module-color: var(--actions);
}

.module-dashboard {
  --module-color: var(--dashboard);
}

/* The subcontractor register, added beside the dashboard on 9 September 2026.
   Its own colour so the six cards stay distinguishable at a glance. */
.module-subcontractors {
  --module-color: var(--subcontractors);
}

.module-vehicle {
  --module-color: var(--vehicle);
}

.module-training {
  --module-color: var(--training);
}

.module-sds {
  --module-color: var(--sds);
}

.module-maintenance {
  --module-color: var(--maintenance);
}

.module-legal {
  --module-color: var(--legal);
}

.module-review {
  --module-color: var(--legal);
}

/* Notification rules, HSEQ and administrators. The page existed at
   /safety/admin/settings with no link to it anywhere, which is how Zak could not find
   it on 23 October 2026. */
.module-rules {
  --module-color: var(--rules);
}

.module-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--module-color);
  color: #ffffff;
}

.module-icon svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.module-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.module-copy strong {
  font-size: 1.08rem;
  line-height: 1.25;
}

.module-copy span {
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.38;
}

.module-arrow {
  color: #a9b2b8;
  font-size: 1.8rem;
  line-height: 1;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 170ms ease, transform 170ms ease;
}

.module-card:hover .module-arrow,
.module-card:focus-visible .module-arrow {
  opacity: 1;
  transform: translateX(0);
}

.safety-status-line {
  margin: 2rem auto 0;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  color: #75818a;
  font-size: 0.76rem;
}

.safety-status-line strong {
  color: #3f4c54;
  font-variant-numeric: tabular-nums;
}

/* Safety manager dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 1rem;
}

.dashboard-grid .panel {
  min-height: 100%;
}

.compact-list {
  display: flex;
  flex-direction: column;
}

.compact-row {
  min-height: 56px;
  padding: 0.62rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border-bottom: 1px solid #edf0f2;
  color: var(--ink);
  text-decoration: none;
}

.compact-row:last-child {
  border-bottom: 0;
}

.compact-row:hover strong {
  color: var(--brand-700);
}

.compact-row > span:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.compact-row strong {
  font-size: 0.82rem;
}

.compact-row small {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-summary {
  display: flex;
  flex-direction: column;
}

.risk-summary-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  border-bottom: 1px solid #edf0f2;
  font-size: 0.84rem;
}

.risk-summary-row:last-child {
  border-bottom: 0;
}

.risk-summary-row strong {
  font-variant-numeric: tabular-nums;
}

.risk-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9aa5ac;
}

.risk-dot-low,
.risk-dot-negligible,
.risk-dot-minor {
  background: #54a36e;
}

.risk-dot-medium,
.risk-dot-moderate {
  background: #e3b23c;
}

.risk-dot-high,
.risk-dot-major {
  background: #e47e35;
}

/* Between High and Extreme. Missing until November 2026, so Very High drew grey. */
.risk-dot-very-high {
  background: #d6623a;
}

.risk-dot-extreme,
.risk-dot-catastrophic,
.risk-dot-critical {
  background: #c84a3d;
}

.admin-shortcuts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-left: 4px solid var(--env-yellow);
}

.admin-shortcuts h2 {
  margin-bottom: 0;
}

/* Safety forms, checklists and matrix */
.quick-links {
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.quick-links .card {
  margin-bottom: 0;
  color: inherit;
  text-decoration: none;
}

.risk-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr));
  gap: 6px;
  overflow-x: auto;
}

.risk-cell {
  min-height: 54px;
  padding: 0.55rem;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 750;
}

.risk-cell small {
  margin-top: 0.15rem;
  display: block;
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1.2;
}

.risk-cell:hover {
  filter: brightness(0.97);
}

.risk-cell.selected {
  border-color: #172127;
  box-shadow: 0 0 0 2px #ffffff inset;
}

.risk-ok {
  background: #a8d08d;
}

.risk-warn {
  background: #ffe699;
}

.risk-high {
  background: #f4b183;
}

.risk-crit {
  background: #b8433a; /* white on #d85f57 was 3.69:1; on #b8433a 5.3:1 */
  color: #ffffff;
}

.builder-section {
  margin: 12px 0;
}

.add-question {
  margin-top: 0.5rem;
}

.remove-question,
.remove-section {
  border-color: #e6b8b1;
  color: var(--red);
}

.remove-question:hover,
.remove-section:hover {
  border-color: #d58e84;
  background: var(--red-bg);
  color: var(--red);
}

.builder-question {
  margin: 10px 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfb;
}

.checklist-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.checklist-section > label {
  margin: 0.8rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
  color: #53616b;
  font-size: 0.82rem;
  font-weight: 650;
}

pre {
  padding: 12px;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background: #f5f6f7;
  white-space: pre-wrap;
  word-break: break-word;
}

