:root {
  --bg: #07090f;
  --panel: #10141d;
  --panel-strong: #171d29;
  --panel-soft: #202838;
  --line: rgba(255, 255, 255, 0.14);
  --text: #f7f9fc;
  --muted: #aeb8c8;
  --red: #ed1c24;
  --red-dark: #a30f18;
  --green: #24d17e;
  --gold: #f9b233;
  --radius: 10px;
  font-family:
    Montserrat, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(237, 28, 36, 0.2), transparent 28rem),
    linear-gradient(225deg, rgba(36, 209, 126, 0.13), transparent 30rem),
    var(--bg);
  color: var(--text);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.82), transparent 75%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.auth-shell,
.admin-shell,
.setup-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.auth-shell,
.setup-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: center;
  gap: 32px;
  min-height: 100vh;
  padding: 48px 0;
}

.brand-panel {
  display: grid;
  gap: 18px;
}

.brand-kicker,
.admin-kicker {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-title {
  margin: 0;
  max-width: 680px;
  font-size: clamp(3rem, 8vw, 6.7rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.brand-copy {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.auth-card,
.setup-card,
.admin-card,
.user-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 20, 29, 0.88);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.auth-card,
.setup-card {
  padding: 30px;
}

.card-head {
  margin-bottom: 22px;
}

.card-head h1,
.card-head h2,
.admin-title h1 {
  margin: 0;
}

.card-head h1,
.card-head h2 {
  font-size: 2rem;
}

.card-head p,
.admin-title p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  background: #070a11;
  color: var(--text);
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: rgba(237, 28, 36, 0.8);
  box-shadow: 0 0 0 4px rgba(237, 28, 36, 0.12);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn,
.btn-soft,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: var(--radius);
  padding: 0 16px;
  border: 1px solid transparent;
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.btn {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  box-shadow: 0 16px 34px rgba(237, 28, 36, 0.25);
}

.btn-soft {
  border-color: var(--line);
  background: var(--panel-soft);
}

.btn-danger {
  border-color: rgba(237, 28, 36, 0.42);
  background: rgba(237, 28, 36, 0.16);
}

.btn:hover,
.btn-soft:hover,
.btn-danger:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.alert {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  line-height: 1.5;
}

.alert-error {
  border-color: rgba(237, 28, 36, 0.45);
  background: rgba(237, 28, 36, 0.13);
}

.alert-success {
  border-color: rgba(36, 209, 126, 0.45);
  background: rgba(36, 209, 126, 0.12);
}

.small-note {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.admin-shell {
  padding: 28px 0 48px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-title h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.admin-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.admin-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
}

.admin-card {
  align-self: start;
  padding: 22px;
}

.admin-card h2,
.users-panel h2 {
  margin: 0 0 16px;
}

.users-panel {
  display: grid;
  gap: 12px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 150px 120px auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.user-name {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.user-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  width: max-content;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 0.78rem;
  font-weight: 900;
}

.status-active {
  background: rgba(36, 209, 126, 0.13);
  color: #a8ffd2;
}

.status-off {
  background: rgba(249, 178, 51, 0.13);
  color: #ffd286;
}

.user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .auth-shell,
  .setup-shell,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    padding-top: 8px;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-row {
    grid-template-columns: 1fr;
  }

  .user-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .auth-shell,
  .admin-shell,
  .setup-shell {
    width: min(100% - 22px, 1120px);
  }

  .auth-card,
  .setup-card,
  .admin-card {
    padding: 20px;
  }
}