:root {
  --bg: #0b0d12;
  --surface: #13161f;
  --surface-alt: #181c28;
  --border: #252b3b;
  --text: #e6e9f0;
  --muted: #8f98ad;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --ok: #22c55e;
  --danger: #ef4444;
  --warn: #f59e0b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  font-size: 14px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { font-weight: 700; font-size: 17px; color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.owner-pill {
  background: #2b2112;
  color: var(--warn) !important;
  border: 1px solid #59421c;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.lang-switch {
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.user-chip { color: var(--text); font-weight: 600; font-size: 13px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn-ghost { background: var(--surface-alt); border-color: var(--border); color: var(--text); }
.btn-danger { background: #3b171b; border-color: #7f1d1d; color: #fecaca; }

.container { max-width: 1320px; margin: 0 auto; padding: 24px 20px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
}
.card h2, .card h3 { margin-top: 0; font-size: 16px; }

.hero {
  padding: 40px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 20px;
}
.hero h1 { margin: 0 0 10px; font-size: 28px; }
.hero p { margin: 0 0 18px; color: var(--muted); max-width: 680px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.stat-val { font-size: 22px; font-weight: 700; }
.stat-lbl { color: var(--muted); font-size: 12px; }

.dash-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .dash-layout { grid-template-columns: 1fr; } }

.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.sidebar a {
  display: block;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 2px;
}
.sidebar a.active, .sidebar a:hover {
  background: var(--surface-alt);
  color: var(--text);
  text-decoration: none;
}

.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.module-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.module-name { font-weight: 600; font-size: 13px; text-transform: capitalize; }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #2f3547; border-radius: 22px; transition: background .15s;
}
.slider:before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform .15s;
}
input:checked + .slider { background: var(--ok); }
input:checked + .slider:before { transform: translateX(18px); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
input[type="text"], input[type="password"], input[type="number"], input[type="datetime-local"], select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
}
textarea { min-height: 90px; resize: vertical; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }

.toast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--surface-alt); border: 1px solid var(--ok); color: var(--text);
  padding: 10px 16px; border-radius: 6px; font-size: 13px; display: none; z-index: 50;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 18px 20px;
  color: var(--muted);
  font-size: 12px;
}
.footer-inner { max-width: 1320px; margin: 0 auto; display: flex; justify-content: space-between; }
.footer-links { display: flex; gap: 16px; }
