:root {
  --bg: #0b1220;
  --bg2: #111827;
  --panel: #151d2e;
  --line: rgba(255,255,255,.08);
  --text: #eef2ff;
  --muted: #9aa8c7;
  --brand: #3b82f6;
  --brand2: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0,0,0,.35);
  --font: "DM Sans", "Segoe UI", sans-serif;
  --display: "Sora", "DM Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(59,130,246,.28), transparent 55%),
    radial-gradient(700px 400px at 100% 0%, rgba(34,197,94,.14), transparent 50%),
    linear-gradient(180deg, #0a1020, #0b1220 40%, #0d1528);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

.layout { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: auto;
  background: rgba(10,16,32,.88);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
  padding: 20px 14px 28px;
}
.logo { display: flex; gap: 12px; align-items: center; padding: 8px 10px 18px; }
.logo img { width: 42px; height: 42px; border-radius: 12px; background: #fff; }
.logo strong { display: block; font-family: var(--display); font-size: 1.05rem; }
.logo small { color: var(--muted); font-size: .75rem; }
.badge-gads {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 10px 14px; padding: 6px 10px; border-radius: 999px;
  background: rgba(59,130,246,.15); color: #93c5fd; border: 1px solid rgba(59,130,246,.35);
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
}
.nav .section {
  margin: 16px 10px 8px; color: var(--muted); font-size: .7rem;
  text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
}
.nav a {
  display: block; padding: 10px 12px; border-radius: 12px; color: #cbd5e1;
  margin: 2px 0; transition: .15s ease;
}
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(59,130,246,.28), rgba(59,130,246,.08)); color: #fff; border: 1px solid rgba(59,130,246,.25); }

.main { padding: 22px 24px 48px; }
.topbar {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  margin-bottom: 18px;
}
.topbar h1 { margin: 0; font-family: var(--display); font-size: 1.35rem; }
.help { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card h2, .card h3 { margin: 0 0 10px; font-family: var(--display); font-size: 1.05rem; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

.stat {
  padding: 16px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.stat .label { color: var(--muted); font-size: .8rem; }
.stat .value { font-family: var(--display); font-size: 1.7rem; margin-top: 6px; font-weight: 700; }

label { display: block; font-size: .85rem; color: #cbd5e1; margin: 0 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; background: #0b1220; color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: rgba(59,130,246,.6); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.form-row { margin-bottom: 12px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 11px 16px; cursor: pointer; font-weight: 600;
  transition: .15s ease;
}
.btn-primary { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ok { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.05); color: #e2e8f0; border: 1px solid var(--line); }
.btn-danger { background: rgba(239,68,68,.15); color: #fecaca; border: 1px solid rgba(239,68,68,.35); }
.btn-sm { padding: 8px 12px; font-size: .85rem; border-radius: 10px; }

.badge { display: inline-flex; padding: 5px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-ok { background: rgba(34,197,94,.15); color: #86efac; }
.badge-bad { background: rgba(239,68,68,.15); color: #fca5a5; }
.badge-warn { background: rgba(245,158,11,.15); color: #fcd34d; }
.badge-info { background: rgba(59,130,246,.15); color: #93c5fd; }

.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; }
.flash.ok { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35); color: #bbf7d0; }
.flash.bad { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); color: #fecaca; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow: auto; }

.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.auth-card {
  width: min(440px, 100%);
  background: rgba(17,24,39,.9);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.auth-brand img { width: 48px; height: 48px; border-radius: 14px; background: #fff; }
.auth-card h1 { margin: 0 0 6px; font-family: var(--display); font-size: 1.55rem; }
.auth-card .lead { color: var(--muted); margin: 0 0 18px; }
.auth-foot { margin-top: 16px; color: var(--muted); font-size: .9rem; }
.mobile-toggle {
  display: none; position: fixed; top: 14px; right: 14px; z-index: 50;
  background: rgba(15,23,42,.9); border: 1px solid var(--line); color: #fff;
  border-radius: 12px; padding: 10px 12px; font-weight: 700;
}
.sidebar-backdrop { display: none; }

.locked-box { max-width: 560px; margin: 40px auto; text-align: center; }
.locked-box h1 { font-family: var(--display); }

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .mobile-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40;
    transform: translateX(-105%); transition: transform .2s ease;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 30;
    opacity: 0; pointer-events: none; transition: .2s ease;
  }
  body.nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .main { padding: 64px 14px 40px; }
}
