:root {
  color-scheme: dark;
  --bg: #050806;
  --bg-soft: #0b120d;
  --panel: #101812;
  --panel-2: #151f17;
  --panel-3: #0d140f;
  --line: #263426;
  --line-strong: #3a5f2d;
  --text: #f1f7ee;
  --muted: #a1b19b;
  --green: #95f20f;
  --green-2: #4fd36b;
  --red: #ff6b6b;
  --yellow: #f7d154;
  --blue: #6db5ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 12%, rgba(149, 242, 15, 0.08), transparent 28%),
    linear-gradient(135deg, #030503 0%, #071008 45%, #020402 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button, input, textarea {
  font: inherit;
}

button {
  border: 1px solid rgba(149, 242, 15, 0.48);
  background: linear-gradient(180deg, rgba(149, 242, 15, 0.24), rgba(54, 99, 24, 0.54));
  color: var(--text);
  border-radius: 7px;
  min-height: 42px;
  padding: 10px 14px;
  cursor: pointer;
}

button:hover { border-color: var(--green); }
button:disabled { cursor: not-allowed; opacity: 0.55; }

button.secondary {
  background: var(--panel-2);
  border-color: var(--line);
}

button.danger {
  background: #3a2024;
  border-color: #95404b;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #080d09;
  color: var(--text);
  border-radius: 7px;
  padding: 11px 12px;
  outline: none;
}

input:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(149, 242, 15, 0.12);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

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

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.15; }
h1 { font-size: 30px; margin-bottom: 2px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  background: #000;
  transition: opacity 280ms ease, visibility 280ms ease;
}

.loading-screen.ready {
  opacity: 0;
  visibility: hidden;
}

.loading-logo {
  width: min(320px, 68vw);
  aspect-ratio: 1;
  object-fit: contain;
}

.loading-status {
  min-height: 28px;
  color: var(--green);
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  padding: 12px 0;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 7px;
}

.brand-name {
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
}

.brand-caption {
  color: var(--green);
  font-size: 12px;
  text-transform: uppercase;
}

.header-copy {
  text-align: center;
  display: grid;
  gap: 4px;
}

.header-copy strong {
  font-size: clamp(26px, 4vw, 48px);
  color: var(--text);
}

.header-copy span {
  color: var(--green);
  font-size: clamp(15px, 2.2vw, 22px);
  font-weight: 700;
}

.header-copy small {
  color: var(--muted);
  font-size: clamp(13px, 1.6vw, 17px);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.landing {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 22px;
  align-items: start;
}

.hero {
  display: grid;
  gap: 18px;
  padding: 22px 0 32px;
}

.hero-title {
  max-width: 760px;
  font-size: clamp(36px, 6vw, 72px);
  margin: 0;
}

.hero-title span {
  color: var(--green);
}

.hero-lead {
  max-width: 780px;
  color: #d6e7d0;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
}

.section-title {
  margin-bottom: 12px;
}

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

.panel {
  background: rgba(16, 24, 18, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel.tight {
  padding: 12px;
  box-shadow: none;
}

.auth-card {
  position: sticky;
  top: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

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

.form.compact {
  max-width: 520px;
}

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

.between {
  justify-content: space-between;
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 14px;
  min-height: 122px;
}

.card.online { border-left-color: var(--green); }
.card.offline { border-left-color: var(--red); }

.metric {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 11px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.metric b {
  font-size: 20px;
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 13px;
}

.pill.good { color: var(--green); }
.pill.bad { color: var(--red); }
.pill.warn { color: var(--yellow); }

.notice {
  min-height: 24px;
  color: var(--yellow);
  overflow-wrap: anywhere;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.feature-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(8, 13, 9, 0.76);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.tabs button.active {
  background: rgba(149, 242, 15, 0.2);
  border-color: var(--green);
}

.qr-video {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
  gap: 12px;
}

.table-wrap {
  overflow: auto;
}

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

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

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

.hidden { display: none !important; }

@media (max-width: 860px) {
  .shell { padding: 12px; }
  .top {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .header-copy { text-align: left; }
  .nav { justify-content: flex-start; }
  .landing { grid-template-columns: 1fr; }
  .auth-card { position: static; }
  .admin-layout { grid-template-columns: 1fr; }
  button { width: 100%; }
  .row button, .nav button { width: auto; }
}

@media (max-width: 520px) {
  .brand-logo { width: 44px; height: 44px; }
  .feature-list, .grid, .dashboard-grid { grid-template-columns: 1fr; }
  .row button, .nav button { width: 100%; }
}
