/* Charte CGT : Rouge #ED1F2F, Gris #848484, Noir #000, Blanc #FFF */

:root {
  --cgt-red: #ED1F2F;
  --cgt-red-dark: #c41a28;
  --cgt-grey: #848484;
  --cgt-grey-light: #f5f5f5;
  --black: #000000;
  --white: #ffffff;
  --carbon: #1a1a1a;
  --carbon-light: #2d2d2d;
  --carbon-border: #3d3d3d;
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.2s ease;
  --header-height: 56px;
  --footer-height: 44px;
  --sidebar-width: 220px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--black);
  background: var(--white);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--black);
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-cgt {
  color: var(--cgt-red);
}

.logo-text {
  color: var(--black);
}

.nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav a {
  color: var(--black);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.nav a:hover {
  color: var(--cgt-red);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--black);
}

/* Hero */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cgt-red) 0%, var(--cgt-red-dark) 100%);
  color: var(--white);
  text-align: center;
  padding: 8rem 1.5rem 4rem;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L30 60M0 30L60 30' stroke='rgba(255,255,255,0.06)' stroke-width='1' fill='none'/%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(transparent, rgba(0,0,0,0.1));
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.hero-subtitle {
  font-size: 1.2rem;
  opacity: 0.95;
  margin-bottom: 2rem;
}

.hero .btn {
  margin: 0 0.5rem 0.5rem 0;
}

/* Boutons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--white);
  color: var(--cgt-red);
  border-color: var(--white);
}

.btn-primary:hover {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

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

.btn-secondary:hover {
  background: var(--white);
  color: var(--cgt-red);
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-light {
  background: var(--cgt-grey-light);
}

.section h2 {
  font-size: 1.75rem;
  color: var(--cgt-red);
  margin-bottom: 2rem;
  text-align: center;
}

/* Cards À propos */
.apropos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(237, 31, 47, 0.12);
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.card-icon .card-icon-svg,
.card-icon svg {
  width: 2.25rem;
  height: 2.25rem;
  color: var(--cgt-red);
}

.card h3 {
  font-size: 1.2rem;
  color: var(--cgt-red);
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--cgt-grey);
  font-size: 0.95rem;
}

/* Actualités */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.news-card {
  background: var(--white);
  padding: 1.75rem;
  border-radius: 8px;
  border-left: 4px solid var(--cgt-red);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.news-date {
  font-size: 0.85rem;
  color: var(--cgt-grey);
  margin-bottom: 0.5rem;
}

.news-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.news-card p {
  font-size: 0.95rem;
  color: var(--cgt-grey);
}

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

.contact-block,
.join-block {
  background: var(--white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.contact-block h2,
.join-block h2 {
  text-align: left;
  margin-bottom: 1rem;
}

.contact-info {
  list-style: none;
  margin-top: 1rem;
}

.contact-info li {
  margin-bottom: 0.5rem;
}

.contact-info a {
  color: var(--cgt-red);
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

.join-block .btn {
  margin-top: 1rem;
}

/* Footer */
.footer {
  background: var(--black);
  color: var(--white);
  padding: 2rem 0;
}

.footer-content {
  text-align: center;
}

.footer-content p {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--white);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ========== Page Login (style cgt-csehexafret) ========== */
.page-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cgt-grey-light);
}

.login-shell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.login-kicker {
  font-size: 0.9rem;
  color: var(--cgt-grey);
  margin-bottom: 0.25rem;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cgt-red);
  margin-bottom: 0.5rem;
}

.login-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 0.5rem;
}

.login-subtitle {
  font-size: 0.95rem;
  color: var(--cgt-grey);
  margin-bottom: 1.5rem;
}

.login-error {
  padding: 0.75rem;
  background: #fee;
  color: #c00;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.login-form .form-group {
  margin-bottom: 1.25rem;
}

.login-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.login-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font);
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.login-form input:focus {
  outline: none;
  border-color: var(--cgt-red);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 2.5rem;
}

.toggle-pwd {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toggle-pwd .icon-eye,
.toggle-pwd svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--cgt-grey);
}

.btn-login {
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  background: var(--cgt-red);
  color: var(--white);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-login:hover:not(:disabled) {
  background: var(--cgt-red-dark);
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--cgt-grey);
}

/* ========== Dashboard (outil interne) ========== */
/* Layout : header fixe + footer fixe (carbon) + sidebar gauche + contenu droite */
.page-dashboard {
  min-height: 100vh;
  background: var(--carbon);
  padding-top: var(--header-height);
  padding-bottom: var(--footer-height);
}

/* Header fixe – fond carbon */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--carbon);
  border-bottom: 1px solid var(--carbon-border);
  z-index: 1000;
}

.main-header .header-inner {
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.main-header .site-name {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--white);
}

.main-header .logo-cgt {
  color: var(--cgt-red);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow: visible;
}

.user-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}

.user-menu-trigger:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.user-menu-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
}

.user-menu-chevron {
  font-size: 0.65rem;
  opacity: 0.7;
  margin-left: 0.25rem;
}

.user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.35rem;
  min-width: 200px;
  background: var(--carbon-light);
  border: 1px solid var(--carbon-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 1100;
}

.user-menu-wrap.is-open .user-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu a {
  display: block;
  padding: 0.6rem 1rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
}

.user-menu a:hover {
  background: rgba(237, 31, 47, 0.2);
  color: var(--cgt-red);
}

.user-info {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.user-icon {
  width: 1.1rem;
  height: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
}

.user-role {
  font-size: 0.8rem;
  color: var(--cgt-grey);
}

.user-email {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.btn-logout {
  font-size: 0.85rem;
  color: var(--cgt-red);
  text-decoration: none;
}

.db-status {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.db-status--ok {
  background: #22c55e;
}

.db-status--error {
  background: #ef4444;
}

.btn-logout:hover {
  text-decoration: underline;
  color: #ff4d5a;
}

/* Sidebar à gauche */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: var(--footer-height);
  width: var(--sidebar-width);
  background: var(--carbon-light);
  border-right: 1px solid var(--carbon-border);
  overflow-y: auto;
  z-index: 100;
}

.sidebar-nav {
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 100%;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--carbon-border);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  transition: background var(--transition), color var(--transition);
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.sidebar-link.active {
  background: rgba(237, 31, 47, 0.2);
  color: var(--cgt-red);
  border-left: 3px solid var(--cgt-red);
  margin-left: -1px;
  padding-left: calc(1.25rem - 1px);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-icon .nav-icon-svg,
.nav-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Zone contenu à droite */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
  padding: 1.5rem 2rem;
  overflow-y: auto;
  background: var(--carbon);
}

.page-inner h1 {
  font-size: 1.5rem;
  color: var(--black);
  margin-bottom: 0.5rem;
}

.welcome-msg {
  color: var(--cgt-grey);
  margin-bottom: 2rem;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.card-link {
  text-decoration: none;
  color: inherit;
}

.page-inner .card {
  height: 100%;
  text-align: left;
}

.content-block {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.content-block h2 {
  font-size: 1.1rem;
  color: var(--cgt-red);
  margin-bottom: 0.75rem;
}

.simple-list,
.contact-list {
  list-style: none;
}

.simple-list li,
.contact-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--cgt-grey-light);
}

.simple-list li:last-child,
.contact-list li:last-child {
  border-bottom: none;
}

.simple-list a,
.content-block a {
  color: var(--cgt-red);
  text-decoration: none;
}

.simple-list a:hover,
.content-block a:hover {
  text-decoration: underline;
}

/* Footer fixe – fond carbon */
.main-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--carbon);
  border-top: 1px solid var(--carbon-border);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Contenu des pages – fond carbon, texte clair */
.page-inner h1 {
  color: var(--white);
}

.welcome-msg {
  color: rgba(255, 255, 255, 0.7);
}

.page-inner .card {
  background: var(--carbon-light);
  border: 1px solid var(--carbon-border);
}

.page-inner .card-link:hover .card {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--cgt-red);
}

.page-inner .card h3 {
  color: var(--cgt-red);
}

.page-inner .card p {
  color: rgba(255, 255, 255, 0.75);
}

.content-block {
  background: var(--carbon-light);
  border: 1px solid var(--carbon-border);
}

.content-block h2 {
  color: var(--cgt-red);
}

.content-block p,
.simple-list li,
.contact-list li {
  color: rgba(255, 255, 255, 0.8);
}

.simple-list li,
.contact-list li {
  border-bottom-color: var(--carbon-border);
}

.simple-list a,
.content-block a {
  color: var(--cgt-red);
}

.simple-list a:hover,
.content-block a:hover {
  color: #ff4d5a;
}

.content-link {
  color: var(--cgt-red);
  text-decoration: none;
}

.content-link:hover {
  text-decoration: underline;
  color: #ff4d5a;
}

/* Formulaires dashboard */
.form-msg {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.form-msg--success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.form-msg--error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.dashboard-form .form-group {
  margin-bottom: 1rem;
}

.dashboard-form .form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-form .form-row .form-group {
  flex: 1;
  min-width: 180px;
}

.dashboard-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.35rem;
}

.dashboard-form input[type="text"],
.dashboard-form input[type="email"],
.dashboard-form input[type="password"],
.dashboard-form select {
  width: 100%;
  padding: 0.6rem 0.9rem;
  font-family: var(--font);
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--carbon-border);
  border-radius: 6px;
  color: var(--white);
}

.dashboard-form input:focus {
  outline: none;
  border-color: var(--cgt-red);
}

.dashboard-form .password-wrap {
  position: relative;
}

.dashboard-form .password-wrap input {
  padding-right: 2.5rem;
}

.dashboard-form .toggle-pwd {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  opacity: 0.7;
}

.dashboard-form .toggle-pwd:hover {
  opacity: 1;
}

.dashboard-form .form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--cgt-grey);
  margin-top: 0.25rem;
}

.dashboard-form .required {
  color: var(--cgt-red);
}

.dashboard-form .btn {
  margin-top: 0.5rem;
}

/* Table utilisateurs */
.users-table-wrap {
  overflow-x: auto;
}

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

.users-table th,
.users-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--carbon-border);
}

.users-table th {
  font-weight: 600;
  color: var(--cgt-red);
}

.users-table td {
  color: rgba(255, 255, 255, 0.85);
}

.users-table .actions-cell {
  white-space: nowrap;
}

.users-table .inline-form {
  display: inline;
}

.btn-link {
  background: none;
  border: none;
  color: var(--cgt-red);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0 0.25rem;
  text-decoration: none;
}

.btn-link:hover {
  text-decoration: underline;
  color: #ff4d5a;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge--active {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.badge--inactive {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--carbon-light);
  border: 1px solid var(--carbon-border);
  border-radius: 12px;
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  overflow: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--carbon-border);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--cgt-red);
}

.modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: var(--white);
}

.modal-form {
  padding: 1.25rem;
}

.modal-form .form-group {
  margin-bottom: 1rem;
}

.modal-form input[type="password"] {
  width: 100%;
  padding: 0.6rem 2.5rem 0.6rem 0.9rem;
  font-family: var(--font);
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--carbon-border);
  border-radius: 6px;
  color: var(--white);
}

.modal-form input:focus {
  outline: none;
  border-color: var(--cgt-red);
}

.modal-form .password-wrap {
  position: relative;
}

.modal-form .password-wrap input {
  padding-right: 2.5rem;
}

.modal-form .toggle-pwd {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  opacity: 0.7;
}

.modal-form .modal-user-email {
  margin: 0.5rem 0 0;
  color: rgba(255, 255, 255, 0.9);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.modal-actions .btn {
  margin-top: 0;
}

@media (max-width: 768px) {
  .dashboard-form .form-row {
    flex-direction: column;
  }

  .users-table th,
  .users-table td {
    padding: 0.5rem;
    font-size: 0.85rem;
  }
}

/* Calendrier – vue mensuelle, plein écran responsive */
.page-calendrier {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height) - var(--footer-height) - 3rem);
  min-height: 280px;
}

.page-calendrier h1 {
  flex-shrink: 0;
  margin-bottom: 0.75rem;
}

.calendar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--carbon-light);
  border: 1px solid var(--carbon-border);
  border-radius: 8px;
  padding: 1rem;
  width: 100%;
}

.calendar-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.calendar-title {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 600;
  color: var(--white);
  margin: 0;
}

.calendar-nav {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--carbon-border);
  border-radius: 6px;
  color: var(--white);
  font-size: 1.35rem;
  cursor: pointer;
  transition: background var(--transition);
}

.calendar-nav:hover {
  background: rgba(237, 31, 47, 0.2);
  border-color: var(--cgt-red);
}

.calendar-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.calendar-weekdays {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 0.35rem;
}

.calendar-weekdays span {
  text-align: center;
  font-size: clamp(0.65rem, 1.5vw, 0.8rem);
  font-weight: 600;
  color: var(--cgt-grey);
}

.calendar-days {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  gap: 2px;
  min-height: 0;
}

.cal-day {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  font-size: clamp(0.7rem, 1.8vw, 0.95rem);
  color: rgba(255, 255, 255, 0.9);
}

.cal-day .cal-num {
  padding: 0.25rem 0 0 0.35rem;
  line-height: 1;
}

@media (max-width: 768px) {
  .page-calendrier {
    height: calc(100vh - var(--header-height) - var(--footer-height) - 2rem);
    min-height: 240px;
  }

  .calendar-wrap {
    padding: 0.75rem;
  }

  .calendar-header {
    margin-bottom: 0.5rem;
  }

  .calendar-nav {
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
  }
}

.cal-day.cal-empty {
  background: transparent;
}

.cal-day.cal-past {
  opacity: 0.4;
  cursor: default;
}

.cal-day.cal-weekend:not(.cal-today) {
  background: rgba(132, 132, 132, 0.18);
}

.cal-day.cal-today {
  background: var(--cgt-red);
  color: var(--white);
  font-weight: 600;
}

.cal-day.cal-clickable {
  cursor: pointer;
  transition: background var(--transition), transform 0.15s ease;
}

.cal-day.cal-clickable:hover {
  background: rgba(237, 31, 47, 0.25);
  transform: scale(1.05);
}

.cal-day.cal-clickable:focus {
  outline: 2px solid var(--cgt-red);
  outline-offset: 2px;
}

.cal-day.cal-today.cal-clickable:hover {
  background: rgba(237, 31, 47, 0.85);
}

/* Popup informations du jour */
.cal-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cal-popup-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.cal-popup {
  background: var(--carbon-light);
  border: 1px solid var(--carbon-border);
  border-radius: 12px;
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.cal-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--carbon-border);
}

.cal-popup-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--cgt-red);
}

.cal-popup-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--carbon-border);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.5rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.cal-popup-close:hover {
  background: rgba(237, 31, 47, 0.2);
  border-color: var(--cgt-red);
}

.cal-popup-divider {
  margin: 0;
  border: none;
  border-top: 1px solid var(--carbon-border);
}

.cal-popup-body {
  padding: 1.5rem;
}

.cal-popup-events h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cgt-grey);
  margin: 0 0 0.5rem;
}

.cal-popup-events-empty {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin: 0;
}

.cal-popup-events-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}

.cal-popup-events-list li {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--carbon-border);
}

.cal-popup-events-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.cal-event-desc {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.25rem;
}

.cal-popup-events-list small {
  font-size: 0.75rem;
  color: var(--cgt-grey);
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 64px;
  }
  .sidebar {
    width: var(--sidebar-width);
    padding: 0.5rem 0;
  }
  .sidebar-label {
    display: none;
  }
  .sidebar-link {
    padding: 0.75rem;
    justify-content: center;
  }
  .sidebar-link.active {
    margin-left: 0;
    padding-left: 0.75rem;
  }
  .main-content {
    margin-left: var(--sidebar-width);
    padding: 1rem;
  }
  /* Menu utilisateur visible sur mobile – layout adapté */
  .user-menu-trigger {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .user-menu-trigger .user-role {
    display: none;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
  }

  .nav.is-open {
    max-height: 280px;
  }

  .nav ul {
    flex-direction: column;
    padding: 1.5rem;
    gap: 0;
  }

  .nav li {
    border-bottom: 1px solid var(--cgt-grey-light);
  }

  .nav a {
    display: block;
    padding: 1rem 0;
  }

  .hero {
    min-height: 60vh;
    padding: 6rem 1rem 3rem;
  }

  .hero .btn {
    display: block;
    margin-bottom: 0.75rem;
    margin-left: 0;
    margin-right: 0;
  }
}
