:root {
  --bg0: #0b1220;
  --bg1: #121a2b;
  --card: #161f33;
  --line: #243049;
  --text: #e8eefc;
  --muted: #93a0b8;
  --accent: #3d8bfd;
  --accent-2: #22c55e;
  --danger: #f87171;
  --ok: #86efac;
  --warn: #fde68a;
  --radius: 14px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 420px at 10% -10%, #1d4ed855, transparent 55%),
    radial-gradient(700px 380px at 90% 0%, #0ea5e933, transparent 50%),
    linear-gradient(160deg, var(--bg0), var(--bg1));
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}

.brand span { color: var(--accent); }

.nav-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
}

.btn:hover { filter: brightness(1.08); text-decoration: none; }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-block { width: 100%; }

.hero {
  display: grid;
  gap: 18px;
  padding: 48px 0 24px;
  max-width: 640px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

.card {
  background: color-mix(in srgb, var(--card) 92%, white 8%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  width: min(420px, 100%);
  margin: 0 auto;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.card h1 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.card .sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0d1524;
  color: var(--text);
  font-size: 1rem;
}

input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-color: var(--accent);
}

.flash-list { width: min(420px, 100%); margin: 0 auto 16px; }

.flash {
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.flash.error { background: #3f1d1d; color: var(--danger); border: 1px solid #7f1d1d; }
.flash.success { background: #14291c; color: var(--ok); border: 1px solid #166534; }
.flash.info { background: #1e293b; color: var(--warn); border: 1px solid #334155; }

.meta {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel-card {
  width: min(640px, 100%);
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.stat {
  background: #0d1524;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.stat .k { color: var(--muted); font-size: 0.8rem; margin-bottom: 4px; }
.stat .v { font-weight: 600; word-break: break-all; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #14532d;
  color: var(--ok);
}

.badge.off {
  background: #7c2d12;
  color: #fdba74;
}

.section-title {
  margin: 28px 0 14px;
  font-size: 1.15rem;
  font-weight: 700;
}

.guides { width: min(720px, 100%); margin: 0 auto; }

.guide-card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.guide-body {
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
  margin: 0 0 14px;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0f1a;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.video-frame iframe,
.video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-link { margin: 8px 0 0; }

.admin-wide { width: min(860px, 100%); }

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 8px;
}

.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; margin-bottom: 8px; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

.admin-table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }

.row-actions { white-space: nowrap; }
.row-actions a { margin-right: 10px; }

.link-danger {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
}

.muted { color: var(--muted); }

textarea {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0d1524;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}

textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-color: var(--accent);
}

label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  color: var(--text);
  font-size: 0.95rem;
}

label.check input { width: auto; margin: 0; }

@media (max-width: 560px) {
  .stat-row { grid-template-columns: 1fr; }
  .hero { padding-top: 24px; }
}
