/* Simple centred pages (landing, sign in) and the super-admin console. */

.brand { display: inline-flex; color: var(--text); align-items: center; gap: var(--space-2); font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); color: var(--text); text-decoration: none; letter-spacing: var(--tracking-tight); }
.brand-mark { width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0; position: relative; background: conic-gradient(from 210deg, var(--violet-500), var(--pink-500), var(--cyan-400), var(--violet-500)); box-shadow: inset 0 0 0 6px var(--surface); }
.brand-mark::after { content: ''; position: absolute; top: 9px; right: 9px; bottom: 9px; left: 9px; border-radius: 50%; background: conic-gradient(from 210deg, var(--violet-500), var(--pink-500)); }
.brand-lg { font-size: var(--text-2xl); }
.brand-lg .brand-mark { width: 36px; height: 36px; }

.centered-page { display: grid; place-items: center; padding: var(--space-6) var(--space-4); }
.auth { width: 100%; display: grid; place-items: center; }
.auth-card { width: min(100%, 420px); padding: var(--space-8); display: flex; flex-direction: column; gap: var(--space-4); box-shadow: var(--shadow-lg); }
.auth-title { font-size: var(--text-3xl); margin-top: var(--space-3); }
.auth-foot { text-align: center; margin-top: var(--space-2); }
.stack-form { display: flex; flex-direction: column; gap: var(--space-4); }
.input-code { font-family: var(--font-display); font-size: var(--text-xl); letter-spacing: 0.04em; text-transform: lowercase; }

/* ---------- super-admin ---------- */
.admin-top { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) var(--space-6); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
.admin-top .row { display: flex; align-items: center; gap: var(--space-2); }
.admin-main { max-width: 1200px; margin: 0 auto; padding: var(--space-8) var(--space-6) var(--space-16); }
.admin-main section + section { margin-top: var(--space-12); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.section-head h2 { font-size: var(--text-3xl); }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-4); }
.client-card { display: flex; flex-direction: column; gap: var(--space-3); }
.client-card header { display: flex; align-items: center; gap: var(--space-3); }
.client-card .swatches { display: flex; gap: 4px; margin-left: auto; }
.client-card .swatches i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.client-card .logo { height: 40px; width: auto; max-width: 120px; object-fit: contain; border-radius: 8px; background: #fff; padding: 3px 6px; }
.client-card .mark { width: 40px; height: 40px; border-radius: 12px; background: conic-gradient(from 210deg, var(--_c1), var(--_c2), var(--_c1)); flex-shrink: 0; }
.client-card h3 { font-size: var(--text-lg); line-height: 1.25; }
.client-card .link { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--primary-text); word-break: break-all; }
.client-card .stats { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.client-card .actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th, td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td .actions { display: flex; gap: var(--space-2); justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); align-items: end; }
.form-grid .field + .field { margin-top: 0; }
.dlg-gap { flex: 1; } /* pushes the buttons after it to the right */
.with-btn { display: flex; gap: var(--space-2); }
.with-btn .input { flex: 1; }
dialog { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); padding: var(--space-6); width: min(92vw, 460px); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: var(--surface-overlay); }
dialog form { display: flex; flex-direction: column; gap: var(--space-4); }
dialog .btn-row { display: flex; gap: var(--space-2); justify-content: flex-end; }
@media (max-width: 640px) {
  .admin-top, .admin-main { padding-inline: var(--space-4); }
}

/* sign in: "or" divider before the passkey button */
.auth-or { display: flex; align-items: center; gap: var(--space-3); color: var(--text-muted); font-size: var(--text-sm); }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

dialog.dlg-wide { width: min(94vw, 760px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: var(--space-3); margin-bottom: var(--space-4); }
.dlg-head .card-title { margin: 0; }
.dlg-head form { display: block; }

/* admin: which clients a user can run */
.client-checks-field { grid-column: 1 / -1; border: 0; padding: 0; margin: 0; }
.client-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-2) var(--space-4); margin: var(--space-2) 0; }
.client-list { display: flex; flex-wrap: wrap; gap: 4px; }

/* admin: data processing agreement details */
.dpa-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); margin: var(--space-3) 0; }
.dpa-fields .field + .field { margin-top: 0; }
.dpa-wide { grid-column: 1 / -1; }
.dpa-fields ~ .hint .icon, #dpa-state .icon { vertical-align: -2px; }
#dpa-state .warn-line { display: inline-flex; align-items: center; gap: 6px; color: var(--warning); font-weight: 600; }
