@import url('variables.css');

:root {
  --topbar-height: 52px;
  --layout-gap: 0px;
  --layout-padding: 24px;
  --sidebar-offset: 48px; /* largeur effective du menu + marge de sécurité */
}

/* ============================= */
/*          BASE GLOBAL         */
/* ============================= */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  font-family: var(--font-main);
  background-color: var(--carbone);
  color: var(--cgt-white);
}

body.dashboard-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

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

/* ============================= */
/*          AUTH OVERLAY         */
/* ============================= */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(226, 7, 20, 0.18), transparent 28%),
              radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.08), transparent 36%),
              linear-gradient(135deg, rgba(56, 79, 89, 0.96), rgba(31, 31, 31, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.75rem;
  box-sizing: border-box;
  z-index: 2000;
}

.auth-card {
  width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
  color: var(--cgt-white);
}

.auth-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}

.auth-logo {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.auth-eyebrow {
  margin: 0;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.78);
  text-transform: uppercase;
}

.auth-title {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.auth-subtitle {
  margin: 0 0 1.2rem 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-form label {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}

.auth-form input {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--cgt-white);
  font-size: 1rem;
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
}

.auth-form input:focus {
  border-color: rgba(226, 7, 20, 0.6);
  box-shadow: 0 0 0 2px rgba(226, 7, 20, 0.15);
}

.auth-submit {
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, var(--cgt-red), #f04a4a);
  border: none;
  color: var(--cgt-white);
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(226, 7, 20, 0.35);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.12s ease;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(226, 7, 20, 0.45);
  filter: brightness(1.04);
}

.auth-submit:active {
  transform: translateY(0);
  box-shadow: 0 8px 16px rgba(226, 7, 20, 0.3);
}

.auth-error {
  min-height: 1.2rem;
  margin: 0;
  color: var(--cgt-red);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.admin-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
}

.admin-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-form-row input,
.admin-form-row select,
.admin-form-row textarea {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: var(--cgt-white);
}

.admin-form-row textarea {
  resize: vertical;
  min-height: 110px;
  font-family: inherit;
}

.admin-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.admin-submit {
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--cgt-red), #f04a4a);
  color: var(--cgt-white);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(226, 7, 20, 0.32);
  transition: transform 0.12s ease, box-shadow 0.18s ease;
}

.admin-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(226, 7, 20, 0.42);
}

.admin-feedback {
  margin: 0.5rem 0 0;
  grid-column: 1 / -1;
  min-height: 1.2rem;
}

.doc-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.doc-modal.is-open {
  display: flex;
}

.doc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.doc-modal-content {
  position: relative;
  background: #0f0f10;
  border-radius: 10px;
  padding: 0;
  width: min(90vw, 960px);
  height: min(80vh, 720px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.doc-modal-body {
  flex: 1;
}

.doc-modal-body object {
  width: 100%;
  height: 100%;
  border: none;
}

.doc-preview-object {
  width: 100%;
  height: 100%;
  border: none;
}

.doc-preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.doc-modal-close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 1rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
}

.definitions-viewer .admin-user-card {
  cursor: default;
}

.admin-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.4rem 0.8rem;
}

.admin-menu-grid h3 {
  grid-column: 1 / -1;
  margin: 0.4rem 0 0.2rem 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
}

.admin-menu-grid label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.admin-menu-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.admin-menu-group {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
}

.admin-menu-group h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: rgba(0, 0, 0, 0.9);
  background: rgba(255, 255, 255, 0.78);
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.admin-role-label {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.85);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.admin-form-row input[type="file"] {
  color: var(--cgt-white);
}

.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 1.5rem;
  min-height: 160px;
  text-align: center;
  background: var(--carbone-15);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.drop-zone:hover,
.drop-zone.is-dragover {
  border-color: rgba(255, 255, 255, 0.3);
  background: var(--carbone-50);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.28);
}

.drop-zone.has-file {
  background: var(--foret-30);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.32);
}

.drop-zone input[type="file"] {
  display: none;
}

.drop-zone-text {
  margin: 0 0 0.35rem 0;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.contact-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.contact-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.contact-panel-info {
  background: var(--carbone-20);
}

.contact-panel input[type="text"],
.contact-panel textarea,
.contact-panel input[type="email"] {
  width: 100%;
}

.contact-panel textarea {
  margin-top: 0.4rem;
}

.contact-panel .stack.gap > label,
.contact-panel .stack.gap > .stack {
  width: 100%;
}

.contact-message-block {
  margin-top: 0.75rem;
}

.contact-panel .admin-submit {
  margin-top: 0.75rem;
}

.module-motdepasse {
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.module-motdepasse input[type="text"],
.module-motdepasse input[type="email"],
.module-motdepasse input[type="password"] {
  width: 100%;
}

.module-motdepasse label {
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.module-motdepasse .admin-checkbox {
  margin: 0.3rem 0 0.8rem 0;
}

.module-motdepasse .admin-actions-row,
.module-motdepasse button.admin-submit {
  margin-top: 0.8rem;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}

.contact-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.contact-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 0.35rem 0;
}

.admin-hint-muted {
  font-style: italic;
  color: var(--carbone);
}

.admin-table-wrapper {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.admin-table th {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

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

.admin-user-card {
  padding: 0.4rem 0.9rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease;
  display: block;
}

.admin-user-card.user-active {
  background: var(--vert-eau-70);
  border-color: var(--vert-eau-70);
  color: var(--carbone);
}

.admin-user-card.user-inactive {
  background: var(--brique-50);
  border-color: var(--brique-50);
  color: var(--carbone);
}

.admin-user-card.user-active .admin-chip,
.admin-user-card.user-inactive .admin-chip {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--carbone);
}

.admin-users-list .admin-user-card {
  font-size: 0.8rem;
}

.admin-user-email {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.admin-user-last {
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

.admin-user-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.admin-user-left {
  flex: 1 1 50%;
  min-width: 220px;
}

.admin-user-right {
  flex: 0 0 200px;
  min-width: 180px;
}

.admin-user-info-line {
  margin-bottom: 0.4rem;
}

.admin-user-card .admin-actions {
  position: static;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}

.group-point-line {
  border-top: 2px solid rgba(75, 75, 75, 0.75);
  padding-top: 0.35rem;
  margin-top: 0.35rem;
}

.admin-user-card.doc-card {
  cursor: pointer;
}

.admin-user-card.doc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
  background: var(--carbone-15); /* carbone 15 */
}

.admin-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  margin-top: 0.1rem;
}

.elus-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.elus-col.actions-col {
  display: flex;
  justify-content: flex-end;
}

.doc-added {
  font-size: 0.8rem;
  font-style: italic;
  color: #e5e5e5;
  text-align: right;
  margin-top: 0.2rem;
}

.doc-delete {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: var(--cgt-red);
  border: 1px solid #d10612;
  color: var(--cgt-white);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.doc-delete:hover {
  background: #f04a4a;
  border-color: #f04a4a;
  transform: translateY(-1px);
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
}

.chip-success {
  background: var(--vert-eau-70);
  border-color: var(--vert-eau-70);
  color: var(--carbone);
}

.chip-warning {
  background: var(--brique-50);
  border-color: var(--brique-50);
  color: var(--carbone);
}

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

.no-scroll {
  overflow: hidden;
}

.popup-card {
  background: var(--carbone-15);
  color: var(--cgt-white);
  padding: 1.25rem 1.5rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 260px;
  max-width: 420px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.popup-body {
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.5;
}

.popup-card .popup-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, var(--cgt-red), #f04a4a);
  color: var(--cgt-white);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease;
}

.popup-card .popup-ok:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(226, 7, 20, 0.35);
}

.actualites-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.actualites-actions {
  display: flex;
  align-items: flex-start;
}

.actualites-form-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.module-actualites {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.actualites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.tab-bar-actualites {
  margin-top: -0.35rem;
  margin-bottom: 0.25rem;
}

.actualite-bubble {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.actualite-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: rgba(255, 255, 255, 0.75);
}

.actualite-tags {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.actualite-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--carbone);
  background: var(--vert-eau-70);
}

.actualite-tag.tag-danger {
  background: var(--brique-50);
}

.actualite-tag.tag-warning {
  background: var(--bulle-or);
  color: var(--carbone);
}

.actualite-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.actualite-badge.archive {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.85);
}

.actualite-date {
  font-style: italic;
}

.actualite-title {
  margin: 0.1rem 0 0.35rem 0;
  font-size: 1.05rem;
}

.actualite-body {
  margin: 0;
  line-height: 1.5;
  text-align: justify;
}

.admin-actions.bottom-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-actions-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.actualite-actions-bottom {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.actualite-action {
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--carbone-50, rgba(0, 0, 0, 0.5));
  color: var(--cgt-white);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.actualite-action:hover {
  background: rgba(0, 0, 0, 0.65);
  transform: translateY(-1px);
}

.actualite-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--cgt-red);
  border: 1px solid rgba(0, 0, 0, 0.25);
  color: var(--cgt-white);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.actualite-delete:hover {
  background: #f04a4a;
}

.actualite-image {
  width: 100%;
  border-radius: 12px;
  margin: 0.4rem 0 0.5rem;
  object-fit: cover;
}

.actualite-file {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--cgt-white);
  text-decoration: none;
  font-weight: 700;
  margin: 0.3rem 0 0.5rem;
}

.actualite-file:hover {
  background: rgba(255, 255, 255, 0.15);
}

.module-elus {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.module-elus .admin-hint {
  color: var(--carbone);
}

.module-elus #elus-count {
  color: var(--carbone);
  font-weight: 700;
}

.module-elus .admin-user-card {
  background: rgba(255, 255, 255, 0.06);
}

.module-elus .admin-user-card .admin-chip {
  background: rgba(255, 255, 255, 0.14);
  color: var(--carbone);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  position: absolute;
  top: 8px;
  right: 8px;
}

.admin-actions button {
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.25);
  color: var(--cgt-white);
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.admin-actions button:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.admin-actions button.danger {
  border-color: rgba(226, 7, 20, 0.8);
  background: rgba(226, 7, 20, 0.85);
  color: var(--cgt-white);
}

.admin-user-card .admin-actions button,
.admin-user-card .admin-actions select {
  width: 100%;
}

.admin-user-card .admin-actions select {
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.25);
  color: var(--cgt-white);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.admin-actions .delete-icon {
  padding: 0.3rem 0.45rem;
  border-radius: 50%;
  min-width: 32px;
  text-align: center;
}

.admin-roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  align-items: start;
}

.admin-role-form {
  align-self: start;
}

.admin-row-span {
  grid-column: 1 / -1;
}

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

.admin-role-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-role-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.admin-role-title {
  font-weight: 800;
  font-size: 1.05rem;
}

.admin-role-sub {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
}

.admin-role-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-role-label-inline {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-role-label-inline input {
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: var(--cgt-white);
}

.admin-role-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-role-modules label {
  font-weight: 600;
}

.is-disabled {
  opacity: 0.6;
}

/* Onglets (CSE Hexafret) */
.tab-bar {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1rem 0;
  padding: 0.2rem;
  background: var(--carbone-15);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.tab-btn {
  flex: 1;
  padding: 0.35rem 0.55rem;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--carbone-15);
  color: var(--carbone);
  font-weight: 600;
  letter-spacing: 0.015em;
  text-transform: none;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tab-btn:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--cgt-red), #f04a4a);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 26px rgba(226, 7, 20, 0.35);
  transform: translateY(-1px);
  color: #fff;
}

.tab-panel {
  margin-top: 0.5rem;
}

/* Masquer les titres internes des modules chargés dans les onglets CSE */
.tab-panel h1:first-of-type,
.tab-panel h2:first-of-type,
#cse-tab-odj h1, #cse-tab-odj h2,
#cse-tab-import h1, #cse-tab-import h2,
#cse-tab-archives h1, #cse-tab-archives h2 {
  display: none !important;
}

.admin-role-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.admin-role-inline select {
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.3);
  color: var(--cgt-white);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
}

.admin-hint {
  color: rgba(255, 255, 255, 0.75);
}

/* ============================= */
/*         BANDEAU HAUT         */
/* ============================= */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background-color: var(--carbone);
  color: var(--cgt-white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
  z-index: 1000;
  box-sizing: border-box;
  box-shadow: none;
  justify-content: center;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.2rem;
  height: 100%;
  line-height: 1;
  margin-top: 2px;
  text-transform: none;
  color: var(--cgt-white);
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.topbar-subtitle {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 700;
  font-size: 0.85rem;
}

.logout-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--cgt-white);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.24);
  transition: background-color 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
}

.logout-button:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.logout-button:active {
  transform: translateY(0);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.version-footer {
  width: 100%;
  text-align: center;
  font-size: 0.7rem;
  font-style: italic;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 12px;
}

.menu-button {
  background: rgba(255, 255, 255, 0.06);
  color: var(--cgt-white);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 1.2rem;
  cursor: pointer;
  height: 40px;
  width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.menu-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

.menu-button:focus {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.cache-button {
  font-size: 1.4rem;
}

/* ============================= */
/*        DISPOSITION GRID      */
/* ============================= */
.layout-row {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--layout-gap);
  padding: calc(var(--topbar-height) + 4px) var(--layout-padding) var(--layout-padding);
  padding-left: 0;
  box-sizing: border-box;
  width: 100%;
  flex: 1;
  align-items: flex-start;
}

/* ============================= */
/*           SIDEBAR            */
/* ============================= */
.sidebar {
  width: 36px;
  flex-shrink: 0;
  background: var(--carbone);
  color: var(--cgt-white);
  border-radius: 14px;
  padding: 0.35rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
  position: fixed;
  top: calc(var(--topbar-height) + 4px);
  left: 0;
  height: calc(100vh - var(--topbar-height) - 8px);
  overflow-y: auto;
}

.menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.menu li {
  margin: 0;
}

.sidebar .menu button {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--cgt-white);
  font-weight: 700;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 8px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.26);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
  position: relative;
  overflow: visible;
}

.sidebar .menu button .menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 18px;
  font-size: 1rem;
}

.sidebar .menu button .menu-tooltip {
  display: none;
  font-size: 0.82rem;
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--carbone);
  color: var(--cgt-white);
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
  z-index: 2000;
}

.sidebar .menu button:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);
  transform: translateY(-1px);
}

.sidebar .menu button.active {
  background-color: var(--cgt-white);
  color: var(--carbone);
  border-color: var(--cgt-white);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3), 0 10px 18px rgba(0, 0, 0, 0.22);
}

.sidebar .menu button:hover .menu-tooltip {
  display: inline-flex;
  align-items: center;
}

.menu-separator {
  height: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin: 1.05rem 0 0.35rem; /* espace équivalent à un bouton */
}

.cache-menu-button {
  background-color: var(--cgt-red);
  color: var(--cgt-white);
  border-color: var(--cgt-red);
}

.cache-menu-button:hover {
  background-color: #b30610;
  border-color: #b30610;
  color: var(--cgt-white);
}

/* Renforce le style rouge pour le bouton cache dans le menu */
.sidebar .menu button.cache-menu-button {
  background-color: var(--cgt-red);
  border-color: var(--cgt-red);
  color: var(--cgt-white);
}

.sidebar .menu button.cache-menu-button:hover {
  background-color: #b30610;
  border-color: #b30610;
  color: var(--cgt-white);
}

.second-menu {
  margin-top: 2rem;
  border-top: 2px solid var(--carbone-50);
  padding-top: 1rem;
}

/* ============================= */
/*        CONTENU CENTRAL       */
/* ============================= */
.main-content {
  flex: 1;
  display: flex;
  background: transparent;
  margin: 0;
  padding: 0;
  margin-left: var(--sidebar-offset);
  width: calc(100% - var(--sidebar-offset));
}

#module-content {
  width: 100%;
  background-color: var(--cgt-white);
  color: var(--text-dark);
  box-sizing: border-box;
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  min-height: calc(100vh - var(--topbar-height) - (var(--layout-padding) * 2));
}

.main-content h1 {
  color: var(--carbone);
  margin-top: 0;
}

/* Espacement uniforme avant le titre de chaque module */
.main-content > div:first-child {
  padding-top: 0.5rem;
}

/* ============================= */
/*         RESPONSIVE           */
/* ============================= */
@media (max-width: 900px) {
  .layout-row {
    padding: calc(var(--topbar-height) + 4px) 12px 16px;
    padding-left: 0;
  }

  .sidebar {
    width: 36px;
    border-radius: 12px;
  }

  /* Sur mobile on masque les infobulles des menus */
  .sidebar .menu button .menu-tooltip {
    display: none !important;
  }

  #module-content {
    min-height: auto;
  }

  .main-content {
    margin-left: var(--sidebar-offset);
    width: calc(100% - var(--sidebar-offset));
  }
}

@media (max-width: 520px) {
  .menu {
    flex-direction: column;
  }

  .menu li {
    width: 100%;
  }
}

.form-popup {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -10%);
  background: white;
  border: 2px solid var(--carbone);
  padding: 1rem;
  box-shadow: 0 0 10px gray;
  z-index: 9999;
}

/* ============================= */
/*        DEFINITIONS PAGE       */
/* ============================= */
.definitions-module {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
}

.definitions-module h1 {
  width: 100%;
}

.definitions-filters label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--carbone);
}

.definitions-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 240px));
  gap: 0.75rem;
  justify-content: center;
  font-size: 1rem;
}

.definitions-choices {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 1100px;
}

.definitions-choices .filters-row {
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  padding: 0.75rem 1rem;
  background: var(--cgt-white);
  border: 1px solid var(--carbone-50);
  border-radius: 10px;
  box-shadow: var(--shadow-default);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-sizing: border-box;
}

.definitions-choices .filters-row .definitions-filters {
  width: 100%;
}

.definitions-choices .viewer-wrapper {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.definitions-filters select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--carbone-50);
  background: var(--cgt-white);
  box-shadow: var(--shadow-default);
}

.definitions-viewer {
  background: var(--cgt-white);
  border: 1px solid var(--carbone-50);
  border-radius: 8px;
  padding: 1rem;
  min-height: 150px;
  box-shadow: var(--shadow-default);
  text-align: left;
  font-size: 1rem;
}

.definitions-viewer h3 {
  margin-top: 0;
  color: var(--carbone);
  font-size: 1rem;
  font-weight: 700;
}

/* ============================= */
/*       LIVRE DU FRET PAGE      */
/* ============================= */
.livre-fret {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.5rem 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--carbone);
}

.livre-fret__intro {
  background: var(--sable-50);
  border: 1px solid var(--carbone-15);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.livre-fret__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--rouge-3);
}

.livre-fret h1 {
  margin: 0.2rem 0 0.4rem;
  font-size: 2rem;
  color: var(--carbone);
}

.livre-fret h2 {
  margin: 0 0 0.6rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--carbone-70);
}

.livre-fret__lede {
  margin: 0;
  line-height: 1.6;
  font-size: 1rem;
}

.livre-fret__section {
  background: var(--cgt-white);
  border: 1px solid var(--carbone-15);
  border-left: 6px solid var(--rouge-3);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.livre-fret__section h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: var(--carbone);
}

.livre-fret__section p {
  margin: 0;
  line-height: 1.6;
}

.livre-fret__list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
  line-height: 1.5;
}

.livre-fret__list--two-col {
  columns: 2;
  column-gap: 1.4rem;
}

.livre-fret__message {
  background: var(--bleu-horizon-50);
}

.livre-fret__conclusion {
  background: var(--vert-eau-50);
}

.livre-fret__accordion {
  border: 1px solid var(--carbone-15);
  border-radius: 12px;
  background: var(--cgt-white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.livre-fret__accordion summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.9rem 1.1rem;
  background: var(--carbone-15);
  border-bottom: 1px solid var(--carbone-15);
}

.livre-fret__accordion summary h3 {
  margin: 0;
  font-size: 1.05rem;
}

.livre-fret__accordion summary::marker,
.livre-fret__accordion summary::-webkit-details-marker {
  display: none;
}

.livre-fret__accordion summary::after {
  content: "+";
  font-weight: 800;
  color: var(--carbone);
}

.livre-fret__accordion[open] summary::after {
  content: "–";
}

.livre-fret__accordion > .livre-fret__section {
  margin: 0;
  border: none;
  border-left: 6px solid var(--rouge-3);
  border-radius: 0 0 12px 12px;
  box-shadow: none;
}

@media (max-width: 720px) {
  .livre-fret {
    padding: 0.5rem 0.3rem 1.25rem;
  }

  .livre-fret__list--two-col {
    columns: 1;
  }
}

/* ============================= */
/*     ARCHIVES CSE FRET PAGE    */
/* ============================= */
.archives-module {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 1rem;
}

.archives-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  padding: 0.8rem 0.8rem 1.2rem;
  background: var(--cgt-white);
  border: 1px solid var(--carbone-50);
  border-radius: 10px;
  box-shadow: var(--shadow-default);
}

.archives-filters .filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.archives-filters label {
  font-weight: 600;
  color: var(--carbone);
}

.archives-filters select,
.archives-filters input {
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--carbone-50);
  background: var(--cgt-white);
  box-shadow: var(--shadow-default);
  font-size: 16px; /* Evite le zoom automatique sur mobile qui décale la mise en page */
}

.archives-filters .filter-actions {
  display: flex;
  align-items: flex-end;
}

.filter-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.2rem;
}

.filter-actions button {
  min-width: 200px;
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--carbone-50);
  background: var(--carbone-50);
  color: var(--cgt-white);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.filter-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  background: var(--carbone);
}

.filter-actions button:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16) inset;
}

.archives-filters button {
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--carbone-50);
  background: var(--carbone-50);
  color: var(--cgt-white);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-default);
}

.archives-results-header {
  font-weight: 600;
  color: var(--carbone);
}

.archives-table-wrapper {
  background: var(--cgt-white);
  border: 1px solid var(--carbone-50);
  border-radius: 10px;
  box-shadow: var(--shadow-default);
  overflow-x: auto;
}

.archives-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.archives-table th,
.archives-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--carbone-50);
  text-align: left;
  color: var(--carbone);
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archives-table th {
  background: var(--carbone-50);
  color: var(--cgt-white);
}

.archives-table tbody tr:hover {
  background: var(--carbone-15);
  cursor: pointer;
}

.archives-table th:nth-child(1),
.archives-table td:nth-child(1) { width: 100%; }

.archives-table a {
  color: var(--carbone);
  text-decoration: underline;
}

.archives-inline-detail {
  background: var(--cgt-white);
  border: 1px solid var(--carbone-15);
  border-radius: 0 0 10px 10px;
  padding: 0.75rem;
  box-shadow: inset 0 1px 0 var(--carbone-15);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--carbone);
  white-space: normal;
  overflow-wrap: anywhere;
}

.archives-detail-row td,
.archives-detail-row:hover td {
  background: var(--carbone-15);
  border: 1px solid var(--carbone-15);
}
/* ===============================
   PAGE DE CONNEXION
   =============================== */
.login-page {
  background-color: var(--cgt-black);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-family: var(--font-main);
}

.login-box {
  background-color: var(--cgt-white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-default);
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}

.login-title {
  color: var(--carbone);
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 1.2rem;
}

.login-box label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.3rem;
  font-weight: bold;
  color: var(--text-dark);
}

.login-box input[type="text"],
.login-box input[type="password"] {
  width: 100%;
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

.login-box button {
  margin-top: 1.5rem;
  width: 100%;
  padding: 0.8rem;
  background-color: var(--carbone);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.login-box button:hover {
  background-color: var(--carbone-70);
}
.logo-cgt {
  height: 36px;
  vertical-align: middle;
  margin-right: 10px;
}

/* ============================= */
/*        ODJ CSE HEXAFRET       */
/* ============================= */
.odj-module {
  max-width: 1100px;
  margin: 0 auto;
  color: var(--carbone);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.odj-header {
  text-align: center;
}

.odj-header h1 {
  margin: 0 0 0.2rem;
  font-size: 1.6rem;
}

.odj-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  padding: 0.8rem 0.8rem 1.2rem;
  background: var(--cgt-white);
  border: 1px solid var(--carbone-50);
  border-radius: 10px;
  box-shadow: var(--shadow-default);
}

.odj-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.odj-filter-group label {
  font-weight: 600;
  color: var(--carbone);
  margin-bottom: 0.1rem;
}

.odj-filter-group input,
.odj-filter-group select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--carbone-50);
  border-radius: 6px;
  background: var(--cgt-white);
  box-sizing: border-box;
  box-shadow: var(--shadow-default);
}

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

.odj-reset-row {
  display: flex;
  justify-content: center;
}

.odj-reset-row button {
  min-width: 200px;
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--carbone-50);
  background: var(--carbone-50);
  color: var(--cgt-white);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.odj-reset-row button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  background: var(--carbone);
}

.odj-filter-actions button {
  padding: 0.55rem 0.9rem;
  border: none;
  background: var(--carbone);
  color: var(--cgt-white);
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.odj-filter-actions button:hover {
  background: var(--carbone-80);
}

.odj-viewer {
  background: var(--cgt-white);
  border: 1px solid var(--carbone-15);
  border-radius: 10px;
  box-shadow: var(--shadow-default);
  overflow: hidden;
}

.odj-table-wrapper {
  overflow-x: auto;
}

.odj-table {
  width: 100%;
  border-collapse: collapse;
}

.odj-table th,
.odj-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--carbone-10);
  text-align: left;
}

.odj-table th {
  background: var(--carbone);
  color: var(--cgt-white);
}

.odj-row-meta td,
.odj-row-text td {
  border-bottom: 1px solid var(--carbone-10);
}

.odj-group-header td {
  background: var(--carbone-15);
  color: var(--carbone);
}

.odj-group-header .odj-meta-line {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  font-weight: 700;
}

.odj-row-meta .odj-meta-line {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  font-weight: 600;
}

.odj-point-line {
  margin-left: 0.4rem;
}

.odj-meta-date {
  color: var(--carbone-80);
}

.odj-meta-numero {
  color: var(--carbone-70);
}

.odj-row-text td {
  background: var(--sable-50);
  font-style: italic;
}

.odj-count {
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: var(--carbone);
  padding-left: 0.3rem;
}

/* Tracts / Publications */
.tracts-module {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tracts-header h1 {
  margin-bottom: 0.25rem;
}

.tracts-header p {
  margin: 0;
  color: var(--carbone-80);
}

.tracts-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  padding: 0.8rem 0.8rem 1.2rem;
  background: var(--cgt-white);
  border: 1px solid var(--carbone-50);
  border-radius: 10px;
  box-shadow: var(--shadow-default);
}

.tracts-filters .filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 200px;
}

.tracts-filters label {
  font-weight: 600;
  color: var(--carbone);
  margin-bottom: 0.1rem;
}

.tracts-filters select,
.tracts-filters input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--carbone-50);
  border-radius: 6px;
  background: var(--cgt-white);
  box-shadow: var(--shadow-default);
  box-sizing: border-box;
  font-size: 16px;
}

#tracts-status {
  margin: 0;
  padding: 0 0.2rem;
  font-weight: 600;
  color: var(--carbone);
}

.tracts-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 1rem;
  align-items: start;
}

.tracts-panel {
  background: var(--cgt-white);
  border: 1px solid var(--carbone-15);
  border-radius: 12px;
  box-shadow: var(--shadow-default);
  overflow: hidden;
}

.tracts-panel-header {
  padding: 0.4rem 1rem;
  border-bottom: 1px solid var(--carbone-10);
  background: var(--sable-50);
}

.tracts-panel-header h2 {
  margin: 0;
  font-size: 1rem;
}

.tracts-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0.75rem 1rem;
  background: var(--cgt-white);
}

.tract-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--carbone-15);
  border-left: 4px solid transparent;
  border-radius: 10px;
  background: var(--cgt-white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-left-color 0.2s ease;
  cursor: pointer;
}

.tract-item:hover {
  border-color: var(--carbone-40);
  border-left-color: var(--rouge-cgt);
  background: var(--sable-40);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.tract-item.is-active {
  border-color: var(--carbone-50);
  border-left-color: var(--carbone-70);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1), 0 10px 18px rgba(0, 0, 0, 0.12);
  background: var(--sable-50);
}

.tract-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1 1 240px;
}

.tract-date {
  font-weight: 700;
  color: var(--carbone);
  font-size: 0.95rem;
}

.tract-subject {
  color: var(--carbone-80);
  font-size: 0.9rem;
}

.tract-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.tracts-download-hint {
  margin: 0.2rem 0.9rem 0.8rem;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--carbone-70);
}

/* Titres principaux des modules */
.main-content h1 {
  text-align: center;
  display: block;
  padding: 0.45rem 0.75rem;
  margin: 0 0 0.8rem;
  background: var(--carbone-15);
  color: var(--carbone);
  border-radius: 999px;
  font-size: 1.05rem;
  line-height: 1.2;
  box-shadow: var(--shadow-default);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.tract-actions button {
  border: 1px solid var(--carbone-20);
  background: var(--carbone);
  color: var(--cgt-white);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.tract-actions button:hover {
  background: var(--carbone-90);
  box-shadow: var(--shadow-default);
}

.tract-actions button:active {
  transform: translateY(1px);
}

.tract-actions .tract-download {
  display: inline-block;
  border: 1px solid var(--carbone-20);
  background: var(--carbone);
  color: var(--cgt-white);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.tract-actions .tract-download:hover {
  background: var(--carbone-90);
  box-shadow: var(--shadow-default);
}

.tract-actions .tract-download:active {
  transform: translateY(1px);
}

.tracts-viewer {
  display: flex;
  flex-direction: column;
}

.tracts-viewer-container {
  padding: 0;
  min-height: 60vh;
  background: var(--cgt-white);
}

.tracts-viewer-container iframe {
  width: 100%;
  height: 70vh;
  border: none;
}
/* Modal viewer */
.tracts-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.tracts-modal.is-open {
  display: flex;
}

.tracts-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.tracts-modal-content {
  position: relative;
  background: var(--cgt-white);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  max-width: 95vw;
  width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

.tracts-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: var(--carbone);
  color: var(--cgt-white);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-default);
}

.tracts-modal-close:hover {
  background: var(--carbone-90);
}

.tracts-modal-body {
  padding: 0;
  width: 100%;
  height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tract-modal-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tract-pdf-object {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  max-width: 100vw;
}

.tracts-modal-actions {
  padding: 0.5rem 0.8rem;
  background: var(--sable-50);
  border-top: 1px solid var(--carbone-15);
  display: flex;
  justify-content: flex-end;
}

.tracts-modal-actions a {
  color: var(--carbone);
  font-weight: 600;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .tracts-modal {
    align-items: stretch;
  }
  .tracts-modal-content {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .tracts-modal-body {
    height: 100vh;
    overflow: auto;
  }
  .tract-modal-view {
    height: 100vh;
  }
  .tract-pdf-object {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
  }
}

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


.agenda-offline-hint {
  display: block;
  text-align: center;
  font-size: 0.67rem;
  font-style: italic;
}
