/*
 * Yuimaru Organiser Guide — shared stylesheet.
 *
 * This mirrors the real BACK-OFFICE design tokens (warm amber action, light-blue
 * brand mark, slate ink) so the organiser guide looks like the Back Office it
 * documents — distinct from the consumer app's purple guide at /docs/user/.
 * Values mirror back-office/src/styles/tokens.js. Readable text (links,
 * eyebrows) uses the warm "accent" brown, because the light-blue brand colour
 * is an identity fill, never body text.
 */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  /* Back-office palette — one job per colour. */
  --color-action: #f7c37d;       /* amber: primary button fill, current step */
  --color-action-text: #2b3a44;  /* slate ink on top of an action fill */
  --color-highlight: #c98a3a;    /* warm accent used for the nav avatar chip */
  --color-brand: #a4cde0;        /* light blue: identity / mark — never text or a button */
  --color-accent: #c98a3a;       /* readable warm-brown: eyebrows, links, labels */
  --color-ink: #2b3a44;          /* slate: primary text, outlines, ghost-button border */
  --color-muted: #7a8b95;        /* secondary / help text */
  --color-line: #bcd6e6;         /* dividers, borders */
  --color-faint: #9fb0ba;        /* faintest text */
  --color-toast-info: #312e81;   /* shared signal: toast / note copy */
  --color-warning: #f87171;      /* shared signal: warnings */
  --color-positive: #3f8f5f;     /* approved / confirmed */
  --color-placeholder: #a9b6bf;

  --surface-page: #eaf3f8;
  --surface-paper: #ffffff;
  --surface-raised: #f4f9fc;
  --surface-sidebar: #f2f9fc;
  --surface-selected: #fffdf4;

  --font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius-chip: 6px;
  --radius-control: 8px;
  --radius-card: 12px;           /* back office uses 12px cards */
  --radius-dot: 50%;
  --radius-pill: 999px;

  --shadow-modal: 0 20px 44px rgba(43, 58, 68, 0.34);
  --shadow-toast: 0 12px 28px rgba(43, 58, 68, 0.26);
  --shadow-card-hover: 0 10px 26px rgba(43, 58, 68, 0.16);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--color-ink);
  font-family: var(--font-family);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ----------------------------------------------------------------- Layout */

.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
  max-width: 1320px;
  margin: 0 auto;
}

.sidebar {
  background: var(--surface-sidebar);
  border-right: 2px solid var(--color-line);
  padding: 26px 22px 60px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 6px;
}
.sidebar__brand img { width: 40px; height: 40px; object-fit: contain; }
.sidebar__brand .name { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.sidebar__brand .kicker {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .09em; color: var(--color-accent);
}

.sidebar__section {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .09em; color: var(--color-accent);
  margin: 26px 0 8px; padding: 0 8px;
}

.sidebar nav a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  text-decoration: none;
  color: var(--color-muted);
  font-size: 14.5px;
  font-weight: 500;
}
.sidebar nav a:hover { background: var(--surface-selected); color: var(--color-ink); }
.sidebar nav a.current {
  background: var(--surface-selected);
  color: var(--color-ink);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--color-action);
}

.content {
  padding: 40px 56px 120px;
  max-width: 820px;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; border-right: none;
    border-bottom: 2px solid var(--color-line);
  }
  .content { padding: 28px 22px 100px; }
}

/* --------------------------------------------------------------- Typography */

.eyebrow {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--color-accent);
  margin: 0 0 10px;
}
h1 { font-size: 34px; font-weight: 700; line-height: 1.12; letter-spacing: -.02em; margin: 0 0 14px; }
h2 {
  font-size: 23px; font-weight: 700; line-height: 1.2; margin: 46px 0 14px;
  padding-top: 22px; border-top: 2px solid var(--color-line);
}
h2:first-of-type { border-top: none; padding-top: 0; }
h3 { font-size: 18px; font-weight: 700; margin: 30px 0 8px; }
p { margin: 0 0 16px; font-size: 16.5px; }
.lead { font-size: 19px; color: var(--color-muted); line-height: 1.5; margin-bottom: 30px; }
a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration: none; }
strong { font-weight: 600; }
code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--surface-raised); border: 1px solid var(--color-line);
  border-radius: var(--radius-chip); padding: 1px 6px; color: var(--color-toast-info);
}

/* ------------------------------------------------------- Numbered step list */

ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 22px 0; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 4px 0 22px 56px;
  min-height: 40px;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 38px; height: 38px;
  background: var(--color-action);
  color: var(--color-action-text);
  border-radius: var(--radius-dot);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
ol.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 18px; top: 40px; bottom: 4px;
  width: 2px; background: var(--color-line);
}
ol.steps > li .step-title { font-weight: 600; font-size: 17px; display: block; margin-bottom: 2px; }
ol.steps > li p { margin: 4px 0; }

ul.plain { padding-left: 22px; margin: 16px 0; }
ul.plain li { margin-bottom: 8px; font-size: 16.5px; }

/* ------------------------------------------------------------------ Cards */

.card-link {
  display: block;
  background: var(--surface-paper);
  border: 2px solid var(--color-line);
  border-radius: var(--radius-card);
  padding: 22px 24px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s ease, transform .15s ease;
}
.card-link:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.card-link .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius-dot);
  background: var(--surface-raised); color: var(--color-accent);
  font-weight: 700; font-size: 14px; margin-bottom: 12px;
}
.card-link h3 { margin: 0 0 6px; font-size: 18px; }
.card-link p { margin: 0; color: var(--color-muted); font-size: 15px; }

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; margin: 22px 0;
}

/* ---------------------------------------------------------------- Callouts */

.note {
  border: 2px solid var(--color-line);
  border-left: 6px solid var(--color-accent);
  background: var(--surface-paper);
  border-radius: var(--radius-control);
  padding: 16px 18px;
  margin: 22px 0;
  font-size: 15.5px;
}
.note .note__label {
  font-weight: 700; font-size: 13px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--color-accent); display: block; margin-bottom: 4px;
}
.note p:last-child { margin-bottom: 0; }
.note.tip { border-left-color: var(--color-positive); }
.note.tip .note__label { color: var(--color-positive); }
.note.warn { border-left-color: var(--color-warning); }
.note.warn .note__label { color: var(--color-warning); }
.note.money { border-left-color: var(--color-action); }
.note.money .note__label { color: var(--color-accent); }

/* -------------------------------------------------- UI mock-up: a frame box */

.ui-demo {
  border: 2px dashed var(--color-line);
  border-radius: var(--radius-control);
  background: var(--surface-page);
  padding: 20px;
  margin: 20px 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
}
.ui-demo .caption {
  flex-basis: 100%; font-size: 12.5px; color: var(--color-faint);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
  margin-bottom: -2px;
}

/* Buttons — as in the Back Office. primary and bo-primary are both amber so
 * pages authored with either class render identically here. */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-control);
  padding: 10px 16px; font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: default; border: 2px solid transparent;
  text-decoration: none;
}
.btn.primary, .btn.bo-primary { background: var(--color-action); border-color: var(--color-action); color: var(--color-action-text); }
.btn.ghost { background: var(--surface-paper); border-color: var(--color-ink); color: var(--color-ink); }

/* Status / info pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-pill); padding: 4px 12px;
  font-size: 13px; font-weight: 600;
  border: 2px solid var(--color-line); background: var(--surface-paper);
  color: var(--color-muted);
}
.pill .dot { width: 8px; height: 8px; border-radius: var(--radius-dot); background: currentColor; }
.pill.open { color: var(--color-positive); border-color: #bfe3cd; }
.pill.pending { color: var(--color-accent); border-color: #e7d3ac; }
.pill.full, .pill.warn { color: var(--color-warning); border-color: #f4c9c9; }

/* A toast */
.toast {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--surface-paper); border: 2px solid var(--color-line);
  border-radius: var(--radius-control); box-shadow: var(--shadow-toast);
  padding: 12px 15px; max-width: 300px;
  color: var(--color-toast-info); font-size: 13.5px; font-weight: 700;
}
.toast .x {
  width: 20px; height: 20px; border-radius: var(--radius-chip);
  border: 2px solid var(--color-line); color: var(--color-muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}

/* A ticket-code chip */
.ticket-code {
  font-family: var(--font-mono); font-weight: 600; letter-spacing: .04em;
  background: var(--surface-raised); border: 2px solid var(--color-line);
  border-radius: var(--radius-control); padding: 8px 14px; display: inline-block;
  color: var(--color-toast-info);
}

/* A faux input field */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 220px; }
.field label { font-size: 13.5px; font-weight: 600; }
.field .box {
  border: 2px solid var(--color-line); border-radius: var(--radius-control);
  padding: 11px 13px; background: var(--surface-paper);
  color: var(--color-placeholder); font-size: 14.5px;
}

/* A faux top bar */
.faux-nav {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: var(--surface-paper);
  border: 2px solid var(--color-line); border-radius: var(--radius-control);
  padding: 10px 16px;
}
.faux-nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.faux-nav .brand img { width: 26px; height: 26px; }
.faux-nav .right { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--color-muted); }
.faux-nav .avatar {
  width: 30px; height: 30px; border-radius: var(--radius-dot);
  background: var(--color-highlight); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}

/* Key-caps for on-screen buttons in prose. kbd and kbd.bo are both amber. */
.kbd {
  display: inline-block; font-family: inherit; font-size: .92em; font-weight: 600;
  background: var(--color-action); color: var(--color-action-text);
  border-radius: var(--radius-chip); padding: 1px 8px; white-space: nowrap;
}
.kbd.bo { background: var(--color-action); color: var(--color-action-text); }
.kbd.ghost { background: var(--surface-paper); color: var(--color-ink); border: 1.5px solid var(--color-ink); }

/* -------------------------------------------------------------- FAQ blocks */

.faq { border-top: 2px solid var(--color-line); margin-top: 12px; }
.faq details { border-bottom: 2px solid var(--color-line); padding: 4px 0; }
.faq summary {
  cursor: pointer; padding: 14px 4px; font-weight: 600; font-size: 16.5px;
  list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--color-accent); font-weight: 700; font-size: 20px; }
.faq details[open] summary::after { content: "–"; }
.faq details[open] summary { color: var(--color-accent); }
.faq .answer { padding: 0 4px 16px; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------- Page nav / crumbs */

.crumbs { font-size: 13.5px; color: var(--color-muted); margin-bottom: 22px; }
.crumbs a { color: var(--color-muted); }

.pager {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 60px; padding-top: 26px; border-top: 2px solid var(--color-line);
}
.pager a {
  flex: 1; text-decoration: none; color: inherit;
  border: 2px solid var(--color-line); border-radius: var(--radius-card);
  padding: 16px 18px; background: var(--surface-paper);
}
.pager a:hover { box-shadow: var(--shadow-card-hover); }
.pager a.next { text-align: right; }
.pager .dir { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--color-accent); font-weight: 600; }
.pager .ttl { font-weight: 600; font-size: 16px; margin-top: 2px; }

.page-footer {
  margin-top: 40px; font-size: 13.5px; color: var(--color-faint);
  border-top: 2px solid var(--color-line); padding-top: 18px;
}

/* Real screenshots of the Back Office (captured from the live app). */
figure.shot { margin: 24px 0; }
figure.shot img {
  display: block; max-width: 100%; height: auto; margin: 0 auto;
  border: 2px solid var(--color-line); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card-hover);
}
figure.shot figcaption {
  margin-top: 10px; font-size: 13px; color: var(--color-faint); text-align: center;
}
figure.shot figcaption b { color: var(--color-muted); font-weight: 600; }
