/* OMOS Modul HSE - Health, Safety, and Environment */
/* Acuan Tampilan Mutlak: admin-dashboard/assets/sample page/omos_hse_dashboard_layout.html */

:root {
  --hse-surface-0: #f9f9f7;
  --hse-surface-1: #f0efec;
  --hse-surface-2: #ffffff;
  --hse-border: rgba(11, 11, 11, 0.1);
  --hse-border-strong: rgba(11, 11, 11, 0.2);
  --hse-text-primary: #0b0b0b;
  --hse-text-secondary: #52514e;
  --hse-text-muted: #898781;
  --hse-text-accent: #184f95;
  --hse-text-success: #006300;
  --hse-text-warning: #734500;
  --hse-text-danger: #8e2626;
  --hse-bg-accent: #ddebfa;
  --hse-bg-success: #e0f2de;
  --hse-bg-warning: #faebce;
  --hse-bg-danger: #fae7e7;
  --hse-fill-accent: #2a78d6;
  --hse-fill-success: #009300;
  --hse-fill-warning: #fab219;
  --hse-fill-danger: #d03b3b;
}

[data-mode="dark"] {
  --hse-surface-0: #111111;
  --hse-surface-1: #151515;
  --hse-surface-2: #1e1e1d;
  --hse-border: rgba(255, 255, 255, 0.1);
  --hse-border-strong: rgba(255, 255, 255, 0.2);
  --hse-text-primary: #fcfcfb;
  --hse-text-secondary: #b4b3a8;
  --hse-text-muted: #7b7974;
  --hse-text-accent: #6da7ec;
  --hse-text-success: #55bf50;
  --hse-text-warning: #eda100;
  --hse-text-danger: #ec7e7e;
  --hse-bg-accent: #062b57;
  --hse-bg-success: #0f350d;
  --hse-bg-warning: #412400;
  --hse-bg-danger: #511212;
  --hse-fill-accent: #3987e5;
  --hse-fill-success: #35b231;
  --hse-fill-warning: #fab219;
  --hse-fill-danger: #e34948;
}

#hseRoot {
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  color: var(--hse-text-primary);
  line-height: 1.4;
  font-size: 12px;
}

.hse-container {
  background: var(--hse-surface-1);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  gap: 12px;
  box-sizing: border-box;
}

/* SIDEBAR SUB-HALAMAN */
.hse-sidebar {
  background: var(--hse-surface-2);
  border: 0.5px solid var(--hse-border);
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 12px;
  height: fit-content;
}

.hse-sidebar-group {
  padding: 10px 8px 4px;
  font-size: 11px;
  color: var(--hse-text-muted);
  font-weight: 500;
}
.hse-sidebar-group:first-child {
  padding-top: 4px;
}

.hse-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--hse-text-secondary);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 12px;
  box-sizing: border-box;
  transition: background 0.15s ease, color 0.15s ease;
}

.hse-sidebar-item:hover {
  background: var(--hse-surface-1);
  color: var(--hse-text-primary);
}

.hse-sidebar-item.is-active {
  background: var(--hse-bg-accent);
  color: var(--hse-text-accent);
  font-weight: 500;
}

.hse-sidebar-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hse-sidebar-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 9999px;
  background: var(--hse-bg-danger);
  color: var(--hse-text-danger);
  font-weight: 500;
}

/* HEADER HALAMAN */
.hse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.hse-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--hse-text-primary);
  line-height: 1.2;
}

.hse-subtitle {
  font-size: 12px;
  color: var(--hse-text-secondary);
  margin-top: 2px;
}

.hse-actions-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hse-btn {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 0.5px solid var(--hse-border);
  background: var(--hse-surface-2);
  color: var(--hse-text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 400;
  transition: all 0.15s ease;
}

.hse-btn:hover {
  background: var(--hse-surface-1);
}

.hse-btn--primary {
  background: var(--hse-fill-accent);
  color: #ffffff;
  border-color: transparent;
  font-weight: 500;
}

.hse-btn--primary:hover {
  opacity: 0.92;
}

/* HERO HARI TANPA LTI */
.hse-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--hse-bg-success);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.hse-hero-number {
  font-size: 30px;
  font-weight: 500;
  color: var(--hse-text-success);
  line-height: 1;
}

.hse-hero-body {
  flex: 1;
}

.hse-hero-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--hse-text-success);
}

.hse-hero-desc {
  font-size: 12px;
  color: var(--hse-text-success);
  margin-top: 2px;
}

.hse-hero-progress {
  width: 110px;
  flex-shrink: 0;
}

.hse-progress-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--hse-surface-2);
  overflow: hidden;
}

.hse-progress-fill {
  height: 6px;
  border-radius: 3px;
  background: var(--hse-fill-success);
}

.hse-progress-label {
  font-size: 11px;
  color: var(--hse-text-success);
  margin-top: 3px;
  text-align: right;
}

/* KPI CARDS (4 KOLOM) */
.hse-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.hse-kpi-card {
  background: var(--hse-surface-2);
  border: 0.5px solid var(--hse-border);
  border-radius: 8px;
  padding: 8px 10px;
  box-sizing: border-box;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.hse-kpi-card:hover {
  border-color: var(--hse-border-strong);
}

.hse-kpi-label {
  font-size: 11px;
  color: var(--hse-text-secondary);
}

.hse-kpi-value {
  font-size: 18px;
  font-weight: 500;
  color: var(--hse-text-primary);
  margin: 2px 0;
}

.hse-kpi-desc {
  font-size: 11px;
}

/* CHARTS (2 KOLOM) */
.hse-charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.hse-card {
  background: var(--hse-surface-2);
  border: 0.5px solid var(--hse-border);
  border-radius: 8px;
  padding: 10px;
  box-sizing: border-box;
}

.hse-card-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--hse-text-primary);
  margin-bottom: 8px;
}

/* Bar Chart Vertikal 6 Bulan */
.hse-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 84px;
}

.hse-bar-col {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}

.hse-bar-fill {
  background: var(--hse-fill-accent);
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
}

.hse-bar-label {
  font-size: 11px;
  color: var(--hse-text-muted);
  margin-top: 3px;
}

/* Horizontal Risk Bar */
.hse-risk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  margin-bottom: 6px;
}
.hse-risk-row:last-child {
  margin-bottom: 0;
}

.hse-risk-label {
  width: 44px;
  color: var(--hse-text-secondary);
}

.hse-risk-bar-track {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--hse-surface-1);
  overflow: hidden;
}

.hse-risk-bar-fill {
  height: 8px;
  border-radius: 4px;
}

.hse-risk-count {
  width: 16px;
  text-align: right;
  color: var(--hse-text-primary);
  font-weight: 500;
}

/* BOTTOM GRID: KEPATUHAN & PERLU TINDAKAN */
.hse-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.hse-compliance-row {
  font-size: 11px;
  margin-bottom: 7px;
}
.hse-compliance-row:last-child {
  margin-bottom: 0;
}

.hse-compliance-meta {
  display: flex;
  justify-content: space-between;
  color: var(--hse-text-secondary);
}

.hse-compliance-track {
  height: 5px;
  border-radius: 3px;
  background: var(--hse-surface-1);
  margin-top: 3px;
  overflow: hidden;
}

.hse-compliance-fill {
  height: 5px;
  border-radius: 3px;
}

.hse-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 7px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.hse-action-row:hover {
  background: var(--hse-surface-1);
}
.hse-action-row:last-child {
  margin-bottom: 0;
}

/* TABEL DAFTAR & FILTER */
.hse-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.hse-input, .hse-select {
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 0.5px solid var(--hse-border);
  background: var(--hse-surface-2);
  color: var(--hse-text-primary);
  box-sizing: border-box;
}

.hse-table-wrap {
  background: var(--hse-surface-2);
  border: 0.5px solid var(--hse-border);
  border-radius: 8px;
  overflow-x: auto;
}

.hse-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.hse-table th {
  background: var(--hse-surface-1);
  color: var(--hse-text-secondary);
  font-weight: 500;
  padding: 8px 10px;
  border-bottom: 0.5px solid var(--hse-border);
}

.hse-table td {
  padding: 8px 10px;
  border-bottom: 0.5px solid var(--hse-border);
  color: var(--hse-text-primary);
}

.hse-table tr:last-child td {
  border-bottom: none;
}

.hse-table tr:hover td {
  background: var(--hse-surface-1);
}

/* BADGES */
.hse-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.hse-badge--low { background: var(--hse-bg-success); color: var(--hse-text-success); }
.hse-badge--medium { background: var(--hse-bg-accent); color: var(--hse-text-accent); }
.hse-badge--high { background: var(--hse-bg-warning); color: var(--hse-text-warning); }
.hse-badge--extreme { background: var(--hse-bg-danger); color: var(--hse-text-danger); }

.hse-badge--new { background: var(--hse-bg-accent); color: var(--hse-text-accent); }
.hse-badge--process { background: var(--hse-bg-warning); color: var(--hse-text-warning); }
.hse-badge--closed { background: var(--hse-bg-success); color: var(--hse-text-success); }
.hse-badge--overdue { background: var(--hse-bg-danger); color: var(--hse-text-danger); }

/* SUB-TAB NAV DALAM SUB-HALAMAN */
.hse-subnav {
  display: flex;
  gap: 6px;
  border-bottom: 0.5px solid var(--hse-border);
  padding-bottom: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.hse-subnav-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  border: 0.5px solid transparent;
  background: transparent;
  color: var(--hse-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.hse-subnav-btn:hover {
  background: var(--hse-surface-1);
  color: var(--hse-text-primary);
}

.hse-subnav-btn.is-active {
  background: var(--hse-surface-2);
  color: var(--hse-text-primary);
  border-color: var(--hse-border);
  font-weight: 500;
}

/* MODAL / DRAWER */
.hse-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 11, 11, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  box-sizing: border-box;
}

.hse-modal {
  background: var(--hse-surface-2);
  border-radius: 12px;
  border: 0.5px solid var(--hse-border);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 16px;
  box-sizing: border-box;
}

.hse-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.hse-form-group {
  margin-bottom: 10px;
}

.hse-form-label {
  display: block;
  font-size: 11px;
  color: var(--hse-text-secondary);
  margin-bottom: 4px;
}

.hse-form-input, .hse-form-select, .hse-form-textarea {
  width: 100%;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 0.5px solid var(--hse-border);
  background: var(--hse-surface-2);
  color: var(--hse-text-primary);
  box-sizing: border-box;
}

.hse-form-textarea {
  resize: vertical;
  min-height: 60px;
}

.hse-matrix-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--hse-surface-1);
  padding: 8px 10px;
  border-radius: 6px;
  margin-top: 6px;
}

/* ROADMAP PLACEHOLDER */
.hse-placeholder-card {
  background: var(--hse-surface-2);
  border: 0.5px solid var(--hse-border);
  border-radius: 8px;
  padding: 32px 20px;
  text-align: center;
}

.hse-placeholder-icon {
  font-size: 32px;
  color: var(--hse-text-muted);
  margin-bottom: 8px;
}

.hse-placeholder-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}

.hse-placeholder-desc {
  font-size: 12px;
  color: var(--hse-text-secondary);
  max-width: 480px;
  margin: 0 auto 16px;
}

@media (max-width: 768px) {
  .hse-container {
    grid-template-columns: 1fr;
  }
  .hse-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hse-charts-grid, .hse-bottom-grid {
    grid-template-columns: 1fr;
  }
}

/* FASE 2: INCIDENTS & REPORTS STYLING */
.hse-incident-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.hse-stat-pill {
  background: var(--hse-surface-2);
  border: 0.5px solid var(--hse-border);
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.hse-stat-pill-label {
  color: var(--hse-text-secondary);
}

.hse-stat-pill-val {
  font-weight: 600;
  font-size: 13px;
  color: var(--hse-text-primary);
}

.hse-why-chain {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.hse-why-item {
  background: var(--hse-surface-1);
  border: 0.5px solid var(--hse-border);
  border-radius: 6px;
  padding: 8px 10px;
}

.hse-why-num {
  display: inline-block;
  background: var(--hse-bg-accent);
  color: var(--hse-text-accent);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.hse-tab-pills {
  display: flex;
  gap: 4px;
  border-bottom: 0.5px solid var(--hse-border);
  margin-bottom: 12px;
}

.hse-tab-pill {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--hse-text-secondary);
  font-size: 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.hse-tab-pill.is-active {
  color: var(--hse-text-primary);
  font-weight: 500;
  border-bottom-color: var(--hse-text-accent);
}

.hse-stat-col-rate {
  font-weight: 600;
  color: var(--hse-text-primary);
}

/* FASE 3: KOMPETENSI (SIMPER, MATRIX, INDUKSI, P5M) */
.hse-badge--valid, .hse-badge--fit {
  background: var(--hse-bg-success);
  color: var(--hse-text-success);
}

.hse-badge--expiring {
  background: var(--hse-bg-warning);
  color: var(--hse-text-warning);
}

.hse-badge--expired, .hse-badge--suspended, .hse-badge--unfit {
  background: var(--hse-bg-danger);
  color: var(--hse-text-danger);
}

.hse-matrix-emp-row:hover {
  background: var(--hse-surface-1);
}

/* FASE 4: IZIN KERJA (PTW, LOTO, SIMOPS) & INSPEKSI */
.hse-badge--simops {
  background: var(--hse-bg-danger);
  color: var(--hse-text-danger);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  animation: pulse-simops 2s infinite ease-in-out;
}

@keyframes pulse-simops {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.hse-simops-alert {
  background: var(--hse-bg-danger);
  border: 1px solid var(--hse-border-danger, rgba(220, 38, 38, 0.4));
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--hse-text-danger);
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
}

.hse-badge--loto-locked {
  background: var(--hse-bg-danger);
  color: var(--hse-text-danger);
  font-weight: 600;
}

.hse-badge--loto-released {
  background: var(--hse-bg-success);
  color: var(--hse-text-success);
}

.hse-badge--ptw-active {
  background: var(--hse-bg-success);
  color: var(--hse-text-success);
}

.hse-badge--ptw-approved {
  background: var(--hse-bg-accent);
  color: var(--hse-text-accent);
}

.hse-badge--ptw-submitted, .hse-badge--ptw-hse-check {
  background: var(--hse-bg-warning);
  color: var(--hse-text-warning);
}

.hse-badge--ptw-closed {
  background: var(--hse-surface-1);
  color: var(--hse-text-secondary);
}

.hse-badge--ptw-expired, .hse-badge--ptw-rejected {
  background: var(--hse-bg-danger);
  color: var(--hse-text-danger);
}

.hse-checklist-group {
  margin-bottom: 14px;
}

.hse-checklist-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--hse-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 0.5px solid var(--hse-border);
}

.hse-checklist-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: var(--hse-surface-1);
  border: 0.5px solid var(--hse-border);
  border-radius: 6px;
  margin-bottom: 6px;
}

.hse-checklist-row.is-critical {
  border-left: 3px solid var(--hse-text-danger);
}

.hse-checklist-prompt {
  font-size: 12px;
  color: var(--hse-text-primary);
  flex: 1;
}

.hse-checklist-options {
  display: flex;
  gap: 6px;
}

.hse-checklist-opt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  cursor: pointer;
  padding: 3px 8px;
  border: 0.5px solid var(--hse-border);
  border-radius: 4px;
  background: var(--hse-surface-0);
  transition: all 0.15s ease;
}

.hse-checklist-opt:hover {
  background: var(--hse-surface-1);
}

.hse-checklist-opt input[type="radio"]:checked + span {
  font-weight: 600;
}

/* ============================================================================
   FASE 6: TANGGAP DARURAT & APD / PERALATAN
   ============================================================================ */
.hse-ert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.hse-ert-card {
  background: var(--hse-surface-2);
  border: 0.5px solid var(--hse-border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hse-ert-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hse-ert-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--hse-text-primary);
}

.hse-ert-role-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.hse-ert-role-badge.commander {
  background: var(--hse-bg-danger);
  color: var(--hse-text-danger);
}

.hse-ert-role-badge.firefighter {
  background: var(--hse-bg-warning);
  color: var(--hse-text-warning);
}

.hse-ert-role-badge.firstaider {
  background: var(--hse-bg-success);
  color: var(--hse-text-success);
}

.hse-ert-role-badge.rescue {
  background: var(--hse-bg-accent);
  color: var(--hse-text-accent);
}

.hse-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.hse-contact-card {
  background: var(--hse-surface-2);
  border: 0.5px solid var(--hse-border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hse-contact-card.internal {
  border-left: 3px solid var(--hse-fill-accent);
}

.hse-contact-card.clinic, .hse-contact-card.hospital {
  border-left: 3px solid var(--hse-fill-success);
}

.hse-contact-card.fire_dept {
  border-left: 3px solid var(--hse-fill-warning);
}

.hse-contact-card.police {
  border-left: 3px solid var(--hse-fill-danger);
}

.hse-stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.hse-stock-pill.critical {
  background: var(--hse-bg-danger);
  color: var(--hse-text-danger);
  font-weight: 600;
}

.hse-stock-pill.normal {
  background: var(--hse-bg-success);
  color: var(--hse-text-success);
}

/* ============================================================================
   FASE 7: KONTRAKTOR (CSMS) & LINGKUNGAN HIDUP
   ============================================================================ */
.hse-csms-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.hse-csms-badge.approved {
  background: var(--hse-bg-success);
  color: var(--hse-text-success);
}

.hse-csms-badge.conditional {
  background: var(--hse-bg-warning);
  color: var(--hse-text-warning);
}

.hse-csms-badge.rejected {
  background: var(--hse-bg-danger);
  color: var(--hse-text-danger);
}

.hse-ctr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.hse-ctr-card {
  background: var(--hse-surface-2);
  border: 0.5px solid var(--hse-border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hse-ctr-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.hse-ctr-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--hse-text-primary);
}

.hse-env-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.hse-env-status.complies {
  background: var(--hse-bg-success);
  color: var(--hse-text-success);
}

.hse-env-status.near_limit {
  background: var(--hse-bg-warning);
  color: var(--hse-text-warning);
}

.hse-env-status.exceeded {
  background: var(--hse-bg-danger);
  color: var(--hse-text-danger);
}

.hse-progress-track {
  width: 100%;
  height: 6px;
  background: var(--hse-surface-1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.hse-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--hse-fill-accent);
}

/* ============================================================================
   FASE 8: AUDIT, SMKP MINERBA, DOKUMEN & REGULASI
   ============================================================================ */
.hse-smkp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.hse-smkp-card {
  background: var(--hse-surface-2);
  border: 1px solid var(--hse-border);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hse-smkp-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--hse-text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hse-finding-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.hse-finding-pill.major {
  background: var(--hse-bg-danger);
  color: var(--hse-text-danger);
  border: 1px solid var(--hse-fill-danger);
}

.hse-finding-pill.minor {
  background: var(--hse-bg-warning);
  color: var(--hse-text-warning);
  border: 1px solid var(--hse-fill-warning);
}

.hse-finding-pill.observation {
  background: var(--hse-surface-1);
  color: var(--hse-text-secondary);
  border: 1px solid var(--hse-border);
}

.hse-finding-pill.opportunity {
  background: var(--hse-bg-success);
  color: var(--hse-text-success);
  border: 1px solid var(--hse-fill-success);
}

.hse-doc-rev-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
  background: var(--hse-surface-1);
  color: var(--hse-text-secondary);
  border: 1px solid var(--hse-border);
}

.hse-legal-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.hse-legal-status.compliant {
  background: var(--hse-bg-success);
  color: var(--hse-text-success);
}

.hse-legal-status.partial {
  background: var(--hse-bg-warning);
  color: var(--hse-text-warning);
}

.hse-legal-status.non_compliant {
  background: var(--hse-bg-danger);
  color: var(--hse-text-danger);
}

.hse-legal-status.not_assessed {
  background: var(--hse-surface-1);
  color: var(--hse-text-muted);
}

/* ============================================================================
   FITUR PELENGKAP: MODE LAYAR BESAR (TV BRIEFING POS HSE) & CETAK DOKUMEN
   ============================================================================ */
.hse-big-screen-container {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0b1120;
  color: #f8fafc;
  padding: 24px 32px;
  box-sizing: border-box;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.hse-tv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.hse-tv-site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hse-tv-badge-live {
  background: #dc2626;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.hse-tv-site-title {
  font-size: 20px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: -0.2px;
}

.hse-tv-site-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.hse-tv-time-clock {
  font-size: 18px;
  font-weight: 600;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #1e293b;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #334155;
}

.hse-tv-btn-close {
  background: #334155;
  color: #f1f5f9;
  border: 1px solid #475569;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.hse-tv-btn-close:hover {
  background: #dc2626;
  border-color: #b91c1c;
  color: #ffffff;
}

.hse-tv-hero {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  border-radius: 12px;
  padding: 24px 32px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  border: 1px solid #22c55e;
}

.hse-tv-hero-main {
  display: flex;
  align-items: center;
  gap: 24px;
}

.hse-tv-hero-number {
  font-size: 68px;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hse-tv-hero-label {
  font-size: 18px;
  font-weight: 700;
  color: #f0fdf4;
}

.hse-tv-hero-desc {
  font-size: 13px;
  color: #bbf7d0;
  margin-top: 4px;
}

.hse-tv-hero-stats {
  text-align: right;
  min-width: 220px;
}

.hse-tv-hero-progress-bg {
  height: 8px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}

.hse-tv-hero-progress-fill {
  background: #86efac;
  height: 100%;
  border-radius: 4px;
}

.hse-tv-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.hse-tv-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hse-tv-card-label {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hse-tv-card-value {
  font-size: 30px;
  font-weight: 800;
  color: #ffffff;
  margin: 8px 0 4px 0;
  line-height: 1.1;
}

.hse-tv-card-desc {
  font-size: 12px;
  color: #64748b;
}

.hse-tv-ticker {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
}

.hse-tv-ticker-badge {
  background: #e11d48;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.hse-tv-ticker-text {
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
  animation: marquee 25s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Dokumen Cetak Standar (Print Template View) */
.hse-print-doc {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 32px 36px;
  margin: 0 auto;
  max-width: 820px;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.4;
}

.hse-print-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 12px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hse-print-company {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
}

.hse-print-doc-title {
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  margin: 10px 0;
  letter-spacing: 0.5px;
}

.hse-print-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  background: #f8fafc;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 16px;
}

.hse-print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-bottom: 18px;
}

.hse-print-table th,
.hse-print-table td {
  border: 1px solid #475569;
  padding: 6px 8px;
  vertical-align: top;
}

.hse-print-table th {
  background: #f1f5f9;
  font-weight: 700;
  text-align: left;
}

.hse-print-signatures {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.hse-print-sign-box {
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 8px;
  text-align: center;
  font-size: 11px;
}

.hse-print-sign-role {
  font-weight: 700;
  margin-bottom: 40px;
  min-height: 28px;
}

.hse-print-sign-name {
  border-top: 1px dashed #475569;
  padding-top: 4px;
  font-weight: 600;
}

/* IBPR / HIRADC RISK REGISTER & 5x5 RISK MATRIX */
.hse-matrix-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--hse-surface-2);
  border: 0.5px solid var(--hse-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.hse-matrix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hse-matrix-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
}

.hse-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hse-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.hse-legend-dot--extreme { background: var(--hse-fill-danger); }
.hse-legend-dot--high { background: var(--hse-fill-warning); }
.hse-legend-dot--medium { background: var(--hse-fill-accent); }
.hse-legend-dot--low { background: var(--hse-fill-success); }

.hse-matrix-grid-wrapper {
  overflow-x: auto;
  padding-bottom: 4px;
}

.hse-matrix-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
}

.hse-matrix-table th,
.hse-matrix-table td {
  border: 1px solid var(--hse-border);
  text-align: center;
  padding: 6px;
  font-size: 11px;
}

.hse-matrix-th-axis {
  background: var(--hse-surface-1);
  font-weight: 600;
  color: var(--hse-text-secondary);
}

.hse-matrix-cell {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
  min-height: 48px;
  height: 52px;
  position: relative;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  font-weight: 600;
}

.hse-matrix-cell:hover {
  transform: scale(1.03);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hse-matrix-cell.is-selected {
  outline: 2.5px solid var(--hse-text-accent);
  outline-offset: -1px;
  z-index: 3;
}

.hse-matrix-cell--extreme {
  background: var(--hse-bg-danger);
  color: var(--hse-text-danger);
  border: 1px solid rgba(208, 59, 59, 0.35);
}

.hse-matrix-cell--high {
  background: var(--hse-bg-warning);
  color: var(--hse-text-warning);
  border: 1px solid rgba(250, 178, 25, 0.4);
}

.hse-matrix-cell--medium {
  background: var(--hse-bg-accent);
  color: var(--hse-text-accent);
  border: 1px solid rgba(42, 120, 214, 0.35);
}

.hse-matrix-cell--low {
  background: var(--hse-bg-success);
  color: var(--hse-text-success);
  border: 1px solid rgba(0, 147, 0, 0.35);
}

.hse-matrix-cell-score {
  font-size: 11px;
  opacity: 0.75;
}

.hse-matrix-cell-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  background: var(--hse-surface-2);
  color: var(--hse-text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.hse-hierarchy-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.hse-hierarchy-badge--elimination { background: #fee2e2; color: #991b1b; }
.hse-hierarchy-badge--substitution { background: #ffedd5; color: #9a3412; }
.hse-hierarchy-badge--engineering { background: #e0f2fe; color: #075985; }
.hse-hierarchy-badge--administrative { background: #fef3c7; color: #92400e; }
.hse-hierarchy-badge--ppe { background: #dcfce7; color: #166534; }

[data-mode="dark"] .hse-hierarchy-badge--elimination { background: #450a0a; color: #fca5a5; }
[data-mode="dark"] .hse-hierarchy-badge--substitution { background: #431407; color: #fdba74; }
[data-mode="dark"] .hse-hierarchy-badge--engineering { background: #082f49; color: #7dd3fc; }
[data-mode="dark"] .hse-hierarchy-badge--administrative { background: #451a03; color: #fcd34d; }
[data-mode="dark"] .hse-hierarchy-badge--ppe { background: #052e16; color: #86efac; }

.hse-control-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  margin-bottom: 4px;
}

@media print {
  body * {
    visibility: hidden;
  }
  .hse-print-area, .hse-print-area * {
    visibility: visible;
  }
  .hse-print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }
  .hse-no-print {
    display: none !important;
  }
}

/* SETUP MASTER: HIERARKI AREA & SUB-AREA */
.hse-setup-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

@media (max-width: 960px) {
  .hse-setup-layout {
    grid-template-columns: 1fr;
  }
}

.hse-setup-col {
  background: var(--hse-surface-2);
  border: 0.5px solid var(--hse-border);
  border-radius: 8px;
  padding: 14px;
  box-sizing: border-box;
}

.hse-setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid var(--hse-border);
}

.hse-setup-title {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--hse-text-primary);
}

.hse-setup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  padding-right: 4px;
}

.hse-setup-area-card {
  padding: 10px 12px;
  border-radius: 6px;
  border: 0.5px solid var(--hse-border);
  background: var(--hse-surface-0);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.hse-setup-area-card:hover {
  background: var(--hse-surface-1);
  border-color: var(--hse-border-strong);
}

.hse-setup-area-card.is-active {
  background: var(--hse-surface-1);
  border-color: var(--hse-text-accent);
  border-left: 4px solid var(--hse-text-accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.hse-setup-area-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.hse-setup-area-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--hse-text-primary);
}

.hse-setup-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
}

.hse-setup-badge-count {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--hse-bg-accent);
  color: var(--hse-text-accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.hse-setup-action-btns {
  display: flex;
  gap: 4px;
  align-items: center;
}

.hse-setup-btn-icon {
  background: transparent;
  border: none;
  color: var(--hse-text-muted);
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 12px;
  transition: color 0.15s, background 0.15s;
}

.hse-setup-btn-icon:hover {
  background: var(--hse-surface-2);
  color: var(--hse-text-primary);
}

.hse-setup-btn-icon--danger:hover {
  color: var(--hse-text-danger);
  background: var(--hse-bg-danger);
}

.hse-setup-detail-banner {
  background: var(--hse-surface-0);
  border: 0.5px solid var(--hse-border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* SETUP INSPEKSI: SEGMENTED CONTROLS & STATS BAR */
.hse-segmented-control {
  display: inline-flex;
  background: var(--hse-surface-1);
  padding: 3px;
  border-radius: 8px;
  gap: 3px;
  border: 0.5px solid var(--hse-border);
}

.hse-segmented-btn {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--hse-text-secondary);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.hse-segmented-btn:hover {
  color: var(--hse-text-primary);
}

.hse-segmented-btn.is-active {
  background: var(--hse-surface-0);
  color: var(--hse-text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.hse-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.hse-stat-card {
  background: var(--hse-surface-0);
  border: 0.5px solid var(--hse-border);
  border-radius: 8px;
  padding: 10px 14px;
}

.hse-stat-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--hse-text-muted);
  margin-bottom: 4px;
}

.hse-stat-val {
  font-size: 18px;
  font-weight: 600;
  color: var(--hse-text-primary);
}

