:root {
  --ink: #1f1e1d;
  --accent: #c96442;
  --bg: #f0eee6;
  --line: #e6e2d8;
  --muted: #68675f;
  --ok: #286536;
  --danger: #a32e24;
}
.refund-evidence {
  overflow-wrap: anywhere;
}
dl.refund-evidence {
  display: grid;
  grid-template-columns: minmax(90px, 150px) minmax(0, 1fr);
  gap: 8px 16px;
}
.refund-evidence dt {
  color: var(--muted);
}
.refund-evidence dd {
  margin: 0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  line-height: 1.55;
}
header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 5vw;
  background: var(--ink);
  color: #fff;
  border-top: 4px solid var(--accent);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.1;
  color: #fff;
  text-decoration: none;
}
/* Logo de la charte (Documentation/brand), version blanche sur l'encre. */
.brand img {
  display: block;
  height: 56px;
  width: auto;
}
.brand span {
  padding-left: 10px;
  border-left: 1px solid #5a5853;
  color: #d0ccc4;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.country {
  margin-right: auto;
  font-size: 13px;
  color: #d0ccc4;
}
#connection {
  font-size: 13px;
}
header button {
  color: white;
  border-color: #615b52;
  background: transparent;
}
.sandbox {
  font-size: 12px;
  text-align: center;
  padding: 9px;
  background: #eadfd3;
  color: #6f4228;
}
main {
  max-width: 1200px;
  margin: auto;
  padding: 34px 30px;
}
h1,
h2 {
  font-family: Georgia, serif;
  line-height: 1.2;
}
h1 {
  font-size: 38px;
  letter-spacing: -0.7px;
  margin: 5px 0 13px;
}
h2 {
  font-size: 24px;
  margin: 0 0 18px;
}
p {
  margin: 8px 0 18px;
}
button,
input,
select {
  font: inherit;
}
button {
  padding: 11px 17px;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
  background: #fff;
  font-weight: 600;
  font-size: 14px;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.secondary {
  background: transparent;
  border-color: #c7bcae;
}
.text-button {
  padding: 7px 0;
  border: none;
  background: transparent;
  color: #92472e;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.login {
  background: white;
  padding: 48px;
  max-width: 640px;
  margin: 30px auto;
  border-radius: 14px;
  border-top: 4px solid var(--accent);
}
.login h1 {
  font-size: 44px;
}
.login > p {
  max-width: 440px;
  color: var(--muted);
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 18px 0 6px;
}
input,
select {
  border: 1px solid #ccc5b9;
  border-radius: 7px;
  padding: 11px 13px;
  background: white;
  max-width: 100%;
  width: 100%;
}
form .primary {
  margin-top: 18px;
}
.login form button {
  width: 100%;
}
.eyebrow {
  font-size: 11px !important;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #925133 !important;
  margin-bottom: 10px;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}
.page-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}
.page-title p {
  margin-bottom: 0;
  color: var(--muted);
}
nav {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid #d6cfc3;
  margin-bottom: 25px;
  padding-bottom: 10px;
  overflow-x: auto;
}
nav button {
  white-space: nowrap;
  background: transparent;
  border: none;
  color: var(--muted);
}
nav button.selected {
  color: var(--ink);
  background: white;
  border-bottom: 3px solid var(--accent);
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}
.treasury-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.treasury-filter input {
  width: auto;
  margin: 0;
}
.treasury-filter label {
  margin: 0;
}
#treasury > .panel,
.treasury-settings {
  margin-bottom: 24px;
}
#treasury td:first-child {
  min-width: 150px;
  white-space: normal;
  overflow-wrap: anywhere;
}
#treasury table {
  min-width: 720px;
}
#treasury details {
  margin-top: 18px;
}
#treasury summary {
  cursor: pointer;
  font-weight: 600;
}
#treasury .panel-title {
  flex-wrap: wrap;
  gap: 12px;
}
#treasury .panel-title h2 {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
#treasury .item,
#treasury .hint {
  overflow-wrap: anywhere;
}
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  font: inherit;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 18px 0;
  padding: 14px;
}
.checkbox-label {
  display: flex;
  gap: 10px;
  align-items: start;
  overflow-wrap: anywhere;
}
.checkbox-label input {
  width: auto;
  margin: 3px 0;
  flex-shrink: 0;
}
.panel,
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}
.balance {
  font-family: Georgia, serif;
  font-size: 36px;
  line-height: 1.2;
  margin: 18px 0 8px;
}
.balance small {
  font-family: system-ui;
  font-size: 15px;
}
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 22px;
  font-size: 14px;
}
.metric-grid span {
  color: var(--muted);
  display: block;
  font-size: 12px;
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.badge {
  display: inline-block;
  border: 1px solid #ded7cd;
  border-radius: 30px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.badge.active {
  color: var(--ok);
  background: #edf5ec;
  border-color: #d2e8d0;
}
.badge.critical {
  color: var(--danger);
  background: #fff0ec;
  border-color: #efb5a8;
}
.columns {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}
.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.item {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.item:last-child {
  border-bottom: 0;
}
.item-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
}
.item p {
  color: var(--muted);
  font-size: 13px;
  margin: 5px 0;
}
.item button {
  margin-top: 8px;
}
.notice {
  background: #fff8e7;
  padding: 16px;
  border-left: 3px solid #9d7728;
  margin-bottom: 22px;
  border-radius: 6px;
  font-size: 14px;
}
.table-wrap {
  overflow: auto;
  margin-top: 20px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  font-weight: 600;
  color: var(--muted);
}
td.code {
  font-family: monospace;
  font-size: 11px;
}
#message {
  padding: 15px;
  background: #fff;
  border-left: 4px solid var(--danger);
  color: var(--danger);
  margin-top: 20px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 480px;
  max-width: 95vw;
  padding: 28px;
  color: var(--ink);
}
dialog::backdrop {
  background: #17141180;
}
dialog.wide {
  width: 780px;
}
.close {
  float: right;
  border: 0;
  padding: 0 6px;
  font-size: 22px;
  background: transparent;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.dialog-actions button {
  margin: 0;
}
#action-error {
  color: var(--danger);
  font-size: 13px;
}
.quote {
  background: var(--bg);
  border-radius: 8px;
  padding: 16px;
  margin: 18px 0;
}
.quote p {
  display: flex;
  justify-content: space-between;
  margin: 7px 0;
}
.empty {
  padding: 20px 0;
  color: var(--muted);
}
footer {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 40px 0 5px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 700px) {
  main {
    padding: 22px 16px;
  }
  header {
    gap: 14px;
    padding: 16px;
  }
  .country {
    display: none;
  }
  .brand {
    margin-right: auto;
  }
  .brand img {
    height: 46px;
  }
  .login {
    padding: 28px;
    margin: 15px auto;
  }
  .login h1 {
    font-size: 36px;
  }
  h1 {
    font-size: 31px;
  }
  .columns {
    grid-template-columns: 1fr;
  }
  .panel,
  .card {
    padding: 20px;
  }
  .page-title {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .page-title button {
    padding: 9px 12px;
  }
  .balance {
    font-size: 32px;
  }
  nav button {
    padding: 9px 12px;
  }
}

#document-viewer {
  width: 950px;
}
#document-content iframe {
  width: 100%;
  height: 65vh;
  border: 1px solid var(--line);
}
#document-content pre {
  max-height: 65vh;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 13px;
  padding: 16px;
  background: var(--bg);
}
input[type="checkbox"] {
  width: auto;
}

#document-content {
  max-height: 65vh;
  overflow: auto;
}
.pdf-page {
  border: 1px solid var(--line);
  padding: 10px;
  margin-bottom: 14px;
}
.pdf-page canvas {
  display: block;
  width: 100%;
  height: auto;
}
.pdf-page summary {
  font-size: 12px;
  cursor: pointer;
  margin-top: 12px;
}

/* Keep every amount and decision visible on small screens. */
@media (max-width: 640px) {
  .freeze-table, .freeze-table tbody, .freeze-table tr, .freeze-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .freeze-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .freeze-table tbody tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .freeze-table td {
    border: 0;
    padding: 7px 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .freeze-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
  }
}

#disputes .item, #disputes p, #disputes strong { overflow-wrap:anywhere; }
#disputes .dispute-narrative { white-space:pre-wrap; color:var(--ink); }
#disputes h3 { margin-top:2rem; }
#document-content img { max-width:100%; height:auto; }

/* Conformité, DPO et annuaire du personnel (vues chargées à la demande). */
.subnav { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.bo-filter { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; margin:12px 0; }
.bo-filter select { width:auto; max-width:100%; }
.bo-filter label { margin:0 0 6px; }
.bo-filter .checkbox-label { margin:0 0 12px; }
.badge.warning { color:#7a5a17; background:#fff8e7; border-color:#e7cf96; }
dl.facts { display:grid; grid-template-columns:minmax(110px,190px) minmax(0,1fr); gap:8px 16px; margin:16px 0; }
dl.facts dt { color:var(--muted); font-size:13px; }
dl.facts dd { margin:0; overflow-wrap:anywhere; }
#compliance-body > .panel, #staff-directory > .panel, #identity-body > .panel { margin-bottom:24px; }
#compliance td, #staff-directory td, #identities td { white-space:normal; overflow-wrap:anywhere; min-width:90px; }
#compliance .item, #compliance p, #staff-directory p, #compliance h2, #staff-directory h2, #identities p, #identities h2 { overflow-wrap:anywhere; }
#compliance small, #staff-directory small, #identities small { display:block; color:var(--muted); }
#compliance .item-title { flex-wrap:wrap; }
#compliance .item-title span { min-width:0; overflow-wrap:anywhere; }
#compliance code, #staff-directory code, #identities code { font-size:11px; word-break:break-all; }
#compliance h3, #identities h3 { margin-top:1.6rem; }
#identities .niu-value { display:inline-block; margin-right:12px; font-variant-numeric:tabular-nums; letter-spacing:.04em; }
#identities .bo-filter input { width:auto; max-width:100%; }
textarea:focus-visible, h2[tabindex="-1"]:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
@media (max-width: 640px) {
  dl.facts { grid-template-columns:1fr; gap:2px; }
  dl.facts dd { margin-bottom:8px; }
  #compliance td, #staff-directory td, #identities td { min-width:0; }
}
/* Vues BO chargées à la demande (059 et suivantes) : identifiants, empreintes
   et références longues passent à la ligne au lieu d'élargir la page. */
#tariffs, #fiscal-reviews, #accounts, #dgi-access, #audit, #accounting, #withdrawals, #kyb, #detail-body dl { overflow-wrap: anywhere; }
/* Petits téléphones : la mention NovaGov cède la place au bouton de déconnexion. */
@media (max-width: 420px) {
  .brand span { display: none; }
}
