/* NeonWA theme — deep-space dark with emerald/cyan neon (ported from chat-companion-hub) */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --radius: 0.875rem;
  --radius-sm: calc(var(--radius) - 4px);
  --background: oklch(0.14 0.02 180);
  --foreground: oklch(0.97 0.01 180);
  --card: oklch(0.18 0.025 185 / 0.6);
  --primary: oklch(0.82 0.22 155);
  --primary-foreground: oklch(0.12 0.03 180);
  --secondary: oklch(0.24 0.04 190);
  --muted: oklch(0.22 0.025 190);
  --muted-foreground: oklch(0.68 0.03 190);
  --accent: oklch(0.78 0.18 200);
  --destructive: oklch(0.65 0.24 25);
  --border: oklch(0.3 0.04 190 / 0.5);
  --input: oklch(0.22 0.03 190);
  --neon: oklch(0.85 0.24 150);

  --gradient-glow: radial-gradient(circle at 20% 0%, oklch(0.4 0.18 155 / 0.35), transparent 50%),
    radial-gradient(circle at 80% 100%, oklch(0.4 0.16 210 / 0.3), transparent 55%);
  --gradient-neon: linear-gradient(135deg, oklch(0.85 0.24 150), oklch(0.82 0.16 210));
  --shadow-neon: 0 0 30px oklch(0.85 0.24 150 / 0.45), 0 0 60px oklch(0.85 0.24 150 / 0.2);
  --shadow-card: 0 8px 32px oklch(0 0 0 / 0.5), inset 0 1px 0 oklch(1 0 0 / 0.05);
}

* { box-sizing: border-box; border-color: var(--border); }
html, body { margin: 0; min-height: 100vh; }
body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: var(--background);
  color: var(--foreground);
  background-image: var(--gradient-glow);
  background-attachment: fixed;
}
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.muted { color: var(--muted-foreground); }
h1, h2, h3, h4 { margin: 0; }
a { color: inherit; }

/* utilities */
.glass {
  background: oklch(0.18 0.025 185 / 0.55);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid oklch(1 0 0 / 0.06);
  box-shadow: var(--shadow-card);
}
.neon-border {
  border: 1px solid oklch(0.85 0.24 150 / 0.4);
  box-shadow: 0 0 0 1px oklch(0.85 0.24 150 / 0.1), var(--shadow-neon);
}
.text-gradient {
  background: var(--gradient-neon);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.glow-pulse { animation: glow-pulse 3s ease-in-out infinite; }
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px oklch(0.85 0.24 150 / 0.3), 0 0 40px oklch(0.85 0.24 150 / 0.15); }
  50% { box-shadow: 0 0 32px oklch(0.85 0.24 150 / 0.55), 0 0 64px oklch(0.85 0.24 150 / 0.3); }
}
.scanline { position: relative; overflow: hidden; }
.scanline-bar {
  content: ""; position: absolute; inset: 0; left: 0; right: 0;
  background: linear-gradient(180deg, transparent, oklch(0.85 0.24 150 / 0.4), transparent);
  height: 30%; animation: scan 2.5s linear infinite; pointer-events: none;
}
@keyframes scan { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }
.hidden { display: none !important; }

/* splash / auth loader */
#splashView {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: var(--background); background-image: var(--gradient-glow);
}
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.splash-inner .brand-badge { transform: scale(1.2); }
.spinner {
  height: 34px; width: 34px; border-radius: 999px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.accounts-loading {
  display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 48px 0;
}

/* commands endbar */
.endbar {
  position: fixed; top: 0; right: 0; height: 100vh; width: 370px; max-width: 90vw;
  background: oklch(0.16 0.022 185 / 0.99); border-left: 1px solid var(--border);
  z-index: 60; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
  box-shadow: -20px 0 60px oklch(0 0 0 / .45);
}
.endbar.open { transform: translateX(0); }
.endbar-backdrop {
  position: fixed; inset: 0; background: oklch(0.14 0.02 180 / .6);
  z-index: 59; opacity: 0; pointer-events: none; transition: opacity .25s;
}
.endbar-backdrop.open { opacity: 1; pointer-events: auto; }
.endbar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 14px; border-bottom: 1px solid var(--border);
}
.endbar-search { padding: 12px 18px; border-bottom: 1px solid var(--border); }
.endbar-filter { padding: 10px 18px; border-bottom: 1px solid var(--border); }
.endbar-body { flex: 1; overflow-y: auto; padding: 14px 18px 28px; }
.cmd-group { margin-bottom: 18px; }
.cmd-cat {
  font-family: "JetBrains Mono", monospace; font-size: 11px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--primary); margin-bottom: 8px;
}
.cmd-row { padding: 8px 0; border-bottom: 1px solid oklch(1 0 0 / .04); display: flex; align-items: center; gap: 8px; cursor: pointer; transition: background .15s; border-radius: 6px; }
.cmd-row:hover { background: oklch(1 0 0 / .03); }
.cmd-main { flex: 1; min-width: 0; }
.cmd-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.cmd-desc { font-size: 12px; margin-top: 2px; line-height: 1.4; }
.cmd-tag {
  font-size: 9px; text-transform: uppercase; letter-spacing: .08em;
  background: var(--secondary); color: var(--muted-foreground);
  padding: 1px 7px; border-radius: 999px; font-weight: 500;
}
.cmd-usage-name { font-size: 18px; font-weight: 600; color: var(--primary); }
.cmd-usage-desc { font-size: 14px; line-height: 1.5; }
.cmd-usage-text {
  background: oklch(1 0 0 / .03); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px;
  white-space: pre-wrap; word-break: break-word;
}

/* buttons */
button { font-family: inherit; cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary); color: var(--primary-foreground); border: 0;
  border-radius: var(--radius-sm); padding: 10px 18px; font-weight: 600; font-size: 14px;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: scale(1.02); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-ghost {
  background: transparent; color: var(--muted-foreground);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 14px; font-size: 13px;
}
.btn-ghost:hover { color: var(--foreground); }
.btn-danger { color: oklch(0.7 0.2 25); border-color: oklch(0.5 0.18 25 / .5); }
.btn-danger:hover { background: oklch(0.65 0.24 25 / .12); }

/* login */
#loginView { position: relative; min-height: 100vh; overflow: hidden; }
#loginView .hero {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .4; pointer-events: none;
}
#loginView .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, oklch(0.14 0.02 180 / .4), oklch(0.14 0.02 180 / .7), var(--background));
}
.login-wrap {
  position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; min-height: 100vh;
  display: grid; gap: 40px; align-items: center; padding: 40px 24px;
}
@media (min-width: 900px) { .login-wrap { grid-template-columns: 1fr 1fr; gap: 64px; } }
.brand-badge {
  display: grid; place-items: center; height: 48px; width: 48px; border-radius: var(--radius-sm);
}
.headline { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; line-height: 1.05; margin-top: 28px; }
.feature-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 380px; margin-top: 28px; }
.chip { border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.login-card { position: relative; width: 100%; max-width: 420px; border-radius: var(--radius-sm); padding: 32px; }
.google-btn {
  margin-top: 28px; display: flex; width: 100%; align-items: center; justify-content: center; gap: 12px;
  border-radius: var(--radius-sm); background: #fff; color: #171717; padding: 14px;
  font-weight: 600; border: 0; transition: transform .15s, box-shadow .15s;
}
.google-btn:hover { transform: scale(1.02); box-shadow: 0 0 30px oklch(1 0 0 / .3); }
.divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; font-size: 11px; color: var(--muted-foreground); }
.divider .line { height: 1px; flex: 1; background: var(--border); }

/* app shell */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5;
}
.brand-row { display: flex; align-items: center; gap: 12px; }
.user-row { display: flex; align-items: center; gap: 10px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.avatar { height: 36px; width: 36px; border-radius: 999px; background: var(--muted); object-fit: cover; border: 1px solid var(--border); }
main.container { max-width: 1000px; margin: 0 auto; padding: 24px; }

/* plan chip (header) */
.topbar-right { display: flex; align-items: center; gap: 14px; }
.plan-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--secondary); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px; color: var(--foreground);
  font-size: 13px; font-weight: 600; transition: background .15s, border-color .15s;
}
.plan-chip:hover { background: var(--muted); border-color: var(--primary); }
.plan-chip-tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--primary);
}
.plan-pill {
  font-family: "JetBrains Mono", monospace; font-size: 11px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--primary);
}
.plan-detail-name { font-size: 28px; font-weight: 700; margin-top: 6px; }

/* account cards */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 16px; }
.account { border-radius: var(--radius-sm); padding: 18px; margin-bottom: 16px; }
.acct-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acct-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.acct-icon { display: grid; place-items: center; height: 40px; width: 40px; border-radius: var(--radius-sm); background: var(--secondary); position: relative; }
.dot { position: absolute; bottom: -2px; right: -2px; height: 11px; width: 11px; border-radius: 999px; border: 2px solid var(--background); background: var(--muted); }
.dot.connected { background: var(--primary); animation: glow-pulse 3s ease-in-out infinite; }
.dot.reconnecting, .dot.pending { background: oklch(0.8 0.16 90); }
.dot.logged_out, .dot.stopped, .dot.error { background: var(--destructive); }
.acct-label { font-weight: 600; }
.status {
  font-size: 11px; padding: 3px 10px; border-radius: 999px; background: var(--secondary);
  text-transform: capitalize; font-family: "JetBrains Mono", monospace;
}
.status.connected { background: oklch(0.82 0.22 155 / .18); color: var(--primary); }
.status.reconnecting, .status.pending { background: oklch(0.8 0.16 90 / .18); color: oklch(0.85 0.16 90); }
.status.logged_out, .status.stopped, .status.error { background: oklch(0.65 0.24 25 / .18); color: oklch(0.75 0.2 25); }

/* feature toggle cards (like the plugin grid) */
.toggles { display: grid; gap: 10px; grid-template-columns: 1fr; margin: 16px 0; }
@media (min-width: 560px) { .toggles { grid-template-columns: 1fr 1fr; } }
.toggle-card {
  display: flex; align-items: center; gap: 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); padding: 12px 14px; transition: border-color .15s, box-shadow .15s, background .15s;
  user-select: none; cursor: pointer; background: transparent; text-align: left; width: 100%;
}
.toggle-card.on { border-color: oklch(0.82 0.22 155 / .4); background: oklch(0.82 0.22 155 / .06); box-shadow: 0 0 20px oklch(0.85 0.24 150 / .15); }
.toggle-card .tc-text { flex: 1; min-width: 0; }
.toggle-card .tc-name { font-size: 13px; font-weight: 500; color: var(--foreground); }
.toggle-card .tc-desc { font-size: 11px; color: var(--muted-foreground); }
.switch { position: relative; height: 24px; width: 44px; border-radius: 999px; background: var(--muted); transition: background .15s; flex-shrink: 0; }
.toggle-card.on .switch { background: var(--primary); }
.switch .knob { position: absolute; top: 2px; left: 2px; height: 20px; width: 20px; border-radius: 999px; background: var(--background); transition: left .15s; }
.toggle-card.on .switch .knob { left: 22px; }
.toggle-card.loading { pointer-events: none; opacity: .7; }
.toggle-card.loading .switch::after {
  content: "";
  position: absolute; inset: 2px; border-radius: 999px;
  border: 2px solid var(--muted); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.acct-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* modals */
.modal { position: fixed; inset: 0; background: oklch(0.14 0.02 180 / .85); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal .box { border-radius: var(--radius-sm); padding: 28px; width: 100%; max-width: 420px; position: relative; }
.modal .box.glass { backdrop-filter: none; background: oklch(0.18 0.025 185 / 0.98); }
.modal .box.wide { max-width: 600px; }
.modal .close { position: absolute; right: 14px; top: 12px; background: none; border: 0; color: var(--muted-foreground); font-size: 18px; }
.qr-frame { margin: 18px auto 0; width: fit-content; padding: 12px; border-radius: var(--radius-sm); background: var(--background); }
#qrImg, #qrSkeleton { width: 256px; height: 256px; border-radius: 8px; display: block; }
#qrImg { background: #fff; }
#qrSkeleton { background: var(--secondary); position: relative; overflow: hidden; }
#qrSkeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, oklch(1 0 0 / .08), transparent); transform: translateX(-100%); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.input {
  width: 100%; border-radius: var(--radius-sm); background: oklch(0.22 0.03 190 / .6);
  border: 1px solid var(--border); padding: 12px 14px; font-size: 14px; color: var(--foreground); margin-top: 16px;
}
.input:focus { outline: none; border-color: oklch(0.82 0.22 155 / .5); box-shadow: 0 0 0 3px oklch(0.85 0.24 150 / .15); }

/* plans grid */
.plan-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 18px 0; }
.plan { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; text-align: left; }
.plan.current { border-color: oklch(0.82 0.22 155 / .5); box-shadow: 0 0 20px oklch(0.85 0.24 150 / .15); }
.plan .price { font-size: 22px; font-weight: 700; }
.plan ul { padding-left: 16px; margin: 8px 0; font-size: 12px; color: var(--muted-foreground); }
.plan button { width: 100%; margin-top: 8px; }
.pay-summary {
  display: flex; align-items: center; justify-content: space-between;
  border-radius: var(--radius-sm); padding: 14px 16px; margin: 16px 0;
}
.pay-summary .pp { font-size: 22px; font-weight: 700; }

/* admin console */
.admin-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 22px; }
.stat { border-radius: var(--radius-sm); padding: 18px; }
.stat .v { font-size: 26px; font-weight: 700; }
.stat .l { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-foreground); margin-top: 4px; }
.panel { border-radius: var(--radius-sm); padding: 18px; margin-bottom: 20px; }
.panel h3 { font-size: 16px; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--muted-foreground); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:hover td { background: oklch(1 0 0 / .02); }
.tbl select, .tbl input { background: oklch(0.22 0.03 190 / .6); border: 1px solid var(--border); border-radius: 6px; color: var(--foreground); padding: 6px 8px; font-size: 12px; font-family: inherit; }
.tbl input { width: 56px; }
.badge-role { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: var(--secondary); text-transform: uppercase; }
.badge-role.admin { background: oklch(0.82 0.22 155 / .2); color: var(--primary); }
.pay-status { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--secondary); text-transform: capitalize; }
.pay-status.success, .pay-status.granted { background: oklch(0.82 0.22 155 / .18); color: var(--primary); }
.pay-status.pending { background: oklch(0.8 0.16 90 / .18); color: oklch(0.85 0.16 90); }
.pay-status.failed { background: oklch(0.65 0.24 25 / .18); color: oklch(0.75 0.2 25); }
.denied { min-height: 70vh; display: grid; place-items: center; text-align: center; }
