/* SpinFace Bio console. SpinMinds brand: purple lead, rainbow accent, light surfaces so the logo reads. */
:root {
  --bg: #f5f6fb; --surface: #ffffff; --surface-2: #f9f9fd; --text: #161a33; --muted: #646a85; --line: #e7e8f1;
  --primary: #7b2d8e; --primary-strong: #5f1f70; --primary-ink: #ffffff; --primary-soft: #f3e8f7;
  --pink: #ec268f; --red: #e03a3c; --orange: #f47b20; --yellow: #f2c500; --green: #3cb54a; --blue: #29abe2;
  --ok: #15803d; --ok-soft: #dcfce7; --warn: #b45309; --warn-soft: #fef3c7; --bad: #c81e1e; --bad-soft: #fee2e2;
  --in: #15803d; --out: #e0560f;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(22, 26, 51, .05), 0 6px 24px rgba(22, 26, 51, .06);
  --rainbow: linear-gradient(90deg, #7b2d8e, #ec268f, #e03a3c, #f47b20, #f2c500, #3cb54a, #29abe2);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 14px; }
code { font: .88em ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.rainbow { height: 4px; background: var(--rainbow); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
/* Grid children may shrink below their content (the scrolling phone menu must not widen the page). */
.shell > * { min-width: 0; }
.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .logo { padding: 22px 22px 6px; display: block; }
.side .logo img { height: 34px; width: auto; display: block; }
.side .product { margin: 8px 22px 18px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--primary); }
.side .product .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rainbow); }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; position: relative; }
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); }
.nav .sep { height: 1px; background: var(--line); margin: 10px 12px; }
.side .foot { margin-top: auto; padding: 14px 16px 18px; border-top: 1px solid var(--line); }
.side .who { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--primary), var(--pink)); flex: none; }
.side .who .name { font-weight: 600; font-size: .9rem; line-height: 1.2; }
.side .who .role { font-size: .78rem; color: var(--muted); }
.side .foot button { width: 100%; }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px clamp(16px, 4vw, 40px); background: rgba(245, 246, 251, .85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); }
.topbar .org { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.topbar .org .badge { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-size: .85rem; font-weight: 700; background: var(--primary); }
.topbar form { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.topbar select { width: auto; min-width: 200px; padding: 8px 12px; }
.content { padding: 26px clamp(16px, 4vw, 40px) 48px; max-width: 1240px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .logo { padding: 14px 16px 4px; }
  .side .logo img { height: 28px; }
  .side .product { margin: 4px 16px 10px; }
  .nav { flex-direction: row; overflow-x: auto; padding: 0 10px 10px; gap: 4px; scrollbar-width: none; }
  .nav a { white-space: nowrap; padding: 8px 12px; }
  .nav a.on::before { display: none; }
  .nav .sep { display: none; }
  .side .foot { display: none; }
  .topbar { position: static; flex-wrap: wrap; }
  .topbar form { margin-left: 0; width: 100%; }
  .topbar select { flex: 1; min-width: 0; }
  .mobile-only { display: inline-flex !important; }
}
.mobile-only { display: none !important; }

/* ---------- building blocks ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 22px; margin-bottom: 18px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; }
.stat .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; }
.stat .ic svg { width: 21px; height: 21px; }
.stat b { display: block; font-size: 1.9rem; line-height: 1.1; letter-spacing: -.02em; margin-top: 2px; }
.stat .lbl { color: var(--muted); font-size: .88rem; font-weight: 500; }
.ic.purple { background: var(--primary); } .ic.pink { background: var(--pink); } .ic.blue { background: var(--blue); }
.ic.green { background: var(--green); } .ic.orange { background: var(--orange); }
.stat.hero { background: linear-gradient(135deg, #7b2d8e 0%, #b0278f 55%, #ec268f 100%); color: #fff; border: 0; }
.stat.hero .lbl, .stat.hero .muted { color: rgba(255, 255, 255, .85); }
.stat.hero .ic { background: rgba(255, 255, 255, .18); }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 170px; }
label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
input, select { width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid #d9dbe7; background: #fff; color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--primary); color: var(--primary-ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, transform .05s; text-decoration: none; }
button:hover, .btn:hover { background: var(--primary-strong); text-decoration: none; }
button:active { transform: translateY(1px); }
button svg, .btn svg, .tag svg { width: 18px; height: 18px; flex: none; }
.btn.ghost, button.ghost { background: var(--primary-soft); color: var(--primary); }
.btn.ghost:hover, button.ghost:hover { background: #ead6f1; }
button.quiet { background: transparent; color: var(--muted); border-color: var(--line); }
button.quiet:hover { background: var(--surface-2); color: var(--text); }
button.danger { background: transparent; color: var(--bad); border-color: #f3c4c4; padding: 6px 12px; font-size: .88rem; }
button.danger:hover { background: var(--bad-soft); }
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; background: var(--ok-soft); color: #14532d; border: 1px solid #bbf7d0; }
.flash.err { background: var(--bad-soft); color: #7f1d1d; border-color: #fecaca; }
.secret { border: 2px dashed var(--primary); background: #fcf8fe; }
.code { font: 700 1.9rem/1.25 ui-monospace, Consolas, monospace; letter-spacing: 4px; color: var(--primary); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--primary-soft); color: var(--primary); }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
.in { color: var(--in); font-weight: 700; } .out { color: var(--out); font-weight: 700; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: #c9c3d8; display: block; margin: 0 auto 10px; }

/* Tables turn into labelled cards on phones. */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
th:first-child { border-top-left-radius: 10px; } th:last-child { border-top-right-radius: 10px; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover td { background: #fcfcff; }
tr:last-child td { border-bottom: 0; }
@media (max-width: 720px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
  table.stack td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.stack td::before { content: attr(data-l); color: var(--muted); font-size: .84rem; text-align: left; }
  tbody tr:hover td { background: transparent; }
}
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; }
.tabs a { padding: 7px 16px; border-radius: 9px; color: var(--muted); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.on { background: var(--primary); color: #fff; }
.pager { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.auth .brand { position: relative; overflow: hidden; color: #fff; padding: 48px clamp(28px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at -10% -20%, #a33ab9 0%, transparent 60%), radial-gradient(900px 500px at 110% 120%, #ec268f 0%, transparent 55%), linear-gradient(160deg, #3b1048 0%, #5f1f70 45%, #7b2d8e 100%); }
.auth .brand .globe { position: absolute; right: -90px; bottom: -70px; width: 460px; opacity: .14; filter: grayscale(1) brightness(2.2); pointer-events: none; }
.auth .brand h1 { font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 1.1; margin: 18px 0 14px; letter-spacing: -.02em; }
.auth .brand p.lead { font-size: 1.05rem; color: rgba(255, 255, 255, .85); max-width: 460px; margin: 0; }
.auth .brand .tag { display: inline-flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); padding: 6px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.auth .brand ul { list-style: none; padding: 0; margin: 34px 0 0; display: grid; gap: 14px; max-width: 460px; }
.auth .brand li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255, 255, 255, .92); }
.auth .brand li svg { width: 22px; height: 22px; flex: none; color: #ffd36b; margin-top: 1px; }
.auth .brand .fine { font-size: .8rem; color: rgba(255, 255, 255, .6); }
.auth .panel { display: grid; place-items: center; padding: 32px 20px; position: relative; }
.auth .panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--rainbow); }
.auth .form { width: min(400px, 100%); }
.auth .form .logo { height: 44px; width: auto; display: block; margin-bottom: 30px; }
.auth .form h2 { font-size: 1.45rem; margin: 0 0 6px; }
.auth .form p.sub { color: var(--muted); margin: 0 0 24px; }
.auth .form .field { margin-bottom: 16px; }
.auth .form button { width: 100%; padding: 12px; font-size: 1rem; margin-top: 6px; }
.auth .form .help { margin-top: 22px; font-size: .84rem; color: var(--muted); text-align: center; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth .brand { padding: 28px 22px 30px; }
  .auth .brand ul, .auth .brand .fine, .auth .brand .globe { display: none; }
  .auth .brand h1 { font-size: 1.7rem; margin: 12px 0 6px; }
  .auth .panel { padding: 28px 18px 40px; place-items: start center; }
  .auth .form .logo { height: 36px; margin-bottom: 20px; }
}
