* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  color: #1d2939;
  background: #f3f6fb;
}

header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding: 2rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.header-title {
  flex: 1;
}

header h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.7rem);
  color: #0f172a;
}

header p {
  margin: 0.75rem 0 0;
  color: #475569;
  max-width: 780px;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.3rem;
}

.auth-button {
  padding: 0.75rem 1.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
}

.auth-button:hover {
  background: #1d4ed8;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#user-name {
  font-weight: 600;
  color: #0f172a;
}

.auth-link-button,
.logout-button {
  padding: 0.5rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.3s ease;
}

.auth-link-button:hover,
.logout-button:hover {
  background: #e2e8f0;
}

.guest-login-btn,
.btn-primary.guest-login-btn {
  background: #f70059;
  color: #fff;
  border-color: #f70059;
}

.guest-login-btn:hover,
.btn-primary.guest-login-btn:hover {
  background: #d4004e;
  border-color: #d4004e;
}

.profile-form {
  display: grid;
  gap: 1rem;
}

.profile-form input {
  width: 100%;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font: inherit;
}

.profile-bio-textarea {
  width: 100%;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font: inherit;
  resize: vertical;
  min-height: 6rem;
  box-sizing: border-box;
}

.amendment-list-user {
  display: grid;
  gap: 1rem;
}

.amendment-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem;
}

.amendment-meta,
.amendment-target {
  margin: 0.5rem 0;
  color: #475569;
}

.current-version-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  padding: 1rem;
  margin: 1rem 0;
}

.current-version-box h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.current-version-meta {
  margin: 0 0 0.75rem;
  color: #334155;
  font-weight: 600;
}

/* ── Système de commentaires threadés ─────────────────────────────────────── */
.comment-section {
  margin-top: 1.5rem;
}

.comment-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.6rem 0.875rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.comment-section-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: 0.01em;
}

.comment-sort-select {
  padding: 0.25rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.82rem;
  background: #fff;
  color: #374151;
  cursor: pointer;
}

/* Comment tree nodes */
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.comment-node {
  padding: 0.65rem 0.75rem;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  margin-bottom: 0.4rem;
  background: #fff;
}

/* Décalage uniforme par niveau via padding sur le conteneur de réponses */
.comment-node.depth-1 { border-left-color: #e2e8f0; }
.comment-node.depth-2 { border-left-color: #bfdbfe; }
.comment-node.depth-3 { border-left-color: #93c5fd; }
.comment-node.depth-4 { border-left-color: #60a5fa; }
.comment-node.depth-5 { border-left-color: #3b82f6; }
.comment-node.depth-6 { border-left-color: #1d4ed8; }

.comment-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

.comment-author {
  font-weight: 700;
  color: #1e293b;
}

.author-link {
  cursor: pointer;
  color: inherit;
  font-weight: 600;
  border-bottom: 1px dotted currentColor;
  transition: color 0.15s;
}
.author-link:hover { color: #2563eb; }

.comment-date {
  color: #94a3b8;
  font-size: 0.78rem;
}

.comment-body {
  margin: 0 0 0.5rem;
  line-height: 1.65;
  white-space: pre-wrap;
  color: #1e293b;
}

.comment-body.comment-deleted {
  color: #94a3b8;
  font-style: italic;
}

/* Vote + action bar */
.comment-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.comment-vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.45rem;
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #f8fafc;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  color: #374151;
}

.comment-vote-btn.up   { background: #dcfce7; border-color: #86efac; color: #15803d; }
.comment-vote-btn.down { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.comment-vote-btn.up:hover   { background: #bbf7d0; border-color: #4ade80; }
.comment-vote-btn.down:hover { background: #fecaca; border-color: #f87171; }
.comment-vote-btn.up.active   { background: #16a34a; border-color: #15803d; color: #fff; font-weight: 700; }
.comment-vote-btn.down.active { background: #dc2626; border-color: #b91c1c; color: #fff; font-weight: 700; }

.comment-score {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  min-width: 1.5rem;
  text-align: center;
}

.comment-score.positive { color: #15803d; }
.comment-score.negative { color: #b91c1c; }

.comment-action-btn {
  padding: 0.15rem 0.5rem;
  border: none;
  background: none;
  font-size: 0.8rem;
  color: #64748b;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.comment-action-btn:hover { background: #f1f5f9; color: #1e293b; }
.comment-action-btn.danger { color: #b91c1c; }
.comment-action-btn.danger:hover { background: #fee2e2; }

/* Replies — le décalage est ici, uniforme à chaque niveau */
.comment-replies {
  margin-top: 0.15rem;
  padding-left: 1.25rem;
  border-left: 1px solid #f1f5f9;
}


/* Reply form inline */
.comment-reply-form {
  margin: 0.5rem 0 0.25rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

/* Root comment form */
.comment-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.comment-form textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  resize: vertical;
  min-height: 100px;
  font: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.comment-form-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.comment-form button {
  margin-top: 0;
}

/* Pagination / states */
.comment-pager {
  margin-top: 0.5rem;
  text-align: center;
}

.comment-load-more {
  width: 100%;
  margin-top: 0.25rem;
}

.comment-loading,
.comment-empty,
.comment-error {
  padding: 0.75rem 0;
  color: #64748b;
  font-size: 0.9rem;
  font-style: italic;
}

.comment-error { color: #b91c1c; }

/* ── Profil public ────────────────────────────────────────────────────────── */
.public-profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.public-profile-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.public-profile-name {
  margin: 0 0 0.2rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.public-profile-handle {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}

.public-profile-bio {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.5;
  white-space: pre-wrap;
}

.profile-tab-bar {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0;
}

.profile-tab-btn {
  padding: 0.45rem 0.9rem;
  border: none;
  background: none;
  font-size: 0.88rem;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 4px 4px 0 0;
  transition: color 0.15s, border-color 0.15s;
}

.profile-tab-btn:hover { color: #1e293b; }
.profile-tab-btn.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }

.profile-list-row {
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
}

.profile-list-row:last-child { border-bottom: none; }
.profile-list-row:hover { background: #f8fafc; border-radius: 6px; padding-left: 0.5rem; }

.profile-row-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.profile-row-title {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.92rem;
}

.profile-row-meta {
  margin: 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

.profile-comment-body {
  margin: 0 0 0.3rem;
  color: #374151;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ── Fin profil public ────────────────────────────────────────────────────── */

.amendment-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

.login-wall {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 130px);
  padding: 2rem 1rem;
  background: #f3f6fb;
}

.login-wall-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.login-wall-card h3 {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  color: #0f172a;
}

.login-wall-subtitle {
  color: #64748b;
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
}

.login-wall-card label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.3rem;
}

.login-wall-card input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.login-wall-card input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-wall-card .btn-primary {
  width: 100%;
  margin-top: 0.25rem;
}

.main-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(240px, 320px) 1fr minmax(280px, 360px);
  padding: 1.5rem;
}

.main-layout.home-layout {
  grid-template-columns: 1fr;
  max-width: 720px;
  margin: 0 auto;
}

.main-layout.menu-layout {
  grid-template-columns: 1fr;
  max-width: 960px;
  margin: 0 auto;
}

.main-layout.gestion-layout {
  grid-template-columns: 190px 1fr;
  max-width: 1140px;
  margin: 0 auto;
  align-items: start;
  gap: 1.25rem;
}

.main-layout.gestion-layout aside.sidebar {
  display: flex !important;
  flex-direction: column;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  max-height: none;
  overflow: visible;
  gap: 0;
  position: sticky;
  top: 1.5rem;
}

.main-layout.gestion-layout aside.sidebar > div {
  display: none;
}

.main-layout.gestion-layout #amendments-panel {
  display: none !important;
}

.main-layout.gestion-layout .block-header {
  display: none;
}

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.block-action-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

#open-amend-button {
  flex-shrink: 0;
  width: auto;
}

.btn-secondary,
.btn-danger {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-secondary {
  background: #64748b;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-danger {
  background: #dc2626;
}

.btn-danger:hover {
  background: #b91c1c;
}

aside.sidebar,
#amendments-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0;
}

aside.sidebar > div,
#amendments-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem;
  flex-shrink: 0;
}

aside.sidebar > div {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem;
  flex-shrink: 0;
}

.panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem;
}

.sidebar h2,
.panel h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.nav-part,
.nav-chapter,
.nav-section,
.nav-block {
  width: 100%;
  text-align: left;
  margin-bottom: 0.55rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
}

.nav-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0;
  position: relative;
}

.nav-block-row {
  position: relative;
}

.nav-block-line {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  align-items: stretch;
  gap: 0.35rem;
}

.nav-collapse-button,
.nav-collapse-spacer {
  width: 1.6rem;
  min-width: 1.6rem;
}

.nav-collapse-button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
}

.nav-collapse-button:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.nav-block-row + .nav-block-row {
  margin-top: 0.35rem;
}

.nav-block-row::before {
  content: "";
  position: absolute;
  left: -0.42rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.nav-block-row-depth-0::before {
  display: none;
}

.nav-block-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-amendment-badge {
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #f70059;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.nav-block:hover {
  background: #e2e8f0;
  color: #f70059;
}

.selected-target {
  background: #f70059;
  border-color: #f70059;
  color: #ffffff;
}

.selected-target .nav-amendment-badge {
  background: #ffffff;
  color: #f70059;
}

.nav-sublist {
  margin-left: 1rem;
  margin-bottom: 0.5rem;
}

.nav-sublist--nested {
  margin-left: 1rem;
}

.nav-group {
  margin-bottom: 0.85rem;
}

.nav-group-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  margin-bottom: 0.4rem;
  padding: 0 0.1rem;
}

.nav-env-select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

.nav-env-select:focus,
.nav-env-select:hover {
  border-color: #94a3b8;
}

.nav-text-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  margin-bottom: 0.15rem;
}

.nav-text-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.nav-text-btn.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  font-weight: 500;
}

.nav-text-code {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #64748b;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: monospace;
}

.nav-text-btn.active .nav-text-code {
  background: #bfdbfe;
  color: #1d4ed8;
}

.nav-text-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.nav-separator {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 0.5rem 0 0.85rem;
}

.nav-role-block {
  margin-bottom: 0.85rem;
}

.nav-role-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.nav-role-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
}
.nav-role--admin    { background: #fef3c7; color: #92400e; }
.nav-role--owner    { background: #dbeafe; color: #1e40af; }
.nav-role--moderator{ background: #ede9fe; color: #5b21b6; }
.nav-role--writer   { background: #d1fae5; color: #065f46; }
.nav-role--contributor { background: #e0f2fe; color: #075985; }
.nav-role--reader   { background: #f1f5f9; color: #64748b; }
.nav-role--creator  { background: #fce7f3; color: #9d174d; }

.nav-role-source {
  font-size: 0.7rem;
  color: #94a3b8;
  font-style: italic;
}

.nav-role-info {
  position: relative;
  cursor: default;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1;
}

.nav-role-tooltip {
  display: none;
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #f8fafc;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  pointer-events: none;
}

.nav-role-info:hover .nav-role-tooltip,
.nav-role-info:focus .nav-role-tooltip {
  display: block;
}

.nav-role-tooltip-item {
  padding: 0.1rem 0;
}

.nav-role-vote {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.3rem;
}

.nav-empty {
  font-size: 0.875rem;
  color: #94a3b8;
  padding: 0.25rem 0.1rem;
}

.block-tree {
  display: grid;
  gap: 0.35rem;
  overflow: hidden;
}

#content-area {
  display: grid;
  gap: 1rem;
}

  .child-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
  }

  .child-list li {
    margin: 0;
  }

  .child-list button {
    width: 100%;
    text-align: left;
    padding: 0.85rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    cursor: pointer;
  }

  .child-list button:hover {
    background: #e2e8f0;
  }

  .selected-child {
    border-color: #2563eb;
    background: #dbeafe;
  }

#block-meta {
  color: #64748b;
  margin-bottom: 1rem;
}

.readable-block {
  position: relative;
  margin: 0 0 0.8rem;
  padding: 0.75rem 1rem 0.75rem 0.75rem;
  border-left: 3px solid transparent;
  border-radius: 8px;
  line-height: 1.7;
  color: #1e293b;
  background: #ffffff;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.readable-block:hover,
.readable-block:focus-within {
  background: #f8fafc;
  border-left-color: #f70059;
}

.readable-block.has-amendments {
  border-left-color: #f9a8c8;
}

.readable-block--list-element {
  display: block;
  padding-left: 2.5rem;
  position: relative;
}

.readable-block--list-element::before {
  content: "•";
  position: absolute;
  left: 0.75rem;
  color: #f70059;
  font-weight: 800;
  font-size: 1.2rem;
}

.readable-block-text {
  white-space: pre-wrap;
  display: block;
  padding-right: 0;
}

/* Barre d'actions unifiée en bas à droite */
.readable-block-actions-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid #f1f5f9;
}

/* Boutons d'action - cachés par défaut */
.readable-block-actions-bar .action-buttons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.readable-block:hover .action-buttons,
.readable-block:focus-within .action-buttons {
  opacity: 1;
  transform: translateY(0);
}

/* Séparateur entre actions et stats */
.readable-block-actions-bar .actions-separator {
  width: 1px;
  height: 1.2rem;
  background: #e2e8f0;
  margin: 0 0.25rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.readable-block:hover .actions-separator,
.readable-block:focus-within .actions-separator {
  opacity: 1;
}

/* Statistiques (likes, amendements) */
.readable-block-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #64748b;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-item .stat-icon {
  font-size: 0.9rem;
}

.stat-item .stat-count {
  font-weight: 600;
  min-width: 1rem;
  text-align: center;
}

/* Boutons d'action */
.inline-block-action {
  width: 2rem;
  height: 2rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  color: #64748b;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.inline-block-action:hover {
  transform: scale(1.1);
}

.inline-like-button {
  color: #ec4899;
  border-color: #fce7f3;
}

.inline-like-button:hover {
  background: #fce7f3;
  border-color: #f9a8c8;
}

.inline-like-button.liked {
  background: #fce7f3;
  border-color: #f9a8c8;
  transform: scale(1.1);
}

.inline-like-button.liked:hover {
  background: #fbcfe8;
  border-color: #f472b6;
}

.inline-amend-button {
  color: #10b981;
  border-color: #d1fae5;
}

.inline-amend-button:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}

.inline-open-button {
  color: #3b82f6;
  border-color: #dbeafe;
}

.inline-open-button:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.child-list--headers .section-link-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.child-list--headers .section-link-button.has-amendments {
  border-color: #f9a8c8;
  background: #fff1f6;
}

/* Sections d'amendements */
.amendment-section {
  margin-bottom: 1.5rem;
}

.amendment-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.amendment-section--sub .amendment-section-title {
  color: #475569;
  border-bottom-color: #f1f5f9;
}

.amendment-section + .amendment-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px dashed #e2e8f0;
}

.amendment-empty {
  color: #64748b;
  font-style: italic;
  font-size: 0.9rem;
  margin: 0;
}

.amendment-block-info {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0 0 0.5rem;
  padding: 0.4rem 0.6rem;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #f70059;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.amendment-card {
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.amendment-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.amendment-section--sub .amendment-card {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.amendment-section--sub .amendment-card:hover {
  border-color: #cbd5e1;
}

.amendment-section--subheaders {
  margin-top: 1.5rem;
  border-top: 2px solid #f1f5f9;
  padding-top: 1rem;
}

/* ── Section visibilité (admin environnement) ─────────────────────────────── */

.env-visibility-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.75rem;
}

.env-visibility-section h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.vis-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0;
  gap: 1rem;
}

.vis-row--env {
  font-weight: 600;
}

.vis-label {
  flex: 1;
  font-size: 0.9rem;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vis-sublabel {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0.5rem 0 0.25rem;
  font-style: italic;
}

.vis-separator {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 0.75rem 0;
}

.vis-toggle {
  flex-shrink: 0;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.vis-toggle--public {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.vis-toggle--public:hover {
  background: #bbf7d0;
}

.vis-toggle--private {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.vis-toggle--private:hover {
  background: #fecaca;
}


.amendment-section--subheaders .amendment-card {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.amendment-section--subheaders .amendment-card:hover {
  border-color: #cbd5e1;
}

.amendment-card h4 {
  margin: 0 0 0.4rem;
}

.amendment-meta {
  font-size: 0.95rem;
  color: #475569;
  margin-bottom: 0.75rem;
}

/* Badges de statut des amendements */
.amendment-status-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}

.status-a-verifier          { background: #fef3c7; color: #92400e; }
.status-recueil             { background: #dbeafe; color: #1e40af; }
.status-revision            { background: #fce7f3; color: #9d174d; }
.status-qualifie            { background: #d1fae5; color: #065f46; }
.status-accepte             { background: #dcfce7; color: #14532d; }
.status-clos-rejete         { background: #fee2e2; color: #991b1b; }
.status-clos-accepte        { background: #bbf7d0; color: #14532d; }
.status-rejete-moderation   { background: #f3e8ff; color: #6b21a8; }

.amendment-moderation-reject-notice {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  background: #f3e8ff;
  color: #6b21a8;
  border-left: 3px solid #a855f7;
  border-radius: 4px;
  font-size: 0.875rem;
}

.amendment-moderation-reject-notice p {
  margin: 0.25rem 0 0;
}

.amendment-moderation-reject-notice p:first-child {
  margin-top: 0;
}

.amendment-moderation-reject-reason {
  font-style: italic;
}

.amendment-revision-notice {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  background: #fefce8;
  color: #854d0e;
  border-left: 3px solid #eab308;
  border-radius: 4px;
  font-size: 0.875rem;
}

.amendment-revision-notice p {
  margin: 0.25rem 0 0;
}

.amendment-revision-notice p:first-child {
  margin-top: 0;
}

.amendment-revision-reason {
  font-style: italic;
}

.revision-vote-info {
  margin: 0.4rem 0 0;
  padding: 0.35rem 0.6rem;
  background: #fefce8;
  color: #854d0e;
  border-left: 3px solid #eab308;
  border-radius: 4px;
  font-size: 0.8rem;
  font-style: italic;
}

/* Page d'accueil */
.home-page {
  padding: 1.5rem 0;
}

.home-greeting {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: #0f172a;
}

.home-intro {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0.5rem 0 1rem;
}

.home-env-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin: 1.25rem 0 0.5rem;
}

.home-text-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.home-text-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.9rem 1.1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
  min-height: 5rem;
  justify-content: space-between;
}

.home-text-card:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.home-text-card-title {
  font-weight: 500;
  color: #1e293b;
  font-size: 1rem;
}

.home-text-card-stats {
  display: flex;
  gap: 0.75rem;
  align-self: flex-end;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.5rem;
}

.home-text-card-code {
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: monospace;
}

.home-empty {
  color: #94a3b8;
  font-style: italic;
}

.home-auth-box {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.5rem;
}

.home-auth-box p {
  margin: 0 0 0.75rem;
  color: #475569;
}

.home-auth-buttons {
  display: flex;
  gap: 0.75rem;
}

/* Onglets du panneau Gestion */
/* Formulaires modales admin */
.admin-form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  margin: 0.85rem 0 0.3rem;
}

.admin-form-label:first-of-type { margin-top: 0; }

.admin-form-select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font: inherit;
  font-size: 0.9rem;
  color: #1e293b;
  transition: border-color 0.15s;
  cursor: pointer;
}

.admin-form-select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: #fff;
}

.gestion-nav-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  padding: 0 0.25rem 0.5rem;
  margin: 0;
}

.gestion-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.5rem;
}

.gestion-tab {
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: none;
  color: #64748b;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gestion-tab:hover {
  color: #1e293b;
  background: #f1f5f9;
}

.gestion-tab--active {
  color: #1e40af;
  background: #eff6ff;
  font-weight: 600;
}

/* Boutons de transition de statut */
.amendment-transition-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

.btn-transition {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-transition--recueil-soutiens    { color: #1e40af; border-color: #93c5fd; }
.btn-transition--recueil-soutiens:hover { background: #dbeafe; }
.btn-transition--revision-necessaire { color: #9d174d; border-color: #f9a8d4; }
.btn-transition--revision-necessaire:hover { background: #fce7f3; }
.btn-transition--qualifie            { color: #065f46; border-color: #6ee7b7; }
.btn-transition--qualifie:hover      { background: #d1fae5; }
.btn-transition--accepte             { color: #14532d; border-color: #86efac; }
.btn-transition--accepte:hover       { background: #dcfce7; }
.btn-transition--clos-rejete         { color: #991b1b; border-color: #fca5a5; }
.btn-transition--clos-rejete:hover   { background: #fee2e2; }
.btn-transition--clos-accepte        { color: #14532d; border-color: #4ade80; }
.btn-transition--clos-accepte:hover  { background: #bbf7d0; }

.support-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.amendment-score-row {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.5rem;
}

.amendment-support-section {
  margin-bottom: 0.75rem;
}

.amendment-progress-wrap {
  margin-top: 0.5rem;
}

.amendment-progress-label {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.amendment-progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.amendment-progress-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.amendment-progress-fill--ratio {
  background: #3b82f6;
}

.report-paragraph-option {
  display: block;
  padding: 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.report-paragraph-option input {
  margin-right: 0.75rem;
}

.report-status {
  margin-top: 1rem;
  color: #047857;
  font-weight: 600;
}

.block-measures h3 {
  margin: 1rem 0 0.75rem;
  font-size: 1.05rem;
}

.measure-list {
  margin: 0;
  padding-left: 1.25rem;
  color: #334155;
}

.measure-list li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

#amend-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

#amend-form input,
#amend-form select,
#amend-form textarea {
  width: 100%;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  margin-bottom: 1rem;
  font: inherit;
}

#amend-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.3rem;
  border: none;
  border-radius: 14px;
  background: #10b981;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

/* ── Gestion utilisateurs ─────────────────────────────────────────────────── */

.user-search-bar {
  margin-bottom: 1.25rem;
}

.user-search-input {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 0.75rem center;
  padding-left: 2.5rem;
}

.user-search-input:focus {
  outline: none;
  border-color: #6366f1;
  background-color: #fff;
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.user-card:hover {
  border-color: #6366f1;
  box-shadow: 0 2px 8px rgba(99,102,241,0.1);
}

.user-card--suspended {
  opacity: 0.6;
}

.user-card--member {
  flex-wrap: wrap;
  cursor: default;
}

.user-card--member .user-card-body {
  flex-basis: 100%;
  order: 2;
  min-width: 0;
}

.user-card--member .user-card-avatar {
  order: 1;
}

.user-card--member .user-detail-select--sm,
.user-card--member .user-detail-remove {
  order: 3;
}

.user-card--member .badge {
  order: 3;
}

.user-card-avatar {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #e0e7ff;
  color: #4338ca;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-card-body {
  flex: 1;
  min-width: 0;
}

.user-card-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card-handle {
  font-weight: 400;
  color: #94a3b8;
  font-size: 0.82rem;
}

.user-card-email {
  font-size: 0.8rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card-badges {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.user-card-roles {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.2rem;
}

.user-card-arrow {
  color: #cbd5e1;
  font-size: 1.2rem;
}

.user-list-empty {
  color: #94a3b8;
  font-style: italic;
  padding: 1rem 0;
}

.badge-admin    { background: #fee2e2; color: #991b1b; }
.badge-creator  { background: #dbeafe; color: #1e40af; }
.badge-moderator { background: #fef3c7; color: #92400e; }
.badge-suspended { background: #f1f5f9; color: #64748b; }

/* ── Détail utilisateur ───────────────────────────────────────────────────── */

.user-detail-back {
  background: none;
  border: none;
  color: #6366f1;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0 0 1rem;
  display: block;
}

.user-detail-back:hover { text-decoration: underline; }

.user-detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.user-detail-avatar {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: #e0e7ff;
  color: #4338ca;
  font-weight: 700;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-detail-name {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
}

.user-detail-meta {
  font-size: 0.82rem;
  color: #94a3b8;
}

.user-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-detail-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.user-detail-card-title {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.user-detail-field-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-detail-label {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 500;
}

.user-detail-select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font: inherit;
  font-size: 0.88rem;
  background: #f8fafc;
}

.user-detail-select--sm  { flex-shrink: 0; }
.user-detail-select--grow { flex: 1; min-width: 0; }

.user-detail-add-row .user-detail-select--sm,
.user-detail-add-row .user-detail-select--grow { width: 100%; flex: none; }

.user-detail-role-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.user-detail-role-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-detail-role-name {
  flex: 1;
  font-size: 0.88rem;
  min-width: 0;
}

.user-detail-role-env {
  color: #94a3b8;
  font-size: 0.8rem;
}

.user-detail-remove {
  flex-shrink: 0;
  background: none;
  border: 1px solid #fca5a5;
  color: #ef4444;
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
}

.user-detail-remove:hover { background: #fee2e2; }

.user-detail-add-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.user-detail-add-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  width: 100%;
}

.user-detail-empty {
  color: #94a3b8;
  font-size: 0.85rem;
  font-style: italic;
  margin: 0 0 0.5rem;
}

/* ── Gestion membres environnement (owner) ───────────────────────────────── */

.env-members-search-result {
  margin-top: 0.75rem;
}

.env-members-not-found {
  color: #94a3b8;
  font-size: 0.88rem;
  font-style: italic;
  margin: 0;
}


footer {
  padding: 1.5rem;
  text-align: center;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-bug-btn {
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  color: #64748b;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.3rem 0.9rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.footer-bug-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e293b;
}

.hidden {
  display: none !important;
}

.auth-warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  color: #92400e;
}

#auth-panel input,
#auth-panel button {
  width: 100%;
}

#auth-panel button {
  margin-top: 0.5rem;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal[hidden] {
  display: none;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
}

.reparent-modal-content {
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reparent-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

.reparent-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.reparent-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.85rem;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  white-space: pre;
  color: #334155;
  transition: background 0.12s;
}

.reparent-option:last-child {
  border-bottom: none;
}

.reparent-option:hover {
  background: #f0f9ff;
  color: #0f172a;
}

.reparent-option--header {
  font-weight: 600;
  color: #1e293b;
}

.inline-reparent-button {
  color: #7c3aed;
  border-color: transparent;
}

.inline-reparent-button:hover {
  background: #ede9fe;
  border-color: #c4b5fd;
}

.modal-close:hover {
  color: #0f172a;
}

.auth-tab {
  display: none;
}

.auth-tab.active {
  display: block;
}

.auth-tab h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: #0f172a;
}

.auth-tab label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #0f172a;
}

.password-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.password-wrapper input {
  width: 100%;
  padding-right: 2.75rem;
  box-sizing: border-box;
  margin-bottom: 0;
}

.toggle-password {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  line-height: 1;
  color: #64748b;
  opacity: 0.6;
}

.toggle-password:hover {
  opacity: 1;
}

.auth-tab input {
  width: 100%;
  padding: 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  margin-bottom: 1rem;
  font: inherit;
}

.auth-tab input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-primary {
  width: 100%;
  padding: 0.9rem;
  border: none;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  color: #64748b;
}

.link-button {
  border: none;
  background: none;
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600;
  padding: 0;
}

.link-button:hover {
  color: #1d4ed8;
}

.error-message {
  color: #dc2626;
  font-size: 0.9rem;
  margin-top: -0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 960px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Boutons d'édition inline ────────────────────────────────────────────── */

.inline-edit-button,
.inline-delete-button {
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.1rem 0.3rem;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}

.inline-edit-button:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.inline-delete-button:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.inline-move-button {
  color: #64748b;
  border-color: transparent;
}

.inline-move-button:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.inline-move-button:disabled {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}

/* Barre auteur (modifier bloc courant + ajouter sous-bloc) */
.block-author-bar {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed #e2e8f0;
  flex-wrap: wrap;
}

.block-author-bar .btn-secondary {
  font-size: 0.82rem;
  padding: 0.3rem 0.75rem;
}

/* Historique des modifications d'un bloc */
.block-history-section {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.block-history-summary {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.block-history-summary::before {
  content: '▶';
  font-size: 0.65rem;
  transition: transform 0.15s;
}

.block-history-section[open] .block-history-summary::before {
  transform: rotate(90deg);
}

.block-history-entry {
  margin-top: 0.9rem;
  padding: 0.75rem;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 6px;
  border-left: 3px solid var(--border);
}

.block-history-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.block-history-diff {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.block-history-before,
.block-history-after {
  font-size: 0.83rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  line-height: 1.5;
}

.block-history-before {
  background: #fff0f0;
  color: #a00;
  text-decoration: line-through;
  text-decoration-color: #c00;
}

.block-history-after {
  background: #f0fff4;
  color: #1a6b2a;
}

.block-history-arrow {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* Boutons d'action sur les sections (intertitre) */
.section-nav-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-nav-item .section-link-button {
  flex: 1;
  min-width: 0;
}

.section-nav-item .section-action-btn {
  width: auto;
  flex-shrink: 0;
}

.section-action-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.15rem 0.35rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}

.section-nav-item:hover .section-action-btn {
  opacity: 1;
}

.section-action-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.section-action-btn--danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.section-action-btn:disabled {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}

/* ── Cloche de notifications ─────────────────────────────────────────────── */

.notif-bell {
  position: relative;
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.2s;
}

.notif-bell:hover {
  background: #e2e8f0;
}

.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  border-radius: 9px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 340px;
  max-height: 480px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  overflow-y: auto;
  z-index: 200;
}

.notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  font-size: 0.9rem;
}

.notif-panel-header button {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
}

.notif-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s;
}

.notif-item:hover {
  background: #f8fafc;
}

.notif-item.unread {
  background: #eff6ff;
  border-left: 3px solid #2563eb;
}

.notif-item.unread:hover {
  background: #dbeafe;
}

.notif-item-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.notif-item-body {
  font-size: 0.8rem;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-item-time {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.2rem;
}

.notif-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* Wrapper relatif pour positionner le panel */
.notif-wrapper {
  position: relative;
  display: inline-flex;
}

/* ── Logo cliquable ───────────────────────────────────────────────────────── */

.logo-link {
  text-decoration: none;
  color: inherit;
}

.logo-link:hover h1 {
  opacity: 0.8;
}

/* ── Menu hamburger ───────────────────────────────────────────────────────── */

.hamburger-wrapper {
  position: relative;
  display: inline-flex;
}

.hamburger-button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.hamburger-button:hover {
  background: #e2e8f0;
}

.hamburger-button span {
  display: block;
  height: 2px;
  background: #0f172a;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger-button.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-button.is-open span:nth-child(2) {
  opacity: 0;
}
.hamburger-button.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hamburger-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  z-index: 300;
  padding: 0.4rem 0;
  overflow: hidden;
}

.header-username {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-username:hover {
  color: #e11d48;
  text-decoration: underline;
}

.hamburger-item {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.9rem;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.15s;
}

.hamburger-item:hover {
  background: #f8fafc;
}

.hamburger-item--logout {
  color: #ef4444;
}

.hamburger-item--logout:hover {
  background: #fef2f2;
}

.hamburger-item--lang {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lang-arrow {
  font-size: 0.75rem;
  color: #94a3b8;
  transition: transform 0.2s;
}

.hamburger-lang-wrapper.is-open .lang-arrow {
  transform: rotate(90deg);
}

.hamburger-separator {
  height: 1px;
  background: #f1f5f9;
  margin: 0.3rem 0;
}

.lang-submenu {
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

.lang-option {
  display: block;
  width: 100%;
  padding: 0.5rem 1.5rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.85rem;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.15s;
}

.lang-option:hover {
  background: #e2e8f0;
}

.lang-option.is-active {
  font-weight: 700;
  color: #2563eb;
}

/* ── Page signalements (modération) ─────────────────────────────────────── */

.report-filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.report-filter-btn {
  padding: 0.35rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  background: #f8fafc;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.15s, border-color 0.15s;
}

.report-filter-btn.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.report-filter-btn:hover:not(.active) {
  background: #e2e8f0;
}

.report-mine-bar {
  display: flex;
  gap: 0.25rem;
  margin-top: -0.75rem;
  margin-bottom: 1.25rem;
}

.report-mine-btn {
  padding: 0.2rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  background: none;
  cursor: pointer;
  font-size: 0.78rem;
  color: #64748b;
  transition: background 0.15s, color 0.15s;
}

.report-mine-btn.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.report-mine-btn:hover:not(.active) {
  background: #f1f5f9;
}

.report-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.report-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.report-status-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.report-status-pending   { background: #fef9c3; color: #854d0e; }
.report-status-acknowledged { background: #dbeafe; color: #1e40af; }
.report-status-resolved  { background: #dcfce7; color: #166534; }
.report-status-dismissed { background: #f1f5f9; color: #64748b; }

.report-issue {
  font-size: 0.88rem;
  margin: 0.3rem 0 0.6rem;
  color: #1e293b;
}

.report-type-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.report-type--block   { background: #e0f2fe; color: #075985; }
.report-type--comment { background: #fef3c7; color: #92400e; }

.report-comment-box {
  background: #f8fafc;
  border-left: 3px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin: 0.3rem 0 0.5rem;
}

.report-comment-author {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.report-comment-text {
  font-size: 0.88rem;
  color: #1e293b;
}

.report-amendment-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  color: #3b82f6;
  cursor: pointer;
  margin-bottom: 0.5rem;
  text-align: left;
}

.report-amendment-link:hover {
  text-decoration: underline;
}

.report-excerpt {
  font-size: 0.8rem;
  color: #64748b;
  font-style: italic;
  margin-bottom: 0.6rem;
}

.report-meta {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.report-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.report-note-input {
  width: 100%;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  font-size: 0.82rem;
  resize: vertical;
}

/* ── Signatures nominatives ──────────────────────────────────────────────────── */
.signatures-section {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.signatures-section h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: #1e293b;
}

.signatures-count {
  font-size: 0.85rem;
  color: #475569;
  margin: 0 0 0.5rem;
}

.signatures-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.signatures-list li {
  background: #e0f2fe;
  color: #0c4a6e;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

/* ── Panneau de signature (volet droit) ─────────────────────────────────────── */
.sign-panel {
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.sign-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: #1e293b;
}

.sign-panel .signatures-count {
  margin: 0 0 0.75rem;
}

/* ── Vote formel ─────────────────────────────────────────────────────────────── */
.formal-vote-section {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: #fafafa;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.formal-vote-section h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: #1e293b;
}

.vote-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.vote-status-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.vote-status--open   { background: #dbeafe; color: #1e40af; }
.vote-status--closed { background: #f1f5f9; color: #64748b; }

.vote-result-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.vote-result--adopted  { background: #dcfce7; color: #14532d; }
.vote-result--rejected { background: #fee2e2; color: #7f1d1d; }

.vote-closes-at {
  font-size: 0.8rem;
  color: #64748b;
}

.vote-counters {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.vote-oui { color: #15803d; font-weight: 600; }
.vote-non { color: #b91c1c; font-weight: 600; }

.vote-progress-bar {
  flex: 1;
  height: 8px;
  background: #fee2e2;
  border-radius: 999px;
  overflow: hidden;
}

.vote-progress-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.ballot-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-ballot {
  padding: 0.4rem 1.2rem;
  border-radius: 6px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid;
  transition: background 0.15s, transform 0.1s;
}

.btn-ballot--oui {
  background: #f0fdf4;
  color: #15803d;
  border-color: #86efac;
}
.btn-ballot--oui:hover, .btn-ballot--oui.active {
  background: #dcfce7;
}

.btn-ballot--non {
  background: #fff1f2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.btn-ballot--non:hover, .btn-ballot--non.active {
  background: #fee2e2;
}

.btn-ballot.active {
  box-shadow: 0 0 0 2px currentColor;
}

.vote-no-right {
  font-size: 0.85rem;
  color: #64748b;
  font-style: italic;
}

/* ── File de vérification ────────────────────────────────────────────────────── */
.review-queue-section {
  margin-bottom: 1.5rem;
}

.review-queue-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: #1e293b;
}

.review-queue-card {
  border-left: 3px solid #94a3b8;
}

/* ── Alerte file de vérification — en retard ─────────────────────────────────── */
.review-queue-overdue {
  margin-top: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  color: #92400e;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ── Onglets de navigation texte (Voir le texte / Qualifiés / Voter / Clos / Gérer) ── */
#text-tab-bar-container {
  margin-bottom: 1rem;
}

.text-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0;
}

.text-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #64748b;
  transition: color 0.15s, border-color 0.15s;
  border-radius: 0;
}

.text-tab-btn:hover {
  color: #1e293b;
}

.text-tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}

.text-tab-panel {
  padding: 0.5rem 0;
}

/* ── Vue traitement owner ─────────────────────────────────────────────────────── */
.treat-box {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
}

.treat-box h3 {
  margin: 0 0 0.5rem;
  color: #166534;
}

.treat-side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.treat-side {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.75rem;
}

.treat-side h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.treat-block-content {
  font-style: italic;
  color: #1e293b;
  white-space: pre-wrap;
}

.treat-proposal {
  color: #166534;
  font-weight: 500;
  white-space: pre-wrap;
}

.treat-delete {
  color: #b91c1c;
  font-style: italic;
}

/* ── Formulaire paramétrage texte ─────────────────────────────────────────────── */
.text-settings-form {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  max-width: 560px;
}

.text-settings-form h3 {
  margin: 0 0 1rem;
  color: #1e293b;
  font-size: 1.1rem;
}

.settings-field {
  margin-bottom: 1rem;
}

.settings-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.3rem;
}

.settings-field input[type="number"],
.settings-field select {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 0.9rem;
  background: #fff;
  color: #1e293b;
}

.settings-field .field-hint {
  display: block;
  font-size: 0.78rem;
  color: #6b7280;
  margin-top: 0.2rem;
}

.settings-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.settings-save-status {
  font-size: 0.85rem;
  margin-top: 0.75rem;
  font-weight: 600;
}

.settings-save-status.ok  { color: #166534; }
.settings-save-status.err { color: #b91c1c; }

/* ── Vue Espaces & Textes ───────────────────────────────────────────────────── */

.spaces-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.spaces-quota {
  font-size: 0.82rem;
  color: #475569;
  background: #f0f4ff;
  border: 1px solid #c5d3f6;
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
}

.spaces-quota-warn {
  font-size: 0.78rem;
  color: #856404;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
}

.spaces-accordion {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 0.6rem;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.spaces-accordion--open {
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.spaces-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
  gap: 0.75rem;
}

.spaces-accordion--open .spaces-accordion-header {
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.spaces-accordion-header:hover {
  background: #f1f5f9;
}

.spaces-accordion-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}

.spaces-chevron {
  font-size: 0.6rem;
  color: #94a3b8;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.spaces-accordion--open .spaces-chevron {
  transform: rotate(90deg);
}

.spaces-env-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.spaces-owner-badge {
  font-size: 0.7rem;
  background: #dcfce7;
  color: #166534;
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  font-weight: 600;
}

.spaces-meta-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.spaces-badge {
  font-size: 0.72rem;
  background: #e2e8f0;
  color: #475569;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
}

.spaces-accordion-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.spaces-action-btn {
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #475569;
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.spaces-action-btn:hover { background: #f1f5f9; border-color: #94a3b8; }
.spaces-action-btn--danger { color: #dc2626; border-color: #fca5a5; }
.spaces-action-btn--danger:hover { background: #fee2e2; border-color: #f87171; }
.spaces-action-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.spaces-vis-btn--public { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.spaces-vis-btn--public:hover { background: #bfdbfe; }

.spaces-accordion-body {
  padding: 0.75rem 1rem 1rem;
}

.spaces-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #f1f5f9;
}

.spaces-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.spaces-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  gap: 0.5rem;
}

.spaces-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.spaces-empty {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0.35rem 0 0;
}

.spaces-loading {
  font-size: 0.85rem;
  color: #94a3b8;
  font-style: italic;
}

.spaces-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.spaces-table thead tr {
  background: #f8fafc;
}

.spaces-table th {
  padding: 0.4rem 0.6rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

.spaces-th-center { text-align: center !important; }

.spaces-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.spaces-table tr:last-child td { border-bottom: none; }

.spaces-code {
  font-size: 0.75rem;
  color: #64748b;
  font-family: monospace;
}

.spaces-actions-cell {
  white-space: nowrap;
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.spaces-member-add-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.spaces-member-search-result {
  font-size: 0.82rem;
}

.spaces-member-found {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  flex-wrap: wrap;
}

.spaces-member-info {
  font-size: 0.82rem;
}

.spaces-members-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.spaces-member-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
}

.spaces-member-row .spaces-member-info { flex: 1; min-width: 0; }

.spaces-member-text-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.spaces-member-text-badge {
  font-size: 0.72rem;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

.spaces-member-text-badge-role {
  font-weight: 600;
  color: #2563eb;
}

.vr-can-vote-yes {
  font-weight: 700;
  color: #16a34a;
  font-size: 1rem;
}

.vr-can-vote-no {
  color: #cbd5e1;
  font-size: 1rem;
}

.vr-inherited-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.vote-rights-checkbox {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
  accent-color: #2563eb;
}

.vote-rights-checkbox:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Dysfonctionnements plateforme — modale footer */
/* Modale partagée signalement texte + amendement */
.form-modal-content {
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
}

.form-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
  padding-right: 1.5rem;
}

.form-modal-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.form-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.form-modal-section-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.platform-report-modal-content {
  max-width: 460px;
  padding: 1.75rem;
}

.modal-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.5rem;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.modal-btn-row {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.report-reason-textarea {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.88rem;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  color: #1e293b;
}

.report-reason-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.platform-report-subtitle {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
}

.platform-report-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: 0.9rem;
  color: #1e293b;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #f8fafc;
  line-height: 1.5;
}

.platform-report-textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: #fff;
}

.platform-report-feedback {
  font-size: 0.82rem;
  margin: 0.4rem 0 0;
}

.platform-report-feedback.error { color: #dc2626; }

.platform-report-success-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0 0.5rem;
  text-align: center;
}

.platform-report-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.platform-report-success-text {
  font-size: 0.97rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.platform-report-success-hint {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
}

.platform-report-close-btn {
  margin-top: 0.5rem;
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #475569;
  font-size: 0.85rem;
  padding: 0.4rem 1.2rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.platform-report-close-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.platform-report-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.platform-report-submit-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.platform-report-submit-btn:hover { background: #1d4ed8; }
.platform-report-submit-btn[style*="dc2626"]:hover { background: #b91c1c !important; }
.platform-report-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.success-message {
  color: #166534;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.platform-reports-closed-details {
  margin-top: 1.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.platform-reports-closed-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #475569;
  font-size: 0.9rem;
  padding: 0.25rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.platform-reports-closed-details summary::before {
  content: '▶';
  font-size: 0.65rem;
  transition: transform 0.15s;
}

.platform-reports-closed-details[open] summary::before {
  transform: rotate(90deg);
}

.platform-reports-closed-details .report-card {
  margin-top: 0.75rem;
}
