/* Society Gate - shared styles for the admin portal and public pages */
:root {
  --brand: #3949ab;
  --brand-dark: #283593;
  --brand-deep: #1a237e;
  --brand-soft: #e8eaf6;
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1b2233;
  --muted: #667085;
  --line: #e6e8f0;
  --ok: #2e7d32;   --ok-soft: #e7f4e8;
  --warn: #e65100; --warn-soft: #fff1e6;
  --bad: #c62828;  --bad-soft: #fdecec;
  --grey-soft: #eef0f4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 12px rgba(16, 24, 40, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5; font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
svg.i { width: 18px; height: 18px; flex: 0 0 auto; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt { margin-top: 16px; }

/* ---------- buttons & inputs ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; border: 1px solid var(--brand); border-radius: 10px;
  padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, box-shadow .15s;
  white-space: nowrap;
}
button:hover { background: var(--brand-dark); }
button:focus-visible { outline: 3px solid rgba(57, 73, 171, .3); outline-offset: 1px; }
button.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
button.secondary:hover { background: var(--grey-soft); }
button.ghost { background: transparent; border-color: transparent; color: var(--brand); padding: 6px 10px; }
button.ghost:hover { background: var(--brand-soft); }
button.danger { background: #fff; color: var(--bad); border-color: #f3c4c4; }
button.danger:hover { background: var(--bad-soft); }
button.block { width: 100%; padding: 12px 16px; }
button:disabled { opacity: .5; cursor: not-allowed; }
label { display: block; font-size: 12.5px; font-weight: 600; color: #344054; margin: 0 0 6px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d0d5dd; border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(57, 73, 171, .15); }
textarea { min-height: 160px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 160px; margin-bottom: 0; }
.msg { margin-top: 12px; font-size: 13.5px; }
.msg:empty { display: none; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--ok); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head p { margin: 2px 0 0; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--grey-soft); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.APPROVED, .pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.DENIED, .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.PENDING, .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.INSIDE { background: var(--brand-soft); color: var(--brand); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 650; background: var(--brand-soft); color: var(--brand); letter-spacing: .02em; }
.tag.GUARD { background: #e0f2f1; color: #00695c; }
.tag.ADMIN { background: #fce4ec; color: #ad1457; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; margin: 0 -20px -20px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 20px; border-top: 1px solid var(--line); vertical-align: middle; }
th { background: #f9fafb; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; border-top: 0; }
tbody tr:hover { background: #fafbff; }
td.empty { text-align: center; color: var(--muted); padding: 36px 20px; }
.person { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.person small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- admin layout ---------- */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--brand-deep), var(--brand-dark)); color: #c5cae9; padding: 20px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: #fff; }
.brand .logo { width: 38px; height: 38px; border-radius: 11px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; }
.brand .logo svg { width: 22px; height: 22px; }
.brand b { display: block; font-size: 16px; }
.brand small { display: block; font-size: 11.5px; color: #9fa8da; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { justify-content: flex-start; background: transparent; border: 0; color: #c5cae9; font-weight: 550; padding: 10px 12px; border-radius: 10px; width: 100%; }
.nav button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav button.active { background: rgba(255, 255, 255, .16); color: #fff; }
.side-foot { margin-top: auto; padding: 12px 8px 0; font-size: 11.5px; color: #9fa8da; border-top: 1px solid rgba(255, 255, 255, .12); }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 32px; background: rgba(244, 246, 251, .9); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 21px; font-weight: 700; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.who { display: flex; align-items: center; gap: 10px; }
.who .name { font-weight: 600; }
.content { padding: 24px 32px 40px; max-width: 1240px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; gap: 14px; align-items: center; }
.stat .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.stat .ico svg { width: 22px; height: 22px; }
.stat.warn .ico { background: var(--warn-soft); color: var(--warn); }
.stat.ok .ico { background: var(--ok-soft); color: var(--ok); }
.stat.teal .ico { background: #e0f2f1; color: #00695c; }
.stat .num { font-size: 26px; font-weight: 750; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.grid-2 > .card + .card { margin-top: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); gap: 10px; }
.list li:first-child { border-top: 0; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(1200px 600px at 10% -10%, #5c6bc0 0%, transparent 60%),
  radial-gradient(900px 500px at 110% 110%, #3949ab 0%, transparent 55%), var(--brand-deep); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 32px; box-shadow: 0 24px 60px rgba(10, 15, 40, .35); }
.auth-card .brand { color: var(--ink); padding: 0 0 20px; }
.auth-card .brand .logo { background: var(--brand); color: #fff; }
.auth-card .brand small { color: var(--muted); }
.auth-card h2 { font-size: 22px; margin-bottom: 4px; }
.auth-foot { margin-top: 20px; text-align: center; font-size: 12px; color: var(--muted); }
.auth-note { color: rgba(255, 255, 255, .7); font-size: 12px; text-align: center; margin-top: 18px; }

/* ---------- public pages ---------- */
.site-head { background: linear-gradient(120deg, var(--brand-deep), var(--brand)); color: #fff; padding: 0 24px; }
.site-head .inner { max-width: 860px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 64px; }
.site-head .brand { padding: 0; }
.site-head nav a { color: #e8eaf6; margin-left: 18px; font-weight: 550; }
.hero { background: linear-gradient(120deg, var(--brand-deep), var(--brand)); color: #fff; padding: 36px 24px 72px; }
.hero .inner { max-width: 860px; margin: 0 auto; }
.hero h1 { font-size: 30px; margin-bottom: 8px; }
.hero p { color: #c5cae9; max-width: 560px; margin: 0; }
.page { max-width: 860px; margin: -48px auto 40px; padding: 0 24px; }
.page.plain { margin-top: 24px; }
.doc h2 { font-size: 17px; margin: 26px 0 8px; }
.doc h2:first-child { margin-top: 0; }
.doc p, .doc li { color: #344054; }
.doc ul { padding-left: 20px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 10px; }
.feature p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.site-foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 8px 24px 32px; }

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 12px; }
  .brand { padding-bottom: 10px; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav button { width: auto; }
  .side-foot { display: none; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .features { grid-template-columns: 1fr; }
  .tablewrap { margin: 0 -20px -20px; }
}

/* ---------- icons (sprite in each page) ---------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg.i { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.search { max-width: 280px; }

/* v1 modules */
button.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.field.grow { flex: 1 1 280px; }
select[multiple] { min-width: 140px; padding: 4px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
code.passcode { font-size: 15px; letter-spacing: 2px; background: #f1f5f9; padding: 3px 8px; border-radius: 6px; font-weight: 600; }
.settings { display: grid; gap: 14px; max-width: 460px; }
.settings .field input { width: 100%; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
label.check input { width: 18px; height: 18px; }
.notice h2 { margin-top: 0; } .notice p { font-size: 17px; line-height: 1.6; }
