:root {
  --bg: #eef4fb;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: #d9e2ef;
  --brand: #0697d8;
  --brand-2: #00f0ff;
  --fire: #ff9d00;
  --dark: #07111f;
  --danger: #b42318;
  --warn: #b45309;
  --good: #15803d;
  --shadow: 0 20px 48px rgba(15, 23, 42, 0.11);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 10%, rgba(0, 240, 255, 0.20), transparent 28%),
    radial-gradient(circle at 84% 5%, rgba(255, 157, 0, 0.16), transparent 26%),
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 48%, #dce8f5 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
}

.brand span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(145deg, #0b1020, #13314d);
  overflow: hidden;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow: auto;
}

nav a,
.mini,
.button,
.logout button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  padding: 0 12px;
  text-decoration: none;
}

nav a.active,
.button {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), #0b68ff);
  color: white;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
}

.button.ghost {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}

.logout {
  margin: 0;
}

.flash {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--good) 10%, white);
  color: var(--good);
  font-weight: 800;
}

.flash.bad {
  background: color-mix(in srgb, var(--danger) 10%, white);
  color: var(--danger);
}

.auth-grid,
.public-page,
.admin-main {
  display: grid;
  gap: 16px;
  padding-top: 16px;
}

.admin-hero,
.finance-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.44fr);
  gap: 18px;
  align-items: center;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(7, 17, 31, 0.94), rgba(13, 46, 75, 0.92)),
    url("nitroshare-logo.png") center/cover no-repeat;
  color: white;
  box-shadow: var(--shadow);
}

.admin-hero::after,
.finance-hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -30% 42%;
  height: 190px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.30), transparent 62%);
  pointer-events: none;
}

.admin-hero h1,
.finance-hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4.6rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.admin-hero p,
.finance-hero p {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.76);
}

.admin-hero-logo {
  width: min(420px, 78vw);
  height: auto;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.34));
}

.admin-hero-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(14px);
}

.admin-hero-card span,
.admin-hero-card small {
  color: rgba(255, 255, 255, 0.70);
  font-weight: 800;
}

.admin-hero-card strong {
  font-size: 2.1rem;
}

.finance-hero img {
  width: min(260px, 58vw);
  justify-self: center;
  filter: drop-shadow(0 0 28px rgba(0, 240, 255, 0.42));
}

.auth-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: center;
  min-height: calc(100vh - 170px);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 5.8rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero-logo {
  display: block;
  width: min(430px, 82vw);
  height: auto;
  margin-bottom: 12px;
}

.hero p {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.block-title h2 {
  margin: 0;
}

.card h2,
.card h1 {
  margin: 0 0 14px;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.login-card {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

label.wide {
  grid-column: 1 / -1;
}

label.check {
  align-content: end;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  min-height: 62px;
}

input,
select,
textarea {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 11px;
}

textarea {
  min-height: 88px;
  padding-top: 10px;
  resize: vertical;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stats > div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, white, #edf7ff);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

.finance-stats > div:nth-child(1) {
  background: linear-gradient(145deg, #07111f, #0d4d84);
  color: white;
}

.finance-stats > div:nth-child(1) span {
  color: rgba(255, 255, 255, 0.72);
}

.stats span,
.license-output span,
.muted {
  color: var(--muted);
  font-size: 0.86rem;
}

.stats strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 1.5rem;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

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

.visual-card {
  position: relative;
  overflow: hidden;
}

.visual-card::after {
  content: "";
  position: absolute;
  right: -44px;
  top: -44px;
  width: 160px;
  height: 160px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.18), transparent 62%);
  pointer-events: none;
}

.accent-card::after {
  background: radial-gradient(circle, rgba(255, 157, 0, 0.22), transparent 62%);
}

.compact-form {
  grid-template-columns: 1fr;
}

.bar-chart {
  min-height: 230px;
  display: grid;
  grid-template-columns: repeat(6, minmax(70px, 1fr));
  gap: 12px;
  align-items: end;
  overflow: auto;
  padding-top: 14px;
}

.bar-item {
  display: grid;
  align-items: end;
  justify-items: center;
  gap: 8px;
  min-height: 210px;
}

.bar-value {
  position: relative;
  width: 100%;
  max-width: 74px;
  min-height: 8px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  box-shadow: 0 14px 26px rgba(6, 151, 216, 0.25);
}

.bar-value span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.76rem;
  font-weight: 900;
}

.bar-item strong {
  color: var(--muted);
  font-size: 0.78rem;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

td {
  overflow-wrap: anywhere;
}

.card:has(table) {
  overflow: auto;
}

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

.actions form {
  margin: 0;
}

.mini {
  min-height: 32px;
  font-size: 0.82rem;
}

.mini.danger {
  color: var(--danger);
}

.badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  padding: 0 9px;
  font-size: 0.78rem;
  font-weight: 900;
}

.badge.good {
  color: var(--good);
}

.badge.warn {
  color: var(--warn);
}

.badge.bad {
  color: var(--danger);
}

code {
  display: inline-block;
  padding: 4px 6px;
  border-radius: 6px;
  background: #0b1020;
  color: #d1fae5;
  font-family: Consolas, "Liberation Mono", monospace;
}

.license-output {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbff;
}

.license-output code {
  width: fit-content;
  font-size: 1.15rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 14px;
  color: var(--muted);
}

.admin-body {
  background:
    linear-gradient(180deg, #f7fbff 0%, #eef4fb 100%);
}

.admin-body .shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.admin-body .topbar {
  position: fixed;
  inset: 16px auto 16px 16px;
  width: 272px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 18px;
  padding: 18px;
  border-color: rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(7, 17, 31, 0.98), rgba(9, 31, 52, 0.98));
  color: white;
  overflow: auto;
}

.admin-body .brand {
  color: white;
  font-size: 1.1rem;
}

.admin-body .brand span {
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.08);
}

.admin-body .brand img {
  width: 42px;
  height: 42px;
}

.admin-body nav {
  width: 100%;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: visible;
}

.admin-body nav a,
.admin-body .logout button {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: #cbd5e1;
  box-shadow: none;
}

.admin-body nav a.active,
.admin-body nav a:hover {
  border-color: rgba(0, 240, 255, 0.24);
  background: linear-gradient(135deg, rgba(6, 151, 216, 0.34), rgba(11, 104, 255, 0.26));
  color: white;
}

.admin-body .logout {
  align-self: end;
}

.admin-body .logout button {
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: white;
}

.admin-body .flash,
.admin-body .admin-main,
.admin-body .footer {
  margin-left: 304px;
  margin-right: 24px;
}

.admin-body .flash {
  margin-top: 18px;
}

.admin-body .admin-main {
  padding: 22px 0 0;
}

.admin-body .footer {
  padding-bottom: 22px;
}

.campaign-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(120deg, #ffffff, #edf7ff 54%, #fff7e8);
  box-shadow: var(--shadow);
}

.campaign-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.campaign-hero p:not(.eyebrow) {
  color: var(--muted);
  max-width: 680px;
}

.campaign-hero img {
  width: min(220px, 48vw);
  justify-self: center;
  filter: drop-shadow(0 18px 28px rgba(6, 151, 216, 0.24));
}

.campaign-preview {
  display: grid;
  align-content: start;
  gap: 14px;
}

.desktop-notice-preview {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: 8px;
  background: linear-gradient(90deg, #eafaff, white);
}

.desktop-notice-preview span {
  color: var(--muted);
}

.desktop-notice-preview a {
  width: fit-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: var(--dark);
  color: white;
  font-weight: 900;
  padding: 0 12px;
  text-decoration: none;
}

@media (max-width: 900px) {
  .topbar,
  .auth-grid,
  .admin-hero,
  .finance-hero,
  .split-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .topbar {
    position: static;
    flex-direction: column;
  }

  .admin-body .topbar {
    position: static;
    width: auto;
    margin: 12px;
  }

  .admin-body .flash,
  .admin-body .admin-main,
  .admin-body .footer {
    margin-left: 12px;
    margin-right: 12px;
  }

  .admin-body .admin-main {
    padding-top: 0;
  }

  nav {
    width: 100%;
  }

  .grid-form,
  .stats,
  .campaign-hero {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: clamp(2.4rem, 16vw, 4rem);
  }
}
