/* HRH Monitoring — modern field-friendly UI */
:root {
  --hrh-ink: #0f2744;
  --hrh-accent: #0a6b3c;
  --hrh-accent-2: #00431F;
  --hrh-warn: #c2410c;
  --hrh-ok: #15803d;
  --hrh-surface: #f3f7f4;
  --hrh-card: #ffffff;
  --hrh-line: #d5e5db;
  --hrh-muted: #64748b;
}

.hrh-page {
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 5rem;
}

.hrh-hero {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 67, 31, 0.35), transparent 50%),
    linear-gradient(135deg, #000000 0%, #003216 55%, #00431F 85%, #FFDE00 160%);
  color: #fff;
  border-radius: 18px;
  padding: 1.35rem 1.5rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 12px 32px rgba(15, 39, 68, 0.18);
}

.hrh-hero-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 0.35rem;
}

.hrh-hero-title {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.4rem;
}

.hrh-hero p {
  margin: 0;
  opacity: 0.9;
  max-width: 40rem;
  font-size: 0.95rem;
}

.hrh-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.hrh-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.hrh-metric {
  background: var(--hrh-card);
  border: 1px solid var(--hrh-line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hrh-metric:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.12);
  text-decoration: none;
  color: inherit;
}

.hrh-metric-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hrh-muted);
}

.hrh-metric-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--hrh-ink);
  line-height: 1.2;
}

.hrh-metric.is-ok .hrh-metric-value { color: var(--hrh-ok); }
.hrh-metric.is-warn .hrh-metric-value { color: var(--hrh-warn); }
.hrh-metric.is-accent .hrh-metric-value { color: var(--hrh-accent-2); }

.hrh-panel {
  background: var(--hrh-card);
  border: 1px solid var(--hrh-line);
  border-radius: 16px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.hrh-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1.1rem;
  background: var(--hrh-surface);
  border-bottom: 1px solid var(--hrh-line);
}

.hrh-panel-title {
  font-weight: 700;
  color: var(--hrh-ink);
  margin: 0;
  font-size: 1rem;
}

.hrh-panel-body {
  padding: 1.1rem;
}

.hrh-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}

.hrh-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hrh-muted);
  margin-bottom: 0.3rem;
}

.hrh-staff-card {
  border: 1px solid var(--hrh-line);
  border-radius: 14px;
  padding: 0.9rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(180deg, #fff 0%, var(--hrh-surface) 160%);
  animation: hrhIn 0.25s ease;
}

@keyframes hrhIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.hrh-staff-card.is-absent {
  border-color: #fed7aa;
  background: #fff7ed;
}

.hrh-staff-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.hrh-staff-num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--hrh-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.hrh-seg {
  display: inline-flex;
  border: 1px solid var(--hrh-line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.hrh-seg label {
  margin: 0;
  cursor: pointer;
}

.hrh-seg input { display: none; }

.hrh-seg span {
  display: block;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hrh-muted);
}

.hrh-seg input:checked + span {
  background: var(--hrh-accent);
  color: #fff;
}

.hrh-seg.is-absent input:checked + span {
  background: var(--hrh-warn);
}

.hrh-sig-box {
  border: 1px dashed #99f6e4;
  border-radius: 12px;
  min-height: 72px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}

.hrh-sig-box:hover {
  border-color: var(--hrh-accent);
  background: var(--hrh-surface);
}

.hrh-sig-box img {
  max-height: 70px;
  max-width: 100%;
  object-fit: contain;
}

.hrh-sig-box .placeholder {
  color: var(--hrh-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 0.5rem;
}

.hrh-sig-box.has-sig .placeholder { display: none; }

.hrh-sig-box.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background: #f1f5f9;
}

.hrh-sig-box.is-disabled:hover {
  border-color: #99f6e4;
  background: #f1f5f9;
}

.hrh-official-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .hrh-official-grid { grid-template-columns: 1fr; }
}

.hrh-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.hrh-badge-draft { background: #ffedd5; color: #c2410c; }
.hrh-badge-submitted { background: #dcfce7; color: #15803d; }

.hrh-sticky {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--hrh-line);
  margin: 1rem -0.25rem 0;
  box-shadow: 0 -8px 24px rgba(15, 39, 68, 0.08);
}

.hrh-btn-primary {
  background: var(--hrh-accent) !important;
  border-color: var(--hrh-accent) !important;
}

.hrh-btn-primary:hover {
  background: var(--hrh-accent-2) !important;
  border-color: var(--hrh-accent-2) !important;
}

/* Signature modal canvas */
#hrhSigCanvas {
  width: 100%;
  height: 220px;
  touch-action: none;
  border: 1px solid #99f6e4;
  border-radius: 12px;
  background: #fff;
  cursor: crosshair;
}

.hrh-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--hrh-line);
}

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

.hrh-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--hrh-muted);
}

/* Print / paper report — mirrors NCCG Word document logos & colours */
.hrh-paper {
  --nccg-green: #00431F;
  --nccg-green-dark: #003216;
  --nccg-yellow: #FFDE00;
  --nccg-navy: #1F497D;
  background: #fff;
  color: #111;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0 0 0.5rem;
  overflow: hidden;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

.hrh-paper-brand-header {
  background: #000;
  margin: 0 0 0.85rem;
  border-bottom: 4px solid var(--nccg-yellow);
}

.hrh-paper-brand-header--composed {
  line-height: 1.2;
  padding: 0.65rem 0.75rem 0.75rem;
}

.hrh-brand-row {
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  align-items: center;
  gap: 0.5rem;
}

.hrh-brand-left img {
  width: 100%;
  height: auto;
  max-height: 88px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.hrh-brand-center {
  text-align: center;
  color: #fff;
}

.hrh-brand-crest {
  width: auto;
  height: 72px;
  object-fit: contain;
  display: inline-block;
  margin-bottom: 0.25rem;
  image-rendering: -webkit-optimize-contrast;
}

.hrh-brand-county {
  color: var(--nccg-yellow);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hrh-brand-url {
  color: #d7e8d7;
  font-size: 0.72rem;
  margin-bottom: 0.15rem;
}

.hrh-brand-dept {
  color: #2ab864;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hrh-brand-office {
  color: #fff;
  font-size: 0.82rem;
}

.hrh-paper-brand-header img {
  width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: contain;
  object-position: center top;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

.hrh-paper-brand-footer {
  margin: 1.25rem 0 0;
  line-height: 0;
}

.hrh-paper-brand-footer img {
  width: 100%;
  height: auto;
  max-height: 72px;
  object-fit: contain;
  display: block;
}

.hrh-paper-brand-footer-fallback .slogan {
  background: #000;
  color: var(--nccg-green);
  text-align: center;
  padding: 0.55rem;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
}

.hrh-paper-brand-footer-fallback .contacts {
  background: var(--nccg-green);
  color: #fff;
  text-align: center;
  padding: 0.45rem 0.75rem;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

.hrh-paper-status {
  text-align: right;
  padding: 0 1.5rem;
  margin-bottom: 0.35rem;
}

.hrh-paper-badge {
  display: inline-block;
  background: var(--nccg-green);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-bottom: 3px solid var(--nccg-yellow);
}

.hrh-paper-badge.is-draft {
  background: #64748b;
  border-bottom-color: #cbd5e1;
}

.hrh-paper h1 {
  text-align: center;
  font-size: 1.12rem;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 1.5rem 1.1rem;
  letter-spacing: 0.03em;
  color: var(--nccg-green);
  line-height: 1.35;
}

.hrh-paper-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 0.75rem 1rem;
  margin: 0 1.5rem 0.85rem;
  font-size: 0.95rem;
}

.hrh-paper-line {
  border-bottom: 1.5px solid #111;
  min-height: 1.4rem;
  padding: 0 0.25rem 0.15rem;
}

.hrh-paper-label {
  font-size: 0.72rem;
  margin-bottom: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--nccg-navy);
  font-weight: 700;
}

.hrh-paper-team {
  margin: 0 1.5rem 0.85rem;
  font-size: 0.95rem;
}

.hrh-paper-team > strong {
  color: var(--nccg-green);
}

.hrh-paper-team-slot {
  display: inline-block;
  min-width: 28%;
  margin-right: 0.35rem;
}

.hrh-paper table {
  width: calc(100% - 3rem);
  margin: 0.75rem 1.5rem 1rem;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.hrh-paper th,
.hrh-paper td {
  border: 1px solid #111;
  padding: 0.35rem 0.4rem;
  vertical-align: top;
}

.hrh-paper th {
  background: var(--nccg-green);
  color: #fff;
  font-weight: 700;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 3px solid var(--nccg-yellow);
}

.hrh-paper tbody tr:nth-child(even) {
  background: #f4f7f5;
}

.hrh-paper .sig-cell img {
  max-height: 42px;
  max-width: 110px;
}

.hrh-paper-concerns-label {
  margin: 0 1.5rem 0.35rem;
  color: var(--nccg-green);
  font-weight: 700;
  font-size: 0.9rem;
}

.hrh-paper-concerns {
  margin: 0 1.5rem 1rem;
  border: 1px solid #111;
  border-top: 3px solid var(--nccg-yellow);
  min-height: 3rem;
  padding: 0.65rem 0.75rem;
  background: #fafafa;
}

.hrh-paper-signoff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1rem 1.5rem 0.5rem;
  font-size: 0.95rem;
  border-top: 2px solid var(--nccg-green);
  padding-top: 0.85rem;
}

.hrh-paper-signoff img {
  max-height: 56px;
  margin-top: 0.35rem;
}

@media print {
  .main-sidebar,
  .main-header,
  .main-footer,
  .hrh-toolbar,
  .hrh-sticky,
  .hrh-no-print,
  .content-header {
    display: none !important;
  }
  .content-wrapper {
    margin: 0 !important;
  }
  .hrh-paper {
    border: 0;
    padding: 0;
  }
  .hrh-paper-brand-header img {
    max-height: 130px;
  }
  .hrh-brand-crest {
    height: 64px;
  }
  .hrh-brand-row {
    grid-template-columns: 90px 1fr 90px;
  }
}


.hrh-staff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.hrh-hint {
  font-size: 0.88rem;
  color: var(--hrh-muted);
  margin: 0;
}

.hrh-ess-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.45rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: #ccfbf1;
  color: var(--hrh-accent-2);
}

.hrh-staff-top .ml-auto {
  margin-left: auto;
}

.hrh-check-all {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--hrh-ink);
}

.hrh-user-pull-list {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--hrh-line);
  border-radius: 12px;
  background: var(--hrh-surface);
}

.hrh-user-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  margin: 0;
  border-bottom: 1px solid var(--hrh-line);
  cursor: pointer;
  font-weight: 400;
}

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

.hrh-user-row.is-on-roster {
  opacity: 0.65;
  background: #f8fafc;
}

.hrh-user-row input {
  margin-top: 0.25rem;
}

.hrh-user-meta {
  flex: 1;
  min-width: 0;
}

.hrh-user-sig-preview {
  width: 72px;
  height: 36px;
  object-fit: contain;
  border: 1px solid var(--hrh-line);
  border-radius: 6px;
  background: #fff;
  flex-shrink: 0;
}

/* —— Intelligent dashboard —— */
.hrh-page.hrh-dash {
  max-width: 1280px;
}

.hrh-hero--dash {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 1.25rem;
  align-items: stretch;
}

.hrh-hero-aside {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hrh-hero-pulse {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 222, 0, 0.35);
  border-radius: 14px;
  padding: 0.9rem 1rem;
}

.hrh-hero-pulse-label {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

.hrh-hero-pulse-value {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.1;
  color: #ffde00;
}

.hrh-hero-pulse-meta {
  font-size: 0.82rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

.hrh-hero-pulse-meta .is-up { color: #86efac; font-weight: 700; }
.hrh-hero-pulse-meta .is-down { color: #fdba74; font-weight: 700; }

.hrh-hero-mini {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  opacity: 0.95;
}

.hrh-hero-mini span {
  font-weight: 800;
  color: #ffde00;
  margin-right: 0.25rem;
}

.hrh-insight-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.hrh-insight {
  display: block;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  text-decoration: none !important;
  border: 1px solid var(--hrh-line);
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border-left: 4px solid #94a3b8;
}

.hrh-insight:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 39, 68, 0.08);
}

.hrh-insight.tone-ok { border-left-color: #16a34a; background: linear-gradient(180deg, #f0fdf4, #fff); }
.hrh-insight.tone-warn { border-left-color: #ea580c; background: linear-gradient(180deg, #fff7ed, #fff); }
.hrh-insight.tone-danger { border-left-color: #dc2626; background: linear-gradient(180deg, #fef2f2, #fff); }
.hrh-insight.tone-info { border-left-color: #0284c7; background: linear-gradient(180deg, #f0f9ff, #fff); }

.hrh-insight-title {
  font-weight: 700;
  color: var(--hrh-ink);
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
}

.hrh-insight-detail {
  color: var(--hrh-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.hrh-metrics--rich .hrh-metric-sub {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--hrh-muted);
}

.hrh-panel-sub {
  font-size: 0.75rem;
  color: var(--hrh-muted);
  margin-top: 0.1rem;
}

.hrh-smart-table {
  font-size: 0.86rem;
}

.hrh-smart-table th {
  border-top: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hrh-muted);
  background: var(--hrh-surface);
  white-space: nowrap;
}

.hrh-smart-table tr.is-hot { background: #fff1f2; }
.hrh-smart-table tr.is-warm { background: #fff7ed; }
.hrh-smart-table tr.is-cool td:first-child { box-shadow: inset 3px 0 0 #16a34a; }

.hrh-mini-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 0.2rem;
  max-width: 72px;
}

.hrh-mini-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #00431f, #2ab864);
}

.hrh-list-row--rich {
  align-items: flex-start;
}

.hrh-recent-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
}

.hrh-recent-stats span {
  background: var(--hrh-surface);
  border: 1px solid var(--hrh-line);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  color: var(--hrh-ink);
}

.hrh-recent-stats .ok { color: #15803d; }
.hrh-recent-stats .warn { color: #c2410c; }
.hrh-recent-stats .pct { background: #00431f; color: #fff; border-color: #00431f; }

.hrh-cov-row { margin-bottom: 0.85rem; }
.hrh-cov-row:last-child { margin-bottom: 0; }

.hrh-cov-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}

.hrh-cov-bar {
  height: 8px;
  background: #e8eee9;
  border-radius: 99px;
  overflow: hidden;
}

.hrh-cov-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #003216, #2ab864);
  border-radius: 99px;
}

.hrh-cov-meta {
  font-size: 0.75rem;
  color: var(--hrh-muted);
  margin-top: 0.25rem;
}

.hrh-risk-pill {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-weight: 800;
  font-size: 0.85rem;
}

@media (max-width: 991.98px) {
  .hrh-hero--dash {
    grid-template-columns: 1fr;
  }
}
