:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #667085;
  --line: #d9e0ea;
  --brand: #1f6feb;
  --brand-strong: #164fa8;
  --good: #16803c;
  --warn: #b54708;
  --bad: #b42318;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

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

button {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: white;
  padding: 10px 14px;
  cursor: pointer;
}

button:hover {
  background: var(--brand-strong);
}

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.hidden {
  display: none !important;
}

.shell {
  min-height: 100vh;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.login-panel {
  width: min(420px, 100%);
  padding: 28px;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: #0f172a;
  color: white;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar h1 {
  margin: 4px 0 0;
  font-size: 28px;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.nav {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #dbeafe;
  border: 1px solid transparent;
}

.nav.active,
.nav:hover {
  background: #1e293b;
  border-color: #334155;
}

.content {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h2 {
  margin: 4px 0 0;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 700;
}

.sidebar .eyebrow {
  color: #93c5fd;
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.panel h3 {
  margin: 0 0 14px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

.form label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  background: white;
  color: var(--text);
}

textarea {
  resize: vertical;
}

.row-form {
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  align-items: end;
}

.row-form .wide {
  grid-column: span 2;
}

.stack {
  display: grid;
  gap: 10px;
}

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

.item h4 {
  margin: 0 0 6px;
}

.item p {
  margin: 4px 0;
}

.muted {
  color: var(--muted);
}

.error {
  color: var(--bad);
  min-height: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  background: #eef2ff;
  color: #3730a3;
}

.pill.good {
  background: #ecfdf3;
  color: var(--good);
}

.pill.bad {
  background: #fef3f2;
  color: var(--bad);
}

.table {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: 1.5fr 2fr 110px;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
}

.editor-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-bottom: 12px;
}

.title-input {
  font-size: 20px;
  font-weight: 700;
}

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

.editor {
  min-height: 520px;
  line-height: 1.5;
}

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

.score-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.pre {
  white-space: pre-wrap;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 14px;
  overflow: auto;
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .grid.two,
  .row-form,
  .editor-head {
    grid-template-columns: 1fr;
  }

  .row-form .wide {
    grid-column: auto;
  }

  .table-row {
    grid-template-columns: 1fr;
  }
}
