/* ===== Typography ===== */
:root {
  --text-primary: #e8eef6;
  --text-secondary: #9fb3c8;
}

/* ===== Artifact Groups ===== */
.artifact-upload-group {
  border-left: 4px solid #4da3ff;
  background: linear-gradient(180deg, rgba(77,163,255,.12), transparent);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.artifact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.artifact-header strong {
  font-size: 14px;
  font-weight: 600;
  max-width: 75%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Children ===== */
.artifact-child {
  padding: 8px 10px;
  margin-top: 6px;
  border-radius: 8px;
  background: rgba(255,255,255,.03);
}

.artifact-meta {
  font-size: 11px;
  color: var(--text-secondary);
}


.nav-row--project {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
  padding: 6px 8px;
}

.nav-row--project.is-active {
  color: #38bdf8;
  background: rgba(56,189,248,0.12);
  border-radius: 6px;
}

.nav-row--group {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  padding-left: 6px;
}

.nav-row--item {
  font-size: 13px;
  color: #e5e7eb;
  padding: 4px 6px;
  margin-left: 12px;
  border-radius: 4px;
}

.nav-row--item:hover {
  background: rgba(255,255,255,0.06);
}

.artifact {
  margin-left: 16px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  max-width: calc(100% - 24px);
  box-sizing: border-box;
  overflow: hidden;
}
.artifact-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artifact-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.artifact-actions button {
  font-size: 11px;
  padding: 4px 8px;
}

/* ===== Artifact Type Colours (Single Source) ===== */
.artifact-bpmn {
  border-left: 4px solid #6fb7ff;
  background: rgba(111,183,255,0.08);
}

.artifact-policy {
  border-left: 4px solid #f5c542;
  background: rgba(245,197,66,0.08);
}

.artifact-procedure {
  border-left: 4px solid #4caf50;
  background: rgba(76,175,80,0.08);
}

.artifact-uploaded {
  border-left: 4px solid #4da3ff;
  background: rgba(77,163,255,0.06);
}

.artifact-reviewed {
  border-left: 4px solid #ec4899;
  background: rgba(236,72,153,0.06);
}


.artifact-meta.reviewed {
  color: #ec4899;
  font-size: 12px;
}

.sidebar {
  font-size: 13px;
  line-height: 1.4;
}

/* ===== Library Typography Scale ===== */
.nav-row--project {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.nav-row--group {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.nav-row--item {
  font-size: 13px;
  line-height: 1.35;
}

.artifact-title {
  font-size: 13px;
  line-height: 1.35;
}

.artifact-meta {
  font-size: 11px;
  line-height: 1.3;
}

/* ===== Artifact Container Stability ===== */
.artifact,
.artifact-child,
.artifact-upload-group {
  min-width: 0;
  box-sizing: border-box;
}

.artifact-title,
.artifact-header strong {
  overflow-wrap: anywhere;
}

/* ===== Uploaded + Reviewed Group Emphasis ===== */
.artifact-upload-group {
  border-left-width: 5px;
  padding: 14px;
}

.artifact-upload-group > .artifact-header {
  margin-bottom: 6px;
}

.artifact-children {
  margin-top: 8px;
}

.artifact-child {
  margin-left: 6px;
  background: rgba(255,255,255,0.04);
}
/* ===== Artifact Actions ===== */
.artifact-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.artifact-actions button {
  white-space: nowrap;
}

/* ===============================
   Library Tree Structure
================================ */

.sidebar {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-primary);
}

/* PROJECT ROW */
.nav-row--project {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
}

.nav-row--project .nav-label {
  font-size: 14px;
  font-weight: 600;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  opacity: 0.7;
}

/* GROUP HEADERS */
.nav-row--group {
  margin-top: 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 6px 8px;
}

/* ITEM ROWS */
.nav-row--item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 6px 8px;
  margin-left: 12px;
  border-radius: 6px;
}

.nav-row--item .nav-label {
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===============================
   Artifact Cards (Files)
================================ */

.nav-files {
  margin-left: 8px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.artifact {
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 10px 12px;
  max-width: 100%;
}

.artifact-title {
  font-size: 13px;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ACTION BUTTONS */
.artifact-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.artifact-actions button {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
}

/* ===============================
   Uploaded + Reviewed Group
================================ */

.artifact-upload-group {
  background: linear-gradient(
    180deg,
    rgba(90,169,255,0.10),
    rgba(0,0,0,0)
  );
  border-left: 4px solid #5aa9ff;
  border-radius: 12px;
}

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

.artifact-count {
  font-size: 11px;
  opacity: 0.7;
}

.artifact-chevron {
  font-size: 12px;
  opacity: 0.6;
}

/* CHILD ROWS */
.artifact-subrow {
  background: transparent;
  margin-left: 12px;
}

/* ===== Risk Viewer Page ===== */
.viewer-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border-bottom: 1px solid #1e2d3d;
  background: #0f172a;
}

.back-btn {
  background: #1e2d3d;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  color: #e8eef6;
  border-radius: 6px;
  font-size: 13px;
}

.back-btn:hover {
  background: #2a3f55;
}

.risk-card {
  padding: 30px;
  max-width: 900px;
  margin: auto;
}

.risk-card h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 12px;
}

.risk-card h4 {
  margin-top: 25px;
}

/* ===== Risk Artifact Buttons ===== */
.artifact-btn.primary {
  background: #38bdf8;
  color: #020617;
  font-weight: 600;
  border: none;
  border-radius: 4px;
}

.artifact-btn.primary:hover {
  background: #7dd3fc;
}

/* ===== Artifact Register Page ===== */
.register-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: #0f172a;
  border-bottom: 1px solid #1e2d3d;
  flex-wrap: wrap;
}

.register-search {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #2d4a66;
  background: #1e2d3d;
  color: #e8eef6;
  font-size: 13px;
  outline: none;
}

.register-search:focus {
  border-color: #38bdf8;
}

.register-select-all-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #9fb3c8;
  cursor: pointer;
  white-space: nowrap;
}

.artifact-table-container {
  width: 100%;
  max-height: 70vh;   /* 👈 THIS ENABLES VERTICAL SCROLL */
  overflow-y: auto;
  overflow-x: auto;
  padding: 20px;
  box-sizing: border-box;
}

#artifact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: #e8eef6;
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
  min-width: 800px;
}

#artifact-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1e2d3d;
}

#artifact-table th {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;   /* 👈 NEW */
  user-select: none;
}

#artifact-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #1e2d3d;
  vertical-align: middle;
}

#artifact-table tbody tr:last-child td {
  border-bottom: none;
}

#artifact-table tbody tr:hover {
  background: rgba(56,189,248,0.05);
}

#artifact-table .col-select,
#artifact-table .col-select th,
#artifact-table .col-select td {
  width: 36px;
  text-align: center;
}

.col-actions {
  white-space: nowrap;
}

.artifact-name-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(77,163,255,0.14);
  color: #7dd3fc;
  font-size: 11px;
  white-space: nowrap;
}

.artifact-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(74,222,128,0.14);
  color: #86efac;
  font-size: 11px;
  white-space: nowrap;
}

.register-action-btn {
  display: inline-block;
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  background: #1e2d3d;
  color: #e8eef6;
  margin-right: 4px;
  white-space: nowrap;
}

.register-action-btn:hover {
  background: #2a3f55;
}

.register-action-btn.danger {
  background: rgba(239,68,68,0.15);
  color: #f87171;
}

.register-action-btn.danger:hover {
  background: rgba(239,68,68,0.28);
}

/* ===== Revision History Panel ===== */
.history-panel {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-panel.hidden {
  display: none;
}

.history-panel-inner {
  background: #131f2e;
  border: 1px solid #1e2d3d;
  border-radius: 12px;
  width: 560px;
  max-width: 95vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.history-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #1e2d3d;
  background: #1e2d3d;
}

.history-close-btn {
  background: none;
  border: none;
  color: #9fb3c8;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.history-close-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #e8eef6;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: #e8eef6;
}

.history-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9fb3c8;
  border-bottom: 1px solid #1e2d3d;
}

.history-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #1a2840;
}

.history-table tbody tr:hover {
  background: rgba(56,189,248,0.05);
}

@media (max-width: 640px) {
  .register-header {
    flex-direction: column;
    align-items: stretch;
  }
  .register-search {
    max-width: 100%;
  }
}

/* =========================================================
   RISK ANALYTICS MODULE
========================================================= */


.ra-page {
  margin: 12px 16px 16px 12px; /* top, right, bottom, left */
  padding: 20px;
  border-radius: 12px;

  background: radial-gradient(circle at top, #1e293b, #020617);

  height: calc(100vh - 80px); /* prevents overflow issues */
  overflow-y: auto;
}

.ra-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #e2e8f0;
}

.ra-controls {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ra-control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ra-control-group label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9fb3c8;
}
#ra-controls-list {
  max-width: 800px;
}

.ra-select {
  background: #0d1e2e;
  color: #e2e8f0;
  border: 1px solid #1e3a5f;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  min-width: 160px;
}

.ra-toggle {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #1e3a5f;
}

.ra-toggle-btn {
  background: #0d1e2e;
  color: #9fb3c8;
  border: none;
  padding: 7px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.ra-toggle-btn.active {
  background: #1e3a5f;
  color: #38bdf8;
  font-weight: 600;
}

.ra-toggle-btn:not(.active):hover {
  background: #111e2d;
  color: #e2e8f0;
}

.ra-divider {
  border: none;
  border-top: 1px solid #1e2d3d;
  margin: 20px 0;
}

.ra-section {
  margin-bottom: 32px;
}

.ra-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 16px;
}

/* Heatmap */

.ra-heatmap-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.ra-heatmap-y-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 12px;
  color: #9fb3c8;
  align-self: center;
  white-space: nowrap;
}

.ra-heatmap-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ra-heatmap-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ra-heatmap-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ra-heatmap-row-label {
  width: 24px;
  text-align: right;
  font-size: 12px;
  color: #9fb3c8;
  flex-shrink: 0;
}

.ra-heat-cell {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  user-select: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.ra-heat-cell:hover {
  opacity: 0.85;
  transform: scale(1.06);
}

.ra-heatmap-x-labels {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.ra-heatmap-x-label {
  width: 60px;
  text-align: center;
  font-size: 12px;
  color: #9fb3c8;
}

.ra-heatmap-x-title {
  font-size: 12px;
  color: #9fb3c8;
  text-align: center;
  margin-top: 4px;
  margin-left: 28px;
}

/* Pareto chart */

.ra-chart-wrap {
  max-width: 700px;
}

/* Modal */

.ra-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.ra-modal-overlay.hidden {
  display: none;
}

.ra-modal {
  background: #0d1e2e;
  border: 1px solid #1e3a5f;
  border-radius: 10px;
  padding: 24px;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

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

.ra-modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
}

.ra-modal-close {
  background: none;
  border: none;
  color: #9fb3c8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.ra-modal-close:hover {
  background: #1e3a5f;
  color: #e2e8f0;
}

.ra-modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: #cbd5e1;
}

.ra-modal-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #1e3a5f;
  color: #9fb3c8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ra-modal-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #1a2840;
}

.ra-modal-empty {
  color: #9fb3c8;
  font-size: 14px;
}

/* Empty and loading states */

.ra-loading,
.ra-empty {
  color: #9fb3c8;
  font-size: 14px;
  padding: 16px 0;
}

@media (max-width: 640px) {
  .ra-heat-cell {
    width: 44px;
    height: 44px;
    font-size: 14px;
  }
  .ra-heatmap-x-label {
    width: 44px;
  }
}

/* Risk Heatmap */

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(5, 70px);
  gap: 8px;
  margin-top: 20px;
}

.heat-cell {
  width: 70px;
  height: 70px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border: 1px solid #e5e7eb;
}

.heat-low { background:#bbf7d0; }
.heat-medium { background:#fde68a; }
.heat-high { background:#fdba74; }
.heat-extreme { background:#f87171; color:white; }

.ra-risk-link {
  background:none;
  border:none;
  color:#1565c0;
  cursor:pointer;
  text-align:left;
  padding:0;
}

.ra-risk-link:hover {
  text-decoration:underline;
}

.workspace-artifact-table {
  padding: 24px;
}

.artifact-table {
  width: 100%;
  border-collapse: collapse;
}

.artifact-table th {
  background: #0B2D5C;
  color: white;
  padding: 10px;
  text-align: left;
}

#artifact-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.artifact-table tr:hover {
  background: rgba(255,255,255,0.06);
  transform: scale(1.002);
  transition: all 0.12s ease;
}

/* =========================
   Risk Viewer Layout Fix
========================= */

#workspace-editor {
  overflow-y: auto;
}

/* Sticky table header */
.risk-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #0f172a; /* match dark theme */
}

/* Better readability */
.risk-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}
.ra-main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 16px;
}

.ra-left {
  min-width: 0;
}

.ra-right {
  background: #1e2a36;
  padding: 16px;
  border-radius: 10px;
}

.ra-top-risks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ra-risk-item {
  background: #263544;
  padding: 10px;
  border-radius: 6px;
}

.ra-risk-title {
  font-size: 13px;
  font-weight: 600;
}

.ra-risk-score {
  font-size: 12px;
  color: #90a4ae;
}

.ra-main-grid {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr; /* ← balanced */
  gap: 16px;
}

.ra-risk-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
}

.ra-sub {
  color: #90a4ae;
}

.ra-arrow {
  opacity: 0.6;
}

.ra-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.ra-extreme { background:#e53935; color:white; }
.ra-high    { background:#fb8c00; color:white; }
.ra-medium  { background:#fdd835; color:black; }
.ra-low     { background:#43a047; color:white; }

.ra-control-item {
  display: flex;
  justify-content: space-between;
  align-items: center;

  background: rgba(148,163,184,0.15);
  padding: 10px 12px;
  border-radius: 8px;

  margin-bottom: 8px;
}

.ra-control-count {
  opacity: 0.7;
}

.ra-control-item {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  background: #263544;
  border-radius: 6px;
  margin-bottom: 6px;
}

.ra-control-count {
  opacity: 0.7;
}

.ra-right {
  background: linear-gradient(
    180deg,
    #1e293b,
    #0f172a
  );
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.ra-left {
  background: linear-gradient(
    180deg,
    #0f172a,
    #020617
  );
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 16px;
}

#workspace-risk-analytics {
  color: #e2e8f0; /* soft white */
}

.ra-subtitle {
  color: #94a3b8;
}

.ra-divider {
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    #334155,
    transparent
  );
  margin: 20px 0;
}
.ra-summary-wrap {
  max-width: 420px;   /* 👈 key change */
  margin-bottom: 16px;
}

.ra-summary {
  display: grid;
  gap: 6px;
}

.ra-summary-card {
  display: flex;
  justify-content: space-between; /* 👈 key fix */
  align-items: center;
  padding: 0 10px;
  height: 24px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.ra-summary-value {
  margin-right: 6px;
}

.ra-pareto-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: stretch; /* 👈 key fix */
}

.ra-pareto-main {
  background: #0f172a;
  padding: 16px;
  border-radius: 10px;
}

.ra-pareto-side {
  display: grid;
  gap: 16px;
}

.ra-pareto-side > div {
  height: 100%;
}

.ra-section {
  margin-bottom: 24px;
}

.ra-section h3 {
  margin-bottom: 10px;
}

.ra-chart-card {
  background: #0f172a; /* deep navy (matches your UI) */
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.ra-chart-card h4 {
  margin-bottom: 10px;
  font-weight: 600;
  color: #e5e7eb;
}
.ra-chart-card--main {
  display: flex;
  flex-direction: column;
}

.ra-chart-card--main canvas {
  max-height: 260px; /* 👈 controls height */
}

.ra-header {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  padding: 20px 24px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.ra-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ra-header h2 {
  margin: 0;
  font-size: 22px;
  color: #f9fafb;
}

.ra-subtitle {
  margin-top: 6px;
  color: #94a3b8;
  font-size: 14px;
}

.ra-back-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e5e7eb;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.ra-back-btn:hover {
  background: #334155;
}

.ra-page {
  background: radial-gradient(circle at top, #1e293b, #020617);
  padding: 20px;
  border-radius: 12px;
}

/* =========================================
   JSEA Hazard ID Fix (FORCE WHITE TEXT)
.jsea-hazard-id {
  color: #ffffff !important;
  font-weight: 600;
  opacity: 0.95;
}

.risk-table td:first-child {
  color: #ffffff !important;
  font-weight: 600;
}

#artifact-table tr {
  height: 44px;
}
#artifact-table tbody tr:hover {
  box-shadow: inset 3px 0 0 #38bdf8;
}

#artifact-table th:hover {
  color: #38bdf8;
}

.artifact-table-container::-webkit-scrollbar {
  width: 8px;
}

.artifact-table-container::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
}

/* ─── Training Compliance Page ─── */
.training-page {
  background: radial-gradient(circle at top, #0b1e3a, #050d1f);
  min-height: 100%;
  padding: 24px;
}

.training-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.training-controls {
  margin-top: 24px;
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
}

.training-dashboard + .training-controls {
  margin-top: 20px;
}

.training-table {
  background: rgba(10, 20, 40, 0.9);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.training-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 8px;
  padding: 10px 16px;
}

.arch-upload-zone {
  border: 2px dashed #334155;
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(15, 23, 42, 0.4);
  min-width: 240px;
}

.arch-upload-zone:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.arch-upload-zone.drag-over {
  border-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.15);
}

.arch-upload-title {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 2px;
}

.arch-upload-sub {
  font-size: 12px;
  color: #94a3b8;
}
.arch-upload-zone input {
  display: none;
}

.arch-status {
  margin-top: 10px;
  font-size: 13px;
}

.arch-status.hidden {
  display: none;
}

.gen-modal-section {
  margin-bottom: 28px;   /* ↑ more breathing room */
}

.arch-input-row {
  display: flex;
  gap: 20px;              /* spacing between button + upload */
  align-items: stretch;   /* aligns heights nicely */
  margin-top: 16px;
}

.arch-upload-zone {
  flex: 1;                 /* fills remaining space */
  min-height: 72px;        /* gives it presence */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.arch-upload-title {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 4px;
}

.arch-upload-sub {
  font-size: 12px;
  color: #94a3b8;
}

.arch-status {
  margin-top: 12px;
  font-size: 13px;
}

.arch-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-width: 180px;
  height: 72px;

  padding: 0 16px;

  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid #334155;
  border-radius: 10px;

  color: #e2e8f0;
  font-weight: 600;

  cursor: pointer;
  transition: all 0.2s ease;
}
.arch-btn-secondary:hover {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border-color: #38bdf8;
  color: white;

  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}
.arch-btn-secondary:active {
  transform: translateY(0);
  box-shadow: none;
}

.gen-modal-actions {
  margin-top: 8px;
  margin-bottom: 8px;
}

.gen-section-heading {
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.arch-upload-zone:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

#workspace-architecture {
  position: fixed;
  top: 64px;
  left: 280px;
  right: 0;
  bottom: 0;
  background: #0f172a;
  z-index: 5;
}

#arch-canvas {
  position: absolute;
  top: 48px; /* below header */
  left: 0;
  right: 0;
  bottom: 0;

  background: #ffffff;
}

.arch-header {
  height: 48px;
  background: #1e293b;
  color: white;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 16px;
  border-bottom: 1px solid #334155;
}

.arch-title {
  font-weight: 600;
  font-size: 14px;
}

.arch-toolbar {
  position: absolute;
  top: 60px;
  right: 16px;
  z-index: 10;

  display: flex;
  gap: 8px;
}

.arch-toolbar button {
  background: #1e293b;
  color: white;
  border: 1px solid #334155;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.arch-toolbar button:hover {
  background: #3b82f6;
}

.lf-node-text-input {
  color: #000 !important;
  background: #fff !important;
  border: 1px solid #3b82f6 !important;
}
