:root {
  color-scheme: dark;
  --bg: #0f100e;
  --panel: #191a17;
  --panel-2: #20211d;
  --ink: #f3f4ee;
  --muted: #989b91;
  --line: rgba(255, 255, 255, .09);
  --lime: #c7ff41;
  --danger: #ff7575;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% -10%, rgba(199, 255, 65, .10), transparent 32rem),
    var(--bg);
  font-family: "Yu Gothic UI", "Hiragino Sans", system-ui, sans-serif;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #10110f;
  background: var(--lime);
  font-size: 24px;
}
.brand strong { display: block; font-size: 15px; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font: 700 8px/1 system-ui; letter-spacing: .18em; }
.eyebrow { color: var(--lime); font: 800 9px/1 system-ui; letter-spacing: .2em; }

/* Login */
.auth-page { display: grid; grid-template-columns: minmax(360px, .9fr) 1.1fr; min-height: 100vh; }
.auth-panel { display: flex; flex-direction: column; justify-content: space-between; padding: 38px clamp(28px, 5vw, 76px); border-right: 1px solid var(--line); background: #141512; }
.auth-copy { margin: 70px 0; }
.auth-copy h1 { margin: 16px 0; font-size: clamp(40px, 5vw, 66px); line-height: 1.05; letter-spacing: -.055em; }
.auth-copy p { max-width: 500px; color: var(--muted); font-size: 13px; line-height: 1.9; }
.privacy-line { color: #696b64; font-size: 10px; }
.auth-form-wrap { display: grid; place-items: center; padding: 40px; }
.auth-card { width: min(420px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, #1d1e1a, #161714); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.auth-card h2 { margin: 20px 0 7px; font-size: 24px; }
.auth-card > p { margin: 0 0 25px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 11px; background: #11120f; }
.mode-switch button { height: 34px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; }
.mode-switch button.active { color: var(--ink); background: #292b26; }
.field { display: block; margin-top: 17px; color: #c6c7c0; font-size: 11px; font-weight: 700; }
.field input, .field textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: #11120f;
  font-size: 13px;
}
.field input { height: 46px; padding: 0 13px; }
.field textarea { min-height: 110px; padding: 12px 13px; resize: vertical; line-height: 1.7; }
.field input:focus, .field textarea:focus { border-color: rgba(199,255,65,.5); box-shadow: 0 0 0 3px rgba(199,255,65,.06); }
.submit-button { width: 100%; height: 47px; margin-top: 23px; border: 0; border-radius: 11px; color: #10110f; background: var(--lime); font-size: 12px; font-weight: 900; }
.submit-button:disabled { opacity: .55; cursor: wait; }
.form-error { margin: 14px 0 0; padding: 10px 12px; border: 1px solid rgba(255,117,117,.25); border-radius: 9px; color: #ffb2b2; background: rgba(255,117,117,.07); font-size: 11px; }

/* Dashboard */
.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: #141512;
}
.sidebar nav { display: grid; gap: 5px; margin-top: 58px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 700; }
.sidebar nav a span { color: #5d5f58; font: 700 9px ui-monospace; }
.sidebar nav a:hover, .sidebar nav a.active { color: var(--ink); background: #20211e; }
.sidebar nav a.active span { color: var(--lime); }
.account {
  position: absolute;
  right: 20px;
  bottom: 24px;
  left: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.account-email { display: block; overflow: hidden; color: #c8c9c2; font-size: 10px; text-overflow: ellipsis; }
.logout-button { margin-top: 9px; padding: 0; border: 0; color: #74766e; background: transparent; font-size: 10px; }
.dashboard-main { width: min(880px, calc(100% - 70px)); margin: 0 auto; padding: 64px 0 100px; }
.dashboard-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 45px; }
.dashboard-head h1 { margin: 12px 0 0; font-size: clamp(34px, 4vw, 52px); line-height: 1.12; letter-spacing: -.045em; }
.server-status { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid rgba(199,255,65,.18); border-radius: 999px; color: #b9d877; font-size: 9px; }
.server-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(199,255,65,.08); }
.settings-form { display: grid; gap: 18px; }
.settings-card { display: grid; grid-template-columns: 46px 1fr; gap: 18px; padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, #1b1c19, #161714); scroll-margin-top: 20px; }
.card-number { color: var(--lime); font: 800 12px ui-monospace; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { margin: 0; font-size: 20px; }
.section-head p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.counter { color: var(--muted); font-size: 9px; }
.help { margin: 8px 0 0; color: #71736b; font-size: 10px; line-height: 1.7; }
.add-button { padding: 8px 11px; border: 1px solid rgba(199,255,65,.25); border-radius: 9px; color: var(--lime); background: rgba(199,255,65,.05); font-size: 10px; }
.qa-list { display: grid; gap: 10px; }
.qa-item { display: grid; grid-template-columns: 28px 1fr 28px; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #141512; }
.qa-index { padding-top: 24px; color: #686a62; font: 700 10px ui-monospace; }
.qa-fields { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12px; }
.qa-fields .field { margin-top: 0; }
.delete-button { align-self: start; width: 28px; height: 28px; border: 0; color: #74766e; background: transparent; font-size: 18px; }
.delete-button:hover { color: var(--danger); }
.form-actions { position: sticky; bottom: 16px; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(28,29,26,.93); backdrop-filter: blur(16px); box-shadow: 0 15px 45px rgba(0,0,0,.35); }
.save-state { margin: 0; color: var(--muted); font-size: 10px; }
.save-state.saved { color: var(--lime); }
.save-button { padding: 11px 24px; border: 0; border-radius: 10px; color: #111; background: var(--lime); font-size: 12px; font-weight: 900; }
.admin-console-link { display: inline-block; margin: 0 0 18px; padding: 9px 12px; border: 1px solid rgba(199,255,65,.35); border-radius: 9px; color: var(--lime); font-size: 11px; text-decoration: none; }
.admin-table-wrap { overflow: auto; }
#users { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 12px; }
#users th, #users td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
#users th { color: var(--muted); font-size: 10px; font-weight: 700; }
#users td:first-child { max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
#users .save-button { padding: 8px 12px; font-size: 10px; }
.admin-test-banner { position: sticky; top: 0; z-index: 10; display: flex; justify-content: center; align-items: center; gap: 12px; padding: 10px 16px; background: #c7ff41; color: #111; font-size: 12px; font-weight: 800; }
.admin-test-banner button { border: 1px solid #111; border-radius: 6px; padding: 5px 8px; background: transparent; color: inherit; font: inherit; }

@media (max-width: 780px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-panel { min-height: 360px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-copy { margin: 50px 0; }
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; }
  .sidebar nav, .account { display: none; }
  .dashboard-main { width: auto; padding: 38px 18px 80px; }
  .settings-card { grid-template-columns: 1fr; padding: 22px; }
  .qa-fields { grid-template-columns: 1fr; }
}
