/* ============================================================
   Nimbus Network — shared design system
   One source of truth for every module's look & feel.
   Include on a page:  <link rel="stylesheet" href="/nimbus.css">
   ============================================================ */
:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --border: #e8e6dc;
  --border-strong: #d9d5ca;
  --ink: #141413;
  --muted: #8b8680;
  --muted-2: #6a6a6a;
  --accent: #d97757;
  --accent-ink: #ffffff;
  --accent-tint: #fff1ea;
  --blue: #4a6a8a;
  --blue-tint: #eef5fb;
  --green: #3f7a3f;
  --green-tint: #eef7ee;
  --danger: #c0392b;
  --danger-tint: #fef2f2;
  --danger-border: #f2c4bd;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow: 0 2px 8px rgba(20,20,19,.06);
  --shadow-lg: 0 12px 40px rgba(20,20,19,.10);
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --mono: 'SF Mono', ui-monospace, Menlo, Monaco, 'Courier New', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* App bar (.nimbus-appbar) is injected + styled by nimbus.js so it can also sit
   on top of the compiled DR app without loading this whole stylesheet. */

/* ---------- Page layout ---------- */
.page { max-width: 1160px; margin: 28px auto; padding: 0 24px; }
.page-narrow { max-width: 760px; }
.page-wide { max-width: 1360px; }
.page-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.01em; }
.page-sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar h2 { font-size: 18px; margin: 0; }
.toolbar .spacer { flex: 1; }
.section-title { font-size: 15px; font-weight: 700; margin: 0 0 14px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card + .card { margin-top: 18px; }

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  border-radius: var(--radius-sm); padding: 10px 16px; border: 1px solid transparent;
  transition: filter .12s, background .12s, border-color .12s, transform .06s;
  display: inline-flex; align-items: center; gap: 8px; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(.96); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: var(--surface-2); color: var(--muted-2); border-color: var(--border); }
.btn-ghost:hover { background: #f0eee8; color: var(--ink); }
.btn-danger { background: var(--danger-tint); color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover { filter: brightness(.98); }
.btn-lg { font-size: 15px; padding: 13px 22px; }
.btn-sm { font-size: 12px; padding: 7px 12px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; }
.field.full { grid-column: 1 / -1; }
label, .label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin-bottom: 6px;
}
.input, input[type=text].input, input[type=number].input, input[type=search].input,
select.input, textarea.input {
  font-family: inherit; font-size: 13px; color: var(--ink);
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); width: 100%;
}
.input:focus { outline: none; border-color: var(--accent); }
.input.mono { font-family: var(--mono); font-size: 12px; }

/* ---------- Badges ---------- */
.badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: .03em; }
.badge-accent { background: var(--accent-tint); color: var(--accent); }
.badge-blue { background: var(--blue-tint); color: var(--blue); }
.badge-green { background: var(--green-tint); color: var(--green); }
.badge-muted { background: #f0efe9; color: var(--muted-2); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 11px 14px; font-size: 13px; border-bottom: 1px solid #f0eee8; }
.table th { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table .mono { font-family: var(--mono); font-size: 12px; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20,20,19,.45); display: none; align-items: center; justify-content: center; z-index: 9500; padding: 20px; }
.overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 24px; width: 560px; max-width: 100%; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal h3 { margin: 0 0 4px; font-size: 17px; }
.modal .modal-sub { color: var(--muted); font-size: 12px; margin: 0 0 18px; }

/* ---------- Code / CLI output ---------- */
.codeblock {
  background: #17171a; color: #d6d6d6; border-radius: var(--radius-sm);
  padding: 18px 20px; font-family: var(--mono); font-size: 13px; line-height: 1.6;
  white-space: pre-wrap; word-wrap: break-word; position: relative; border: 1px solid #26262b;
}

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 44px 20px; }
a { color: var(--accent); }
