:root {
  color-scheme: dark;
  --bg: #05070d;
  --bg-2: #090d16;
  --panel: rgba(14, 20, 32, 0.82);
  --panel-strong: rgba(20, 29, 46, 0.92);
  --panel-soft: rgba(255, 255, 255, 0.045);
  --text: #f8fafc;
  --muted: #94a3b8;
  --subtle: #64748b;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(148, 163, 184, 0.3);
  --accent: #7dd3fc;
  --accent-2: #a78bfa;
  --accent-3: #22d3ee;
  --danger: #fb7185;
  --ok: #34d399;
  --warn: #fbbf24;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  --radius: 26px;
  --radius-sm: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 5%, rgba(125, 211, 252, 0.18), transparent 28%),
    radial-gradient(circle at 85% 0%, rgba(167, 139, 250, 0.16), transparent 30%),
    linear-gradient(180deg, var(--bg), var(--bg-2) 55%, #05070d);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 72%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  max-width: 1220px;
  margin: 0 auto;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  backdrop-filter: blur(18px);
}

.topbar nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.topbar a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.94rem;
}

.topbar nav a {
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
}

.topbar nav a:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text) !important;
  letter-spacing: -0.035em;
  font-weight: 950 !important;
}

.brand::before {
  content: '';
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 28px rgba(125, 211, 252, 0.24);
}

.landing,
.page {
  position: relative;
  max-width: 1220px;
  margin: 0 auto;
  padding: 58px 22px 104px;
}

.hero-block {
  min-height: calc(100vh - 150px);
  display: grid;
  align-content: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 950;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

h1 {
  max-width: 920px;
  font-size: clamp(3.7rem, 10vw, 8.8rem);
}

h2 { font-size: clamp(1.65rem, 3vw, 2.6rem); }
h3 { font-size: 1.12rem; }

.lede,
.muted {
  color: var(--muted);
}

.lede {
  max-width: 640px;
  margin: 24px 0 0;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 40px;
  max-width: 900px;
}

.action-grid.compact { max-width: 460px; }

.big-action,
.panel,
.image-card,
.empty,
.table-wrap {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.big-action::before,
.panel::before,
.image-card::before,
.empty::before,
.table-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.12), transparent 35%, rgba(167, 139, 250, 0.08));
  opacity: 0;
  transition: opacity 180ms ease;
}

.big-action:hover::before,
.image-card:hover::before,
.panel:hover::before { opacity: 1; }

.big-action {
  min-height: 230px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.big-action:hover {
  transform: translateY(-4px);
  border-color: rgba(125, 211, 252, 0.55);
}

.big-action span,
.big-action small {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-weight: 850;
}

.big-action span {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.84rem;
}

.big-action strong {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 360px;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.page-head {
  margin-bottom: 30px;
  display: grid;
  gap: 12px;
}

.page-head h1 { font-size: clamp(3rem, 7vw, 6rem); }

.split {
  display: grid;
  grid-template-columns: minmax(260px, .78fr) minmax(0, 1.22fr);
  gap: 28px;
  align-items: start;
}

.panel {
  padding: 30px;
}

.panel.narrow {
  width: min(520px, calc(100vw - 36px));
}

.center-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.stack {
  display: grid;
  gap: 16px;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 11px 13px;
  background: rgba(5, 7, 13, 0.72);
  color: var(--text);
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input[type='file'] {
  padding: 13px;
}

textarea { resize: vertical; }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(125, 211, 252, 0.75);
  box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.13);
  background: rgba(5, 7, 13, 0.92);
}

.button {
  appearance: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 19px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 950;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, opacity 150ms ease;
}

.button:hover { transform: translateY(-1px); }
.button.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #030712; }
.button.secondary { background: rgba(255, 255, 255, 0.045); color: var(--text); border-color: var(--line); }
.button.secondary:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.07); }

.notice {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-weight: 750;
}
.notice.error { color: #fecdd3; border-color: rgba(251, 113, 133, .4); background: rgba(251, 113, 133, .085); }
.notice.ok { color: #bbf7d0; border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .085); }
.notice.warn { color: #fde68a; border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .085); }

.small { color: var(--subtle); font-size: .9rem; }

.sortbar {
  margin: -4px 0 26px;
  max-width: 270px;
}

.empty {
  padding: 38px;
  margin-top: 24px;
  color: var(--muted);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.image-card {
  transition: transform 180ms ease, border-color 180ms ease;
}

.image-card:hover {
  transform: translateY(-3px);
  border-color: rgba(125, 211, 252, 0.42);
}

.image-card img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--panel-strong);
}

.image-card div {
  position: relative;
  z-index: 1;
  padding: 18px;
}

.image-card h2 {
  font-size: 1.28rem;
}

.image-card p,
.image-card small {
  color: var(--muted);
}

.image-card p { margin-bottom: 10px; }

.table-wrap {
  overflow-x: auto;
}

table {
  position: relative;
  z-index: 1;
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

tr:last-child td { border-bottom: 0; }
th {
  color: var(--subtle);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 950;
}

.user-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 1fr) 150px auto;
  gap: 12px;
  align-items: end;
}

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

.reset-form input { min-width: 170px; }

@media (max-width: 980px) {
  .action-grid,
  .split,
  .image-grid {
    grid-template-columns: 1fr;
  }

  .hero-block {
    min-height: auto;
    padding: 70px 0 40px;
  }

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

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .topbar nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .landing,
  .page {
    padding: 34px 16px 78px;
  }

  .big-action {
    min-height: 178px;
    padding: 24px;
  }

  .panel {
    padding: 24px;
  }

  h1 {
    font-size: clamp(3.1rem, 18vw, 5rem);
  }
}
