:root {
  --bg: #0d0f12;
  --panel: #15181d;
  --panel-2: #1c2026;
  --line: #2a2f37;
  --text: #e7e9ee;
  --muted: #8b929e;
  --accent: #d61f1f;
  --accent-2: #ff5a5a;
  --green: #2ecc71;
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 70% -10%, #1a1d23 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
h1 { font-size: 26px; margin: 22px 0 18px; }
h2 { font-size: 17px; margin: 0; }
code { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; }

.muted { color: var(--muted); }
.small { font-size: 12px; }

.topbar {
  display: flex; align-items: center; gap: 22px;
  padding: 14px 26px;
  background: rgba(20,23,28,.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 18px; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.brand.big { font-size: 26px; justify-content: center; }
.brand .muted { font-weight: 600; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.nav { display: flex; gap: 6px; }
.nav a { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; }
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.active { color: #fff; background: var(--panel-2); }
.logout { margin-left: auto; }

.container { max-width: 1000px; margin: 0 auto; padding: 8px 26px 60px; }
.footer { text-align: center; color: var(--muted); padding: 30px; font-size: 12px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card.stat { text-align: center; padding: 26px 18px; }
.stat-num { font-size: 40px; font-weight: 800; }
.stat-label { color: var(--muted); margin-top: 6px; font-size: 13px; }

label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
input {
  width: 100%; padding: 11px 13px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; color: var(--text); font-size: 14px;
}
input:focus { outline: none; border-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px; cursor: pointer;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); font-size: 14px; font-weight: 600;
}
.btn:hover { border-color: #3a414b; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; }
.btn.full { width: 100%; justify-content: center; margin-top: 18px; }
.btn.tiny { padding: 5px 9px; font-size: 12px; }
.btn.danger { color: #ff7676; border-color: #5a2a2a; }
.btn.danger:hover { background: #2a1414; }

.row-form { display: flex; gap: 10px; }
.row-form input { flex: 1; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.table td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.actions { display: flex; gap: 6px; }
.actions form { display: inline; }

.key { background: var(--panel-2); padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); font-size: 13px; }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert.error { background: #2a1414; border: 1px solid #5a2a2a; color: #ff9a9a; }
.alert.success { background: #122a1c; border: 1px solid #1f5a38; color: #8ff0b6; }

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 34px; width: 340px; }
.login-card .subtitle { text-align: center; color: var(--muted); margin: 6px 0 18px; }

@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr; }
  .nav a { padding: 8px 10px; }
  .container { padding: 8px 14px 50px; }
}
