:root {
  --bg: #090b0f;
  --panel: #121720;
  --panel-2: #171e29;
  --line: #2a3444;
  --text: #f4f7fb;
  --muted: #9da9b8;
  --accent: #d5a94e;
  --accent-2: #f0d08a;
  --danger: #d45656;
  --success: #57b981;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(213,169,78,.12), transparent 32rem),
    linear-gradient(135deg, #080a0e, #0c1118 55%, #080a0e);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  background: rgba(9,11,15,.88);
  border-bottom: 1px solid rgba(213,169,78,.22);
  backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: .8rem; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
  background: rgba(213,169,78,.08);
  box-shadow: 0 0 30px rgba(213,169,78,.12);
}
.brand-mark span { transform: rotate(-45deg); font-weight: 900; color: var(--accent-2); }
.brand h1 { margin: 0; font-size: 1rem; letter-spacing: .14em; text-transform: uppercase; }
.brand p { margin: .15rem 0 0; color: var(--muted); font-size: .78rem; }

.page-shell { width: min(1240px, calc(100% - 2rem)); margin: 0 auto; padding: 3rem 0 5rem; }
.hero { text-align: center; padding: 3rem 1rem 4rem; }
.eyebrow { color: var(--accent-2); text-transform: uppercase; letter-spacing: .28em; font-size: .72rem; font-weight: 800; }
.hero h2 { margin: .8rem auto; max-width: 800px; font-size: clamp(2.2rem, 6vw, 5rem); line-height: .98; letter-spacing: -.05em; }
.hero p { margin: 1.2rem auto 0; max-width: 650px; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }

.gang-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.25rem; }
.gang-card {
  position: relative;
  overflow: hidden;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(23,30,41,.96), rgba(14,18,25,.97));
  box-shadow: 0 16px 48px rgba(0,0,0,.28);
}
.gang-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(var(--accent-2), var(--accent));
}
.gang-card h3 { margin: 0 0 1.2rem; font-size: 1.45rem; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.stat { padding: .9rem; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.05); }
.stat-label { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; }
.stat-value { display: block; margin-top: .35rem; font-size: 1.05rem; font-weight: 800; }
.members { margin-top: 1.1rem; }
.members h4 { margin: 0 0 .7rem; color: var(--accent-2); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.member-list { display: flex; flex-wrap: wrap; gap: .45rem; }
.member-chip { padding: .45rem .7rem; border-radius: 999px; background: #222b38; border: 1px solid #303b4c; color: #e7edf5; font-size: .83rem; }
.empty-state { padding: 4rem 1rem; text-align: center; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); }

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: .72rem 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-primary { color: #17120a; background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.btn-secondary { color: var(--text); background: #202938; border-color: #344052; }
.btn-danger { color: white; background: rgba(212,86,86,.16); border-color: rgba(212,86,86,.5); }
.btn-link { color: var(--accent-2); background: transparent; border-color: rgba(213,169,78,.35); }

.admin-layout { display: grid; grid-template-columns: 350px 1fr; gap: 1.25rem; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 18px; background: rgba(18,23,32,.94); box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.2rem; border-bottom: 1px solid var(--line); }
.panel-header h2, .panel-header h3 { margin: 0; }
.panel-body { padding: 1.2rem; }
.sticky-panel { position: sticky; top: 86px; }

.form-grid { display: grid; gap: .85rem; }
.field { display: grid; gap: .38rem; }
.field label { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.field input {
  width: 100%;
  padding: .78rem .85rem;
  border-radius: 10px;
  color: var(--text);
  background: #0c1016;
  border: 1px solid #303a49;
  outline: none;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(213,169,78,.1); }
.member-editor { display: grid; gap: .55rem; }
.member-row { display: grid; grid-template-columns: 1fr auto; gap: .55rem; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .35rem; }

.admin-gang-list { display: grid; gap: 1rem; }
.admin-gang-card { padding: 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.admin-gang-card header { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.admin-gang-card h3 { margin: 0; }
.admin-gang-card p { margin: .3rem 0 0; color: var(--muted); }
.card-actions { display: flex; gap: .45rem; }

.login-wrap { min-height: calc(100vh - 75px); display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: min(430px, 100%); }
.notice { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.notice-error { color: #ffd8d8; background: rgba(212,86,86,.12); border: 1px solid rgba(212,86,86,.35); }
.notice-success { color: #d9ffe8; background: rgba(87,185,129,.12); border: 1px solid rgba(87,185,129,.35); }
.hidden { display: none !important; }
.muted { color: var(--muted); }

@media (max-width: 850px) {
  .admin-layout { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .topbar { align-items: flex-start; }
}
