@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --bg: #06080d;
  --bg2: #0c1018;
  --card: #121820;
  --card2: #181f2a;
  --border: #252d3d;
  --text: #f0f3fa;
  --muted: #8b95a8;
  --accent: #6366f1;
  --accent2: #818cf8;
  --glow: rgba(99, 102, 241, 0.35);
  --ok: #22c55e;
  --bad: #ef4444;
  --warn: #f59e0b;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Sidebar */
.side {
  width: 260px;
  background: linear-gradient(180deg, var(--card) 0%, var(--bg2) 100%);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
  position: fixed;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.brand {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  padding: 0 .5rem;
  background: linear-gradient(135deg, #a5b4fc, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lic-picker { margin-bottom: 1rem; }
.lic-picker label {
  font-size: .65rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.lic-picker select {
  width: 100%;
  margin-top: .4rem;
  padding: .55rem .75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: .88rem;
}

.nav-section {
  font-size: .65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .75rem .5rem .35rem;
  font-weight: 600;
}

.side a {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
  text-decoration: none;
  padding: .65rem .75rem;
  border-radius: 10px;
  margin: .12rem 0;
  font-size: .9rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}

.side a:hover { background: rgba(99, 102, 241, .12); color: var(--accent2); }
.side a.on {
  background: linear-gradient(90deg, rgba(99, 102, 241, .25), transparent);
  color: var(--text);
  border-left: 2px solid var(--accent);
  padding-left: calc(.75rem - 2px);
}

.side-foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--muted);
}
.side-foot a { color: var(--accent2); font-size: .8rem; padding: .25rem 0; }

/* Main */
.main {
  margin-left: 260px;
  padding: 2rem 2.5rem 3rem;
  max-width: 1200px;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: .35rem;
}

.sub { color: var(--muted); margin-bottom: 1.75rem; font-size: .95rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  transition: border-color .2s, box-shadow .2s;
}
.card:hover { border-color: #354056; }

.stat .n {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat .l { color: var(--muted); font-size: .78rem; margin-top: .25rem; font-weight: 500; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.quick-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  text-decoration: none;
  color: var(--text);
  font-size: .88rem;
  font-weight: 600;
  transition: transform .15s, border-color .15s;
}
.quick-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent2);
}

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: .8rem .65rem; text-align: left; border-bottom: 1px solid var(--border); }
th {
  color: var(--muted);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}
tr:hover td { background: rgba(255,255,255,.02); }

.tag {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 600;
}
.tag.bad { background: rgba(239, 68, 68, .15); color: #fca5a5; }
.tag.ok { background: rgba(34, 197, 94, .15); color: #86efac; }
.tag.warn { background: rgba(245, 158, 11, .15); color: #fcd34d; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem 1.15rem;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, box-shadow .12s;
  box-shadow: 0 4px 20px var(--glow);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px var(--glow);
}
.btn.bad {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 4px 16px rgba(239, 68, 68, .3);
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent2); }

input, select, textarea {
  width: 100%;
  padding: .65rem .85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  margin-top: .35rem;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

label { display: block; color: var(--muted); font-size: .8rem; font-weight: 500; margin-top: .65rem; }

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .5rem 1rem;
}
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: .88rem;
}
.toggle input { width: auto; margin: 0; accent-color: var(--accent); }

.alert {
  padding: .9rem 1rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  font-size: .9rem;
}
.alert.bad { background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .35); }
.alert.ok { background: rgba(34, 197, 94, .1); border: 1px solid rgba(34, 197, 94, .35); }

.form-row { display: flex; gap: .85rem; flex-wrap: wrap; align-items: flex-end; }
.form-row > * { flex: 1; min-width: 120px; }

code {
  background: var(--bg);
  padding: .15rem .4rem;
  border-radius: 5px;
  font-size: .82rem;
  border: 1px solid var(--border);
}

/* Auth / landing */
.center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, .25), transparent),
    var(--bg);
}

.box {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.25rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
}

.box h1 { font-size: 1.5rem; margin-bottom: .5rem; -webkit-text-fill-color: var(--text); }
.box .back { font-size: .85rem; color: var(--muted); margin-bottom: 1.25rem; }
.box .back a { color: var(--accent2); }

/* Landing */
.landing {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(99, 102, 241, .2), transparent 60%),
    var(--bg);
}

.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2.5rem;
  border-bottom: 1px solid var(--border);
}

.landing-nav .logo { font-weight: 700; font-size: 1.25rem; color: var(--text); text-decoration: none; }

.landing-hero {
  text-align: center;
  padding: 5rem 2rem 4rem;
  max-width: 720px;
  margin: 0 auto;
}

.landing-hero h1 {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 30%, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-hero p { color: var(--muted); font-size: 1.1rem; margin-bottom: 2rem; line-height: 1.6; }

.landing-btns { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
}
.feature-card h3 { font-size: 1rem; margin-bottom: .4rem; }
.feature-card p { color: var(--muted); font-size: .88rem; }

@media (max-width: 768px) {
  .side { width: 100%; height: auto; position: relative; }
  .main { margin-left: 0; padding: 1.25rem; }
}
