* {
  box-sizing: border-box;
}

:root {
  --bg: #05070c;
  --bg-soft: #090d14;
  --sidebar: rgba(13, 18, 29, 0.92);
  --panel: rgba(17, 24, 39, 0.78);
  --panel-2: rgba(21, 30, 47, 0.78);
  --panel-3: #090e17;

  --border: rgba(148, 163, 184, 0.14);
  --border-bright: rgba(45, 212, 191, 0.35);

  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;

  --green: #2dd4bf;
  --blue: #38bdf8;
  --purple: #8b5cf6;
  --red: #ef4444;
  --orange: #f59e0b;

  --shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

/* =========================
   LOCK ADMIN WHEN LOGGED OUT
========================= */

body.logged-out .sidebar,
body.logged-out .topbar,
body.logged-out #adminView {
  display: none !important;
}

body.logged-out .admin-shell {
  display: block;
}

body.logged-out .main {
  padding: 0;
  min-height: 100vh;
}

/* =========================
   BASE
========================= */

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(45, 212, 191, 0.16), transparent 28rem),
    radial-gradient(circle at 90% 20%, rgba(56, 189, 248, 0.13), transparent 32rem),
    radial-gradient(circle at 50% 90%, rgba(139, 92, 246, 0.08), transparent 35rem),
    linear-gradient(180deg, #05070c 0%, #080c14 50%, #05070c 100%);
  overflow-x: hidden;
}

/* Subtle grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.75), transparent 75%);
}

/* Glow orb */
body::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: 720px;
  height: 720px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(45, 212, 191, 0.16), transparent 68%);
  pointer-events: none;
  z-index: 0;
}

/* =========================
   LAYOUT
========================= */

.admin-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 15px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.008)),
    var(--sidebar);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  box-shadow: 20px 0 70px rgba(0, 0, 0, 0.3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 30px;
  padding: 8px;
  border-radius: 16px;
  transition: 0.22s ease;
}

.brand:hover {
  background: rgba(255,255,255,0.055);
  transform: translateY(-1px);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #03131f;
  font-weight: 950;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow:
    0 0 30px rgba(45, 212, 191, 0.32),
    inset 0 1px 0 rgba(255,255,255,0.35);
}

.brand h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.brand h1 span {
  color: var(--green);
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
}

.nav-label {
  margin: 22px 10px 9px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.side-nav {
  flex: 1;
}

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #a8b3cf;
  padding: 12px 14px;
  border-radius: 13px;
  cursor: pointer;
  text-align: left;
  margin-bottom: 6px;
  font-weight: 800;
  transition: 0.2s ease;
}

.nav-item:hover {
  background: rgba(255,255,255,0.055);
  color: #fff;
  border-color: rgba(255,255,255,0.06);
}

.nav-item.active {
  color: var(--green);
  background:
    linear-gradient(90deg, rgba(45, 212, 191, 0.16), rgba(45, 212, 191, 0.045));
  border-color: rgba(45, 212, 191, 0.2);
  box-shadow:
    inset 3px 0 0 var(--green),
    0 12px 28px rgba(45, 212, 191, 0.08);
}

.logout-btn {
  margin-top: auto;
  border: 1px solid rgba(239,68,68,0.22);
  background: rgba(239,68,68,0.08);
  color: #ff9b9b;
  padding: 13px 14px;
  border-radius: 13px;
  cursor: pointer;
  text-align: left;
  font-weight: 900;
  transition: 0.2s ease;
}

.logout-btn:hover {
  background: rgba(239,68,68,0.15);
  transform: translateY(-1px);
}

/* =========================
   MAIN
========================= */

.main {
  min-width: 0;
  padding: 34px clamp(24px, 4vw, 56px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  margin-bottom: 30px;
}

.topbar h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.055em;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.admin-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015)),
    var(--panel);
  border: 1px solid var(--border);
  padding: 11px 15px;
  border-radius: 999px;
  font-weight: 900;
  box-shadow: 0 15px 45px rgba(0,0,0,0.25);
}

.online-dot {
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.95);
}

/* =========================
   PAGE VISIBILITY
========================= */

.page {
  display: none;
}

.active-page {
  display: block;
}

.hidden {
  display: none !important;
}

/* =========================
   PREMIUM LOGIN
========================= */

.login-card {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 5;
  transform: translate(-50%, -50%);

  width: min(92vw, 460px);
  padding: 38px;

  background:
    linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.025)),
    rgba(17, 24, 39, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 26px;
  backdrop-filter: blur(20px);
  box-shadow:
    0 35px 110px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(255,255,255,0.07);
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  background:
    radial-gradient(circle at top left, rgba(45,212,191,0.28), transparent 16rem),
    radial-gradient(circle at bottom right, rgba(56,189,248,0.18), transparent 15rem);
  pointer-events: none;
  opacity: 0.85;
}

.login-card::after {
  content: "FiveM Atlas";
  position: absolute;
  right: 26px;
  top: 22px;
  color: rgba(148, 163, 184, 0.16);
  font-weight: 950;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card > * {
  position: relative;
  z-index: 1;
}

.login-card h2 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.login-card p {
  margin: 0 0 24px;
  color: #b9c6dc;
  line-height: 1.55;
}

.login-card input {
  width: 100%;
  margin-bottom: 13px;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(5, 9, 16, 0.72);
  color: white;
  outline: none;
  font-size: 14px;
  transition: 0.2s ease;
}

.login-card input:focus {
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.09);
}

.login-card input::placeholder {
  color: #7c8799;
}

.login-card button {
  width: 100%;
  margin-top: 6px;
  padding: 14px;
  border-radius: 15px;
  border: none;
  cursor: pointer;
  font-weight: 950;
  color: #03131f;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 18px 45px rgba(56,189,248,0.22);
  transition: 0.2s ease;
}

.login-card button:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 60px rgba(56,189,248,0.34);
}

.message {
  margin-top: 14px !important;
  color: #ff9b9b !important;
  font-weight: 700;
}

/* =========================
   DASHBOARD WELCOME
========================= */

.welcome-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background:
    linear-gradient(90deg, rgba(45, 212, 191, 0.15), transparent 45%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018)),
    var(--panel);
  border-left: 4px solid var(--green);
  border-radius: 22px;
  padding: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}

.welcome-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.13), transparent 24rem);
  pointer-events: none;
}

.welcome-card > * {
  position: relative;
  z-index: 1;
}

.welcome-card h3 {
  margin: 0;
  font-size: 27px;
  letter-spacing: -0.045em;
}

.welcome-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, 108px);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(5, 9, 16, 0.42);
  backdrop-filter: blur(10px);
}

.mini-stats div {
  padding: 17px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.mini-stats div:last-child {
  border-right: 0;
}

.mini-stats strong {
  display: block;
  color: var(--green);
  font-size: 26px;
  line-height: 1;
}

.mini-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

/* =========================
   PANELS / GRIDS
========================= */

.grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 22px;
}

.panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(45, 212, 191, 0.08), transparent 22rem);
  pointer-events: none;
}

.panel > * {
  position: relative;
  z-index: 1;
}

.panel h3 {
  margin: 0 0 16px;
  font-size: 19px;
  letter-spacing: -0.025em;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

/* =========================
   LIST CARDS
========================= */

.list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.list-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01)),
    var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 15px;
  transition: 0.2s ease;
}

.list-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
}

.list-card-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
}

.list-card h4 {
  margin: 0;
  font-size: 15px;
}

.list-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.empty {
  color: var(--muted);
  margin: 0;
}

/* =========================
   FORMS
========================= */

input {
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 11px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(5, 9, 16, 0.72);
  color: white;
  outline: none;
  transition: 0.2s ease;
}

input:focus {
  border-color: rgba(45, 212, 191, 0.58);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.08);
}

input::placeholder {
  color: #717d90;
}

.wide-input {
  margin: 6px 0 18px;
}

/* =========================
   BUTTONS
========================= */

button,
.actions a {
  border: none;
  cursor: pointer;
  font-weight: 900;
  border-radius: 13px;
  padding: 10px 14px;
  transition: 0.2s ease;
  font-family: inherit;
}

button:hover,
.actions a:hover {
  transform: translateY(-1px);
}

.primary-btn {
  color: #03131f;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 14px 34px rgba(56,189,248,0.18);
}

.primary-btn:hover {
  box-shadow: 0 18px 44px rgba(56,189,248,0.28);
}

.danger-btn {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ffcaca;
}

.panel-head button,
.quick-grid button {
  background: rgba(255, 255, 255, 0.045);
  color: #cbd5e1;
  border: 1px solid var(--border);
}

.panel-head button:hover,
.quick-grid button:hover {
  border-color: rgba(45, 212, 191, 0.5);
  color: var(--green);
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.quick-grid button {
  min-height: 62px;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.012)),
    var(--panel-2);
}

/* =========================
   ACTION BUTTONS
========================= */

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.actions button,
.actions a {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  color: white;
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
}

.actions button:hover,
.actions a:hover {
  border-color: rgba(45, 212, 191, 0.5);
}

.actions .approve {
  color: var(--green);
}

.actions .reject,
.actions .delete {
  color: #ff8a8a;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 950;
  background: rgba(45, 212, 191, 0.12);
  color: var(--green);
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 12px rgba(45,212,191,0.9);
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1100px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .main {
    padding: 24px 18px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .welcome-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .mini-stats {
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }

  .mini-stats div:nth-child(2) {
    border-right: 0;
  }

  .mini-stats div:nth-child(1),
  .mini-stats div:nth-child(2) {
    border-bottom: 1px solid var(--border);
  }
}

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

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .list-card-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-card {
    padding: 28px;
  }

  .login-card h2 {
    font-size: 30px;
  }
}

/* Partnerships Admin */
.partners-admin-grid textarea,
.partners-admin-grid select,
.partners-admin-grid input {
  width: 100%;
}

.field-label {
  display: block;
  margin: 13px 0 7px;
  color: #8fa7bf;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.partners-admin-grid textarea,
.partners-admin-grid select {
  background: rgba(255,255,255,.04);
  color: #eef7ff;
  border: 1px solid rgba(64,205,255,.18);
  border-radius: 12px;
  padding: 12px;
  outline: none;
  resize: vertical;
}

.admin-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.admin-form-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px 0;
}

.admin-check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(64,205,255,.15);
  background: rgba(255,255,255,.035);
  border-radius: 12px;
  color: #d9edff;
  font-weight: 800;
}

.admin-check input { width: auto; accent-color: #19d8ff; }
.form-message { min-height: 20px; color: #19d8ff; font-weight: 800; }
.partner-admin-card { border-left: 3px solid #19d8ff; }
.partner-admin-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.partner-admin-pill { font-size: 11px; font-weight: 900; text-transform: uppercase; border: 1px solid rgba(64,205,255,.22); color: #bff5ff; padding: 5px 8px; border-radius: 999px; background: rgba(64,205,255,.06); }
@media (max-width: 850px) { .admin-form-row, .admin-form-row.three { grid-template-columns: 1fr; } }


/* ===== Founder/Admin Expansion ===== */
.analytics-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:12px;
}
.admin-stat-card {
  border:1px solid rgba(39,212,255,.2);
  background:linear-gradient(135deg,rgba(39,212,255,.08),rgba(168,85,247,.06));
  border-radius:16px;
  padding:14px;
}
.admin-stat-card span {
  display:block;
  color:#94a3b8;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.admin-stat-card strong {
  display:block;
  margin-top:6px;
  color:#fff;
  font-size:28px;
}
.admin-note {
  color:#94a3b8;
  font-size:13px;
  line-height:1.5;
  margin:0 0 14px;
}
.founder-panel .panel {
  border-color:rgba(250,204,21,.22);
  box-shadow:0 0 38px rgba(250,204,21,.04);
}
.admin-pill span:last-child,
#adminRoleLabel {
  font-weight:900;
}


/* ===== Admin hotfix: scroll, form controls, and founder branding ===== */
html, body { height: 100%; }
body:not(.logged-out) { overflow: hidden; }
body.logged-out { overflow: auto; }
.admin-shell { height: 100vh; min-height: 0; }
.sidebar { min-height: 0; overflow: hidden; }
.brand { flex-shrink: 0; }
.side-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(56,189,248,.45) rgba(15,23,42,.35); }
.side-nav::-webkit-scrollbar { width: 8px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(56,189,248,.45); border-radius: 999px; }
.side-nav::-webkit-scrollbar-track { background: rgba(15,23,42,.35); }
.logout-btn { flex-shrink: 0; }
.main { height: 100vh; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }

input, textarea, select {
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 11px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(5, 9, 16, 0.72);
  color: white;
  outline: none;
  transition: 0.2s ease;
  font: inherit;
}
textarea { min-height: 116px; resize: vertical; line-height: 1.45; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
input:focus, textarea:focus, select:focus { border-color: rgba(45, 212, 191, 0.58); box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.08); }
input::placeholder, textarea::placeholder { color: #717d90; }
.admin-form-row > * { min-width: 0; }
.admin-check input { width: auto; margin: 0; }
.brand-mark.has-global-pfp { background-size: cover !important; background-position: center !important; color: transparent !important; font-size: 0 !important; }
