* {
  box-sizing: border-box;
}

:root {
  --bg: #090b14;
  --panel: rgba(18, 23, 40, 0.85);
  --panel-2: rgba(27, 35, 59, 0.92);
  --line: rgba(255, 255, 255, 0.1);
  --text: #eef4ff;
  --muted: #a9b7d0;
  --primary: #6fe0ff;
  --primary-2: #8d79ff;
  --danger: #ff7b96;
  --success: #62e1a3;
  --warning: #ffcb66;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(111, 224, 255, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(141, 121, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #080a12 0%, #0c1120 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(transparent 0%, rgba(255,255,255,0.02) 100%),
    repeating-linear-gradient(90deg, transparent 0 95px, rgba(255,255,255,0.03) 95px 96px);
  opacity: 0.4;
}

a {
  color: inherit;
  text-decoration: none;
}

code, pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.page-shell,
.auth-shell,
.dashboard-shell {
  position: relative;
  z-index: 1;
}

.topbar,
.dashboard-header {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(18px);
  background: rgba(12, 18, 31, 0.7);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(111, 224, 255, 0.28);
}

.brand strong,
.widget-top strong {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.brand span,
.widget-top span,
.nav a,
.hero-copy p,
.section-heading p,
.card p,
.notice-box p,
.status-card p,
.empty-state p,
.form-card p,
.widget-state,
.widget-label {
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav a:not(.btn):hover,
.footer a:hover,
.text-link:hover {
  color: var(--primary);
}

.hero {
  width: min(1180px, calc(100% - 32px));
  margin: 34px auto 0;
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.hero-card,
.card,
.form-card,
.notice-box,
.footer,
.auth-side,
.auth-main,
.widget-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.hero-copy,
.hero-card,
.card,
.form-card,
.notice-box,
.auth-side,
.auth-main {
  padding: 28px;
}

.hero-copy h1,
.section-heading h2,
.notice-box h1,
.form-card h2,
.dashboard-main h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3.65rem);
  line-height: 1.02;
}

.section-heading h2,
.form-card h2,
.notice-box h1,
.dashboard-main h1 {
  font-size: clamp(1.55rem, 3vw, 2.4rem);
}

.eyebrow {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(111, 224, 255, 0.18);
  background: rgba(111, 224, 255, 0.08);
  color: var(--primary);
  font-size: 0.83rem;
  margin-bottom: 16px;
}

.hero-actions,
.dashboard-actions,
.widget-actions,
.mini-widget-badges {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--muted);
}

.mini-widget {
  display: grid;
  gap: 16px;
}

.mini-widget-header,
.widget-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mini-widget-header img,
.widget-brand-logo {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 16px;
}

.mini-widget-body {
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}

.mini-widget-badges span,
.status-badge,
.widget-footer a,
.btn,
.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mini-widget-badges span,
.status-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  font-size: 0.78rem;
}

.mini-widget-footer,
.widget-footer,
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section {
  width: min(1180px, calc(100% - 32px));
  margin: 26px auto 0;
}

.section-heading {
  margin-bottom: 18px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.step {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
}

.step span {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(111,224,255,0.25), rgba(141,121,255,0.35));
  margin-bottom: 12px;
  font-weight: 700;
}

.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 32px;
  padding: 22px 24px;
}

.auth-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 22px;
}

.feature-list {
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.tabs {
  display: inline-flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 14px;
  cursor: pointer;
}

.tab-btn.active,
.btn,
.btn:hover {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #06111c;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.form-card,
.card {
  display: grid;
  gap: 16px;
}

.form-card label,
.stack-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.11);
  background: rgba(5, 10, 21, 0.78);
  color: var(--text);
  border-radius: 16px;
  padding: 15px 16px;
  outline: none;
  transition: 0.2s ease;
  font-size: 0.98rem;
}

input:focus,
textarea:focus {
  border-color: rgba(111,224,255,0.6);
  box-shadow: 0 0 0 4px rgba(111,224,255,0.12);
}

.btn {
  border: 0;
  padding: 13px 18px;
  border-radius: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-small {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
}

.full {
  width: 100%;
}

.text-link {
  color: var(--primary);
  font-weight: 600;
}

.dashboard-main {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 32px;
  display: grid;
  gap: 20px;
}

.notice-box.hidden,
.hidden,
#ownerPanel.hidden,
#adminPanel.hidden {
  display: none !important;
}

.notice-box {
  text-align: center;
}

.status-card {
  min-height: 160px;
}

.status-value {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 800;
}

.status-badge {
  width: fit-content;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-badge.pending {
  background: rgba(255, 203, 102, 0.12);
  color: var(--warning);
}

.status-badge.denied {
  background: rgba(255, 123, 150, 0.12);
  color: var(--danger);
}

.status-badge.approved {
  background: rgba(98, 225, 163, 0.12);
  color: var(--success);
}

.stack-form {
  display: grid;
  gap: 14px;
}

.panel-layout {
  align-items: start;
}

.code-block {
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: rgba(5, 10, 21, 0.92);
  border: 1px solid var(--line);
  color: #cde6ff;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.application-list {
  display: grid;
  gap: 14px;
}

.application-item {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: rgba(255,255,255,0.03);
  display: grid;
  gap: 14px;
}

.application-meta {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.application-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px;
  align-items: start;
}

.copy-group {
  display: grid;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(7, 11, 21, 0.92);
  color: var(--text);
  box-shadow: var(--shadow);
  transform: translateY(120%);
  opacity: 0;
  transition: 0.24s ease;
  z-index: 9999;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.empty-state {
  color: var(--muted);
}

.devtools-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 16, 0.96);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.devtools-overlay.show {
  display: flex;
}

.devtools-overlay-inner {
  max-width: 560px;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(10, 15, 28, 0.96);
  box-shadow: var(--shadow);
}

@media (max-width: 960px) {
  .hero,
  .auth-shell,
  .grid.two,
  .grid.three,
  .steps {
    grid-template-columns: 1fr;
  }

  .topbar,
  .dashboard-header,
  .footer {
    border-radius: 24px;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav,
  .dashboard-actions,
  .mini-widget-footer,
  .widget-footer {
    flex-wrap: wrap;
  }

  .kv {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar,
  .dashboard-header,
  .hero,
  .section,
  .footer,
  .auth-shell,
  .dashboard-main {
    width: min(100% - 20px, 1180px);
  }

  .hero-copy h1,
  .section-heading h2,
  .notice-box h1,
  .dashboard-main h1 {
    line-height: 1.1;
  }
}
