/* ============================================
   MD3 DESIGN TOKENS — PETROSTEPS ADMIN
   ============================================ */

:root {
  /* Primary palette */
  --md-primary: #e74c3c;
  --md-on-primary: #FFFFFF;
  --md-primary-container: #FADBD8;
  --md-on-primary-container: #641E16;

  /* Secondary */
  --md-secondary: #7F8C8D;
  --md-secondary-container: #D5DBDB;

  /* Surface & Background */
  --md-surface: #FAFDFD;
  --md-surface-variant: #DAE5E5;
  --md-background: #F0F4F4;
  --md-on-surface: #191C1C;
  --md-on-surface-variant: #3F4949;

  /* Error */
  --md-error: #BA1A1A;
  --md-error-container: #FFDAD6;

  /* Elevation / Glass */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.45);
  --glass-blur: blur(20px) saturate(180%);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);

  /* Radius MD3 */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Elevation shadows */
  --elev-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --elev-2: 0 4px 6px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
  --elev-3: 0 10px 20px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);

  /* Typography */
  --font-display: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'Roboto Mono', monospace;

  /* Transitions */
  --transition-standard: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

.brand-wordmark__dollar {
  display: inline-block;
  margin-left: 1px;
  font-size: 1.18em;
  font-weight: 700;
  line-height: 0.8;
  transform: translateY(0.03em);
}

/* ============================================
   GLOBAL RESET
   ============================================ */

body {
  font-family: var(--font-display);
  background: var(--md-background);
  color: var(--md-on-surface);
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(231,76,60,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(127,140,141,0.10) 0%, transparent 50%),
    var(--md-background);
  min-height: 100vh;
}

/* ============================================
   NAVIGATION RAIL
   ============================================ */

body:not(.login-page) {
  display: flex;
}

.navbar-md3 {
  width: 240px;
  min-height: 100vh;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: var(--elev-2);
}

.navbar-md3__brand {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  padding: 16px 12px 20px !important;
  color: var(--md-primary);
}

.navbar-md3__brand .material-symbols-outlined {
  font-size: 28px;
  font-variation-settings: 'FILL' 1;
}

.navbar-md3__brand-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--md-on-surface);
  letter-spacing: -0.3px;
}

.navbar-md3__section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-xl);
  color: var(--md-on-surface-variant);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-standard);
  position: relative;
}

.nav-rail-item:hover {
  background: rgba(231, 76, 60, 0.08);
  color: var(--md-primary);
}

.nav-rail-item.active {
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}

.nav-rail-item .material-symbols-outlined {
  font-size: 22px;
  font-variation-settings: 'FILL' 0;
}

.nav-rail-item.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

/* Submenu */
.nav-rail-item--parent {
  cursor: pointer;
}

.nav-rail-item--parent .nav-rail-item__chevron {
  margin-left: auto;
  transition: transform 0.2s;
  font-size: 18px;
}

.nav-rail-item--parent.open .nav-rail-item__chevron {
  transform: rotate(180deg);
}

.nav-rail-submenu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: 16px;
  margin: 2px 0;
}

.nav-rail-submenu.open {
  display: flex;
}

.nav-rail-submenu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-radius: var(--radius-xl);
  color: var(--md-on-surface-variant);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition-standard);
}

.nav-rail-submenu__item:hover {
  background: rgba(231, 76, 60, 0.08);
  color: var(--md-primary);
}

.nav-rail-submenu__item.active {
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}

.navbar-md3__footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--md-surface-variant);
}

.nav-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--md-on-surface-variant);
}

/* ============================================
   ADMIN RESPONSIVE MOBILE TOPBAR & OVERLAY
   ============================================ */

.admin-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--elev-1);
  z-index: 1050;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.admin-topbar__toggle,
.admin-sidebar-close {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: var(--md-on-surface) !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: var(--radius-full) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 !important;
  margin: 0 !important;
  transition: var(--transition-standard);
}

.admin-topbar__toggle:hover,
.admin-sidebar-close:hover {
  background: rgba(0, 0, 0, 0.08) !important;
}

.admin-topbar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--md-primary);
}

.admin-topbar__brand .material-symbols-outlined {
  font-size: 24px;
  font-variation-settings: 'FILL' 1;
}

.admin-topbar__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--md-on-surface);
}

.admin-topbar__user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--md-on-surface-variant);
}

.admin-topbar__username {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-sidebar-overlay {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.55) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  z-index: 1060 !important;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.2, 0, 0, 1);
}

.admin-sidebar-overlay.admin-sidebar-overlay--active {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.navbar-md3__brand-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-sidebar-close {
  display: none;
  margin-left: auto;
}

.main-content-wrapper {
  margin-left: 240px;
  margin-right: 0;
  padding: 40px 48px;
  box-sizing: border-box;
  flex: 1;
  width: calc(100% - 240px);
  min-height: 100vh;
}

.main-content-wrapper--centered {
  margin-left: auto;
  margin-right: auto;
  max-width: 960px;
  padding: 40px 32px;
}

/* ============================================
   PAGE HEADER
   ============================================ */

.md3-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}

.md3-page-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--md-on-surface);
  margin: 0 0 4px;
  letter-spacing: -0.5px;
}

.md3-page-subtitle {
  font-size: 14px;
  color: var(--md-on-surface-variant);
  margin: 0;
}

/* ============================================
   FOOTER
   ============================================ */

.md3-footer {
  background: var(--md-surface);
  border-top: 1px solid var(--md-outline-variant);
  padding: 16px 48px 16px 288px; /* align with main-content-wrapper */
}

.md3-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--md-on-surface-variant);
}

/* ============================================
   KPI CARDS GRID
   ============================================ */

.kpi-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  margin-bottom: 40px;
}

.kpi-card {
  flex: 1 1 0;
  min-width: 0;
}

.kpi-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--elev-1);
  transition: var(--transition-standard);
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  box-shadow: var(--elev-3);
  transform: translateY(-2px);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kpi-card--primary::before  { background: var(--md-primary); }
.kpi-card--secondary::before { background: var(--md-secondary); }
.kpi-card--warning::before  { background: #B45309; }
.kpi-card--success::before  { background: #15803D; }

.kpi-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-card--primary  .kpi-card__icon { background: var(--md-primary-container); color: var(--md-primary); }
.kpi-card--secondary .kpi-card__icon { background: var(--md-secondary-container); color: var(--md-secondary); }
.kpi-card--warning  .kpi-card__icon { background: #FEF3C7; color: #B45309; }
.kpi-card--success  .kpi-card__icon { background: #DCFCE7; color: #15803D; }

.kpi-card__icon .material-symbols-outlined {
  font-size: 24px;
  font-variation-settings: 'FILL' 1;
}

.kpi-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kpi-card__label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--md-on-surface-variant);
}

.kpi-card__value {
  font-size: 32px;
  font-weight: 600;
  color: var(--md-on-surface);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi-card__meta {
  font-size: 12px;
  color: var(--md-on-surface-variant);
}

.kpi-card__action {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-on-surface-variant);
  transition: var(--transition-standard);
  text-decoration: none;
}

.kpi-card__action:hover {
  background: var(--md-surface-variant);
  color: var(--md-primary);
}

.kpi-card__action .material-symbols-outlined { font-size: 20px; }

/* ============================================
   MD3 DATA TABLE
   ============================================ */

.md3-table-container {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.md3-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  flex-wrap: wrap;
  gap: 12px;
}

.md3-table-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--md-on-surface);
  margin: 0;
}

.md3-table-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.md3-search-field {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F0F4F4;
  border-radius: 999px;
  padding: 10px 18px;
  border: 1px solid transparent;
  transition: var(--transition-standard);
}

.md3-search-field:focus-within {
  border-color: var(--md-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,106,106,0.10);
}

.md3-search-field .material-symbols-outlined {
  font-size: 18px;
  color: var(--md-on-surface-variant);
}

.md3-search-field input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--md-on-surface);
  font-family: var(--font-display);
}

.md3-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.md3-table thead th {
  padding: 11px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--md-on-surface-variant);
  background: #F8FAFA;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  white-space: nowrap;
}

.md3-table thead th:last-child,
.md3-table tbody td:last-child {
  text-align: center;
}

.md3-table thead th .sort-icon {
  font-size: 14px;
  vertical-align: middle;
  opacity: 0.5;
  cursor: pointer;
}

.md3-table tbody tr {
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: var(--transition-standard);
}

.md3-table tbody tr:hover {
  background: rgba(231, 76, 60, 0.03);
}

.md3-table tbody tr:last-child {
  border-bottom: none;
}

.md3-table tbody td {
  padding: 14px 20px;
  font-size: 14px;
  color: var(--md-on-surface);
  vertical-align: middle;
}

.md3-code {
  background: #F0F4F4;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--md-primary);
}

.md3-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}

.md3-badge--primary { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.md3-badge--neutral { background: #F0F4F4; color: var(--md-on-surface-variant); }

/* ============================================
   TABLE — ACTION MENU (3 points)
   ============================================ */

.md3-action-menu {
  position: relative;
  display: inline-block;
}

.md3-action-trigger {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--md-on-surface-variant);
  transition: background 0.15s ease;
}

.md3-action-trigger:hover {
  background: rgba(0,0,0,0.06);
}

.md3-action-trigger .material-symbols-outlined {
  font-size: 20px;
}

.md3-action-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 160px;
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 999;
  overflow: hidden;
  padding: 6px 0;
}

.md3-action-dropdown--up {
  top: auto;
  bottom: calc(100% + 4px);
}

.md3-action-dropdown--open {
  display: block;
  animation: menuFadeIn 0.15s ease;
}

.md3-action-dropdown--open.md3-action-dropdown--up {
  animation: menuFadeInUp 0.15s ease;
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes menuFadeInUp {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.md3-action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--md-on-surface);
  text-decoration: none;
  transition: background 0.12s ease;
  cursor: pointer;
}

.md3-action-item:hover {
  background: rgba(231, 76, 60, 0.06);
  color: var(--md-primary);
}

.md3-action-item--danger {
  color: var(--md-error);
}

.md3-action-item--danger:hover {
  background: rgba(186,26,26,0.07);
  color: var(--md-error);
}

.md3-action-item .material-symbols-outlined {
  font-size: 17px;
}

.md3-action-separator {
  height: 1px;
  background: rgba(0,0,0,0.07);
  margin: 4px 0;
}

/* ============================================
   PAGINATION
   ============================================ */

.md3-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: #FAFBFB;
}

.md3-pagination__info {
  font-size: 13px;
  color: var(--md-on-surface-variant);
}

/* ============================================
   BOUTONS MD3
   ============================================ */

.md3-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition-standard);
  font-family: var(--font-display);
}

.md3-btn--filled {
  background: var(--md-primary);
  color: var(--md-on-primary);
  box-shadow: var(--elev-1);
}

.md3-btn--filled:hover {
  background: #c0392b;
  box-shadow: var(--elev-2);
  color: var(--md-on-primary);
}

.md3-btn--tonal {
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}

.md3-btn--outlined {
  background: transparent;
  color: var(--md-primary);
  border: 1px solid var(--md-primary);
}

.md3-btn .material-symbols-outlined { font-size: 18px; }

/* ============================================
   PAGINATION
   ============================================ */

.md3-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--md-surface-variant);
}

.md3-pagination__info {
  font-size: 13px;
  color: var(--md-on-surface-variant);
}

.md3-pagination__controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.md3-pagination__btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-on-surface-variant);
  transition: var(--transition-standard);
}

.md3-pagination__btn:hover:not(:disabled) { background: var(--md-surface-variant); }
.md3-pagination__btn:disabled { opacity: 0.4; cursor: not-allowed; }
.md3-pagination__btn .material-symbols-outlined { font-size: 20px; }

.md3-pagination__current {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--md-primary);
  color: var(--md-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

/* ============================================
   FORM CARD — CENTRAGE ET TAILLE
   ============================================ */

.md3-form-card {
  max-width: 600px;
  margin: 0 auto;
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  overflow: hidden;
}

.md3-form-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 28px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: #FAFBFB;
}

.md3-form-card__header .material-symbols-outlined {
  font-size: 22px;
  color: var(--md-primary);
  font-variation-settings: 'FILL' 1;
}

.md3-form-card__header h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--md-on-surface);
  margin: 0;
}

.md3-form-card__body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Champs en grille 2 colonnes */
.md3-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 540px) {
  .md3-form-row { grid-template-columns: 1fr; }
}

/* Floating label fields */
.md3-field {
  position: relative;
}

.md3-field input,
.md3-field select {
  width: 100%;
  padding: 20px 16px 8px;
  border: 1.5px solid rgba(0,0,0,0.15);
  border-radius: 10px;
  background: #FAFBFB;
  font-size: 14px;
  color: var(--md-on-surface);
  font-family: var(--font-display);
  outline: none;
  transition: all 0.18s ease;
  box-sizing: border-box;
  margin: 5px 0;
}

.md3-field input:focus,
.md3-field select:focus {
  border-color: var(--md-primary);
  border-width: 2px;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.09);
}

.md3-field label {
  position: absolute;
  top: 14px;
  left: 16px;
  font-size: 14px;
  color: rgba(0,0,0,0.45);
  pointer-events: none;
  transition: all 0.18s ease;
  background: transparent;
}

.md3-field input:focus ~ label,
.md3-field input:not(:placeholder-shown) ~ label,
.md3-field select:focus ~ label,
.md3-field select:valid ~ label {
  top: 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--md-primary);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.md3-field--select .md3-field__trailing {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--md-on-surface-variant);
  pointer-events: none;
}

/* Password controls keep the field readable while leaving room for the visibility button. */
.md3-field--password {
  position: relative;
}

.md3-field--password input {
  padding-right: 52px;
}

.md3-field--password .md3-password-toggle {
  position: absolute !important;
  right: 12px;
  top: 50%;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 50%;
  background: transparent !important;
  color: var(--md-on-surface-variant);
  cursor: pointer;
  z-index: 1;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.md3-field--password .md3-password-toggle:hover {
  background: var(--md-surface-variant);
  color: var(--md-primary);
}

.md3-field--password .md3-password-toggle:active {
  transform: translateY(-50%) scale(0.94);
}

.md3-field--password .md3-password-toggle:focus-visible {
  outline: 2px solid var(--md-primary);
  outline-offset: 2px;
}

.md3-field--password .md3-password-toggle .material-symbols-outlined {
  font-size: 20px;
}

.md3-form-card__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 18px 28px;
  background: #FAFBFB;
  border-top: 1px solid rgba(0,0,0,0.06);
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand__icon {
  width: 64px;
  height: 64px;
  background: var(--md-primary-container);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.login-brand__icon .material-symbols-outlined {
  font-size: 32px;
  color: var(--md-primary);
  font-variation-settings: 'FILL' 1;
}

.login-brand__name {
  display: block;
  font-size: 26px;
  font-weight: 600;
  color: var(--md-on-surface);
  letter-spacing: -0.5px;
}

.login-brand__tagline {
  display: block;
  font-size: 14px;
  color: var(--md-on-surface-variant);
  margin-top: 4px;
}

.login-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--elev-3);
}

.login-card h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 24px;
  color: var(--md-on-surface);
}

.login-submit {
  width: 100%;
  padding: 14px;
  background: var(--md-primary);
  color: var(--md-on-primary);
  border: none;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-standard);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  box-shadow: var(--elev-2);
  margin-top: 8px;
}

.login-submit:hover {
  background: #c0392b;
  box-shadow: var(--elev-3);
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--md-on-surface-variant);
}

/* ============================================
   ALERT
   ============================================ */

.md3-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
}

.md3-alert--error {
  background: var(--md-error-container);
  color: var(--md-error);
}

.md3-alert .material-symbols-outlined {
  font-size: 20px;
}

/* ============================================
   LOGIN — SPLIT SCREEN
   ============================================ */

body.login-page {
  display: flex;
  min-height: 100vh;
  margin: 0;
  background: #FFFFFF;
}

.login-split {
  display: flex;
  width: 100%;
  min-height: 100vh;
  background: #FFFFFF;
  overflow: hidden;
}

/* --- PANNEAU GAUCHE --- */
.login-split__left {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  padding: 0;
}

/* ============================================
   LOGIN LEFT — TEXT OVERLAY SUR ILLUSTRATION
   ============================================ */

.login-left__text {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 40px 36px 52px;

  /* Dégradé sombre descendant depuis le haut —
     garantit lisibilité sur n'importe quelle image */
  background: linear-gradient(
    to bottom,
    rgba(0, 20, 20, 0.92) 0%,
    rgba(0, 20, 20, 0.75) 40%,
    rgba(0, 20, 20, 0.30) 70%,
    transparent 100%
  );

  text-align: center;
}

/* Ligne décorative au-dessus du titre */
.login-left__text::before {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--md-primary-container);
  margin: 0 auto 16px;
  border-radius: 2px;
  opacity: 0.9;
}

.login-left__text h2 {
  font-size: 26px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 14px;
  letter-spacing: -0.5px;
  line-height: 1.2;

  /* Légère ombre portée sur les lettres pour
     renforcer le contraste sur l'image */
  text-shadow:
    0 2px 12px rgba(0, 0, 0, 0.5),
    0 1px 3px rgba(0, 0, 0, 0.8);
}

.login-left__text p {
  font-size: 13px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.1px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.login-left__img-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.login-left__img-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Icône de fallback si pas d'image */
.login-left__img-placeholder .material-symbols-outlined {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 96px;
  color: var(--md-primary);
  font-variation-settings: 'FILL' 1;
  opacity: 0.3;
}

/* ============================================
   ILLUSTRATION ÉPINGLÉE (40% DU BAS)
   ============================================ */
.login-left__pinned-illustration {
  position: absolute;
  bottom: 40%;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 48px), 520px);
  z-index: 8;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-left__pinned-illustration img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.85)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.95));
}

/* --- PANNEAU DROIT --- */
.login-split__right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  gap: 0;
}

.login-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 32px;
}

.login-brand__icon {
  width: 52px;
  height: 52px;
  background: var(--md-primary-container);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.login-brand__icon .material-symbols-outlined {
  font-size: 26px;
  color: var(--md-primary);
  font-variation-settings: 'FILL' 1;
}

.login-brand__name {
  font-size: 22px;
  font-weight: 600;
  color: var(--md-on-surface);
  letter-spacing: -0.4px;
}

.login-brand__tagline {
  display: block;
  font-size: 13px;
  color: var(--md-on-surface-variant);
  margin-top: 4px;
}

/* Alertes login */
.login-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}

.login-alert .material-symbols-outlined { font-size: 18px; }

.login-alert--error {
  background: var(--md-error-container);
  color: var(--md-error);
}

.login-alert--success {
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}

/* Bouton submit */
.login-submit {
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  background: var(--md-primary);
  color: var(--md-on-primary);
  border: none;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  box-shadow: var(--elev-2);
  transition: var(--transition-standard);
}

.login-submit:hover {
  background: #005555;
  box-shadow: var(--elev-3);
}

.login-submit .material-symbols-outlined { font-size: 20px; }

/* Footer */
.login-footer {
  font-size: 12px;
  color: var(--md-on-surface-variant);
  margin-top: 32px;
  text-align: center;
}

/* --- RESPONSIVE --- */
@media (max-width: 800px) {
  .login-split {
    flex-direction: column;
    width: 94vw;
    min-height: auto;
  }

  .login-split__left {
    flex: none;
    min-height: 280px;
    height: 280px;
    position: relative;
    padding: 0;
  }

  .login-left__pinned-illustration {
    bottom: 22px;
    width: min(calc(100% - 36px), 440px);
  }

  .login-split__right {
    padding: 36px 28px;
  }
}

/* ============================================
   PARTICIPANT LAYOUT — USER INTERFACE
   ============================================ */

:root {
  --participant-topbar-height: 72px;
  --participant-shell-edge: 24px;
  --participant-sidebar-rail-width: 74px;
  --participant-sidebar-panel-width: 278px;
  --participant-sidebar-gap: 16px;
  --participant-sidebar-shell-width: calc(var(--participant-sidebar-rail-width) + var(--participant-sidebar-gap) + var(--participant-sidebar-panel-width));
  --participant-content-offset: calc(var(--participant-shell-edge) + var(--participant-sidebar-shell-width) + 28px);
  --participant-content-expanded-offset: calc(var(--participant-shell-edge) + var(--participant-sidebar-panel-width) + 28px);
  --participant-content-collapsed-offset: calc(var(--participant-shell-edge) + var(--participant-sidebar-rail-width) + 28px);
}

body.participant-page {
  display: flex;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(111,214,183,0.12), transparent 32%),
    linear-gradient(180deg, #F7F8FA 0%, #EFF2F5 100%);
  font-family: var(--font-display);
  margin: 0;
}

body.participant-shell {
  --participant-content-current-offset: var(--participant-content-expanded-offset);
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(111,214,183,0.12), transparent 32%),
    linear-gradient(180deg, #F7F8FA 0%, #EFF2F5 100%);
}

body.participant-shell.participant-shell-collapsed {
  --participant-content-current-offset: var(--participant-content-collapsed-offset);
}

body.participant-menu-open {
  overflow: hidden;
}

.participant-topbar {
  height: var(--participant-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
  background: rgba(255,255,255,0.94);
  color: #122033;
  border-bottom: 1px solid rgba(17,34,52,0.08);
  backdrop-filter: blur(18px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 170;
  box-shadow: 0 10px 28px rgba(20,32,46,0.06);
}

.participant-topbar__left,
.participant-topbar__heading,
.participant-topbar__right,
.participant-topbar__metrics {
  display: flex;
  align-items: center;
}

.participant-topbar__left {
  flex: 1 1 auto;
  gap: 16px;
  min-width: 0;
}

.participant-topbar__heading {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.participant-topbar__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #7B8696;
}

.participant-topbar__title {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.35px;
  color: #1A2234;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.participant-topbar__right {
  flex: 0 0 auto;
  gap: 14px;
  justify-content: flex-end;
  min-width: 0;
}

.participant-topbar__metrics {
  gap: 10px;
  flex-wrap: nowrap;
}

.participant-topbar__shortcut {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(18,32,51,0.08);
  background: #FFFFFF;
  color: #1B2435;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(20,32,46,0.05);
  transition: var(--transition-standard);
}

.participant-topbar__shortcut:hover {
  background: #F6F9FC;
  color: var(--md-primary);
  border-color: rgba(231,76,60,0.24);
}

.participant-topbar__shortcut .material-symbols-outlined {
  font-size: 20px;
}

.participant-top-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #F6F8FB;
  border: 1px solid rgba(18,32,51,0.08);
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.participant-top-pill--accent {
  background: rgba(231,76,60,0.14);
  border-color: rgba(231,76,60,0.22);
  color: var(--md-on-primary-container);
}

.participant-top-pill .material-symbols-outlined {
  font-size: 16px;
}

.participant-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.participant-user-chip__text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.participant-user-chip__text strong {
  font-size: 14px;
  font-weight: 700;
  color: #1A2234;
  line-height: 1;
}

.participant-user-chip__text span {
  font-size: 12px;
  color: #6D7786;
  line-height: 1;
}

.participant-user-chip__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #6B39F4 0%, #4D1FDD 100%);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
}

.participant-menu-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(18,32,51,0.10);
  border-radius: 14px;
  background: #F7F9FC;
  color: #172437;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-standard);
}

.participant-menu-toggle:hover {
  background: #EEF2F7;
}

.participant-menu-toggle .material-symbols-outlined {
  font-size: 22px;
}

.participant-sidebar-overlay {
  display: block;
  position: fixed;
  inset: 0;
  border: none;
  padding: 0;
  background: rgba(10,15,30,0.42);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 150;
}

.participant-sidebar-shell {
  position: fixed;
  left: var(--participant-shell-edge);
  top: calc(var(--participant-topbar-height) + 24px);
  width: var(--participant-sidebar-panel-width);
  max-width: calc(100vw - (var(--participant-shell-edge) * 2));
  min-height: calc(100dvh - var(--participant-topbar-height) - 48px);
  z-index: 160;
  transition: width 0.34s cubic-bezier(0.22, 1, 0.36, 1), transform 0.24s ease, opacity 0.24s ease;
}

body.participant-shell.participant-shell-collapsed .participant-sidebar-shell {
  width: var(--participant-sidebar-rail-width);
}

.participant-sidebar-rail {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--participant-sidebar-rail-width);
  flex-shrink: 0;
  min-height: calc(100dvh - var(--participant-topbar-height) - 48px);
  background: rgba(255,255,255,0.84);
  border: 1px solid rgba(206,214,224,0.9);
  border-radius: 30px;
  box-shadow: 0 22px 48px rgba(22,31,45,0.10);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-24px) scale(0.92);
  transition: opacity 0.24s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.24s ease;
}

body.participant-shell.participant-shell-collapsed .participant-sidebar-rail {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.participant-sidebar-rail__brand,
.participant-sidebar-rail__avatar {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.participant-sidebar-rail__brand {
  background: rgba(231,76,60,0.12);
  color: var(--md-primary);
  margin-bottom: 18px;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: var(--transition-standard);
}

.participant-sidebar-rail__brand:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(231,76,60,0.18);
}

.participant-sidebar-rail__brand .material-symbols-outlined {
  font-size: 22px;
}

.participant-shell-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
}

.user-sidebar__brand-mark .participant-shell-toggle-icon {
  transform: translateX(-1px) rotate(0deg);
}

.participant-sidebar-rail__brand .participant-shell-toggle-icon {
  transform: translateX(1px) rotate(180deg);
}

.participant-sidebar-rail__items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  align-items: center;
}

.participant-rail-item {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #516071;
  text-decoration: none;
  background: transparent;
  transition: var(--transition-standard);
}

.participant-rail-item:hover {
  background: #F3F6F9;
  color: #18263A;
}

.participant-rail-item.active {
  background: linear-gradient(180deg, #F3B27E 0%, var(--md-primary) 100%);
  color: var(--md-on-primary);
  box-shadow: 0 10px 18px rgba(231,76,60,0.24);
}

.participant-rail-item--danger {
  color: #8A5560;
}

.participant-rail-item .material-symbols-outlined {
  font-size: 20px;
}

.participant-sidebar-rail__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.participant-sidebar-rail__avatar {
  border-radius: 18px;
  background: #172437;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
}

/* Sidebar participant */
.user-sidebar {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--participant-sidebar-panel-width);
  flex-shrink: 0;
  min-height: calc(100dvh - var(--participant-topbar-height) - 48px);
  max-height: calc(100dvh - var(--participant-topbar-height) - 48px);
  overflow: auto;
  background: rgba(255,255,255,0.90);
  border: 1px solid rgba(206,214,224,0.92);
  border-radius: 32px;
  box-shadow: 0 22px 48px rgba(22,31,45,0.12);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  padding: 22px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0) scale(1);
  transition: opacity 0.24s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.24s ease;
}

body.participant-shell.participant-shell-collapsed .user-sidebar {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(20px) scale(0.96);
}

.user-sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(28,42,58,0.08);
}

.user-sidebar__brand-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.user-sidebar__brand-mark {
  appearance: none;
  border: none;
  padding: 0;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(231,76,60,0.16) 0%, rgba(231,76,60,0.08) 100%);
  color: var(--md-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-standard);
}

.user-sidebar__brand-mark .material-symbols-outlined {
  font-size: 22px !important;
}

.user-sidebar__brand-mark:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(231,76,60,0.16);
}

body.participant-shell.participant-shell-collapsed .participant-sidebar-rail__brand .participant-shell-toggle-icon {
  transform: translateX(2px) rotate(180deg);
}

body.participant-shell.participant-shell-collapsed .user-sidebar__brand-mark .participant-shell-toggle-icon {
  transform: translateX(0) rotate(12deg);
}

.user-sidebar__brand-kicker {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #8C97A6;
  margin-bottom: 4px;
}

.user-sidebar__brand-name {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #1B2435;
  letter-spacing: -0.2px;
}

.participant-sidebar-close {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(18,32,51,0.08);
  background: #FAFBFC;
  color: #3B495B;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.participant-sidebar-close .material-symbols-outlined {
  font-size: 22px;
}

.user-sidebar__hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-radius: 26px;
  background: linear-gradient(180deg, #FFF9F6 0%, #FCE8E2 100%);
  border: 1px solid rgba(231,76,60,0.18);
  margin-bottom: 20px;
}

.user-sidebar__hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--md-primary);
}

.user-sidebar__hero h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  color: #172437;
  letter-spacing: -0.6px;
}

.user-sidebar__hero p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #657285;
}

.user-sidebar__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  margin-top: 6px;
  padding: 0 18px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid rgba(207,216,225,0.9);
  box-shadow: 0 8px 16px rgba(22,31,45,0.06);
  color: #193347;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.user-sidebar__cta:hover {
  color: var(--md-primary);
  border-color: rgba(231,76,60,0.24);
}

.user-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.user-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 18px;
  color: #27384A;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  border: 1px solid transparent;
  transition: var(--transition-standard);
}

.user-nav-item:hover {
  background: #F6F8FB;
  color: #142235;
}

.user-nav-item.active {
  background: linear-gradient(180deg, #F3B27E 0%, var(--md-primary) 100%);
  color: var(--md-on-primary);
  box-shadow: 0 12px 20px rgba(231,76,60,0.24);
}

.user-nav-item--ghost {
  background: #FFFFFF;
  border-color: rgba(210,217,225,0.92);
}

.user-nav-item .material-symbols-outlined {
  font-size: 20px;
  flex-shrink: 0;
}

.user-sidebar__meta-card {
  margin-top: auto;
  padding: 18px;
  border-radius: 22px;
  background: #FFFFFF;
  border: 1px solid rgba(210,217,225,0.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.user-sidebar__meta-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.user-sidebar__meta-card-header > span:first-child {
  font-size: 13px;
  font-weight: 700;
  color: #223246;
}

.user-sidebar__meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.user-sidebar__meta-cell {
  padding: 12px;
  border-radius: 16px;
  background: #F7F9FB;
}

.user-sidebar__meta-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #7E8998;
  margin-bottom: 6px;
}

.user-sidebar__meta-cell strong {
  display: block;
  font-size: 22px;
  line-height: 1;
  color: #18263A;
  letter-spacing: -0.5px;
}

.user-sidebar__empty-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #6C7786;
}

.user-sidebar__footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(28,42,58,0.08);
}

.user-avatar-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: #F7F9FB;
  color: #27384A;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}

.user-avatar-chip__avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #172437;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-avatar-chip__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.user-avatar-chip__text strong {
  font-size: 13px;
  color: #18263A;
  line-height: 1;
}

.user-avatar-chip__text span {
  font-size: 12px;
  color: #7B8695;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Wrapper contenu participant */
.user-content-wrapper {
  margin-left: var(--participant-content-current-offset);
  margin-top: var(--participant-topbar-height);
  flex: 1;
  padding: 36px 40px;
  width: calc(100% - var(--participant-content-current-offset));
  min-height: calc(100vh - var(--participant-topbar-height));
  box-sizing: border-box;
  transition: margin-left 0.34s cubic-bezier(0.22, 1, 0.36, 1), width 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

body.participant-shell > .container {
  width: calc(100% - var(--participant-content-current-offset));
  max-width: none;
  margin-top: var(--participant-topbar-height);
  margin-left: var(--participant-content-current-offset);
  padding: 32px 24px 40px;
  box-sizing: border-box;
  transition: margin-left 0.34s cubic-bezier(0.22, 1, 0.36, 1), width 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

body.participant-shell > .container .content,
body.participant-shell > .container .content-container {
  width: auto;
}

/* ============================================
   PARTICIPANT — SECTIONS
   ============================================ */

.user-section {
  margin-bottom: 8px;
}

.user-section--new-project {
  margin-top: 40px;
  /*position: sticky;*/
  top: calc(var(--participant-topbar-height) + 24px);
  z-index: 20;
}

.user-section__header {
  margin-bottom: 20px;
}

.user-section__title-group {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.user-section__title-group > .material-symbols-outlined {
  font-size: 26px;
  color: var(--md-primary);
  font-variation-settings: 'FILL' 1;
  margin-top: 2px;
  flex-shrink: 0;
}

.user-section__title-group h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--md-on-surface);
  margin: 0 0 3px;
}

.user-section__title-group p {
  font-size: 13px;
  color: var(--md-on-surface-variant);
  margin: 0;
}

/* ============================================
   PROJECT CARDS GRID  ← DÉPRÉCIÉ / REMPLACÉ PAR TABLEAU MD3
   ============================================ */

/* .project-cards-grid { ... }
.project-card { ... }
.project-card__header { ... }
.project-card__number { ... }
.project-card__status { ... }
.project-status-dot { ... }
.project-card__name { ... }
.project-card__stats { ... }
.project-stat { ... }
.project-stat__label { ... }
.project-stat__value { ... }
.project-card__cta { ... } */

/* ============================================
   NEW PROJECT CARD
   ============================================ */

.new-project-card {
  background: #FFFFFF;
  border: 1.5px dashed rgba(0,106,106,0.30);
  border-radius: 16px;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  transition: var(--transition-standard);
}

.new-project-card:hover {
  border-color: var(--md-primary);
  background: #FAFEFE;
}

.new-project-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--md-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.new-project-card__icon .material-symbols-outlined {
  font-size: 28px;
  color: var(--md-primary);
  font-variation-settings: 'FILL' 1;
}

.new-project-card__content {
  flex: 1;
}

.new-project-card__content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--md-on-surface);
  margin: 0 0 4px;
}

.new-project-card__content p {
  font-size: 13px;
  color: var(--md-on-surface-variant);
  margin: 0;
  line-height: 1.5;
}

.new-project-card__form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.new-project-field {
  width: 200px;
}

.new-project-field input {
  padding: 14px 16px 6px;
}

/* Responsive */
@media (max-width: 768px) {
  .user-section--new-project {
    position: static;
    top: auto;
  }

  .new-project-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .new-project-card__form {
    width: 100%;
    flex-direction: column;
  }
  .new-project-field {
    width: 100%;
  }
  .new-project-card__form .md3-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   ALERT VARIANTS
   ============================================ */

.md3-alert--success {
  background: #E8F5E9;
  color: #2E7D32;
}

.md3-alert--danger {
  background: var(--md-error-container);
  color: var(--md-error);
}

/* ============================================
   STEP LAYOUT
   ============================================ */

.md3-step-container {
  margin-left: var(--participant-content-current-offset);
  margin-top: var(--participant-topbar-height);
  width: calc(100% - var(--participant-content-current-offset));
  padding: 32px;
  min-height: calc(100vh - var(--participant-topbar-height));
  background: var(--md-surface);
  box-sizing: border-box;
  transition: margin-left 0.34s cubic-bezier(0.22, 1, 0.36, 1), width 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.step-layout {
  display: grid;
  grid-template-columns: 65fr 35fr;
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}

.step-layout__main {
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  min-height: 400px;
  min-width: 0;
}

.step-layout__main .step-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--md-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.step-layout__side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--participant-topbar-height) + 24px);
}

/* Step cards */
.md3-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--md-outline-variant, #E0E0E0);
  overflow: hidden;
}

.md3-card__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--md-outline-variant, #E0E0E0);
  background: #FAFAFA;
}

.md3-card__header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--md-on-surface);
  display: flex;
  align-items: center;
  gap: 8px;
}

.md3-card__body {
  padding: 20px;
}

/* ============================================
   GRAPH BAR
   ============================================ */

.md3-graph-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ============================================
   PARAMETER STRIP
   ============================================ */

.md3-param-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: #E0E0E0;
  border: 1px solid #E0E0E0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}

.md3-param-item {
  background: #F5F5F5;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.md3-param-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #616161;
}

.md3-param-value {
  font-family: 'Roboto Mono', monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--md-on-surface);
}

.md3-param-subvalue {
  color: #757575;
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
  line-height: 1.35;
}

.md3-param-strip--dark .md3-param-item {
  background: #EEEEEE;
}

.md3-param-strip--3col {
  grid-template-columns: repeat(3, 1fr);
}

.md3-param-strip--3col .md3-param-item {
  background: #F0F4F8;
}

.md3-param-strip--costs .md3-param-item {
  background: #F0F4F8;
}

/* ============================================
   STEP TABS — AGRANDISSEMENT
   ============================================ */

.md3-step-nav-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 12px 0;
  margin-bottom: 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.md3-step-nav-wrapper::-webkit-scrollbar {
  display: none;
}

.md3-step-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 4px 2px;
  width: max-content;
  min-width: 100%;
}

.md3-step-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(0,0,0,0.12);
  background: #FFFFFF;
  color: var(--md-on-surface-variant);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition-standard);
  cursor: pointer;
}

.md3-step-tab:hover {
  border-color: var(--md-primary);
  color: var(--md-primary);
  background: var(--md-primary-container);
}

.md3-step-tab.active {
  background: var(--md-primary);
  color: #FFFFFF;
  border-color: var(--md-primary);
  box-shadow: 0 4px 12px rgba(0,106,106,0.25);
}

.md3-step-tab__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.md3-step-tab.active .md3-step-tab__num {
  background: rgba(255,255,255,0.25);
  color: #FFFFFF;
}

.md3-step-tab--utility {
  border-style: dashed;
  border-color: rgba(0,0,0,0.18);
  background: #FAFAFA;
}

.md3-step-tab--utility:hover {
  border-style: solid;
  border-color: var(--md-secondary);
  color: var(--md-secondary);
  background: var(--md-secondary-container);
}

.md3-step-tab .material-symbols-outlined {
  font-size: 17px;
}

/* ============================================
   STEP FOOTER
   ============================================ */

.md3-step-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--md-outline-variant);
}

.md3-step-footer__center {
  font-size: 12px;
  color: var(--md-on-surface-variant);
}

/* ============================================
   SIDEBAR — SIDE-CARD / TASK ITEMS
   ============================================ */

.side-card {
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  min-width: 0;
}

.side-card__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--md-on-surface-variant);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.side-info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.side-info-row:last-child {
  margin-bottom: 0;
}

.side-info-row__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--md-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.side-info-row__value {
  font-size: 20px;
  font-weight: 700;
  color: var(--md-on-surface);
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
}

.side-info-row__value--text {
  font-size: 17px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0;
}

.task-status-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--md-on-surface-variant);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: var(--transition-standard);
}

.task-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.task-item__left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

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

.task-dot--done    { background: #15803D; }
.task-dot--active  { background: #B45309; }
.task-dot--pending { background: #CBD5E1; }

.task-item__label {
  font-size: 15px;
  font-weight: 500;
  color: var(--md-on-surface);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.task-item__btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--md-outline, #C0C0C0);
  border-radius: 50%;
  background: transparent;
  color: var(--md-primary);
  cursor: pointer;
  transition: all 0.15s;
  align-self: flex-start;
}

.task-item__btn:hover:not(:disabled) {
  background: var(--md-primary-container);
  border-color: var(--md-primary);
}

.task-item__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.task-item__btn .material-symbols-outlined {
  font-size: 18px;
}

/* ============================================
   RESPONSIVE — STEP LAYOUT
   ============================================ */

@media (max-width: 1100px) {
  :root {
    --participant-shell-edge: 16px;
    --participant-sidebar-rail-width: 68px;
    --participant-sidebar-panel-width: 252px;
    --participant-sidebar-gap: 14px;
  }

  .user-content-wrapper {
    padding: 28px 24px;
  }

  .md3-step-container {
    padding: 28px 24px;
  }

  body.participant-shell > .container {
    padding: 28px 24px 36px;
  }

  .step-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 1024px) {
  .step-layout {
    grid-template-columns: 1fr;
  }
  .step-layout__side {
    position: static;
  }
  .md3-param-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 991px) {
  :root {
    --participant-shell-edge: 12px;
    --participant-sidebar-rail-width: 64px;
    --participant-sidebar-panel-width: min(272px, calc(100vw - 100px));
    --participant-sidebar-gap: 12px;
  }

  body.participant-page {
    flex-direction: column;
  }

  .participant-topbar {
    padding: 0 16px 0 12px;
    gap: 12px;
  }

  .participant-topbar__left {
    gap: 12px;
  }

  .participant-topbar__right {
    gap: 10px;
  }

  .participant-topbar__metrics {
    gap: 8px;
  }

  .participant-menu-toggle {
    display: inline-flex;
  }

  .participant-sidebar-shell {
    top: calc(var(--participant-topbar-height) + 12px);
    width: min(var(--participant-sidebar-panel-width), calc(100vw - (var(--participant-shell-edge) * 2)));
    min-height: 0;
    transform: translateX(calc(-100% - 28px));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.24s ease, opacity 0.24s ease;
  }

  .user-sidebar {
    min-height: calc(100dvh - var(--participant-topbar-height) - 24px);
    max-height: calc(100dvh - var(--participant-topbar-height) - 24px);
  }

  .participant-sidebar-rail {
    display: none;
  }

  .user-sidebar__brand {
    padding-bottom: 16px;
    margin-bottom: 16px;
  }

  .participant-sidebar-close {
    display: inline-flex;
  }

  .user-sidebar {
    position: relative;
    left: auto;
    top: auto;
    padding: 20px 18px;
    border-radius: 28px;
    width: 100%;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .user-sidebar__nav {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    overflow: visible;
  }

  .user-sidebar__footer {
    display: block;
  }

  .user-avatar-chip {
    display: flex;
  }

  .user-nav-item {
    white-space: normal;
  }

  .user-content-wrapper {
    margin-left: 0;
    width: 100%;
    padding: 24px 20px 32px;
  }

  .md3-step-container {
    margin-left: 0;
    width: 100%;
    padding: 24px 20px 32px;
  }

  body.participant-shell > .container {
    margin-left: 0;
    width: 100%;
    padding: 24px 20px 32px;
    box-sizing: border-box;
  }

  .user-section--new-project {
    position: static;
    top: auto;
  }

  .md3-step-footer {
    flex-wrap: wrap;
    gap: 12px;
  }

  .md3-step-footer__center {
    width: 100%;
    order: 3;
    text-align: center;
  }

  body.participant-menu-open .participant-sidebar-shell {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  body.participant-menu-open .participant-sidebar-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

@media (max-width: 768px) {
  .md3-step-container {
    margin-left: 0;
    padding: 16px;
  }

  .user-content-wrapper {
    padding: 18px 14px 24px;
  }

  body.participant-shell > .container {
    padding: 18px 14px 24px;
  }

  .participant-topbar {
    padding: 0 12px;
  }

  .participant-topbar__eyebrow {
    font-size: 10px;
  }

  .participant-topbar__title {
    font-size: 16px;
  }

  .participant-topbar__metrics {
    display: none;
  }

  .participant-sidebar-shell {
    top: calc(var(--participant-topbar-height) + 10px);
  }

  .user-sidebar {
    padding: 16px;
    gap: 8px;
    border-radius: 26px;
  }

  .user-sidebar__brand-name {
    font-size: 15px;
  }

  .step-layout__main {
    padding: 16px;
    min-height: 0;
  }

  .md3-card__header,
  .md3-card__body,
  .graph-card,
  .side-card {
    padding-left: 16px;
    padding-right: 16px;
  }

  .md3-param-strip {
    grid-template-columns: 1fr 1fr;
  }

  .md3-step-tabs {
    gap: 8px !important;
    padding: 12px 0 !important;
    margin-bottom: 20px !important;
  }

  .md3-step-tab {
    height: auto !important;
    min-height: 58px;
    padding: 14px 16px !important;
    font-size: 13px !important;
  }

  .md3-step-tab__label {
    font-size: 13px !important;
    white-space: normal;
    line-height: 1.25;
  }

  .side-card__title,
  .task-status-title {
    font-size: 12px !important;
  }

  .task-item__label {
    font-size: 15px !important;
  }

  .side-info-row__value {
    font-size: 20px !important;
  }

  .side-info-row__value--text {
    font-size: 16px !important;
  }

  .participant-top-pill--optional {
    display: none;
  }

  .md3-dialog__actions {
    flex-direction: column;
  }

  .md3-dialog__actions .md3-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .md3-page-header {
    margin-bottom: 20px;
  }

  .participant-topbar__title {
    max-width: 150px;
  }

  .participant-user-chip__text {
    display: none;
  }

  .participant-user-chip {
    gap: 8px;
  }

  .participant-user-chip__avatar {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .participant-sidebar-shell {
    width: min(var(--participant-sidebar-panel-width), calc(100vw - 20px));
  }

  .md3-param-strip {
    grid-template-columns: 1fr;
  }

  .new-project-card {
    padding: 20px 18px;
    gap: 16px;
  }

  .graph-card {
    padding: 16px;
  }

  .md3-table {
    min-width: 680px;
  }

  .md3-table thead th,
  .md3-table tbody td {
    padding-left: 12px;
    padding-right: 12px;
  }

}

/* Disabled state for anchor buttons */
a.md3-btn[disabled],
a.md3-btn.disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: default;
}

/* ============================================
   MD3 DIALOG (alert/confirm modal)
   ============================================ */

.md3-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  animation: md3FadeIn 0.2s;
}

.md3-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #FFF;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  z-index: 10000;
  min-width: 320px;
  max-width: 420px;
  animation: md3DialogIn 0.2s;
}

.md3-dialog--alert .md3-dialog__icon .material-symbols-outlined {
  color: var(--md-primary);
}

.md3-dialog--confirm .md3-dialog__icon .material-symbols-outlined {
  color: var(--md-primary);
}

.md3-dialog__content {
  padding: 28px 24px 20px;
  text-align: center;
}

.md3-dialog__icon {
  margin-bottom: 16px;
}

.md3-dialog__icon .material-symbols-outlined {
  font-size: 52px;
}

.md3-dialog__message {
  font-size: 15px;
  line-height: 1.6;
  color: var(--md-on-surface);
  margin: 0 0 24px;
}

.md3-dialog__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.md3-dialog__actions .md3-btn {
  min-width: 100px;
}

.md3-dialog__actions .md3-btn--outline {
  border-color: var(--md-outline, #C0C0C0);
  color: var(--md-on-surface);
  background: transparent;
}

.md3-dialog__actions .md3-btn--outline:hover {
  background: #F5F5F5;
}

@keyframes md3FadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes md3DialogIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ============================================
   GRAPHE AMCHARTS — FIX HAUTEUR CONTENEUR
   ============================================ */

#chartdiv {
  width: 100% !important;
  height: 420px !important;
  min-height: 420px !important;
  display: block !important;
  position: relative !important;
  overflow: visible !important;
}

.graph-card {
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  overflow: visible;
  min-width: 0;
}

#chartdiv svg {
  display: block !important;
  overflow: visible !important;
}

#chartdiv div {
  box-sizing: content-box !important;
}

#chartdiv,
#chartdiv * {
  box-sizing: content-box !important;
}

.md3-step-container {
  overflow: visible !important;
}

#mainChartDiv {
  overflow: visible !important;
}

.md3-card__body img,
.step-layout__main img,
.graph-card img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ============================================
   MODAL PARAMÈTRES DÉTAILLÉS (étape 9)
   ============================================ */

/* Bootstrap 3 JS compat: .in → .show alias */
#basicModal.modal.in { display: block; }
#basicModal.modal.fade.in { opacity: 1; }
.modal-backdrop.in { opacity: 0.5; }

#basicModal.modal.fade.in .modal-dialog {
  transform: none;
}

#basicModal.modal.fade .modal-dialog {
  max-width: 800px;
  margin: 40px auto;
}

#basicModal .modal-content {
  border: none;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
  border: 1px solid var(--md-outline-variant, #E0E0E0);
}

#basicModal .modal-header {
  border-bottom: 1px solid var(--md-outline-variant, #E0E0E0);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#basicModal .modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--md-on-surface);
  margin: 0;
}

#basicModal .close {
  border: none;
  background: none;
  font-size: 24px;
  opacity: 0.5;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  color: var(--md-on-surface);
}

#basicModal .close:hover {
  opacity: 0.8;
}

#basicModal .modal-body {
  padding: 24px;
  overflow-x: auto;
}

#basicModal .table {
  width: 100%;
  margin-bottom: 0;
  font-size: 14px;
  border-collapse: collapse;
}

#basicModal .table th,
#basicModal .table td {
  padding: 10px 12px;
  border: 1px solid var(--md-outline-variant, #E0E0E0);
  text-align: left;
}

#basicModal .table th {
  background: #F5F5F5;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #616161;
}

#basicModal .table tr:last-child th,
#basicModal .table tr:last-child td {
  border-bottom: 1px solid var(--md-outline-variant, #E0E0E0);
}

#basicModal .table caption {
  caption-side: top;
  padding: 0;
}

#basicModal .modal-footer {
  border-top: 1px solid var(--md-outline-variant, #E0E0E0);
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
}

#basicModal .btn-default {
  background: var(--md-surface);
  border: 1px solid var(--md-outline, #C0C0C0);
  color: var(--md-on-surface);
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

#basicModal .btn-default:hover {
  background: #F5F5F5;
}

/* ============================================
   PARTICIPANT — PROJECT TABLE SPECIFICS
   ============================================ */

/* Numéro de ligne */
.proj-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--md-primary-container);
  color: var(--md-primary);
  font-size: 12px;
  font-weight: 700;
}

/* Nom du projet */
.proj-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--md-on-surface);
}

/* Chiffres financiers */
.proj-figure {
  font-size: 13px;
  font-weight: 500;
  color: var(--md-on-surface);
  font-family: var(--font-mono);
}

.proj-figure--spending {
  color: #B45309;
}

/* Badge statut */
.proj-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #FEF3C7;
  color: #B45309;
  font-size: 12px;
  font-weight: 600;
}

.proj-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #B45309;
  flex-shrink: 0;
}

/* Bouton Resume inline */
.proj-resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--md-primary);
  color: #FFFFFF;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-standard);
  white-space: nowrap;
}

.proj-resume-btn:hover {
  background: #005555;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0,106,106,0.28);
}

.proj-resume-btn .material-symbols-outlined {
  font-size: 16px;
  font-variation-settings: 'FILL' 1;
}

@media (max-width: 768px) {
  .md3-dialog {
    width: calc(100vw - 24px);
    min-width: 0;
  }
}

/* ============================================
   GLOBAL RESPONSIVE OVERRIDES & TOUCH ENHANCEMENTS
   ============================================ */

/* Small tablets and mobile landscape (max-width: 991px) */
@media (max-width: 991px) {
  body:not(.login-page) {
    display: block !important;
  }

  html.admin-menu-open,
  body.admin-menu-open {
    overflow: hidden !important;
    height: 100vh !important;
    touch-action: none !important;
  }

  .admin-topbar {
    display: flex !important;
  }

  .navbar-md3 {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 270px !important;
    max-width: calc(100vw - 36px) !important;
    z-index: 1070 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1) !important;
    box-shadow: var(--elev-3) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .navbar-md3.navbar-md3--open {
    transform: translateX(0) !important;
  }

  .admin-sidebar-close {
    display: flex !important;
  }

  .main-content-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    margin-top: 60px !important;
    padding: 24px 20px !important;
  }

  .md3-footer {
    padding: 16px 20px !important;
    margin-left: 0 !important;
    width: 100% !important;
  }

  .kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }
}

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
  }

  .md3-page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    margin-bottom: 20px !important;
  }

  .md3-page-title {
    font-size: 22px !important;
  }

  .md3-table-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 12px !important;
  }

  .md3-table-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 14px 16px !important;
  }

  .md3-table-actions {
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .md3-table-actions .md3-btn,
  .md3-table-actions a {
    flex: 1 !important;
    min-width: 120px !important;
    justify-content: center !important;
  }

  .md3-search-field {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Horizontally Scrollable Touch Tab Bar */
  .md3-step-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding: 6px 2px !important;
    margin-bottom: 16px !important;
    gap: 8px !important;
  }

  .md3-step-tabs::-webkit-scrollbar {
    display: none !important;
  }

  .md3-step-tab {
    flex: 0 0 auto !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    border-radius: 999px !important;
    box-sizing: border-box !important;
  }

  .md3-step-tab__label {
    white-space: nowrap !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
  }

  #basicModal .modal-dialog {
    margin: 12px auto !important;
    width: calc(100vw - 24px) !important;
    max-width: 100% !important;
  }

  #basicModal .modal-body {
    padding: 14px !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
  }
}

/* Compact Mobile Devices (max-width: 576px) */
@media (max-width: 576px) {
  .kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .kpi-card {
    padding: 16px !important;
    gap: 12px !important;
  }

  .kpi-card__value {
    font-size: 24px !important;
  }

  .md3-form-card {
    padding: 0 !important;
    max-width: 100% !important;
    border-radius: 12px !important;
  }

  .md3-form-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .md3-form-card__actions {
    flex-direction: column-reverse !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 16px 14px !important;
  }

  .md3-form-card__actions .md3-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .md3-field input,
  .md3-field select,
  .md3-field textarea {
    font-size: 16px !important; /* Prevents auto-zoom on mobile safari */
    height: 48px !important;
  }

  .login-split {
    width: 100% !important;
    min-height: 100vh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
  }

  .login-split__left {
    height: 220px !important;
    min-height: 220px !important;
    position: relative !important;
    padding: 0 !important;
  }

  .login-left__text {
    padding: 16px 14px 22px !important;
  }

  .login-left__text p {
    display: none !important;
  }

  .login-left__text h2 {
    font-size: 19px !important;
    margin-bottom: 2px !important;
  }

  .login-left__pinned-illustration {
    bottom: 12px !important;
    width: min(calc(100% - 24px), 340px) !important;
  }

  .login-split__right {
    padding: 20px 16px !important;
  }

  .login-card {
    padding: 20px 16px !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
  }

  #chartdiv, #mainChartDiv {
    height: 280px !important;
    min-height: 280px !important;
  }
}

/* Extra-Small & Micro Devices (max-width: 380px) */
@media (max-width: 380px) {
  .main-content-wrapper,
  .user-content-wrapper,
  .md3-step-container {
    padding: 12px 10px !important;
  }

  .md3-page-title {
    font-size: 19px !important;
  }

  .participant-topbar__title {
    max-width: 110px !important;
    font-size: 14px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .participant-user-chip__avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
  }

  .participant-shortcut-btn {
    width: 32px !important;
    height: 32px !important;
  }

  .kpi-card__value {
    font-size: 20px !important;
  }

  .proj-resume-btn {
    padding: 6px 12px !important;
    font-size: 12px !important;
  }

  #chartdiv, #mainChartDiv {
    height: 230px !important;
    min-height: 230px !important;
  }

  .md3-btn {
    font-size: 13px !important;
    padding: 8px 12px !important;
  }
}
