/* RingKeeper dashboard — brand system (tokens mirror ringkeeper-site / chat.hymma.au).
   Hand-rolled, no framework. Aesthetic: Linear/Stripe with a touch of warmth. */
:root {
  --bg: #fafaf9;
  --bg-pure: #ffffff;
  --text: #0c0a09;
  --muted: #57534e;
  --soft: #78716c;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --surface: #f5f5f4;

  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #dbeafe;
  --highlight: #b45309;
  --highlight-soft: #fef3c7;
  --success: #15803d;
  --success-soft: #dcfce7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(12, 10, 9, 0.05);
  --shadow-md: 0 6px 24px rgba(12, 10, 9, 0.08);
  --shadow-lg: 0 24px 60px rgba(12, 10, 9, 0.18);

  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, 'Helvetica Neue', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Consolas, 'Liberation Mono', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: -0.02em; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Brand mark */
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display);
  font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -0.01em; }
.brand__mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: #fff; font-weight: 700; font-family: var(--font-display); }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 24px;
  background: var(--bg-pure); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 14px; line-height: 1;
  padding: 10px 18px; border-radius: var(--radius-md); border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); color: #fff; }
.btn--ghost { background: var(--bg-pure); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--danger { background: transparent; color: var(--danger); border-color: transparent; padding: 6px 10px; font-size: 13px; }
.btn--danger:hover { background: var(--danger-soft); }
.btn--google { background: var(--bg-pure); color: var(--text); border-color: var(--border-strong); font-size: 15px; padding: 12px 22px; }
.btn--google:hover { box-shadow: var(--shadow-sm); border-color: var(--accent); }
.btn[disabled] { opacity: .55; cursor: default; }

/* Forms */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=tel], input[type=email], textarea, select {
  width: 100%; font: inherit; font-size: 14px; padding: 10px 12px; color: var(--text);
  background: var(--bg-pure); border: 1px solid var(--border-strong); border-radius: var(--radius-md); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }

/* Cards & layout */
.card { background: var(--bg-pure); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.center-wrap { min-height: calc(100vh - 61px); display: grid; place-items: center; padding: 24px; }

/* Login */
.login { text-align: center; max-width: 420px; }
.login .pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--accent-hover); background: var(--accent-soft); padding: 6px 14px; border-radius: var(--radius-pill); }
.login h1 { font-size: 2rem; margin: 22px 0 10px; }
.login p { color: var(--muted); margin: 0 0 26px; }

/* Wizard */
.wizard { width: 100%; max-width: 560px; }
.steps { display: flex; gap: 8px; margin-bottom: 22px; }
.steps .step { flex: 1; height: 4px; border-radius: var(--radius-pill); background: var(--surface); }
.steps .step.active { background: var(--accent); }
.steps .step.done { background: var(--success); }
.wizard h2 { font-size: 1.4rem; margin: 0 0 6px; }
.wizard .lead { color: var(--muted); margin: 0 0 22px; }
.wizard .pad { padding: 26px; }
.wizard .actions { display: flex; justify-content: space-between; margin-top: 20px; }

/* App shell */
.app { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 61px); }
.sidebar { border-right: 1px solid var(--border); background: var(--bg-pure); padding: 18px 14px; }
.sidebar .head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 10px; }
.sidebar .head h2 { font-size: 13px; color: var(--soft); margin: 0; text-transform: uppercase; letter-spacing: .04em; }
.bizitem { display: block; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 10px 12px; border-radius: var(--radius-md); margin-bottom: 2px; }
.bizitem:hover { background: var(--surface); }
.bizitem.active { background: var(--accent-soft); }
.bizitem .name { font-weight: 600; font-size: 14px; }
.bizitem .meta { font-size: 12px; color: var(--soft); }
.main { padding: 26px 30px; max-width: 1000px; }
.main h1.title { font-size: 1.6rem; margin: 0 0 2px; }

/* Sections */
.section { margin-top: 26px; }
.section > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--soft); margin: 0 0 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
@media (max-width: 860px) { .app { grid-template-columns: 1fr; } .grid2 { grid-template-columns: 1fr; } }

/* Drop zone + docs */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 22px;
  text-align: center; color: var(--muted); font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.docs { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-top: 12px; }
.docrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); }
.docrow:first-child { border-top: 0; }
.docrow .fn { font-weight: 600; font-size: 14px; }
.docrow .dt { font-size: 12px; color: var(--soft); }

/* Badges */
.badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); }
.badge--ready { background: var(--success-soft); color: var(--success); }
.badge--pending, .badge--processing { background: var(--highlight-soft); color: var(--highlight); }
.badge--failed { background: var(--danger-soft); color: var(--danger); }
.badge--empty { background: var(--surface); color: var(--soft); }

/* Definition rows + code */
.kv { font-size: 14px; }
.kv .row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.kv .row .k { color: var(--soft); }
.kv .row .v { text-align: right; word-break: break-all; }
pre.snippet { background: #0c0a09; color: #f5f5f4; font-family: var(--font-mono); font-size: 12px;
  border-radius: var(--radius-md); padding: 14px; overflow: auto; white-space: pre-wrap; word-break: break-all; }

.note { font-size: 13px; }
.note.err { color: var(--danger); }
.note.ok { color: var(--success); }
.note.warn { color: var(--highlight); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(12,10,9,.4); display: grid; place-items: start center;
  padding: 24px; overflow: auto; z-index: 40; }
.modal .card { width: 100%; max-width: 480px; margin-top: 8vh; padding: 24px; }
.hidden { display: none !important; }
