:root {
  --bg: #030613;
  --panel: rgba(14, 27, 54, 0.74);
  --panel-strong: rgba(20, 39, 78, 0.92);
  --line: rgba(148, 185, 255, 0.18);
  --line-hot: rgba(25, 213, 255, 0.62);
  --text: #edf7ff;
  --muted: #9db0ca;
  --dim: #64738e;
  --cyan: #19d5ff;
  --green: #63f0c2;
  --blue: #5c8dff;
  --amber: #ffd166;
  --violet: #b694ff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(49, 124, 255, .23), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(0, 218, 255, .14), transparent 32%),
    radial-gradient(circle at 50% 100%, rgba(30, 220, 155, .08), transparent 26%),
    linear-gradient(135deg, #030613 0%, #08111f 44%, #040915 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 75%);
}

a { color: inherit; text-decoration: none; }
code { color: #c8f6ff; background: rgba(25,213,255,.08); padding: 2px 6px; border-radius: 7px; }

.orbital {
  position: fixed;
  border: 1px solid rgba(25, 213, 255, .18);
  border-radius: 999px;
  pointer-events: none;
  transform: rotate(-18deg);
}
.orbital-a { width: 54vw; height: 24vw; right: -18vw; top: 12vh; }
.orbital-b { width: 44vw; height: 18vw; left: -14vw; bottom: 8vh; border-color: rgba(99, 240, 194, .16); }

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(148,185,255,.12);
  background: rgba(4, 9, 20, .72);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(28,213,255,.18), rgba(53,119,255,.16));
  border: 1px solid rgba(25,213,255,.25);
  color: #dff8ff;
  font-weight: 900;
  letter-spacing: .08em;
}
.brand strong { display: block; letter-spacing: .02em; }
.brand small { display: block; color: var(--muted); margin-top: 2px; }

.shell { width: min(1240px, calc(100vw - 36px)); margin: 0 auto; padding: 34px 0 56px; }
.shell.narrow { width: min(960px, calc(100vw - 36px)); }

.hero {
  min-height: 260px;
  display: block;
  margin-bottom: 22px;
}

.hero-copy,
.module-card,
.exhibit-band,
.status-panel,
.login-card,
.metrics > div {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 31, 64, .76), rgba(9, 17, 34, .72));
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.hero-copy::before,
.module-card::before,
.login-card::before,
.status-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(25,213,255,.9), transparent);
}

.hero-copy { border-radius: 22px; padding: clamp(28px, 5vw, 56px); display: flex; flex-direction: column; justify-content: center; }
.hero-copy h1 { margin: 0; font-size: clamp(48px, 8vw, 104px); line-height: .88; letter-spacing: 0; max-width: 980px; }
.hero-copy p { margin: 0; max-width: 720px; color: #c5d6eb; line-height: 1.7; font-size: 17px; }

.kicker { display: inline-flex; align-items: center; gap: 10px; color: #9defff; text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 800; }
.kicker span { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 18px var(--green); }

.hero-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(148,185,255,.22);
  background: rgba(255,255,255,.06);
  color: white;
  font-weight: 800;
  transition: transform .18s ease, border .18s ease, background .18s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(25,213,255,.55); background: rgba(25,213,255,.10); }
.btn.primary { background: linear-gradient(135deg, rgba(24,213,255,.92), rgba(53,119,255,.95)); box-shadow: 0 14px 34px rgba(25,213,255,.22); border-color: transparent; }
.btn.ghost { background: rgba(9,18,38,.54); }

@keyframes scan { 0%,100% { top: 18%; opacity: .5; } 50% { top: 82%; opacity: 1; } }

.sort-toolbar {
  min-height: 52px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
.sort-hint { color: var(--muted); font-size: 13px; }
.sort-toggle { min-width: 104px; }
.sort-toggle[aria-pressed="true"] {
  color: #04111d;
  background: var(--cyan);
  border-color: var(--cyan);
}

.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.module-card { min-height: 218px; border-radius: 20px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; transition: transform .2s ease, border-color .2s ease, background .2s ease, opacity .2s ease; touch-action: pan-y; cursor: pointer; }
.module-card:hover { transform: translateY(-4px); border-color: var(--line-hot); background: linear-gradient(180deg, rgba(23, 48, 92, .82), rgba(9, 17, 34, .74)); }
.is-editing .module-card {
  touch-action: none;
  user-select: none;
  cursor: grab;
  border-style: dashed;
}
.is-editing .module-card:active { cursor: grabbing; }
.module-card.is-dragging {
  opacity: .54;
  border-color: var(--line-hot);
  background: linear-gradient(180deg, rgba(25, 213, 255, .16), rgba(9, 17, 34, .72));
  pointer-events: none;
}
.is-sorting .module-card { transition: transform .12s ease, border-color .12s ease, background .12s ease, opacity .12s ease; }
.is-sorting .module-card:hover { transform: none; }
.module-topline, .module-meta { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: var(--muted); font-size: 12px; }
.chip { border: 1px solid rgba(25,213,255,.28); background: rgba(25,213,255,.08); color: #c8f6ff; padding: 6px 9px; border-radius: 999px; font-weight: 900; letter-spacing: .1em; }
.state { color: var(--green); font-weight: 900; letter-spacing: .12em; }
.module-card h2 { margin: 22px 0 10px; font-size: 27px; line-height: 1.05; }
.module-card p { margin: 0; color: #c5d6eb; line-height: 1.52; }
.accent-green .chip { border-color: rgba(99,240,194,.32); background: rgba(99,240,194,.09); color: #ccfff0; }
.accent-blue .chip { border-color: rgba(92,141,255,.34); background: rgba(92,141,255,.11); color: #dbe5ff; }
.accent-amber .chip { border-color: rgba(255,209,102,.34); background: rgba(255,209,102,.10); color: #ffe8a6; }
.accent-violet .chip { border-color: rgba(182,148,255,.34); background: rgba(182,148,255,.10); color: #eadfff; }

.footer { padding: 28px; text-align: center; color: var(--dim); font-size: 13px; }

.login-shell { min-height: calc(100vh - 58px); display: grid; place-items: center; padding: 28px; }
.login-card { width: min(520px, calc(100vw - 32px)); border-radius: 22px; padding: 28px; }
.login-card h1 { margin: 14px 0 10px; font-size: clamp(34px, 7vw, 58px); line-height: .96; }
.login-card p { color: #c5d6eb; line-height: 1.6; margin: 0 0 22px; }
.back { color: var(--muted); font-size: 13px; }
label { display: block; color: var(--muted); margin-bottom: 8px; font-size: 12px; letter-spacing: .13em; text-transform: uppercase; }
input {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(148,185,255,.24);
  background: rgba(4,9,20,.72);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  outline: none;
  margin-bottom: 14px;
}
input:focus { border-color: rgba(25,213,255,.62); box-shadow: 0 0 0 4px rgba(25,213,255,.10); }
.error { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,111,145,.35); color: #ffd8e2; background: rgba(255,111,145,.10); }
.login-card .btn { width: 100%; }
.login-meta { margin-top: 16px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }

.status-panel { border-radius: 22px; padding: 24px; }
.status-panel h1 { margin: 0 0 18px; font-size: 42px; }
table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 16px; }
th, td { padding: 12px; border-bottom: 1px solid rgba(148,185,255,.12); text-align: left; color: #c5d6eb; }
th { color: #9defff; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }

@media (max-width: 980px) {
  .hero { min-height: auto; }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .nav { align-items: flex-start; padding: 12px 16px; }
  .shell { width: min(100vw - 24px, 1240px); padding-top: 20px; }
  .hero-copy { padding: 26px 20px; }
  .sort-toolbar { justify-content: space-between; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 196px; }
  .login-shell { padding: 16px; }
  .login-meta { flex-direction: column; }
}
