:root {
  --bg: #000000;
  --fg: #f6fbff;
  --muted: rgba(246, 251, 255, 0.58);
  --border: rgba(246, 251, 255, 0.18);
  --border-faint: rgba(246, 251, 255, 0.08);
  --panel: transparent;
  --panel-strong: transparent;
  --accent: #00bfff;
  --accent-soft: transparent;
  --danger: #ff8da1;
}

[data-theme="light"] {
  --bg: #ffffff;
  --fg: #000000;
  --muted: rgba(0, 0, 0, 0.58);
  --border: rgba(0, 0, 0, 0.18);
  --border-faint: rgba(0, 0, 0, 0.08);
  --panel: transparent;
  --panel-strong: transparent;
  --accent-soft: transparent;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Work Sans", sans-serif;
  font-weight: 400;
}

a,
button,
input,
label,
p,
h1,
h2,
h3,
h4,
h5,
h6,
div,
span {
  font-family: "Work Sans", sans-serif;
  font-weight: 400;
}

a { color: inherit; }
button,
input { font: inherit; }

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  background: var(--bg);
}

.brand-link { text-decoration: none; }
.brand-wordmark {
  font-size: clamp(1.15rem, 1.1rem + 1vw, 1.8rem);
  letter-spacing: -0.04em;
}
.brand-c { color: var(--accent); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-actions.mobile {
  display: none;
  flex-direction: column;
  align-items: stretch;
  padding: 0 1.5rem 1rem;
  background: var(--bg);
}

.menu-toggle { display: none; min-width: 56px; width: 56px; padding: 0.75rem; align-items: center; justify-content: center; }
.menu-toggle-lines { display: inline-flex; flex-direction: column; gap: 4px; }
.menu-toggle-lines span { display: block; width: 20px; height: 1px; background: var(--fg); }
.menu-toggle-lines span:nth-child(2) { background: var(--accent); }

.ui-btn {
  min-width: 108px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}

.ui-btn:hover {
  border-color: rgba(0, 191, 255, 0.45);
}

.ui-btn.primary {
  background: transparent;
}

.ui-btn.danger {
  color: var(--danger);
  border-color: rgba(255, 141, 161, 0.36);
}

.page-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem 7rem;
}

.homepage-mark {
  text-align: center;
  font-size: clamp(2.8rem, 10vw, 5.8rem);
  letter-spacing: -0.07em;
  line-height: 1;
}

.hero-card,
.form-card,
.dashboard-card {
  width: min(100%, 980px);
  border: 1px solid var(--border);
  border-radius: 28px;
  background: transparent;
  overflow: hidden;
}

.hero-card { display: grid; grid-template-columns: 1.2fr 0.8fr; }
.hero-copy,
.hero-aside,
.form-card-inner,
.dashboard-card-inner { padding: clamp(1.5rem, 4vw, 3rem); }

.eyebrow {
  display: inline-flex;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-title {
  margin: 1.2rem 0 0;
  font-size: clamp(2.8rem, 8vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.07em;
}

.hero-subtitle,
.form-note,
.page-copy-empty {
  margin: 1rem 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions,
.toolbar-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.hero-stat-grid { display: grid; gap: 1rem; }
.hero-stat {
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
}
.hero-stat-label {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hero-stat-value { margin-top: 0.5rem; font-size: 1.2rem; line-height: 1.4; }

.form-card { width: min(100%, 440px); }
.form-card-inner,
.dashboard-card-inner { display: flex; flex-direction: column; gap: 1rem; }
.form-title,
.dashboard-title { margin: 0; font-size: 2.1rem; letter-spacing: -0.05em; }
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field label { font-size: 0.95rem; }
.field input {
  width: 100%;
  padding: 0.92rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  outline: none;
}
.field input:focus,
.level-input:focus {
  border-color: rgba(0, 191, 255, 0.56);
}

.form-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.text-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}

.status-text { min-height: 1.25rem; font-size: 0.92rem; }
.status-text.error { color: var(--danger); }
.status-text.success { color: var(--fg); }
.submit-row { display: flex; align-items: center; gap: 0.85rem; }
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
}
.spinner.visible { display: inline-block; }

.criteria {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
}
.criteria li.pass { color: var(--fg); }

.admin-toolbar {
  display: grid;
  grid-template-columns: 1.3fr auto auto;
  gap: 0.85rem;
  align-items: end;
}

.table-shell {
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  background: transparent;
}

.tbl-header,
.tbl-row {
  display: grid;
  grid-template-columns: 2fr 0.6fr 1fr 1fr 1fr 1.4fr 1.4fr 0.8fr 90px;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  align-items: center;
}

.tbl-header {
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.tbl-header button {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.tbl-row {
  border-bottom: 1px solid var(--border-faint);
  font-size: 0.9rem;
}

.tbl-row:last-child { border-bottom: 0; }
.level-input {
  width: 72px;
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
}
.delete-btn {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 141, 161, 0.36);
  background: transparent;
  color: var(--danger);
  cursor: pointer;
}
.empty-state {
  padding: 1.2rem 1rem;
  color: var(--muted);
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem 1.5rem 1.25rem;
  font-size: 0.86rem;
  background: var(--bg);
}

.footer-session { display: none; }
.footer-copyright { text-align: center; }
.theme-toggle {
  position: absolute;
  right: 1.5rem;
  bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.theme-toggle button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle button.active { color: var(--accent); }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .hero-card,
  .admin-toolbar,
  .tbl-header,
  .tbl-row {
    grid-template-columns: 1fr;
  }

  .tbl-header { display: none; }
  .tbl-row {
    gap: 0.45rem;
    padding: 1rem;
  }

  .tbl-row > div::before,
  .tbl-row > label::before,
  .tbl-row > button::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
}

@media (max-width: 820px) {
  .hero-card { grid-template-columns: 1fr; }
  .desktop-only { display: none; }
  .menu-toggle { display: inline-flex; }
  .header-actions.mobile.open { display: flex; }
  .theme-toggle { position: static; }
  .site-footer {
    position: static;
    padding-bottom: 1.5rem;
  }
  .page-main { padding-bottom: 2rem; }
}
