/* Les couleurs de Tework : un seul bleu (#2F72C9), l'encre de nuit. */
:root {
  --blue: #2f72c9;
  --blue-wash: #e6eef9;
  --ink: #1b2021;
  --ink-soft: #5c6465;
  --faint: #8e9596;
  --line: rgba(27, 32, 33, 0.1);
  --surface: #ffffff;
  --page: #f4f6f8;
  --ok: #1f7a4d;
  --person: #dbe7f8;
  --contact: #fbe3d3;
  --ident: #e9e0f7;
  --place: #dff1e6;
  --org: #f6efd0;
  --other: #eceeef;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ebe7;
    --ink-soft: #a7afb0;
    --faint: #7f8889;
    --line: rgba(232, 235, 231, 0.12);
    --surface: #1b2023;
    --page: #12161a;
    --blue-wash: #1d2c42;
    --person: #23406a;
    --contact: #5a3421;
    --ident: #3d2f5c;
    --place: #1f4733;
    --org: #4a4220;
    --other: #33393b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 8px;
}

.brand { display: flex; align-items: center; gap: 14px; }
.tile {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--blue);
  color: #0b2f3a;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
}
h1 { margin: 0; font-size: 22px; letter-spacing: -0.3px; }
.brand p { margin: 2px 0 0; color: var(--ink-soft); font-size: 14px; }

.local {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.18); }

main { max-width: 1180px; margin: 0 auto; padding: 8px 16px 40px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-top: 16px;
}
.card-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.num {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
h2 { margin: 1px 0 2px; font-size: 17px; }
.card-head p { margin: 0; color: var(--ink-soft); font-size: 14px; }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 18px;
  margin-bottom: 12px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.over { border-color: var(--blue); background: var(--blue-wash); }
.drop small { color: var(--faint); }

textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--page);
  color: var(--ink);
  font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  resize: vertical;
}
textarea + textarea { margin-top: 10px; }
textarea:focus, select:focus, button:focus-visible, .doc:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.row.end { justify-content: flex-end; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
.muted { color: var(--faint); font-weight: 400; }

button { font: inherit; cursor: pointer; }
.primary {
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}
.primary:disabled { opacity: 0.6; cursor: progress; }
.primary.small { padding: 6px 12px; font-size: 13px; }
.link { border: 0; background: none; padding: 0; color: var(--blue); font-weight: 600; font-size: 13px; }

.review { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
@media (max-width: 860px) { .review { grid-template-columns: 1fr; } }

.doc-wrap { position: relative; min-width: 0; }
.doc {
  max-height: 560px;
  overflow: auto;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--page);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
}
.selbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--blue-wash);
  font-size: 13px;
}
select { font: inherit; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }

mark { color: inherit; border-radius: 4px; padding: 0 2px; cursor: pointer; }
mark.off { background: transparent !important; outline: 1.5px dashed var(--faint); outline-offset: -1px; }
.t-personne { background: var(--person); }
.t-telephone, .t-email, .t-adresse { background: var(--contact); }
.t-npi, .t-ifu, .t-iban, .t-matricule, .t-plaque { background: var(--ident); }
.t-lieu { background: var(--place); }
.t-organisation { background: var(--org); }
.t-autre { background: var(--other); }

.side { min-width: 0; }
.side-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.group { padding: 10px 0; border-top: 1px solid var(--line); }
.group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.group ul { list-style: none; margin: 0; padding: 0; }
.group li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 0; font-size: 14px; }
.group li label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.group li label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group li small { color: var(--faint); font-size: 11px; }

.table { margin-top: 14px; }
.table summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.table table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table th { color: var(--faint); font-weight: 600; font-size: 12px; }

.foot { margin: 20px 4px 0; color: var(--faint); font-size: 13px; }
