:root {
  --bg: #080b12;
  --panel: #111827;
  --panel2: #0f172a;
  --line: rgba(148, 163, 184, .18);
  --text: #e5eefb;
  --muted: #94a3b8;
  --brand: #22d3ee;
  --brand2: #8b5cf6;
  --ok: #34d399;
  --danger: #fb7185;
  --warn: #fbbf24;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body {
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, .12), transparent 32%),
    linear-gradient(135deg, #050712, #111827);
  font-family: Inter, Open Sans, Arial, sans-serif;
  color: var(--text);
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card,
.card {
  background: linear-gradient(180deg, rgba(17, 24, 39, .96), rgba(15, 23, 42, .96));
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
  border-radius: 24px;
}

.login-card { width: 420px; padding: 34px; }

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.side {
  background: rgba(6, 9, 17, .78);
  border-right: 1px solid rgba(148, 163, 184, .14);
  padding: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 26px;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 0 25px rgba(34, 211, 238, .22);
  flex: 0 0 auto;
}

.brand h1 { font-size: 22px; margin: 0; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.nav { display: grid; gap: 8px; margin-top: 30px; }
.nav a { padding: 13px 14px; border-radius: 14px; color: #cbd5e1; font-weight: 700; }
.nav a.active, .nav a:hover { background: rgba(34, 211, 238, .1); color: #fff; }

.main { padding: 28px; }

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.top h2 { margin: 0; font-size: 26px; }
.muted { color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid2, .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3, .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.card { padding: 20px; margin-bottom: 18px; }
.card h2, .card h3 { margin-top: 0; }

.stat strong { font-size: 26px; }
.stat span { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; }

.field { margin: 14px 0; }
.field label, label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }

input, select, textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, .2);
  background: #070b14;
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(34, 211, 238, .65);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .1);
}

textarea { min-height: 100px; resize: vertical; }
small { display: block; margin-top: 7px; line-height: 1.4; }

.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn.secondary { background: #1f2937; }
.btn.danger { background: linear-gradient(135deg, #ef4444, #be123c); }
.btn.small, .btn-sm { padding: 8px 10px; border-radius: 10px; font-size: 12px; }

.alert {
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 16px;
  background: rgba(34, 211, 238, .11);
  border: 1px solid rgba(34, 211, 238, .24);
}

.alert.err, .alert-error {
  background: rgba(251, 113, 133, .12);
  border-color: rgba(251, 113, 133, .25);
}

.alert.warn {
  background: rgba(251, 191, 36, .10);
  border-color: rgba(251, 191, 36, .25);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 220px 180px auto;
  gap: 12px;
  align-items: end;
}

.table-wrap { overflow: auto; border-radius: 18px; border: 1px solid rgba(148, 163, 184, .15); }
table { width: 100%; border-collapse: collapse; min-width: 900px; background: rgba(15, 23, 42, .7); }
th, td { padding: 14px 16px; border-bottom: 1px solid rgba(148, 163, 184, .14); text-align: left; vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; background: rgba(255, 255, 255, .03); }
td { font-size: 14px; }
tr:last-child td { border-bottom: 0; }

.badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #1f2937; }
.badge.active, .badge.success { color: #06281c; background: #34d399; }
.badge.error, .badge.blocked { color: #fff; background: #e11d48; }
.badge.suspicious { color: #111827; background: #fbbf24; }
.badge.expired { color: #111827; background: #fbbf24; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { height: auto; position: relative; }
  .grid, .grid2, .grid-2, .grid3, .grid-3, .filters, .form-row { grid-template-columns: 1fr; }
  .main { padding: 18px; }
  .top { flex-direction: column; align-items: flex-start; }
}
