:root {
  color-scheme: dark;
  --acid: #b6ff00;
  --acid-soft: rgba(182, 255, 0, .14);
  --ink: #f4f4ef;
  --muted: #97978f;
  --panel: rgba(16, 17, 15, .88);
  --line: rgba(255, 255, 255, .1);
  --danger: #ff5266;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #070807;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 86%);
}

.ambient {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -15%, rgba(182,255,0,.17), transparent 34rem),
    radial-gradient(circle at 100% 80%, rgba(182,255,0,.07), transparent 28rem);
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.eyebrow {
  margin: 0 0 11px;
  color: var(--acid);
  font-size: .73rem;
  font-weight: 850;
  letter-spacing: .17em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2.35rem, 6vw, 4.8rem); line-height: .94; letter-spacing: -.055em; }
h2 { margin-bottom: 22px; font-size: 1.25rem; }

.login-shell {
  display: grid;
  min-height: 100vh;
  padding: 26px;
  place-items: center;
}

.login-card {
  width: min(100%, 480px);
  padding: clamp(28px, 6vw, 50px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(0,0,0,.45), 0 0 70px rgba(182,255,0,.035);
  backdrop-filter: blur(16px);
}

.login-logo {
  display: block;
  width: min(270px, 78%);
  max-height: 120px;
  margin: 0 0 38px;
  object-fit: contain;
  object-position: left center;
}

.login-card h1 { font-size: clamp(2.25rem, 9vw, 3.7rem); }
.login-intro { margin: 18px 0 30px; color: var(--muted); line-height: 1.55; }

.login-form, .admin-form { display: grid; gap: 10px; }
.login-form label, .admin-form label { margin-top: 8px; color: #bdbdb7; font-size: .78rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }

input, select {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 11px;
  outline: none;
  background: rgba(0,0,0,.34);
  transition: border-color .18s ease, box-shadow .18s ease;
}

input:focus, select:focus { border-color: var(--acid); box-shadow: 0 0 0 3px rgba(182,255,0,.1); }

.primary-button {
  min-height: 52px;
  margin-top: 14px;
  padding: 0 20px;
  color: #070807;
  border: 0;
  border-radius: 11px;
  background: var(--acid);
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease;
}

.primary-button:hover { transform: translateY(-2px); filter: brightness(1.08); }

.notice { padding: 13px 15px; border: 1px solid; border-radius: 11px; font-size: .9rem; line-height: 1.4; }
.notice-error { color: #ffacb6; border-color: rgba(255,82,102,.35); background: rgba(255,82,102,.09); }
.notice-success { color: var(--acid); border-color: rgba(182,255,0,.3); background: rgba(182,255,0,.08); }

.dashboard-shell {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.dashboard-logo { display: block; width: min(210px, 46vw); height: 60px; object-fit: contain; object-position: left center; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.current-user { color: var(--muted); font-size: .84rem; }

.ghost-button, .logout-button {
  min-height: 38px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.035);
  cursor: pointer;
}

.ghost-button:hover { border-color: var(--acid); }

.hub-nav { display: flex; gap: 8px; margin-top: 22px; }
.hub-nav a { padding: 10px 15px; color: var(--muted); border-radius: 9px; font-size: .9rem; font-weight: 750; text-decoration: none; }
.hub-nav a:hover, .hub-nav a.active { color: #080808; background: var(--acid); }

.dashboard-shell > .notice { margin-top: 24px; }

.section-heading { max-width: 760px; padding: clamp(42px, 8vw, 82px) 0 38px; }
.section-heading p:last-child { margin: 18px 0 0; color: var(--muted); font-size: 1.05rem; }

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.app-card {
  position: relative;
  display: flex;
  aspect-ratio: 1;
  min-width: 0;
  padding: clamp(22px, 3vw, 32px);
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(24,26,21,.97), rgba(12,13,11,.97));
  box-shadow: 0 22px 60px rgba(0,0,0,.25);
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.app-card::after {
  content: "";
  position: absolute;
  right: -35%;
  bottom: -45%;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--acid);
  opacity: .04;
  filter: blur(16px);
}

.app-card:hover, .app-card:focus-visible { transform: translateY(-6px); border-color: var(--acid); box-shadow: 0 28px 75px rgba(0,0,0,.36), 0 0 35px rgba(182,255,0,.07); outline: none; }

.app-icon {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  color: #070807;
  border-radius: 19px;
  background: var(--acid);
}

.app-icon svg { width: 43px; height: 43px; fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.app-copy { display: grid; gap: 8px; margin-top: auto; padding-top: 32px; }
.app-copy strong { max-width: 90%; font-size: clamp(1.35rem, 2.6vw, 2rem); line-height: 1.05; letter-spacing: -.035em; }
.app-copy small { color: var(--muted); font-size: .92rem; }
.open-arrow { position: absolute; top: 28px; right: 28px; color: var(--acid); font-size: 1.35rem; font-weight: 900; }

.user-layout { display: grid; grid-template-columns: minmax(280px, .78fr) minmax(0, 1.4fr); align-items: start; gap: 22px; }
.panel, .user-card { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.panel { padding: 26px; }
.users-list { display: grid; gap: 12px; }
.user-card { padding: 18px; }

.user-summary { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 14px; }
.avatar { display: grid; width: 48px; height: 48px; place-items: center; color: #070807; border-radius: 13px; background: var(--acid); font-weight: 950; }
.user-summary strong, .user-summary small { display: block; }
.user-summary small { margin-top: 5px; color: var(--muted); font-size: .8rem; }
.user-state { width: 9px; height: 9px; border-radius: 50%; background: #666; }
.user-state.online { background: var(--acid); box-shadow: 0 0 13px var(--acid); }

.user-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.user-actions details { margin-right: auto; }
.user-actions summary { color: var(--muted); font-size: .8rem; cursor: pointer; }
.inline-form { display: flex; gap: 8px; margin-top: 11px; }
.inline-form input { min-height: 40px; }
.inline-form button, .small-button { min-height: 38px; padding: 0 12px; white-space: nowrap; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.045); cursor: pointer; }
.small-button.danger { color: #ff9aa6; border-color: rgba(255,82,102,.28); }

@media (max-width: 820px) {
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-layout { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .login-shell { padding: 12px; }
  .login-card { padding: 26px 22px; border-radius: 20px; }
  .dashboard-shell { width: min(100% - 24px, 1120px); padding-top: 14px; }
  .topbar { align-items: flex-start; }
  .topbar-actions { align-items: flex-end; flex-direction: column; gap: 6px; }
  .current-user { display: none; }
  .section-heading { padding: 42px 0 28px; }
  .app-grid { grid-template-columns: 1fr; }
  .app-card { aspect-ratio: 1.15; }
  .user-actions { align-items: stretch; flex-wrap: wrap; }
  .user-actions details { width: 100%; margin: 0; }
  .inline-form { flex-direction: column; }
}
