:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9dee8;
  --primary: #0f766e;
  --primary-soft: #e7f7f4;
  --nav: #14213d;
  --warning: #b45309;
  --danger: #b42318;
  --blue: #1d4ed8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body.locked {
  overflow: hidden;
}

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

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #14213d 0%, #0f766e 100%);
}

.login-screen.hidden {
  display: none;
}

.login-card {
  width: 392px;
  padding: 28px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.login-brand {
  padding: 0 0 22px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.login-brand .brand-subtitle {
  color: var(--muted);
}

.login-label {
  display: block;
  margin: 18px 0 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.login-input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.login-button {
  width: 100%;
  height: 42px;
  margin-top: 22px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.login-error {
  min-height: 20px;
  margin-top: 10px;
  color: var(--danger);
  font-size: 13px;
}

.login-help {
  margin-top: 8px;
  font-size: 12px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  padding: 22px 16px;
  background: var(--nav);
  color: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #0f766e;
  font-weight: 800;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 3px;
  color: #b8c3d7;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 20px;
}

.nav-item {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d7deea;
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.main {
  margin-left: 236px;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  background: rgba(244, 246, 248, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.search {
  width: 280px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
}

.primary-action,
.small-button {
  height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: #eef2f7;
  color: #344054;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.54);
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
}

.modal-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.demand-form {
  padding: 22px 24px 24px;
}

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

.form-group-title {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.form-divider {
  height: 1px;
  margin: 20px 0;
  background: var(--line);
}

.form-field {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.form-field.full {
  margin-top: 14px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 400;
}

.form-field input,
.form-field select {
  height: 40px;
  padding: 0 12px;
}

.form-field textarea {
  min-height: 118px;
  resize: vertical;
  padding: 12px;
  line-height: 1.6;
}

.form-options {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 16px;
  color: #344054;
  font-size: 13px;
}

.form-error {
  min-height: 20px;
  margin-top: 10px;
  color: var(--danger);
  font-size: 13px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.small-button.secondary {
  background: #eef2f7;
  color: #344054;
}

.content {
  padding: 24px 28px 40px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric-button {
  display: block;
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.metric-button:hover {
  border-color: rgba(15, 118, 110, 0.5);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  margin-top: 12px;
  font-size: 28px;
  font-weight: 800;
}

.metric-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.panel-title {
  font-size: 16px;
  font-weight: 800;
}

.panel-hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.panel-body {
  padding: 18px;
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 40;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #172033;
  color: #ffffff;
  font-size: 14px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

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

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

.table th,
.table td {
  padding: 13px 12px;
  border-bottom: 1px solid #eef1f5;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #f8fafc;
}

.interactive-row {
  cursor: pointer;
}

.interactive-row:hover td {
  background: #f8fbfc;
}

.status,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #344054;
  font-size: 12px;
  white-space: nowrap;
}

.link-button,
.plain-action,
.tag-button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.link-button {
  color: var(--ink);
  font-weight: 700;
}

.link-button:hover {
  color: var(--primary);
}

.plain-action:hover .status,
.tag-button:hover {
  outline: 1px solid rgba(15, 118, 110, 0.35);
}

.tag-button {
  margin: 0 4px 4px 0;
}

.status.green,
.tag.green {
  background: var(--primary-soft);
  color: var(--primary);
}

.status.orange,
.tag.orange {
  background: #fff7ed;
  color: var(--warning);
}

.status.red,
.tag.red {
  background: #fef3f2;
  color: var(--danger);
}

.status.blue,
.tag.blue {
  background: #eff6ff;
  color: var(--blue);
}

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

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

.action-card {
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.action-card:hover {
  border-color: rgba(15, 118, 110, 0.5);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.work-card-title {
  font-weight: 800;
}

.work-card-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.integration-steps {
  display: grid;
  gap: 14px;
}

.integration-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

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

.material-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.material-code {
  margin-top: 8px;
  color: var(--blue);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.ai-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.ai-box {
  min-height: 380px;
}

.raw-text {
  padding: 14px;
  border-radius: 8px;
  background: #f8fafc;
  color: #344054;
  line-height: 1.7;
}

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

.field {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.field-label {
  color: var(--muted);
  font-size: 12px;
}

.field-value {
  margin-top: 6px;
  font-weight: 700;
}

.timeline {
  display: grid;
  gap: 12px;
}

.milestone {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 10px;
  align-items: center;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
}

.dot.done {
  background: var(--primary);
}

.dot.doing {
  background: #f59e0b;
}

.split-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-block {
  display: grid;
  gap: 6px;
}

.contact-button {
  width: fit-content;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.stat-line {
  line-height: 1.6;
}

.choice-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.choice-pill.green {
  background: var(--primary-soft);
  color: var(--primary);
}

.choice-pill.blue {
  background: #eff6ff;
  color: var(--blue);
}

.choice-pill.orange {
  background: #fff7ed;
  color: var(--warning);
}

.mini-note {
  margin-top: 6px;
  font-size: 12px;
}

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

.field-rule {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(68px, 1fr));
  gap: 6px;
  color: #344054;
  font-size: 12px;
}

@media (max-width: 1280px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
