:root {
  --bg: #f5f7f9;
  --surface: #ffffff;
  --text: #1d2733;
  --muted: #5d6b7a;
  --accent: #0b5c8a;
  --ok: #1f7a3f;
  --ko: #b3261e;
  --warn: #8a5a00;
  --line: #d9e0e6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font:
    14px/1.45 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
}
.brand .product {
  margin-left: 10px;
  opacity: 0.85;
}
.session {
  font-size: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.session button {
  background: transparent;
  color: #fff;
  border: 1px solid #fff8;
}
.menu {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.menu a {
  padding: 10px 14px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.menu a.active {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
main {
  max-width: 1180px;
  margin: 16px auto;
  padding: 0 16px;
  display: grid;
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
}
h1 {
  font-size: 20px;
  margin: 0 0 8px;
}
h2 {
  font-size: 16px;
  margin: 0 0 12px;
}
h3 {
  font-size: 14px;
  margin: 12px 0 6px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px 12px;
  align-items: end;
}
label {
  display: grid;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
}
input,
select,
textarea {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
}
textarea {
  width: 100%;
  min-height: 220px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
button {
  font: inherit;
  padding: 7px 12px;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button.secondary {
  background: #fff;
  color: var(--accent);
}
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: #e8eef3;
}
.badge.ok,
.badge.TAXABLE,
.badge.ADMISSIBLE,
.badge.PUBLISHED,
.badge.PASS {
  background: #e3f3e8;
  color: var(--ok);
}
.badge.ko,
.badge.REJECTED,
.badge.FAIL,
.badge.INDETERMINEE {
  background: #fbe4e2;
  color: var(--ko);
}
.badge.EXCLUE,
.badge.EXONEREE,
.badge.DRAFT,
.badge.SKIPPED {
  background: #fff1d6;
  color: var(--warn);
}
.amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  margin: 0;
}
dt {
  color: var(--muted);
}
.trace {
  margin: 0;
  padding-left: 18px;
}
.muted {
  color: var(--muted);
}
.toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  max-width: 520px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--text);
  color: #fff;
  display: none;
}
.toast.show {
  display: block;
}
.toast.error {
  background: var(--ko);
}
@media (max-width: 760px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

/* RA-INC-01-C: profile administration */
fieldset {
  border: 1px solid #d8dee6;
  border-radius: 6px;
  margin: 0 0 12px;
  padding: 8px 12px 12px;
}
legend {
  font-weight: 600;
  padding: 0 4px;
}
label.inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 14px;
}
label.inline input {
  width: auto;
}
.pair {
  display: flex;
  gap: 6px;
}
td.actions button {
  margin: 2px 0;
}
.case {
  border-top: 1px dashed #d8dee6;
  margin-top: 8px;
  padding-top: 8px;
}
.badge.ACTIVE,
.badge.QUALIFIED,
.badge.VALIDATED,
.badge.ARMATEUR,
.badge.REPRESENTANT {
  background: #e3f0ff;
  color: #134a8e;
}
.badge.SUSPENDED,
.badge.INACTIVE,
.badge.INDETERMINE,
.badge.FICTIF,
.badge.FICTITIOUS_TEST {
  background: #fff4e0;
  color: #8a5a00;
}

/* RA-INC-04 H4 — trial mention, cancelled receipt, printing one document. */
.trial-notice {
  border: 2px solid #a40000;
  color: #a40000;
  font-weight: bold;
  padding: 4px;
  text-align: center;
}
.cancelled {
  color: #a40000;
  font-weight: bold;
}
@media print {
  body * {
    visibility: hidden;
  }
  .print-target,
  .print-target * {
    visibility: visible;
  }
  .print-target {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  .print-target iframe {
    height: 260mm !important;
    border: 0 !important;
  }
  .no-print {
    display: none;
  }
}

/* RA-INC-05 D3 — rendered documents and templates */
.document-frame {
  width: 100%;
  height: 32rem;
  border: 1px solid #ccc;
  background: #fff;
}
label.button {
  display: inline-block;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent);
}
.fields code {
  margin-right: 0.25rem;
}
.issues,
.error {
  color: #a40000;
}
