/* Paper Trail tokens, carried over from culmentech.com as real custom
   properties rather than the marketing site's inline hexes — see the plan's
   "Carrying over the Paper Trail tokens" section for why: no dc-runtime here
   to force that pattern, and a back office with tables/forms/states needs
   the discipline a stylesheet gives.

   Hard rules that this file exists to enforce (see plan §Screens):
     - no red anywhere, including "failed" and "opted out"
     - marker (#80C0C0) is a highlighter — ink text ON it, never AS text
     - marker is never used for focus rings
     - cards: 1px line border, 2px radius, no shadows
*/
:root {
  --ink: #15181D;
  --ink-hover: #04070B;
  --paper: #F2F5F8;
  --on-ink: #F5F8FB;
  --surface: #FFFFFF;
  --line: #D8DFE6;
  --muted: #525A63;
  --fill: #E4EAF0;
  --marker: #80C0C0;
  --seal: #1F7A74;

  --w: 1120px;
  --w-wide: 1440px;
  --radius: 2px;

  --font-display: "Newsreader", Georgia, serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-word: "Space Grotesk", var(--font-body);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0 0 8px; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }

a { color: var(--ink); }

.mono-label {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.mono-label.ok { color: var(--seal); }
.mono-label.muted { color: var(--muted); }

.tabular { font-variant-numeric: tabular-nums; }
.muted-text { color: var(--muted); }

/* Focus is always ink, never marker — marker fails contrast as a focus
   ring (~1.6:1) per the design system's rules. */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

button, .link-button {
  font-family: var(--font-body);
  font-size: 15px;
  cursor: pointer;
}

button[type="submit"] {
  background: var(--ink);
  color: var(--on-ink);
  border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-weight: 500;
}
button[type="submit"]:hover { background: var(--ink-hover); }

.link-button {
  background: none;
  border: none;
  color: var(--muted);
  text-decoration: underline;
  padding: 0;
}

input[type="email"], input[type="password"], input[type="text"], input[type="search"] {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}

label {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 16px 0 6px;
}

/* --- login page ------------------------------------------------------ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 380px;
}
.login-card form { display: flex; flex-direction: column; }
.login-card button[type="submit"] { margin-top: 24px; }

.field-error {
  color: var(--seal);
  font-size: 14px;
  margin: 8px 0 0;
}

/* --- app shell --------------------------------------------------------- */
.topbar {
  background: var(--ink);
  color: var(--on-ink);
}
.topbar-inner {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 56px;
}
.wordmark {
  font-family: var(--font-word);
  font-weight: 600;
  font-size: 16px;
}
.topnav { display: flex; gap: 20px; flex: 1; }
.topnav a {
  color: var(--on-ink);
  text-decoration: none;
  font-size: 14px;
  opacity: 0.75;
}
.topnav a.active, .topnav a:hover { opacity: 1; text-decoration: underline; }
.logout-form { display: flex; align-items: center; gap: 12px; }
.logout-form .link-button { color: var(--on-ink); opacity: 0.75; }

.page {
  max-width: var(--w);
  margin: 0 auto;
  padding: 40px 24px;
}
.page.wide { max-width: var(--w-wide); }
.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.empty-state { color: var(--muted); }

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.board-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.board-stats { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.board-stats div { display: flex; justify-content: space-between; }
.board-stats dt { color: var(--muted); font-size: 14px; }
.board-stats dd { margin: 0; font-weight: 500; }

/* Status labels: mono, never red. A restricted/banned account gets a
   marker background with ink text on top (highlighter), not a colour
   swap — see the rule at the top of this file. */
.status-active { color: var(--seal); }
.status-restricted, .status-banned {
  background: var(--marker);
  color: var(--ink);
  padding: 2px 6px;
  border-radius: var(--radius);
}
.status-new, .status-warming, .status-disabled { color: var(--muted); }

/* --- narrow pages (forms, single-record detail) ----------------------- */
.page.narrow { max-width: 560px; }

/* --- link-styled buttons and button-styled links ----------------------- */
a.button-link {
  display: inline-block;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: var(--radius);
  padding: 10px 18px;
  font-weight: 500;
  text-decoration: none;
}
a.button-link:hover { background: var(--ink-hover); }

/* --- tables (user list, later queue/clients/audit) --------------------- */
.tablewrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); }
thead th {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
}
tbody tr:last-child td { border-bottom: none; }

/* --- forms -------------------------------------------------------------- */
select {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
button:disabled, select:disabled, input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.field-note { font-size: 14px; margin-top: 12px; }
.field-warning {
  color: var(--seal);
  font-size: 14px;
  margin: 16px 0;
}
.inline-form {
  display: flex;
  gap: 12px;
  align-items: center;
}
.inline-form select { width: auto; flex: 1; }

/* --- action cards (user detail: role / password / access) -------------- */
.action-card { margin-top: 16px; }
.action-card h2 { font-size: 15px; margin-bottom: 8px; }
.action-card .muted-text { display: block; margin-bottom: 12px; font-size: 14px; }

/* --- detail field list --------------------------------------------------- */
.detail-fields { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.detail-fields div { display: flex; justify-content: space-between; gap: 16px; }
.detail-fields dt { color: var(--muted); font-size: 14px; }
.detail-fields dd { margin: 0; }

/* --- one-time credential display ---------------------------------------- */
.credential-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 12px 0;
}
.credential-box code {
  font-family: var(--font-mono);
  font-size: 16px;
  flex: 1;
  word-break: break-all;
}
