:root {
  --bg: #000000;
  --bg-elevated: #0d0d0d;
  --bg-soft: #161616;
  --ink: #ffffff;
  --ink-soft: rgba(255, 255, 255, 0.62);
  --ink-muted: rgba(255, 255, 255, 0.4);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.28);
  --accent: #ffffff;
  --accent-hover: #e8e8e8;
  --danger: #ff6b6b;
  --danger-bg: rgba(255, 107, 107, 0.12);
  --radius: 0;
  --font: "Inter", system-ui, sans-serif;
  --display: "Montserrat", system-ui, sans-serif;
}

/* Zone principale (droite) — fond blanc, écriture noire */
.main {
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --bg-soft: #f3f3f3;
  --ink: #111111;
  --ink-soft: #555555;
  --ink-muted: #888888;
  --line: #e4e4e4;
  --line-strong: #cfcfcf;
  --accent: #111111;
  --accent-hover: #333333;
  --danger: #b42318;
  --danger-bg: rgba(180, 35, 24, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover {
  opacity: 0.75;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg);
  border-right: 1px solid var(--line);
  color: var(--ink);
  padding: 2rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.brand {
  display: block;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
  opacity: 1;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  color: var(--ink);
}

.logo-word {
  font-family: var(--display);
  font-size: 2.35rem;
  line-height: 0.9;
  letter-spacing: -0.04em;
  display: inline-flex;
  align-items: baseline;
}

.logo-s { font-weight: 100; }
.logo-t { font-weight: 300; }
.logo-o { font-weight: 700; }
.logo-a { font-weight: 900; }

.logo-tagline {
  font-family: var(--font);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  align-self: flex-end;
  margin-top: 0.1rem;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 0.35rem;
}

.nav-group-title {
  font-weight: 600;
  letter-spacing: 0.04em;
}

.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  margin-left: 0.55rem;
  padding-left: 0.7rem;
  border-left: 1px solid var(--line);
}

.nav-sub-link {
  font-size: 0.86rem;
  padding: 0.45rem 0;
  font-weight: 400;
}

.nav-link {
  color: var(--ink-soft);
  padding: 0.65rem 0;
  border-radius: 0;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover {
  color: var(--ink);
  text-decoration: none;
  opacity: 1;
}

.nav-link.is-active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.sidebar-foot-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sidebar-foot-logo {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
}

.sidebar-foot-mark {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.sidebar-foot-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.sidebar-foot-beta {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.sidebar-foot-author {
  font-size: 0.72rem;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.sidebar-foot-user {
  font-size: 0.72rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout {
  margin: 0;
}

.sidebar-logout-btn {
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
  border-color: var(--line);
  color: var(--ink-soft);
}

.login-page {
  min-height: 100vh;
  margin: 0;
  background: #000;
  color: #fff;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.login-card {
  width: min(100%, 26rem);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0d0d0d;
  padding: 2rem 1.75rem 1.75rem;
}

.login-brand {
  display: inline-block;
  margin-bottom: 1.75rem;
  color: inherit;
  text-decoration: none;
}

.login-card h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 300;
  letter-spacing: -0.03em;
}

.login-lead {
  margin: 0.4rem 0 1.25rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.login-form input {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #161616;
  color: #fff;
  padding: 0.65rem 0.75rem;
  font: inherit;
}

.login-form input:focus {
  outline: none;
  border-color: #fff;
}

.login-submit {
  margin-top: 0.35rem;
  width: 100%;
  background: #fff;
  border-color: #fff;
  color: #000;
}

.login-submit:hover {
  background: #e8e8e8;
  border-color: #e8e8e8;
  color: #000;
}

.login-page .alert {
  background: rgba(255, 107, 107, 0.12);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.35);
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
  color: var(--ink);
}

.main a:not(.btn) {
  color: var(--ink);
}

.main .btn,
.main .btn-ghost {
  border-width: 1px;
  border-color: #d0d0d0;
}

.main .btn-ghost:hover {
  border-color: #999999;
}

.main a.btn.btn-primary,
.main .btn-primary {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
  text-decoration: none;
}

.main a.btn.btn-primary:hover,
.main .btn-primary:hover {
  background: #333333;
  border-color: #333333;
  color: #ffffff;
}

.main .subnav-link.is-active {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}

.main .form input,
.main .form select,
.main .form textarea {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

.main .sheet-input {
  background: transparent;
  border: none;
  color: var(--ink);
}

.main .sheet-input:focus {
  background: rgba(0, 0, 0, 0.04);
}

.main .form option {
  background: #ffffff;
  color: #111111;
}

.main .sticky-actions {
  background: rgba(255, 255, 255, 0.94);
}

.main .name-open {
  border-bottom-color: rgba(0, 0, 0, 0.35);
}

.topbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding: 1.75rem 2rem 0.5rem;
}

.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  color: var(--ink);
  min-width: 0;
}

.topbar-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.topbar-back {
  flex-shrink: 0;
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
  border-width: 1px;
  border-color: #c8c8c8;
}

.content {
  padding: 1rem 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.stats--dashboard {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stats--dashboard .stat-value {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 300;
  line-height: 1.35;
  min-height: 1.35em;
  display: flex;
  align-items: center;
}

.stats--dashboard .stat-value--money {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  word-break: break-word;
}

.stat {
  background: var(--bg-elevated);
  padding: 1.15rem 1.25rem;
}

.stat-value--money {
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  word-break: break-word;
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 0.45rem;
}

.stat-value {
  font-family: var(--display);
  font-size: 2.1rem;
  font-weight: 300;
  line-height: 1;
}

.stat-value a {
  text-decoration: none;
  color: inherit;
}

.stat-value a:hover {
  opacity: 0.7;
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: 1.25rem 1.35rem 1.5rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.panel-head h2,
.panel-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.panel-title {
  margin-bottom: 0.85rem;
}

.panel-toolbar {
  display: grid;
  grid-template-columns: minmax(12rem, 22rem) auto;
  align-items: center;
  justify-content: space-between;
  column-gap: 1rem;
  margin-bottom: 1.1rem;
}

.panel-toolbar .table-search {
  margin-bottom: 0;
  min-width: 0;
}

.panel-toolbar .table-search-input {
  width: 100%;
}

.panel-toolbar .btn,
.panel-toolbar .btn-primary {
  justify-self: end;
  flex-shrink: 0;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
}

.table-search {
  margin-bottom: 0.85rem;
}

.table-search-input {
  width: min(100%, 22rem);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
}

.table-search-input:focus {
  outline: none;
  border-color: var(--ink);
}

.table-search-input::placeholder {
  color: var(--ink-muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 600;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 0.15rem 0.4rem;
}

.code-badge {
  display: inline-block;
  box-sizing: content-box;
  min-width: var(--code-badge-ch, 12ch);
  text-align: center;
  white-space: nowrap;
}

.actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.actions form {
  display: inline;
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  padding: 0.5rem 0.95rem;
  border-radius: 0;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
  opacity: 1;
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #000;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #000;
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  color: var(--danger);
  border-color: transparent;
  background: transparent;
}

.btn-danger:hover {
  background: var(--danger-bg);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 720px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: none;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.form label span {
  font-weight: 500;
}

.form input,
.form select,
.form textarea {
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: 1px solid var(--ink);
  border-color: var(--ink);
}

.form option {
  background: #111;
  color: #fff;
}

.form-span {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.narrow {
  max-width: 140px;
}

.address-block {
  border: 1px solid var(--line);
  padding: 1rem;
  margin: 0;
}

.address-block legend {
  padding: 0 0.35rem;
  font-weight: 600;
  color: var(--ink);
}

.alert {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(255, 107, 107, 0.35);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.empty {
  color: var(--ink-soft);
  margin: 0.5rem 0;
}

.muted {
  color: var(--ink-soft);
}

.name-open {
  cursor: pointer;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.35);
}

.name-open:hover {
  border-bottom-color: currentColor;
}

.tag {
  display: inline-block;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 0.2rem 0.65rem;
  font-size: 0.8rem;
}

.lead {
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.subnav-link {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
}

.subnav-link:hover {
  color: var(--ink);
  text-decoration: none;
  opacity: 1;
  border-color: var(--line-strong);
}

.subnav-link.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #000;
}

.adm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.adm-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: var(--bg-elevated);
  padding: 1.4rem 1.35rem;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}

.adm-card:hover {
  background: var(--bg-soft);
  text-decoration: none;
  opacity: 1;
}

.adm-card-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.adm-card-value {
  font-family: var(--display);
  font-size: 2.4rem;
  font-weight: 300;
  line-height: 1;
}

.adm-card-desc {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.sheet-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
  max-width: 760px;
  width: 100%;
}

.sheet-toolbar .actions {
  flex-shrink: 0;
  margin-left: auto;
}

.sheet-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.sheet-meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.notice {
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  max-width: 760px;
}

.budget-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 760px;
}

.sheet {
  border: 1px solid var(--line);
  overflow: auto;
  width: 100%;
  max-width: none;
  background: var(--bg);
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.sheet-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-elevated);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line-strong);
  padding: 0.4rem 0.45rem;
}

.sheet-table td,
.sheet-table th {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.22rem 0.45rem;
  vertical-align: middle;
  line-height: 1.25;
  overflow: hidden;
}

.sheet-table tr td:last-child,
.sheet-table tr th:last-child {
  border-right: none;
}

.col-poste {
  width: 48%;
}

.col-num {
  width: 26%;
  text-align: right;
  white-space: nowrap;
}

.sheet-section td {
  background: var(--bg-soft);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.45rem;
}

.sheet-row--saisie td {
  background: var(--bg);
}

.sheet-row--sous_total td,
.sheet-row--total td,
.sheet-row--emphasis td {
  background: linear-gradient(180deg, #f0f0f0 0%, #e4e4e4 100%);
  color: #111111;
  font-weight: 700;
  border-top: 1px solid #999999;
  border-bottom: 1px solid #bbbbbb;
  border-right: 1px solid transparent;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.sheet-row--sous_total td:last-child,
.sheet-row--total td:last-child,
.sheet-row--emphasis td:last-child {
  border-right: none;
}

.sheet-row--sous_total .col-poste,
.sheet-row--total .col-poste,
.sheet-row--emphasis .col-poste {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
}

.sheet-row--sous_total .sheet-num,
.sheet-row--total .sheet-num,
.sheet-row--emphasis .sheet-computed,
.sheet-row--emphasis .sheet-num {
  font-size: 0.86rem;
  color: #111111;
}

.sheet-row--emphasis .sheet-input {
  font-weight: 700;
  color: #111111;
  font-size: 0.86rem;
  background: transparent;
}

.sheet-row--emphasis .sheet-input:hover,
.sheet-row--emphasis .sheet-input:focus {
  background: rgba(0, 0, 0, 0.04);
}

.sheet-row--lots-link {
  cursor: pointer;
}

.sheet-row--lots-link:hover td {
  filter: brightness(0.97);
}


.sheet-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.sheet-toggle-mark {
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.28rem 0 0.28rem 0.4rem;
  border-color: transparent transparent transparent currentColor;
  opacity: 0.75;
  transition: transform 0.12s ease;
  flex-shrink: 0;
}

.sheet-toggle.is-open .sheet-toggle-mark {
  transform: rotate(90deg);
}

.sheet-detail.is-collapsed {
  display: none !important;
}

.sheet-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
  border: none;
  border-radius: 0;
  padding: 0.12rem 0.2rem;
  margin: 0;
  background: transparent;
  color: inherit;
  min-height: 1.35rem;
  appearance: none;
  -webkit-appearance: none;
}

.sheet-input:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sheet-input:focus {
  outline: 1px solid var(--ink);
  background: rgba(0, 0, 0, 0.04);
}

.sheet-computed {
  display: block;
  color: var(--ink-soft);
  padding: 0.12rem 0.2rem;
  font-variant-numeric: tabular-nums;
}

.sheet-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sheet-num,
.sheet-computed,
.sheet-input,
.synth-modal-kpis strong,
.synth-lots-table .num,
.donut-value,
.donut-pct,
.synth-stats dd {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "kern" 1;
  letter-spacing: 0.01em;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  padding: 0.75rem 0;
  margin: 0;
  border-top: 1px solid var(--line);
  z-index: 2;
  max-width: none;
  width: 100%;
}

.tiny {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  margin-top: 0.2rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.access-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.access-wrap {
  border: 1px solid var(--line);
  background: var(--bg-elevated);
}

.access-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.access-table th,
.access-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0.7rem 0.55rem;
  vertical-align: middle;
}

.access-table th:last-child,
.access-table td:last-child {
  border-right: none;
}

.access-table thead th {
  background: var(--bg-soft);
  text-align: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.access-role {
  text-align: left;
  min-width: 12rem;
  white-space: normal;
}

.access-menu {
  min-width: 5.5rem;
}

.access-menu-label {
  display: block;
  color: var(--ink);
  font-weight: 600;
}

.access-menu-group {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.access-check {
  text-align: center;
}

.access-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
}

.access-checkbox input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.access-box {
  width: 1.15rem;
  height: 1.15rem;
  border: 1px solid var(--line-strong);
  background: transparent;
  display: inline-block;
}

.access-checkbox input:checked + .access-box {
  background: #111111;
  border-color: #111111;
  box-shadow: inset 0 0 0 3px #ffffff;
}

.access-checkbox input:focus-visible + .access-box {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

.access-actions {
  max-width: none;
}

.synth-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.dash-commercialisation {
  margin-bottom: 0;
}

.synth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1rem;
}

.synth-card {
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  padding: 1.25rem 1.35rem 1.4rem;
}

.synth-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 400;
}

.synth-card > .muted {
  margin: 0.35rem 0 1rem;
}

.donut-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0.5rem auto 1.25rem;
}

.donut {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-track,
.donut-seg {
  fill: none;
  stroke-width: 20;
}

.donut-track {
  stroke: #ffffff;
}

.donut-seg {
  stroke-linecap: butt;
  transition: stroke-dasharray 0.2s ease;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.donut-center strong {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
}

.donut-center span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-top: 0.35rem;
}

.donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.donut-legend li {
  display: grid;
  grid-template-columns: 0.85rem 1fr auto;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.92rem;
  line-height: 1.25;
}

.donut-legend-item.is-clickable,
.donut-seg.is-clickable {
  cursor: pointer;
}

.donut-legend-item.is-clickable:hover {
  background: var(--bg-soft);
}

.donut-legend-item.is-clickable {
  padding: 0.12rem 0.4rem;
  margin: 0 -0.4rem;
}

.donut-seg.is-clickable:hover {
  stroke-opacity: 0.85;
}

.donut-label {
  text-align: left;
  justify-self: start;
}

.donut-data {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.55rem;
  justify-self: end;
  min-width: 6.5rem;
}

.donut-value {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.donut-pct {
  text-align: right;
  font-weight: 400;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  min-width: 2.5rem;
}

.donut-swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 0;
}

.synth-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0 0;
}

.synth-stats > div {
  border: 1px solid var(--line);
  padding: 0.75rem 0.85rem;
}

.synth-stats dt {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.synth-stats dd {
  margin: 0.3rem 0 0;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 300;
}

.synth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.25rem;
}

.synth-modal {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0;
  width: min(820px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.synth-modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.synth-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 0.75rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
}

.synth-modal-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 400;
}

.synth-modal-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.synth-modal-kpis > div {
  background: #fff;
  padding: 0.85rem 1rem;
}

.synth-modal-kpis span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.synth-modal-kpis strong {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 300;
}

.synth-lots-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.synth-lots-table th,
.synth-lots-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.synth-lots-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.synth-lots-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.lot-num-link,
.lot-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--line);
  background: var(--bg-soft, #f2f2f2);
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  cursor: pointer;
}

button.lot-num-link {
  appearance: none;
  -webkit-appearance: none;
}

.lot-num-link:hover {
  border-color: var(--ink);
  text-decoration: none;
  opacity: 1;
}

.lots-table [data-lot-row].is-focused td {
  background: rgba(15, 92, 76, 0.12);
  outline: 1px solid rgba(15, 92, 76, 0.35);
}

@media (max-width: 960px) {
  .synth-grid {
    grid-template-columns: 1fr;
  }

  .synth-modal-kpis {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    padding: 1.25rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-foot {
    margin-top: 1rem;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
  }

  .nav-group {
    margin-top: 0;
    width: 100%;
  }

  .nav-sub {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }

  .nav-link {
    padding: 0.35rem 0;
  }

  .stats,
  .adm-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .narrow {
    max-width: none;
  }

  .topbar,
  .content {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .sheet {
    max-width: none;
  }

  .sheet-input {
    min-height: 1.6rem;
  }

  .access-role {
    min-width: 8rem;
  }
}
