@import './process-mapping-print.css';

/* ============================================================
   Rubber Nursery — Business Process & Requirement Portal Styles
   Fully Scoped under .pm-portal
   ============================================================ */

.pm-portal {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1e293b;
  background-color: #f8fafc;
  line-height: 1.5;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.pm-portal *,
.pm-portal *::before,
.pm-portal *::after {
  box-sizing: inherit;
}

/* ------------------------------------------------------------
   1. Portal Top Header
   ------------------------------------------------------------ */
.pm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 18px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  box-sizing: border-box;
}

.pm-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  min-width: 0;
}

.pm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.pm-brand-icon {
  width: 32px;
  height: 32px;
  background: #116834;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 18px;
}

.pm-brand-titles {
  display: flex;
  flex-direction: column;
}

.pm-brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.pm-brand-sub {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 500;
}

.pm-header-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.pm-nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.15s ease;
  cursor: pointer;
  background: transparent;
  border: none;
}

.pm-nav-link:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.pm-nav-link.is-active {
  color: #116834;
  font-weight: 700;
  border-bottom: 2px solid #116834;
  border-radius: 4px 4px 0 0;
}

.pm-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pm-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 320px;
  min-width: 150px;
  box-sizing: border-box;
}

.pm-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #94a3b8;
  font-size: 0.85rem;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

.pm-search-input {
  width: 100%;
  height: 36px;
  box-sizing: border-box;
  padding: 0 46px 0 36px;
  font-size: 0.82rem;
  line-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  background: #f8fafc;
  color: #1e293b;
  outline: none;
  transition: all 0.15s ease;
  vertical-align: middle;
}

.pm-search-input:focus {
  background: #ffffff;
  border-color: #116834;
  box-shadow: 0 0 0 3px rgba(17, 104, 52, 0.12);
}

.pm-search-input::placeholder {
  color: #94a3b8;
  font-size: 0.8rem;
}

.pm-search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  pointer-events: none;
  user-select: none;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  z-index: 2;
}

.pm-header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.72rem;
  color: #64748b;
}

.pm-header-version {
  font-weight: 600;
  color: #334155;
}

.pm-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1e293b;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}

/* ------------------------------------------------------------
   2. Main 3-Column Layout
   ------------------------------------------------------------ */
.pm-layout {
  display: flex;
  min-height: calc(100vh - 120px);
  width: 100%;
  background: #ffffff;
}

/* Sidebar */
.pm-sidebar {
  width: 230px;
  min-width: 230px;
  max-width: 230px;
  border-right: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pm-sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pm-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pm-role-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.pm-role-select:focus {
  border-color: #116834;
}

.pm-module-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pm-module-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.pm-module-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.pm-module-item.is-active {
  background: #e8f5e9;
  color: #116834;
  font-weight: 700;
}

.pm-mod-num {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 600;
  min-width: 20px;
}

.pm-module-item.is-active .pm-mod-num {
  color: #116834;
}

.pm-common-features {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pm-common-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  font-size: 0.82rem;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  border: none;
  text-align: left;
  width: 100%;
}

.pm-common-item:hover {
  background: #f8fafc;
  color: #1e293b;
}

/* Center Content Area */
.pm-content {
  flex: 1;
  min-width: 0;
  padding: 24px 28px;
  background: #ffffff;
  overflow-y: auto;
}

.pm-breadcrumb {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pm-breadcrumb-link {
  color: #475569;
  text-decoration: none;
  cursor: pointer;
}

.pm-mod-header {
  margin-bottom: 18px;
}

.pm-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.pm-mod-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
}

.pm-badge-confirmed {
  background: #dcfce7;
  color: #15803d;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
}

.pm-badge-progress {
  background: #fef9c3;
  color: #854d0e;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
}

.pm-mod-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  margin: 0 0 6px 0;
}

.pm-mod-desc {
  font-size: 0.86rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
  max-width: 900px;
}

/* Tabs & Feature Selector Row */
.pm-tab-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 16px;
  gap: 12px;
}

.pm-sub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pm-sub-tab-btn {
  padding: 8px 16px;
  font-size: 0.86rem;
  font-weight: 500;
  color: #64748b;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pm-sub-tab-btn:hover {
  color: #116834;
}

.pm-sub-tab-btn.is-active {
  color: #116834;
  font-weight: 700;
  border-bottom-color: #116834;
}

.pm-feature-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #475569;
}

.pm-feature-select {
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  outline: none;
  cursor: pointer;
}

/* ------------------------------------------------------------
   3. Flow Canvas Container
   ------------------------------------------------------------ */
.pm-canvas-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  margin-bottom: 24px;
  overflow: hidden;
}

.pm-canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
}

.pm-canvas-info {
  display: flex;
  flex-direction: column;
}

.pm-canvas-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.pm-canvas-hint {
  font-size: 0.74rem;
  color: #94a3b8;
}

.pm-canvas-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pm-ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
  min-height: 28px;
}

.pm-ctrl-btn:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}

.pm-zoom-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  padding: 0 4px;
  min-width: 44px;
  text-align: center;
}

/* Flow Stage */
.pm-canvas-stage {
  min-height: 380px;
  background: #fdfdfd;
  position: relative;
  overflow: auto;
  padding: 32px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.pm-canvas-stage:active {
  cursor: grabbing;
}

.pm-flow-viewport {
  transition: transform 0.15s ease-out;
  transform-origin: center center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
}

/* Custom Interactive High-Density Node Flowchart */
.pm-flow-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 16px 20px;
  max-width: 950px;
  padding: 10px;
}

.pm-node-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.pm-node-box {
  min-width: 110px;
  max-width: 170px;
  min-height: 52px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  text-align: center;
  line-height: 1.35;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pm-node-box:hover {
  border-color: #64748b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.pm-node-box.is-start,
.pm-node-box.is-end {
  background: #e8f5e9;
  border-color: #4caf50;
  color: #1b5e20;
}

.pm-node-box.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.pm-node-arrow {
  color: #94a3b8;
  font-size: 1.1rem;
  font-weight: bold;
  user-select: none;
}

/* ------------------------------------------------------------
   4. Right Detail Panel
   ------------------------------------------------------------ */
.pm-detail-panel {
  width: 340px;
  min-width: 340px;
  max-width: 340px;
  border-left: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  position: relative;
}

.pm-detail-panel.is-collapsed {
  display: none;
}

.pm-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
}

.pm-detail-head-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pm-detail-close-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.pm-detail-close-btn:hover {
  color: #1e293b;
  background: #f1f5f9;
}

.pm-detail-node-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.pm-detail-node-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.pm-step-code-badge {
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

.pm-detail-summary {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

/* Metadata Key-Value List */
.pm-meta-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #f1f5f9;
}

.pm-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  gap: 12px;
}

.pm-meta-label {
  color: #64748b;
  font-weight: 500;
}

.pm-meta-val {
  color: #1e293b;
  font-weight: 600;
  text-align: right;
}

/* Detail Section Blocks */
.pm-detail-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pm-section-heading {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
}

.pm-section-body {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.45;
  margin: 0;
}

.pm-section-body ul {
  margin: 4px 0 0 0;
  padding-left: 18px;
}

.pm-section-body li {
  margin-bottom: 3px;
}

/* Stock / Population Pill */
.pm-stock-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.pm-stock-pill.is-minus {
  background: #fef2f2;
  color: #b91c1c;
}

.pm-stock-pill.is-plus {
  background: #f0fdf4;
  color: #15803d;
}

.pm-stock-pill.is-neutral {
  background: #f1f5f9;
  color: #475569;
}

/* Business Rule Box */
.pm-br-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pm-br-card:hover {
  background: #dcfce7;
}

.pm-br-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: #166534;
  margin-bottom: 2px;
}

.pm-br-desc {
  font-size: 0.78rem;
  color: #14532d;
  line-height: 1.35;
  margin: 0;
}

/* ------------------------------------------------------------
   5. Requirements Table View
   ------------------------------------------------------------ */
.pm-req-table-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin-top: 20px;
}

.pm-req-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.pm-req-table-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.pm-req-table-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  cursor: pointer;
}

.pm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  background: #ffffff;
}

.pm-table-req {
  min-width: 720px;
}

.pm-table-rev {
  min-width: 780px;
}

.pm-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 0.76rem;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.pm-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: top;
  font-size: 0.8rem;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.pm-table tr:hover td {
  background: #f8fafc;
}

.pm-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: #1e293b;
  white-space: nowrap;
}

/* Specific Column Hierarchy for Requirement Manager */
.pm-col-req-id {
  width: 115px;
  min-width: 110px;
  white-space: nowrap;
}

.pm-col-req-title {
  min-width: 220px;
}

.pm-col-req-role {
  width: 100px;
  min-width: 90px;
}

.pm-col-req-mod {
  width: 130px;
  min-width: 120px;
}

.pm-col-req-proc {
  width: 145px;
  min-width: 135px;
}

.pm-col-req-status {
  width: 95px;
  min-width: 95px;
  text-align: center;
  white-space: nowrap;
}

.pm-col-req-action {
  width: 48px;
  min-width: 48px;
  text-align: center;
}

/* Specific Column Hierarchy for Revision & Review */
.pm-col-rev-entity {
  width: 100px;
  min-width: 95px;
  white-space: nowrap;
}

.pm-col-rev-id {
  width: 115px;
  min-width: 110px;
  white-space: nowrap;
}

.pm-col-rev-title {
  min-width: 220px;
}

.pm-col-rev-mod {
  width: 130px;
  min-width: 120px;
}

.pm-col-rev-change {
  width: 95px;
  min-width: 90px;
  text-align: center;
  white-space: nowrap;
}

.pm-col-rev-status {
  width: 95px;
  min-width: 95px;
  text-align: center;
  white-space: nowrap;
}

.pm-col-rev-meta {
  width: 110px;
  min-width: 100px;
}

.pm-col-rev-action {
  width: 48px;
  min-width: 48px;
  text-align: center;
}

.pm-version-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 1px 5px;
  border-radius: 3px;
  margin-top: 3px;
  font-family: inherit;
  white-space: nowrap;
}

/* ------------------------------------------------------------
   Pagination Controls
   ------------------------------------------------------------ */
.pm-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  font-size: 0.78rem;
  color: #64748b;
  flex-wrap: wrap;
  gap: 12px;
}

.pm-pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pm-page-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.pm-page-btn:hover:not(:disabled):not(.is-active) {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.pm-page-btn.is-active {
  background: #116834;
  border-color: #116834;
  color: #ffffff;
}

.pm-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pm-page-ellipsis {
  padding: 0 4px;
  color: #94a3b8;
  font-size: 0.78rem;
}

.pm-page-size-select {
  padding: 3px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #334155;
  background: #ffffff;
  outline: none;
  cursor: pointer;
  margin-left: 6px;
}

/* ------------------------------------------------------------
   6. Business Rule Full View
   ------------------------------------------------------------ */
.pm-br-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.pm-br-full-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.pm-br-full-id {
  font-size: 0.75rem;
  font-weight: 700;
  color: #116834;
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: 4px;
  align-self: flex-start;
}

.pm-br-full-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.pm-br-full-desc {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.45;
  margin: 0;
}

/* ------------------------------------------------------------
   7. Empty / In-Progress State
   ------------------------------------------------------------ */
.pm-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  color: #64748b;
  border: 2px dashed #e2e8f0;
  border-radius: 12px;
  margin: 20px 0;
}

.pm-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.8;
}

.pm-empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 6px 0;
}

.pm-empty-desc {
  font-size: 0.88rem;
  color: #94a3b8;
  max-width: 440px;
  margin: 0;
  line-height: 1.5;
}

/* ------------------------------------------------------------
   8. Tooltip
   ------------------------------------------------------------ */
.pm-tooltip {
  position: absolute;
  z-index: 50;
  background: #0f172a;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  line-height: 1.4;
  max-width: 380px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.pm-tooltip.is-visible {
  opacity: 1;
}

/* ------------------------------------------------------------
   9. Footer
   ------------------------------------------------------------ */
.pm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  font-size: 0.78rem;
  color: #64748b;
}

.pm-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pm-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ------------------------------------------------------------
   9.5. All Modules View & Section Cards
   ------------------------------------------------------------ */
.pm-all-modules-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pm-all-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 12px;
}

.pm-module-section-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  scroll-margin-top: 80px;
}

.pm-module-section-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.pm-module-section-card.is-focused {
  border-color: #116834;
  box-shadow: 0 0 0 3px rgba(17, 104, 52, 0.15);
}

.pm-section-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  gap: 12px;
  flex-wrap: wrap;
}

.pm-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pm-section-badge-num {
  font-size: 0.85rem;
  font-weight: 700;
  background: #116834;
  color: #ffffff;
  padding: 3px 9px;
  border-radius: 6px;
}

.pm-section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.pm-section-sub {
  font-size: 0.82rem;
  color: #64748b;
  margin-left: 6px;
}

.pm-section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pm-section-meta-pill {
  font-size: 0.75rem;
  color: #475569;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 8px;
}

.pm-section-focus-btn {
  font-size: 0.78rem;
  font-weight: 600;
  color: #116834;
  background: #e8f5e9;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pm-section-focus-btn:hover {
  background: #116834;
  color: #ffffff;
}

.pm-section-stage {
  padding: 24px 20px;
  background: #ffffff;
  overflow-x: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* ------------------------------------------------------------
   10. Responsive Breakpoints
   ------------------------------------------------------------ */
@media (max-width: 1280px) {
  .pm-layout {
    flex-direction: column;
    width: 100%;
  }

  .pm-sidebar {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 16px;
  }

  .pm-module-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px;
  }

  .pm-detail-panel {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    border-left: none;
    border-top: 1px solid #e2e8f0;
    padding: 16px;
  }
}

@media (max-width: 768px) {
  .pm-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .pm-header-right {
    width: 100%;
    justify-content: space-between;
  }

  .pm-search-wrap {
    width: 100%;
  }

  .pm-search-kbd {
    display: none;
  }

  .pm-search-input {
    padding-right: 14px;
  }

  .pm-tab-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ------------------------------------------------------------
   11. Compact Manage Mode Toolbar & Editing UI
   ------------------------------------------------------------ */
.pm-manage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
  color: #f8fafc;
  padding: 8px 24px;
  border-bottom: 1px solid #334155;
  font-size: 0.82rem;
  gap: 16px;
  flex-wrap: wrap;
}

.pm-manage-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pm-mode-segmented {
  display: inline-flex;
  background: #1e293b;
  border-radius: 6px;
  padding: 2px;
  border: 1px solid #475569;
}

.pm-mode-seg-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pm-mode-seg-btn.is-active {
  background: #116834;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pm-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
}

.pm-meta-draft-chip {
  background: #854d0e;
  color: #fef08a;
  border-color: #a16207;
  font-weight: 600;
  animation: pmPulse 2s infinite;
}

@keyframes pmPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.pm-manage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pm-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.pm-btn-primary {
  background: #16a34a;
  color: #ffffff;
}

.pm-btn-primary:hover {
  background: #15803d;
}

.pm-btn-secondary {
  background: #334155;
  color: #f1f5f9;
  border: 1px solid #475569;
}

.pm-btn-secondary:hover {
  background: #475569;
}

.pm-btn-danger {
  background: #991b1b;
  color: #fef2f2;
}

.pm-btn-danger:hover {
  background: #b91c1c;
}

.pm-btn-outline-danger {
  background: #ffffff;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.pm-btn-outline-danger:hover {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

/* Node Manage Overlays */
.pm-node-card.is-manage-mode {
  position: relative;
  padding-top: 24px;
}

.pm-node-manage-header {
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 6px 6px 0 0;
  padding: 2px 6px;
  font-size: 0.7rem;
}

.pm-node-ctrl-btns {
  display: flex;
  align-items: center;
  gap: 3px;
}

.pm-node-btn-icon {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  color: #334155;
  transition: all 0.1s ease;
}

.pm-node-btn-icon:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.pm-node-btn-icon.is-danger:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

/* Modals */
.pm-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.pm-modal-dialog {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pmModalFade 0.2s ease-out;
  box-sizing: border-box;
}

.pm-modal-dialog form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  margin: 0;
}

@keyframes pmModalFade {
  from {
    opacity: 0;
    transform: scale(0.97);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.pm-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  flex-shrink: 0;
}

.pm-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.pm-modal-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
}

.pm-modal-close:hover {
  color: #0f172a;
}

.pm-modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 0.85rem;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.pm-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
  flex-shrink: 0;
}

@media (max-height: 800px) {
  .pm-modal-dialog {
    max-height: calc(100vh - 20px);
  }

  .pm-modal-header {
    padding: 12px 18px;
  }

  .pm-modal-body {
    padding: 14px 18px;
    gap: 10px;
  }

  .pm-modal-footer {
    padding: 10px 18px;
  }
}

@media (max-width: 640px) {
  .pm-modal-backdrop {
    padding: 8px;
  }

  .pm-modal-dialog {
    max-height: calc(100vh - 16px);
  }
}

/* Form inputs in modal */
.pm-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pm-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pm-form-group.is-full {
  grid-column: 1 / -1;
}

.pm-form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}

.pm-form-input,
.pm-form-select,
.pm-form-textarea {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.82rem;
  color: #1e293b;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s ease;
}

.pm-form-input:focus,
.pm-form-select:focus,
.pm-form-textarea:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
}

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

.pm-revision-alert {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.8rem;
  color: #1e40af;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.pm-row-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s ease;
}

.pm-row-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.pm-row-btn.is-danger {
  color: #b91c1c;
  border-color: #fca5a5;
  background: #fff5f5;
}

.pm-row-btn.is-danger:hover {
  background: #fee2e2;
}

.pm-badge-draft {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fef08a;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.pm-badge-archived {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Toast */
.pm-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  font-size: 0.84rem;
  font-weight: 500;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: pmToastSlide 0.25s ease-out;
}

@keyframes pmToastSlide {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Scoped Mermaid Diagram & Node Interactivity */
.mermaid-diagram svg {
  max-width: 100%;
  height: auto;
  user-select: none;
}

.mermaid-diagram .node {
  cursor: pointer !important;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.mermaid-diagram .node:hover rect,
.mermaid-diagram .node:hover polygon,
.mermaid-diagram .node:hover circle,
.mermaid-diagram .node:hover path {
  stroke-width: 2.5px !important;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}

/* Visual Selected State for Diagram Nodes */
.mermaid-diagram .node.is-selected rect,
.mermaid-diagram .node.is-selected polygon,
.mermaid-diagram .node.is-selected circle,
.mermaid-diagram .node.is-selected path {
  stroke: #2563eb !important;
  stroke-width: 3.5px !important;
  filter: drop-shadow(0 0 10px rgba(37, 99, 235, 0.55)) !important;
}

.mermaid-diagram .node.is-selected text {
  font-weight: 700 !important;
}

/* Canvas Panning State */
.pm-canvas-stage.is-panning {
  cursor: grabbing !important;
  user-select: none !important;
}

/* Detail Panel Type Pills */
.pm-type-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pm-type-start,
.pm-type-end {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.pm-type-process {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.pm-type-decision {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}

/* ------------------------------------------------------------
   12. Dashboard, Reference, & Reports Scoped Styles
   ------------------------------------------------------------ */

/* Dashboard */
.pm-dashboard-container {
  padding: 32px 40px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.pm-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.pm-dashboard-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #116834;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.pm-dashboard-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.pm-dashboard-sub {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0;
}

.pm-dashboard-meta-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.8rem;
  color: #475569;
}

/* Stat Grid */
.pm-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.pm-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pm-stat-card.pm-stat-highlight {
  border-left: 4px solid #116834;
}

.pm-stat-card.pm-stat-confirmed {
  border-left: 4px solid #16a34a;
  background: #fdfefe;
}

.pm-stat-card.pm-stat-progress {
  border-left: 4px solid #eab308;
  background: #fdfefe;
}

.pm-stat-card.pm-stat-open {
  border-left: 4px solid #64748b;
}

.pm-stat-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.pm-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 6px;
}

.pm-stat-hint {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Dashboard Tables */
.pm-dashboard-tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 1100px) {
  .pm-dashboard-tables-grid {
    grid-template-columns: 1fr;
  }
}

.pm-dash-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pm-dash-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pm-dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  display: block;
  overflow-x: auto;
}

.pm-dash-table th {
  background: #f8fafc;
  padding: 10px 12px;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.pm-dash-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

/* Reference View */
.pm-reference-container {
  padding: 32px 40px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.pm-ref-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.pm-ref-pill-group {
  display: flex;
  gap: 6px;
  border-right: 1px solid #e2e8f0;
  padding-right: 14px;
}

.pm-ref-pill-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pm-ref-pill-btn.is-active {
  background: #116834;
  color: #ffffff;
  border-color: #116834;
}

.pm-ref-search-input {
  flex: 1;
  min-width: 200px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 0.82rem;
  outline: none;
}

.pm-ref-search-input:focus {
  border-color: #116834;
}

.pm-ref-select {
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 0.8rem;
  color: #334155;
  background: #ffffff;
  outline: none;
}

.pm-ref-table-wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pm-ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.pm-ref-table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.pm-ref-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: top;
}

.pm-ref-id-badge {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  font-size: 0.78rem;
  color: #116834;
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  padding: 2px 8px;
  border-radius: 4px;
}

.pm-ref-category-tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

/* Reports View */
.pm-reports-container {
  padding: 32px 40px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.pm-reports-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 12px;
}

.pm-report-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pm-report-tab-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pm-report-tab-btn.is-active {
  background: #116834;
  color: #ffffff;
  border-color: #116834;
}

.pm-report-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.pm-btn-export-pdf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  background: #116834;
  color: #ffffff;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pm-btn-export-pdf:hover {
  background: #0d5229;
}

/* Document Paper Preview */
.pm-report-document {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 48px 56px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  line-height: 1.6;
  color: #0f172a;
}

.pm-doc-header {
  border-bottom: 2px solid #116834;
  padding-bottom: 20px;
  margin-bottom: 32px;
}

.pm-doc-company {
  font-size: 0.82rem;
  font-weight: 800;
  color: #116834;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pm-doc-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
  margin: 4px 0 8px 0;
  letter-spacing: -0.02em;
}

.pm-doc-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.78rem;
  margin-top: 14px;
}

.pm-doc-meta-item strong {
  color: #475569;
}

.pm-doc-section {
  margin-bottom: 36px;
}

.pm-doc-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #116834;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 8px;
  margin: 0 0 16px 0;
}

.pm-doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-bottom: 20px;
}

.pm-doc-table th {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 8px 12px;
  text-align: left;
  color: #334155;
  font-weight: 700;
}

.pm-doc-table td {
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  vertical-align: top;
  color: #1e293b;
}

/* Print Stylesheet for Pure Document Export */
#pm-print-host {
  display: none;
}

@media print {
  html, body {
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    position: static !important;
  }

  /* When printing with dedicated top-level print host, hide everything else under body */
  body.pm-printing-active > *:not(#pm-print-host) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  .workspace-preview-column,
  .device-stage,
  .device-toolbar-container,
  .device-frame,
  .review-header,
  .review-nav,
  .pm-header,
  .pm-nav-tabs,
  .pm-manage-bar,
  .pm-footer,
  .pm-reports-header,
  .pm-report-controls,
  .pm-doc-preview-toolbar,
  .pm-no-print,
  .pm-tooltip,
  .pm-toast,
  .sidebar,
  .top-bar,
  #app-header,
  #pm-print-frame,
  #pm-modal-backdrop:not(.pm-doc-preview-backdrop) {
    display: none !important;
  }

  .workspace-layout,
  .workspace-review-column,
  #review-panel-container,
  .process-mapping-container,
  #process-mapping-container,
  .pm-portal,
  #pm-portal-root,
  .pm-modal-backdrop,
  .pm-doc-preview-backdrop,
  #pm-modal-backdrop,
  .pm-doc-preview-container,
  .pm-doc-preview-viewport {
    display: block !important;
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
    float: none !important;
    border: none !important;
  }

  .pm-reports-container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .pm-report-document {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #pm-print-host,
  #pm-print-host #pm-printable-root,
  #pm-printable-root {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    overflow: visible !important;
    box-shadow: none !important;
    border: none !important;
  }

  #pm-print-host .pm-doc-sheet,
  #pm-printable-root .pm-doc-sheet {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 auto !important;
    padding: 15mm 12mm !important;
    width: 100% !important;
    max-width: 210mm !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
    page-break-after: always !important;
    break-after: page !important;
    background: #ffffff !important;
  }

  #pm-print-host .pm-doc-sheet:last-child,
  #pm-printable-root .pm-doc-sheet:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }
}


/* ============================================================
   Dashboard View — Container / Header / Stats Grid
   ============================================================ */

.pm-dashboard-container {
  padding: 32px 40px;
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.pm-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 16px;
}

.pm-dashboard-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px 0;
  letter-spacing: -0.02em;
}

.pm-dashboard-desc {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.pm-dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

/* Stat card color variants */
.pm-stat-card.pm-stat-primary {
  border-left: 4px solid #116834;
}

.pm-stat-card.pm-stat-modules {
  border-left: 4px solid #0d9488;
}

.pm-stat-card.pm-stat-features {
  border-left: 4px solid #6366f1;
}

.pm-stat-card.pm-stat-reqs {
  border-left: 4px solid #f59e0b;
}

/* ============================================================
   Status Badge (shared component)
   ============================================================ */

.pm-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.pm-status-badge.pm-status-confirmed {
  color: #116834;
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
}

.pm-status-badge.pm-status-review {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.pm-status-badge.pm-status-draft {
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

/* ============================================================
   Reference Chip Type Badges (Functional / Non-Functional)
   ============================================================ */

.pm-chip-type {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pm-chip-type.pm-chip-func {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.pm-chip-type.pm-chip-nonfunc {
  color: #7c3aed;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
}

@media (max-width: 1300px) {
  .pm-mod-title {
    font-size: 1.3rem;
  }
}

/* ============================================================
   Requirement Manager & Revision UI Styles (Scoped .pm-*)
   ============================================================ */

.pm-req-manager-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.pm-req-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  margin-bottom: 12px;
}

.pm-req-search-input {
  flex: 1 1 240px;
  min-width: 180px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #1e293b;
  outline: none;
  background: #ffffff;
  transition: border-color 0.12s ease;
}

.pm-req-search-input:focus {
  border-color: #116834;
  box-shadow: 0 0 0 2px rgba(17, 104, 52, 0.08);
}

.pm-req-filter-select {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #334155;
  background: #ffffff;
  outline: none;
  min-width: 120px;
}

.pm-req-filter-select:focus {
  border-color: #116834;
}

.pm-req-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
}

.pm-req-acc-preview {
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 3px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pm-req-feat-sub {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.25;
}

.pm-linked-node-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 1px 6px;
  border-radius: 3px;
  margin-top: 3px;
  width: fit-content;
}

.pm-linked-node-empty {
  font-size: 0.74rem;
  color: #94a3b8;
}

.pm-revision-sub {
  font-size: 0.68rem;
  color: #b45309;
  font-weight: 600;
  margin-top: 2px;
}

/* Detail Modal Styles */
.pm-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.pm-detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pm-detail-item.is-full {
  grid-column: span 2;
}

.pm-detail-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.pm-detail-value {
  font-size: 0.88rem;
  color: #1e293b;
  line-height: 1.45;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.pm-detail-value.is-accent {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
  font-weight: 500;
}

.pm-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.pm-timeline-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 0.82rem;
}

.pm-timeline-card.is-active {
  background: #f0fdf4;
  border-color: #86efac;
}

.pm-node-link-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  margin-top: 6px;
  font-size: 0.82rem;
}

/* ------------------------------------------------------------
   Revision & Review Workflow Styles (Phase 3)
   ------------------------------------------------------------ */
.pm-review-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f59e0b;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 5px;
  line-height: 1.2;
}

.pm-review-count-badge.is-zero {
  background: #94a3b8;
}

.pm-status-badge.pm-status-review {
  background: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

.pm-status-badge.pm-status-rejected {
  background: #fef2f2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
}

/* Diff Table & Compare Modal */
.pm-diff-summary-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 14px;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.pm-diff-table-wrap {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
}

.pm-diff-table {
  width: 100%;
  min-width: 600px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.81rem;
  box-sizing: border-box;
}

.pm-diff-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid #cbd5e1;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  box-sizing: border-box;
}

.pm-diff-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.pm-diff-table tbody tr:last-child td {
  border-bottom: none;
}

.pm-diff-row-modified {
  background: #fffdf5;
}

.pm-diff-row-added {
  background: #f0fdf4;
}

.pm-diff-row-archived {
  background: #fef2f2;
}

.pm-diff-field-name {
  font-weight: 600;
  color: #334155;
  font-size: 0.8rem;
}

.pm-diff-old-val {
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.45;
  word-break: break-word;
}

.pm-diff-old-val.is-deleted {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
  padding: 3px 6px;
  border-radius: 4px;
  text-decoration: line-through;
  display: block;
  word-break: break-word;
}

.pm-diff-new-val {
  color: #1e293b;
  font-size: 0.8rem;
  line-height: 1.45;
  word-break: break-word;
}

.pm-diff-new-val.is-changed {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: 600;
  display: block;
  word-break: break-word;
}

.pm-diff-status-cell {
  text-align: center;
  white-space: nowrap;
}

.pm-diff-status-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pm-diff-status-added {
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #86efac;
}

.pm-diff-status-modified {
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
}

.pm-diff-status-archived {
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.pm-diff-status-same {
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-weight: 500;
}

.pm-rev-timeline-track {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 20px;
  margin: 12px 0;
}

.pm-rev-timeline-track::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: 2px;
  background: #cbd5e1;
}

.pm-rev-timeline-step {
  position: relative;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.8rem;
}

.pm-rev-timeline-step::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  border: 2px solid #ffffff;
}

.pm-rev-timeline-step.is-confirmed::before {
  background: #16a34a;
}

.pm-rev-timeline-step.is-draft::before {
  background: #3b82f6;
}

.pm-rev-timeline-step.is-review::before {
  background: #f59e0b;
}

.pm-rev-timeline-step.is-rejected::before {
  background: #ef4444;
}

/* Action Menu Dropdown per Row (Revision & Review) */
.pm-action-menu-wrap {
  position: relative;
  display: inline-block;
}

.pm-action-trigger-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  width: 30px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  line-height: 1;
  transition: all 0.12s ease;
  padding: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.pm-action-trigger-btn:hover,
.pm-action-trigger-btn.is-active {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.pm-action-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 1000;
  min-width: 170px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  padding: 4px 0;
  text-align: left;
}

.pm-action-dropdown-menu.is-open {
  display: block;
}

.pm-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #1e293b;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
  transition: background 0.1s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.pm-dropdown-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.pm-dropdown-item.is-confirm {
  color: #15803d;
  font-weight: 600;
}

.pm-dropdown-item.is-confirm:hover {
  background: #f0fdf4;
  color: #166534;
}

.pm-dropdown-item.is-danger {
  color: #b91c1c;
}

.pm-dropdown-item.is-danger:hover {
  background: #fef2f2;
  color: #991b1b;
}

.pm-dropdown-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

/* ------------------------------------------------------------
   Phase 4B Trace Navigation & Link Badges
   ------------------------------------------------------------ */
.pm-node-link-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.8rem;
  line-height: 1.4;
  transition: all 0.15s ease;
}

.pm-node-link-card:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.pm-badge-rule-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pm-badge-rule-pill:hover {
  background: #fde68a;
  color: #78350f;
}

@keyframes pmPulseHighlight {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    outline: 2px solid #2563eb;
  }
  70% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    outline: 2px solid #2563eb;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    outline: none;
  }
}

.is-pulse-highlight {
  animation: pmPulseHighlight 1.5s ease-out infinite;
}

/* ------------------------------------------------------------
   Phase 4C Traceability Matrix (RTM) Styles
   ------------------------------------------------------------ */
.pm-rtm-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.pm-rtm-view-wrapper {
  background: transparent;
  padding: 0;
  border: none;
}

.pm-rtm-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.pm-rtm-toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.pm-rtm-title-area {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.pm-rtm-main-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.pm-rtm-metrics-summary {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}

.pm-rtm-filters-grid {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pm-rtm-search-box {
  flex: 1 1 240px;
  min-width: 200px;
  position: relative;
}

.pm-rtm-search-input {
  width: 100%;
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #1e293b;
  background: #ffffff;
  transition: all 0.15s ease;
}

.pm-rtm-search-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.pm-rtm-select {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #334155;
  background: #ffffff;
  cursor: pointer;
  max-width: 170px;
}

.pm-rtm-select:focus {
  outline: none;
  border-color: #2563eb;
}

.pm-rtm-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.pm-table-rtm {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.pm-table-rtm th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.pm-table-rtm td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #1e293b;
}

.pm-table-rtm tr:hover {
  background: #f8fafc;
}

/* Column Width Constraints */
.pm-col-rtm-id { width: 100px; min-width: 95px; }
.pm-col-rtm-title { min-width: 220px; }
.pm-col-rtm-role { width: 110px; min-width: 100px; }
.pm-col-rtm-mod { width: 120px; min-width: 110px; }
.pm-col-rtm-feat { width: 120px; min-width: 110px; }
.pm-col-rtm-fstatus { width: 85px; min-width: 80px; text-align: center; }
.pm-col-rtm-fnode { width: 125px; min-width: 115px; }
.pm-col-rtm-rule { width: 125px; min-width: 115px; }
.pm-col-rtm-status { width: 85px; min-width: 80px; text-align: center; }
.pm-col-rtm-class { width: 135px; min-width: 125px; text-align: center; }
.pm-col-rtm-action { width: 50px; min-width: 50px; text-align: center; position: relative; }

/* Badges & Text Styling */
.pm-badge-rtm {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pm-badge-rtm.pm-badge-covered {
  background: #e8f5e9;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.pm-badge-rtm.pm-badge-management {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.pm-badge-rtm.pm-badge-gap {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.pm-badge-node-jump {
  display: inline-flex;
  align-items: center;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  cursor: pointer;
  transition: all 0.15s ease;
  margin: 1px 2px 1px 0;
}

.pm-badge-node-jump:hover {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.pm-rtm-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

/* ------------------------------------------------------------
   Phase 4D Coverage Metrics & Gap Analysis Styles
   ------------------------------------------------------------ */
.pm-coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  width: 100%;
}

.pm-coverage-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.pm-coverage-card.is-primary {
  border-left: 4px solid #1e3a8a;
}

.pm-coverage-card.is-success {
  border-left: 4px solid #16a34a;
}

.pm-coverage-card.is-warning {
  border-left: 4px solid #d97706;
}

.pm-coverage-card.is-danger {
  border-left: 4px solid #dc2626;
}

.pm-coverage-card.is-info {
  border-left: 4px solid #0284c7;
}

.pm-cov-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.pm-cov-val-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.pm-cov-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}

.pm-cov-pct {
  font-size: 0.8rem;
  font-weight: 600;
  color: #166534;
}

.pm-cov-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* Module Gap Breakdown Grid */
.pm-module-gap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  width: 100%;
}

.pm-module-gap-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pm-module-gap-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.pm-module-gap-card.is-active {
  border-color: #2563eb;
  background: #eff6ff;
}

.pm-gap-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 6px;
}

.pm-gap-badge-count.has-gaps {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.pm-gap-badge-count.no-gaps {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* ============================================================
   Document Hub & Document Viewer Styles (Phase 5C)
   ============================================================ */

.pm-doc-hub-container {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.pm-doc-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #1b365d;
  border-radius: 4px;
  margin-bottom: 24px;
}

.pm-doc-hub-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1b365d;
  margin: 0 0 6px 0;
}

.pm-doc-hub-desc {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

.pm-doc-hub-header-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pm-doc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 20px;
}

.pm-doc-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pm-doc-card:hover {
  border-color: #1b365d;
  box-shadow: 0 4px 12px rgba(27, 54, 93, 0.08);
}

.pm-doc-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.pm-doc-card-code-badge {
  background: #1b365d;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.pm-doc-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px 0;
  line-height: 1.35;
}

.pm-doc-card-desc {
  font-size: 0.84rem;
  color: #475569;
  margin: 0 0 16px 0;
  line-height: 1.5;
  flex-grow: 1;
}

.pm-doc-card-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 0.8rem;
}

.pm-doc-card-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pm-doc-card-meta-full {
  grid-column: 1 / -1;
  border-top: 1px solid #e2e8f0;
  padding-top: 6px;
  margin-top: 4px;
}

.pm-doc-card-meta-label {
  color: #64748b;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pm-doc-card-meta-val {
  color: #1e293b;
  font-weight: 500;
}

.pm-doc-card-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: auto;
}

/* Document Viewer Modal Overlay */
.pm-doc-preview-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.pm-doc-preview-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #334155;
  overflow: hidden;
}

.pm-doc-preview-toolbar {
  height: 52px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
  z-index: 10;
}

.pm-doc-toolbar-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pm-doc-toolbar-code {
  background: #2563eb;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
}

.pm-doc-toolbar-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #f8fafc;
}

.pm-doc-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pm-doc-preview-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  padding: 32px 16px;
  display: flex;
  justify-content: center;
  background: #475569;
}

@media (max-width: 768px) {
  .pm-doc-card-grid {
    grid-template-columns: 1fr;
  }
  .pm-doc-toolbar-title {
    display: none;
  }
}

/* ============================================================
   Phase 4E & 4F — Process Mapping Traceability, Health, & RTM Extensions
   Fully Scoped under .pm-portal / .pm-*
   ============================================================ */

/* ------------------------------------------------------------
   1. Traceability Health Strip & Badges
   ------------------------------------------------------------ */
.pm-trace-health-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pm-trace-health-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.pm-trace-health-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pm-trace-health-pass,
.pm-trace-health-badge.is-pass {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.pm-trace-health-check,
.pm-trace-health-badge.is-check {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.pm-trace-health-warn,
.pm-trace-health-badge.is-warn {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* ------------------------------------------------------------
   2. Manage Mode Action Buttons (High Contrast & States)
   ------------------------------------------------------------ */
#pm-btn-finalize-traceability,
.pm-btn-finalize-traceability {
  background: #16a34a !important;
  border-color: #15803d !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  transition: all 0.15s ease;
}

#pm-btn-finalize-traceability:hover:not(:disabled),
.pm-btn-finalize-traceability:hover:not(:disabled) {
  background: #15803d !important;
  border-color: #166534 !important;
  box-shadow: 0 2px 4px rgba(22, 163, 74, 0.25);
}

#pm-btn-apply-true-gaps,
.pm-btn-apply-true-gaps {
  font-weight: 600;
  transition: all 0.15s ease;
}

#pm-gap-apply-plan {
  background: #16a34a !important;
  border-color: #15803d !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  transition: all 0.15s ease;
}

#pm-gap-apply-plan:hover:not(:disabled) {
  background: #15803d !important;
  border-color: #166534 !important;
  box-shadow: 0 2px 4px rgba(22, 163, 74, 0.25);
}

/* ------------------------------------------------------------
   3. RTM Row, Empty Cells, and Drilldown Badges
   ------------------------------------------------------------ */
.pm-rtm-row {
  transition: background-color 0.15s ease;
}

.pm-rtm-row:hover {
  background-color: #f8fafc;
}

.pm-rtm-empty-cell {
  color: #94a3b8;
  font-style: italic;
  font-size: 0.78rem;
}

.pm-rtm-drilldown-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #334155;
  cursor: pointer;
  transition: all 0.12s ease;
}

.pm-rtm-drilldown-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

.pm-rtm-jump-req-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

/* ------------------------------------------------------------
   4. Status, Role & Related Badges
   ------------------------------------------------------------ */
.pm-badge-role {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.pm-badge-related {
  display: inline-flex;
  align-items: center;
  background: #f8fafc;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.pm-status-badge.pm-status-archived {
  color: #94a3b8;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.pm-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pm-tag.pm-tag-covered {
  background: #e8f5e9;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.pm-tag.pm-tag-gap {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.pm-feature-label {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}

.pm-mod-text {
  font-size: 0.78rem;
  color: #334155;
  font-weight: 600;
}

/* ------------------------------------------------------------
   5. Linked Reqs, Edge Cards & Connections Layout
   ------------------------------------------------------------ */
.pm-linked-req-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.12s ease;
}

.pm-linked-req-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pm-edge-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pm-connections-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.pm-connections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.pm-detail-action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  margin-top: 16px;
}

.pm-detail-body {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pm-detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
}

.pm-canvas-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.pm-canvas-pan-wrap {
  width: 100%;
  height: 100%;
  overflow: auto;
  cursor: grab;
}

.pm-canvas-pan-wrap:active {
  cursor: grabbing;
}

.pm-section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.pm-section-card-titles {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pm-section-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pm-section-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #116834;
  color: #ffffff;
  border-radius: 11px;
  font-size: 0.72rem;
  font-weight: 700;
}

.pm-select-wrapper {
  position: relative;
  display: inline-block;
}

.pm-doc-card-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.pm-doc-hub-header-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ------------------------------------------------------------
   6. Navigation Pulse & Interactive Highlights
   ------------------------------------------------------------ */
@keyframes pmPulseHighlight {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    outline: 2px solid #2563eb;
  }
  70% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    outline: 2px solid #2563eb;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    outline: none;
  }
}

.is-pulse-highlight {
  animation: pmPulseHighlight 1.5s ease-out infinite !important;
}

.is-target-highlight {
  background-color: #fef9c3 !important;
  transition: background-color 0.5s ease;
}

.is-search-match {
  outline: 2px solid #3b82f6 !important;
  outline-offset: 2px;
}

.is-selected {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25) !important;
}

/* ------------------------------------------------------------
   7. Responsive Adaptations (Desktop, Tablet, Mobile)
   ------------------------------------------------------------ */
@media (max-width: 1024px) {
  .pm-coverage-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
  .pm-rtm-toolbar-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .pm-rtm-filters-grid {
    width: 100%;
  }
  .pm-rtm-search-box {
    width: 100%;
    flex: 1 1 100%;
  }
}

@media (max-width: 768px) {
  .pm-coverage-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .pm-cov-value {
    font-size: 1.15rem;
  }
  .pm-trace-health-strip {
    flex-direction: column;
    align-items: flex-start;
  }
  .pm-module-gap-grid {
    grid-template-columns: 1fr;
  }
  .pm-table-rtm th,
  .pm-table-rtm td {
    padding: 6px 8px;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .pm-coverage-grid {
    grid-template-columns: 1fr;
  }
}
