/* Alpha desk: Design3 WOW, the internal tooling system of the Skrivna studio.
   Provenance: token values copied from SkrivnaBookStudioFrontEnd packages/ui/src/styles/base.css
   (the --wow-* set between @tokens-begin and @tokens-end, plus the moss/amber/rust status tokens) and
   mapped as studio-wow.css and b2.css map them (navy bar, warm ground, white panels, steel focus,
   spruce B2 primary). Master commit 33402e6. This file is self-contained: it loads with fonts.css only.
   Every colour lives in the token block; components read var() only. The public site uses a separate token set; it is never used here. */
:root {
  --wow-navy: #1B2838;
  --wow-ground: #FBF7F2;
  --wow-page: #FFFFFF;
  --wow-spruce: #1F3A2E;
  --wow-spruce-hover: #305A47;
  --wow-sage-wash: #EEF2EC;
  --wow-copper: #9A4A26;
  --wow-steel: #276A88;
  --wow-hjortron: #F2B387;
  --wow-ink: #2B211C;
  --wow-muted: #5C4B42;
  --wow-field-line: #7A6A5E;
  --wow-bar-ink: #D9D3CE;
  --wow-bar-ink-hi: #F4EEE8;
  --wow-bar-ink-lo: #D3CCC6;
  --wow-menu-hover: #EDE6DE;
  --wow-scroll: #C9B8AC;
  --wow-wash: #F4EEE8;
  --wow-rule: #B9A99C;
  --wow-tag-line: #BFB1A6;
  --wow-divider: #D9CCC1;
  --wow-card-shadow: 0 14px 36px -14px rgba(43,33,28,.2), 0 1px 3px rgba(43,33,28,.07);
  --moss-mark: #4E8A0C;
  --moss-word: #3C6905;
  --moss-tint: #C9DDBC;
  --amber-mark: #A87A0C;
  --amber-word: #7E5703;
  --amber-tint: #E5D4B1;
  --rust-mark: #C44A41;
  --rust-word: #A43B35;
  --rust-tint: #F5CAC4;
}
/* @tokens-end: no hex literal below this line */
:root {
  --ui: Geist, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --serif: "Instrument Serif", Georgia, serif;
  --ink: var(--wow-ink);
  --ink-2: var(--wow-muted);
  --line: var(--wow-divider);
  --hair: color-mix(in srgb, var(--wow-ink) 62%, transparent);
  --hair-off: color-mix(in srgb, var(--wow-ink) 22%, transparent);
  --r: 2px;
  --r-btn: 5px;
  --r-card: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--wow-ground); scrollbar-color: var(--wow-scroll) var(--wow-ground); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--wow-ground); color: var(--ink); font: 400 14px/1.55 var(--ui); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; font-synthesis-weight: none; color: var(--ink); }
a { color: inherit; text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--wow-steel); outline-offset: 3px; }
::selection { background: var(--wow-hjortron); color: var(--wow-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 99; background: var(--wow-spruce); color: var(--wow-page); padding: 10px 16px; border-radius: var(--r); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

/* ---- the bar: navy, 56px, the real logo ---- */
.sbar { position: sticky; top: 0; z-index: 40; min-height: 56px; display: flex; align-items: center; gap: 24px; padding: 0 32px; background: var(--wow-navy); color: var(--wow-bar-ink-hi); font-size: 14px; }
.sbar a { color: inherit; text-decoration: none; }
.sbar :focus-visible { outline: 2px solid var(--wow-hjortron); outline-offset: 2px; border-radius: 6px; }
.sbar-mark { display: flex; align-items: center; flex: 0 0 auto; }
.sbar-mark img { height: 28px; width: auto; }
.sbar-nav { display: flex; align-self: stretch; gap: 28px; margin-left: 12px; }
.sbar-nav a { display: inline-flex; align-items: center; padding: 0 2px; color: var(--wow-bar-ink-hi); border-bottom: 2px solid transparent; }
.sbar-nav a[aria-current] { color: var(--wow-page); border-bottom-color: var(--wow-hjortron); }
.sbar-label { font: 400 14px/1 var(--ui); color: var(--wow-bar-ink-lo); white-space: nowrap; }
.sbar-btn { appearance: none; background: transparent; border: 0; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wow-page) 72%, transparent); color: var(--wow-page); font: 600 14px/1 var(--ui); height: 36px; padding: 0 14px; border-radius: var(--r-btn); white-space: nowrap; }
.sbar-btn:hover { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--wow-page) 90%, transparent); }
.sbar-fill { flex: 1 1 auto; }
.sbar-account { display: flex; align-items: center; gap: 18px; font-size: 13px; color: var(--wow-bar-ink-lo); min-width: 0; }
#admin-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- type roles ---- */
.eyebrow { font: 500 12px/1.4 var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 10px; }
.eyebrow-serif { font: italic 400 18px/1.3 var(--serif); color: var(--wow-copper); margin-bottom: 14px; }
.lede { color: var(--ink-2); font-size: 15px; }
h1 em { font-style: italic; color: var(--wow-copper); }
.small { font-size: 13px; color: var(--ink-2); }

/* ---- buttons: B2 (spruce primary, outlined box, quiet word) ---- */
.button { position: relative; isolation: isolate; appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 36px; padding: 0 16px; border: 0; border-radius: var(--r-btn); background: var(--wow-spruce); color: var(--wow-page); font: 600 14px/1 var(--ui); letter-spacing: .02em; text-decoration: none; white-space: nowrap; transition: background-color 120ms ease-out, transform 90ms ease-out; }
.button:hover:not(:disabled) { background: var(--wow-spruce-hover); }
.button:active:not(:disabled) { transform: scale(.97); }
.button.secondary { background: var(--wow-page); color: var(--ink); }
.button.secondary::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; border: 1px solid var(--hair); pointer-events: none; }
.button.secondary:hover:not(:disabled) { background: var(--wow-sage-wash); }
.button.secondary:hover:not(:disabled)::before { border-width: 2px; }
.button.danger { background: var(--rust-word); color: var(--wow-page); }
.button.danger:hover:not(:disabled) { background: var(--rust-mark); }
.button:disabled { cursor: not-allowed; background: var(--wow-sage-wash); color: var(--ink-2); }
.button.secondary:disabled::before { border-color: var(--hair-off); }
.text-button { appearance: none; border: 0; background: none; padding: 8px 0; min-height: 36px; color: var(--ink); font-size: 14px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; transition: text-decoration-thickness 120ms ease-out; }
.text-button:hover { text-decoration-thickness: 2px; }
.danger-text { color: var(--rust-word); }

/* ---- fields ---- */
.field { margin: 0 0 18px; min-width: 0; }
.field > label, form > label { display: block; font: 400 13px/1.4 var(--ui); color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select, .field textarea, form > input { width: 100%; max-width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--wow-field-line); border-radius: var(--r-btn); background: var(--wow-page); color: var(--ink); font-size: 14px; }
.field textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-2); opacity: .8; }
.field .small { margin-top: 6px; }
.form-error { color: var(--rust-word); }
.notice { padding: 12px 16px; border-left: 3px solid var(--wow-steel); background: var(--wow-wash); font-size: 13px; margin: 0 0 16px; }
.notice.warning, .dev-notice { border-left-color: var(--amber-mark); background: var(--amber-tint); color: var(--amber-word); }
.dev-notice { padding: 12px 16px; font-size: 13px; border-left: 3px solid var(--amber-mark); margin: 20px 0; }

/* ---- the desk: a white page card on the ground, as the studio rooms ---- */
.desk-main { max-width: 1510px; margin: 0 auto; padding: 28px 32px 72px; }
.hero-card, .desk-card { background: var(--wow-page); border-radius: var(--r-card); box-shadow: var(--wow-card-shadow); }
.hero-card { padding: 36px 40px 22px; }
.desk-title { display: flex; gap: 30px; justify-content: space-between; align-items: flex-start; }
.desk-title h1 { font-size: clamp(2.4rem, 4.2vw, 4rem); line-height: 1.06; margin-bottom: 14px; max-width: 14em; }
.desk-title > a { flex-shrink: 0; }
.metrics { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 28px; border-top: 1px solid var(--line); }
.metrics > div { padding: 14px 18px 6px; border-left: 1px solid var(--line); }
.metrics > div:first-child { padding-left: 0; border-left: 0; }
.metrics span { display: block; font: 400 14px/1.45 var(--ui); color: var(--ink-2); }
.metrics strong { display: block; font: 400 2.6rem/1.15 var(--serif); font-variant-numeric: tabular-nums; color: var(--ink); margin-top: 2px; }
.notice { margin-top: 20px; }
.desk-card { margin-top: 24px; padding: 24px 0 0; overflow: hidden; }
.desk-filters { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; padding: 0 28px; margin-bottom: 18px; }
.desk-filters .field { margin: 0; flex: 1 1 130px; }
.desk-filters .search-field { flex: 2 1 220px; }
.desk-filters .text-button { min-width: 48px; }
#desk-message { font-size: 13px; min-height: 20px; color: var(--ink-2); padding: 0 28px; margin-bottom: 12px; }
.table-scroll { position: relative; overflow: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 800px; text-align: left; font-size: 14px; }
th { padding: 12px 16px; font: 400 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--wow-wash); }
th:first-child, td:first-child { padding-left: 28px; }
td { padding: 16px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--wow-menu-hover); }
td:first-child { max-width: 320px; overflow-wrap: anywhere; }
td:nth-child(5) { font: 400 12px/1.5 var(--mono); white-space: nowrap; }
td strong { display: block; color: var(--ink); font-size: 15px; font-weight: 600; }
td small { display: block; font-size: 13px; color: var(--ink-2); margin-top: 3px; }
td .text-button { font-weight: 600; }
.empty-cell { text-align: center; padding: 48px 20px !important; }
.mail-failed { color: var(--rust-word); }

/* status chip: outlined and neutral by default; tint only for ok (activated) and bad (revoked);
   every state has its own glyph, and the word always stays. */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border: 1px solid var(--wow-tag-line); border-radius: var(--r); font: 600 12px/1.5 var(--ui); color: var(--ink); background: transparent; }
.status::before { content: "·"; content: "·" / ""; font-weight: 400; }
.status[data-state="pending_review"]::before { content: "○"; content: "○" / ""; }
.status[data-state="approved"]::before { content: "◐"; content: "◐" / ""; }
.status[data-state="invited"]::before { content: "●"; content: "●" / ""; }
.status[data-state="waitlisted"]::before, .status[data-state="declined"]::before { content: "–"; content: "–" / ""; }
.status[data-state="activated"] { background: var(--moss-tint); border-color: var(--moss-mark); color: var(--moss-word); }
.status[data-state="activated"]::before { content: "✓"; content: "✓" / ""; color: var(--moss-mark); }
.status[data-state="revoked"] { background: var(--rust-tint); border-color: var(--rust-mark); color: var(--rust-word); }
.status[data-state="revoked"]::before { content: "✕"; content: "✕" / ""; color: var(--rust-mark); }

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 28px; border-top: 1px solid var(--line); }
.pagination > span { font-size: 13px; color: var(--ink-2); }
.pagination > div { display: flex; gap: 10px; }

/* ---- the review dialog: a WOW card ---- */
dialog { color: var(--ink); background: var(--wow-page); border: 0; border-radius: var(--r-card); box-shadow: var(--wow-card-shadow); max-width: 540px; width: calc(100% - 30px); padding: 28px 32px; max-height: 88dvh; overflow: auto; }
dialog::backdrop { background: color-mix(in srgb, var(--wow-navy) 62%, transparent); }
dialog p { font-size: 14px; }
.review-dialog { max-width: 720px; }
.review-heading { display: flex; justify-content: space-between; align-items: center; }
.review-heading .eyebrow { margin: 0; }
.close-button { appearance: none; background: none; border: 0; width: 40px; height: 40px; font-size: 28px; line-height: 1; color: var(--ink); border-radius: var(--r); }
.close-button:hover { background: var(--wow-menu-hover); }
.review-dialog h2 { font-size: clamp(1.9rem, 3vw, 2.5rem); line-height: 1.1; margin: 10px 0 6px; }
.review-dialog > p { overflow-wrap: anywhere; color: var(--ink-2); }
.review-details { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 26px; border-block: 1px solid var(--line); padding: 18px 0; margin: 20px 0 22px; }
.review-details > div { min-width: 0; }
.review-details .eyebrow { margin-bottom: 3px; display: block; }
.review-details p { font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.review-history { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px; font-size: 14px; }
.review-history summary { cursor: pointer; min-height: 36px; font-weight: 600; }
.review-history ol { padding-left: 20px; }
.review-history li { margin-bottom: 10px; font: 400 12px/1.5 var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.review-erase { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
#review-message { font-size: 13px; margin-top: 16px; min-height: 20px; }

/* ---- sign-in: bar plus one centred card ---- */
.login-main { display: grid; place-items: center; padding: 72px 20px 96px; }
.login-card { width: 100%; max-width: 520px; background: var(--wow-page); border-radius: var(--r-card); box-shadow: var(--wow-card-shadow); padding: 36px 40px 40px; }
.login-card h1 { font-size: clamp(2.2rem, 4vw, 2.8rem); line-height: 1.1; margin-bottom: 14px; }
.login-card .lede { margin-bottom: 26px; }
.login-card form .button { margin-top: 16px; }
.login-card .small { margin-top: 16px; }

@media (max-width: 850px) {
  .sbar { padding: 0 18px; gap: 14px; }
  .sbar-label { display: none; }
  .desk-main { padding: 18px 14px 56px; }
  .hero-card { padding: 26px 22px 18px; }
  .desk-title { flex-direction: column; gap: 16px; }
  .metrics > div { padding: 12px 12px 4px; }
  .metrics strong { font-size: 2.1rem; }
  .desk-filters { padding: 0 18px; }
  #desk-message, .pagination { padding-inline: 18px; }
  th:first-child, td:first-child { padding-left: 18px; }
  .desk-filters .field { flex-basis: 150px; }
  .desk-filters .search-field { flex-basis: 100%; }
  dialog { padding: 22px; }
  .login-card { padding: 28px 24px 32px; }
}
@media (max-width: 640px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics > div { padding: 12px 12px 6px 0; border-left: 0; }
  .metrics > div:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--line); }
  .metrics > div:last-child { grid-column: 1 / -1; border-left: 0; padding-left: 0; }
  .sbar-nav { margin-left: 0; gap: 16px; }
}
@media (max-width: 520px) {
  .desk-filters .field { flex-basis: calc(50% - 12px); }
  .desk-filters .search-field { flex-basis: 100%; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .review-details { grid-template-columns: 1fr; }
  .review-actions .button { flex: 1 1 45%; }
  .login-main { padding-top: 28px; }
  .sbar-account { gap: 10px; }
  .sbar-mark img { height: 24px; }
  #admin-name { max-width: 90px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
