/* ═════════════════════════════════════════════════════════════════════
   BFC WMS — gateway supplemental styles
   Loaded by the server-rendered gateway pages AFTER ui/bfc.css. Every
   color/radius/shadow/font comes from the --bfc-* tokens in bfc.css; this
   file only adds the two layouts bfc.css does not already cover:
     1. the immersive "front door"  → login + database picker
     2. the admin control-panel extras that ride on the light in-app shell
   Class names are namespaced (gw-* front door, admin-* control panel) so they
   never collide with the shared bfc.css component classes. No CDN assets.
   ═════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────
   1. Immersive front door (login + database picker)
   ───────────────────────────────────────────────────────────────────── */

body.gw-immersive {
  color: #fff;
  background:
    radial-gradient(circle at 14% 12%, rgba(35, 177, 165, 0.26), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(253, 202, 73, 0.24), transparent 28%),
    linear-gradient(135deg, #081631 0%, var(--bfc-navy) 42%, var(--bfc-indigo-dark) 100%);
  overflow-x: hidden;
}
body.gw-immersive::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 36%),
    radial-gradient(circle at 52% 115%, rgba(255, 255, 255, 0.16), transparent 36%);
  pointer-events: none;
}

/* Brand lockup + eyebrow — shared by both front-door pages */
.gw-brand { display: flex; align-items: center; gap: 14px; }
.gw-logo {
  width: 64px;
  height: auto;
  border-radius: 13px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24), 0 18px 42px rgba(0, 0, 0, 0.22);
}
.gw-wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: #fff;
}
.gw-wordmark span { color: rgba(255, 255, 255, 0.66); font-weight: 700; }

/* ---- Shared contained two-panel card (login + database picker) ---- */
.gw-stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.gw-split {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  align-items: stretch;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 34px 90px rgba(6, 16, 38, 0.46);
}
/* left: dark brand panel */
.gw-aside {
  position: relative;
  overflow: hidden;
  padding: 44px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 26px;
  background:
    radial-gradient(circle at 84% 14%, rgba(35, 177, 165, 0.22), transparent 32%),
    linear-gradient(160deg, var(--bfc-navy-deep), var(--bfc-navy) 52%, var(--bfc-indigo-dark));
}
.gw-aside::before {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 300px;
  height: 300px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(35, 177, 165, 0.34), transparent 70%);
  pointer-events: none;
}
.gw-aside > * { position: relative; z-index: 1; }
.gw-headline {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 3.2vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin: 0;
}
.gw-tagline {
  margin: 11px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: var(--text-lg);
  line-height: 1.6;
  max-width: 30rem;
}
.gw-bullets {
  list-style: none;
  margin: auto 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.gw-bullets li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--text-base);
}
.gw-bullets li::before { content: "\25b8"; color: var(--bfc-yellow); font-size: var(--text-sm); }
.gw-bullets strong { color: #fff; font-weight: 700; }
/* When the brand side carries no bullets (database picker), center its message
   in the panel so it doesn't sit top-heavy against the centered content pane. */
.gw-aside-fill { margin: auto 0; }
.gw-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  grid-template-rows: 178px;
  gap: 10px;
  margin-top: 22px;
}
.gw-showcase-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 28px rgba(3, 12, 29, 0.28);
}
.gw-showcase-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gw-showcase-modern img { object-position: 52% center; }
.gw-showcase-classic img { object-position: center top; }
.gw-showcase-card::after {
  content: "";
  position: absolute;
  inset: 42% 0 0;
  background: linear-gradient(to bottom, transparent, rgba(4, 14, 35, 0.9));
  pointer-events: none;
}
.gw-showcase-card figcaption {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 18px 10px 8px;
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}
.gw-showcase-card figcaption::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--bfc-indigo);
  box-shadow: 0 0 0 3px rgba(63, 83, 216, 0.3);
}
/* right: light content panel */
.gw-pane {
  background: var(--bfc-surface);
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.gw-pane h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--bfc-navy);
  margin: 0;
}
.gw-pane-sub { color: var(--bfc-muted); font-size: var(--text-base); line-height: 1.5; margin: 8px 0 0; }
.gw-help {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--bfc-line);
  color: var(--bfc-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.gw-form { display: grid; gap: 14px; margin-top: 22px; }
.gw-form .field { display: grid; gap: 6px; }
.gw-form .field label { color: var(--bfc-navy); font-size: var(--text-md); font-weight: 600; }
/* Style every field in the front-door forms, not just the text/password inputs
   bfc.css covers — the GUI URL panel adds type=url fields that would otherwise
   fall back to the unstyled browser default. (input:focus in bfc.css is already
   type-agnostic, so only the resting look is restated here.) */
.gw-form input,
.gw-form select {
  width: 100%;
  font: inherit;
  font-size: var(--text-base);
  color: var(--bfc-ink);
  background: var(--bfc-surface);
  border: 1px solid var(--bfc-line-strong);
  border-radius: 10px;
  padding: 9px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.gw-form .btn { margin-top: 4px; }
.gw-pane .alert { margin: 18px 0 0; }
.gw-auth-panel { min-width: 0; }
.gw-target-row { animation: gw-row-in .18s ease both; }
@keyframes gw-row-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.gw-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  color: var(--bfc-muted);
  font-size: var(--caps-size);
  font-weight: var(--caps-weight);
  letter-spacing: var(--caps-tracking);
  text-transform: uppercase;
}
.gw-or::before,
.gw-or::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--bfc-line);
}
/* An <a> styled as a .btn (e.g. "Sign in with Microsoft") must drop the link
   underline and center its label the way a real <button> does. */
a.btn { text-decoration: none; }
.btn-block { text-align: center; }
.btn-microsoft {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 18px;
  color: #1f1f1f;
  background: #fff;
  border-color: #8c8c8c;
  border-radius: 6px;
  box-shadow: none;
  font-family: "Segoe UI", var(--font-display), sans-serif;
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0;
}
.btn-microsoft:hover { background: #f7f7f7; filter: none; border-color: #6f6f6f; }
.gw-auth-methods { gap: 10px; }
.gw-magic-form { display: grid; gap: 12px; }
.gw-auth-note {
  margin: -2px 0 0;
  color: var(--bfc-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
  text-align: center;
}
.gw-auth-panel button:disabled,
.gw-auth-panel input:disabled {
  cursor: wait;
  opacity: 0.66;
}
.ms-mark {
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: repeat(2, 10px);
  grid-template-rows: repeat(2, 10px);
  gap: 2px;
}
.ms-mark span:nth-child(1) { background: #f25022; }
.ms-mark span:nth-child(2) { background: #7fba00; }
.ms-mark span:nth-child(3) { background: #00a4ef; }
.ms-mark span:nth-child(4) { background: #ffb900; }

/* ---- BFC Auth target picker ---- */
.gw-loading {
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--bfc-line);
  border-radius: var(--radius-md);
  background: var(--bfc-soft);
  color: var(--bfc-navy);
}
.gw-loading strong { display: block; font-family: var(--font-display); font-size: var(--text-lg); }
.gw-loading span { display: block; margin-top: 2px; color: var(--bfc-muted); font-size: var(--text-md); }
.gw-spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid rgba(63, 83, 216, 0.18);
  border-top-color: var(--bfc-indigo);
  animation: gw-spin 0.85s linear infinite;
}
@keyframes gw-spin { to { transform: rotate(360deg); } }
.gw-target-results {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}
.gw-target-group {
  margin: 8px 0 0;
  color: var(--bfc-muted);
  font-size: var(--caps-size);
  font-weight: var(--caps-weight);
  letter-spacing: var(--caps-tracking);
  text-transform: uppercase;
}
.gw-target-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  color: var(--bfc-navy);
  background: var(--bfc-surface);
  border: 1px solid var(--bfc-line-strong);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
}
.gw-target-row:hover,
.gw-target-row.selected {
  border-color: rgba(35, 177, 165, 0.65);
  box-shadow: 0 0 0 3px rgba(35, 177, 165, 0.12), var(--shadow-card);
}
.gw-target-main { display: grid; gap: 2px; min-width: 0; }
.gw-target-main strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.gw-target-main span {
  color: var(--bfc-muted);
  font-size: var(--text-sm);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gw-target-main .gw-target-customer {
  color: var(--bfc-ink);
  font-size: var(--text-base);
  font-weight: 700;
}
.gw-target-main .gw-target-technical {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
}
.gw-target-arrow {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--bfc-teal), var(--bfc-teal-soft));
  color: #fff;
  font-weight: 800;
}
.gw-target-empty {
  padding: 12px 2px;
  color: var(--bfc-muted);
  font-size: var(--text-md);
}
.gw-picker-toolbar {
  display: grid;
  gap: 14px;
  margin: 10px 0 0;
}
.gw-picker-toolbar .gw-pane-sub {
  margin: 0;
  min-width: 0;
}
.gw-toolbar-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  width: 100%;
}
.gw-admin-action { min-width: 0; }
.gw-admin-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  width: 100%;
  min-height: 48px;
  padding: 7px 8px;
  color: var(--bfc-navy);
  background: var(--bfc-soft);
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: var(--text-sm);
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  box-shadow: none;
  white-space: normal;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.gw-admin-link-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  color: var(--bfc-indigo);
  background: var(--bfc-surface);
  border: 1px solid var(--bfc-line);
  border-radius: 9px;
}
.gw-admin-link-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gw-admin-link:hover {
  border-color: rgba(63, 83, 216, 0.28);
  background: rgba(63, 83, 216, 0.08);
  box-shadow: 0 5px 14px rgba(16, 34, 72, 0.08);
}
.gw-admin-link:focus-visible {
  outline: 3px solid rgba(63, 83, 216, 0.2);
  outline-offset: 2px;
  border-color: rgba(63, 83, 216, 0.46);
}

/* ---- IBM account management and database file-set choices ---- */
.gw-account-results {
  display: grid;
  gap: 10px;
  max-height: 330px;
  overflow: auto;
  margin-top: 20px;
  padding-right: 2px;
}
.gw-account-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  color: var(--bfc-navy);
  background: var(--bfc-surface);
  border: 1px solid var(--bfc-line-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.gw-account-main { display: grid; gap: 3px; min-width: 0; }
.gw-account-main strong { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 800; }
.gw-account-main span { color: var(--bfc-muted); font-size: var(--text-sm); line-height: 1.4; }
.gw-account-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.gw-account-buttons .btn { min-height: 34px; padding: 7px 11px; font-size: var(--text-sm); }
.gw-remove-account { color: var(--bfc-danger-text); }

/* ---- Database file-set choices (list inside the light pane) ---- */
.gw-choices {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  margin-top: 22px;
  padding-right: 2px;
  overscroll-behavior: contain;
}
.gw-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  color: var(--bfc-navy);
  background: var(--bfc-surface);
  border: 1px solid var(--bfc-line-strong);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.gw-choice:hover { transform: translateY(-1px); box-shadow: var(--shadow-elev); border-color: rgba(35, 177, 165, 0.5); }
.gw-choice:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(35, 177, 165, 0.2); }
.gw-customer-choice {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.gw-customer-choice:disabled { transform: none; box-shadow: var(--shadow-card); }
.gw-choice-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gw-choice strong { font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: -0.02em; }
.gw-choice span { color: var(--bfc-muted); font-size: var(--text-sm); font-weight: 700; }
.gw-arrow {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--bfc-teal), var(--bfc-teal-soft));
  color: #fff;
  font-weight: 800;
}
.gw-pane-note { color: var(--bfc-muted); font-size: var(--text-sm); line-height: 1.5; margin: 18px 0 0; }

/* "Opening" boot layer reused by the picker (single-DB auto-forward and
   post-click). Renders the SAME shell skeleton as the SPA first-load
   (ui/css/shell.css .boot-* / .sk) so sign-in → app is one continuous screen
   rather than two loaders that look slightly different. */
.gw-booting {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--bfc-navy);
  background: var(--bfc-page);
  z-index: 99;
  /* Fade in rather than snap on when a file set is chosen (or on auto-forward),
     so the hand-off into the loading screen feels smooth. */
  opacity: 0;
  visibility: hidden;
  transition: opacity .32s ease, visibility 0s .32s;
}
body.busy .gw-booting {
  opacity: 1;
  visibility: visible;
  transition: opacity .32s ease;
}
body.busy .gw-choice { pointer-events: none; opacity: 0.6; }
@media (prefers-reduced-motion: reduce) {
  .gw-target-row,
  .gw-spinner { animation: none; }
}
/* JS-off fallback link (auto-forward) sits under the skeleton. */
.gw-booting noscript { position: absolute; inset: auto 16px 84px; text-align: center; }
.gw-booting .btn { margin-top: 6px; }

@media (max-width: 860px) {
  .gw-stage { padding: 16px; }
  .gw-split { grid-template-columns: 1fr; width: min(440px, 100%); }
  .gw-aside { padding: 30px; }
  .gw-pane { padding: 30px; }
}
@media (max-width: 560px) {
  .gw-showcase {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 110px 82px;
  }
}
@media (max-width: 400px) {
  .gw-toolbar-actions { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────────────────────
   2. Admin control panel — rides on the light in-app shell (bfc.css topbar,
   --bfc-page background, .card / .btn / .pill / table / .alert components).
   ───────────────────────────────────────────────────────────────────── */

/* Standalone topbar (admin is server-rendered, no app.js): reuses the bfc
   .topbar / .brand / .brand-logo look, with an admin wordmark + sign-out. */
.admin-bar-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: #fff;
}
.admin-bar-title span { color: rgba(255, 255, 255, 0.62); font-weight: 700; }
.admin-bar-spacer { flex: 1 1 auto; }
/* Topbar-friendly ghost button (the navy .btn-ghost would vanish on dark). */
.btn-ghost-light {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
}
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.2); }

.admin-section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
  color: var(--bfc-navy);
  margin: 26px 0 10px;
}
.admin-narrow { max-width: 460px; margin: 56px auto; }

/* Sign-out sits in the dark topbar (uses the light ghost button). */
.admin-signout { display: inline-flex; margin: 0; }

/* Small print under the install list: where edits land + the password note. */
.admin-foot {
  margin: 28px 0 8px;
  padding-top: 16px;
  border-top: 1px solid var(--bfc-line);
  color: var(--bfc-muted);
  font-size: var(--text-md);
  line-height: 1.6;
}

/* Install / add accordions are bfc cards with a clickable summary header. */
.admin-install > summary,
.admin-add > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
}
.admin-install > summary::-webkit-details-marker,
.admin-add > summary::-webkit-details-marker { display: none; }
.admin-install[open] > summary,
.admin-add[open] > summary { border-bottom: 1px solid var(--bfc-line); }
.admin-install summary strong,
.admin-add summary strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--bfc-navy);
}
.admin-install summary .sub,
.admin-add summary .sub { display: block; color: var(--bfc-muted); font-size: var(--text-md); margin-top: 2px; }
.admin-badges { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.admin-body { padding: 22px; }

/* Two-column form grid */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.admin-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--bfc-navy);
}
.admin-grid input { width: 100%; }
.admin-grid input[readonly] { background: var(--bfc-soft); color: var(--bfc-muted); }
.admin-span { grid-column: 1 / -1; }
.admin-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
/* Inside the form grid the gap owns vertical rhythm — drop component margins. */
.admin-grid .alert, .admin-grid .notice { margin: 0; }
.cap-refresh { margin: 0; }
.admin-subhead {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--bfc-navy);
  margin: 6px 0 0;
}
/* Inline helper text inside a form grid — full width, muted, sits under a subhead. */
.admin-hint {
  grid-column: 1 / -1;
  color: var(--bfc-muted);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.5;
  margin: -4px 0 0;
}

.admin-checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.admin-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  background: var(--bfc-soft);
  border: 1px solid var(--bfc-line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--bfc-navy);
}
.admin-check input { width: auto; }
.admin-check-single { margin-top: 4px; }

/* Locked install: edits disabled until capabilities are refreshed. */
.admin-install.locked .admin-grid input:not([type=hidden]):not([readonly]) {
  pointer-events: none;
  background: var(--bfc-soft);
  color: var(--bfc-muted);
}
.admin-install.locked .admin-checks { opacity: 0.6; pointer-events: none; }

/* Live capabilities block — leads the install card body; refresh here unlocks editing. */
.admin-caps {
  margin: 0 0 18px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--bfc-line);
}
.admin-caps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.admin-caps-head h3 { font-family: var(--font-display); font-size: var(--text-base); color: var(--bfc-navy); margin: 0; }
.admin-capset {
  border: 1px solid var(--bfc-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 10px;
  background: var(--bfc-soft);
}
.admin-caphead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bfc-soft-2);
}
.admin-caphead strong { font-family: var(--font-display); color: var(--bfc-navy); }
.admin-caphead span { color: var(--bfc-muted); font-size: var(--text-sm); }
.admin-caprow {
  display: grid;
  grid-template-columns: 150px auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 9px 14px;
  border-top: 1px solid var(--bfc-line);
  font-size: var(--text-md);
}
.admin-caprow .label { color: var(--bfc-navy); font-weight: 600; }
.admin-caprow em { font-style: normal; color: var(--bfc-muted); word-break: break-word; }

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 18px;
}
.admin-tabs a,
.admin-tabs button {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--bfc-line);
  border-radius: 999px;
  background: var(--bfc-surface);
  color: var(--bfc-navy);
  text-decoration: none;
  font: inherit;
  font-size: var(--text-md);
  font-weight: 800;
  cursor: pointer;
}
.admin-tabs a.active,
.admin-tabs button.active {
  border-color: var(--bfc-teal);
  background: rgba(35,177,165,.10);
  color: var(--bfc-success-text);
}
.admin-tabs button:disabled { cursor: wait; opacity: .62; }

.customer-users-app { display: grid; gap: 16px; }
.customer-users-invite {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--bfc-line);
  border-radius: var(--radius-md);
  background: var(--bfc-soft);
}
.customer-users-invite label { display: grid; gap: 6px; color: var(--bfc-navy); font-size: var(--text-md); font-weight: 700; }
.customer-users-invite input { width: 100%; }
.customer-users-invite fieldset { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; }
.customer-users-invite legend { margin-bottom: 7px; color: var(--bfc-navy); font-size: var(--text-md); font-weight: 700; }
.customer-users-systems { display: flex; gap: 8px; flex-wrap: wrap; }
.customer-users-systems .customer-users-system {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px;
  border: 1px solid var(--bfc-line); border-radius: 9px; background: var(--bfc-surface);
}
.customer-users-systems input[type="checkbox"] { width: auto; margin: 0; }
.customer-users-invite p { grid-column: 1 / -1; margin: 0; color: var(--bfc-muted); font-size: var(--text-sm); }
.customer-users-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 1.35fr) auto;
  gap: 12px;
  align-items: end;
}
.customer-users-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--bfc-navy);
  font-size: var(--text-md);
  font-weight: 700;
}
.customer-users-toolbar select,
.customer-users-toolbar input { width: 100%; }
.customer-users-freshness {
  min-height: 18px;
  margin: 10px 0 4px;
  color: var(--bfc-muted);
  font-size: var(--text-sm);
}
.customer-users-results { display: grid; gap: 12px; }
.customer-user-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--bfc-line);
  border-radius: var(--radius-md);
  background: var(--bfc-surface);
  box-shadow: var(--shadow-card);
}
.customer-user-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.customer-user-primary { display: grid; gap: 2px; min-width: 0; }
.customer-user-primary strong { color: var(--bfc-navy); font-family: var(--font-display); font-size: var(--text-lg); }
.customer-user-primary span { color: var(--bfc-muted); font-size: var(--text-md); overflow-wrap: anywhere; }
.customer-user-pills { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.customer-user-note { margin: 0; color: var(--bfc-muted); font-size: var(--text-md); line-height: 1.5; }
.customer-user-identities { display: grid; gap: 7px; }
.customer-user-identity {
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--bfc-soft);
}
.customer-user-identity strong { color: var(--bfc-navy); font-size: var(--text-md); }
.customer-user-identity span { color: var(--bfc-muted); font-size: var(--text-sm); }
.customer-user-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.customer-user-actions .btn { min-height: 34px; padding: 7px 11px; font-size: var(--text-sm); }
.customer-user-remove { color: var(--bfc-danger-text); }
.customer-user-confirm {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(196, 49, 75, .32);
  border-radius: 10px;
  background: var(--bfc-danger-bg, #fff4f5);
  color: var(--bfc-navy);
  font-size: var(--text-md);
}
.customer-user-confirm label { display: grid; gap: 5px; font-weight: 700; }
.customer-user-confirm input { width: 100%; }
.customer-user-confirm .btn-danger {
  color: #fff;
  background: var(--bfc-danger-text);
  border-color: var(--bfc-danger-text);
}
.customer-user-audit { box-shadow: none; }

.admin-filter { margin: 0 0 16px; }
.admin-grid select { width: 100%; }
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-md);
}
.admin-table th,
.admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--bfc-line);
  text-align: left;
  vertical-align: top;
}
.admin-table th {
  color: var(--bfc-muted);
  font-weight: var(--caps-weight);
  text-transform: uppercase;
  letter-spacing: var(--caps-tracking);
  background: var(--bfc-soft);
}
.admin-detail-row td { padding-top: 0; background: var(--bfc-soft); }
.admin-detail-row pre,
.admin-log-tail {
  max-height: 520px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.45 var(--font-mono);
  color: var(--bfc-navy);
  background: #fff;
  border: 1px solid var(--bfc-line);
  border-radius: 10px;
  padding: 10px;
}

@media (max-width: 760px) {
  .admin-grid { grid-template-columns: 1fr; }
  .customer-users-invite,
  .customer-users-toolbar { grid-template-columns: 1fr; }
  .customer-user-head { flex-direction: column; }
  .customer-user-pills { justify-content: flex-start; }
  .admin-checks { grid-template-columns: 1fr; }
  .admin-badges { justify-content: flex-start; }
  .admin-caprow { grid-template-columns: 1fr; gap: 4px; }
}
