:root {
  --bg-deep: #070b14;
  --bg-panel: #0c1222;
  --bg-card: #111827;
  --bg-card-alt: #0f172a;
  --border: rgba(148, 163, 184, 0.12);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --success: #22c55e;
  --danger: #f87171;
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  background: radial-gradient(ellipse 80% 60% at 50% -20%, #1e1b4b 0%, var(--bg-deep) 55%);
  color: var(--text);
}

a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----- Login ----- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.login-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 920px;
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.45);
}
@media (max-width: 768px) {
  .login-card { grid-template-columns: 1fr; }
  .login-brand { display: none; }
}
.login-brand {
  padding: 2.5rem;
  background: linear-gradient(165deg, #1e293b 0%, #0f172a 100%);
  border-right: 1px solid var(--border);
}
.brand-badge {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; margin-bottom: 1.25rem;
}
.login-brand h1 { font-size: 1.35rem; margin: 0 0 0.75rem; font-weight: 700; }
.login-brand p { color: var(--text-muted); line-height: 1.55; font-size: 0.92rem; margin: 0 0 1.25rem; }
.login-brand ul { margin: 0; padding: 0; list-style: none; }
.login-brand li {
  font-size: 0.88rem; color: var(--text-muted);
  padding: 0.35rem 0; padding-left: 1.1rem;
  position: relative;
}
.login-brand li::before {
  content: "";
  position: absolute; left: 0; top: 0.65rem;
  width: 6px; height: 6px; border-radius: 50%; background: #3b82f6;
}
.login-form {
  padding: 2.5rem 2.25rem;
}
.login-form h2 { margin: 0 0 0.35rem; font-size: 1.5rem; }
.login-form .sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.75rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.field input {
  width: 100%; padding: 0.7rem 0.85rem;
  border-radius: 10px; border: 1px solid var(--border);
  background: #0b0f1a; color: var(--text); font-size: 0.95rem;
}
.field input:focus { outline: 2px solid rgba(99, 102, 241, 0.45); border-color: var(--accent); }
.btn-primary {
  width: 100%; margin-top: 0.5rem;
  padding: 0.75rem 1rem; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-weight: 600; font-size: 0.95rem; cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.08); }

/* ----- App shell ----- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
.sidebar {
  background: rgba(12, 18, 34, 0.95);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0.75rem;
  display: flex; flex-direction: column;
}
.sidebar .logo {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.5rem 0.75rem 1.25rem;
  font-weight: 700; font-size: 0.95rem;
}
.nav a {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.55rem 0.85rem; margin: 0.12rem 0;
  border-radius: 10px; color: var(--text-muted); font-size: 0.9rem;
  text-decoration: none;
}
.nav a svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover, .nav a.active { background: rgba(99, 102, 241, 0.18); color: #fff; }
.nav a.active { box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.35); }
.sidebar .brand-badge {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(180deg, #60a5fa, #2563eb); color: #fff; font-weight: 800; font-size: 0.75rem;
  margin: 0;
}
.logo small, .logo .role { font-weight: 500; color: var(--text-muted); font-size: 0.72rem; letter-spacing: 0.04em; }
.stats-6 { grid-template-columns: repeat(6, 1fr); }
.stat-card { text-align: center; padding: 1.35rem 0.5rem 1.15rem; border-radius: 16px; }
.stat-card .val { font-size: 1.85rem; font-weight: 650; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.card-head h3 { margin: 0; }
.btn-view {
  border: 1px solid var(--border); border-radius: 8px; padding: 0.3rem 0.65rem;
  color: var(--text-muted); font-size: 0.78rem; text-decoration: none;
}
.activity-bar { display: flex; gap: 0.65rem; align-items: stretch; margin: 0.8rem 0 1rem; }
.activity-toggle {
  flex: 1; margin: 0; background: #1d4e89; border: none; border-radius: 12px;
  min-height: 74px; display: flex; align-items: center; justify-content: center; gap: 0.85rem;
  color: #fff; cursor: pointer;
}
.switch-btn {
  width: 44px; height: 24px; border: none; border-radius: 99px; background: #94a3b8;
  position: relative; cursor: pointer; padding: 0;
}
.switch-btn:after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px;
}
.switch-btn.on { background: #22c55e; }
.switch-btn.on:after { left: 23px; }
.btn-clear {
  align-self: center; background: transparent; color: #fda4af;
  border: 1px solid #fb7185; border-radius: 10px; padding: 0.45rem 0.75rem; cursor: pointer;
}
.badge.php { background: #0e7490; color: #ecfeff; }
.badge.gold { background: rgba(234, 179, 8, 0.16); color: #facc15; }
.file-link { color: #93c5fd; margin-right: 0.35rem; }
.actions { display: flex; gap: 0.4rem; align-items: center; }
.actions form { margin: 0; }
.btn-activate, .btn-reject {
  border-radius: 8px; padding: 0.38rem 0.7rem; font-size: 0.78rem; font-weight: 650; cursor: pointer; text-decoration: none;
}
.btn-activate { background: linear-gradient(135deg, #6366f1, #7c3aed); color: #fff; border: none; }
.btn-reject { background: #111827; color: #e5e7eb; border: 1px solid #374151; }
.manage-row { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.manage-row input, .manage-row select, table.data input, table.data select {
  background: #0b0f1a; color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.4rem 0.55rem; font-size: 0.82rem;
}
table.data input { width: 100%; max-width: 220px; margin: 0.2rem 0; }
.twofa-box { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin: 0.8rem 0; }
.twofa-box img { background: #fff; border-radius: 8px; padding: 6px; }
.totp-code { font-size: 1.6rem; letter-spacing: 0.18em; }
@media (max-width: 1200px) { .stats-6 { grid-template-columns: repeat(3, 1fr); } }
.sidebar-foot {
  margin-top: auto; padding: 1rem 0.75rem;
  font-size: 0.75rem; color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.main { padding: 1.25rem 1.5rem 2rem; overflow-x: auto; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.75rem;
}
.topbar h1 { margin: 0; font-size: 1.35rem; font-weight: 600; }
.btn-action {
  padding: 0.55rem 1rem; border-radius: 9px; border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-weight: 600; font-size: 0.85rem; cursor: pointer;
  text-decoration: none; display: inline-block;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem; margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.stat-card .val { font-size: 1.5rem; font-weight: 700; }
.stat-card .lbl { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }
.stats-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.85rem; }
.stats-6 .stat-card {
  text-align: center;
  min-height: 112px;
  padding: 1.6rem 0.6rem 1.25rem;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.stats-6 .stat-card .val { font-size: 2rem; font-weight: 650; line-height: 1; }
.stats-6 .stat-card .lbl { margin-top: 0.55rem; font-size: 0.8rem; }
.topbar { align-items: center; margin-bottom: 1.1rem; }
.btn-action {
  padding: 0.72rem 1.15rem;
  border-radius: 12px;
  font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
  white-space: nowrap;
}
.main { padding: 1.35rem 1.75rem 2rem; }
.grid-2 {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 1rem;
}
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.card h3 { margin: 0 0 0.75rem; font-size: 0.95rem; font-weight: 600; }
.alert {
  padding: 0.65rem 0.9rem; border-radius: 10px; margin-bottom: 1rem;
  background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.35);
  font-size: 0.88rem;
}
.alert.error { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.35); }
.upload-zone {
  border: 1px dashed var(--border);
  border-radius: 12px; padding: 1.25rem; text-align: center;
  background: var(--bg-card-alt);
}
.upload-zone input[type=file] { width: 100%; margin: 0.5rem 0; color: var(--text-muted); }
.upload-zone .hint { font-size: 0.8rem; color: var(--text-muted); }
table.data {
  width: 100%; border-collapse: collapse; font-size: 0.82rem;
}
table.data th {
  text-align: left; color: var(--text-muted); font-weight: 500;
  padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--border);
}
table.data td {
  padding: 0.55rem 0.4rem; border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.badge {
  display: inline-block; padding: 0.2rem 0.5rem; border-radius: 6px;
  font-size: 0.72rem; font-weight: 600;
}
.badge.ok { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.badge.muted { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }
.btn-dl {
  font-size: 0.78rem; padding: 0.35rem 0.65rem; border-radius: 7px;
  background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.35);
  text-decoration: none; display: inline-block;
}
.btn-dl:hover { background: rgba(59, 130, 246, 0.35); text-decoration: none; }
.link-logout { font-size: 0.8rem; color: var(--text-muted); }

.site-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 6vw; position: sticky; top: 0; z-index: 5;
  background: rgba(7, 11, 20, 0.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-nav .links a { margin-left: 1rem; color: var(--text-muted); }
.hero { padding: 4.5rem 6vw 3rem; text-align: center; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); margin: 0.4rem 0; }
.hero p.lead { color: var(--text-muted); max-width: 40rem; margin: 0 auto 1.25rem; }
.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.pills span { border: 1px solid var(--border); border-radius: 999px; padding: 0.25rem 0.7rem; font-size: 0.8rem; color: var(--text-muted); }
.section { padding: 2rem 6vw 3rem; }
.cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.price { font-size: 2rem; font-weight: 700; }
.banner-info {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 10px; padding: 0.7rem 1rem; margin-bottom: 1rem; font-size: 0.88rem;
}
.toggle-box {
  background: #1e3a5f; border-radius: 12px; padding: 1.25rem; text-align: center; margin-bottom: 0.75rem;
}
.user-chip { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #7c3aed; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; }
.plan-pill { border: 1px solid rgba(34,197,94,.4); color: #4ade80; border-radius: 8px; padding: 0.45rem 0.6rem; font-size: 0.75rem; margin: 0.5rem 0.75rem; }
.crumb { color: var(--text-muted); font-size: 0.78rem; margin-bottom: 0.2rem; }
.sec-hero-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.sec-pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; margin: 1rem 0 0.6rem; }
.sec-pills span {
  border: 1px solid var(--border); border-radius: 999px; padding: 0.45rem 0.8rem;
  font-size: 0.82rem; color: var(--text-muted);
}
.sec-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.sec-switch { display: flex; align-items: center; gap: 0.6rem; color: var(--text-muted); font-size: 0.85rem; }
.switch { position: relative; width: 42px; height: 24px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: #334155; border-radius: 99px; cursor: pointer;
}
.slider:before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: 0.15s;
}
.switch input:checked + .slider { background: #22c55e; }
.switch input:checked + .slider:before { transform: translateX(18px); }
.badge.warn { background: rgba(234, 179, 8, 0.18); color: #facc15; }
.hint { color: var(--text-muted); font-size: 0.8rem; margin: 0.25rem 0 0; }
@media (max-width: 900px) { .sec-pills { grid-template-columns: 1fr 1fr; } }