:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #60a5fa;
  --accent-2: #34d399;
  --danger: #ef4444;
  --border: #334155;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); text-decoration: none; }
strong { color: #fff; }
.topbar, .nav, .content, .panel, .card, .auth-card, .flash {
  border: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.92);
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding: 1rem;
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(10px);
}
.topbar .muted { display: block; color: var(--muted); font-size: .85rem; }
.shell { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; padding: 1rem; }
.nav { padding: 1rem; border-radius: 12px; height: fit-content; position: sticky; top: 5rem; }
.nav a { display: block; padding: .7rem .8rem; border-radius: 8px; color: var(--text); }
.nav a:hover { background: var(--panel-2); }
.content { border-radius: 12px; padding: 1rem; min-width: 0; }
.page-title { margin: 0 0 1rem; font-size: 1.6rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.card, .panel, .auth-card, .flash { border-radius: 12px; padding: 1rem; }
.card { display: flex; flex-direction: column; gap: .7rem; }
.card-head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.card h3 { margin: 0; }
.score { background: var(--accent); color: #0b1220; padding: .25rem .5rem; border-radius: 999px; font-weight: 700; }
.meta { display: flex; gap: .4rem; flex-wrap: wrap; }
.badge { display: inline-block; padding: .25rem .5rem; border-radius: 999px; font-size: .78rem; }
.badge-neutral { background: #1d4ed8; }
.badge-status { background: #334155; }
.next-action { margin: 0; color: #f8fafc; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.label { display: block; color: var(--muted); font-size: .78rem; margin-bottom: .1rem; }
.actions, .inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .7rem .9rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn-primary { background: var(--accent); color: #081120; font-weight: 700; }
.btn-secondary { background: #1f2937; }
.btn-success { background: var(--accent-2); color: #052016; font-weight: 700; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-small { padding: .35rem .5rem; border-radius: 8px; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 700; }
.field small { color: var(--muted); }
input, select, textarea {
  width: 100%; padding: .8rem .9rem; border-radius: 10px;
  border: 1px solid var(--border); background: #0b1220; color: var(--text);
}
textarea { resize: vertical; }
.form { display: grid; gap: 1rem; }
.intro, .empty { color: var(--muted); }
.panel { margin-bottom: 1rem; }
.panel-critical { border-color: #b91c1c; background: rgba(127, 29, 29, .25); }
.detail-head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.detail-score { text-align: right; min-width: 90px; }
.detail-score span { color: var(--muted); font-size: .8rem; display: block; }
.detail-score strong { font-size: 2rem; }
.subtask-list { list-style: decimal; padding-left: 1.25rem; }
.subtask-item { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: .7rem; }
.subtask-title { display: flex; gap: .5rem; align-items: center; flex: 1; }
.subtask-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.flash-success { border-color: #166534; background: rgba(22, 101, 52, .2); }
.flash-danger { border-color: #991b1b; background: rgba(127, 29, 29, .22); }
.flash-info { border-color: #1d4ed8; background: rgba(29, 78, 216, .18); }
.domain-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .7rem; }
.domain-item { padding: .8rem; border-radius: 10px; background: rgba(31, 41, 55, .8); display: flex; justify-content: space-between; }
.auth-card { max-width: 420px; margin: 3rem auto; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: static; }
}
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .detail-head { flex-direction: column; }
  .subtask-item { flex-direction: column; align-items: start; }
  .actions { gap: .4rem; }
  .btn { width: 100%; }
}
