*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --bg3: #22263a;
  --border: #2e3350;
  --text: #e2e4ef;
  --text2: #8b90a8;
  --accent: #5c6ef8;
  --green: #4caf74;
  --yellow: #e8b84b;
  --red: #e85c4b;
  --radius: 8px;
}

body { background: var(--bg); color: var(--text); font-family: system-ui, sans-serif; font-size: 15px; }

/* NAV */
nav {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 52px; position: sticky; top: 0; z-index: 100;
}
.nav-brand { font-weight: 700; font-size: 18px; color: var(--accent); text-decoration: none; }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { color: var(--text2); text-decoration: none; font-size: 14px; transition: color .2s; }
.nav-links a:hover { color: var(--text); }

main { max-width: 900px; margin: 0 auto; padding: 24px 16px; }

/* LOGIN */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.login-box {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 40px; width: 360px;
}
.login-box h1 { text-align: center; color: var(--accent); margin-bottom: 28px; }
.login-box input, .login-box button {
  display: block; width: 100%; padding: 10px 14px; margin-bottom: 14px;
  border-radius: var(--radius); border: 1px solid var(--border); font-size: 15px;
}
.login-box input { background: var(--bg3); color: var(--text); }
.login-box button { background: var(--accent); color: #fff; cursor: pointer; border: none; font-weight: 600; }
.login-box button:hover { opacity: .9; }

/* CARDS */
.card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px;
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-meta { font-size: 13px; color: var(--text2); margin-bottom: 12px; }

/* SCORE BADGES */
.badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }

.badge-combo {
  font-size: 20px; font-weight: 800; padding: 4px 12px;
  border-radius: var(--radius); color: #fff; min-width: 56px; text-align: center;
}
.badge-small {
  font-size: 12px; font-weight: 600; padding: 3px 8px;
  border-radius: 4px; background: var(--bg3); color: var(--text2);
}
.badge-cat {
  font-size: 12px; font-weight: 600; padding: 3px 8px;
  border-radius: 4px; color: #fff;
}

.score-red    { background: var(--red); }
.score-orange { background: #e8874b; }
.score-yellow { background: var(--yellow); }
.score-lime   { background: #8bc34a; }
.score-green  { background: var(--green); }

/* FEEDBACK */
.feedback-row { display: flex; gap: 8px; margin-top: 12px; }
.btn { padding: 6px 14px; border-radius: var(--radius); border: 1px solid var(--border); cursor: pointer; background: var(--bg3); color: var(--text); font-size: 13px; transition: all .2s; }
.btn:hover { background: var(--bg); border-color: var(--accent); }
.btn.active { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { opacity: .9; }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }

/* REASONING */
.reasoning-toggle { font-size: 12px; color: var(--accent); cursor: pointer; margin-top: 8px; }
.reasoning-text { font-size: 13px; color: var(--text2); margin-top: 6px; padding: 8px; background: var(--bg3); border-radius: 4px; }

/* FORMS */
.section-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 8px 12px; background: var(--bg2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px;
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-group input[type="range"] { padding: 4px 0; }

/* TABLE */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
th { color: var(--text2); font-weight: 600; }

/* TOGGLE */
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--bg3); border-radius: 24px; cursor: pointer; transition: .3s; }
.slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: var(--text2); border-radius: 50%; transition: .3s; }
input:checked + .slider { background: var(--accent); }
input:checked + .slider::before { transform: translateX(18px); background: #fff; }

/* UTILS */
.error { color: var(--red); font-size: 13px; }
.success { color: var(--green); font-size: 13px; }
.empty { color: var(--text2); text-align: center; padding: 40px; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mb-16 { margin-bottom: 16px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; background: var(--bg3); color: var(--text2); }

/* FILTER BAR */
.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar select, .filter-bar input { padding: 6px 10px; background: var(--bg2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }

/* PAGINATION */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 24px; }

/* ADMIN BAR */
.admin-bar {
  display: flex; gap: 10px; align-items: center;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px;
}

/* STAT CARDS */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-number { font-size: 32px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 13px; color: var(--text2); margin-top: 4px; }
