/* ============================================================
   THE RELIANCE — ADMIN
   Same language as the Seuil (landing): Cormorant + IBM Plex Mono,
   palette froide lunaire, halos diffus, fil signature.

   No Tailwind. No CDN. One file, autonomous.
   ============================================================ */

:root {
  --void: #010103;
  --void-2: #0a0b0e;
  --void-3: #14151a;
  --light: #e8ebf0;
  --glow: 224, 230, 238;       /* white-cool tint */
  --gold: 224, 234, 245;        /* cool lunar accent */
  --muted: #6b6f76;
  --faint: #3c3f45;
  --green: 110, 180, 142;
  --amber: 215, 175, 115;
  --red: 200, 105, 105;
  --line-w: 1px;

  --font-display: 'Cormorant', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
}

body.reliance-admin {
  background: var(--void);
  color: var(--light);
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

body.reliance-admin::selection,
body.reliance-admin *::selection {
  background: rgba(var(--gold), 0.4);
  color: var(--light);
}

body.reliance-admin::before {
  content: ""; position: fixed; inset: 0;
  background:
    radial-gradient(120% 80% at 50% 18%, rgba(var(--glow), 0.03) 0%, transparent 55%),
    radial-gradient(100% 100% at 50% 50%, transparent 55%, rgba(0,0,0,0.7) 100%);
  pointer-events: none; z-index: 1;
}

body.reliance-admin::after {
  content: ""; position: fixed; inset: 0;
  pointer-events: none; z-index: 2; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Signature vertical thread — between sidebar and main */
.thread-v {
  position: fixed;
  top: 0;
  left: 240px;
  width: var(--line-w);
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(var(--glow), 0.18) 12%,
    rgba(var(--glow), 0.08) 50%,
    rgba(var(--glow), 0.18) 88%,
    transparent 100%
  );
  box-shadow: 0 0 14px 1px rgba(var(--gold), 0.06);
  z-index: 5; pointer-events: none;
}

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

/* ============================================================
   SIDEBAR
   ============================================================ */
.side {
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,0.012) 0%, transparent 100%);
  overflow: auto;
}
.side::-webkit-scrollbar { width: 6px; }
.side::-webkit-scrollbar-thumb { background: rgba(var(--glow), 0.08); }

.wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: 0.14em;
  background: linear-gradient(180deg, rgb(248,251,255) 0%, rgb(212,222,231) 46%, rgb(150,164,176) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: rgb(206, 218, 228);
  text-shadow: 0 0 18px rgba(var(--glow), 0.18);
  margin-bottom: 4px;
  text-decoration: none;
  display: block;
}
.wordmark-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 48px;
}

.nav-section { margin-bottom: 32px; }
.nav-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
}
.nav-i {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 300;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color 0.4s ease, letter-spacing 0.4s ease;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.nav-i:hover { color: var(--light); letter-spacing: 0.03em; }
.nav-i.active { color: var(--light); }
.nav-i.active::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 50%;
  width: 3px;
  height: 18px;
  background: rgba(var(--gold), 0.55);
  transform: translateY(-50%);
  box-shadow: 0 0 10px rgba(var(--gold), 0.4);
}
.nav-i .gly {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  width: 12px;
  display: inline-block;
  transition: color 0.4s ease;
}
.nav-i:hover .gly, .nav-i.active .gly { color: rgba(var(--gold), 0.7); }

.nav-spacer { flex: 1; }

.side-foot {
  border-top: var(--line-w) solid rgba(var(--glow), 0.06);
  padding-top: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  position: relative;
}
.side-foot .ava {
  width: 32px;
  height: 32px;
  background: var(--void-2);
  border: var(--line-w) solid rgba(var(--glow), 0.12);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(var(--gold), 0.8);
  letter-spacing: 0.1em;
}
.side-foot .who { flex: 1; min-width: 0; }
.side-foot .who .nm {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
  color: var(--light);
}
.side-foot .who .rl {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 2px;
}
.side-foot .logout-form { margin: 0; }
.side-foot .logout-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 4px 0;
  transition: color 0.4s ease;
}
.side-foot .logout-btn:hover { color: rgba(var(--red), 0.9); }

/* ============================================================
   MAIN — content area
   ============================================================ */
.main {
  overflow: auto;
  padding: 56px 64px 80px;
  position: relative;
}
.main::-webkit-scrollbar { width: 8px; }
.main::-webkit-scrollbar-thumb { background: rgba(var(--glow), 0.08); }

.main::before {
  content: "";
  position: absolute;
  left: 50%; top: -40px;
  transform: translateX(-50%);
  width: 700px; height: 200px;
  background: radial-gradient(60% 80% at 50% 50%, rgba(var(--glow), 0.045), transparent 70%);
  pointer-events: none; z-index: 0;
}

.crumb {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}
.crumb .dot { color: rgba(var(--gold), 0.5); margin: 0 8px; }
.crumb a { color: var(--faint); text-decoration: none; transition: color 0.4s ease; }
.crumb a:hover { color: rgba(var(--gold), 0.8); }

.pg-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 4vw, 44px);
  letter-spacing: 0.06em;
  color: var(--light);
  background: linear-gradient(180deg, rgb(248,251,255) 0%, rgb(212,222,231) 56%, rgb(160,170,182) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 24px rgba(var(--glow), 0.15);
  line-height: 1.1;
  position: relative; z-index: 1;
  margin: 0;
}
.pg-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--muted);
  margin: 14px 0 0;
  max-width: 540px;
  position: relative; z-index: 1;
}

.h-thread {
  height: var(--line-w);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(var(--glow), 0.18) 20%,
    rgba(var(--glow), 0.18) 80%,
    transparent 100%
  );
  margin: 48px 0 40px;
  position: relative; z-index: 1;
  border: none;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  position: relative;
  z-index: 1;
}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; position: relative; z-index: 1; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; margin-top: 48px; position: relative; z-index: 1; }
.grid-2.equal { grid-template-columns: 1fr 1fr; }

.stat {
  padding: 28px 26px 30px;
  background: rgba(255,255,255,0.018);
  border: var(--line-w) solid rgba(var(--glow), 0.08);
  position: relative;
  transition: border-color 0.6s ease;
}
.stat:hover { border-color: rgba(var(--gold), 0.25); }
.stat::before {
  content: "";
  position: absolute;
  left: -1px; top: 20%;
  width: 2px; height: 18px;
  background: rgba(var(--gold), 0.35);
  box-shadow: 0 0 10px rgba(var(--gold), 0.3);
  opacity: 0; transition: opacity 0.6s ease;
}
.stat:hover::before { opacity: 1; }
.stat .k {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 18px;
}
.stat .v {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 38px;
  color: var(--light);
  line-height: 1;
  letter-spacing: 0.02em;
}
.stat .v small {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--muted);
  font-weight: 300;
  margin-left: 4px;
}
.stat .v.good { color: rgba(var(--green), 0.95); }
.stat .v.bad { color: rgba(var(--red), 0.95); }
.stat .v.warn { color: rgba(var(--amber), 0.95); }
.stat .delta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-top: 14px;
}
.stat .delta.good { color: rgba(var(--green), 0.9); }
.stat .delta.bad { color: rgba(var(--red), 0.85); }

/* ============================================================
   PANEL
   ============================================================ */
.panel {
  border: var(--line-w) solid rgba(var(--glow), 0.08);
  background: rgba(255,255,255,0.012);
  overflow: hidden;
}
.panel.full { margin-top: 48px; }
.panel-head {
  padding: 22px 26px 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: var(--line-w) solid rgba(var(--glow), 0.06);
}
.panel-head h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  color: var(--light);
  letter-spacing: 0.02em;
  margin: 0;
}
.panel-head .meta {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--faint);
}
.panel-body { padding: 22px 26px; }

/* ============================================================
   TABLE
   ============================================================ */
table.reliance-table { width: 100%; border-collapse: collapse; }
table.reliance-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--faint);
  padding: 18px 26px 14px;
  border-bottom: var(--line-w) solid rgba(var(--glow), 0.06);
}
table.reliance-table tbody td {
  padding: 18px 26px;
  border-bottom: var(--line-w) solid rgba(var(--glow), 0.04);
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--light);
  font-weight: 300;
  vertical-align: middle;
}
table.reliance-table tbody tr:last-child td { border-bottom: none; }
table.reliance-table tbody tr { transition: background 0.4s ease; }
table.reliance-table tbody tr:hover { background: rgba(255,255,255,0.015); }

.t-email,
.t-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: 0.02em;
}
.t-strong { color: var(--light); }

/* ============================================================
   ROLE & STATUS PILLS
   ============================================================ */
.role,
.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: var(--line-w) solid rgba(var(--glow), 0.12);
  color: var(--muted);
  background: transparent;
}
.role.admin, .pill.gold { color: rgba(var(--gold), 0.9); border-color: rgba(var(--gold), 0.25); }
.role.superadmin, .pill.red { color: rgba(var(--red), 0.9); border-color: rgba(var(--red), 0.25); }
.pill.green { color: rgba(var(--green), 0.9); border-color: rgba(var(--green), 0.3); }
.pill.amber { color: rgba(var(--amber), 0.95); border-color: rgba(var(--amber), 0.3); }

/* ============================================================
   ROW ACTIONS — inline mono action triggers
   ============================================================ */
.row-act {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  position: relative;
  transition: color 0.4s ease, letter-spacing 0.4s ease;
  margin-right: 18px;
  text-decoration: none;
  display: inline-block;
}
.row-act::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: var(--line-w);
  background: rgba(var(--glow), 0.12);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease, background 0.4s ease;
}
.row-act:hover { color: rgba(var(--gold), 0.95); letter-spacing: 0.28em; }
.row-act:hover::after { transform: scaleX(1); background: rgba(var(--gold), 0.5); }
.row-act.danger:hover { color: rgba(var(--red), 0.95); }
.row-act.danger:hover::after { background: rgba(var(--red), 0.5); }
.row-act:last-child { margin-right: 0; }

/* ============================================================
   SYSTEM STATUS LIST (Souffles)
   ============================================================ */
.sys-list { padding: 8px 26px 22px; }
.sys-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: var(--line-w) solid rgba(var(--glow), 0.04);
}
.sys-row:last-child { border-bottom: none; }
.sys-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  color: var(--light);
}
.sys-name .desc {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 4px;
}
.sys-val {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}
.sys-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: var(--line-w) solid rgba(var(--glow), 0.12);
  color: var(--muted);
}
.sys-pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(var(--green), 0.85);
  box-shadow: 0 0 8px rgba(var(--green), 0.6);
}
.sys-pill.alive { color: rgba(var(--green), 0.9); border-color: rgba(var(--green), 0.3); }
.sys-pill.alive::before { animation: livePulse 2.4s ease-in-out infinite; }
.sys-pill.warn,
.sys-pill.veille { color: rgba(var(--amber), 0.95); border-color: rgba(var(--amber), 0.3); }
.sys-pill.warn::before,
.sys-pill.veille::before { background: rgba(var(--amber), 0.85); box-shadow: 0 0 8px rgba(var(--amber), 0.6); }
.sys-pill.down,
.sys-pill.endormie { color: rgba(var(--red), 0.95); border-color: rgba(var(--red), 0.3); }
.sys-pill.down::before,
.sys-pill.endormie::before { background: rgba(var(--red), 0.85); box-shadow: 0 0 8px rgba(var(--red), 0.6); }
@keyframes livePulse { 50% { opacity: 0.45; } }

/* ============================================================
   FORMS — Cormorant fields with hairline underlines
   ============================================================ */
.form-field {
  position: relative;
  margin-bottom: 32px;
  text-align: left;
}
.form-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
  transition: color 0.5s ease;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: var(--line-w) solid rgba(var(--glow), 0.14);
  color: var(--light);
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 20px;
  padding: 6px 0 10px;
  outline: none;
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}
.form-field textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--faint); font-style: italic; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-bottom-color: rgba(var(--gold), 0.7);
  box-shadow: 0 12px 22px -18px rgba(var(--gold), 0.6);
}
.form-field:focus-within label { color: var(--muted); }
.form-field .hint {
  display: block;
  margin-top: 10px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.form-field .err {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(var(--red), 0.95);
  text-transform: uppercase;
}
.form-field select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 22px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b6f76' stroke-width='1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
}
.form-field select option { background: var(--void-2); color: var(--light); }

/* Submit button — same as landing .submit */
.btn-submit {
  align-self: flex-start;
  margin-top: 6px;
  background: transparent;
  border: none;
  color: var(--light);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 10px 0;
  position: relative;
  transition: color 0.4s ease, letter-spacing 0.4s ease;
}
.btn-submit::after {
  content: "";
  position: absolute;
  left: 0; bottom: 4px;
  width: 100%; height: var(--line-w);
  background: rgba(var(--glow), 0.2);
  transform: scaleX(0.4);
  transform-origin: left;
  transition: transform 0.5s ease, background 0.5s ease;
}
.btn-submit:hover { color: rgba(var(--gold), 0.95); letter-spacing: 0.36em; }
.btn-submit:hover::after { transform: scaleX(1); background: rgba(var(--gold), 0.6); }
.btn-submit .arrow { margin-left: 12px; }

.btn-danger { color: rgba(var(--red), 0.9); }
.btn-danger:hover { color: rgba(var(--red), 1); }
.btn-danger:hover::after { background: rgba(var(--red), 0.6); }

/* Form layout helpers */
.form-shell { max-width: 480px; margin-top: 32px; }
.form-actions {
  margin-top: 32px;
  padding-top: 24px;
  border-top: var(--line-w) solid rgba(var(--glow), 0.06);
  display: flex; align-items: center; gap: 28px;
}

/* ============================================================
   PRE / CODE blocks for monitoring pages
   ============================================================ */
.code-block {
  background: rgba(0,0,0,0.35);
  border: var(--line-w) solid rgba(var(--glow), 0.06);
  padding: 18px 22px;
  margin-top: 18px;
  overflow: auto;
  max-height: 420px;
}
.code-block pre {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
}

/* ============================================================
   QUICK ACTIONS — link cards
   ============================================================ */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 24px;
}
.quick {
  display: block;
  padding: 24px 20px;
  background: rgba(255,255,255,0.012);
  border: var(--line-w) solid rgba(var(--glow), 0.08);
  text-decoration: none;
  color: var(--light);
  transition: border-color 0.5s ease, background 0.5s ease, transform 0.5s ease;
  position: relative;
}
.quick:hover {
  border-color: rgba(var(--gold), 0.25);
  background: rgba(255,255,255,0.02);
}
.quick .q-glyph {
  font-family: var(--font-mono);
  font-size: 14px;
  color: rgba(var(--gold), 0.7);
  margin-bottom: 14px;
  display: block;
}
.quick .q-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 6px;
  color: var(--light);
}
.quick .q-desc {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ============================================================
   SEARCH / FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 32px;
  padding: 20px 26px;
  border-bottom: var(--line-w) solid rgba(var(--glow), 0.06);
  flex-wrap: wrap;
}
.filter-bar .form-field { margin-bottom: 0; flex: 1; min-width: 180px; }

/* ============================================================
   TOAST / MESSAGES
   ============================================================ */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}
.toast {
  background: rgba(10,11,14,0.92);
  border: var(--line-w) solid rgba(var(--glow), 0.12);
  padding: 14px 18px;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--light);
  backdrop-filter: blur(20px);
  animation: toastIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  position: relative;
}
.toast::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: rgba(var(--gold), 0.55);
  box-shadow: 0 0 8px rgba(var(--gold), 0.4);
}
.toast.error::before { background: rgba(var(--red), 0.9); box-shadow: 0 0 8px rgba(var(--red), 0.5); }
.toast.success::before { background: rgba(var(--green), 0.9); box-shadow: 0 0 8px rgba(var(--green), 0.5); }
.toast.warning::before { background: rgba(var(--amber), 0.9); box-shadow: 0 0 8px rgba(var(--amber), 0.5); }
.toast .t-eyebrow {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
  display: block;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   FOOTER MOTTO
   ============================================================ */
.footer-motto {
  margin-top: 80px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--faint);
  position: relative;
  z-index: 1;
}
.footer-motto .sub {
  display: block;
  margin-top: 8px;
  font-size: 7.5px;
  letter-spacing: 0.26em;
  opacity: 0.65;
}

/* ============================================================
   ACCESSIBILITY — focus rings consistent with landing
   ============================================================ */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: var(--line-w) solid rgba(var(--gold), 0.6);
  outline-offset: 4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 40px 32px 60px; }
}
@media (max-width: 780px) {
  html, body { overflow: auto; height: auto; }
  body.reliance-admin { overflow: visible; }
  .shell { grid-template-columns: 1fr; height: auto; }
  .thread-v { display: none; }
  .side { flex-direction: row; flex-wrap: wrap; padding: 18px 20px; gap: 18px; }
  .nav-section { margin-bottom: 0; }
  .nav-label { display: none; }
  .wordmark-sub { display: none; }
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .main { padding: 28px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .sys-pill.alive::before { animation: none; }
  .stat::before { transition: none; }
}

/* ============================================================
   PUBLIC SHELL — auth, profile, legal pages
   Same language as the Seuil: voile sombre, halo, no sidebar.
   ============================================================ */
body.reliance-public {
  background: var(--void);
  color: var(--light);
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  overflow-y: auto;
}
body.reliance-public::selection,
body.reliance-public *::selection {
  background: rgba(var(--gold), 0.4);
  color: var(--light);
}
body.reliance-public::before {
  content: ""; position: fixed; inset: 0;
  background:
    radial-gradient(120% 80% at 50% 18%, rgba(var(--glow), 0.035) 0%, transparent 55%),
    radial-gradient(100% 100% at 50% 50%, transparent 55%, rgba(0,0,0,0.7) 100%);
  pointer-events: none; z-index: 1;
}
body.reliance-public::after {
  content: ""; position: fixed; inset: 0;
  pointer-events: none; z-index: 2; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.public-shell {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 48px 28px 32px;
}

/* Top thin bar with wordmark + back to home */
.public-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  width: 100%;
  margin: 0 auto 48px;
}
.public-bar .pb-mark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.14em;
  color: var(--light);
  text-decoration: none;
  background: linear-gradient(180deg, rgb(248,251,255) 0%, rgb(212,222,231) 46%, rgb(150,164,176) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: letter-spacing 0.4s ease;
}
.public-bar .pb-mark:hover { letter-spacing: 0.18em; }
.public-bar .pb-link {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 0;
  position: relative;
  transition: color 0.4s ease, letter-spacing 0.4s ease;
}
.public-bar .pb-link::after {
  content: ""; position: absolute; left: 0; bottom: 2px;
  width: 100%; height: var(--line-w);
  background: rgba(var(--glow), 0.15);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s ease, background 0.5s ease;
}
.public-bar .pb-link:hover {
  color: rgba(var(--gold), 0.95);
  letter-spacing: 0.32em;
}
.public-bar .pb-link:hover::after {
  transform: scaleX(1);
  background: rgba(var(--gold), 0.6);
}

/* Centered card layout (login, register, password reset, beta) */
.public-card {
  max-width: 460px;
  width: 100%;
  margin: auto;
  padding: 32px 0 56px;
  text-align: center;
  position: relative;
}
.public-card .pc-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 18px;
}
.public-card h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: 0.06em;
  line-height: 1.15;
  color: var(--light);
  background: linear-gradient(180deg, rgb(248,251,255) 0%, rgb(212,222,231) 56%, rgb(160,170,182) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 24px rgba(var(--glow), 0.12);
  margin: 0;
}
.public-card .pc-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--muted);
  margin: 14px 0 0;
  line-height: 1.55;
}
.public-card .pc-form,
.public-card .pc-body {
  margin-top: 48px;
  text-align: left;
}
.public-card .pc-form .form-field,
.public-card .pc-body .form-field {
  margin-bottom: 28px;
}
.public-card .pc-foot {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.public-card .pc-secondary {
  margin-top: 36px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--muted);
  text-align: center;
}
.public-card .pc-secondary a {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(var(--gold), 0.85);
  text-decoration: none;
  padding: 0 4px;
  position: relative;
  transition: letter-spacing 0.4s ease, color 0.4s ease;
}
.public-card .pc-secondary a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: var(--line-w);
  background: rgba(var(--gold), 0.3);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s ease;
}
.public-card .pc-secondary a:hover {
  letter-spacing: 0.32em;
  color: rgba(var(--gold), 1);
}
.public-card .pc-secondary a:hover::after { transform: scaleX(1); }

/* Inline checkbox row (Remember me) */
.pc-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.pc-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: var(--line-w) solid rgba(var(--glow), 0.25);
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: border-color 0.3s ease;
}
.pc-check input[type="checkbox"]:checked {
  border-color: rgba(var(--gold), 0.7);
  background: rgba(var(--gold), 0.15);
}
.pc-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 3px; top: -1px;
  width: 5px; height: 9px;
  border: solid rgba(var(--gold), 0.9);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

/* Block-level link footer (e.g. "Forgot password ?") on its own line */
.pc-link-row {
  margin-top: 36px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.pc-link-row a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 0;
  position: relative;
  transition: color 0.4s ease, letter-spacing 0.4s ease;
}
.pc-link-row a::after {
  content: ""; position: absolute; left: 0; bottom: 2px;
  width: 100%; height: var(--line-w);
  background: rgba(var(--glow), 0.12);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s ease, background 0.4s ease;
}
.pc-link-row a:hover { color: rgba(var(--gold), 0.95); letter-spacing: 0.3em; }
.pc-link-row a:hover::after { transform: scaleX(1); background: rgba(var(--gold), 0.55); }

/* Non-field errors block (login fails, etc.) */
.public-card .form-errors {
  margin-bottom: 28px;
  padding: 14px 18px;
  border-left: 2px solid rgba(var(--red), 0.7);
  background: rgba(var(--red), 0.04);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: rgba(var(--red), 0.95);
  text-align: left;
}

/* ============================================================
   LEGAL / LONG-FORM CONTENT
   For terms, privacy, data_privacy
   ============================================================ */
.legal-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 0 64px;
}
.legal-shell .pc-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
}
.legal-shell h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(32px, 4vw, 42px);
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: var(--light);
  background: linear-gradient(180deg, rgb(248,251,255) 0%, rgb(212,222,231) 56%, rgb(160,170,182) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 12px;
}
.legal-shell .legal-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 56px;
}
.legal-shell h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  color: var(--light);
  letter-spacing: 0.01em;
  margin: 56px 0 18px;
  padding-top: 28px;
  border-top: var(--line-w) solid rgba(var(--glow), 0.08);
}
.legal-shell h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.legal-shell h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  color: var(--light);
  margin: 32px 0 12px;
}
.legal-shell p,
.legal-shell li {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.75;
  color: var(--light);
  margin: 0 0 16px;
}
.legal-shell ul, .legal-shell ol {
  margin: 0 0 20px;
  padding-left: 24px;
}
.legal-shell ul li, .legal-shell ol li {
  margin-bottom: 8px;
}
.legal-shell strong { color: var(--light); font-weight: 500; }
.legal-shell em { font-style: italic; color: var(--muted); }
.legal-shell a {
  color: rgba(var(--gold), 0.85);
  text-decoration: none;
  border-bottom: var(--line-w) solid rgba(var(--gold), 0.3);
  transition: color 0.3s ease, border-color 0.3s ease;
}
.legal-shell a:hover { color: rgba(var(--gold), 1); border-color: rgba(var(--gold), 0.7); }
.legal-shell .updated {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 56px;
  padding-top: 24px;
  border-top: var(--line-w) solid rgba(var(--glow), 0.06);
  text-align: center;
}

/* ============================================================
   PROFILE LAYOUT
   ============================================================ */
.profile-shell {
  max-width: 720px;
  margin: 0 auto;
}
.profile-card {
  border: var(--line-w) solid rgba(var(--glow), 0.08);
  background: rgba(255,255,255,0.012);
  padding: 32px 36px 40px;
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 22px;
  padding-bottom: 28px;
  margin-bottom: 32px;
  border-bottom: var(--line-w) solid rgba(var(--glow), 0.08);
}
.profile-head .pf-ava {
  width: 64px;
  height: 64px;
  border: var(--line-w) solid rgba(var(--glow), 0.2);
  background: var(--void-2);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
  color: rgba(var(--gold), 0.85);
  flex: none;
  overflow: hidden;
}
.profile-head .pf-ava img {
  width: 100%; height: 100%; object-fit: cover;
}
.profile-head .pf-who {
  flex: 1;
  min-width: 0;
}
.profile-head .pf-name {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--light);
  margin: 0 0 4px;
}
.profile-head .pf-role {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(var(--gold), 0.8);
  margin: 0 0 2px;
}
.profile-head .pf-email {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}
.profile-meta {
  margin-top: 32px;
  padding-top: 24px;
  border-top: var(--line-w) solid rgba(var(--glow), 0.06);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.profile-meta .pm-info {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  line-height: 1.9;
}

/* ============================================================
   PUBLIC FOOTER MOTTO
   ============================================================ */
.public-foot {
  margin-top: auto;
  padding-top: 64px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--faint);
}
.public-foot .sub {
  display: block;
  margin-top: 8px;
  font-size: 7.5px;
  letter-spacing: 0.26em;
  opacity: 0.65;
}
.public-foot .legal-links {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}
.public-foot .legal-links a {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--faint);
  text-decoration: none;
  transition: color 0.4s ease;
}
.public-foot .legal-links a:hover { color: rgba(var(--gold), 0.9); }

/* Responsive */
@media (max-width: 600px) {
  .public-shell { padding: 32px 20px 24px; }
  .public-bar { margin-bottom: 32px; }
  .public-card { padding: 24px 0 36px; }
  .public-card .pc-form,
  .public-card .pc-body { margin-top: 36px; }
  .profile-card { padding: 24px 20px 32px; }
}
