/* Page Négociations — sobre, responsive, couleurs sémantiques */

.negociations-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 0.5rem 2rem;
  font-family: var(--font-main, Arial, sans-serif);
}



.neg-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.neg-toolbar .neg-filters {
  margin-bottom: 0;
}

.neg-btn-new-fiche {
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--theme-primary, #e20714);
  color: #fff;
  white-space: nowrap;
}

.neg-btn-new-fiche:hover {
  filter: brightness(1.05);
}

.neg-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.neg-filter-btn {
  border: 1px solid rgba(56, 79, 89, 0.25);
  background: #fff;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.88rem;
  line-height: 1.25;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.neg-filter-label {
  display: inline;
}

.neg-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(56, 79, 89, 0.15);
  color: var(--theme-text-primary, #333);
}

.neg-filter-btn.is-active .neg-filter-count {
  background: rgba(56, 79, 89, 0.35);
  color: #fff;
}

.neg-filter-btn:hover {
  border-color: var(--theme-primary, #e20714);
  color: var(--theme-primary, #e20714);
}

.neg-filter-btn.is-active {
  background: var(--theme-secondary, #384f59);
  color: #fff;
  border-color: var(--theme-secondary, #384f59);
}

.neg-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.neg-accordion {
  border: 1px solid rgba(56, 79, 89, 0.18);
  border-radius: var(--ui-border-radius, 10px);
  background: #fff;
  overflow: hidden;
}

.neg-accordion > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-weight: 600;
  color: var(--theme-text-primary, #333);
}

.neg-sum-title {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.neg-sum-vote {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.neg-sum-vote__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  padding: 0 0.3rem;
  cursor: default;
}

.neg-sum-vote__chip--signer  { background: #27ae60; }
.neg-sum-vote__chip--reserve { background: #2980b9; }
.neg-sum-vote__chip--refus   { background: #c0392b; }
.neg-sum-vote__chip--neutral { background: #7f8c8d; }

.neg-results-btn {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(56, 79, 89, 0.35);
  background: #fff;
  color: var(--theme-secondary, #384f59);
  cursor: pointer;
  z-index: 1;
}

.neg-results-btn:hover {
  border-color: var(--theme-secondary, #384f59);
  background: var(--theme-secondary, #384f59);
  color: #fff;
}

.neg-view-btn {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: none;
  background: var(--theme-primary, #e20714);
  color: #fff;
  cursor: pointer;
  z-index: 1;
}

.neg-view-btn:hover {
  filter: brightness(1.1);
}

.neg-edit-fiche {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(56, 79, 89, 0.35);
  background: #fff;
  color: var(--theme-secondary, #384f59);
  cursor: pointer;
  z-index: 1;
}

.neg-edit-fiche:hover {
  border-color: var(--theme-primary, #e20714);
  color: var(--theme-primary, #e20714);
}

/* ── Dialog résultats du vote (admin) ─────────────────────────────────────── */

.neg-results-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(540px, 95vw);
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.neg-results-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.neg-results-dialog__inner {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.neg-results-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(56, 79, 89, 0.12);
}

.neg-results-dialog__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--theme-text-primary, #333);
  overflow-wrap: anywhere;
}

.neg-results-dialog__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.neg-results-dialog__footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(56, 79, 89, 0.12);
  display: flex;
  justify-content: flex-end;
}

.neg-results-question {
  margin: 0 0 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--theme-text-primary, #333);
}

.neg-results-rows {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.neg-results-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.2rem 0.75rem;
  align-items: center;
}

.neg-results-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.neg-results-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.neg-results-dot--signer  { background: #27ae60; }
.neg-results-dot--reserve { background: #2980b9; }
.neg-results-dot--refus   { background: #c0392b; }

.neg-results-bar-wrap {
  grid-column: 1;
  height: 8px;
  background: rgba(56, 79, 89, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.neg-results-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.neg-results-bar--signer  { background: #27ae60; }
.neg-results-bar--reserve { background: #2980b9; }
.neg-results-bar--refus   { background: #c0392b; }

.neg-results-count {
  grid-column: 2;
  grid-row: 1 / 3;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.neg-results-pct {
  font-weight: 400;
  color: var(--theme-text-secondary, #666);
}

.neg-results-total {
  margin: 0;
  font-size: 0.83rem;
  color: var(--theme-text-secondary, #666);
  border-top: 1px solid rgba(56, 79, 89, 0.1);
  padding-top: 0.65rem;
}

/* ── Dialog de lecture / vote ─────────────────────────────────────────────── */

.neg-view-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(720px, 95vw);
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.neg-view-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.neg-view-dialog__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 90vh;
}

.neg-view-dialog__header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(56, 79, 89, 0.12);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
}

.neg-view-dialog__title-area {
  flex: 1 1 auto;
  min-width: 0;
}

.neg-view-dialog__title {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--theme-text-primary, #333);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.neg-view-dialog__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.neg-view-dialog__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.5rem;
}

.neg-accordion > summary::-webkit-details-marker {
  display: none;
}

.neg-accordion > summary::after {
  content: "▸";
  margin-left: auto;
  font-size: 0.85rem;
  opacity: 0.5;
  transition: transform 0.2s;
}

.neg-accordion[open] > summary::after {
  transform: rotate(90deg);
}

.neg-accordion__actions {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.35rem 1rem 0.6rem;
  border-top: 1px solid rgba(56, 79, 89, 0.08);
}

.neg-accordion__body {
  padding: 0 1rem 1rem;
  border-top: 1px solid rgba(56, 79, 89, 0.08);
}

.neg-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: #fff;
}

.neg-badge--en_cours {
  background: #e67e22;
}

.neg-badge--a_venir {
  background: #2980b9;
}

.neg-badge--conclu {
  background: #27ae60;
}

.neg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0;
}

.neg-tag {
  font-size: 0.8rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: rgba(56, 79, 89, 0.08);
  color: var(--theme-text-primary, #333);
}

.neg-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--theme-text-secondary, #74848b);
  margin: 0.85rem 0 0.4rem;
}

.neg-list-points {
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.5;
  font-size: 0.92rem;
}

.neg-etat-row {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.9rem;
  margin: 0.25rem 0;
}

.neg-etat-ic {
  flex-shrink: 0;
  font-weight: 800;
}

.neg-etat-ic--ok {
  color: #27ae60;
}

.neg-etat-ic--no {
  color: #c0392b;
}

.neg-alerte {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: rgba(231, 126, 34, 0.12);
  border-left: 4px solid #e67e22;
  font-size: 0.88rem;
  font-family: var(--font-main, Arial, sans-serif);
  line-height: 1.45;
}

.neg-alerte * {
  font-family: inherit !important;
}

.neg-vote {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed rgba(56, 79, 89, 0.2);
}

.neg-vote-q {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.65rem;
  overflow-wrap: anywhere;
}

.neg-vote-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.neg-vote-btn {
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  color: #fff;
}

.neg-vote-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.neg-vote-btn--signer {
  background: #27ae60;
}

.neg-vote-btn--refus {
  background: #c0392b;
}

.neg-vote-btn--reserve {
  background: #2980b9;
}

.neg-vote-btn--neutral {
  background: #5d6d7e;
}

/* ── Nouveau UX de vote : sélection + commentaire ───────────────────────── */

.neg-vote-opts {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.neg-vote-opt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 2px solid rgba(56, 79, 89, 0.18);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  color: var(--theme-text-primary, #333);
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.neg-vote-opt::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(56, 79, 89, 0.35);
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}

.neg-vote-opt.is-selected::before {
  border-width: 5px;
}

.neg-vote-opt--signer { border-color: #27ae60; }
.neg-vote-opt--signer:hover,
.neg-vote-opt--signer.is-selected {
  background: rgba(39, 174, 96, 0.07);
  border-color: #27ae60;
}
.neg-vote-opt--signer.is-selected::before { border-color: #27ae60; background: #fff; }

.neg-vote-opt--reserve { border-color: #2980b9; }
.neg-vote-opt--reserve:hover,
.neg-vote-opt--reserve.is-selected {
  background: rgba(41, 128, 185, 0.07);
  border-color: #2980b9;
}
.neg-vote-opt--reserve.is-selected::before { border-color: #2980b9; background: #fff; }

.neg-vote-opt--refus { border-color: #c0392b; }
.neg-vote-opt--refus:hover,
.neg-vote-opt--refus.is-selected {
  background: rgba(192, 57, 43, 0.07);
  border-color: #c0392b;
}
.neg-vote-opt--refus.is-selected::before { border-color: #c0392b; background: #fff; }

.neg-vote-comment-wrap {
  margin-bottom: 0.55rem;
}

.neg-vote-comment-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--theme-text-secondary, #74848b);
  margin-bottom: 0.3rem;
}

.neg-vote-comment {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid rgba(56, 79, 89, 0.22);
  border-radius: 7px;
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
  font-family: var(--font-main, Arial, sans-serif);
  resize: vertical;
  color: var(--theme-text-primary, #333);
}

.neg-vote-comment:focus {
  outline: none;
  border-color: #2980b9;
}

.neg-vote-submit {
  display: block;
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--theme-primary, #384f59);
  color: #fff;
  margin-bottom: 0.55rem;
  transition: opacity 0.15s;
}

.neg-vote-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.neg-vote-commentaire {
  font-size: 0.84rem;
  color: var(--theme-text-secondary, #74848b);
  margin: 0.25rem 0 0.5rem;
  font-style: normal;
}

.neg-vote-meta {
  font-size: 0.82rem;
  color: var(--theme-text-secondary, #74848b);
  margin: 0.5rem 0 0;
}

.neg-vote-results {
  margin-top: 0.75rem;
}

.neg-vote-bar-row {
  margin-bottom: 0.45rem;
}

.neg-vote-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
}

.neg-vote-bar-track {
  height: 10px;
  border-radius: 5px;
  background: rgba(56, 79, 89, 0.1);
  overflow: hidden;
}

.neg-vote-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.35s ease;
}

.neg-vote-bar-fill--signer {
  background: #27ae60;
}

.neg-vote-bar-fill--refus {
  background: #c0392b;
}

.neg-vote-bar-fill--reserve {
  background: #2980b9;
}

.neg-vote-bar-fill--neutral {
  background: #7f8c8d;
}

.neg-vote-closed {
  font-size: 0.88rem;
  color: var(--theme-text-secondary, #74848b);
  font-style: italic;
}

.neg-is-hidden {
  display: none !important;
}

/* ── 2-column grid inside accordion body ─────────────────────────────────── */

.neg-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 0.5rem;
}

.neg-body-col {
  min-width: 0;
  padding: 0 0.85rem;
}

.neg-body-col:first-child {
  padding-left: 0;
  border-right: 1px solid rgba(56, 79, 89, 0.15);
}

.neg-body-col:last-child {
  padding-right: 0;
}

.neg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.5;
}

.neg-table td {
  padding: 0.3rem 0.35rem;
  vertical-align: top;
  border-bottom: 1px solid rgba(56, 79, 89, 0.07);
}

.neg-table tr:last-child td {
  border-bottom: none;
}

.neg-empty {
  font-size: 0.85rem;
  color: var(--theme-text-secondary, #74848b);
  font-style: italic;
  margin: 0.25rem 0 0;
}

/* ── Argumentaire ────────────────────────────────────────────────────────── */

.neg-argumentaire {
  margin-top: 0.9rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  background: rgba(56, 79, 89, 0.05);
  border-left: 4px solid var(--theme-secondary, #384f59);
}

.neg-argumentaire__content {
  font-size: 0.9rem;
  line-height: 1.55;
  font-family: var(--font-main, Arial, sans-serif);
  color: var(--theme-text-primary, #333);
  margin: 0;
}

.neg-argumentaire__content * {
  font-family: inherit !important;
}

/* ── Images dans les colonnes État / Propositions ───────────────────────── */

.neg-section-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.neg-img-thumb {
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  line-height: 0;
  flex-shrink: 0;
}

.neg-img-thumb img {
  display: block;
  width: auto;
  height: 80px;
  max-width: 140px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(56, 79, 89, 0.15);
  transition: opacity 0.15s;
}

.neg-img-thumb:hover img {
  opacity: 0.85;
}

/* Images dans la boîte de dialogue (gestion) */

.neg-dialog-img-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.neg-dialog-img-item {
  position: relative;
  line-height: 0;
  border-radius: 6px;
  overflow: visible;
}

.neg-dialog-img-item img {
  display: block;
  height: 64px;
  width: auto;
  max-width: 120px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(56, 79, 89, 0.15);
}

.neg-dialog-img-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c0392b;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.65rem;
  line-height: 18px;
  text-align: center;
  padding: 0;
}

/* ── Documents joints ────────────────────────────────────────────────────── */

.neg-doc-list {
  margin-top: 0.9rem;
}

.neg-doc-items {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.neg-doc-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  background: rgba(56, 79, 89, 0.04);
  border: 1px solid rgba(56, 79, 89, 0.12);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s, border-color 0.15s;
}

.neg-doc-item:hover {
  background: rgba(56, 79, 89, 0.09);
  border-color: rgba(56, 79, 89, 0.25);
}

.neg-doc-item__icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  line-height: 1;
}

.neg-doc-item__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--theme-text-primary, #333);
}

.neg-doc-item__size {
  font-size: 0.75rem;
  color: var(--theme-text-secondary, #74848b);
  flex-shrink: 0;
}

/* ── Gestion des fichiers dans la boîte de dialogue ─────────────────────── */

.neg-doc-section {
  border-top: 1px solid rgba(56, 79, 89, 0.1);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.neg-dialog-doc-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.neg-dialog-doc-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(56, 79, 89, 0.04);
  border: 1px solid rgba(56, 79, 89, 0.1);
}

.neg-dialog-doc-item .neg-doc-item__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.neg-doc-del-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #c0392b;
  font-size: 0.85rem;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  line-height: 1;
}

.neg-doc-del-btn:hover {
  background: rgba(192, 57, 43, 0.08);
}

.neg-doc-upload-btn {
  align-self: flex-start;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px dashed rgba(56, 79, 89, 0.4);
  background: #fff;
  color: var(--theme-secondary, #384f59);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.neg-doc-upload-btn:hover {
  border-color: var(--theme-secondary, #384f59);
  background: rgba(56, 79, 89, 0.04);
}

/* ── Popup visionneuse de document ───────────────────────────────────────── */

.neg-doc-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(10, 15, 20, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.neg-doc-viewer {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 920px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.neg-doc-viewer__controls {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(56, 79, 89, 0.12);
  background: #f9fafb;
  font-size: 0.8rem;
}

.neg-doc-viewer__controls.visible {
  display: flex;
}

.neg-doc-viewer__controls button {
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(56, 79, 89, 0.25);
  border-radius: 4px;
  background: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}

.neg-doc-viewer__controls button:hover {
  background: rgba(56, 79, 89, 0.08);
}

.neg-doc-viewer__controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.neg-doc-viewer__header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(56, 79, 89, 0.12);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.neg-doc-viewer__name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--theme-text-primary, #333);
}

.neg-doc-viewer__actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.neg-doc-viewer__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.neg-doc-iframe {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
  max-width: 100%;
  height: auto;
  min-height: 300px;
}

@supports (width: 100dvw) {
  .neg-doc-iframe {
    max-height: 100dvh;
  }
}

.neg-doc-fallback {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  color: var(--theme-text-secondary, #74848b);
  font-size: 0.95rem;
}

@media (max-width: 520px) {
  .neg-accordion > summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .neg-accordion > summary::after {
    margin-left: 0;
  }

  .neg-body-grid {
    grid-template-columns: 1fr;
  }
}

.neg-bureau-dialog {
  max-width: min(100vw - 2rem, 680px);
  width: 100%;
  padding: 0;
  border: 1px solid rgba(56, 79, 89, 0.2);
  border-radius: var(--ui-border-radius, 12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  font-family: var(--font-main, Arial, sans-serif);
}

.neg-bureau-dialog::backdrop {
  background: rgba(15, 23, 30, 0.45);
}

.neg-bureau-dialog__form {
  padding: 1.1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.neg-bureau-dialog__title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--theme-text-primary, #333);
  overflow-wrap: anywhere;
}

.neg-bureau-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--theme-text-secondary, #74848b);
}

.neg-bureau-field--inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.neg-bureau-field--info {
  cursor: default;
}

.neg-vote-fixed-hint {
  font-size: 0.8rem;
  color: var(--theme-text-secondary, #74848b);
  font-style: italic;
}

/* ── Éditeur de texte riche ──────────────────────────────────────────────── */

.neg-rich-editor {
  border: 1px solid rgba(56, 79, 89, 0.25);
  border-radius: 8px;
  overflow: hidden;
}

.neg-rich-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  background: rgba(56, 79, 89, 0.05);
  border-bottom: 1px solid rgba(56, 79, 89, 0.12);
  flex-wrap: wrap;
}

.neg-rich-toolbar button {
  border: none;
  background: none;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--theme-text-primary, #333);
  line-height: 1.4;
  white-space: nowrap;
}

.neg-rich-toolbar button:hover {
  background: rgba(56, 79, 89, 0.1);
}

.neg-rich-toolbar button.is-active {
  background: var(--theme-secondary, #384f59);
  color: #fff;
}

.neg-rich-color-btn {
  --color-current: #000000;
  display: inline-flex;
  align-items: center;
  padding: 3px 6px;
  border-radius: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--theme-text-primary, #333);
  line-height: 1.4;
}

.neg-rich-color-btn:hover {
  background: rgba(56, 79, 89, 0.1);
}

.neg-rich-color-btn span {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--color-current);
  pointer-events: none;
}

.neg-color-palette {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(6, 22px);
  gap: 3px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.neg-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s, border-color 0.1s;
}

.neg-color-swatch:hover {
  transform: scale(1.25);
  border-color: rgba(0, 0, 0, 0.5);
  z-index: 1;
  position: relative;
}

.neg-color-swatch[style*="#ffffff"],
.neg-color-swatch[style*="rgb(255, 255, 255)"] {
  border-color: rgba(0, 0, 0, 0.3);
}

.neg-rich-sep {
  width: 1px;
  height: 16px;
  background: rgba(56, 79, 89, 0.2);
  margin: 0 2px;
  flex-shrink: 0;
  align-self: center;
}

.neg-rich-content {
  padding: 0.45rem 0.55rem;
  min-height: 5rem;
  outline: none;
  font-size: 0.92rem;
  line-height: 1.55;
  font-family: var(--font-main, Arial, sans-serif);
  color: var(--theme-text-primary, #333);
}

/* Neutralise les font-family inline (execCommand ou copier-coller) */
.neg-rich-content * {
  font-family: inherit !important;
}

.neg-rich-content:focus {
  background: rgba(56, 79, 89, 0.02);
}

.neg-rich-content p { margin: 0 0 0.2em; }
.neg-rich-content p:last-child { margin-bottom: 0; }
.neg-rich-content ul,
.neg-rich-content ol { padding-left: 1.4rem; margin: 0.2em 0; }

.neg-rich-hint {
  font-size: 0.78rem;
  color: var(--theme-text-secondary, #74848b);
  margin: 0 0 0.25rem;
}

/* Rendu du contenu riche dans l'accordéon */

.neg-table td p { margin: 0 0 0.2em; }
.neg-table td p:last-child { margin-bottom: 0; }
.neg-table td ul,
.neg-table td ol { padding-left: 1.2rem; margin: 0.1em 0; }

.neg-etat-content,
.neg-rev-content {
  font-size: 0.9rem;
  line-height: 1.5;
  font-family: var(--font-main, Arial, sans-serif);
}

.neg-etat-content *,
.neg-rev-content * {
  font-family: inherit !important;
}

.neg-etat-content p,
.neg-rev-content p { margin: 0 0 0.25em; }

.neg-etat-content p:last-child,
.neg-rev-content p:last-child { margin-bottom: 0; }

.neg-etat-content ul,
.neg-etat-content ol,
.neg-rev-content ul,
.neg-rev-content ol { padding-left: 1.2rem; margin: 0.1em 0; }

.neg-argumentaire__content p { margin: 0 0 0.3em; }
.neg-argumentaire__content p:last-child { margin-bottom: 0; }
.neg-argumentaire__content ul,
.neg-argumentaire__content ol { padding-left: 1.4rem; margin: 0.15em 0; }

.neg-alerte p { margin: 0 0 0.25em; }
.neg-alerte p:last-child { margin-bottom: 0; }
.neg-alerte ul,
.neg-alerte ol { padding-left: 1.3rem; margin: 0.15em 0; }

.neg-bureau-field input,
.neg-bureau-field select,
.neg-bureau-field textarea {
  font-size: 0.92rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(56, 79, 89, 0.25);
  font-family: inherit;
}

.neg-bureau-field textarea {
  resize: vertical;
  min-height: 3rem;
}

.neg-bureau-dialog__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(56, 79, 89, 0.1);
}

.neg-bureau-dialog__actions-spacer {
  flex: 1;
  min-width: 0.25rem;
}

.neg-vote-confirm-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  max-width: min(100vw - 2rem, 400px);
  width: 100%;
  font-family: var(--font-main, Arial, sans-serif);
}

.neg-vote-confirm-dialog::backdrop {
  background: rgba(15, 23, 30, 0.45);
}

.neg-vote-confirm-inner {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.neg-vote-confirm-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--theme-text-primary, #333);
}

.neg-vote-confirm-choice {
  margin: 0;
  font-size: 0.95rem;
  color: var(--theme-text-primary, #333);
}

.neg-vote-confirm-choice strong {
  color: var(--theme-secondary, #384f59);
}

.neg-vote-confirm-warning {
  margin: 0;
  font-size: 0.83rem;
  color: #b35900;
  background: rgba(231, 126, 34, 0.1);
  border-left: 3px solid #e67e22;
  border-radius: 4px;
  padding: 0.45rem 0.65rem;
}

.neg-vote-confirm-identity {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(56, 79, 89, 0.05);
  border-radius: 8px;
}

.neg-vote-confirm-identity-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--theme-text-secondary, #666);
}

.neg-vote-confirm-row {
  display: flex;
  gap: 0.75rem;
}

.neg-vote-confirm-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  font-size: 0.85rem;
  color: var(--theme-text-primary, #333);
}

.neg-vote-confirm-field input {
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(56, 79, 89, 0.3);
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
  background: #fff;
  color: inherit;
  width: 100%;
  box-sizing: border-box;
}

.neg-vote-confirm-field input:focus {
  outline: 2px solid var(--theme-primary, #e20714);
  outline-offset: -1px;
  border-color: transparent;
}

.neg-vote-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.neg-btn {
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  line-height: 1.25;
  cursor: pointer;
  border: 1px solid transparent;
}

.neg-btn--ghost {
  background: #fff;
  border-color: rgba(56, 79, 89, 0.3);
  color: var(--theme-text-primary, #333);
}

.neg-btn--primary {
  background: var(--theme-primary, #e20714);
  color: #fff;
  border-color: var(--theme-primary, #e20714);
}

.neg-btn--primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.neg-btn--danger {
  background: transparent;
  color: #c0392b;
  border-color: #c0392b;
}

.neg-btn--danger:hover:not(:disabled) {
  background: rgba(192, 57, 43, 0.08);
}

@media (max-width: 860px) {
  .neg-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .neg-btn-new-fiche {
    width: 100%;
    text-align: center;
  }

  .neg-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 0.5rem;
  }

  .neg-filter-btn {
    width: 100%;
    min-height: 2.35rem;
    justify-content: center;
  }

  .neg-filter-label {
    text-align: center;
  }

  .neg-accordion > summary {
    padding: 0.75rem 0.85rem;
    gap: 0.45rem 0.55rem;
  }

  .neg-edit-fiche {
    padding: 0.3rem 0.55rem;
  }

  .neg-body-col {
    padding: 0 0.6rem;
  }

  .neg-vote-opt {
    padding: 0.55rem 0.7rem;
    font-size: 0.87rem;
  }

  .neg-vote-submit,
  .neg-btn,
  .neg-doc-upload-btn {
    min-height: 2.4rem;
  }

  .neg-doc-viewer__name {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    line-height: 1.35;
  }

  .neg-doc-overlay {
    padding: 0.5rem;
  }

  .neg-doc-viewer {
    height: calc(100vh - 1rem);
    border-radius: 8px;
  }

  .neg-doc-viewer__body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .neg-doc-iframe {
    min-height: 400px;
  }
}

@media (max-width: 560px) {
  .negociations-page {
    padding: 0.6rem 0.35rem 1.25rem;
  }

  .neg-counter {
    flex: 1 1 calc(50% - 0.35rem);
    min-width: 0;
  }

  .neg-counter__value {
    font-size: 1.25rem;
  }

  .neg-filters {
    grid-template-columns: 1fr;
  }

  .neg-filter-btn,
  .neg-btn-new-fiche {
    font-size: 0.85rem;
  }

  .neg-accordion > summary {
    flex-direction: column;
    align-items: stretch;
  }

  .neg-accordion > summary::after {
    margin-left: 0;
  }

  .neg-sum-vote {
    order: 2;
  }

  .neg-body-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .neg-body-col,
  .neg-body-col:first-child,
  .neg-body-col:last-child {
    padding: 0;
    border-right: none;
  }

  .neg-accordion__body {
    padding: 0 0.75rem 0.85rem;
  }

  .neg-vote-bar-label {
    gap: 0.5rem;
    line-height: 1.35;
  }

  .neg-doc-viewer__header {
    padding: 0.65rem 0.75rem;
  }

  .neg-doc-viewer__actions {
    width: 100%;
  }

  .neg-doc-viewer__actions .neg-btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .neg-bureau-dialog {
    max-width: calc(100vw - 1rem);
  }

  .neg-bureau-dialog__form {
    padding: 0.85rem 0.8rem 0.95rem;
    gap: 0.65rem;
  }

  .neg-rich-toolbar button {
    padding: 0.28rem 0.45rem;
    font-size: 0.75rem;
  }

  .neg-bureau-dialog__actions {
    flex-wrap: wrap;
  }

  .neg-bureau-dialog__actions-spacer {
    display: none;
  }

  .neg-bureau-dialog__actions .neg-btn {
    flex: 1 1 100%;
    width: 100%;
  }

  .neg-vote-confirm-inner {
    padding: 1rem;
  }

  .neg-vote-confirm-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .neg-vote-confirm-actions {
    flex-direction: column-reverse;
  }

  .neg-vote-confirm-actions .neg-btn {
    width: 100%;
  }
}

  /* Mobile document viewer improvements */
  .neg-doc-overlay {
    padding: 0.25rem;
  }

  .neg-doc-viewer {
    height: calc(100vh - 0.5rem);
    border-radius: 6px;
    max-width: 100%;
  }

  .neg-doc-viewer__header {
    padding: 0.5rem 0.6rem;
    flex-wrap: wrap;
  }

  .neg-doc-viewer__name {
    font-size: 0.8rem;
  }

  .neg-doc-viewer__actions {
    width: 100%;
    gap: 0.3rem;
  }

  .neg-doc-viewer__actions .neg-btn {
    flex: 1 1 auto;
    text-align: center;
    font-size: 0.75rem;
    padding: 0.4rem 0.5rem;
  }

  .neg-doc-viewer__controls {
    padding: 0.35rem 0.5rem;
    gap: 0.35rem;
  }

  .neg-doc-viewer__controls button {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
  }

  .neg-doc-iframe {
    min-height: 300px;
  }
}
