/* ---------------------------------------------------------------------------
   PressboardKit dashboard

   The same register as pressboardkit.com — system face at 17px, a neutral ramp
   with one blue, hairlines instead of boxes, pill controls — written as plain
   CSS rather than pulling a build step into a .NET service for one stylesheet.

   Served from this origin. Nothing here loads a font, a script or an image
   from anywhere else, which is the same property the marketing site has and
   the same one the SDK claims about itself.
--------------------------------------------------------------------------- */

:root {
  color-scheme: light;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #ffffff;
  --bg-subtle: #f5f5f7;
  --bg-raised: #ffffff;
  --bg-code: #e8e8ed;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --hairline: #d2d2d7;
  --accent: #0071e3;
  --accent-text: #ffffff;
  --warn: #8a5a00;
  --warn-bg: #fff6e0;
  --danger: #a1231c;

  --radius-card: 1.125rem;
  --radius-control: 0.75rem;
  --radius-pill: 980px;
}

/* Two selectors, one palette, and the duplication is the point: CSS has no way to reuse a
   declaration block, and the two are answering different questions. The media query is "the
   device is dark and the reader has not asked for light" — it matches data-theme="system" and
   data-theme="dark" alike. The bare attribute below is "this reader asked for dark", which has
   to win on a light device too, and would not from inside the query. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --bg-subtle: #0a0a0c;
    --bg-raised: #1d1d1f;
    --bg-code: #1f1f22;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #86868b;
    --hairline: #333336;
    --accent: #2997ff;
    --accent-text: #000000;
    --warn: #f5c56b;
    --warn-bg: #2a1f06;
    --danger: #ff6961;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-subtle: #0a0a0c;
  --bg-raised: #1d1d1f;
  --bg-code: #1f1f22;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #86868b;
  --hairline: #333336;
  --accent: #2997ff;
  --accent-text: #000000;
  --warn: #f5c56b;
  --warn-bg: #2a1f06;
  --danger: #ff6961;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;      /* 17 — the one step that separates a platform document from a web app */
  line-height: 1.5;
  letter-spacing: -0.011em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  /* Short pages — sign in, a confirmation — otherwise leave the footer floating in
     the middle of the viewport with black below it. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- chrome ------------------------------------------------------------ */

.chrome {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.375rem;
  height: 48px;
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  font-size: 0.875rem;
  letter-spacing: -0.008em;
}
.chrome a { color: var(--text); }
.chrome .wordmark { font-weight: 600; }
.chrome .spacer { margin-left: auto; }
.chrome form { display: inline; }

/* ---- the appearance control --------------------------------------------
   A segmented group of three submit buttons. It is a form rather than a switch
   because the dashboard runs no script: the choice is a POST, and the server
   renders the result. Small and quiet — it is a preference, not an action
   anybody came here to perform.                                            */
.chrome form.theme {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 1px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
}
.chrome form.theme button {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1;
  letter-spacing: -0.004em;
  color: var(--text-secondary);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-pill);
  transition: color 0.12s ease, background-color 0.12s ease;
}
.chrome form.theme button:hover { color: var(--text); }

/* The selected one, said with a fill rather than with colour alone, so it survives a
   monochrome display and a reader who cannot separate the two shades. */
.chrome form.theme button[aria-pressed="true"] {
  background: var(--bg-raised);
  color: var(--text);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 12%, transparent);
}

/* Narrow screens: the group is the first thing worth dropping, because the device
   setting already gives everybody a working appearance without it. */
@media (max-width: 30rem) {
  .chrome form.theme { display: none; }
}

main { flex: 1; width: 100%; max-width: 61.25rem; margin: 0 auto; padding: 3rem 1.375rem 6rem; }
/* A single form has no business hugging the left edge of a 980px page. */
.narrow { max-width: 27rem; margin-inline: auto; }

h1 { font-size: 2.25rem; line-height: 1.14; letter-spacing: -0.018em; font-weight: 600; margin: 0 0 0.5rem; }
h2 { font-size: 1.3125rem; line-height: 1.3; letter-spacing: -0.012em; font-weight: 600; margin: 2.75rem 0 0.75rem; }
.lede { font-size: 1.3125rem; line-height: 1.4; letter-spacing: -0.012em; color: var(--text-secondary); margin: 0 0 2.5rem; }
.muted { color: var(--text-secondary); }
.small { font-size: 0.875rem; line-height: 1.45; letter-spacing: -0.008em; }

/* ---- surfaces ---------------------------------------------------------- */

.card {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--bg-raised);
  padding: 1.375rem 1.5rem;
  margin: 0 0 1rem;
}
.card h3 { margin: 0 0 0.25rem; font-size: 1.0625rem; font-weight: 600; }
.band { background: var(--bg-subtle); border-radius: var(--radius-card); padding: 1.375rem 1.5rem; }

.rows { border-top: 1px solid var(--hairline); margin-top: 1rem; }
.row { display: flex; gap: 1rem; padding: 0.875rem 0; border-bottom: 1px solid var(--hairline); }
.row dt, .row .label { flex: 0 0 12rem; color: var(--text-secondary); font-size: 0.875rem; }
.row dd { margin: 0; }

code, .mono { font-family: var(--font-mono); font-size: 0.9375em; }
.key {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  word-break: break-all;
  background: var(--bg-code);
  border-radius: var(--radius-control);
  padding: 0.75rem 0.875rem;
  margin: 0.75rem 0;
  user-select: all;
}

/* ---- status ------------------------------------------------------------ */

.pill {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: -0.003em;
  padding: 0.125rem 0.625rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline);
  color: var(--text-secondary);
}
.pill.ok { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }

.note { border-radius: var(--radius-control); padding: 0.75rem 1rem; margin: 0 0 1.5rem; font-size: 0.9375rem; }
.note.info { background: var(--bg-subtle); }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.bad { background: var(--bg-subtle); color: var(--danger); }

/* ---- controls ---------------------------------------------------------- */

label { display: block; font-size: 0.875rem; color: var(--text-secondary); margin: 1rem 0 0.375rem; }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  font: inherit;
  font-size: 1.0625rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  padding: 0.625rem 0.75rem;
}
input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.button {
  display: inline-block;
  font: inherit;
  font-size: 1rem;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0.625rem 1.25rem;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}
.button:hover { text-decoration: none; filter: brightness(1.06); }
.button.quiet { background: transparent; color: var(--accent); border-color: var(--hairline); }

/* Destructive, and it should not look like the others. Built from --danger, which both themes
   already define, rather than a colour written in here. */
.button.danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.button.link { background: none; border: none; padding: 0; color: var(--accent); font-size: inherit; }
.button.link:hover { text-decoration: underline; }
.actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 0.625rem 1rem 0.625rem 0; border-bottom: 1px solid var(--hairline); }
th { color: var(--text-secondary); font-weight: 400; }
td.amount, th.amount { text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; }

footer {
  border-top: 1px solid var(--hairline);
  color: var(--text-tertiary);
  font-size: 0.75rem;
  padding: 1.5rem 1.375rem;
}
footer .inner { max-width: 61.25rem; margin: 0 auto; display: flex; gap: 1.25rem; flex-wrap: wrap; }
