/* SyntroIdP — Demo comercial
   Estilos autocontenidos, sin fuentes ni recursos externos. */

:root {
  --navy: #0b1220;
  --navy-2: #111c33;
  --navy-3: #16233d;
  --blue: #4a9eff;
  --blue-2: #2563eb;
  --blue-3: #1d4ed8;
  --teal: #14b8a6;
  --purple: #8b5cf6;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --rose: #f43f5e;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #f6f8fc;
  --bg-2: #eef3fa;
  --white: #ffffff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.06);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noscript {
  padding: 24px;
  text-align: center;
  background: #fef3c7;
  color: #92400e;
}

/* ---------- Buttons & inputs ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(74, 158, 255, 0.35); outline-offset: 2px; }
.btn-primary { background: var(--blue-2); color: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25); }
.btn-primary:hover { background: var(--blue-3); }
.btn-secondary { background: #fff; color: var(--ink-2); border-color: var(--line-2); }
.btn-secondary:hover { background: #f8fafc; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(15, 23, 42, 0.05); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: #eef6ff; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink-2);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { background: #f8fafc; border-color: var(--line-2); }
.icon-btn:focus-visible { outline: 3px solid rgba(74, 158, 255, 0.35); outline-offset: 2px; }
.icon-btn .dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid #fff;
  transform: translate(11px, -11px);
}

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); letter-spacing: 0.01em; }
.field .hint { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  padding: 11px 13px;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(74, 158, 255, 0.14);
}
.textarea { min-height: 92px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.checkbox { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.checkbox input { width: 16px; height: 16px; margin-top: 1px; accent-color: var(--blue-2); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- Badges / avatars ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-neutral { background: #f1f5f9; color: #475569; }
.badge-dark { background: rgba(255, 255, 255, 0.12); color: #e2e8f0; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.avatar-sm { width: 30px; height: 30px; border-radius: 9px; font-size: 10.5px; }
.avatar-lg { width: 52px; height: 52px; border-radius: 15px; font-size: 15px; }
.avatar-round { border-radius: 50%; }

/* ---------- Home ---------- */

.home-shell { min-height: 100vh; background: var(--navy); color: #e2e8f0; }
.home-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 28px;
}
.home-brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4a9eff, #2563eb 55%, #14b8a6);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}
.home-brand h1 { font-size: 19px; letter-spacing: -0.02em; }
.home-brand p { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.home-nav { display: flex; align-items: center; gap: 6px; }
.home-nav a {
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 13px;
  color: #cbd5e1;
  transition: background 0.15s ease, color 0.15s ease;
}
.home-nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.home-nav .active { background: rgba(74, 158, 255, 0.16); color: #bfdbfe; }
.home-top-actions { display: flex; align-items: center; gap: 10px; }

.home-main { max-width: 1240px; margin: 0 auto; padding: 8px 28px 60px; }

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  padding: 48px;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(74, 158, 255, 0.35), transparent 60%),
    radial-gradient(700px 420px at 95% 10%, rgba(20, 184, 166, 0.24), transparent 60%),
    linear-gradient(135deg, #0d1b35 0%, #10264a 50%, #0b3b45 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 80%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #dbeafe;
}
.hero-title {
  max-width: 760px;
  margin-top: 18px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 800;
  color: #fff;
}
.hero-title span { color: #7dd3fc; }
.hero-text {
  max-width: 660px;
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.65;
  color: #cbd5e1;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-actions .btn { padding: 12px 18px; font-size: 14px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 36px;
  max-width: 760px;
}
.stat-pill {
  padding: 14px 16px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}
.stat-pill strong { display: block; font-size: 22px; letter-spacing: -0.03em; color: #fff; }
.stat-pill span { display: block; margin-top: 3px; font-size: 11.5px; color: #94a3b8; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 42px 0 16px; }
.section-head h2 { font-size: 22px; letter-spacing: -0.03em; color: #fff; }
.section-head p { margin-top: 5px; font-size: 13.5px; color: #94a3b8; max-width: 640px; line-height: 1.5; }
.section-head .section-note { font-size: 12px; color: #7dd3fc; white-space: nowrap; }

.view-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.view-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  text-align: left;
  color: inherit;
}
.view-card:hover { transform: translateY(-3px); background: rgba(255, 255, 255, 0.085); border-color: rgba(125, 211, 252, 0.35); }
.view-card:focus-visible { outline: 3px solid rgba(74, 158, 255, 0.5); outline-offset: 3px; }
.view-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.view-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  color: #bfdbfe;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.view-tag { font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #94a3b8; }
.view-card h3 { font-size: 15.5px; letter-spacing: -0.01em; color: #f8fafc; }
.view-card p { font-size: 12.5px; line-height: 1.5; color: #94a3b8; flex: 1; }
.view-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.view-card-footer span { font-size: 12px; font-weight: 700; color: #7dd3fc; }
.view-card-footer .arrow { color: #7dd3fc; }

.home-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 28px 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #64748b;
}
.home-footer strong { color: #cbd5e1; }

/* ---------- Guide panel ---------- */

.guide-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #0d9488);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.guide-fab:hover { transform: translateY(-2px); box-shadow: 0 20px 48px rgba(2, 6, 23, 0.45); }
.guide-fab:focus-visible { outline: 3px solid rgba(125, 211, 252, 0.65); outline-offset: 3px; }

.guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.guide-overlay.open { opacity: 1; pointer-events: auto; }

.guide-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  width: min(420px, 94vw);
  background: #fff;
  color: var(--ink);
  box-shadow: -30px 0 80px rgba(2, 6, 23, 0.25);
  transform: translateX(105%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.guide-panel.open { transform: translateX(0); }
.guide-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 24px 24px 18px; border-bottom: 1px solid var(--line); }
.guide-header h2 { font-size: 18px; letter-spacing: -0.02em; }
.guide-header p { margin-top: 5px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.guide-body { padding: 20px 24px 28px; }
.guide-step {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  width: 100%;
  background: none;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  color: inherit;
}
.guide-step:hover .guide-step-title { color: var(--blue-2); }
.guide-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}
.guide-step-title { display: block; font-size: 13px; font-weight: 750; color: var(--ink); transition: color 0.15s ease; }
.guide-step-text { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.guide-personas { display: grid; gap: 10px; margin-top: 18px; }
.guide-persona { display: flex; align-items: flex-start; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdff; }
.guide-persona strong { display: block; font-size: 12.5px; }
.guide-persona span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.guide-footer { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.guide-footer p { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }

/* ---------- Auth ---------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(74, 158, 255, 0.18), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(20, 184, 166, 0.12), transparent 60%),
    #0b1220;
  color: #e2e8f0;
}
.auth-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 28px; max-width: 1240px; margin: 0 auto; width: 100%; }
.auth-topbar .home-brand h1 { color: #fff; }
.auth-topbar .home-brand p { color: #94a3b8; }
.auth-back { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: #94a3b8; padding: 8px 11px; border-radius: 9px; }
.auth-back:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px 24px 60px; }
.auth-card {
  width: 100%;
  max-width: 460px;
  padding: 34px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
.auth-brand strong { display: block; font-size: 14px; color: #fff; }
.auth-brand span { display: block; margin-top: 2px; font-size: 11.5px; color: #94a3b8; }
.auth-tenant {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(74, 158, 255, 0.12);
  border: 1px solid rgba(74, 158, 255, 0.22);
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 700;
}
.auth-steps { display: flex; align-items: center; gap: 6px; margin-bottom: 24px; }
.auth-step { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: #64748b; white-space: nowrap; }
.auth-step .num { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); color: #94a3b8; font-size: 10px; font-weight: 800; }
.auth-step.active { color: #dbeafe; }
.auth-step.active .num { background: var(--blue-2); color: #fff; }
.auth-step.done .num { background: #0d9488; color: #fff; }
.auth-step-sep { width: 14px; height: 1px; background: rgba(255, 255, 255, 0.14); }
.auth-title { font-size: 24px; line-height: 1.15; letter-spacing: -0.03em; color: #fff; }
.auth-subtitle { margin-top: 8px; font-size: 13px; line-height: 1.55; color: #94a3b8; }
.auth-form { display: grid; gap: 16px; margin-top: 24px; }
.auth-form .field label { color: #cbd5e1; }
.auth-form .input {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
}
.auth-form .input::placeholder { color: #64748b; }
.auth-form .input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(74, 158, 255, 0.18); }
.auth-form .btn-primary { width: 100%; padding: 12px; }
.auth-hint { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(20, 184, 166, 0.08); border: 1px solid rgba(20, 184, 166, 0.18); color: #99f6e4; font-size: 11.5px; line-height: 1.45; }
.auth-footer { margin-top: 18px; text-align: center; font-size: 11.5px; color: #64748b; }
.auth-footer a { color: #93c5fd; }
.auth-error { display: none; padding: 10px 12px; border-radius: 10px; background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.28); color: #fecaca; font-size: 12px; }
.auth-error.show { display: block; }

.scope-list { display: grid; gap: 10px; margin: 22px 0; }
.scope-item { display: flex; align-items: flex-start; gap: 11px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.055); border: 1px solid rgba(255, 255, 255, 0.09); }
.scope-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; background: rgba(74, 158, 255, 0.12); color: #93c5fd; flex: 0 0 auto; }
.scope-item strong { display: block; font-size: 12.5px; color: #f1f5f9; }
.scope-item span { display: block; margin-top: 2px; font-size: 11.5px; color: #94a3b8; line-height: 1.45; }
.scope-item .scope-required { margin-left: auto; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: #5eead4; }
.consent-user { display: flex; align-items: center; gap: 10px; padding: 11px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); }
.consent-user strong { display: block; font-size: 12.5px; color: #f8fafc; }
.consent-user span { display: block; margin-top: 2px; font-size: 11.5px; color: #94a3b8; }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.consent-actions .btn { width: 100%; padding: 12px; }
.consent-deny { background: rgba(255, 255, 255, 0.08); color: #e2e8f0; border-color: rgba(255, 255, 255, 0.14); }
.consent-deny:hover { background: rgba(255, 255, 255, 0.12); }
.auth-note { margin-top: 16px; font-size: 11px; line-height: 1.5; color: #64748b; text-align: center; }

/* ---------- SP app ---------- */

.sp-shell { min-height: 100vh; background: #f4f7fb; }
.sp-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--line); }
.sp-brand { display: flex; align-items: center; gap: 11px; }
.sp-logo { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #2563eb, #0d9488); color: #fff; font-size: 13px; font-weight: 800; }
.sp-brand strong { display: block; font-size: 14px; }
.sp-brand span { display: block; margin-top: 1px; font-size: 10.5px; color: var(--muted); }
.sp-nav { display: flex; align-items: center; gap: 4px; }
.sp-nav a { padding: 8px 11px; border-radius: 8px; font-size: 12.5px; color: var(--muted); }
.sp-nav a:hover { background: #f1f5f9; color: var(--ink); }
.sp-nav a.active { background: #eff6ff; color: #1d4ed8; font-weight: 700; }
.sp-top-actions { display: flex; align-items: center; gap: 10px; }
.sp-demo-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; background: #f0fdfa; color: #0f766e; border: 1px solid #ccfbf1; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.sp-main { max-width: 1240px; margin: 0 auto; padding: 28px 28px 96px; }
.sp-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; border-radius: 16px; background: linear-gradient(135deg, #eff6ff, #f0fdfa); border: 1px solid #dbeafe; margin-bottom: 22px; }
.sp-banner-left { display: flex; align-items: center; gap: 12px; }
.sp-banner-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: #2563eb; color: #fff; }
.sp-banner strong { display: block; font-size: 13.5px; }
.sp-banner span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.sp-token-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 9px; background: #fff; border: 1px solid #bfdbfe; color: #1d4ed8; font-size: 11.5px; font-weight: 750; font-family: var(--mono); }
.sp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.sp-welcome { margin-bottom: 18px; }
.sp-welcome h1 { font-size: 26px; letter-spacing: -0.03em; }
.sp-welcome p { margin-top: 5px; font-size: 13px; color: var(--muted); }
.pipeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pipeline-col { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-height: 340px; }
.pipeline-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.pipeline-col-head strong { font-size: 12.5px; }
.pipeline-col-head span { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px; background: #f1f5f9; color: var(--muted); font-size: 10.5px; font-weight: 800; }
.deal-card { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: #fbfdff; margin-bottom: 10px; }
.deal-card:last-child { margin-bottom: 0; }
.deal-top { display: flex; align-items: center; gap: 8px; }
.deal-top strong { font-size: 12px; }
.deal-top .deal-amount { margin-left: auto; font-size: 11.5px; font-weight: 800; color: #0f766e; }
.deal-card p { margin-top: 6px; font-size: 11px; color: var(--muted); line-height: 1.45; }
.deal-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.deal-tags .badge { padding: 3px 7px; font-size: 10px; }
.sp-side { display: grid; gap: 14px; }
.session-card { padding: 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.session-card h3 { font-size: 13px; margin-bottom: 12px; }
.session-user { display: flex; align-items: center; gap: 11px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.session-user strong { display: block; font-size: 13px; }
.session-user span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.session-meta { display: grid; gap: 9px; margin-top: 13px; }
.session-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); }
.session-meta-row strong { color: var(--ink); font-size: 11.5px; }
.session-actions { display: grid; gap: 8px; margin-top: 15px; }
.connected-apps { padding: 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.connected-apps h3 { font-size: 13px; margin-bottom: 12px; }
.connected-app { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.connected-app:last-child { border-bottom: 0; padding-bottom: 0; }
.connected-app strong { display: block; font-size: 12px; }
.connected-app span { display: block; margin-top: 1px; font-size: 10.5px; color: var(--muted); }
.connected-app .badge { margin-left: auto; }
.sp-footer { margin-top: 26px; text-align: center; font-size: 11px; color: var(--muted); }

/* ---------- Admin ---------- */

.admin-shell { min-height: 100vh; background: var(--bg); }
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 30;
  width: 248px;
  padding: 18px 14px;
  background: #0b1220;
  color: #cbd5e1;
  overflow-y: auto;
  transition: transform 0.25s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
.sidebar-brand strong { display: block; font-size: 14px; color: #fff; }
.sidebar-brand span { display: block; margin-top: 2px; font-size: 10.5px; color: #64748b; }
.sidebar-section { margin-top: 18px; }
.sidebar-section-label { padding: 0 10px 7px; font-size: 9.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #475569; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-size: 12.5px; color: #cbd5e1; transition: background 0.15s ease, color 0.15s ease; }
.sidebar-link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sidebar-link.active { background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(13, 148, 136, 0.85)); color: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22); }
.sidebar-link .sidebar-badge { margin-left: auto; padding: 2px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.12); font-size: 9.5px; font-weight: 800; }
.sidebar-footer { margin-top: 24px; padding: 12px 8px 4px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-user { display: flex; align-items: center; gap: 9px; }
.sidebar-user strong { display: block; font-size: 11.5px; color: #e2e8f0; }
.sidebar-user span { display: block; margin-top: 1px; font-size: 10px; color: #64748b; }
.sidebar-user .avatar { width: 32px; height: 32px; border-radius: 9px; font-size: 10px; }
.sidebar-footer .sidebar-link { margin-top: 8px; font-size: 11.5px; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 25; background: rgba(2, 6, 23, 0.45); }

.admin-main { margin-left: 248px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 24px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-menu { display: none; }
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.breadcrumb strong { color: var(--ink); font-weight: 750; }
.breadcrumb .sep { color: var(--line-2); }
.topbar-search { position: relative; width: min(320px, 30vw); }
.topbar-search .input { padding-left: 36px; background: #f8fafc; border-color: transparent; }
.topbar-search .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.notification-wrap { position: relative; }
.notification-menu { position: absolute; top: 46px; right: 0; z-index: 35; width: 320px; padding: 8px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18); display: none; }
.notification-menu.open { display: block; }
.notification-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 10px; border-bottom: 1px solid var(--line); }
.notification-menu-head strong { font-size: 12px; }
.notification-item { display: flex; gap: 9px; padding: 10px 8px; border-radius: 9px; }
.notification-item:hover { background: #f8fafc; }
.notification-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; flex: 0 0 auto; }
.notification-item strong { display: block; font-size: 11.5px; }
.notification-item span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.notification-item time { display: block; margin-top: 3px; font-size: 9.5px; color: var(--muted-2); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; font-size: 9.5px; }
.user-chip span { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }

.content { padding: 24px 24px 96px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-title { font-size: 26px; letter-spacing: -0.03em; line-height: 1.15; }
.page-subtitle { margin-top: 5px; font-size: 13px; color: var(--muted); line-height: 1.5; max-width: 720px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.demo-note { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; background: #fff7ed; border: 1px solid #fed7aa; color: #c2410c; font-size: 10.5px; font-weight: 750; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-card { padding: 17px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; }
.kpi-value { margin-top: 14px; font-size: 27px; line-height: 1; letter-spacing: -0.04em; font-weight: 800; }
.kpi-label { margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.kpi-delta { font-size: 10.5px; font-weight: 750; }
.kpi-delta.up { color: #15803d; }
.kpi-delta.down { color: #b91c1c; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 17px 18px 0; }
.card-title { font-size: 14px; letter-spacing: -0.01em; }
.card-subtitle { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.card-body { padding: 16px 18px 18px; }
.chart-legend { display: flex; align-items: center; gap: 14px; font-size: 10.5px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.chart-wrap { margin-top: 10px; }
.chart-wrap svg { width: 100%; height: auto; }

.activity-list { display: grid; gap: 2px; }
.activity-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; flex: 0 0 auto; }
.activity-item strong { display: block; font-size: 11.5px; }
.activity-item span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.activity-item time { margin-left: auto; font-size: 9.5px; color: var(--muted-2); white-space: nowrap; }

.usage-list { display: grid; gap: 13px; }
.usage-row { display: grid; gap: 5px; }
.usage-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; }
.usage-row-head strong { font-weight: 700; }
.usage-row-head span { color: var(--muted); }
.progress { height: 7px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; }

.status-list { display: grid; gap: 10px; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.status-row:last-child { border-bottom: 0; }
.status-row span { color: var(--muted); }
.status-row strong { font-size: 11.5px; }
.status-ok { display: inline-flex; align-items: center; gap: 5px; color: #15803d; font-weight: 750; }

.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick-action { display: flex; align-items: center; gap: 9px; padding: 11px; border-radius: 11px; border: 1px solid var(--line); background: #fbfdff; text-align: left; font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.quick-action:hover { border-color: #bfdbfe; background: #eff6ff; }

/* ---------- Tables ---------- */

.table-card { margin-top: 16px; }
.table-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filter-grid { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.filter-field { display: flex; flex-direction: column; gap: 5px; }
.filter-field label { font-size: 10.5px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.filter-field .input, .filter-field .select { min-width: 150px; padding: 8px 10px; font-size: 12px; border-radius: 9px; }
.filter-field .input { min-width: 220px; }
.result-count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.data-table { min-width: 820px; }
.data-table th { padding: 10px 16px; text-align: left; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 12px 16px; font-size: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfdff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.cell-main { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.cell-main strong { display: block; font-size: 12px; }
.cell-main span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.cell-mono { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.audit-context { display: block; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-actions { display: flex; align-items: center; gap: 5px; }
.table-empty { padding: 28px 18px; text-align: center; font-size: 12px; color: var(--muted); }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.pagination { display: flex; align-items: center; gap: 4px; }
.pagination button { min-width: 28px; height: 28px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--muted); font-size: 11px; }
.pagination button.active { background: var(--blue-2); border-color: var(--blue-2); color: #fff; }
.pagination button:hover:not(.active) { background: #f8fafc; }

.scope-badges { display: flex; flex-wrap: wrap; gap: 4px; max-width: 230px; }
.scope-badges .badge { padding: 3px 7px; font-size: 9.5px; }
.role-badges { display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; }
.role-badges .badge { padding: 3px 7px; font-size: 9.5px; }

/* ---------- Modals ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 40px 100px rgba(2, 6, 23, 0.35);
  transform: translateY(10px) scale(0.99);
  transition: transform 0.18s ease;
}
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 720px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 0; }
.modal-head h3 { font-size: 17px; letter-spacing: -0.02em; }
.modal-head p { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.modal-close { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); flex: 0 0 auto; }
.modal-close:hover { background: #f8fafc; color: var(--ink); }
.modal-body { padding: 18px 22px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 0 22px 22px; }
.modal-note { padding: 10px 12px; border-radius: 10px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; font-size: 11.5px; line-height: 1.5; }
.modal-success { display: grid; gap: 12px; }
.secret-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); }
.secret-row code { flex: 1; font-family: var(--mono); font-size: 11px; color: var(--ink-2); overflow-wrap: anywhere; }
.secret-row .btn { flex: 0 0 auto; }
.json-block { padding: 14px; border-radius: 12px; background: #0b1220; color: #e2e8f0; font-family: var(--mono); font-size: 11px; line-height: 1.55; overflow-x: auto; white-space: pre-wrap; }

/* ---------- Toasts ---------- */

.toast-root { position: fixed; right: 22px; bottom: 86px; z-index: 70; display: flex; flex-direction: column; gap: 9px; width: min(360px, 92vw); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #0b1220; color: #e2e8f0; box-shadow: 0 18px 40px rgba(2, 6, 23, 0.35); border-left: 4px solid var(--blue); animation: toastIn 0.2s ease both; pointer-events: auto; }
.toast.success { border-left-color: var(--green); }
.toast.warning { border-left-color: var(--amber); }
.toast.danger { border-left-color: var(--red); }
.toast strong { display: block; font-size: 12px; }
.toast span { display: block; margin-top: 2px; font-size: 11px; color: #94a3b8; line-height: 1.45; }
.toast .toast-icon { flex: 0 0 auto; margin-top: 1px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Roles / federation / tenants / security / developer ---------- */

.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.role-card { padding: 17px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.role-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.role-name { font-family: var(--mono); font-size: 12px; font-weight: 800; color: var(--ink); }
.role-scope { margin-top: 3px; font-size: 10.5px; color: var(--muted); }
.role-card p { margin-top: 10px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.permission-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.permission-chip { padding: 3px 7px; border-radius: 6px; background: #f1f5f9; color: #475569; font-size: 9.5px; font-weight: 650; }

.federation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.provider-card { padding: 17px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.provider-head { display: flex; align-items: flex-start; gap: 11px; }
.provider-head .avatar { width: 42px; height: 42px; border-radius: 12px; }
.provider-head strong { display: block; font-size: 13px; }
.provider-head span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.provider-head .badge { margin-left: auto; }
.provider-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.provider-meta div { padding: 8px 9px; border-radius: 9px; background: #f8fafc; border: 1px solid var(--line); }
.provider-meta span { display: block; font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.provider-meta strong { display: block; margin-top: 3px; font-size: 11.5px; }
.provider-endpoint { margin-top: 10px; font-family: var(--mono); font-size: 9.5px; color: var(--muted); overflow-wrap: anywhere; line-height: 1.45; }

.flow-card { margin-top: 16px; }
.flow-diagram { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 0 4px; flex-wrap: wrap; }
.flow-node { min-width: 150px; padding: 14px; border-radius: 13px; border: 1px solid var(--line); background: #fbfdff; text-align: center; }
.flow-node strong { display: block; font-size: 12px; }
.flow-node span { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); }
.flow-node .avatar { margin: 0 auto 8px; }
.flow-arrow { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 9.5px; }
.flow-arrow .line { width: 54px; height: 1px; background: var(--line-2); position: relative; }
.flow-arrow .line::after { content: ""; position: absolute; right: -1px; top: -3px; border-left: 6px solid var(--line-2); border-top: 4px solid transparent; border-bottom: 4px solid transparent; }

.tenant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tenant-card { padding: 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.tenant-head { display: flex; align-items: flex-start; gap: 11px; }
.tenant-head .avatar { width: 44px; height: 44px; border-radius: 13px; font-size: 13px; }
.tenant-head strong { display: block; font-size: 14px; }
.tenant-head span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.tenant-head .badge { margin-left: auto; }
.tenant-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.tenant-stat { padding: 9px; border-radius: 9px; background: #f8fafc; border: 1px solid var(--line); text-align: center; }
.tenant-stat strong { display: block; font-size: 16px; letter-spacing: -0.03em; }
.tenant-stat span { display: block; margin-top: 2px; font-size: 9.5px; color: var(--muted); }
.tenant-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted); }

.security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row strong { display: block; font-size: 12px; }
.setting-row span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); line-height: 1.45; }
.toggle { position: relative; width: 42px; height: 24px; border-radius: 999px; border: 0; background: #cbd5e1; flex: 0 0 auto; transition: background 0.18s ease; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.18s ease; }
.toggle.on { background: var(--blue-2); }
.toggle.on::after { transform: translateX(18px); }
.toggle:focus-visible { outline: 3px solid rgba(74, 158, 255, 0.35); outline-offset: 2px; }
.compliance-list { display: flex; flex-wrap: wrap; gap: 8px; }
.compliance-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line); background: #fbfdff; font-size: 10.5px; font-weight: 700; color: var(--ink-2); }

.endpoint-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.endpoint-card { padding: 14px; border-radius: 13px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm); }
.endpoint-head { display: flex; align-items: center; gap: 8px; }
.endpoint-method { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; padding: 3px 7px; border-radius: 5px; background: #dcfce7; color: #15803d; font-family: var(--mono); font-size: 9.5px; font-weight: 800; }
.endpoint-method.post { background: #dbeafe; color: #1d4ed8; }
.endpoint-card strong { font-size: 11.5px; }
.endpoint-path { margin-top: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); overflow-wrap: anywhere; }
.endpoint-card p { margin-top: 6px; font-size: 10.5px; color: var(--muted); line-height: 1.45; }
.code-card { margin-top: 16px; }
.code-tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.code-tab { padding: 11px 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.code-tab.active { color: var(--blue-2); border-bottom-color: var(--blue-2); }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; }
.code-toolbar span { font-size: 10.5px; color: var(--muted); }
.code-block { margin: 0 18px 18px; padding: 16px; border-radius: 12px; background: #0b1220; color: #e2e8f0; font-family: var(--mono); font-size: 11px; line-height: 1.6; overflow-x: auto; white-space: pre; }
.checklist { display: grid; gap: 10px; }
.checklist-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist-item:last-child { border-bottom: 0; }
.check-circle { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #dcfce7; color: #15803d; flex: 0 0 auto; }
.checklist-item strong { display: block; font-size: 11.5px; }
.checklist-item span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); line-height: 1.45; }

/* ---------- Footer ---------- */

.footer { padding: 20px 0 0; text-align: center; font-size: 11px; color: var(--muted); }

/* ---------- Responsive ---------- */

@media (max-width: 1120px) {
  .view-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .sp-grid { grid-template-columns: 1fr; }
  .sp-side { grid-template-columns: 1fr 1fr; }
  .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tenant-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }
  .admin-main { margin-left: 0; }
  .topbar-menu { display: inline-flex; }
  .topbar-search { display: none; }
  .home-nav { display: none; }
  .hero { padding: 34px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline-col { min-height: auto; }
  .security-grid { grid-template-columns: 1fr; }
  .federation-grid { grid-template-columns: 1fr; }
  .endpoint-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .home-topbar { padding: 18px 18px; }
  .home-top-actions { display: none; }
  .home-main { padding: 4px 18px 44px; }
  .hero { padding: 26px 22px; border-radius: 22px; }
  .hero-title { font-size: 34px; }
  .hero-text { font-size: 14px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .hero-stats { gap: 8px; margin-top: 24px; }
  .stat-pill { padding: 11px 12px; }
  .stat-pill strong { font-size: 18px; }
  .view-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .section-head .section-note { display: none; }
  .home-footer { flex-direction: column; align-items: flex-start; padding: 18px 18px 32px; }
  .auth-topbar { padding: 18px; }
  .auth-main { padding: 10px 16px 40px; }
  .auth-card { padding: 24px; border-radius: 18px; }
  .auth-title { font-size: 21px; }
  .consent-actions { grid-template-columns: 1fr; }
  .sp-topbar { padding: 12px 16px; }
  .sp-nav { display: none; }
  .sp-main { padding: 20px 16px 44px; }
  .sp-banner { flex-direction: column; align-items: flex-start; }
  .sp-side { grid-template-columns: 1fr; }
  .topbar { padding: 10px 12px; }
  .topbar-actions > .btn { display: none; }
  .topbar-actions .user-chip { display: none; }
  .breadcrumb { font-size: 11px; }
  .content { padding: 18px 14px 90px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-title { font-size: 22px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { padding: 13px; }
  .kpi-value { font-size: 22px; }
  .quick-actions { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .role-grid { grid-template-columns: 1fr; }
  .filter-grid { flex-direction: column; align-items: stretch; }
  .filter-field .input, .filter-field .select { min-width: 0; width: 100%; }
  .table-toolbar { align-items: stretch; }
  .table-footer { flex-direction: column; align-items: flex-start; }
  .guide-fab { right: 14px; bottom: 14px; padding: 11px 13px; font-size: 12px; }
  .toast-root { right: 12px; bottom: 70px; }
  .user-chip span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
