:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --border: #d8e0e6;
  --teal: #0f766e;
  --teal-dark: #0d5f59;
  --teal-soft: #e6f4f2;
  --slate: #334155;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --ok: #15803d;
  --ok-soft: #ecfdf5;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  --radius: 10px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #d9efe9 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #e8eef3 0%, transparent 50%),
    var(--bg);
}

a {
  color: var(--teal);
}

button,
input,
select,
textarea {
  font: inherit;
}

.page {
  min-height: 100vh;
}

.page-center {
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
}

.brand {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: 0.02em;
  margin: 0 0 0.35rem;
}

.subtitle {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

label {
  display: block;
  font-size: 0.875rem;
  color: var(--slate);
  margin-bottom: 0.35rem;
}

.field {
  margin-bottom: 1rem;
}

.field input,
.field select,
.field textarea,
.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  background: #fff;
  color: var(--ink);
}

.field textarea,
.textarea {
  min-height: 180px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  background: var(--teal);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}

.btn:hover {
  background: var(--teal-dark);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  color: var(--slate);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: #f8fafc;
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #991b1b;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.msg {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.msg-error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}

.msg-ok {
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}

.msg-warn {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-weight: 700;
  color: var(--teal);
}

.layout {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 1.25rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.tab-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--slate);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--teal-soft);
  border-color: #99d5cd;
  color: var(--teal-dark);
  font-weight: 600;
}

.panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.panel.active {
  display: block;
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.split {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.list {
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 480px;
  overflow: auto;
  background: #fafcfc;
}

.list-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  color: inherit;
}

.list-item:last-child {
  border-bottom: 0;
}

.list-item:hover,
.list-item.active {
  background: var(--teal-soft);
}

.list-item .meta {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.tpl-q-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.tpl-q-tab {
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0.5rem 0.85rem;
  margin-bottom: -1px;
  cursor: pointer;
  font-size: 0.95rem;
}

.tpl-q-tab:hover {
  color: var(--ink);
}

.tpl-q-tab.active {
  color: var(--teal-dark);
  border-bottom-color: var(--teal);
  font-weight: 600;
}

.tpl-q-panel.hidden {
  display: none !important;
}

.tpl-q-toolbar {
  margin-bottom: 0.75rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 700px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f1f5f7;
  color: var(--slate);
  font-weight: 600;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.kpi {
  background: var(--teal-soft);
  border: 1px solid #b7ddd7;
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.kpi .label {
  color: var(--muted);
  font-size: 0.8rem;
}

.kpi .value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-top: 0.2rem;
}

.kpi .hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}

.kpi .hint.warn {
  color: var(--danger);
  font-weight: 600;
}

.kpi.kpi-warn {
  background: #fff7ed;
  border-color: #fdba74;
}

.kpi.kpi-warn .value {
  color: #c2410c;
}

.kpi.kpi-ok {
  background: var(--ok-soft);
  border-color: #86efac;
}

.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 860px) {
  .charts {
    grid-template-columns: 1fr;
  }
}

.chart-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  background: #fff;
  min-height: 280px;
}

.token-box {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  margin-top: 0.5rem;
}

.token-box code {
  flex: 1;
  word-break: break-all;
  font-size: 0.85rem;
}

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #e2e8f0;
  color: var(--slate);
}

.status-pill.collecting {
  background: var(--ok-soft);
  color: var(--ok);
}

.status-pill.archived {
  background: #f1f5f9;
  color: var(--muted);
}

.hint {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--teal-soft, #e6f4f1);
  border-radius: 8px;
  color: var(--slate, #334155);
  font-size: 0.9rem;
  line-height: 1.5;
}

.duty-box {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.duty-box-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.duty-box .textarea {
  min-height: 7.5rem;
  font-size: 0.9rem;
}

.duty-actions {
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.duty-hint {
  margin: 0;
  line-height: 1.45;
}

.tpl-preview {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.tpl-preview-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.tpl-preview-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.tpl-preview-dims {
  font-size: 0.85rem;
  line-height: 1.45;
}

.muted {
  color: var(--muted, #64748b);
  font-size: 12px;
}

.advanced-json {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.advanced-json summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
}

.tpl-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 62vh;
  overflow: auto;
  padding-right: 0.25rem;
}

.tpl-form.empty {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
}

.dim-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 0.35rem 0.75rem 0.75rem;
}

.dim-card > summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0.15rem;
  list-style: none;
}

.dim-card > summary::-webkit-details-marker {
  display: none;
}

.dim-summary-title {
  font-weight: 700;
}

.dim-summary-meta {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.dim-body {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.q-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.q-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
  background: #fafcfc;
}

.q-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.textarea-sm {
  min-height: 64px;
  font-family: inherit;
  font-size: 0.9rem;
}

.opt-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.opt-row {
  display: grid;
  grid-template-columns: 28px 1fr 72px;
  gap: 0.4rem;
  align-items: center;
}

.opt-row .opt-code {
  font-weight: 700;
  text-align: center;
}

.opt-score {
  text-align: center;
}

.survey-wrap {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 1.25rem;
}

.survey-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1rem;
}

.dimension {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}

.dimension h3 {
  margin: 0 0 0.85rem;
  color: var(--teal-dark);
  font-size: 1.05rem;
}

.question {
  border-top: 1px solid var(--border);
  padding: 0.9rem 0;
}

.question:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.question .topic {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.question .text {
  color: var(--slate);
  margin-bottom: 0.65rem;
}

.option {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
}

.option:hover {
  background: var(--teal-soft);
}

.option input {
  margin-top: 0.25rem;
}

.option .opt-code {
  font-weight: 700;
  color: var(--teal);
  min-width: 1.2rem;
}

.option .opt-score {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.personal-result {
  text-align: left;
}

.personal-total {
  background: #f1f5f7;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  text-align: center;
}

.personal-total-score {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.personal-total-score span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
}

.personal-total-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.personal-dim-table {
  width: 100%;
}

.score-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  min-width: 72px;
}

.score-bar span {
  display: block;
  height: 100%;
  background: #0f6e56;
  border-radius: 99px;
}

.hidden {
  display: none !important;
}

.empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.75rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.perspective-field { margin-top: 0.75rem; }
.perspective-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 0.35rem;
}
@media (max-width: 640px) {
  .perspective-cards { grid-template-columns: 1fr; }
}
.perspective-card {
  display: block;
  margin: 0;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color 0.15s, background 0.15s;
}
.perspective-card:has(input:checked) {
  border-color: var(--accent, #0f766e);
  background: #f0fdfa;
  box-shadow: inset 0 0 0 1px var(--accent, #0f766e);
}
.perspective-card input { position: absolute; opacity: 0; pointer-events: none; }
.perspective-card .pc-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink, #1e293b);
}
.perspective-card:has(input:checked) .pc-title { color: var(--accent, #0f766e); }
.perspective-card .pc-desc {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
}

/* ---------- Report workbench ---------- */
.report-workbench {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.report-block {
  margin-bottom: 0;
}

.report-subhead {
  margin: 0.85rem 0 0.45rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--slate, #334155);
}

.interview-source-list .list-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  text-align: left;
  width: 100%;
  cursor: default;
}

.interview-source-list .list-item .meta {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.interview-draft-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.draft-point {
  display: grid;
  grid-template-columns: auto 120px 1fr;
  gap: 0.5rem;
  align-items: start;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.draft-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  white-space: nowrap;
  padding-top: 0.35rem;
}

.draft-box {
  min-width: 0;
}

@media (max-width: 720px) {
  .draft-point {
    grid-template-columns: 1fr;
  }
}

#actionsTableBody .input,
#actionsTableBody .textarea,
#actionsTableBody .select {
  width: 100%;
  min-width: 0;
}

#actionsTableBody td {
  vertical-align: top;
}

#actionsTableBody tr.action-overdue {
  background: #fff7ed;
}

.badge-overdue {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: #fed7aa;
  color: #9a3412;
  font-size: 0.72rem;
  font-weight: 600;
}

.actions-summary {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}

.add-tracking-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: center;
}

.rejected-actions {
  margin-top: 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.rejected-actions summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.inline-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.select-sm {
  min-width: 7.5rem;
  padding: 0.25rem 0.45rem;
  font-size: 0.85rem;
}

.overdue-strip {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid #fdba74;
  border-radius: 8px;
  background: #fff7ed;
}

.overdue-strip.hidden {
  display: none;
}

.overdue-strip-title {
  font-weight: 700;
  color: #9a3412;
  margin-bottom: 0.35rem;
}

.overdue-strip ul {
  margin: 0;
  padding-left: 1.1rem;
}

.overdue-strip li {
  margin: 0.2rem 0;
  font-size: 0.9rem;
}

tr.gap-hot td:last-child,
.report-table tr.gap-hot td:nth-child(5) {
  font-weight: 700;
  color: #c2410c;
}

a.btn[aria-disabled='true'] {
  opacity: 0.55;
  pointer-events: none;
}

/* ---------- Printable report page ---------- */
.report-page {
  background: #eef2f6;
  min-height: 100vh;
}

.report-chrome {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.report-chrome-inner {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.report-doc {
  width: min(920px, 100%);
  margin: 1.25rem auto 2.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 2rem 2.25rem 2.5rem;
}

.report-cover h1 {
  margin: 0.35rem 0 1rem;
  font-size: 1.75rem;
  color: var(--teal-dark, #0f766e);
  line-height: 1.3;
}

.report-hero {
  background: linear-gradient(145deg, #123047 0%, #1a4a5c 100%);
  color: #fff;
  border-radius: 12px;
  padding: 1.5rem 1.6rem 1.25rem;
  margin: -0.25rem -0.25rem 0;
}

.report-hero h1 {
  color: #fff;
}

.report-hero .muted {
  color: #b7c7d6;
}

.report-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.85rem 0 1rem;
}

.report-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.report-kpis {
  margin: 0;
}

.report-hero .kpi {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.report-hero .kpi .label {
  color: #9fb3c8;
}

.report-hero .kpi .value {
  color: #fff;
}

.report-kpi-sm {
  font-size: 1rem !important;
}

.report-callout {
  background: #eef6ff;
  border-left: 4px solid #1d4f91;
  padding: 0.85rem 1rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
}

.report-tri-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.report-tri-list li {
  margin: 0.35rem 0;
}

.report-eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.report-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem 1rem;
  margin: 0;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.report-meta div {
  margin: 0;
}

.report-meta dt {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.report-meta dd {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.report-section {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.report-section h2 {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  color: var(--teal-dark, #0f766e);
}

.report-section h3 {
  margin: 0.85rem 0 0.4rem;
  font-size: 1rem;
}

.report-lead {
  margin: 0 0 0.75rem;
}

.report-gap {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  background: #f0fdfa;
  border-radius: 8px;
  font-size: 0.92rem;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.report-table th,
.report-table td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.report-table th {
  background: #f8fafc;
  font-weight: 700;
}

.report-narrative p,
.report-conclusion {
  margin: 0;
  line-height: 1.7;
  color: var(--slate, #334155);
  white-space: pre-wrap;
}

.people-brief-analysis {
  margin-top: 12px;
  padding: 12px 14px;
  background: #eef6ff;
  border-left: 4px solid #1d4f91;
  border-radius: 0 8px 8px 0;
}
.people-brief-analysis ul.compact {
  margin: 8px 0 0;
  padding-left: 18px;
}
.report-roster-edu-age {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}
@media (max-width: 800px) {
  .report-roster-edu-age {
    grid-template-columns: 1fr;
  }
}

.report-roster-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.25rem;
}

.report-roster-charts .chart-box {
  min-height: 220px;
  padding: 0.75rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: #fff;
}

.report-roster-narratives {
  margin: 0.5rem 0 1.25rem;
}

.report-narrative-block {
  margin-bottom: 0.85rem;
}

.report-narrative-block h3 {
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
}

.report-narrative-block p {
  margin: 0;
  color: var(--text-muted, #4b5563);
}

@media (max-width: 720px) {
  .report-roster-charts {
    grid-template-columns: 1fr;
  }
}

.report-finding-group ul {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
  line-height: 1.6;
}

#reportPageMsg {
  width: min(920px, 100%);
  margin: 0 auto 1.5rem;
}

.roster-mapping {
  margin: 0.75rem 0;
  padding: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fff;
}

.roster-mapping-title {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.roster-mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem 0.75rem;
}

.roster-mapping-grid .field {
  margin: 0;
}

.roster-mapping-grid label {
  font-size: 0.8rem;
}

.roster-summary {
  margin-top: 0.5rem;
  line-height: 1.5;
}

.roster-warnings {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  color: #b45309;
}

.roster-panels {
  margin: 0.75rem 0;
  align-items: start;
}

.org-tree {
  margin: 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  max-height: 320px;
  overflow: auto;
  font-size: 0.88rem;
  line-height: 1.45;
}

.org-tree ul {
  margin: 0.2rem 0 0.2rem 1.1rem;
  padding: 0;
  list-style: disc;
}

.org-tree li {
  margin: 0.15rem 0;
}

.org-tree .org-node-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.roster-coverage-kpi {
  margin: 0.35rem 0 0.5rem;
}

.roster-unmatched {
  line-height: 1.5;
}

.roster-findings {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.4rem 0 0.6rem;
}

.roster-finding {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.5rem;
  align-items: start;
}

.roster-finding textarea {
  width: 100%;
  min-height: 3.2rem;
  resize: vertical;
}

.roster-finding-level {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-align: center;
}

.roster-finding-level.risk {
  background: #fee2e2;
  color: #b91c1c;
}

.roster-finding-level.warn {
  background: #fef3c7;
  color: #b45309;
}

.roster-finding-level.info {
  background: #e5e7eb;
  color: #374151;
}

.roster-findings-stale {
  color: #b45309;
  margin: 0.25rem 0 0.5rem;
}

.roster-solutions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.roster-solution {
  padding: 0.65rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
}

.roster-solution p {
  margin: 0.35rem 0 0;
  line-height: 1.5;
}

.roster-solution-priority {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: #e0e7ff;
  color: #3730a3;
  margin-right: 0.35rem;
}

.roster-ai-summary {
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: #f0f9ff;
  border-radius: 6px;
  line-height: 1.55;
}

.roster-missing {
  margin: 0.5rem 0;
  line-height: 1.5;
}

.roster-missing p {
  margin: 0 0 0.5rem;
}

.roster-division-box {
  margin: 0.75rem 0 1rem;
}

.division-change-panel {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fafafa;
}

.division-change-list {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.25rem;
}

.org-chart-editor-host {
  margin: 0.5rem 0 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f8fafc;
  overflow: auto;
  min-height: 420px;
}

.org-chart-svg {
  display: block;
  min-width: 900px;
  background: #fff;
}

.org-chart-edge {
  stroke: #94a3b8;
  stroke-width: 1.5;
}

.org-chart-node-box {
  fill: #eff6ff;
  stroke: #3b82f6;
  stroke-width: 1.5;
}

.org-chart-node.is-selected .org-chart-node-box {
  fill: #dbeafe;
  stroke: #1d4ed8;
  stroke-width: 2;
}

.org-chart-node-name {
  font-size: 13px;
  font-weight: 600;
  fill: #0f172a;
}

.org-chart-node-title {
  font-size: 11px;
  fill: #64748b;
}

.report-org-chart-img {
  max-width: 100%;
  height: auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
}

@media print {
  .no-print,
  .report-chrome {
    display: none !important;
  }

  body.report-page {
    background: #fff;
  }

  .report-doc {
    width: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }

  .report-section {
    break-inside: avoid;
  }

  .report-table {
    break-inside: auto;
  }
}
