:root {
  color-scheme: light;
  --blue: #0b63ff;
  --blue-dark: #073b95;
  --ink: #13213a;
  --muted: #64738b;
  --line: #dbe5f2;
  --soft: #f6f9fd;
  --surface: #ffffff;
  --green: #087f5b;
  --green-soft: #e8f7f0;
  --red: #b42318;
  --red-soft: #fff0ed;
  --gray: #eef2f6;
  --shadow: 0 16px 42px rgba(13, 39, 82, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--soft);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

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

img {
  max-width: 100%;
}

.public {
  background: #fff;
}

.public-topbar,
.mobile-appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 12px clamp(14px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  color: var(--blue-dark);
}

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

.brand span {
  font-size: 20px;
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 264px;
  padding: 18px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.sidebar-brand {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 18px 0;
}

.side-nav a,
.ghost,
.nav-actions a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 720;
  cursor: pointer;
}

.side-nav a.active,
.side-nav a:hover,
.ghost:hover,
.nav-actions a:hover {
  background: #eaf2ff;
  color: var(--blue-dark);
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.mobile-appbar {
  display: none;
}

.main {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 58px;
}

.client-shell .main,
.admin-shell .main {
  width: auto;
  max-width: 1320px;
  margin-left: 264px;
  padding: 26px clamp(18px, 3vw, 34px) 60px;
}

.client-shell .main {
  padding-bottom: 112px;
}

.temporary-home,
.auth {
  width: min(620px, calc(100vw - 28px));
  margin: 52px auto;
  padding: clamp(22px, 5vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.temporary-home {
  min-height: 430px;
  display: grid;
  align-content: center;
  justify-items: start;
}

.hero-logo,
.auth-logo {
  width: 82px;
  height: 82px;
  object-fit: contain;
  margin-bottom: 16px;
}

.eyebrow,
.source {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.05;
}

h2 {
  margin: 0;
  font-size: 22px;
}

h3 {
  margin: 0;
  font-size: 18px;
}

p {
  color: var(--muted);
}

.auth h1 {
  font-size: clamp(30px, 4vw, 42px);
}

.auth-hint {
  margin: 10px 0 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.button.secondary {
  background: var(--soft);
}

.button.danger {
  border-color: var(--red-soft);
  background: var(--red-soft);
  color: var(--red);
}

.button.full {
  width: 100%;
}

.button.tiny {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.hero-actions,
.actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-hero,
.section-head,
.panel,
.stat,
.contest-card,
.band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(13, 39, 82, 0.045);
}

.app-hero,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: clamp(18px, 3vw, 28px);
}

.app-hero h1,
.section-head h1 {
  font-size: clamp(30px, 4vw, 48px);
}

.hero-status {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 190px;
}

.hero-status strong {
  font-size: 26px;
  color: var(--blue-dark);
}

.panel {
  margin: 18px 0;
  padding: clamp(16px, 3vw, 24px);
}

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

.panel-head a {
  color: var(--blue-dark);
  font-weight: 800;
}

.stats-grid,
.details-grid,
.cards {
  display: grid;
  gap: 14px;
}

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

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

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

.stat,
.contest-card {
  padding: 16px;
}

.stat strong {
  display: block;
  color: var(--blue-dark);
  font-size: 24px;
  line-height: 1.1;
}

.stat span,
small,
.fineprint {
  color: var(--muted);
}

.stat small {
  display: block;
  margin-top: 4px;
}

.contest-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.contest-card .prize {
  margin: 0;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bonus-panel {
  border-color: #cfe0ff;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  max-width: 100%;
  padding: 0 9px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 850;
  white-space: normal;
}

.badge.green {
  color: var(--green);
  background: var(--green-soft);
}

.badge.gray {
  color: #536271;
  background: var(--gray);
}

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

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.check {
  grid-template-columns: 20px 1fr;
  align-items: start;
  color: var(--ink);
}

.check input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
}

.grid-form .full,
.grid-form button,
.form.two .full,
.check,
label:has(textarea) {
  grid-column: 1 / -1;
}

.demo-box,
.notice,
.empty {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
}

.notice {
  margin: 0 0 18px;
  color: var(--blue-dark);
  border: 1px solid #c7ddff;
  background: #eef5ff;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

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

td small {
  display: block;
  margin-top: 3px;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 12px;
  margin: 0;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
}

.copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.notification-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.notification-list li {
  display: grid;
  gap: 3px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.email-card strong {
  display: block;
  margin: 10px 0;
  font-size: clamp(22px, 4vw, 34px);
  color: var(--blue-dark);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px max(10px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.bottom-nav a {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 54px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bottom-nav span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--gray);
  font-size: 12px;
}

.bottom-nav a.active {
  color: var(--blue);
  background: #eaf2ff;
}

.bottom-nav a.active span {
  background: var(--blue);
  color: #fff;
}

@media (max-width: 1120px) {
  .stats-grid,
  .details-grid,
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-sidebar {
    display: none;
  }

  .mobile-appbar {
    display: flex;
  }

  .client-shell .main,
  .admin-shell .main,
  .main {
    width: min(100% - 22px, 1180px);
    margin: 0 auto;
    padding: 18px 0 112px;
  }

  .admin-shell .main {
    padding-bottom: 40px;
  }

  .client-shell .bottom-nav {
    display: grid;
  }

  .app-hero,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-status {
    justify-items: start;
    width: 100%;
  }

  .stats-grid,
  .details-grid,
  .cards,
  .form.two,
  .grid-form {
    grid-template-columns: 1fr;
  }

  .actions-row,
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .actions-row .button,
  .hero-actions .button,
  .actions-row form,
  .actions-row form .button {
    width: 100%;
  }

  .copy-row,
  dl {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 640px;
  }
}
