:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #0d9488;
  --accent2: #14b8a6;
  --border: #334155;
  --err: #f87171;
  --ok: #4ade80;
  --warn: #facc15;
}
* { box-sizing: border-box; }
body.app-body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(160deg, #0f172a 0%, #134e4a 45%, #0f172a 100%);
  color: var(--text);
  min-height: 100vh;
}
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: rgba(15, 23, 42, 0.92);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0.85rem;
  flex-shrink: 0;
}
.brand { margin-bottom: 1.25rem; padding: 0 0.4rem; }
.brand strong { display: block; font-size: 1.15rem; color: var(--accent2); }
.brand span { color: var(--muted); font-size: 0.8rem; }
.sidebar nav { display: flex; flex-direction: column; gap: 0.2rem; }
.nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
}
.nav-link:hover, .nav-link.active {
  background: rgba(13, 148, 136, 0.2);
  color: #fff;
}
.main { flex: 1; padding: 1.25rem 1.5rem 3rem; overflow-x: auto; }
.userbar {
  display: flex; justify-content: flex-end; gap: 1rem; align-items: center;
  margin-bottom: 1rem; color: var(--muted); font-size: 0.9rem;
}
.userbar a { color: var(--accent2); }
.panel {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.panel h1, .panel h2 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.panel-copy { color: var(--muted); margin: 0 0 1rem; font-size: 0.92rem; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}
.stat .lbl { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; }
.stat .val { font-size: 1.25rem; font-weight: 700; margin-top: 0.25rem; }
.table-scroll { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
th, td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.5rem;
  text-align: left;
}
th { background: rgba(15, 23, 42, 0.8); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:nth-child(even) td { background: rgba(15, 23, 42, 0.35); }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
}
.btn:hover { background: var(--accent2); }
.btn.secondary { background: #475569; }
.btn.danger { background: #b91c1c; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.25rem; }
input, select, textarea {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: var(--text);
}
.login-wrap {
  max-width: 400px;
  margin: 4rem auto;
}
.alert {
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}
.alert.ok { background: rgba(74, 222, 128, 0.15); border: 1px solid var(--ok); }
.alert.err { background: rgba(248, 113, 113, 0.15); border: 1px solid var(--err); }
.conv-bad { background: rgba(248, 113, 113, 0.35); }
.conv-ok { background: rgba(74, 222, 128, 0.25); }
.conv-meh { background: rgba(250, 204, 21, 0.25); }
.conv-great { background: rgba(96, 165, 250, 0.3); }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; align-items: end; }
.muted { color: var(--muted); }
.foot-strong td { font-weight: 700; background: rgba(13, 148, 136, 0.15) !important; }
@media (max-width: 800px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
}
