/* Bancone's warm dark palette, adapted for a readable operator workspace.
   System fonts only: no display fonts or external font requests. */
:root {
  color-scheme: dark;
  --paper: #0a0806;
  --surface: #120d09;
  --raised: #1c160f;
  --hover: #2a2018;
  --ink: #faf3e6;
  --muted: #bcb1a0;
  --line: rgba(250, 243, 230, .14);
  --gold: #ffb627;
  --gold-light: #ffd166;
  --red: #ff6549;
  --green: #2ec47a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 95% 0, #ffb62708, transparent 45%), var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--gold);
  color: #1a1308;
  cursor: pointer;
  font-weight: 650;
  transition: background .15s, border-color .15s;
}
button:hover { background: var(--gold-light); }
button:disabled { opacity: .5; cursor: wait; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
a { color: inherit; }
.secondary {
  background: var(--raised);
  color: var(--ink);
  border-color: var(--line);
}
.secondary:hover { background: var(--hover); border-color: #ffb62766; }
.quiet { background: transparent; color: var(--muted); padding: 8px; }
.quiet:hover { background: var(--hover); color: var(--ink); }
.danger { background: #992f22; color: var(--ink); }
.danger:hover { background: #b73b2b; }
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 235px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 35px 25px;
  display: flex;
  flex-direction: column;
}
aside small {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--muted);
  margin: 14px 0 44px;
}
.brand, .auth-brand {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1.6px;
  text-decoration: none;
}
.brand span, .auth-brand span {
  color: var(--gold);
  font-size: 18px;
  margin-left: 4px;
  text-shadow: 0 0 18px #ffb62755;
}
nav { display: grid; gap: 9px; }
.nav { text-align: left; background: transparent; color: var(--muted); border-radius: 10px; }
.nav:hover { background: var(--raised); color: var(--ink); }
.nav.active { background: #ffb62712; border-color: #ffb62740; color: var(--gold); }
.sidebar-foot { margin-top: auto; display: grid; gap: 12px; color: var(--muted); }
main { margin-left: 235px; padding: 38px 48px; max-width: 1600px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.eyebrow { font-size: 10px; letter-spacing: 2px; font-weight: 700; color: var(--gold); margin: 0 0 10px; }
h1 { font-size: 38px; letter-spacing: -1.3px; line-height: 1.16; margin: 0; }
h2 { font-size: 19px; letter-spacing: -.3px; margin: 0 0 20px; }
h3 { margin: 28px 0 12px; font-size: 15px; }
.intro { font-size: 17px; color: var(--muted); margin: 0 0 28px; }
.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  margin-bottom: 22px;
}
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat {
  border: 1px solid var(--line);
  border-top-color: #ffb62755;
  border-radius: 14px;
  padding: 23px;
  background: linear-gradient(145deg, #ffb62708, transparent 70%), var(--raised);
}
.stat b { display: block; font-size: 36px; letter-spacing: -1px; margin: 8px 0; color: var(--gold); font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.stack { display: grid; gap: 16px; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 20px; }
label { display: grid; gap: 7px; font-size: 12px; font-weight: 600; }
input, textarea, select {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 11px;
  border-radius: 9px;
  color: var(--ink);
  width: 100%;
  min-width: 0;
}
input::placeholder, textarea::placeholder { color: #a19585; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--gold); flex-shrink: 0; }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.muted { color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.small { font-size: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.section-head h2 { margin: 0; }
.filters { display: flex; gap: 12px; margin-bottom: 22px; }
.filters select { width: 180px; }
.filters button { white-space: nowrap; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 15px 10px; border-bottom: 1px solid var(--line); }
th { font-size: 10px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
tbody tr:hover { background: #ffb62705; }
td small { display: block; color: var(--muted); margin-top: 5px; }
.badge { display: inline-block; font-size: 11px; border: 1px solid var(--line); border-radius: 20px; padding: 5px 10px; background: var(--raised); }
.badge.active, .badge.ok { background: #2ec47a15; border-color: #2ec47a40; color: #74e8ae; }
.badge.trial { background: #ffb62715; border-color: #ffb62740; color: var(--gold-light); }
.badge.warning, .badge.attention { background: #ffb62715; border-color: #ffb62740; color: var(--gold-light); }
.badge.suspended, .badge.error, .badge.stale { background: #ff3d2e15; border-color: #ff654940; color: #ff927b; }
.badge.archived { color: var(--muted); }
.row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.steps { display: flex; gap: 8px; margin-bottom: 20px; }
.step { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); flex: 1; background: var(--surface); }
.step.active { border-color: #ffb62766; background: #ffb62712; color: var(--gold-light); }
.form-footer { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding-top: 20px; }
.notice { background: #ffb6270d; border-left: 3px solid var(--gold); padding: 15px; line-height: 1.6; border-radius: 0 9px 9px 0; }
.review { display: grid; gap: 12px; }
.review p { margin: 0; }
.auth { max-width: 480px; margin: 9vh auto; padding: 20px; }
.auth-brand { margin-bottom: 45px; }
.auth h1 { font-size: 44px; }
.auth form { margin-top: 30px; }
.contract-wrap { max-width: 850px; margin: 50px auto; padding: 20px; }
.contract-wrap .brand { margin-bottom: 30px; }
.contract-wrap h1 { margin: 15px 0 30px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.8; }
.contract-wrap pre { max-height: 55vh; overflow: auto; background: var(--paper); padding: 20px; border: 1px solid var(--line); border-radius: 9px; }
details { border-bottom: 1px solid var(--line); padding: 15px 0; }
summary { cursor: pointer; font-weight: 600; margin-bottom: 15px; }
.detail-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.detail-tabs button { background: var(--raised); border-color: var(--line); color: var(--muted); }
.detail-tabs button:hover { background: var(--hover); color: var(--ink); }
.detail-tabs button.active { background: #ffb62712; border-color: #ffb62766; color: var(--gold-light); }
.ledger { overflow: auto; }
#toast {
  position: fixed;
  right: 25px;
  top: 20px;
  max-width: min(500px, calc(100vw - 32px));
  background: var(--raised);
  color: var(--ink);
  border: 1px solid #ffb62766;
  padding: 17px 24px;
  border-radius: 12px;
  z-index: 10;
  box-shadow: 0 12px 40px #0008;
  overflow-wrap: anywhere;
}
#toast.error { border-color: var(--red); background: #351710; }
dialog { background: var(--raised); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 30px; max-width: 650px; width: 90%; }
dialog::backdrop { background: #0a0806c9; }
dialog button { margin-top: 20px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.action-list { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 1000px) {
  aside { width: 190px; padding: 30px 18px; }
  main { margin-left: 190px; padding: 30px 22px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 650px) {
  aside { position: static; width: 100%; padding: 20px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  aside small { display: none; }
  .sidebar-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 12px; }
  nav { display: flex; flex-wrap: wrap; margin-top: 15px; gap: 6px; }
  .nav { flex: 1; padding: 10px; font-size: 12px; }
  main { margin: 0; padding: 25px 16px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .steps { flex-wrap: wrap; }
  .step { font-size: 11px; padding: 10px; }
  .card { padding: 18px; overflow: auto; }
  h1 { font-size: 30px; }
  .filters { flex-wrap: wrap; }
  .auth { margin: 3vh auto; }
  .section-head { align-items: flex-start; }
  .stats { gap: 10px; }
  .stat { padding: 15px; }
  .auth h1 { font-size: 38px; }
  #toast { right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
}
