@import url("https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600;700&family=Source+Serif+4:opsz,wght@8..60,300;8..60,400;8..60,600&family=JetBrains+Mono:wght@400;600&display=swap");

:root {
  --bg: #f2f5f9;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #6b7280;
  --line: #e2e8f0;
  --accent: #1d4ed8;
  --accent-2: #c2410c;
  --teal: #0f766e;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Serif 4", serif;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 15% -10%, #ffffff, var(--bg));
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(243, 246, 249, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.nav {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-family: "Sora", sans-serif;
  font-size: 14px;
}

.btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-family: "Sora", sans-serif;
  font-size: 14px;
}

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

.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin: 24px 0 16px;
}

.page-hero h1 {
  font-family: "Sora", sans-serif;
  font-size: 34px;
  margin: 0;
}

.page-hero p {
  margin: 6px 0 0;
  color: var(--muted);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(12, 1fr);
}

.col-12 {
  grid-column: span 12;
}

.col-9 {
  grid-column: span 9;
}

.col-8 {
  grid-column: span 8;
}

.col-7 {
  grid-column: span 7;
}

.col-6 {
  grid-column: span 6;
}

.col-5 {
  grid-column: span 5;
}

.col-4 {
  grid-column: span 4;
}

.col-3 {
  grid-column: span 3;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.section-title {
  margin: 18px 0 10px;
  font-family: "Sora", sans-serif;
  font-weight: 600;
}

.kpi {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 10px;
}

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

.kpi .label {
  font-size: 12px;
  color: var(--muted);
  font-family: "Sora", sans-serif;
}

.kpi .value {
  font-size: 20px;
  font-family: "JetBrains Mono", monospace;
  margin-top: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Sora", sans-serif;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #fef3c7;
  color: #92400e;
}

.badge.green {
  background: #dcfce7;
  color: #14532d;
}

.badge.orange {
  background: #ffedd5;
  color: #9a3412;
}

.badge.red {
  background: #fee2e2;
  color: #991b1b;
}

.badge.black {
  background: #0f172a;
  color: #fff;
}

.badge.neutral {
  background: #e0e7ff;
  color: #3730a3;
}

.chart {
  width: 100%;
  height: 220px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}

.chart-grid {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
      to right,
      transparent,
      transparent 40px,
      rgba(15, 23, 42, 0.05) 40px,
      rgba(15, 23, 42, 0.05) 41px
    ),
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 30px,
      rgba(15, 23, 42, 0.05) 30px,
      rgba(15, 23, 42, 0.05) 31px
    );
}

.chart-line {
  position: absolute;
  inset: 18px 18px 30px 18px;
  background: linear-gradient(120deg, rgba(29, 78, 216, 0.85), rgba(15, 118, 110, 0.55));
  clip-path: polygon(0 70%, 10% 60%, 20% 62%, 30% 45%, 40% 55%, 55% 30%, 65% 40%, 75% 28%, 85% 35%, 100% 18%, 100% 100%, 0 100%);
  border-radius: 12px;
  opacity: 0.8;
}

.list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li,
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}

.learn {
  border-left: 4px solid var(--accent);
  padding: 12px;
  background: #f1f5ff;
  border-radius: 12px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-family: "Sora", sans-serif;
  font-size: 14px;
}

.textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  margin-top: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.action-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.notice {
  padding: 10px 12px;
  border-radius: 10px;
  font-family: "Sora", sans-serif;
  font-size: 13px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.notice.success {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
}

.notice.error {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #7f1d1d;
}

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

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: "Sora", sans-serif;
  font-size: 12px;
  background: #f8fafc;
}

.engine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.engine {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-family: "Sora", sans-serif;
  font-size: 12px;
  text-align: center;
  background: #f8fafc;
}

.badge-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

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

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(12, 1fr);
  }

  .col-3,
  .col-4,
  .col-5,
  .col-6,
  .col-7,
  .col-8,
  .col-9 {
    grid-column: span 12;
  }

  .kpi {
    grid-template-columns: 1fr 1fr;
  }

  .page-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-row {
    flex-wrap: wrap;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .action-row {
    flex-direction: column;
    align-items: stretch;
  }
}
