:root {
  --bg: #f5f7fb;
  --bg-soft: #eef2f8;
  --card: #ffffff;
  --text: #0b1220;
  --muted: #64748b;
  --line: #e3e8f0;
  --blue: #0b57d0;
  --blue-2: #1c6bff;
  --blue-soft: #e8f0ff;
  --red: #e32934;
  --green: #12a150;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, 0.04), 0 24px 64px rgba(15, 23, 42, 0.10);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
code, .mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.text-center { text-align: center; }
.text-dim { color: var(--muted); }
.text-danger { color: var(--red); }

.page-glow {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 560px;
  background:
    radial-gradient(60% 60% at 20% 30%, rgba(28, 107, 255, 0.16), transparent 70%),
    radial-gradient(50% 50% at 80% 20%, rgba(227, 41, 52, 0.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245, 247, 251, 0.78);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(227, 232, 240, 0.9);
}

.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.02em; }
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--blue-2), var(--blue));
  color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 6px 16px rgba(11, 87, 208, 0.28);
}
.brand-name { font-size: 16px; }
.brand-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; color: var(--muted);
  padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px;
}

.nav-links { display: flex; gap: 6px; margin-right: auto; }
.nav-link {
  padding: 8px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 500; font-size: 14px;
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.7); }
.nav-link.active { color: var(--text); background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.06); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-auth, .nav-profile { display: flex; align-items: center; gap: 10px; }

.user-badge { font-weight: 600; }
.profile-id h3 { margin: 0; }

.role-pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em;
  color: var(--blue); background: var(--blue-soft);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--blue-2), var(--blue));
  color: #fff;
  box-shadow: 0 6px 16px rgba(11, 87, 208, 0.26);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(11, 87, 208, 0.34); }
.btn-outline { background: #fff; border-color: var(--line); color: var(--text); }
.btn-outline:hover { border-color: #cbd5e1; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.7); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }

/* ---------- Layout ---------- */
.container { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; padding: 48px 24px 80px; }

.page-section { display: none; }
.page-section.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-head { margin-bottom: 22px; }
.section-head h2 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.02em; }
.section-head p { margin: 0; color: var(--muted); }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px;
  align-items: start; padding: 18px 0 40px;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.hero-title {
  margin: 14px 0 16px;
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 800;
}
.hero-title .grad {
  background: linear-gradient(92deg, var(--blue) 0%, var(--blue-2) 55%, var(--red) 120%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin: 0 0 26px; max-width: 520px; color: var(--muted); font-size: 16px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }

.chip {
  padding: 6px 10px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}

.hero-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 20px;
}
.hero-card-top {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 14px; margin-bottom: 14px;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(18, 161, 80, .45);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(18,161,80,0); }
  100% { box-shadow: 0 0 0 0 rgba(18,161,80,0); }
}
.status-list { list-style: none; margin: 0; padding: 0; }
.status-list li {
  display: flex; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px;
}
.status-list li:last-child { border-bottom: 0; }
.status-list .ok { color: var(--green); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
.hero-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px; font-family: "JetBrains Mono", monospace;
}

/* ---------- Features ---------- */
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-top: 8px;
}
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.feature-icon {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; background: var(--blue-soft); color: var(--blue);
  margin-bottom: 14px;
}
.feature-icon svg { width: 20px; height: 20px; }
.feature h3 { margin: 0 0 6px; font-size: 15.5px; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px;
}

.cabinet-grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 18px; }

.profile-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.avatar {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue);
}
.avatar svg { width: 24px; height: 24px; }
.profile-id { margin-right: auto; }
.profile-id h3 { font-size: 17px; }

.profile-list { margin: 0 0 16px; display: grid; gap: 10px; }
.profile-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.profile-list > div:last-child { border-bottom: 0; }
.profile-list dt { color: var(--muted); font-size: 13.5px; }
.profile-list dd { margin: 0; font-weight: 500; text-align: right; }

.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .03em;
}
.badge-pending { background: #fff7e6; color: #b45309; }
.badge-approved { background: #e8f8ef; color: var(--green); }
.badge-banned { background: #fdecec; color: var(--red); }

.notice { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13.5px; }
.notice-pending { background: #fff7e6; color: #92400e; }
.notice-ok { background: #e8f8ef; color: #0f7a3d; }
.notice-bad { background: #fdecec; color: #b91c1c; }

.info-card h3 { margin: 0 0 14px; font-size: 16px; }
.steps { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); font-size: 13.5px; }
.steps li span {
  flex: 0 0 24px; height: 24px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue); font-weight: 700; font-size: 12.5px;
}
.steps code { color: var(--text); background: var(--bg-soft); padding: 1px 6px; border-radius: 6px; }

/* ---------- Admin ---------- */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 2px;
  color: var(--muted); font-size: 13px;
}
.stat-num { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }

.table-card { padding: 6px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-glass { background: var(--bg-soft); border-color: transparent; color: var(--text); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: rgba(255,255,255,.6); }
.footer-inner {
  max-width: 1160px; margin: 0 auto; padding: 22px 24px;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  color: var(--muted); font-size: 13px;
}

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(11, 18, 32, .38); backdrop-filter: blur(6px); }
.modal-card {
  position: relative; width: 100%; max-width: 400px;
  background: var(--card); border-radius: 20px; border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); padding: 26px 24px 24px;
  animation: pop .18s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }

.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; border-radius: 8px; border: 0;
  background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: var(--bg-soft); color: var(--text); }

.modal-tabs { display: flex; gap: 6px; padding: 4px; background: var(--bg-soft); border-radius: 12px; margin-bottom: 18px; }
.modal-tab {
  flex: 1; height: 34px; border: 0; border-radius: 9px; background: transparent;
  color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer;
}
.modal-tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(15,23,42,.08); }

.modal-msg { margin-bottom: 14px; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.modal-msg.error { background: #fdecec; color: #b91c1c; }
.modal-msg.success { background: #e8f8ef; color: #0f7a3d; }

.auth-form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field input {
  height: 42px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--line); background: #fff;
  font-family: inherit; font-size: 14px; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  outline: none; border-color: var(--blue-2);
  box-shadow: 0 0 0 3px rgba(28, 107, 255, .12);
}
.auth-form .btn { margin-top: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; gap: 26px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .cabinet-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 620px) {
  .features-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .hero-title { font-size: 36px; }
  .nav-actions .btn-ghost { display: none; }
}

/* ---------- RAM setting ---------- */
.settings-card h3 { margin: 0 0 6px; font-size: 16px; }
.settings-card p { margin: 0 0 16px; font-size: 13.5px; }
.ram-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ram-row input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--blue) var(--ram-fill, 33%), var(--bg-soft) var(--ram-fill, 33%));
  outline: none;
}
.ram-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--blue);
  box-shadow: 0 2px 6px rgba(11, 87, 208, .25); cursor: pointer;
}
.ram-value { min-width: 64px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }