/* The fiduciary console. One committed dark surface: this is an operated
   product screen, the same identity as the approved concept render. */

:root {
  --bg: #141824;
  --panel: #1C2233;
  --panel-2: #171C2B;
  --line: #2B3349;
  --ink: #E6E8F0;
  --soft: #9BA3B8;
  --faint: #6B7288;
  --accent: #8CA5F5;
  --good: #4CC38A;
  --warn: #D9A34A;
  --bad: #E5766B;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Public Sans', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
a { color: var(--accent); }
button { font: inherit; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 0.92em; }
.num { font-variant-numeric: tabular-nums; }
.soft { color: var(--soft); }
.faint { color: var(--faint); }

/* layout */
.shell { display: grid; grid-template-columns: 15rem 1fr; min-height: 100vh; }
.side {
  border-right: 1px solid var(--line);
  padding: 1.1rem 0.9rem;
  display: flex; flex-direction: column; gap: 0.2rem;
  background: var(--panel-2);
  position: sticky; top: 0; height: 100vh;
}
.brand { font-family: 'Spectral', Georgia, serif; font-weight: 700; font-size: 1.05rem; padding: 0.2rem 0.6rem 0; }
.brand small { display: block; font-family: 'Public Sans', sans-serif; font-weight: 500; color: var(--soft); font-size: 0.72rem; }
.side nav { display: flex; flex-direction: column; gap: 0.1rem; margin-top: 1rem; flex: 1; }
.side nav a {
  color: var(--soft); text-decoration: none; padding: 0.42rem 0.6rem; border-radius: 6px;
  font-weight: 500; font-size: 0.86rem;
}
.side nav a:hover { color: var(--ink); background: var(--panel); }
.side nav a.on { color: var(--ink); background: var(--panel); box-shadow: inset 2px 0 0 var(--accent); }
.side .foot { font-size: 0.72rem; color: var(--faint); padding: 0.6rem; display: grid; gap: 0.5rem; }

main { padding: 1.4rem 1.8rem 3rem; max-width: 74rem; }
.pagehead { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
h1 { font-family: 'Spectral', Georgia, serif; font-size: 1.35rem; font-weight: 600; margin: 0; }
h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--soft); font-weight: 600; margin: 1.6rem 0 0.6rem; }

/* components */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.9rem; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 0.8rem 1rem; }
.tile .lab { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--soft); }
.tile .val { font-family: 'Spectral', Georgia, serif; font-size: 1.7rem; font-weight: 600; line-height: 1.25; }
.tile .sub { font-size: 0.75rem; color: var(--soft); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 0.9rem 1.1rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.9rem; }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 0.83rem; }
th { text-align: left; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }

.pill { display: inline-block; border-radius: 99px; padding: 0.02rem 0.55rem; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.pill.active, .pill.delivered, .pill.published, .pill.granted { background: rgba(76,195,138,0.14); color: var(--good); }
.pill.superseded, .pill.draft { background: rgba(155,163,184,0.14); color: var(--soft); }
.pill.withdrawn, .pill.failed, .pill.dead, .pill.denied { background: rgba(229,118,107,0.14); color: var(--bad); }
.pill.expired, .pill.pending, .pill.delivering { background: rgba(217,163,74,0.14); color: var(--warn); }

button.primary, button.ghost, button.danger {
  border-radius: 6px; padding: 0.42rem 0.9rem; font-weight: 600; font-size: 0.84rem;
  cursor: pointer; border: 1px solid transparent;
}
button.primary { background: var(--accent); color: #10131C; }
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: transparent; color: var(--soft); border-color: var(--line); }
button.ghost:hover { color: var(--ink); }
button.danger { background: transparent; color: var(--bad); border-color: var(--line); }
button.danger:hover { border-color: var(--bad); }
button:disabled { opacity: 0.55; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

label.field { display: grid; gap: 0.25rem; font-size: 0.78rem; color: var(--soft); font-weight: 600; }
input, select, textarea {
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
  padding: 0.45rem 0.6rem; font: inherit; width: 100%;
}
textarea { min-height: 6.5rem; resize: vertical; }
form.stack { display: grid; gap: 0.8rem; max-width: 34rem; }
.row { display: flex; gap: 0.7rem; align-items: end; flex-wrap: wrap; }
.row > * { flex: 0 0 auto; }
.checks { display: flex; gap: 0.9rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--soft); }
.checks label { display: flex; gap: 0.35rem; align-items: center; font-weight: 500; }
.checks input { width: auto; }

.note { font-size: 0.8rem; color: var(--soft); }
.error { color: var(--bad); font-size: 0.84rem; margin: 0.6rem 0; }
.okmsg { color: var(--good); font-size: 0.84rem; margin: 0.6rem 0; }

pre.snippet {
  background: #10131C; border: 1px solid var(--line); border-radius: 8px;
  padding: 0.9rem 1rem; overflow-x: auto; font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem; line-height: 1.5; margin: 0.5rem 0;
}
.secretbox {
  border: 1px solid var(--warn); border-radius: 8px; padding: 0.8rem 1rem; margin: 0.8rem 0;
  background: rgba(217,163,74,0.06); font-size: 0.84rem;
}

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; font-size: 0.82rem; }
.feed li { display: flex; gap: 0.7rem; justify-content: space-between; }
.feed .when { color: var(--faint); white-space: nowrap; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login {
  width: min(26rem, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 1.6rem 1.8rem; display: grid; gap: 0.9rem;
}
.login .brand { padding: 0; font-size: 1.3rem; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .side nav { flex-direction: row; margin-top: 0; }
  .side .foot { display: none; }
}
