@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Outfit:wght@500;600;700&display=swap");

:root {
  --bg: #07060f;
  --card: rgba(16, 10, 32, 0.82);
  --line: rgba(196, 140, 255, 0.28);
  --text: #f6f1ff;
  --muted: #b9a8d6;
  --purple: #a855f7;
  --pink: #e879f9;
  --violet: #7c3aed;
  --ok: #86efac;
  --danger: #f9a8d4;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; overflow-x: clip; }

body {
  min-height: 100vh;
  color: var(--text);
  font-family: Manrope, "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 480px at 10% -10%, rgba(168, 85, 247, 0.28), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(232, 121, 249, 0.16), transparent 50%),
    var(--bg);
}

img { max-width: 100%; display: block; }

a { color: #f0abfc; }

h1, h2, .brand-name {
  font-family: Outfit, Manrope, sans-serif;
  letter-spacing: -0.03em;
}

h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }

.lede, .muted { color: var(--muted); line-height: 1.55; }

.login-page {
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 32px 28px 26px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(32, 18, 58, 0.92), rgba(10, 7, 20, 0.94));
  border: 1px solid var(--line);
  box-shadow: var(--shadow), 0 0 48px rgba(168, 85, 247, 0.18);
  text-align: center;
}

.login-card img {
  width: 168px;
  height: 168px;
  margin: 0 auto 8px;
  object-fit: cover;
  border-radius: 50%;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 22px rgba(168, 85, 247, 0.55));
}

.login-card h1 { font-size: 1.7rem; }
.login-card .lede { margin: 0 0 18px; }

.notice, .note, .form-error {
  border-radius: 14px;
  padding: 12px 14px;
  line-height: 1.45;
  text-align: left;
}

.notice, .note {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(196, 140, 255, 0.32);
  color: #f3e8ff;
  margin-bottom: 16px;
}

.form-error {
  margin-top: 14px;
  text-align: center;
  color: #ffe4fb;
  background: rgba(232, 121, 249, 0.14);
  border: 1px solid rgba(232, 121, 249, 0.4);
}

form { margin: 0; }

.stack { display: grid; gap: 14px; text-align: left; }

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(196, 140, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
}

input:focus {
  outline: 2px solid rgba(232, 121, 249, 0.7);
  outline-offset: 2px;
}

input:disabled { opacity: 0.72; }

.btn, button, input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
  padding: 13px 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--violet), var(--pink));
  color: white;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(168, 85, 247, 0.35);
}

.btn.slim, .sidebar .logout {
  width: auto;
  margin-top: 0;
  padding: 10px 14px;
  box-shadow: none;
}

button:hover, input[type="submit"]:hover, .btn:hover { filter: brightness(1.08); }

.app {
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  background: rgba(8, 6, 16, 0.88);
  border-right: 1px solid rgba(196, 140, 255, 0.16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 14px rgba(168, 85, 247, 0.55));
}

.brand-name { font-size: 1.2rem; line-height: 1; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-family: Manrope, sans-serif; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }

.nav { display: grid; gap: 6px; }
.nav a, .logout {
  display: block;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.nav a.active, .nav a:hover {
  color: white;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.55), rgba(232, 121, 249, 0.28));
}

.sidebar .logout { margin-top: auto; color: #fbcfe8; }

.main { padding: 28px clamp(16px, 3vw, 40px) 48px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.who { color: var(--muted); min-width: 0; text-align: right; }
.who strong { color: var(--text); }

.menu-btn {
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.menu-btn span, .menu-btn span:before, .menu-btn span:after {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: white;
  position: relative;
  content: "";
}
.menu-btn span:before { position: absolute; top: -6px; }
.menu-btn span:after { position: absolute; top: 6px; }

.grid, .stats {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}
.grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 22px; }
.plan .price { margin: 8px 0 0; font-family: Outfit, Manrope, sans-serif; font-size: 2rem; letter-spacing: -0.04em; }
.plan .was { color: var(--muted); text-decoration: line-through; }
.plan .save { color: var(--ok); font-weight: 700; }
.plan .pay-wrap { max-width: none; margin-top: 16px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.card, .stat {
  padding: 20px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.card p { margin: 0; color: var(--muted); line-height: 1.55; }
.card .btn { width: auto; margin-top: 16px; }

.online-board { margin-top: 16px; }
.online-board table.data { margin-top: 14px; background: transparent; border: 0; box-shadow: none; }
.card.accent { background: linear-gradient(180deg, rgba(124, 58, 237, 0.28), rgba(16, 10, 32, 0.9)); }
.card.warn { border-color: rgba(244, 114, 182, 0.45); }

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stat strong { display: block; margin-top: 10px; font-size: 1.35rem; }

.pill {
  display: inline-flex;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}
.pill.ok { color: var(--ok); background: rgba(134, 239, 172, 0.12); }
.pill.bad { color: var(--danger); background: rgba(244, 114, 182, 0.14); }

.panel { max-width: 560px; }
.pay-wrap { max-width: 360px; margin-top: 8px; }

table.data {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
}
table.data input, table.data button { width: auto; margin: 0 4px 0 0; padding: 8px 12px; }
table.data th, table.data td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
table.data th {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.log-mark::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 10px var(--pink);
}

ul.plain { list-style: none; padding: 0; margin: 0 0 14px; }
ul.plain li { padding: 6px 0; color: var(--muted); border-bottom: 1px solid rgba(255,255,255,.06); }
textarea {
  width: 100%;
  min-height: 160px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(196, 140, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
}

.pager { display: flex; gap: 10px; list-style: none; padding: 16px 0 0; margin: 0; }
.pager a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--line);
}

.mode-row, .search-row, .result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mode-row { margin-bottom: 14px; }
.mode-row button, .search-row button, .result-actions button { width: auto; margin-top: 0; }
.mode-row button.active { box-shadow: 0 0 0 2px #f0abfc; }
.search-row input { flex: 1; min-width: 0; }
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 18px; }
.result { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; }
.result img, .poster-fallback { width: 96px; height: 144px; object-fit: cover; border-radius: 12px; background: rgba(255,255,255,.06); }
.poster-fallback { display: grid; place-items: center; color: var(--muted); font-size: .8rem; }
.result p { margin: 6px 0 0; }
.status-line { min-height: 1.2em; margin-top: 12px; }

.backdrop { display: none; }

@media (max-width: 860px) {
  .app { display: block; }
  .sidebar, .main, .grid, .card { min-width: 0; max-width: 100%; }
  .sidebar {
    position: fixed;
    z-index: 20;
    left: 0;
    width: min(300px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 10; }
  .menu-btn { display: inline-flex; }
  .main { width: 100%; padding: 16px; }
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { min-width: 0; }
  table.data { display: block; width: 100%; overflow-x: auto; }
  .topbar { align-items: flex-start; }
  .who { flex: 1; overflow-wrap: anywhere; }
  .login-page { padding: 16px 12px; }
  .login-card { padding: 22px 16px; }
  .login-card img { width: 120px; height: 120px; }
}
