/* =====================================================================
   LPPM ISTN — Dashboard, Charts, Wizard & Domain Widgets
   ===================================================================== */

/* ------------------------------------------------------------- KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: var(--sp-4);
}

.kpi {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 15px 13px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  min-width: 0;
  transition: box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.kpi:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.kpi::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--kpi-accent, var(--royal-600));
}

.kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.kpi-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.35;
}

.kpi-ico {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--kpi-soft, var(--royal-50));
  color: var(--kpi-accent, var(--royal-600));
}

.kpi-ico svg {
  width: 16px;
  height: 16px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--navy-900);
  line-height: 1.15;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.kpi-value .unit {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 700;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
}

.kpi-delta.is-up { color: var(--success); background: var(--success-bg); }
.kpi-delta.is-down { color: var(--danger); background: var(--danger-bg); }
.kpi-delta.is-flat { color: var(--muted); background: var(--surface-3); }

.kpi-spark {
  margin-top: 8px;
  height: 30px;
}

.kpi.is-gold { --kpi-accent: var(--gold-600); --kpi-soft: var(--gold-100); }
.kpi.is-green { --kpi-accent: var(--success); --kpi-soft: var(--success-bg); }
.kpi.is-orange { --kpi-accent: var(--warning); --kpi-soft: var(--warning-bg); }
.kpi.is-red { --kpi-accent: var(--danger); --kpi-soft: var(--danger-bg); }
.kpi.is-navy { --kpi-accent: var(--navy-700); --kpi-soft: var(--royal-50); }

/* Compact KPI variant */
.kpi.is-compact .kpi-value {
  font-size: 21px;
  margin-top: 4px;
}

.kpi.is-compact {
  padding: 12px 13px;
}

/* -------------------------------------------------------------- Chart box */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px 8px;
  flex-wrap: wrap;
}

.chart-head h3 {
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--navy-900);
  margin: 0;
}

.chart-head .c-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.chart-head .c-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-body {
  padding: 4px 12px 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.chart-body.is-flush {
  padding: 0;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 2px 16px 12px;
  font-size: 11px;
  color: var(--muted);
}

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

.chart-legend .sw {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: var(--muted);
  font-size: var(--fs-sm);
  text-align: center;
  padding: 20px;
}

/* SVG chart text defaults */
.chart-svg text {
  font-family: var(--font-sans);
  fill: var(--muted);
}

.chart-svg .axis-line {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-svg .grid-line {
  stroke: #eef2f7;
  stroke-width: 1;
}

.chart-svg .axis-label {
  font-size: 9.5px;
  fill: var(--muted);
}

.chart-svg .value-label {
  font-size: 9.5px;
  fill: var(--text-soft);
  font-weight: 700;
}

.chart-svg .bar {
  transition: opacity var(--t-fast);
}

.chart-svg .bar:hover {
  opacity: 0.82;
}

.chart-svg .chart-hit {
  fill: transparent;
  cursor: pointer;
}

/* ---------------------------------------------------------------- Heatmap */
.heatmap {
  display: grid;
  gap: 3px;
  font-size: 10.5px;
  min-width: 520px;
}

.heatmap-row {
  display: grid;
  gap: 3px;
  align-items: center;
}

.heatmap-row .hm-label {
  color: var(--text-soft);
  font-weight: 600;
  padding-right: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.heatmap-row .hm-head {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.04em;
}

.hm-cell {
  height: 26px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--navy-950);
  background: var(--surface-3);
  border: 1px solid rgba(15, 32, 55, 0.04);
  cursor: default;
  transition: transform var(--t-fast);
}

.hm-cell:hover {
  transform: scale(1.06);
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.hm-scale {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 10px;
}

.hm-scale .grad {
  width: 110px;
  height: 9px;
  border-radius: 5px;
  background: linear-gradient(90deg, #eef2f7, #bfd3f2, #4f86d8, #12325a);
  border: 1px solid var(--border);
}

/* --------------------------------------------------------------- Progress */
.progress {
  height: 7px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  min-width: 60px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--royal-600), var(--royal-500));
  border-radius: 999px;
  transition: width var(--t-slow) var(--ease);
}

.progress-bar.is-gold { background: linear-gradient(90deg, var(--gold-600), var(--gold-300)); }
.progress-bar.is-green { background: linear-gradient(90deg, #0f6b4c, #34b483); }
.progress-bar.is-orange { background: linear-gradient(90deg, #9a5408, #e5a04a); }
.progress-bar.is-red { background: linear-gradient(90deg, #92201a, #dc6a62); }

.progress.is-lg { height: 10px; }
.progress.is-sm { height: 5px; }

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-row .pr-label {
  flex: 0 1 auto;
  min-width: 84px;
  font-size: 11.5px;
  color: var(--text-soft);
  font-weight: 600;
}

.progress-row .progress {
  flex: 1 1 auto;
  min-width: 0;
}

.progress-row .pr-val {
  flex: 0 0 auto;
  min-width: 44px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.progress-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

/* ------------------------------------------------------------- Metric list */
.metric-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #eef2f7;
  font-size: var(--fs-sm);
}

.metric-item:last-child {
  border-bottom: 0;
}

.metric-item .mi-label {
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.metric-item .mi-val {
  font-weight: 800;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.metric-item .mi-sub {
  font-size: 10.5px;
  color: var(--muted);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 7px;
  background: var(--muted-2);
}

.dot-gold { background: var(--gold-500); }
.dot-navy { background: var(--navy-700); }
.dot-royal { background: var(--royal-600); }
.dot-green { background: var(--success); }
.dot-orange { background: var(--warning); }
.dot-red { background: var(--danger); }

/* --------------------------------------------------------------- Wizard */
.wizard {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: start;
}

.wizard-steps {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  box-shadow: var(--shadow-xs);
}

.wizard-step {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

.wizard-step:hover {
  background: var(--surface-3);
}

.wizard-step .ws-num {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--muted);
}

.wizard-step .ws-txt {
  min-width: 0;
  padding-top: 2px;
}

.wizard-step.is-active {
  background: var(--royal-50);
  color: var(--royal-700);
  font-weight: 700;
}

.wizard-step.is-active .ws-num {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: #ffffff;
}

.wizard-step.is-done .ws-num {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.wizard-step.is-done {
  color: var(--text-soft);
}

.wizard-main {
  min-width: 0;
}

.wizard-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.wizard-panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.wizard-panel-head .w-title {
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--navy-900);
}

.wizard-panel-head .w-sub {
  font-size: 11.5px;
  color: var(--muted);
}

.wizard-panel-body {
  padding: 18px;
}

.wizard-panel-foot {
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.wizard-progress {
  margin-top: 10px;
}

.wizard-progress .wp-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

/* Dynamic rows */
.dyn-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dyn-row {
  display: grid;
  gap: 8px;
  align-items: end;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.dyn-row.is-team {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) 120px 84px 32px;
}

.dyn-row.is-budget {
  grid-template-columns: minmax(0, 1.1fr) 92px 118px 118px 32px;
}

.dyn-row .field label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dyn-row .field .input,
.dyn-row .field .select {
  min-height: 30px;
  font-size: var(--fs-sm);
}

.dyn-remove {
  width: 30px;
  height: 30px;
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius-xs);
  display: grid;
  place-items: center;
  margin-bottom: 1px;
}

.dyn-remove:hover {
  background: #f9d9d6;
}

.dyn-remove svg {
  width: 13px;
  height: 13px;
}

.budget-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--navy-900);
  color: #ffffff;
  margin-top: 12px;
  flex-wrap: wrap;
}

.budget-total .bt-label {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
  font-weight: 700;
}

.budget-total .bt-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.budget-total .bt-meta {
  font-size: 11px;
  color: var(--on-dark-soft);
}

/* Upload simulation */
.upload-box {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  background: var(--surface-2);
  color: var(--muted);
  font-size: var(--fs-sm);
}

.upload-box .u-ico {
  width: 38px;
  height: 38px;
  margin: 0 auto 8px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--royal-50);
  color: var(--royal-600);
  border: 1px solid var(--info-border);
}

.upload-box .u-ico svg {
  width: 18px;
  height: 18px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 11.5px;
}

.file-item .fi-ico {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 9px;
  font-weight: 800;
}

.file-item .fi-ico.is-img { background: var(--success-bg); color: var(--success); }
.file-item .fi-ico.is-doc { background: var(--info-bg); color: var(--info); }

.file-item .fi-main {
  flex: 1 1 auto;
  min-width: 0;
}

.file-item .fi-name {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item .fi-meta {
  font-size: 10px;
  color: var(--muted);
}

/* --------------------------------------------------------------- Preview */
.preview-doc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 30px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-soft);
  box-shadow: var(--shadow-xs);
}

.preview-doc .pd-head {
  border-bottom: 2px solid var(--navy-900);
  padding-bottom: 10px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.preview-doc .pd-org {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.preview-doc .pd-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.3;
  margin-top: 2px;
}

.preview-doc h4 {
  font-size: 12.5px;
  margin: 14px 0 4px;
  color: var(--navy-900);
}

.preview-doc .pd-kv {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 3px 12px;
  font-size: 12px;
}

.preview-doc .pd-kv dt {
  color: var(--muted);
}

.preview-doc .pd-kv dd {
  margin: 0;
  color: var(--text);
}

/* --------------------------------------------------------- Person / cards */
.person-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  transition: box-shadow var(--t-fast), transform var(--t-fast), border-color var(--t-fast);
}

.person-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.person-card .pc-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.person-card .pc-main {
  min-width: 0;
  flex: 1 1 auto;
}

.person-card .pc-name {
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.25;
}

.person-card .pc-role {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.person-card .pc-meta {
  font-size: 10.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.person-card .pc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  border-top: 1px solid #eef2f7;
  padding-top: 8px;
  margin-top: 2px;
}

.person-card .pc-stat {
  text-align: center;
}

.person-card .pc-stat .v {
  font-size: 13px;
  font-weight: 800;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
}

.person-card .pc-stat .l {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.person-card .pc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.person-card .pc-tags .tag {
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.person-card .pc-foot {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

/* Module / roadmap cards */
.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
  box-shadow: var(--shadow-xs);
  min-width: 0;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.module-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.module-card .mc-ico {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--royal-50);
  color: var(--royal-600);
  border: 1px solid var(--info-border);
}

.module-card .mc-ico svg {
  width: 18px;
  height: 18px;
}

.module-card .mc-ico.is-gold {
  background: var(--gold-100);
  color: var(--gold-700);
  border-color: #f0dfa4;
}

.module-card .mc-ico.is-green {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}

.module-card .mc-body {
  min-width: 0;
  flex: 1 1 auto;
}

.module-card .mc-title {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.3;
}

.module-card .mc-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 2px;
}

.module-card .mc-list {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.module-card .mc-list .tag {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* Detail header */
.detail-head {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  margin-bottom: var(--sp-4);
}

.detail-head .dh-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.detail-head .dh-code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.detail-head .dh-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.3;
  margin-top: 4px;
  letter-spacing: -0.015em;
  max-width: 96ch;
}

.detail-head .dh-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.detail-head .dh-meta .dm-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.detail-head .dh-meta svg {
  width: 13px;
  height: 13px;
  color: var(--muted-2);
}

.detail-head .dh-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.detail-head .dh-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.detail-head .dh-stat .ds-l {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 700;
}

.detail-head .dh-stat .ds-v {
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
}

/* Workflow rail */
.flow-rail {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 12px 4px 6px;
}

.flow-node {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.flow-node .fn-dot {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  font-size: 9px;
  font-weight: 800;
  color: var(--muted);
}

.flow-node.is-done {
  color: var(--text-soft);
}

.flow-node.is-done .fn-dot {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.flow-node.is-current {
  color: var(--navy-900);
  font-weight: 800;
}

.flow-node.is-current .fn-dot {
  background: var(--gold-500);
  border-color: var(--gold-600);
  color: var(--navy-950);
  box-shadow: 0 0 0 3px var(--gold-100);
}

.flow-node.is-rejected .fn-dot {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

.flow-line {
  flex: 1 1 16px;
  min-width: 14px;
  height: 2px;
  background: var(--border);
  margin: 0 6px;
}

.flow-line.is-done {
  background: #b7e3d3;
}

/* Schematic map */
.map-box {
  background: linear-gradient(180deg, #f7fafd, #eef4fb);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  position: relative;
  overflow: hidden;
}

.map-box svg {
  width: 100%;
  height: auto;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 8px;
}

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

.map-legend .sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* Gantt */
.gantt {
  min-width: 640px;
  font-size: 11px;
}

.gantt-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 4px 0;
}

.gantt-row .g-label {
  color: var(--text-soft);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-track {
  position: relative;
  height: 18px;
  background: var(--surface-3);
  border-radius: 4px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.gantt-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--royal-600), var(--royal-500));
}

.gantt-bar.is-gold { background: linear-gradient(90deg, var(--gold-600), var(--gold-300)); }
.gantt-bar.is-green { background: linear-gradient(90deg, #0f6b4c, #34b483); }
.gantt-bar.is-orange { background: linear-gradient(90deg, #9a5408, #e5a04a); }

.gantt-head {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}

.gantt-months {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

/* Reviewer comparison */
.compare-grid {
  display: grid;
  grid-template-columns: 190px repeat(auto-fit, minmax(120px, 1fr));
  font-size: 11.5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.compare-grid > div {
  padding: 7px 10px;
  border-bottom: 1px solid #eef2f7;
  border-right: 1px solid #eef2f7;
}

.compare-grid > div:nth-child(n) {
  background: var(--surface);
}

.compare-grid .cg-head {
  background: var(--surface-2);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.compare-grid .cg-label {
  color: var(--muted);
  font-weight: 600;
}

.compare-grid .cg-total {
  background: var(--surface-2);
  font-weight: 800;
  color: var(--navy-900);
}

/* Scoring inputs */
.score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 62px 84px;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #eef2f7;
}

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

.score-row .sr-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

.score-row .sr-hint {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}

.score-row .sr-weight {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 0;
}

.score-row .sr-calc {
  text-align: right;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
}

.score-input {
  width: 74px;
  text-align: center;
  min-height: 32px;
  font-weight: 700;
}

.score-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(120deg, var(--navy-900), var(--navy-700));
  color: #ffffff;
  margin-top: 14px;
  flex-wrap: wrap;
}

.score-total .st-label {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
  font-weight: 700;
}

.score-total .st-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.score-total .st-meta {
  font-size: 11px;
  color: var(--on-dark-soft);
}

.score-total .st-rec {
  padding: 3px 9px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 11px;
  font-weight: 700;
}

/* Role cards (settings) */
.role-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: var(--shadow-xs);
  min-width: 0;
}

.role-card.is-active {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 2px var(--gold-100);
}

.role-card .rc-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-card .rc-name {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--navy-900);
}

.role-card .rc-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.role-card .rc-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.role-card .rc-perms .tag {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* Scenario steps */
.scenario {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.scenario-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.scenario-head .sc-num {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--navy-900);
  color: #ffffff;
  font-weight: 800;
  font-size: 11px;
}

.scenario-head .sc-title {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--navy-900);
}

.scenario-head .sc-sub {
  font-size: 10.5px;
  color: var(--muted);
}

.scenario-steps {
  padding: 10px 15px 14px;
}

.sc-step {
  display: flex;
  gap: 9px;
  padding: 7px 0;
  border-bottom: 1px dashed #eef2f7;
  font-size: 11.5px;
}

.sc-step:last-child {
  border-bottom: 0;
}

.sc-step .ss-n {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 50%;
  background: var(--royal-50);
  border: 1px solid var(--info-border);
  color: var(--royal-700);
  display: grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 800;
}

.sc-step .ss-body {
  min-width: 0;
  flex: 1 1 auto;
}

.sc-step .ss-role {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-700);
}

.sc-step .ss-text {
  color: var(--text-soft);
  line-height: 1.45;
}

/* Data tables in cards */
.mini-table {
  width: 100%;
  font-size: 11.5px;
}

.mini-table td {
  padding: 6px 0;
  border-bottom: 1px solid #f1f4f8;
  color: var(--text-soft);
}

.mini-table tr:last-child td {
  border-bottom: 0;
}

.mini-table td:last-child {
  text-align: right;
  font-weight: 700;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
}

/* Activity feed */
.activity-item {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #eef2f7;
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-item .a-ico {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--muted);
}

.activity-item .a-ico svg {
  width: 13px;
  height: 13px;
}

.activity-item .a-body {
  min-width: 0;
  flex: 1 1 auto;
}

.activity-item .a-text {
  font-size: 11.5px;
  color: var(--text-soft);
  line-height: 1.45;
}

.activity-item .a-text strong {
  color: var(--text);
}

.activity-item .a-time {
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}

/* Print-friendly header (screen-hidden) */
.print-only {
  display: none;
}
