:root {
  --bg: #080a0f;
  --surface: #111722;
  --surface-soft: #171d2a;
  --surface-strong: #202838;
  --line: #2a3446;
  --text: #f8fafc;
  --muted: #98a4b7;
  --accent: #3182f6;
  --accent-soft: #162b4d;
  --good: #31d187;
  --warn: #f7b955;
  --bad: #ff6b7a;
  --ink: #06080d;
  --shadow: 0 18px 50px rgba(0, 0, 0, .32);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app-root {
  min-height: 100vh;
}

.loading-screen,
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-screen {
  grid-template-columns: minmax(0, min(440px, 100%));
  place-content: center;
  color: #f8fafc;
  background: #080a0f;
}

.auth-panel,
.panel,
.flow-card,
.metric-card,
.loading-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-panel {
  width: 100%;
  max-width: min(440px, 100%);
  min-width: 0;
  padding: 34px;
  background: #10131a;
  border: 1px solid #272d3a;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

.auth-panel .brand-lockup {
  margin-bottom: 28px;
}

.auth-panel .brand-logo {
  box-shadow: 0 10px 30px rgba(49, 130, 246, .28);
}

.auth-panel .eyebrow {
  color: #8ab7ff;
}

.auth-panel h1 {
  color: #ffffff;
  font-size: 32px;
}

.auth-panel h2 {
  color: #f8fafc;
  font-size: 22px;
}

.auth-panel label {
  color: #a8b2c3;
}

.auth-panel input {
  border-color: #2e3647;
  background: #171b24;
  color: #f8fafc;
}

.auth-panel input:focus {
  border-color: #3182f6;
  box-shadow: 0 0 0 4px rgba(49, 130, 246, .16);
  outline: 0;
}

.auth-panel input::placeholder {
  color: #737f91;
}

.auth-panel .helper-text {
  color: #8d98aa;
}

.auth-panel .auth-tabs button {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  border-color: transparent;
  background: transparent;
  color: #8d98aa;
}

.auth-panel .auth-tabs button.active {
  border-color: #2d3444;
  background: #202633;
  color: #ffffff;
}

.auth-panel .primary-button {
  min-height: 48px;
  border-color: #3182f6;
  background: #3182f6;
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(49, 130, 246, .24);
}

.auth-panel .primary-button:hover {
  background: #1f74ed;
  border-color: #1f74ed;
}

.auth-panel .secondary-button {
  min-height: 44px;
  border-color: #2e3647;
  background: #171b24;
  color: #d7deea;
}

.auth-panel .secondary-button:hover {
  border-color: #3c4659;
  background: #1d2330;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.brand-lockup.compact {
  margin-bottom: 18px;
}

.brand-lockup.compact span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-grid;
  place-items: center;
}

.brand-logo.large {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}

.brand-logo.nav {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}

.brand-logo-mark {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 12px 26px rgba(49, 130, 246, .24));
}

.brand-logo-mark rect {
  fill: var(--accent);
}

.brand-logo-mark path {
  fill: #ffffff;
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  letter-spacing: 0;
}

h3 {
  font-size: 15px;
  letter-spacing: 0;
}

.helper-text,
.privacy-note {
  color: var(--muted);
  line-height: 1.5;
}

.auth-tabs,
.button-grid,
.top-actions,
.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-tabs {
  padding: 4px;
  border: 1px solid #252b38;
  border-radius: 8px;
  background: #090c12;
  margin-bottom: 18px;
}

.auth-tabs button,
.primary-button,
.secondary-button,
.icon-button,
.nav-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 800;
  padding: 9px 12px;
}

.auth-tabs button.active,
.nav-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.secondary-button {
  background: var(--surface-soft);
  color: var(--text);
}

.secondary-button.danger,
.danger {
  border-color: rgba(255, 107, 122, .42);
  background: rgba(255, 107, 122, .1);
  color: var(--bad);
}

.ghost-button {
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 8px;
  min-height: 38px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  padding: 9px 12px;
}

.icon-button {
  width: 38px;
  padding: 0;
}

button:hover,
.metric-card:hover,
.panel:hover,
.candidate-row:hover {
  transform: translateY(-1px);
}

button,
.metric-card,
.panel,
.candidate-row {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.form-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d121b;
  color: var(--text);
  padding: 10px 12px;
  min-height: 40px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--accent);
}

textarea {
  resize: vertical;
}

.flow-line {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.flow-line span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
  font-weight: 900;
  text-align: center;
}

.erp-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  background: var(--bg);
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: #0c1018;
  border-right: 1px solid var(--line);
}

.side-nav nav {
  display: grid;
  gap: 8px;
}

.side-nav .brand-logo {
  box-shadow: 0 10px 28px rgba(49, 130, 246, .24);
}

.side-nav .brand-lockup strong {
  color: #ffffff;
}

.nav-item {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  cursor: grab;
}

.nav-item:hover {
  border-color: #3a465c;
  background: #151b27;
}

.nav-item.active {
  color: #ffffff;
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item:active {
  cursor: grabbing;
}

.nav-item.dragging {
  opacity: .55;
  transform: scale(.98);
}

.nav-drag-handle {
  width: 12px;
  height: 18px;
  flex: 0 0 12px;
  border-radius: 6px;
  opacity: .72;
  background:
    linear-gradient(#6d778a, #6d778a) left 2px top 3px / 4px 4px no-repeat,
    linear-gradient(#6d778a, #6d778a) right 2px top 3px / 4px 4px no-repeat,
    linear-gradient(#6d778a, #6d778a) left 2px center / 4px 4px no-repeat,
    linear-gradient(#6d778a, #6d778a) right 2px center / 4px 4px no-repeat,
    linear-gradient(#6d778a, #6d778a) left 2px bottom 3px / 4px 4px no-repeat,
    linear-gradient(#6d778a, #6d778a) right 2px bottom 3px / 4px 4px no-repeat;
}

.nav-item:hover .nav-drag-handle,
.nav-item.active .nav-drag-handle {
  opacity: 1;
}

.nav-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.nav-item small {
  color: var(--muted);
  font-weight: 800;
}

.erp-main {
  min-width: 0;
  padding: 24px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1018;
  padding: 16px;
  box-shadow: var(--shadow);
}

.system-pill,
.decision-badge {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 900;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.system-pill.good,
.stage-card.ok {
  color: var(--good);
  background: rgba(49, 209, 135, .1);
  border-color: rgba(49, 209, 135, .3);
}

.module-body {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 16px;
  min-height: 118px;
  background: #111722;
  border-color: #2b3548;
}

.metric-card span {
  color: var(--muted);
  font-weight: 900;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
  color: #ffffff;
}

.metric-card p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.35;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
}

.panel-grid .wide {
  grid-column: 1 / -1;
}

.panel,
.flow-card,
.loading-card {
  padding: 16px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  background: var(--surface);
  border-color: #2b3548;
}

.panel.soft {
  box-shadow: none;
  background: transparent;
}

.card-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  gap: 12px;
}

.opportunity-hero,
.insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 12px;
}

.insight-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.opportunity-brief {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 220px;
  background: linear-gradient(135deg, #111827 0%, #0c1018 58%, #10244a 100%);
}

.opportunity-brief h2 {
  font-size: 30px;
  line-height: 1.15;
}

.opportunity-brief p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.6;
}

.donut-panel {
  min-height: 220px;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.donut-chart {
  width: 136px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  animation: spinIn 720ms var(--ease);
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.donut-chart > div {
  position: relative;
  z-index: 1;
  display: grid;
  text-align: center;
}

.donut-chart strong {
  font-size: 25px;
}

.donut-chart span,
.chart-legend span,
.chart-legend strong,
.priority-row span,
.progress-row span,
.next-action-card span {
  color: var(--muted);
  font-weight: 800;
}

.chart-legend,
.priority-list,
.progress-list,
.next-action-list {
  display: grid;
  gap: 10px;
}

.chart-legend p {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.priority-row,
.progress-row,
.next-action-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(15, 23, 42, .45);
  padding: 10px;
}

.priority-row > div:first-child,
.progress-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.priority-row strong,
.progress-row strong,
.next-action-card strong,
.chart-legend span,
.candidate-row strong,
.candidate-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: #252d3d;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #31d187);
  animation: fillBar 700ms var(--ease);
}

.progress-row p,
.next-action-card p {
  color: var(--muted);
  line-height: 1.45;
}

.candidate-table td:first-child {
  color: #ffffff;
  font-weight: 900;
}

.candidate-list,
.user-list,
.todo-list {
  display: grid;
  gap: 8px;
}

.candidate-row {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
  display: grid;
  gap: 4px;
}

.candidate-row.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #ffffff;
}

.candidate-row span,
.todo-list p {
  color: var(--muted);
}

.candidate-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.stage-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.stage-card.unknown {
  color: var(--warn);
  background: rgba(247, 185, 85, .1);
  border-color: rgba(247, 185, 85, .28);
}

.stage-card.blocked,
.stage-card.risk,
.stage-card.rejected {
  color: var(--bad);
  background: rgba(255, 107, 122, .1);
  border-color: rgba(255, 107, 122, .3);
}

.stage-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.action-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.research-links,
.template-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.research-links a,
.template-links a {
  text-align: center;
  text-decoration: none;
}

.collection-target-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.collection-target-list p {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 8px;
  background: rgba(15, 23, 42, .42);
}

.collection-target-list strong {
  color: #ffffff;
  font-size: 13px;
}

.collection-target-list span {
  color: var(--muted);
  font-size: 12px;
}

.action-plan-card {
  border: 1px solid rgba(96, 165, 250, .24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(49, 130, 246, .11), rgba(49, 209, 135, .06)),
    rgba(15, 23, 42, .46);
  display: grid;
  gap: 14px;
  margin-top: 12px;
  padding: 14px;
  min-width: 0;
}

.action-plan-head {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 118px;
}

.action-plan-head h3 {
  margin: 3px 0 6px;
}

.action-plan-head p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.action-plan-meter {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(2, 6, 23, .28);
  display: grid;
  gap: 5px;
  padding: 10px;
}

.action-plan-meter strong {
  color: #ffffff;
  font-size: 22px;
}

.action-plan-meter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.action-plan-meter i {
  background: rgba(148, 163, 184, .18);
  border-radius: 999px;
  display: block;
  height: 7px;
  overflow: hidden;
}

.action-plan-meter b {
  background: linear-gradient(90deg, var(--accent), var(--good));
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 420ms var(--ease);
}

.next-action-strip {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.next-action-strip p {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(15, 23, 42, .35);
  display: grid;
  gap: 3px;
  margin: 0;
  min-width: 0;
  padding: 10px;
}

.next-action-strip strong {
  color: #ffffff;
  font-size: 13px;
}

.next-action-strip span {
  color: #dbe4f2;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.action-plan-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-plan-grid section {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.action-plan-grid h4 {
  color: #ffffff;
  margin: 0;
}

.action-task-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.action-task {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(15, 23, 42, .34);
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
}

.action-task.done {
  border-color: rgba(49, 209, 135, .34);
  background: rgba(49, 209, 135, .08);
}

.action-task.needed {
  border-color: rgba(247, 185, 85, .28);
  background: rgba(247, 185, 85, .08);
}

.action-task.waiting {
  border-color: rgba(96, 165, 250, .26);
  background: rgba(49, 130, 246, .08);
}

.action-task > div {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.action-task strong {
  color: #ffffff;
  min-width: 0;
  overflow-wrap: anywhere;
}

.action-task em {
  border-radius: 999px;
  background: rgba(148, 163, 184, .14);
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  padding: 3px 7px;
}

.action-task p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.action-task small,
.action-task span,
.action-task a {
  color: #bfd0e4;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.action-task a {
  color: #93c5fd;
  font-weight: 900;
}

.action-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.action-rules span {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(15, 23, 42, .36);
  font-size: 12px;
  font-weight: 900;
  padding: 6px 9px;
}

.task-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.task-toolbar p {
  margin: 0;
}

.mini-task-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mini-task-list > div {
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 8px;
  padding: 10px;
  background: rgba(15, 23, 42, .38);
}

.mini-task-list strong,
.mini-task-list span,
.mini-task-list p {
  display: block;
  overflow-wrap: anywhere;
}

.mini-task-list strong {
  color: #ffffff;
  font-size: 13px;
}

.mini-task-list span,
.mini-task-list p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
}

.mini-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.mini-task-actions .secondary-button,
.mini-task-actions .ghost-button {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
  text-decoration: none;
}

.field-grid,
.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.permission-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  margin-top: 10px;
}

.permission-grid label {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: var(--surface-soft);
  grid-template-columns: 1fr auto auto;
  align-items: center;
}

.permission-grid span {
  color: var(--muted);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.user-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}

.user-card p {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  background: #0d121b;
}

td {
  line-height: 1.4;
  color: #d9e2f1;
}

.bar-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.bar-row span {
  color: var(--muted);
  font-weight: 800;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #252d3d;
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: fillBar 620ms var(--ease);
}

.opportunity-board-head {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
  gap: 12px;
}

.opportunity-board-title,
.action-summary {
  display: grid;
  gap: 10px;
}

.opportunity-board-title h2 {
  font-size: 32px;
}

.opportunity-board-title p,
.action-summary p {
  max-width: 860px;
  color: var(--muted);
  line-height: 1.55;
}

.action-summary span {
  color: var(--muted);
  font-weight: 900;
}

.action-summary strong {
  font-size: 22px;
  line-height: 1.2;
}

.opportunity-metrics .metric-card:nth-child(1) {
  border-color: rgba(49, 209, 135, .38);
}

.opportunity-metrics .metric-card:nth-child(2) {
  border-color: rgba(49, 130, 246, .42);
}

.opportunity-metrics .metric-card:nth-child(3) {
  border-color: rgba(247, 185, 85, .4);
}

.opportunity-metrics .metric-card:nth-child(4) {
  border-color: rgba(148, 163, 184, .28);
}

.opportunity-graph-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.responsibility-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}

.check-list {
  display: grid;
  gap: 8px;
}

.check-list p {
  position: relative;
  padding-left: 22px;
  color: #dbe4f2;
  line-height: 1.45;
}

.check-list p::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(49, 209, 135, .12);
}

.user-work p::before {
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(247, 185, 85, .12);
}

.rule-work p::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(49, 130, 246, .12);
}

.line-chart {
  display: grid;
  gap: 10px;
}

.line-chart svg {
  width: 100%;
  height: 160px;
  overflow: visible;
}

.chart-gridline {
  fill: none;
  stroke: rgba(148, 163, 184, .25);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--good);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 16px rgba(49, 209, 135, .22));
  animation: drawLine 780ms var(--ease);
}

.forecast-line {
  stroke: var(--warn);
  stroke-dasharray: 8 8;
  filter: drop-shadow(0 8px 16px rgba(245, 158, 11, .16));
}

.line-chart circle {
  fill: #ffffff;
  stroke: var(--good);
  stroke-width: 3;
}

.line-chart .forecast-point {
  stroke: var(--warn);
  stroke-dasharray: none;
}

.search-trend-card {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.search-trend-card > p {
  margin: 0;
}

.chart-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.chart-caption strong {
  color: var(--text);
}

.chart-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

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

.legend-dot {
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.legend-dot.observed {
  background: var(--good);
}

.legend-dot.forecast {
  background: var(--warn);
}

.forecast-note {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.scatter-plot {
  position: relative;
  min-height: 230px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background:
    linear-gradient(rgba(148, 163, 184, .08) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, rgba(148, 163, 184, .08) 1px, transparent 1px) 0 0 / 25% 100%,
    #0d121b;
  overflow: hidden;
}

.scatter-axis {
  position: absolute;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  z-index: 1;
}

.scatter-axis.x {
  right: 10px;
  bottom: 8px;
}

.scatter-axis.y {
  top: 10px;
  left: 10px;
}

.scatter-dot {
  position: absolute;
  min-height: 0;
  padding: 0;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, .8);
  background: var(--accent);
  box-shadow: 0 10px 28px rgba(49, 130, 246, .24);
  transform: translate(-50%, 50%);
}

.scatter-dot.active {
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .14), 0 12px 30px rgba(49, 130, 246, .32);
}

.scatter-dot.추천-검토-가능 { background: var(--good); }
.scatter-dot.기회-관찰 { background: var(--accent); }
.scatter-dot.자료-필요,
.scatter-dot.품목명-확인-필요 { background: var(--warn); }
.scatter-dot.제외-보류 { background: var(--muted); }

.recommendation-list {
  max-height: 760px;
  overflow: auto;
  padding-right: 2px;
}

.recommendation-row {
  gap: 7px;
}

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

.recommendation-row em {
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .28);
  padding: 3px 7px;
  color: #d9e2f1;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.recommendation-row small,
.candidate-table small {
  color: var(--muted);
  line-height: 1.4;
}

.candidate-title p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.coverage-item {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

.coverage-item strong {
  font-size: 13px;
}

.coverage-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.coverage-item.done {
  border-color: rgba(49, 209, 135, .3);
  background: rgba(49, 209, 135, .09);
}

.coverage-item.needed {
  border-color: rgba(247, 185, 85, .28);
  background: rgba(247, 185, 85, .08);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.detail-grid section {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  padding: 12px;
  background: rgba(15, 23, 42, .35);
}

.detail-grid p {
  color: #dbe4f2;
  line-height: 1.55;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip-list span,
.empty-chip {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .25);
  background: rgba(148, 163, 184, .09);
  color: #dbe4f2;
  padding: 6px 9px;
  font-size: 13px;
  font-weight: 800;
}

.empty-chip {
  display: inline-block;
  color: var(--muted);
}

.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.mini-stat-grid span {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  background: rgba(15, 23, 42, .35);
}

.mini-stat-grid b {
  display: block;
  color: #ffffff;
  font-size: 18px;
  margin-bottom: 2px;
}

.review-insight-card {
  display: grid;
  gap: 12px;
}

.review-insight-card > p {
  margin: 0;
}

.insight-bars {
  display: grid;
  gap: 9px;
}

.insight-bar {
  display: grid;
  gap: 6px;
}

.insight-bar > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.insight-bar strong {
  color: #ffffff;
}

.insight-bar i {
  background: rgba(148, 163, 184, .16);
  border-radius: 999px;
  display: block;
  height: 9px;
  overflow: hidden;
}

.insight-bar b {
  background: linear-gradient(90deg, var(--accent), var(--good));
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 3%;
  transition: width 420ms var(--ease);
}

.insight-bar.risk b {
  background: linear-gradient(90deg, var(--warn), var(--danger));
}

.external-signal-card {
  display: grid;
  gap: 12px;
}

.external-signal-card > p {
  margin: 0;
}

.external-signal-list {
  display: grid;
  gap: 8px;
}

.external-signal-list > div {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(15, 23, 42, .32);
  padding: 10px;
}

.external-signal-list strong {
  color: #ffffff;
  display: block;
  margin-bottom: 4px;
}

.external-signal-list p {
  margin: 0 0 6px;
}

.external-signal-list small {
  color: var(--muted);
  display: block;
  line-height: 1.45;
  word-break: break-word;
}

.external-signal-list a {
  color: #93c5fd;
  font-weight: 900;
  text-decoration: none;
}

.meeting-board {
  display: grid;
  gap: 10px;
}

.meeting-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.meeting-summary span {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(15, 23, 42, .35);
  color: var(--muted);
  padding: 10px;
}

.meeting-summary b {
  color: #ffffff;
  display: block;
  font-size: 18px;
}

.agent-review-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.agent-role-card {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(15, 23, 42, .35);
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
}

.agent-role-card.done {
  border-color: rgba(49, 209, 135, .32);
  background: rgba(49, 209, 135, .08);
}

.agent-role-card.queued,
.agent-role-card.running {
  border-color: rgba(49, 130, 246, .32);
  background: rgba(49, 130, 246, .08);
}

.agent-role-card.failed {
  border-color: rgba(239, 68, 68, .34);
  background: rgba(239, 68, 68, .08);
}

.agent-role-card > div {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.agent-role-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #ffffff;
}

.agent-role-card span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.agent-role-card p {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.agent-role-card small {
  color: var(--muted);
  display: block;
  line-height: 1.45;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meeting-agenda {
  display: grid;
  gap: 8px;
}

.meeting-agenda p {
  display: grid;
  gap: 3px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.meeting-agenda strong {
  color: #ffffff;
  font-size: 13px;
}

.meeting-agenda .chip-list {
  margin: 2px 0 4px;
}

.upload-box {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  padding: 12px;
  background: rgba(15, 23, 42, .35);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
  background: var(--surface-soft);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: white;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.data-appear,
.panel,
.flow-card {
  animation: riseIn 360ms var(--ease);
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fillBar {
  from { width: 0; }
}

@keyframes spinIn {
  from { opacity: 0; transform: rotate(-24deg) scale(.92); }
  to { opacity: 1; transform: rotate(0) scale(1); }
}

@keyframes drawLine {
  from { stroke-dasharray: 1 900; }
  to { stroke-dasharray: 900 0; }
}

@media (max-width: 980px) {
  .auth-screen,
  .erp-shell,
  .split-layout,
  .opportunity-hero,
  .insight-grid,
  .opportunity-board-head,
  .opportunity-graph-grid,
  .responsibility-grid,
  .mini-task-list {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-grid,
  .panel-grid,
  .stage-grid,
  .coverage-grid,
  .permission-grid,
  .flow-line {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .auth-screen,
  .erp-main,
  .side-nav {
    padding: 12px;
  }

  .auth-screen {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-panel {
    justify-self: start;
    max-width: 366px;
    padding: 28px 24px;
  }

  .auth-panel h1 {
    font-size: 29px;
  }

  .auth-tabs button {
    padding: 9px 8px;
  }

  .opportunity-brief {
    min-height: auto;
  }

  .opportunity-brief h2 {
    font-size: 24px;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .top-bar,
  .candidate-title {
    align-items: stretch;
    flex-direction: column;
  }

  .side-nav nav,
  .report-grid,
  .panel-grid,
  .stage-grid,
  .coverage-grid,
  .detail-grid,
  .permission-grid,
  .flow-line,
  .field-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 22px;
  }
}
