/* Platform shell: sign-in, user menu, admin pages. Builds on theme.css (the dashboard's own styles). */
body.booting main, body.booting header.top { visibility: hidden; }
.boot-screen { display: none; }
body.booting .boot-screen { display: grid; place-items: center; align-content: center; gap: 14px; position: fixed; inset: 0; background: var(--bg); z-index: 50; color: var(--muted); }
.boot-screen img { height: 40px; }
.boot-screen p { margin: 0; font-size: 14px; }
.boot-screen.error p { color: var(--red); max-width: 460px; text-align: center; }

/* user menu in the dashboard/admin header */
.usermenu { display: flex; align-items: center; gap: 10px; margin-left: 18px; }
.usermenu select { font: inherit; font-size: 12.5px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); max-width: 220px; }
.usermenu a, .usermenu button.link { font: inherit; font-size: 12.5px; color: var(--accent); font-weight: 600; text-decoration: none; background: none; border: 0; cursor: pointer; padding: 4px 2px; white-space: nowrap; }
.usermenu a:hover, .usermenu button.link:hover { text-decoration: underline; }
.usermenu .who { font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 900px) { .usermenu .who { display: none; } }
@media (max-width: 600px) { .usermenu { gap: 6px; margin-left: 6px; } .usermenu select { max-width: 120px; } }

/* sign-in */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, #fbfaf8 0%, #f3ece9 100%); }
.auth-card { width: 100%; max-width: 400px; padding: 30px 30px 26px; }
.auth-card .logo { height: 40px; margin: 0 auto 6px; }
.auth-card h1 { font-size: 20px; text-align: center; margin: 10px 0 4px; }
.auth-card .lede { text-align: center; color: var(--muted); margin: 0 0 20px; font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--muted); }
.field input, .field select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 14px; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus { outline: 2px solid var(--accent-soft); border-color: #a17690; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--brand-plum); background: var(--brand-plum); color: #fff; font: inherit; font-weight: 600; font-size: 13.5px; padding: 9px 16px; border-radius: 9px; cursor: pointer; }
.btn:hover { background: var(--dark); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.secondary { background: #fff; color: var(--brand-plum); }
.btn.secondary:hover { background: var(--accent-soft); }
.btn.small { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.danger { background: #fff; color: var(--red); border-color: #e3b8ae; }
.btn.block { width: 100%; }
.msg { font-size: 13px; margin: 10px 0 0; padding: 9px 11px; border-radius: 8px; }
.msg.err { background: var(--red-soft); color: var(--red); }
.msg.ok { background: var(--good-soft); color: var(--good); }
.msg.info { background: var(--blue-soft); color: var(--blue); }
.hidden { display: none !important; }
.auth-foot { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 18px; }

/* admin pages */
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 18px 0 16px; padding: 4px; background: #f3f0ef; border: 1px solid #e8e1e3; border-radius: 12px; width: fit-content; }
.admin-tabs button { border: 1px solid transparent; background: transparent; font: inherit; font-size: 13px; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--ink); }
.admin-tabs button.on { background: #fff; border-color: #a17690; color: var(--brand-plum); font-weight: 600; box-shadow: 0 1px 4px rgba(79, 26, 55, .10); }
.panel { display: none; }
.panel.on { display: block; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpis .card .v { font-size: 24px; font-weight: 650; color: var(--brand-plum); }
.kpis .card .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-card { padding: 4px 6px; overflow-x: auto; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #f0ece7; color: var(--ink); text-transform: capitalize; }
.pill.grn { background: var(--good-soft); color: var(--good); }
.pill.amb { background: var(--amber-soft); color: #7a4f10; }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.plum { background: var(--accent-soft); color: var(--brand-plum); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.form-row .field { margin-bottom: 0; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 10px; gap: 12px; flex-wrap: wrap; }
.section-title h2 { font-size: 16px; margin: 0; font-weight: 650; }
.section-title span { color: var(--muted); font-size: 12.5px; }
.secret { font-family: ui-monospace, Consolas, monospace; background: #fff8e8; border: 1px dashed #d9b36a; padding: 2px 8px; border-radius: 6px; user-select: all; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding: 8px 4px 0; }
.bars div { flex: 1; background: var(--brand-plum); opacity: .8; border-radius: 3px 3px 0 0; min-height: 2px; }
.bars-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); padding: 4px 4px 0; }
.muted { color: var(--muted); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* scorlabs IQ AI layer */
.iq-ai-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 8px; font-size: 12px; color: var(--iq-muted, #64766c); flex-wrap: wrap; }
.iq-ai-bar .seg button { font-size: 12px; padding: 4px 10px; }
.iq-ai-status { display: inline-flex; align-items: center; gap: 6px; }
.iq-ai-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--iq-sage, #527f6d); display: inline-block; }
.iq-ai-status.busy i { animation: iqpulse 1s infinite ease-in-out; }
.iq-ai-status.err i { background: var(--red); }
@keyframes iqpulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.iq-ai-headline { font-weight: 650; color: var(--iq-dark, #2f5d4e); margin: 2px 0 8px; font-size: 14px; }
.iq-fb { display: inline-flex; gap: 6px; margin-left: 8px; vertical-align: middle; }
.card.find .iq-fb { display: flex; margin: 8px 0 0; }
.iq-fb button { font: inherit; font-size: 11px; color: var(--iq-muted, #64766c); background: transparent; border: 1px solid var(--iq-line, #dbe8df); border-radius: 999px; padding: 1px 8px; cursor: pointer; }
.iq-fb button:hover { color: var(--iq-dark, #2f5d4e); border-color: var(--iq-sage, #527f6d); }
.iq-fb .muted { font-size: 11px; }
.memory-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line2); align-items: flex-start; }
.memory-list li:last-child { border-bottom: 0; }
.memory-list { list-style: none; margin: 0; padding: 0; }
textarea.note { width: 100%; min-height: 80px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 14px; resize: vertical; }
.usermenu .who { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.2; background: none; border: 0; cursor: pointer; padding: 2px 4px; font: inherit; text-align: right; border-radius: 6px; }
.usermenu .who:hover { background: #f7f3ee; }
.usermenu .who b { font-size: 12.5px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.usermenu .who small { font-size: 11px; color: var(--muted); white-space: nowrap; }
@media (max-width: 900px) { .usermenu .who small { display: none; } }
