:root {
  --admin-bg: #f4f5f7;
  --admin-sidebar: #10141b;
  --admin-sidebar-active: #2f6fed;
  --admin-card: #ffffff;
  --admin-border: #e4e6eb;
  --admin-text: #1c222c;
  --admin-muted: #6b7280;
  --admin-blue: #2f6fed;
  --admin-blue-light: #eaf0ff;
  --admin-danger: #e0432b;
  --admin-success: #1f9d55;
  --radius: 10px;
  --font-body: "Inter", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--admin-bg);
  color: var(--admin-text);
}

a { color: inherit; text-decoration: none; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #10141b, #0b0d10);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}
.login-card h1 {
  font-size: 20px;
  margin: 0 0 4px;
}
.login-card p.subtitle {
  color: var(--admin-muted);
  font-size: 13px;
  margin: 0 0 24px;
}

/* ---------- Layout ---------- */
.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--admin-sidebar);
  color: #fff;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.admin-brand {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 28px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--admin-sidebar-active); }

.admin-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 4px;
}
.admin-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.admin-nav a.active { background: var(--admin-sidebar-active); color: #fff; }
.admin-nav a.soon { cursor: default; opacity: 0.55; display: flex; align-items: center; justify-content: space-between; }
.admin-nav a.soon:hover { background: none; color: rgba(255,255,255,0.7); }
.admin-nav a.soon .badge { font-size: 9px; padding: 2px 7px; }
.admin-nav .group-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 16px 12px 6px;
}

.admin-main { flex: 1; min-width: 0; }

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid var(--admin-border);
}
.admin-topbar h1 { font-size: 17px; margin: 0; }
.admin-user { font-size: 13px; color: var(--admin-muted); display: flex; align-items: center; gap: 12px; }
.admin-user a { color: var(--admin-danger); font-weight: 600; }

.admin-content { padding: 28px; }

/* ---------- Components ---------- */
.card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  padding: 22px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card .label { font-size: 12px; color: var(--admin-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .value { font-size: 30px; font-weight: 700; margin-top: 6px; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.page-head h2 { font-size: 18px; margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--admin-blue);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: #1d4bb0; }
.btn-secondary { background: #fff; color: var(--admin-text); border: 1px solid var(--admin-border); }
.btn-secondary:hover { background: #f4f5f7; }
.btn-danger { background: var(--admin-danger); }
.btn-danger:hover { background: #b8331f; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--admin-muted);
  border-bottom: 1px solid var(--admin-border);
  padding: 10px 12px;
}
tbody td { padding: 12px; border-bottom: 1px solid var(--admin-border); vertical-align: middle; }
tbody tr:hover { background: #fafbfc; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge-active { background: #e6f7ec; color: var(--admin-success); }
.badge-inactive { background: #fdeceb; color: var(--admin-danger); }
.badge-sub { background: var(--admin-blue-light); color: var(--admin-blue); }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group .hint { font-size: 12px; color: var(--admin-muted); margin-top: 4px; }
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-body);
  background: #fff;
  color: var(--admin-text);
}
.form-control:focus { outline: none; border-color: var(--admin-blue); box-shadow: 0 0 0 3px var(--admin-blue-light); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 13px; }

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 18px;
}
.alert-success { background: #e6f7ec; color: var(--admin-success); }
.alert-error { background: #fdeceb; color: var(--admin-danger); }

@media (max-width: 800px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; }
  .form-row { grid-template-columns: 1fr; }
}
