:root {
  --primary: #0c27b3;
  --primary-dark: #0a2199;
  --primary-darker: #002e58;
  --primary-light: #d8e8fd;
  --ink: #0b1220;
  --muted: #5b6578;
  --line: #e6ebf4;
  --bg: #f5f7fb;
  --white: #ffffff;
  --ok: #0f7a4a;
  --warn: #9a6700;
  --err: #b42318;
  --radius: 16px;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.is-auth { display: grid; place-items: center; padding: 2rem 1rem; }
.auth-shell { width: min(28rem, 100%); }
.auth-brand { text-align: center; margin-bottom: 1.25rem; }
.auth-brand img { display: inline-block; }
.auth-brand p { color: var(--muted); margin: 0.5rem 0 0; }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(12, 39, 179, 0.06);
}
.card h2, .card h1 { margin: 0 0 0.35rem; font-size: 1.35rem; }
.card .lead { color: var(--muted); margin: 0 0 1rem; }

label { display: block; font-weight: 600; font-size: 0.9rem; margin: 0.75rem 0 0.35rem; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: #fff;
}
textarea { min-height: 5rem; resize: vertical; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.7rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-ghost {
  background: var(--primary-light);
  color: var(--primary-darker);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.hint { font-size: 0.85rem; color: var(--muted); }
.demo {
  margin-top: 1rem;
  padding: 0.85rem;
  background: #f8fafc;
  border-radius: 12px;
  font-size: 0.85rem;
}
.demo code { background: #eef2ff; padding: 0.05rem 0.3rem; border-radius: 6px; }

.app-shell { display: grid; grid-template-columns: 16.5rem 1fr; min-height: 100vh; }
.sidebar {
  background: var(--primary-darker);
  color: #fff;
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-logo img { display: block; filter: brightness(0) invert(1); }
.sidebar-app { margin: 0; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; color: #c9d7f5; }
.sidebar nav { display: grid; gap: 0.25rem; }
.sidebar nav a {
  color: #e8eefc;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  text-decoration: none;
}
.sidebar nav a:hover, .sidebar nav a.is-active { background: rgba(255,255,255,0.12); }
.sidebar-foot { margin-top: auto; display: grid; gap: 0.35rem; }
.sidebar-foot a { color: #c9d7f5; font-size: 0.9rem; }

.main { padding: 1.25rem 1.5rem 2.5rem; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.eyebrow { margin: 0; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.topbar h1 { margin: 0.15rem 0 0; font-size: 1.55rem; }
.who { text-align: right; font-size: 0.9rem; }
.who span { display: block; color: var(--muted); }

.grid { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { padding: 1rem; }
.stat strong { display: block; font-size: 1.6rem; color: var(--primary); }
.stat span { color: var(--muted); font-size: 0.9rem; }

.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary-darker);
}
.badge-ok { background: #dcfce7; color: var(--ok); }
.badge-warn { background: #fef3c7; color: var(--warn); }
.badge-no { background: #fee4e2; color: var(--err); }

.score {
  width: 7rem; height: 7rem; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), #e5eaf3 0);
}
.score b { background: #fff; width: 5.1rem; height: 5.1rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; }

.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.checks li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.timeline { display: grid; gap: 0.4rem; }
.timeline div { display: flex; gap: 0.7rem; align-items: center; }
.dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #cbd5e1; }
.dot.done, .dot.current { background: var(--primary); }

.flash { border-radius: 12px; padding: 0.75rem 0.9rem; margin: 0 0 1rem; }
.flash-ok { background: #dcfce7; color: var(--ok); }
.flash-error { background: #fee4e2; color: var(--err); }
.muted { color: var(--muted); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 2; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; }
  .who { text-align: left; }
}
