:root {
  --bg: #eef0fa;
  --bg-2: #f7f8fd;
  --card: #ffffff;
  --ink: #1c1c2e;
  --muted: #6b7086;
  --brand: #7f8ff4;
  --brand-2: #9b6bf0;
  --brand-dark: #5f6fe0;
  --border: #e7e8f2;
  --ok: #1fa971;
  --warn: #b8860b;
  --bad: #e0505f;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 55%, var(--bg) 100%);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.topbar {
  background: linear-gradient(115deg, #1c1c30, #2d2d55 55%, #3a3a72);
  color: #fff;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(30, 30, 70, 0.18);
}
.topbar h1 {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.01em;
}
.topbar nav a {
  color: #c8caf2;
  text-decoration: none;
  margin-left: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}
.topbar nav a:hover { color: #fff; }
.topbar nav a.active { color: #fff; border-bottom-color: var(--brand); }
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: 0 10px 30px rgba(30, 30, 70, 0.06);
}
.card h2 {
  margin-top: 0;
  font-size: 1.12rem;
  font-weight: 700;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 10px;
}
.stat {
  background: linear-gradient(160deg, #f7f8ff, #eef0fd);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.stat b { display: block; font-size: 1.7rem; font-weight: 800; color: var(--brand-dark); }
.stat span { color: var(--muted); font-size: 0.8rem; }
label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
}
input, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(127, 143, 244, 0.18);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.btn {
  display: inline-block;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
  border: 0;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: filter 150ms ease, transform 150ms ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn.small { padding: 6px 13px; font-size: 0.8rem; }
.btn.full { width: 100%; }
.btn.danger { background: linear-gradient(120deg, #e0505f, #c8404e); }
.btn.ghost { background: transparent; color: var(--brand-dark); border: 1px solid var(--brand); }
.btn.ghost:hover { background: rgba(127, 143, 244, 0.08); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.87rem;
  white-space: nowrap;
}
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
tbody tr:hover { background: #f9f9ff; }
.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
}
.badge.ok { background: #e4f8ef; color: var(--ok); }
.badge.warn { background: #fbf1dc; color: var(--warn); }
.badge.bad { background: #fbe6e8; color: var(--bad); }
.alert {
  padding: 13px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.alert.success { background: #e4f8ef; color: var(--ok); border-color: #c7ecda; }
.alert.error { background: #fbe6e8; color: var(--bad); border-color: #f5cdd1; }
code {
  background: #f1f2fb;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Utility classes (replace inline style="" attributes, which some hosts'
   Content-Security-Policy headers block) */
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.88rem; }
.hint-sm { color: var(--muted); font-size: 0.82rem; }
.hint-list { font-size: 0.88rem; color: var(--muted); }
.nowrap { white-space: nowrap; }
.hidden { display: none; }
.mt-10 { margin-top: 10px; }
.field { margin-bottom: 16px; }
.field-lg { margin-bottom: 22px; }

/* Login page */
.login-wrap { width: 100%; max-width: 400px; }
.login-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 16px;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(127, 143, 244, 0.35);
}
.login-badge svg { width: 26px; height: 26px; }
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; margin: 0; }
.login-card { padding: 32px 30px; border-radius: 18px; }
.login-card h1 { text-align: center; font-size: 1.35rem; font-weight: 800; margin: 0 0 4px; }
.login-card .subtitle { text-align: center; color: var(--muted); font-size: 0.88rem; margin-bottom: 24px; }
.login-footer { text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 18px; }

@media (max-width: 600px) {
  .topbar { flex-direction: column; align-items: flex-start; padding: 16px 18px; }
  .topbar nav { display: flex; flex-wrap: wrap; }
  .topbar nav a { margin-left: 0; margin-right: 16px; margin-top: 6px; }
  .wrap { padding: 18px 12px 40px; }
  .card { padding: 18px; border-radius: 14px; }
}
