:root {
  --bg: #0f1216;
  --panel: #171c23;
  --panel-2: #1e252e;
  --border: #2a313b;
  --text: #e6eaf0;
  --muted: #8b97a7;
  --accent: #4f8cff;
  --accent-2: #6c5ce7;
  --green: #2ecc71;
  --amber: #f1c40f;
  --red: #ff5c6c;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  font-size: 15px; line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; background: var(--panel); border-right: 1px solid var(--border);
  padding: 22px 16px; position: sticky; top: 0; height: 100vh; flex-shrink: 0;
}
.brand { font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.brand small { display:block; color: var(--muted); font-weight: 400; font-size: 12px; }
.nav { margin-top: 26px; display: flex; flex-direction: column; gap: 4px; }
.nav a {
  color: var(--text); padding: 10px 12px; border-radius: 10px; display: flex;
  gap: 10px; align-items: center; text-decoration: none;
}
.nav a:hover { background: var(--panel-2); }
.nav a.active { background: var(--accent); color: #fff; }
.nav-group { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin: 16px 12px 4px; }
.mic-btn.recording { background: var(--red); color: #fff; }
.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 28px; border-bottom: 1px solid var(--border); background: var(--panel);
}
.content { padding: 28px; max-width: 1100px; }
.muted { color: var(--muted); }
h1 { font-size: 24px; margin: 0 0 18px; }
h2 { font-size: 18px; margin: 26px 0 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--accent); color: #fff; border: none; padding: 10px 16px;
  border-radius: 10px; font-size: 14px; font-weight: 600; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn.danger { background: var(--red); }
.btn.big { padding: 16px 22px; font-size: 16px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.stat .num { font-size: 30px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 13px; }

.tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
}
.tag.green { color: var(--green); border-color: rgba(46,204,113,.4); }
.tag.amber { color: var(--amber); border-color: rgba(241,196,15,.4); }
.tag.red { color: var(--red); border-color: rgba(255,92,108,.4); }
.tag.blue { color: var(--accent); border-color: rgba(79,140,255,.4); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr:hover td { background: var(--panel-2); }

input, select, textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); padding: 10px 12px; border-radius: 10px; font-size: 14px;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 90px; }
label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 13px; }
.field { margin-bottom: 6px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }

.flashes { margin-bottom: 16px; }
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 8px; border: 1px solid var(--border); }
.flash.success { border-color: rgba(46,204,113,.5); background: rgba(46,204,113,.08); }
.flash.error { border-color: rgba(255,92,108,.5); background: rgba(255,92,108,.08); }
.flash.info { border-color: rgba(79,140,255,.5); background: rgba(79,140,255,.08); }

/* login */
.login-wrap { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.login-card { width: 360px; }

/* score bar */
.score { font-size: 34px; font-weight: 800; }
.bar { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* recorder */
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--red); display: inline-block; }
.rec-dot.live { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.big-timer { font-size: 56px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pill { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2); font-size: 13px; }

.transcript .seg { padding: 8px 0; border-bottom: 1px solid var(--border); }
.transcript .who { color: var(--accent); font-weight: 600; margin-right: 8px; }
.transcript .ts { color: var(--muted); font-size: 12px; margin-right: 8px; }
.empty { color: var(--muted); padding: 30px; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius); }
