/* KoinBooks — the workspace's own rules, on top of shared/koin-frame.css.
 *
 * The frame carries the palette, the type scale and the dark-mode tokens for
 * every KoinOS surface. Nothing here redefines a colour: a book that looked
 * subtly unlike the Control Centre beside it would read as a different product.
 * This file is only the shapes this surface needs and no other does. */

.boot { padding: 28px; color: var(--ink-soft); font-size: var(--t-emph); }

/* ── The frame: a rail and a page ──────────────────────────────────────── */

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.rail {
  background: var(--surface-2); border-right: 1px solid var(--line);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
}
.rail .mark {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 16px; font-weight: 800; color: var(--ink); letter-spacing: -.01em;
}
.rail .mark img { width: 26px; height: 26px; border-radius: 7px; }
.rail .who {
  margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line);
  font-size: var(--t-small); color: var(--ink-soft); line-height: 1.5; word-break: break-word;
}

/* The rail carries fifty-four screens, so it groups them and remembers which
   groups you left open. A flat list of fifty-four is a list nobody reads. */
.group { display: flex; flex-direction: column; }
.grouphead {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; margin: 10px 0 2px; padding: 4px 11px; border: 0; background: none;
  font: inherit; font-size: var(--t-small); font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-soft); cursor: pointer; text-align: left;
}
.grouphead:hover { color: var(--ink); }
.grouphead i { font-style: normal; font-size: 10px; }
.groupitems { display: flex; flex-direction: column; gap: 1px; }
.bottomlinks { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }

/* Which book these figures belong to. One book per legal entity today, so it
   reads rather than chooses. */
.scope {
  display: flex; flex-wrap: wrap; gap: 10px 28px; margin-bottom: 18px; padding: 11px 15px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.scope div { display: flex; flex-direction: column; gap: 2px; }
.scope span { font-size: var(--t-small); color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.scope b { font-size: var(--t-emph); color: var(--ink); font-weight: 800; }

.navlink {
  display: block; padding: 9px 11px; border-radius: 9px; text-decoration: none;
  color: var(--ink); font-size: var(--t-emph); font-weight: 600; line-height: 1.35;
}
.navlink:hover { background: var(--surface); }
.navlink[aria-current="page"] { background: var(--sel); color: var(--pos); font-weight: 800; }

.page { padding: 26px 30px 60px; min-width: 0; }
.page > header { margin-bottom: 20px; }
.page h1 { margin: 0; font-size: var(--t-title); font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.page header p { margin: 6px 0 0; color: var(--ink-soft); font-size: var(--t-emph); max-width: 62ch; line-height: 1.55; }

/* ── Figures ───────────────────────────────────────────────────────────── */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 13px; margin-bottom: 22px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 15px 17px; display: flex; flex-direction: column; gap: 5px;
}
.kpi span { font-size: var(--t-small); color: var(--ink-soft); font-weight: 600; }
.kpi strong { font-size: 22px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi small { font-size: var(--t-small); color: var(--ink-soft); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 17px 19px; margin-bottom: 18px;
}
.card > h2 { margin: 0 0 12px; font-size: var(--t-card); font-weight: 800; color: var(--ink); }

/* Money is right-aligned and tabular, so a column of figures lines up on the
   decimal and a long number cannot be mistaken for a short one. */
table.rows { width: 100%; border-collapse: collapse; font-size: var(--t-emph); }
table.rows th, table.rows td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; }
table.rows th { font-size: var(--t-small); color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
table.rows td.num, table.rows th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.rows tr:last-child td { border-bottom: 0; }
table.rows tfoot td { font-weight: 800; border-top: 1px solid var(--line); border-bottom: 0; }
table.rows td.code { font-variant-numeric: tabular-nums; color: var(--ink-soft); white-space: nowrap; }

/* An account nothing has ever been posted to. Not nought: a dash, because the
   two are different facts and a column of 0.00 hides which is which. */
.none { color: var(--ink-soft); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 20px;
  font-size: var(--t-small); font-weight: 700;
}
.pill.ok { background: var(--sel); color: var(--pos); }
.pill.warn { background: var(--sel-warn, #fdf2df); color: var(--warn, #8a5a00); }

.notice { border-radius: 11px; padding: 12px 14px; font-size: var(--t-emph); line-height: 1.55; }
.notice.warn { background: var(--sel-warn, #fdf2df); color: var(--ink); border: 1px solid var(--line); }
.notice.bad { background: var(--sel-neg, #fdecec); color: var(--ink); border: 1px solid var(--line); }

button.act {
  min-height: 40px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer;
}
button.act:hover { background: var(--surface-2); }

/* ── What is not built here yet ─────────────────────────────────────────
 * Deliberately plain. A convincing empty state for a screen that does not
 * exist is how a demo becomes a promise, so this says what is missing and
 * what it needs, and looks like a note rather than a product. */
.pending { border: 1px dashed var(--line); border-radius: 14px; padding: 20px 22px; background: transparent; }
.pending h2 { margin: 0 0 8px; font-size: var(--t-card); font-weight: 800; color: var(--ink); }
.pending p { margin: 0 0 10px; color: var(--ink-soft); font-size: var(--t-emph); line-height: 1.55; max-width: 64ch; }
.pending dt { font-size: var(--t-small); font-weight: 700; color: var(--ink-soft); margin-top: 10px; }
.pending dd { margin: 3px 0 0; font-size: var(--t-emph); color: var(--ink); line-height: 1.5; max-width: 64ch; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail .mark { width: 100%; padding-bottom: 8px; }
  .rail .who { width: 100%; margin-top: 8px; }
  .page { padding: 18px 16px 48px; }
}

/* ── Approvals: the one screen that writes ────────────────────────────── */

/* A button that looks like a link, for navigation inside a table. A real
   button, because it does something and a screen reader should say so. */
button.linklike {
  border: 0; background: none; padding: 0; font: inherit; color: var(--pos);
  font-weight: 700; cursor: pointer; text-align: left;
}
button.linklike:hover { text-decoration: underline; }

.fields { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; }
.fields label { display: flex; flex-direction: column; gap: 4px; font-size: var(--t-small); color: var(--ink-soft); font-weight: 700; }

/* Money is typed right-aligned and tabular, the way it is read, so a column of
   entered figures lines up with the column of posted ones beside it. */
table.rows input, table.rows select, .fields input {
  min-height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink); font: inherit; max-width: 100%;
}
table.rows td.num input { text-align: right; font-variant-numeric: tabular-nums; width: 11ch; }
table.rows select { min-width: 12ch; }

button.act[disabled] { opacity: .5; cursor: not-allowed; }
.card p + table.rows { margin-top: 6px; }
