@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  /* VERSO brand */
  --verso-bg: #080c18;
  --verso-bg-elevated: #0d1424;
  --verso-surface: rgba(255, 255, 255, 0.05);
  --verso-border: rgba(255, 255, 255, 0.08);
  --verso-text: #f1f5f9;
  --verso-muted: #94a3b8;
  --verso-blue: #3b82f6;
  --verso-cyan: #06b6d4;
  --verso-gradient: linear-gradient(90deg, var(--verso-blue) 0%, var(--verso-cyan) 100%);
  --verso-glow: 0 0 40px rgba(59, 130, 246, 0.25);

  --ink: #0f172a;
  --paper: #f8fafc;
  --panel: #ffffff;
  --line: #e2e8f0;
  --moss: #06b6d4;
  --moss-dark: #0891b2;
  --rust: #dc2626;
  --amber: #d97706;
  --muted: #64748b;
  --sidebar: var(--verso-bg);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--paper);
  color: var(--ink);
}

a { color: var(--moss-dark); }
code { font-size: 0.9em; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: var(--sidebar);
  color: #e7efe8;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1rem;
}
.brand { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1.5rem; }
.brand-mark {
  width: 2.2rem; height: 2.2rem; border-radius: 0.5rem;
  background: var(--verso-gradient); color: white; display: grid; place-items: center;
  font-weight: 700; font-size: 0.85rem;
  box-shadow: var(--verso-glow);
}
.brand small { display: block; color: var(--verso-muted); font-size: 0.75rem; }
.sidebar nav a {
  color: #cbd5e1; text-decoration: none; padding: 0.55rem 0.7rem; border-radius: 0.4rem;
}
.sidebar nav a.active, .sidebar nav a:hover { background: rgba(255, 255, 255, 0.06); }
.sidebar nav { display: grid; gap: 0.25rem; }
.sidebar-foot { margin-top: auto; display: grid; gap: 0.8rem; }
.status-pills { display: grid; gap: 0.35rem; }
.pill {
  font-size: 0.75rem; padding: 0.25rem 0.5rem; border-radius: 999px; width: fit-content;
}
.pill.ok { background: #1f3d2c; color: #b7e0c4; }
.pill.warn { background: #3d2a16; color: #f0c48a; }
.linkish {
  background: none; border: 0; color: #9bb3a3; cursor: pointer; padding: 0; text-align: left;
}

main.with-sidebar { margin-left: 240px; padding: 2rem; }
main.auth { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }

.page-head, .actions { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.page-head { margin-bottom: 1.5rem; }
h1, h2, h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 0.35rem;
  line-height: 1.25;
}
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: 1.2rem; font-weight: 600; }
.muted { color: var(--muted); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted);
}

.btn, button, select, input, textarea {
  font: inherit;
}
.btn, button[type="submit"] {
  background: var(--ink); color: white; border: 0; border-radius: 0.45rem;
  padding: 0.55rem 0.95rem; text-decoration: none; cursor: pointer; display: inline-block;
}
.btn.primary, form .btn.primary, .form-panel button, .auth-card button {
  background: var(--verso-gradient);
  box-shadow: var(--verso-glow);
}
.btn.primary:hover, .form-panel button:hover { filter: brightness(1.08); }

.link-box {
  background: var(--paper); border: 1px solid var(--line); border-radius: 0.6rem;
  padding: 0.9rem 1rem; margin: 0.8rem 0 1rem;
}
.link-box-title { font-size: 1.05rem; margin: 0 0 0.4rem; }
.link-box-lead { margin: 0 0 0.7rem; }
.link-box code {
  display: block; word-break: break-all; background: var(--panel);
  border: 1px solid var(--line); border-radius: 0.4rem; padding: 0.55rem 0.7rem;
}
.link-box-url { font-size: 0.8rem; color: var(--muted); }

.btn.disabled {
  background: var(--line); color: var(--muted); cursor: not-allowed; pointer-events: none;
}

.stat-grid, .meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.4rem;
}
.stat, .meta-grid div, .panel, .auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}
.stat { padding: 1rem; }
.stat span, .meta-grid span { color: var(--muted); font-size: 0.8rem; }
.stat strong, .meta-grid strong { display: block; font-size: 1.6rem; margin-top: 0.2rem; }
.stat.review strong { color: var(--amber); }
.stat.ok strong { color: var(--moss); }
.stat.bad strong { color: var(--rust); }
.meta-grid div { padding: 0.85rem 1rem; }
.meta-grid strong { font-size: 0.95rem; word-break: break-all; }

.split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1rem; margin-bottom: 1rem; }
.panel { padding: 1.1rem 1.2rem; }
.panel h2 { font-size: 1.15rem; margin-bottom: 0.8rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.3rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; color: var(--muted); font-weight: 600; }

.badge {
  display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px;
  background: #ece6d8; font-size: 0.78rem;
}
.badge.approved, .badge.ok { background: #d9efe2; color: var(--moss-dark); }
.badge.declined, .badge.bad { background: #f6d9d4; color: var(--rust); }
.badge.in-review, .badge.review { background: #f8e6c4; color: #7a5410; }
.badge.not-started, .badge.in-progress, .badge.awaiting-user { background: #dce8f2; color: #1d3d5a; }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.timeline span { display: block; color: var(--muted); font-size: 0.8rem; }

.filters { display: flex; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filters input, .filters select, .field input, .field select, .auth-card input {
  border: 1px solid var(--line); border-radius: 0.45rem; padding: 0.5rem 0.7rem; background: white;
}
.filters input { min-width: 260px; }
.stack { display: grid; gap: 0.9rem; max-width: 560px; }
.field { display: grid; gap: 0.3rem; }
.field ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 1rem; }
.errorlist { color: var(--rust); margin: 0; padding-left: 1.1rem; }
pre {
  background: #111814; color: #d7eadc; padding: 1rem; border-radius: 0.6rem;
  overflow: auto; max-height: 480px; font-size: 0.8rem;
}
.flash-list { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.flash { padding: 0.7rem 0.9rem; border-radius: 0.5rem; background: #dce8f2; }
.flash.error, .flash.errorlist { background: #f6d9d4; }
.flash.success { background: #d9efe2; }
.auth-card { width: min(420px, 100%); padding: 2rem; display: grid; gap: 0.8rem; }
.auth-card form, .auth-card label { display: grid; gap: 0.35rem; }
.center-card { max-width: 520px; }

@media (max-width: 900px) {
  .sidebar { position: relative; width: auto; }
  main.with-sidebar { margin-left: 0; padding: 1rem; }
  .split, .page-head { display: block; }
}
