:root {
  --bg: #0b0d12;
  --bg-soft: #11141b;
  --panel: #151925;
  --panel-2: #1b2130;
  --border: #262d3d;
  --border-soft: #1e2432;
  --text: #e8ecf4;
  --muted: #98a2b8;
  --faint: #6b7488;
  --accent: #6c7bff;
  --accent-2: #8b5cf6;
  --accent-soft: rgba(108, 123, 255, 0.14);
  --star: #f7c948;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(
      1200px 600px at 50% -10%,
      rgba(108, 123, 255, 0.12),
      transparent 60%
    ),
    var(--bg);
  min-height: 100dvh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

.wrap {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 18px 64px;
}
.wrap-wide {
  max-width: 960px;
}

/* ── Brand / header ─────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.brand .logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px -6px var(--accent);
}
.brand .name {
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand .tag {
  color: var(--faint);
  font-size: 12px;
}

/* ── Card ───────────────────────────────────────── */
.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.hero {
  text-align: center;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  margin: 6px 0 6px;
  letter-spacing: -0.02em;
}
.hero p {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

/* ── Form ───────────────────────────────────────── */
.field {
  margin-bottom: 20px;
}
.field > label,
.field > .label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.field .hint {
  color: var(--faint);
  font-weight: 400;
  font-size: 0.8rem;
}
.req {
  color: var(--accent);
}

input[type="text"],
input[type="password"],
input[type="tel"],
textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  padding: 12px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea {
  min-height: 110px;
  resize: vertical;
}
::placeholder {
  color: var(--faint);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 460px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ── Star rating ────────────────────────────────── */
.stars {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 4px;
}
.stars input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.stars label {
  font-size: 34px;
  line-height: 1;
  color: #39415a;
  cursor: pointer;
  transition: transform 0.08s, color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.stars label:active {
  transform: scale(0.9);
}
.stars input:checked ~ label,
.stars label:hover,
.stars label:hover ~ label {
  color: var(--star);
}
.stars input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.aspect {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.aspect:last-child {
  border-bottom: none;
}
.aspect .a-name {
  font-size: 0.92rem;
}
.aspect .a-sub {
  color: var(--faint);
  font-size: 0.75rem;
}
.aspect .stars label {
  font-size: 24px;
}

.section-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin: 26px 0 10px;
  font-weight: 700;
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.08s, filter 0.15s, box-shadow 0.15s;
  box-shadow: 0 8px 24px -10px var(--accent);
}
.btn:hover {
  filter: brightness(1.06);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn-ghost {
  background: var(--panel-2);
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--border);
  width: auto;
  padding: 9px 14px;
  font-size: 0.88rem;
}
.btn-sm {
  width: auto;
  padding: 9px 14px;
  font-size: 0.88rem;
}

/* ── Alerts ─────────────────────────────────────── */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
  border: 1px solid;
}
.alert-error {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

/* ── Thank you ──────────────────────────────────── */
.thanks {
  text-align: center;
  padding: 20px 6px;
}
.thanks .emoji {
  font-size: 56px;
}
.thanks h1 {
  margin: 10px 0 6px;
}
.thanks p {
  color: var(--muted);
}

.footer {
  text-align: center;
  color: var(--faint);
  font-size: 0.78rem;
  margin-top: 26px;
}

/* ── Admin ──────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.topbar .actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.stat .k {
  color: var(--faint);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat .v {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 4px;
}
.stat .v small {
  font-size: 0.9rem;
  color: var(--faint);
  font-weight: 600;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.panel h2 {
  font-size: 1rem;
  margin: 0 0 14px;
}

/* distribusi bintang */
.dist-row {
  display: grid;
  grid-template-columns: 46px 1fr 48px;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}
.bar {
  height: 10px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.dist-row .cnt {
  text-align: right;
  color: var(--muted);
}

.aspect-bars .ab {
  margin-bottom: 12px;
}
.aspect-bars .ab .top {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 6px;
}
.aspect-bars .ab .top b {
  color: var(--star);
}

/* tabel respons */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
}
.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.resp {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--panel);
}
.resp .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.resp .stars-static {
  color: var(--star);
  letter-spacing: 2px;
}
.resp .when {
  color: var(--faint);
  font-size: 0.78rem;
}
.resp .comment {
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0;
}
.resp .meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 6px;
}
.resp .aspects {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.tagpill {
  font-size: 0.74rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.empty {
  text-align: center;
  color: var(--faint);
  padding: 40px 10px;
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* nav */
.nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.navlink {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}
.navlink:hover {
  background: var(--panel-2);
  text-decoration: none;
  color: var(--text);
}
.navlink.active {
  background: var(--accent-soft);
  color: var(--text);
}
.navlink-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}

/* delete button */
.del-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--faint);
  width: 26px;
  height: 26px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.del-btn:hover {
  border-color: var(--bad);
  color: var(--bad);
  background: rgba(248, 113, 113, 0.08);
}

/* status pill */
.pill {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid var(--border);
}
.pill-on {
  color: var(--good);
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.35);
}
.pill-off {
  color: var(--faint);
  background: var(--panel-2);
}

.alert-ok {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.35);
  color: #a7f3d0;
}

/* checkbox row */
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500 !important;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* steps */
.steps {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}
.steps li {
  margin-bottom: 6px;
}
.steps b {
  color: var(--text);
}
code {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.85em;
  color: var(--accent);
}

button.btn-ghost.btn:disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* login */
.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
}
