:root {
  --bg: #f5f5f0;
  --surface: #fff;
  --side: #eeefe8;
  --ink: #24382f;
  --muted: #65736b;
  --line: #dce1d9;
  --accent: #27664d;
  --soft: #e8f0e6;
  --warn: #875420;
  --warnbg: #fcf0db;
  --shadow: 0 10px 32px #18372a08;
  font:
    15px/1.55 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}
body.dark {
  --bg: #17221e;
  --surface: #202e27;
  --side: #1b2822;
  --ink: #eef2e9;
  --muted: #b0c0b5;
  --line: #3c4c40;
  --accent: #a5d4af;
  --soft: #2a4031;
  --warn: #f0c889;
  --warnbg: #3b3020;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 10px;
  min-height: 42px;
}
button:active {
  transform: scale(0.985);
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button.primary,
.primary {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}
input,
select,
textarea {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  max-width: 100%;
}
textarea {
  width: 100%;
  resize: vertical;
}
label {
  display: block;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #bc984e;
  outline-offset: 3px;
}
.lab {
  min-height: 35px;
  padding: 7px 24px;
  background: #203e32;
  color: #f4f5ef;
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.035em;
}
.lab b {
  letter-spacing: 0.14em;
}
.lab button {
  padding: 0;
  min-height: 0;
  background: none;
  color: inherit;
  border: 0;
  margin-left: auto;
  font-size: 12px;
}
.app-shell {
  display: grid;
  grid-template-columns: 242px minmax(0, 1fr);
  min-height: calc(100vh - 35px);
}
.sidebar {
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.brand {
  font-size: 32px;
  font-weight: 760;
  letter-spacing: -2px;
  display: flex;
  align-items: center;
  margin: 4px 8px 32px;
}
.brand > span:first-child {
  font-size: 29px;
  letter-spacing: -1px;
  background: #28664d;
  color: white;
  width: 36px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  margin-right: 10px;
}
.brand-dot {
  color: var(--accent);
}
.field-label,
.eyebrow {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}
#company-switch {
  width: 100%;
  font-weight: 650;
}
#trade {
  font-size: 12px;
  margin: 0 8px 25px;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
nav a {
  padding: 12px 14px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 550;
}
nav a.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow);
}
.nav-icon {
  width: 20px;
  font-size: 20px;
  font-weight: 400;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 50px;
  display: grid;
  gap: 9px;
}
.sidebar-bottom button {
  background: none;
  text-align: left;
  border-color: transparent;
}
.sidebar-bottom small {
  color: var(--muted);
  font-size: 11px;
  margin: 14px;
}
.workspace {
  min-width: 0;
}
header {
  height: 80px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}
header > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
header button,
header select {
  font-size: 12px;
}
main {
  max-width: 1450px;
  margin: auto;
  padding: 38px 42px 60px;
  min-height: 75vh;
}
h1 {
  font-size: clamp(27px, 3vw, 43px);
  line-height: 1.12;
  letter-spacing: -1.7px;
  font-weight: 650;
  margin: 9px 0 13px;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.6px;
  margin: 0 0 10px;
  font-weight: 650;
}
h3 {
  font-size: 16px;
  margin: 0 0 8px;
}
p {
  margin: 8px 0 16px;
}
.muted,
.sub {
  color: var(--muted);
}
.sub {
  max-width: 720px;
}
.title-row,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.section-head {
  margin-top: 28px;
  margin-bottom: 14px;
}
.section-head h2 {
  margin: 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  margin: 26px 0;
}
.hero-copy {
  padding: 34px;
}
.hero h2 {
  font-size: 31px;
  line-height: 1.2;
  letter-spacing: -1px;
  max-width: 600px;
  margin: 16px 0;
}
.hero-aside {
  background: var(--soft);
  padding: 30px;
  border-left: 1px solid var(--line);
}
.hero-aside ul {
  padding: 0;
  list-style: none;
}
.hero-aside li {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
}
.hero-aside li span {
  color: var(--muted);
  font-size: 12px;
}
.pill {
  display: inline-flex;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 650;
  padding: 4px 9px;
  background: var(--soft);
  color: var(--accent);
}
.pill.warn {
  background: var(--warnbg);
  color: var(--warn);
}
.metric {
  font-size: 29px;
  font-weight: 650;
  letter-spacing: -1px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child {
  border-bottom: 0;
}
.row p {
  margin: 2px 0;
  font-size: 13px;
}
.row .actions,
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.row > div:first-child {
  min-width: 0;
}
.row button {
  font-size: 12px;
}
.avatar {
  height: 42px;
  width: 42px;
  flex: none;
  border-radius: 13px;
  background: var(--soft);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 650;
}
.person {
  display: flex;
  align-items: center;
  gap: 12px;
}
.list {
  padding-top: 0;
  padding-bottom: 0;
}
.small {
  font-size: 12px;
}
.note {
  font-size: 12px;
  background: var(--soft);
  padding: 13px 16px;
  border-radius: 10px;
  color: var(--muted);
  margin: 18px 0;
}
.warning {
  background: var(--warnbg);
  color: var(--warn);
}
.tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 22px 0;
}
.tabs button.active {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, 1fr);
  gap: 22px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
form label {
  font-size: 12px;
  font-weight: 600;
  margin: 12px 0;
}
form label input,
form label select,
form label textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  font-weight: 400;
}
form button {
  margin-top: 12px;
}
.full {
  grid-column: 1/-1;
}
.link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
}
.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}
.flow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 15px 0;
}
.flow span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}
.flow span.done {
  background: var(--soft);
  color: var(--accent);
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
}
td input {
  width: 95px;
}
.search-input {
  width: 100%;
  margin-bottom: 20px;
}
.feature-symbol {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 20px;
}
.module-card {
  display: flex;
  flex-direction: column;
}
.module-card p {
  flex: 1;
  font-size: 13px;
  color: var(--muted);
}
.module-card button {
  align-self: flex-start;
}
.journal {
  font-size: 12px;
}
.journal time {
  color: var(--muted);
  display: block;
}
.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
footer {
  border-top: 1px solid var(--line);
  padding: 18px 38px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
dialog {
  max-width: 680px;
  width: calc(100% - 30px);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 90px #0003;
}
dialog::backdrop {
  background: #10251d66;
  backdrop-filter: blur(3px);
}
#close-dialog {
  float: right;
  border: 0;
  font-size: 25px;
  padding: 0 10px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--surface);
  padding: 14px 22px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 10;
  max-width: 90vw;
}
.sr-only,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip:focus {
  display: block;
  background: white;
  padding: 10px;
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
}
.draft {
  white-space: pre-wrap;
  line-height: 1.8;
  background: var(--bg);
  padding: 20px;
  border-radius: 12px;
}
.figure-bars {
  display: flex;
  align-items: end;
  gap: 7px;
  height: 100px;
  margin-top: 18px;
}
.figure-bars span {
  flex: 1;
  background: var(--accent);
  opacity: 0.5;
  border-radius: 4px 4px 0 0;
}
.figure-bars span:last-child {
  opacity: 1;
}
@media (hover: hover) {
  button:hover {
    border-color: var(--accent);
  }
  nav a:hover {
    background: var(--surface);
  }
  .link:hover {
    text-decoration: underline;
  }
}
@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  main {
    padding: 28px 24px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-aside {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .hero-aside ul {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
  }
  .hero-aside li {
    border: 0;
  }
  .split {
    grid-template-columns: 1fr;
  }
  header {
    padding: 0 24px;
  }
}
@media (max-width: 680px) {
  .lab {
    padding: 7px 12px;
    gap: 8px;
  }
  .lab > span {
    display: none;
  }
  .app-shell {
    display: block;
  }
  .sidebar {
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    gap: 6px;
  }
  .brand {
    font-size: 24px;
    margin: 0 0 8px;
  }
  .brand > span:first-child {
    width: 28px;
    height: 30px;
    font-size: 22px;
  }
  .sidebar .field-label,
  #trade,
  .sidebar-bottom small {
    display: none;
  }
  #company-switch {
    max-width: 100%;
    font-size: 13px;
  }
  nav {
    flex-direction: row;
    overflow: auto;
    padding: 8px 0;
  }
  nav a {
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 10px;
  }
  .nav-icon {
    display: none;
  }
  .sidebar-bottom {
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: space-between;
  }
  .sidebar-bottom button {
    font-size: 11px;
    padding: 4px 8px;
    min-height: 30px;
  }
  header {
    height: 62px;
    padding: 0 16px;
  }
  #breadcrumb {
    font-size: 11px;
  }
  #search-button span {
    display: none;
  }
  header select {
    max-width: 140px;
  }
  main {
    padding: 24px 16px 40px;
  }
  .grid,
  .grid.two {
    grid-template-columns: 1fr;
  }
  .hero-copy,
  .hero-aside {
    padding: 22px;
  }
  .hero h2 {
    font-size: 26px;
  }
  .panel {
    padding: 20px;
  }
  .title-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .row {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: auto;
  }
  footer {
    padding: 16px;
    flex-direction: column;
  }
  dialog {
    padding: 22px;
  }
  h1 {
    letter-spacing: -1px;
  }
  .actions button {
    flex: 1;
  }
  .hero-aside ul {
    display: block;
  }
  .hero-aside li {
    border-bottom: 1px solid var(--line);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.button-link {
  display: inline-block;
  padding: 11px 17px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
}
.dark .finance-error {
  color: #ffb1a6;
}

.version-data {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  max-height: 360px;
  overflow: auto;
}
details {
  margin-top: 12px;
}
summary {
  cursor: pointer;
  color: var(--ink);
}
.login {
  max-width: 480px;
  margin: 8vh auto;
  padding: 30px;
}
.login h1 {
  font-size: 36px;
}
.login .brand {
  margin: 0 0 30px;
}
.login input {
  width: 100%;
}
.error {
  background: var(--warnbg);
  color: var(--warn);
  padding: 14px;
  border-radius: 10px;
  overflow-wrap: anywhere;
}
.success {
  background: var(--soft);
  padding: 14px;
  border-radius: 10px;
}
.checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.checkboxes label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.checkboxes input {
  width: auto;
  margin: 0;
}
.record-card h2 {
  overflow-wrap: anywhere;
}
.record-card .actions {
  margin-top: 18px;
}
.record-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
}
.record-meta dt {
  color: var(--muted);
}
.record-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.record-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  color: var(--muted);
}
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.toolbar input {
  flex: 1;
  min-width: 0;
}
.auth-status {
  font-size: 11px;
  color: var(--muted);
}
.safety {
  border-left: 3px solid var(--accent);
}
.invite-url {
  width: 100%;
  font-size: 12px;
}
.tenant-kind {
  font-size: 12px;
  color: var(--muted);
}
.quote-line {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 80px 110px 42px;
  gap: 6px;
  align-items: end;
}
.quote-line input {
  width: 100%;
}
.quote-line button {
  padding: 8px;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check-label input {
  width: auto;
}
.busy {
  opacity: 0.65;
  pointer-events: none;
}
.empty p {
  max-width: 500px;
  margin: 10px auto;
}
.audit-detail {
  white-space: pre-wrap;
  overflow: auto;
  font-size: 12px;
  max-height: 350px;
}
.status-strip {
  padding: 9px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  background: var(--soft);
}
.danger {
  color: #a1392e;
}
.dark .danger {
  color: #ffb6aa;
}
@media (max-width: 680px) {
  .login {
    margin: 25px auto;
  }
  .checkboxes {
    grid-template-columns: 1fr;
  }
  .quote-line {
    grid-template-columns: 1fr 65px 85px 34px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .status-strip {
    padding: 9px 16px;
  }
  .record-meta {
    grid-template-columns: 1fr 1fr;
  }
}
.space-top {
  margin-top: 18px;
}
.section-top {
  margin-top: 28px;
}
.toolbar .check-label {
  font-size: 12px;
  white-space: nowrap;
}
.toolbar .check-label input {
  flex: none;
}
.human-details {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.5fr);
  gap: 10px 18px;
  font-size: 12px;
  padding: 14px;
  background: var(--bg);
  border-radius: 10px;
}
.human-details dt {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.human-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.human-details .human-details {
  padding: 0;
}
.detail-list {
  padding-left: 18px;
  margin: 0;
}
.detail-list > li + li {
  margin-top: 12px;
}
@media (max-width: 680px) {
  .human-details {
    grid-template-columns: 1fr;
  }
  .human-details dd {
    padding-bottom: 8px;
  }
}
@media print {
  body.printing-proposal {
    background: #fff;
    color: #17221e;
  }
  body.printing-proposal > *:not(#dialog) {
    display: none !important;
  }
  body.printing-proposal #dialog {
    position: static;
    display: block !important;
    border: 0;
    box-shadow: none;
    width: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    background: #fff;
    color: #17221e;
    overflow: visible;
  }
  body.printing-proposal #dialog::backdrop {
    display: none;
  }
  body.printing-proposal #dialog #close-dialog,
  body.printing-proposal #dialog .no-print {
    display: none !important;
  }
  .print-proposal .note {
    background: #f1f3ef;
    color: #24382f;
  }
  .print-proposal .muted,
  .print-proposal .eyebrow {
    color: #48564c;
  }
  .print-proposal table {
    font-size: 11px;
  }
  .print-proposal .table-wrap {
    overflow: visible;
  }
  .print-proposal tr {
    break-inside: avoid;
  }
  .print-proposal h2 {
    font-size: 24px;
  }
}
.engine-connection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.engine-connection p:last-child {
  margin-bottom: 0;
}
.engine-connection button {
  flex: none;
}
@media (max-width: 680px) {
  .engine-connection {
    align-items: flex-start;
    flex-direction: column;
  }
}
.nav-domain {
  margin: 3px 0;
}
.nav-domain > summary {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 650;
  list-style: none;
  display: flex;
  justify-content: space-between;
  border-radius: 10px;
}
.nav-domain > summary::after {
  content: "+";
  color: var(--muted);
}
.nav-domain[open] > summary::after {
  content: "−";
}
.nav-domain > div {
  border-left: 1px solid var(--line);
  margin: 0 0 10px 17px;
  padding-left: 7px;
}
.nav-domain a {
  font-size: 12px;
  padding: 9px 11px;
}
.nav-domain:has(a.active) > summary {
  color: var(--accent);
}
.payroll-people {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}
.payroll-people .section-head {
  margin-top: 0;
}
.toolbar > label input {
  display: block;
  margin-top: 6px;
}
.toolbar:has(#payroll-period) {
  align-items: end;
}
@media (max-width: 680px) {
  nav {
    flex-direction: column;
    overflow: visible;
  }
  .nav-domain > div {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
  }
  .nav-domain > summary {
    padding: 8px 10px;
  }
  .nav-domain a {
    white-space: normal;
  }
  .payroll-people .section-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
.payroll-person > summary {
  cursor: pointer;
  list-style: none;
  margin-bottom: 0 !important;
}
.payroll-person > summary::after {
  content: "Voir le détail";
  font-size: 12px;
  color: var(--accent);
}
.payroll-person[open] > summary {
  margin-bottom: 22px !important;
}
.payroll-person[open] > summary::after {
  content: "Réduire";
}
.payroll-person summary h2 {
  font-size: 18px;
}
.mobile-menu-button {
  display: none;
}
@media (max-width: 680px) {
  .mobile-menu-button {
    display: block;
    text-align: left;
    font-size: 13px;
  }
  .sidebar nav {
    display: none;
  }
  .sidebar.nav-open nav {
    display: flex;
  }
  .sidebar-bottom {
    padding-top: 6px;
  }
}
