/* GrantleyApp – Health & Safety screens */
.hs-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
@media (max-width: 600px) { .hs-tiles { grid-template-columns: 1fr 1fr; } }
.hs-tiles .stat-card { padding: 12px 14px; }
.hs-tiles .stat-card .value { font-size: 24px; }
.hs-tiles .stat-card.clickable { cursor: pointer; }
.hs-tiles .stat-card.clickable:hover { border-color: #CFC6B1; }
.hs-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.hs-grid2 .wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .hs-grid2 { grid-template-columns: minmax(0, 1fr); } }
.hs-section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; margin: 18px 0 8px; }
.hs-chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #EEF0F3; color: #4A5260; white-space: nowrap; }
.hs-chip.paper { background: #F4EBD3; color: #6B4E06; }
.hs-chip.auto { background: #E8EEF5; color: #34506E; }
.rag-badge.none { background: #ECEAE4; color: #5F5A50; }
.rag-badge.overdue { background: #7F1D1D; color: #fff; }
.hs-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; background: #CFC8B8; }
.hs-dot.green { background: var(--rag-green); } .hs-dot.amber { background: var(--rag-amber); } .hs-dot.red { background: var(--rag-red); }

/* Register */
.hs-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.hs-filters input[type=search], .hs-filters select { height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; background: #fff; }
.hs-filters input[type=search] { flex: 1 1 200px; }
.hs-cat { margin-bottom: 14px; }
.hs-cat > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 6px 2px; display: flex; gap: 8px; align-items: center; }
.hs-table td { vertical-align: top; }
.hs-table tr.hs-row { border-left: 4px solid transparent; }
.hs-table tr.hs-row td:first-child { box-shadow: inset 4px 0 0 #D8D2C4; }
.hs-table tr.rag-red td:first-child { box-shadow: inset 4px 0 0 var(--rag-red); }
.hs-table tr.rag-amber td:first-child { box-shadow: inset 4px 0 0 var(--rag-amber); }
.hs-table tr.rag-green td:first-child { box-shadow: inset 4px 0 0 var(--rag-green); }
.hs-table tr.off { opacity: 0.55; }
.hs-table .sub { font-size: 12px; color: var(--muted); }
.hs-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--secondary); }
.hs-table input.hs-sel { display: none; margin: 0 8px 0 0; vertical-align: -3px; }
.hs-selecting .hs-table input.hs-sel { display: inline-block; }
@media (min-width: 701px) { .hs-table .action-buttons { flex-wrap: nowrap; } .hs-table td:last-child { width: 1%; white-space: nowrap; } }
.hs-bulk { display: none; position: sticky; bottom: 0; z-index: 5; margin-top: 10px; padding: 10px 12px; background: var(--primary); color: #fff; border-radius: var(--radius); gap: 8px; align-items: center; flex-wrap: wrap; box-shadow: 0 -2px 10px rgba(0,0,0,0.12); }
.hs-bulk.active { display: flex; }
.hs-bulk select, .hs-bulk input { height: 32px; border-radius: 8px; padding: 0 8px; border: 0; font-family: inherit; }

/* 24-month grid */
.hs-gwrap { overflow: auto; max-height: 75vh; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.hs-g { border-collapse: separate; border-spacing: 0; font-size: 11px; }
.hs-g th, .hs-g td { border-bottom: 1px solid #F0EBE0; padding: 0; text-align: center; }
.hs-g thead th { position: sticky; top: 0; background: #FBF8F1; z-index: 2; height: 34px; min-width: 34px; font-weight: 600; color: var(--muted); line-height: 1.1; }
.hs-g th.name { position: sticky; left: 0; background: #fff; z-index: 1; text-align: left; padding: 6px 10px; min-width: 230px; max-width: 280px; font-weight: 500; font-size: 12px; border-right: 1px solid var(--border); cursor: pointer; }
.hs-g th.name:hover { text-decoration: underline; }
.hs-g th.name small { display: block; color: var(--muted); font-weight: 400; }
.hs-g thead th.name { z-index: 3; background: #FBF8F1; cursor: default; }
.hs-g tr.cat th { position: sticky; left: 0; background: #F3EEE2; text-align: left; padding: 6px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.hs-g td.c { width: 34px; height: 30px; }
.hs-g td.c span { display: flex; align-items: center; justify-content: center; margin: 3px 2px; height: 24px; border-radius: 4px; font-weight: 700; color: #fff; }
.hs-g td.c span.green { background: var(--rag-green); }
.hs-g td.c span.amber { background: var(--rag-amber); color: #1a1a1a; }
.hs-g td.c span.red { background: var(--rag-red); }
.hs-g td.c span.overdue { background: #fff; color: #7F1D1D; box-shadow: inset 0 0 0 2px #7F1D1D; }
.hs-g td.c span.has { cursor: pointer; }
.hs-g td.c span.has:hover { outline: 2px solid var(--secondary); outline-offset: 1px; }
.hs-g td.now { background: #FBF7EC; }

/* Test form */
.hs-guidance { background: #FBF8F1; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; line-height: 1.5; }
.hs-guidance .legal { color: var(--muted); font-size: 12px; margin-top: 4px; }
.hs-item { border: 1px solid var(--border); border-left: 4px solid transparent; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--surface); }
.hs-item.green { border-left-color: var(--rag-green); background: #F3FAF3; }
.hs-item.amber { border-left-color: var(--rag-amber); background: #FFF6EB; }
.hs-item.red { border-left-color: var(--rag-red); background: #FDF1F1; }
.hs-item.na { border-left-color: #9A958A; background: #F4F3F0; }
.hs-item-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.hs-item-label { font-weight: 500; font-size: 14px; flex: 1; min-width: 180px; }
.hs-item-label small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.hs-btns { display: flex; gap: 5px; flex-wrap: wrap; }
.hs-btns button { height: 36px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font-weight: 600; cursor: pointer; font-size: 13px; font-family: inherit; }
.hs-btns button.on.pass { background: var(--rag-green); border-color: var(--rag-green); color: #fff; }
.hs-btns button.on.minor { background: var(--rag-amber); border-color: var(--rag-amber); color: #1a1a1a; }
.hs-btns button.on.fail { background: var(--rag-red); border-color: var(--rag-red); color: #fff; }
.hs-btns button.on.na { background: #6B675E; border-color: #6B675E; color: #fff; }
.hs-reading { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hs-reading input { width: 110px; height: 36px; padding: 0 8px; font-size: 15px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; }
.hs-item textarea, .hs-item input[type=text] { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 14px; margin-top: 8px; }
.hs-item textarea { min-height: 56px; }
.hs-range { font-size: 12px; color: var(--muted); }
.hs-result { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; font-weight: 600; }
.hs-result.green { background: #EAF5EA; color: #1F4D22; } .hs-result.amber { background: #FFF1E0; color: #7A3E00; } .hs-result.red { background: #FDECEC; color: #8E1F18; }
.hs-kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 14px; margin-bottom: 12px; }
.hs-kv dt { color: var(--muted); font-size: 13px; }
@media (max-width: 600px) { .hs-kv { grid-template-columns: 1fr; } .hs-kv dt { margin-top: 6px; } }
.hs-photo { max-width: 180px; max-height: 180px; border-radius: 8px; border: 1px solid var(--border); display: block; margin-top: 6px; }

/* Criteria editor */
.hs-crit { display: grid; grid-template-columns: 110px 1fr 70px 70px 70px 70px 70px 34px; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid #F0EBE0; }
.hs-crit input, .hs-crit select { width: 100%; height: 32px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; }
.hs-crit.head { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; border-bottom: 1px solid var(--border); }
.hs-crit .band-g { background: #F1F8F1; } .hs-crit .band-a { background: #FFF6EB; }
.hs-crit input:disabled { background: #F5F4F1; }
@media (max-width: 760px) {
  .hs-crit { grid-template-columns: 1fr 1fr 1fr; }
  .hs-crit.head { display: none; }
  .hs-crit > :nth-child(2) { grid-column: 1 / -1; }
}

/* Bars (single series, value-labelled) */
.hs-bars { display: flex; flex-direction: column; gap: 6px; }
.hs-bar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 34px; gap: 8px; align-items: center; font-size: 13px; }
.hs-bar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-bar .trk { height: 10px; background: #EFE9DA; border-radius: 4px; overflow: hidden; }
.hs-bar .fill { height: 100%; background: #8A6D12; border-radius: 0 4px 4px 0; }
.hs-bar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.hs-cols { display: flex; align-items: flex-end; gap: 4px; height: 110px; padding-top: 16px; }
.hs-cols .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.hs-cols .col .b { width: 100%; max-width: 26px; background: #8A6D12; border-radius: 4px 4px 0 0; min-height: 0; }
.hs-cols .col .n { font-size: 11px; font-weight: 600; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.hs-cols .col .m { font-size: 10px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.hs-stack { display: flex; height: 12px; border-radius: 4px; overflow: hidden; background: #EFE9DA; gap: 2px; }
.hs-stack span { height: 100%; }
.hs-stack .green { background: var(--rag-green); } .hs-stack .amber { background: var(--rag-amber); } .hs-stack .red { background: var(--rag-red); } .hs-stack .none { background: #D8D2C4; }
.hs-catrow { display: grid; grid-template-columns: minmax(120px, 36%) 1fr 80px; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; cursor: pointer; }
.hs-catrow:hover .lbl { text-decoration: underline; }
.hs-catrow .v { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hs-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.hs-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -2px; }

/* Accidents */
.hs-alert { background: #FDECEC; border-left: 4px solid var(--rag-red); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 8px; }
.hs-alert.amber { background: #FFF4E5; border-left-color: var(--rag-amber); }
.hs-alert.info { background: #EEF3F8; border-left-color: #34506E; }
.hs-riddor { border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.5; margin: 6px 0 14px; border: 1px solid var(--border); }
.hs-riddor h4 { font-size: 15px; margin-bottom: 4px; }
.hs-riddor.report { background: #FDECEC; border-color: #F2B8B5; }
.hs-riddor.watch, .hs-riddor.check { background: #FFF4E5; border-color: #F5CFA0; }
.hs-riddor.record { background: #FBF7EC; border-color: #E6D7A8; }
.hs-riddor.not_reportable { background: #EAF5EA; border-color: #BFDDBF; }
.hs-riddor ul { margin: 6px 0 0 18px; }
.hs-riddor .done { font-weight: 700; color: var(--rag-green); }
.hs-fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 4px; margin-bottom: 12px; }
.hs-fieldset legend { font-weight: 700; font-size: 13px; padding: 0 6px; color: var(--primary); }
.hs-checks { display: grid; gap: 4px; margin-bottom: 12px; }
.hs-checks label { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 400 !important; cursor: pointer; }
.hs-checks input { width: 18px !important; height: 18px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--secondary); }
.hs-action { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.hs-action .main { flex: 1; min-width: 200px; font-size: 14px; }
.hs-action .main small { display: block; color: var(--muted); font-size: 12px; }
.hs-action.done .main > span { text-decoration: line-through; color: var(--muted); }
.hs-help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.hs-readonly { background: #EEF3F8; color: #34506E; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }
#jobDetailsModal { z-index: 1100; }
@media (max-width: 700px) { .hs-table.cardify td.title-cell { display: block; } }
