/* block-system-admin · phase 0 styles
 * Minimal CSS. No framework. Bumps to a proper system in V1.1.
 */

:root {
  --bg:           #f7f7f5;
  --surface:      #ffffff;
  --surface-alt:  #f0efea;
  --text:         #1c1b18;
  --text-soft:    #6b6a66;
  --border:       #e3e1da;
  --accent:       #2a4a78;
  --accent-soft:  #e7edf6;
  --danger:       #b2371f;
  --success:      #2f7a3f;
  --shadow:       0 1px 2px rgba(0,0,0,0.05);
  --shadow-lg:    0 8px 24px rgba(0,0,0,0.08);
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
}
.topbar__brand {
  font-weight: 600;
  font-size: 0.95rem;
  color: inherit;
}
.topbar__user { display: flex; align-items: center; gap: 0.75rem; }
.topbar__name { font-size: 0.9rem; }
.topbar__role {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 3px;
}
.topbar__logout { margin: 0; }
.topbar--editor .topbar__inner { max-width: none; }
.topbar__crumbs { flex: 1; font-size: 0.9rem; color: var(--text-soft); }
.topbar__crumbs a { color: var(--accent); }
.topbar__sep { margin: 0 0.5rem; opacity: 0.5; }

/* ---------- Page wrapper ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.page__head { margin-bottom: 1.75rem; }
.page__title { margin: 0 0 0.35rem; font-size: 1.75rem; font-weight: 600; }
.page__sub   { margin: 0; color: var(--text-soft); }
.page__breadcrumb {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
}
.card--stub { background: var(--surface-alt); }
.card__title { margin: 0 0 0.85rem; font-size: 1rem; font-weight: 600; }
.muted { color: var(--text-soft); font-size: 0.9rem; }

/* ---------- Banner (settings save / test feedback) ---------- */
.banner {
  padding: 0.7rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.banner--ok  { background: #e3f1e5; color: var(--success); }
.banner--err { background: #fbeae5; color: var(--danger); }

/* ---------- Form (settings page) ---------- */
.form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}
.field--wide { grid-column: 1 / -1; }
.form__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ---------- Key/value list ---------- */
.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
}
.kv dt { color: var(--text-soft); font-size: 0.85rem; }
.kv dd { margin: 0; font-size: 0.92rem; }

/* ---------- Site list ---------- */
.site-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
.site {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.site:hover { border-color: var(--accent); }
.site__link {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: inherit;
  text-decoration: none;
}
.site__link:hover { text-decoration: none; }
.site__main { flex: 1; }
.site__name { font-weight: 600; font-size: 1rem; margin-bottom: 0.25rem; }
.site__meta { display: flex; align-items: center; gap: 0.65rem; font-size: 0.85rem; }
.site__slug { color: var(--text-soft); }
.site__status {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}
.site__status--live     { background: #e3f1e5; color: var(--success); }
.site__status--building { background: #fff4d5; color: #997a14; }
.site__status--paused   { background: #ecebe5; color: var(--text-soft); }
.site__status--dead     { background: #fbeae5; color: var(--danger); }
.site__preview-link { font-size: 0.85rem; color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.55rem 1rem;
  font-family: var(--font);
  font-size: 0.92rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--surface-alt); }
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover { background: #1f3a60; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-alt); }
.btn--small { padding: 0.35rem 0.7rem; font-size: 0.82rem; }
.btn--danger {
  background: var(--danger); color: #fff; border-color: var(--danger);
}
.btn--danger:hover { background: #8d2a16; }

/* ---------- Table (user list) ---------- */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.table th {
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 600;
  padding: 0.7rem 1rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-weight: 600;
}
.badge--admin  { background: var(--accent-soft); color: var(--accent); }
.badge--client { background: #e7f1e8; color: var(--success); }

/* ---------- Assignment checkbox grid (user form) ---------- */
.assign-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.assign-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0;
  font-size: 0.92rem;
}
.assign-row code { color: var(--text-soft); }

/* ---------- Palette swatch picker ---------- */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}
.palette-swatch {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.palette-swatch__label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.palette-swatch__color {
  width: 100%;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px;
  cursor: pointer;
  background: transparent;
}
.palette-swatch__hex {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-alt);
  color: var(--text);
}

/* ---------- Login ---------- */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.login {
  width: 100%;
  max-width: 380px;
  padding: 2rem;
}
.login__head { text-align: center; margin-bottom: 2rem; }
.login__brand { font-size: 1.15rem; font-weight: 600; }
.login__sub { color: var(--text-soft); font-size: 0.85rem; margin-top: 0.35rem; }
.login__form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.login__error {
  padding: 0.65rem 0.85rem;
  background: #fbeae5;
  color: var(--danger);
  border-radius: 5px;
  font-size: 0.88rem;
}
.login__foot {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--text-soft);
}

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field__label { font-size: 0.82rem; font-weight: 500; color: var(--text-soft); }
.field__input {
  width: 100%;
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
}
.field__input:focus { outline: none; border-color: var(--accent); }

/* ---------- Empty state ---------- */
.empty {
  padding: 2rem;
  background: var(--surface-alt);
  border-radius: 8px;
  text-align: center;
  color: var(--text-soft);
}
