/* ZetaBox Demos. Brand colors are defined once here so they can be swapped easily. */
:root {
  --brand: #c71617;
  --brand-ink: #ffffff;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #1d2433;
  --muted: #667085;
  --line: #e3e6ee;
  --ok: #157f3b;
  --ok-bg: #e7f6ec;
  --warn: #8a5a00;
  --warn-bg: #fff5db;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #f26b66;
    --brand-ink: #1a0707;
    --bg: #0f1218;
    --surface: #171b24;
    --ink: #e7eaf2;
    --muted: #98a2b3;
    --line: #2a3040;
    --ok: #6fdc95;
    --ok-bg: #12301f;
    --warn: #f5c451;
    --warn-bg: #33290f;
    --bad: #ff8a80;
    --bad-bg: #3a1714;
  }
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand); }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem;
  padding: .75rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand img { display: block; height: 40px; width: auto; }
.brand-sub { color: var(--muted); font-weight: 500; border-left: 1px solid var(--line); padding-left: .6rem; }
.nav { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem 1rem; font-size: .95rem; }
.nav a { text-decoration: none; }

main { flex: 1; width: 100%; margin: 0 auto; padding: 1.5rem 1rem; }
.container { max-width: 1080px; }
.narrow { max-width: 460px; }
.wide { max-width: 1400px; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1rem;
}
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; margin: .5rem 0; }
.row.between { justify-content: space-between; align-items: center; }
.row label { margin: 0; }
.stack > * { margin-bottom: .5rem; }

label { display: block; margin: 0 0 .85rem; font-weight: 500; font-size: .95rem; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: .5rem .65rem;
}
label > input:not([type=checkbox]):not([type=radio]), label > select, label > textarea { display: block; width: 100%; margin-top: .3rem; }
.row input, .row select { width: auto; max-width: 100%; }
input:focus, select:focus, textarea:focus, .button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.button {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
}
.button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.button.danger { color: var(--bad); border-color: var(--bad); }
.button.small { padding: .3rem .6rem; font-size: .85rem; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; }
form.inline { display: inline; }

.notice { padding: .65rem .8rem; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.notice.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.notice.error { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.notice.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.secret code { font-size: 1.2rem; padding: .4rem .6rem; background: var(--bg); border-radius: 6px; word-break: break-all; user-select: all; }

.tag { display: inline-block; font-size: .75rem; padding: .1rem .45rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); margin-right: .25rem; }
.tag.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.tag.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .92rem; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
table.dense td { padding: .35rem .6rem; font-size: .85rem; }
.nowrap { white-space: nowrap; }
.clip { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filters label { font-size: .85rem; }
.alert { background: var(--bad); color: #fff; padding: .7rem 1rem; text-align: center; }
.alert a { color: #fff; font-weight: 700; }
