/* Bouton de fermeture universel pour modales et formulaires */
.close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 2rem;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}
.close-btn:hover, .close-btn:focus {
    color: #d32f2f;
    outline: none;
}
/* Styles généraux */

.page-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}
/* PAC — Formulaire de modification */
#pac .modal-content--form {
    max-width: 720px;
    padding: 32px 36px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.16);
    max-height: 90vh;
    overflow-y: auto;
}

#pac .form-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.12));
    margin-bottom: 20px;
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.12);
}

#pac .form-banner__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}

#pac .form-banner__text {
    margin: 0;
    font-size: 0.95rem;
    color: #1f2937;
    line-height: 1.5;
}

#pac .form-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

#pac .form-section__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

#pac .form-section__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
}

#pac .form-section__hint {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
    max-width: 280px;
}

#pac .form-section__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#pac .input-grid {
    display: grid;
    gap: 16px;
}

#pac .input-grid--two {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

#pac .input-grid--dates {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

#pac-action-form .input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

#pac-action-form .input-group label {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}

#pac-action-form .input-group .input,
#pac-action-form .input-group textarea,
#pac-action-form .input-group select {
    background: #f8fafc;
    border: 1px solid #dbe2f0;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#pac-action-form .input-group .input:focus,
#pac-action-form .input-group textarea:focus,
#pac-action-form .input-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

#pac-action-form textarea {
    resize: vertical;
    min-height: 96px;
}

#pac-action-form .input-group .muted {
    font-size: 0.8rem;
}

#pac-action-form .critere-multiselect {
    background: #ffffff;
    border-radius: 8px;
}

#pac-action-form .form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
}

#pac-action-form .form-actions__left,
#pac-action-form .form-actions__right {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

#pac-action-form .form-actions__right .btn {
    min-width: 120px;
}

@media (max-width: 720px) {
    #pac .modal-content--form {
        padding: 24px 22px;
    }
    #pac .form-banner {
        flex-direction: column;
    }
    #pac .form-section {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    #pac .modal-content--form {
        padding: 20px 18px;
    }
    #pac .form-section__header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.page-title__label {
    display: inline-block;
}

.page-title__icon {
    --icon-size: clamp(28px, 3vw, 36px);
    width: var(--icon-size);
    height: var(--icon-size);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background-color: var(--primary-color, #2797d6);
    position: relative;
    overflow: hidden;
}

.page-title__icon::after {
    content: '';
    display: block;
    width: 70%;
    height: 70%;
    background-image: var(--icon-url);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color, #edf1f5);
    color: #0f172a;
    --sidebar-expanded-width: 250px;
    --sidebar-collapsed-width: 88px;
    --sidebar-hidden-width: 0px;
    --sidebar-gap: 40px;
    --sidebar-right-margin: 60px;
    --sidebar-current-width: var(--sidebar-expanded-width);
    --sidebar-transition-duration: 0.25s;
    --sidebar-offset-top: 72px;
}

body.sidebar-collapsible {
    --sidebar-current-width: var(--sidebar-hidden-width);
}

body.sidebar-collapsible.sidebar-visible {
    --sidebar-current-width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsible.sidebar-visible.sidebar-expanded {
    --sidebar-current-width: var(--sidebar-expanded-width);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background-color: var(--header-bg, #ffffff);
    border-bottom: 1px solid var(--header-border, #e2e8f0);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    color: var(--header-color, #0f172a);
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-left img { max-height: 40px; }
.header-right {
    display: flex; align-items: center; gap: 10px; margin-right: 20px;
    position: relative; /* pour ancrer le logo structure en position:absolute */
}

/* 👉 Entête : Titre / Nom structure / Nom utilisateur */
.header h1,
.header .site-title,
.header .structure-name,
#user-name,
.header .user-name {
    color: var(--primary-color, #2797d6) !important;
}

/* Styles spécifiques Label/Milo + structure */
.label-bold { font-weight: bold; }
.milo { font-weight: normal; }
/* Nom de structure : non gras + 1/3 plus petit */
#structure-name {
    font-weight: normal !important;
    font-size: 0.67em; /* ≈ -33% */
    margin-left: 6px;
}
/* Ajout d’un séparateur fin automatiquement si non vide */
#structure-name:not(:empty)::before {
    content: "–";
    margin: 0 6px;
    font-size: 0.8em;
    opacity: 0.7;
    font-weight: normal;
}

/* === Overrides logo structure (prend le dessus) === */
/* Nom utilisateur à gauche du logo */
.user-name{
  font-weight: 600;
  opacity: .85;
  white-space: nowrap;
}
.user-name.hidden{ display:none; }

/* Logo structure : plus grand, mais reste dans la hauteur du header */
#structure-logo {
  max-height: clamp(52px, 6vw, 62px);
  width: auto;
  object-fit: contain;
  display: inline-block; /* on évite position:absolute */
  margin-left: 4px;
  vertical-align: middle;
}

#structure-logo.visible {
  display: inline-block;  /* rendu visible par le JS */
}

@media (max-width: 1024px) {
  #structure-logo {
    max-height: 48px;
  }
}

@media (max-width: 640px) {
  #structure-logo {
    max-height: 38px;
  }
}


/* === Tables responsive === */
:where(table) {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: auto;
}

:where(th, td) {
    padding: 0.75rem;
    vertical-align: top;
    text-align: left;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
}

:where(th, td) > * {
    max-width: 100%;
}

:where(thead th) {
    background-color: #f1f5f9;
    font-weight: 600;
}

:where(tr:nth-child(even)) {
    background-color: #f8fafc;
}

:where(caption) {
    caption-side: bottom;
    padding-top: 0.5rem;
    font-size: 0.9rem;
    color: #475569;
    text-align: left;
}

/* === Tableau de bord === */
#dashboard .dashboard-tabs {
    margin-top: clamp(16px, 3vw, 32px);
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    background: rgba(15, 23, 42, 0.04);
    border-radius: 999px;
}

.dashboard-tab {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    background: transparent;
    cursor: pointer;
    transition: background-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
    position: relative;
}

.dashboard-tab::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 10px 25px -20px rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 180ms ease;
}

.dashboard-tab:is(:hover, :focus-visible) {
    background: rgba(39, 151, 214, 0.08);
    outline: none;
}

.dashboard-tab:focus-visible {
    box-shadow: 0 0 0 3px rgba(39, 151, 214, 0.35);
}

.dashboard-tab.is-active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 18px 35px -20px rgba(15, 23, 42, 0.35);
}

.dashboard-tab.is-active::after {
    opacity: 1;
}

#dashboard .dashboard-panels {
    margin-top: clamp(18px, 3vw, 28px);
}

.dashboard-card {
    background: #ffffff;
    border-radius: 18px;
    padding: clamp(18px, 3vw, 28px);
    box-shadow: 0 18px 35px -20px rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 2vw, 24px);
    position: relative;
}

#dashboard .dashboard-panel {
    display: none;
}

#dashboard .dashboard-panel.is-active {
    display: flex;
}

#dashboard .pac-progress {
    display: none !important;
}

.dashboard-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.dashboard-card__header h3 {
    margin: 0;
    font-size: clamp(1.1rem, 1.6vw, 1.35rem);
    color: #0f172a;
}

.dashboard-card__header .muted {
    margin: 4px 0 0 0;
    font-size: 0.9rem;
}

.dashboard-card__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.dashboard-inline-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: #475569;
}

.dashboard-inline-label > span {
    font-weight: 600;
}

.dashboard-card__actions .input {
    min-width: 160px;
}

.dashboard-card__body {
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 2vw, 20px);
}

.dashboard-card__summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.92rem;
    color: #475569;
}

.dashboard-card__summary strong {
    color: var(--primary-color, #2797d6);
}

.dashboard-card__sub {
    font-size: 0.85rem;
    color: #64748b;
}

.pac-progress {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pac-progress__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    font-size: 0.9rem;
    color: #1e293b;
}

.pac-progress__label {
    font-weight: 600;
}

.pac-progress__bar {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background-color: #e2e8f0;
    overflow: hidden;
}

.pac-progress__fill {
    position: absolute;
    inset: 0;
    width: 0;
    border-radius: inherit;
    transition: width 260ms ease;
}

.pac-progress__fill.is-done {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.pac-progress__fill.is-progress {
    background: linear-gradient(90deg, #38bdf8, #0ea5e9);
}

.pac-progress__fill.is-todo {
    background: linear-gradient(90deg, #fbbf24, #f97316);
}

.pac-progress__value {
    font-variant-numeric: tabular-nums;
    color: #475569;
}

.pac-chart {
    min-height: 220px;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top, rgba(148, 163, 184, 0.15), transparent 60%);
    border-radius: 18px;
    padding: 20px;
    position: relative;
}

.pac-chart::before {
    content: '';
    display: block;
    width: clamp(140px, 40vw, 220px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: conic-gradient(
        rgba(34, 197, 94, 0.85) 0deg 120deg,
        rgba(14, 165, 233, 0.85) 120deg 260deg,
        rgba(249, 115, 22, 0.85) 260deg 360deg
    );
    mask: radial-gradient(circle 45% at center, transparent 0 65%, black 65% 100%);
    box-shadow: 0 18px 35px -24px rgba(15, 23, 42, 0.5);
}

.pac-chart > p {
    position: absolute;
    inset: auto;
    max-width: 240px;
    text-align: center;
}

.dashboard-card__sub ul {
    margin: 6px 0 0;
    padding-left: 20px;
}

.dashboard-card__sub li {
    margin: 4px 0;
}

.dashboard-legend {
    margin-top: 4px;
}
.gantt-row-bar {
    position: relative;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(90deg, #f8fafc 0%, #eef2f7 100%);
    overflow: hidden;
}

.gantt-bar {
    position: absolute;
    top: 8px;
    bottom: 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    padding: 0 12px;
    box-shadow: 0 18px 30px -18px rgba(15, 23, 42, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gantt-bar span {
    pointer-events: none;
}

.gantt-bar--compact span {
    font-size: 0;
}

.gantt-bar:hover {
    transform: scale(1.03);
    box-shadow: 0 14px 28px -16px rgba(15, 23, 42, 0.45);
}

@media (max-width: 960px) {
    .dashboard-edp-row,
    .gantt-row {
        grid-template-columns: 1fr;
    }

    .gantt-row-bar {
        height: 58px;
    }
}

@media (max-width: 640px) {
    #dashboard .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card__header {
        align-items: stretch;
    }
}



/* S’assurer que la cloche reste au-dessus et cliquable */
#notification-bell { position: relative; z-index: 1002; }

#notification-bell {
    background-color: var(--primary-color, #2797d6);
    color: var(--on-primary-color, #ffffff);
    font-size: 18px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}
#notification-bell:hover,
#notification-bell:focus {
    background-color: var(--primary-hover, #1f7bb0);
    color: var(--on-primary-color, #ffffff);
    outline: none;
}

/* Fil d'Ariane */
.breadcrumb {
    position: sticky;
    top: 72px;
    z-index: 950;
    display: flex;
    align-items: center;
    width: calc(100% - (var(--sidebar-current-width) + var(--sidebar-gap) + var(--sidebar-right-margin)));
    margin: 86px var(--sidebar-right-margin) 8px calc(var(--sidebar-current-width) + var(--sidebar-gap));
    padding: 10px 18px;
    background-color: var(--surface-color, #ffffff);
    border: 1px solid var(--surface-border-color, #e5e7eb);
    border-radius: 999px;
    box-shadow: var(--surface-shadow, 0 1px 4px rgba(15, 23, 42, 0.05));
    gap: 0.35rem;
    box-sizing: border-box;
    color: var(--secondary-color, #963f64);
    font-size: 0.85rem;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.35rem;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    color: inherit;
    font-size: 0.85rem;
    gap: 0.25rem;
}

.breadcrumb-item:not(:first-child)::before {
    content: '›';
    color: #9ca3af;
    margin: 0 0.35rem 0 0.45rem;
    font-size: 0.85em;
}

.breadcrumb-link {
    color: var(--secondary-color, #963f64);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-link:hover,
.breadcrumb-link:focus {
    text-decoration: underline;
    color: var(--secondary-hover, #7b324f);
}

.breadcrumb-text {
    color: inherit;
    font-weight: 500;
}

.breadcrumb-item[aria-current="page"] .breadcrumb-link,
.breadcrumb-item[aria-current="page"] .breadcrumb-text {
    color: var(--secondary-color, #963f64);
    font-weight: 600;
}

@media (max-width: 1024px) {
    .breadcrumb {
        position: static;
        width: auto;
        max-width: none;
        margin: 82px 20px 8px 20px;
    }
}

@media (max-width: 640px) {
    .breadcrumb {
        margin-top: 76px;
        padding: 10px 14px;
        border-radius: 14px;
    }
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-current-width);
    background-color: var(--primary-color, #2797d6);
    color: var(--on-primary-color, #ffffff);
    height: calc(100vh - var(--sidebar-offset-top));
    position: fixed;
    left: 0;
    top: var(--sidebar-offset-top);
    z-index: 900;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width var(--sidebar-transition-duration) ease, transform 0.3s ease;
}
.sidebar ul {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    flex-grow: 1;
}
.sidebar ul li a {
    text-decoration: none;
    color: var(--on-primary-color, #ffffff);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    transition: background-color 0.3s ease, padding var(--sidebar-transition-duration) ease, gap var(--sidebar-transition-duration) ease;
}
.sidebar ul li a:hover { background-color: rgba(255,255,255,0.1); }
.sidebar ul li a.active { background-color: rgba(255,255,255,0.2); font-weight: bold; }
.sidebar .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    transition: width var(--sidebar-transition-duration) ease, height var(--sidebar-transition-duration) ease, transform var(--sidebar-transition-duration) ease;
}
.sidebar .nav-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.sidebar .nav-label {
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 500;
    transition: opacity var(--sidebar-transition-duration) ease, transform var(--sidebar-transition-duration) ease, max-width var(--sidebar-transition-duration) ease;
    white-space: normal;
    line-height: 1.25;
}

body.sidebar-collapsible.sidebar-visible #menu-lateral .nav-link {
    justify-content: center;
    padding: 16px 0;
    gap: 0;
    text-align: center;
}

body.sidebar-collapsible.sidebar-visible.sidebar-expanded #menu-lateral .nav-link {
    justify-content: flex-start;
    padding: 12px 20px;
    gap: 12px;
    text-align: left;
}

body.sidebar-collapsible.sidebar-visible #menu-lateral .nav-label {
    opacity: 0;
    transform: translateX(-8px);
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

body.sidebar-collapsible.sidebar-visible.sidebar-expanded #menu-lateral .nav-label {
    opacity: 1;
    transform: translateX(0);
    max-width: 220px;
    white-space: normal;
}

body.sidebar-collapsible.sidebar-visible #menu-lateral .nav-icon {
    width: 36px;
    height: 36px;
}

body.sidebar-collapsible.sidebar-visible.sidebar-expanded #menu-lateral .nav-icon {
    width: 28px;
    height: 28px;
}
#user-name {
    margin: 10px; text-align: center; font-size: 14px; color: var(--primary-color, #2797d6);
    padding-bottom: 10px; border-top: 1px solid rgba(15,23,42,0.08);
}

/* Container */
.container {
    margin-left: calc(var(--sidebar-current-width) + var(--sidebar-gap));
    margin-right: var(--sidebar-right-margin);
    margin-top: clamp(12px, 3vw, 24px);
    padding: 20px;
    width: calc(100% - (var(--sidebar-current-width) + var(--sidebar-gap) + var(--sidebar-right-margin)));
    display: none;
    box-sizing: border-box;
}
.container.active { display: block; }

/* Contenu interne avec marges */
.container h2,
.container .filters,
.container table,
.container .theme-buttons,
.container .login-form,
.container .forgot-password-form,
.container .statistics,
.container button,
.container .settings-section {
    margin-left: 20px;
    margin-right: 60px;
}

/* Login form */
.login-form, .forgot-password-form {
    max-width: 320px;
    margin: 40px auto;
    padding: 24px;
    background: var(--surface-color, #ffffff);
    border-radius: 12px;
    border: 1px solid var(--surface-border-color, #e5e7eb);
    box-shadow: var(--surface-shadow, 0 1px 4px rgba(15, 23, 42, 0.05));
    transition: transform 0.3s ease;
}
.login-form:hover, .forgot-password-form:hover { transform: translateY(-2px); }
.form-group { position: relative; margin-bottom: 28px; }
.form-group label {
    position: absolute; top: -18px; left: 12px; font-size: 12px; color: var(--primary-color, #2797d6);
    background: var(--surface-color, #ffffff); padding: 0 4px; z-index: 1; transition: all 0.2s ease;
}
.form-group .input-wrapper { position: relative; }
.form-group .input-icon {
    position: absolute; top: 50%; left: 12px; transform: translateY(-50%);
    font-size: 16px; color: var(--primary-color, #2797d6); z-index: 1;
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s; box-sizing: border-box; position: relative; z-index: 0;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--primary-color, #2797d6);
    box-shadow: 0 0 8px rgba(var(--primary-color-rgb, 39, 151, 214), 0.3);
    outline: none;
}
.form-group select[multiple] { height: 100px; }
.form-group.checkbox { display: flex; align-items: center; gap: 8px; }
.form-group.checkbox input { width: auto; margin: 0; }
.login-form button, .forgot-password-form button {
    width: 100%; padding: 12px; background: var(--primary-color, #2797d6); color: var(--on-primary-color, #ffffff); border: none; border-radius: 8px;
    font-size: 14px; font-weight: bold; cursor: pointer; transition: background-color 0.3s, transform 0.2s;
}
.login-form button:hover, .forgot-password-form button:hover { background: var(--primary-hover, #1f7bb0); transform: translateY(-2px); }
.login-form a, .forgot-password-form a {
    display: block; text-align: center; margin-top: 12px; color: var(--secondary-color, #963f64); text-decoration: none; font-size: 13px; transition: color 0.3s;
}
.login-form a:hover, .forgot-password-form a:hover { color: var(--secondary-hover, #7b324f); }

/* Thèmes */
.theme-buttons { display: flex; flex-direction: column; align-items: center; gap: 15px; margin: 20px 0; }
.theme-item { display: flex; flex-direction: column; align-items: center; width: 80%; max-width: 600px; }
.theme-button {
    padding: 15px 30px; font-size: 18px; border: none; border-radius: 6px; font-weight: bold; cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s; width: 100%;
}
.theme-button:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.theme-button.active { transform: scale(1); }
.theme-button:not(.active) { transform: scale(0.75); opacity: 0.8; }
.theme-button[data-theme="La gouvernance"] { background-color: #f9b668; color: #111; }
.theme-button[data-theme="Le positionnement et les valeurs de la Mission Locale"] { background-color: #a8dbca; color: #111; }
.theme-button[data-theme="L'ancrage territorial et partenarial de la Mission Locale"] { background-color: #87cefa; color: #111; }
.theme-button[data-theme="L'offre de service de la Mission Locale"] { background-color: #ff807d; color: #111; }
.theme-button[data-theme="Le management et le pilotage de l'activité"] { background-color: #e7181e; color: #fff; }

/* Critères container */
.criteres-container {
    display: none; flex-wrap: wrap; gap: 15px; margin-top: 10px; width: 100%;
    padding: 15px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.1);
}
.criteres-container.active { display: flex; }
.criteres-container[data-theme="La gouvernance"] { background-color: rgba(249, 182, 104, 0.3); }
.criteres-container[data-theme="Le positionnement et les valeurs de la Mission Locale"] { background-color: rgba(168, 219, 202, 0.3); }
.criteres-container[data-theme="L'ancrage territorial et partenarial de la Mission Locale"] { background-color: rgba(135, 206, 250, 0.3); }
.criteres-container[data-theme="L'offre de service de la Mission Locale"] { background-color: rgba(255, 128, 125, 0.3); }
.criteres-container[data-theme="Le management et le pilotage de l'activité"] { background-color: rgba(231, 24, 30, 0.3); }
.critere-bubble {
    background-color: #ffffff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 15px; width: 100%; max-width: 300px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: transform 0.3s;
}
.critere-bubble:hover { transform: translateY(-2px); }
.critere-bubble a { color: var(--primary-color, #2797d6); font-weight: bold; text-decoration: none; }
.critere-bubble p { margin: 5px 0; font-size: 14px; color: #666; }

/* Tables (générique) */
table {
    width: 100%; max-width: 100%; border-collapse: collapse; margin-top: 20px; background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden;
}
table th, table td { border: 1px solid #ddd; padding: 12px; text-align: left; font-size: 14px; }
table th { background: var(--primary-color, #2797d6); color: var(--on-primary-color, #ffffff); font-weight: bold; }
table td a { color: var(--secondary-color, #963f64); text-decoration: none; }
table td a:hover { text-decoration: underline; }
table td button.edit-critere {
    background: var(--primary-color, #2797d6); color: var(--on-primary-color, #ffffff); border: none; padding: 8px 12px; border-radius: 4px; cursor: pointer; transition: background-color 0.3s;
}
table td button.edit-critere:hover { background: var(--primary-hover, #1f7bb0); }

/* Filters (générique) */
.filters {
    display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center;
}
.filters select, .filters button {
    padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; min-width: 150px;
}
.filters button {
    background: var(--primary-color, #2797d6); color: var(--on-primary-color, #ffffff); border: none; cursor: pointer; transition: background-color 0.3s;
}


.filters button:hover { background: var(--primary-hover, #1f7bb0); }

/* Modal */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: center;
}
.modal.active { display: flex; }
.modal-content {
    background: var(--surface-color, #ffffff); padding: 24px; border-radius: 12px; max-width: 500px; width: 90%;
    max-height: 80vh; overflow-y: auto; border: 1px solid var(--surface-border-color, #e5e7eb);
    box-shadow: var(--surface-shadow, 0 1px 4px rgba(15, 23, 42, 0.05));
    position: relative;
}

.modal-content--form {
    max-width: 720px;
    width: min(720px, 96%);
    padding: 44px 44px 36px;
    font-family: 'Arial', sans-serif;
}

.modal-content--form .modal-close {
    position: absolute;
    top: 18px;
    right: 20px;
    left: auto;
}

.modal-close--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: none;
    background: rgba(39, 151, 214, 0.12);
    color: var(--primary-color, #2797d6);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-close__icon {
    width: 18px;
    height: 18px;
}

.modal-close--icon:hover,
.modal-close--icon:focus {
    background: var(--primary-color, #2797d6);
    color: var(--on-primary-color, #ffffff);
    outline: none;
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 12px 24px rgba(39, 151, 214, 0.25);
}

.modal-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #0f172a;
}

.modal-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
}
.drag-handle {
    cursor: move;
    user-select: none;
}
.modal-content.dragging {
    cursor: grabbing;
}
.modal-content h3 { margin: 0 0 20px; font-size: 18px; color: #333; }
.modal-content button[type="submit"] {
    font-weight: 600;
}
.modal-content button.cancel-btn {
    background: var(--secondary-color, #963f64);
    border: 1px solid var(--secondary-color, #963f64);
    color: var(--on-secondary-color, #ffffff);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.modal-content button.cancel-btn:hover,
.modal-content button.cancel-btn:focus {
    background: var(--secondary-hover, #7b324f);
    border-color: var(--secondary-hover, #7b324f);
    color: var(--on-secondary-color, #ffffff);
}
.modal-content button.cancel-btn:focus {
    box-shadow: 0 0 0 3px rgba(var(--secondary-color-rgb, 150, 63, 100), 0.18);
    outline: none;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-form__body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.modal-form .form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.modal-form .form-field:focus-within {
    border-color: var(--primary-color, #2797d6);
    box-shadow: 0 18px 34px rgba(39, 151, 214, 0.15);
    transform: translateY(-1px);
}

.modal-form .form-field label {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.95rem;
}

.modal-form .input,
.modal-form input.input,
.modal-form textarea.input,
.modal-form select.input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background-color: #ffffff;
    color: #0f172a;
    font-size: 0.96rem;
    line-height: 1.45;
    box-sizing: border-box;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.modal-form .input:hover,
.modal-form input.input:hover,
.modal-form textarea.input:hover,
.modal-form select.input:hover {
    border-color: rgba(39, 151, 214, 0.7);
}

.modal-form .input:focus {
    border-color: var(--primary-color, #2797d6);
    box-shadow: 0 0 0 3px var(--primary-focus-ring, rgba(39, 151, 214, 0.18));
    outline: none;
    background-color: #f8fafc;
}

.modal-form .input::placeholder {
    color: #94a3b8;
}

.modal-form textarea.input {
    min-height: 140px;
    resize: vertical;
}

.modal-form .form-field__hint {
    margin: 4px 0 0;
    font-size: 0.85rem;
    line-height: 1.45;
}

.modal-form select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%232797d6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-position: calc(100% - 16px) center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 48px;
    cursor: pointer;
}

.modal-form input[type="date"].input {
    padding-right: 48px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%232797d6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='14' height='12' rx='2'/%3E%3Cpath d='M7 2.5v4m6-4v4M3 9.5h14'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 16px) center;
    background-size: 18px;
}

.modal-form input[type="date"].input::-webkit-calendar-picker-indicator {
    opacity: 0;
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.modal-form .input:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 8px;
}

.modal-actions .btn {
    min-width: 140px;
}

/* ===== Améliorations UI pack simple ===== */
.card {
    background: var(--surface-color, #ffffff);
    border: 1px solid var(--surface-border-color, #e5e7eb);
    border-radius: 12px;
    box-shadow: var(--surface-shadow, 0 1px 4px rgba(15, 23, 42, 0.05));
}
#parametres .parametres-tabs {
    box-sizing: border-box;
    margin: 0 auto;
    max-width: 1280px;
    max-width: 1080px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px 32px 32px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
#parametres .parametres-tabs .tabs-nav {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 12px 18px;
    flex-wrap: wrap;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
    background: transparent;
}
#parametres .parametres-tabs .tab-link {
    appearance: none;
    background: none;
    border: none;
    border-radius: 0;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
    padding: 12px 12px;
    position: relative;
    text-decoration: none;
    transition: color .2s ease;
}
#parametres .parametres-tabs .tab-link::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: -1px;
    height: 3px;
    border-radius: 999px;
    background: transparent;
    transition: background-color .2s ease;
}
#parametres .parametres-tabs .tab-link:hover {
    color: var(--primary-color, #2797d6);
}
#parametres .parametres-tabs .tab-link:focus-visible {
    outline: 2px solid var(--primary-focus-ring, rgba(39, 151, 214, 0.35));
    outline-offset: 2px;
}
#parametres .parametres-tabs .tab-link.active {
    color: var(--primary-color, #2797d6);
}
#parametres .parametres-tabs .tab-link.active::after {
    background: var(--primary-color, #2797d6);
}
#parametres .parametres-tabs .tab-label {
    pointer-events: none;
}
#parametres .parametres-tabs .tabs-panels {
    padding: 0;
}
#parametres .tab-panel {
    display: none;
}
#parametres .tab-panel.active {
    display: block;
}
#parametres .parametres-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
#parametres .parametres-form fieldset {
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 18px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    flex-direction: column;
    gap: 20px;
}
#parametres .parametres-form legend {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    padding: 0 6px;
}
#parametres .parametres-form .fieldset-description {
    margin: -8px 0 8px;
    color: #64748b;
    font-size: 14px;
}
#parametres .parametres-form .form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
#parametres .parametres-form .form-row .form-group {
    flex: 1;
    min-width: 200px;
}
#parametres .form-group--actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    min-width: 160px;
}
#parametres .form-group__label-placeholder {
    display: block;
    font-size: 12px;
    visibility: hidden;
    margin-bottom: 8px;
}
#parametres .form-group--actions button {
    width: auto;
}
#parametres .parametres-form .palette-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#parametres .parametres-form .palette-section-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #1e293b;
}
#parametres .parametres-form .color-palettes {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
#parametres .parametres-form .palette-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #f8fafc;
    color: #0f172a;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background-color .2s ease;
}
#parametres .parametres-form .palette-option:hover {
    transform: translateY(-1px);
    border-color: var(--primary-color, #2797d6);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}
#parametres .parametres-form .palette-option:focus-visible {
    outline: none;
    border-color: var(--primary-color, #2797d6);
    box-shadow: 0 0 0 3px var(--primary-focus-ring, rgba(39, 151, 214, 0.18));
}
#parametres .parametres-form .palette-option.active {
    border-color: transparent;
    background: linear-gradient(135deg, rgba(39, 151, 214, 0.12), rgba(150, 63, 100, 0.12));
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}
#parametres .parametres-form .palette-option.active::after {
    content: '✓';
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color, #2797d6);
    position: absolute;
    top: 10px;
    right: 14px;
}
#parametres .parametres-form .palette-option .palette-swatches {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    width: 60px;
}
#parametres .parametres-form .palette-option .palette-swatch {
    border-radius: 8px;
    height: 28px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}
#parametres .parametres-form .palette-option .palette-labels {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
}
#parametres .parametres-form .palette-option .palette-name {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}
#parametres .parametres-form .palette-option .palette-meta {
    font-size: 12px;
    color: #64748b;
    letter-spacing: .05em;
    text-transform: uppercase;
}
#parametres .parametres-form .palette-option.active .palette-meta {
    color: #1e293b;
}
#parametres .parametres-form .color-inputs {
    align-items: flex-end;
}
#parametres .parametres-form .form-hint {
    margin: 4px 0 10px;
    font-size: 13px;
    color: #64748b;
}
#parametres .parametres-form .logo-upload {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border: 1px dashed rgba(148, 163, 184, 0.7);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.85);
}
#parametres .parametres-form .logo-upload input[type="file"] {
    flex: 1 1 220px;
    min-width: 200px;
}
#parametres .logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 120px;
    min-height: 72px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 8px 12px;
    background: #ffffff;
}
#parametres #apercu_logo_structure {
    display: none;
    max-height: 80px;
}
#parametres .form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0;
}
#parametres .utilisateur-form fieldset,
#parametres .responsable-form fieldset {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 16px 18px;
    margin: 0 0 20px;
}
#parametres .utilisateur-form fieldset legend,
#parametres .responsable-form fieldset legend {
    font-weight: 600;
    color: #1f2937;
    padding: 0 8px;
}
#parametres .utilisateur-form .toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-weight: 500;
}
#parametres .utilisateur-form .toggle input {
    width: 20px;
    height: 20px;
}
#parametres .utilisateur-form .form-row,
#parametres .responsable-form .form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
#parametres .utilisateur-form .form-group,
#parametres .responsable-form .form-group {
    flex: 1;
    min-width: 220px;
}
#parametres #parametres-toast {
    min-width: 180px;
    text-align: right;
}
.filters { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px; gap: 10px; }
.filters select, .filters button { border-radius: 10px; border: 1px solid #d1d5db; padding: 10px 12px; }
.filters button { background: var(--primary-color, #2797d6); color:var(--on-primary-color, #ffffff); font-weight:600; }
#edp .table-wrapper-edp {
  width: 100%;
  overflow-x: auto;
}

#edp .table-wrapper-edp table {
  width: 100%;
  min-width: 720px;
}

#documents-table { border-collapse: separate; border-spacing: 0; }
#documents-table thead th {
  position: sticky; top:0; z-index:1; background: linear-gradient(#f3f4f6,#eef2f7);
  color:#111827; font-size:13px; letter-spacing:.02em;
}
#documents-table th, #documents-table td { padding:12px; border-bottom:1px solid #eef2f7; }
#documents-table th.col-criteres,
#documents-table td.col-criteres {
  max-width: 400px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
#edp .edp-critere-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#edp .edp-critere-item {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}
#edp .edp-critere-bullet {
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.4;
  flex: 0 0 auto;
  margin-top: 2px;
}
#edp .edp-critere-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--edp-badge-bg, var(--secondary-color, #f97316));
  color: var(--edp-badge-fg, var(--on-secondary-color, #ffffff));
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1;
  white-space: nowrap;
}
#edp .edp-critere-text {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
}

#edp .edp-detail-modal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

#edp .edp-detail-body {
    min-height: auto;
    max-height: none;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: clamp(14px, 2vw, 20px);
    align-items: flex-start;
}

#edp .edp-detail-content {
    overflow: visible;
    padding-right: 0;
}

#edp .edp-detail-preview {
    align-self: flex-start;
    max-height: 65vh;
}

#edp .edp-detail-preview.is-expanded {
    max-height: none;
}

#edp .edp-detail-preview-frame {
    min-height: 0;
}

#edp .edp-detail-preview-iframe {
    height: clamp(260px, 42vh, 440px);
}

#edp .edp-detail-term {
    flex: 0 0 clamp(120px, 18vw, 180px);
}

#edp .edp-detail-row {
    gap: clamp(10px, 1.6vw, 18px);
}

#edp .edp-detail-critere {
    display: block;
    margin: 4px 0;
}

#edp .edp-detail-critere .edp-detail-badge {
    margin-right: 0;
}

#edp .edp-detail-criteres {
    width: 100%;
}

#edp .edp-detail-document-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

#edp .edp-detail-document-hint {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 0.85rem;
}

#edp .edp-name-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

#edp .edp-name-primary {
    font-size: 0.98rem;
    font-weight: 400;
    color: var(--secondary-color, #963f64);
}

#edp .edp-name-label {
    color: var(--secondary-color, #963f64);
    font-weight: 400;
    text-decoration: none;
}

#edp .edp-name-description {
    color: #111827;
    font-size: 0.85rem;
    line-height: 1.45;
    word-break: break-word;
}

#edp .edp-grid .edp-card {
    flex-direction: row;
    align-items: stretch;
    gap: 16px;
}

#edp .edp-card-media {
    flex: 0 0 132px;
    max-width: 148px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(241,245,249,0.9) 0%, rgba(226,232,240,0.85) 100%);
    aspect-ratio: 3 / 4;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
}

#edp .edp-card-media-link {
    display: block;
    width: 100%;
    height: 100%;
}

#edp .edp-card-thumb-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
}

#edp .edp-card-thumb-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    font-size: 0.78rem;
    line-height: 1.3;
    color: #64748b;
}

#edp .edp-card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

#edp .edp-card-body .edp-card-field {
    gap: 8px;
}

#edp .edp-card-actions {
    margin-top: auto;
}

#edp .edp-card-actions .edp-action-buttons {
    margin-top: 8px;
}

#edp .edp-delete-btn {
    margin-right: auto;
}

#edp .edp-delete-btn[hidden] {
    display: none !important;
}

body.edp-mobile-scroll-lock {
    overflow: hidden;
}

#edp #toggle-filters {
    display: none;
}

#edp .edp-mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 98;
    display: none;
}

#edp .edp-mobile-backdrop:not([hidden]) {
    display: block;
}

#edp[data-device="mobile"] .toolbar {
    flex-wrap: wrap;
    gap: 10px;
}

#edp[data-device="mobile"] #toggle-view {
    display: none;
}

#edp[data-device="mobile"] #toggle-filters {
    display: inline-flex;
}

#edp[data-device="mobile"] .filters-section {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 88vw);
    max-width: 100vw;
    margin: 0;
    padding: 24px 20px;
    border-radius: 0;
    background: #ffffff;
    box-shadow: -24px 0 48px rgba(15, 23, 42, 0.16);
    overflow-y: auto;
    transform: translateX(104%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s ease, opacity 0.28s ease;
    z-index: 99;
}

#edp[data-device="mobile"][data-filters-open="1"] .filters-section {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

#edp[data-device="mobile"] .filters-section .filter-row {
    flex-direction: column;
    gap: 16px;
}

#edp[data-device="mobile"] .filters-section .filter-group {
    width: 100%;
}

#edp[data-device="mobile"] .filters-section .filter-actions {
    justify-content: flex-end;
    margin-top: 12px;
}

#edp[data-device="mobile"] .filters-section details {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 14px;
    margin-bottom: 12px;
}

#edp[data-device="mobile"] .filters-section details:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

#edp[data-device="mobile"] .filters-section summary {
    font-size: 1rem;
    font-weight: 600;
}

#edp[data-device="mobile"] .filters-section .checkbox-list {
    max-height: none;
}

#edp[data-device="mobile"] .filters-section .filter-body {
    flex-direction: column;
    gap: 18px;
}

@media (max-width: 640px) {
    #edp .edp-grid .edp-card {
        flex-direction: column;
    }

    #edp .edp-card-media {
        width: 100%;
        max-width: none;
        aspect-ratio: 16 / 9;
    }

    #edp .edp-card-actions {
        margin-top: 12px;
    }
}

@media (max-width: 719px) {
    #edp .edp-detail-body {
        grid-template-columns: minmax(0, 1fr);
    }
}
#documents-table th.col-statut,
#documents-table th.col-type,
#documents-table th.col-action,
#documents-table td.col-statut,
#documents-table td.col-type,
#documents-table td.col-action {
  white-space: nowrap;
}
#documents-table tbody tr:hover { background:#f9fbff; }
#documents-table tbody tr:nth-child(even) { background:#fcfdff; }
.login-form input, .forgot-password-form input,
#parametres-form input, #parametres-form select, #parametres-form textarea {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 0.95rem;
    transition: border-color .2s, box-shadow .2s;
}
.login-form input:focus, .forgot-password-form input:focus,
#parametres-form input:focus, #parametres-form select:focus, #parametres-form textarea:focus {
  outline: none; border-color: var(--primary-color, #2797d6);
  box-shadow: 0 0 0 3px var(--primary-focus-ring, rgba(39, 151, 214, 0.18));
}

.ref-filters {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#ref-filter-card {
    padding: 24px 28px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(241,245,249,0.75) 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 28px 48px rgba(15, 23, 42, 0.12);
}

.ref-filters__primary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ref-filters__secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.ref-filters__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
    letter-spacing: 0.015em;
}

.ref-filters__label--inline {
    white-space: nowrap;
}

.ref-filters__search-field {
    position: relative;
    display: flex;
    align-items: center;
}

.ref-filters__search-input {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 12px 16px 12px 44px;
    font-size: 1rem;
    background: rgba(255,255,255,0.85);
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ref-filters__search-input:focus {
    outline: none;
    border-color: var(--primary-color, #2797d6);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb, 39, 151, 214), 0.22);
}

.ref-filters__search-icon {
    position: absolute;
    inset-inline-start: 16px;
    color: var(--primary-color, #2797d6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.ref-filters__search-icon svg {
    width: 100%;
    height: 100%;
}

.ref-filters__sort {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 18px;
    background: rgba(226, 232, 240, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

.ref-filters__sort-buttons {
    display: inline-flex;
    gap: 8px;
}

.ref-sort-toggle {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #ffffff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ref-sort-toggle svg {
    width: 18px;
    height: 18px;
}

.ref-sort-toggle:hover,
.ref-sort-toggle:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
    outline: none;
    border-color: rgba(var(--primary-color-rgb, 39, 151, 214), 0.55);
}

.ref-sort-toggle.is-active {
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb, 39, 151, 214), 0.95), rgba(37, 99, 235, 0.85));
    border-color: transparent;
    color: var(--on-primary-color, #ffffff);
    box-shadow: 0 18px 32px rgba(var(--primary-color-rgb, 39, 151, 214), 0.35);
}

.ref-filters__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.ref-filters__pill {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    appearance: none;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ref-filters__pill:focus {
    outline: none;
    border-color: var(--primary-color, #2797d6);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb, 39, 151, 214), 0.18);
}

.ref-filters__actions {
    display: flex;
    align-items: flex-end;
}

.ref-filters__reset {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.85), rgba(255, 255, 255, 0.95));
    color: var(--primary-color, #2797d6);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    transition: transform 0.2s ease, box-shadow 0.2s ease, rotate 0.2s ease;
}

.ref-filters__reset:hover,
.ref-filters__reset:focus-visible {
    outline: none;
    transform: translateY(-1px) rotate(-6deg);
    box-shadow: 0 16px 32px rgba(var(--primary-color-rgb, 39, 151, 214), 0.28);
}

.ref-filters__reset svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 960px) {
    #ref-filter-card {
        padding: 20px 22px;
    }
    .ref-filters__secondary {
        gap: 14px;
    }
    .ref-filters__field {
        min-width: min(220px, 100%);
        flex: 1 1 180px;
    }
}

@media (max-width: 640px) {
    .ref-filters__secondary {
        flex-direction: column;
        align-items: stretch;
    }
    .ref-filters__sort {
        justify-content: space-between;
    }
    .ref-filters__actions {
        justify-content: flex-end;
    }
    .ref-filters__reset {
        align-self: flex-end;
    }
}

.ref-table-card {
    padding: 0;
    overflow: hidden;
}

.ref-table-scroll {
    overflow: auto;
    max-height: min(70vh, 720px);
}

.ref-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 760px;
}

.ref-table__caption {
    text-align: left;
    padding: 14px 18px;
    font-weight: 600;
    color: var(--secondary-color, #963f64);
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.ref-table__head th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.ref-table__header {
    text-align: left;
    padding: 12px 16px;
    background: var(--primary-color, #2797d6);
    color: var(--on-primary-color, #ffffff);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
    white-space: nowrap;
}

.ref-table__header--num {
    width: 80px;
}

.ref-table__header--actions {
    width: 180px;
    text-align: right;
}

.ref-table__body tr:nth-child(odd) {
    background: #f8fafc;
}

.ref-table__row:hover {
    background: rgba(39, 151, 214, 0.08);
}

.ref-table__cell {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
    font-size: 0.95rem;
    color: #1f2937;
}

.ref-table__cell--num {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.ref-table__cell--title {
    font-weight: 600;
}

.ref-table__cell--actions {
    text-align: right;
    white-space: nowrap;
}

.ref-table__cell--loading,
.ref-table__cell--empty {
    text-align: center;
    padding: 24px 16px;
}

.ref-table__cell--empty {
    background: #f1f5f9;
    border-radius: 0 0 4px 4px;
}

.ref-table__cell--actions .btn-ghost {
    margin-left: 6px;
}

.ref-table__cell--actions .btn-ghost:first-child {
    margin-left: 0;
}

.ref-table__body button.btn-ghost {
    font-weight: 600;
}

.ref-table-scroll::-webkit-scrollbar {
    height: 8px;
}

.ref-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.2);
    border-radius: 999px;
}

.ref-table-scroll::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.2);
}

/* Boutons principaux */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary-color, #2797d6);
  color: var(--on-primary-color, #ffffff);
  border: 1px solid var(--primary-color, #2797d6);
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
}

.btn:hover,
.btn:focus {
  background: var(--primary-hover, #1f7bb0);
  border-color: var(--primary-hover, #1f7bb0);
  color: var(--on-primary-color, #ffffff);
}

.btn:focus {
  box-shadow: 0 0 0 3px var(--primary-focus-ring, rgba(39, 151, 214, 0.18));
  outline: none;
}

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

.btn-secondary {
  background: var(--secondary-color, #963f64);
  border-color: var(--secondary-color, #963f64);
  color: var(--on-secondary-color, #ffffff);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--secondary-hover, #7b324f);
  border-color: var(--secondary-hover, #7b324f);
  color: var(--on-secondary-color, #ffffff);
}

.btn-secondary:focus {
     box-shadow: 0 0 0 3px rgba(var(--secondary-color-rgb, 150, 63, 100), 0.18);
  outline: none;
}

/* Boutons fantôme */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--primary-color, #2797d6);
  color: var(--primary-color, #2797d6);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn-ghost:hover,
.btn-ghost:focus {
  background: rgba(var(--primary-color-rgb, 39, 151, 214), 0.06);
  border-color: var(--primary-hover, #1f7bb0);
  color: var(--primary-hover, #1f7bb0);
  outline: none;
}
.btn-ghost:focus {
  box-shadow: 0 0  0 0 3px var(--primary-focus-ring, rgba(39, 151, 214, 0.18));
}

.btn-small {
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.2;
}

.hidden {
  display: none !important;
}

.muted {
  color: #64748b;
  font-size: 0.9em;
}


/* Dark mode support removed to keep a consistent light theme */

#edp .toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin: 12px 0;
}

#edp .toolbar .btn {
    background: var(--primary-color, #2797d6);
    color: var(--on-primary-color, #ffffff);
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

#edp .toolbar .btn:hover {
    background: var(--primary-hover, #1f7bb0);
    color: var(--on-primary-color, #ffffff);
}

#edp .modal .input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

#edp .modal .checkbox-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
}

#edp .modal .checkbox-list .checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    color: #111827;
    width: 100%;
}

#edp .modal .checkbox-list input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

#edp .modal .critere-multiselect,
#pac .modal .critere-multiselect {
    position: relative;
}

#edp .modal .critere-select-display,
#pac .modal .critere-select-display {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#edp .modal .critere-select-display:focus,
#pac .modal .critere-select-display:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

#edp .modal .critere-select-display[data-placeholder="1"],
#pac .modal .critere-select-display[data-placeholder="1"] {
    color: #6b7280;
}

#edp .modal .critere-multiselect.is-open .critere-select-display,
#pac .modal .critere-multiselect.is-open .critere-select-display {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

#edp .modal .critere-select-dropdown,
#pac .modal .critere-select-dropdown {
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    right: 0;
    z-index: 60;
    border: 1px solid #d1d5db;
    border-top: none;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.15);
}

#edp .modal .critere-select-dropdown[hidden],
#pac .modal .critere-select-dropdown[hidden] {
    display: none;
}

#edp .modal .critere-select-dropdown .checkbox-list,
#pac .modal .critere-select-dropdown .checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 260px;
    overflow-y: auto;
    padding: 8px;
    border: none;
    border-radius: 0;
    background: transparent;
}

#edp .modal .critere-select-dropdown .checkbox-item,
#pac .modal .critere-select-dropdown .checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    line-height: 1.35;
    color: #111827;
}

#edp .modal .critere-select-dropdown .checkbox-item input[type="checkbox"],
#pac .modal .critere-select-dropdown .checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

#pac .pac-action-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#pac .pac-action-link {
  color: var(--secondary-color, #963f64);
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#pac .pac-action-link:hover,
#pac .pac-action-link:focus {
  color: #0f172a;
}

#pac .pac-action-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#pac .pac-action-origin {
  color: #111827;
  font-size: 0.85rem;
}

#pac .pac-action-description {
  font-size: 0.95rem;
  color: #111827;
}

#pac .pac-critere-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

#pac .pac-critere-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 10px;
    margin: 2px 4px 2px 0;
    border-radius: 999px;
    background: var(--pac-critere-bg, var(--secondary-color, #f97316));
    color: var(--pac-critere-fg, var(--on-secondary-color, #ffffff));
    font-weight: 600;
    font-size: 0.78rem;
    line-height: 1;
    white-space: nowrap;
}

#edp .modal .critere-chip,
#pac .modal .critere-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e5e7eb;
    font-size: 12px;
    line-height: 1.3;
    color: #1f2937;
}

#edp .modal .modal-content,
#edp .modal .modal-content input,
#edp .modal .modal-content textarea,
#edp .modal .modal-content select,
#edp .modal .modal-content button {
    font-family: 'Arial', sans-serif;
}

#edp .modal .modal-close {
    position: sticky;
    top: 16px;
    margin: -8px -8px 16px auto;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.15);
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-close-icon {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 2px solid currentColor;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.modal-close-icon::before,
.modal-close-icon::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.modal-close-icon::before {
    transform: rotate(45deg);
}

.modal-close-icon::after {
    transform: rotate(-45deg);
}

#edp .modal .modal-close:hover,
#edp .modal .modal-close:focus {
    background: var(--primary-color, #1d4ed8);
    border-color: var(--primary-color, #1d4ed8);
    color: var(--on-primary-color, #ffffff);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-focus-ring, rgba(29, 78, 216, 0.18));
}

.modal .modal-close.modal-close--leading {
    margin: -8px auto 16px -8px;
    align-self: flex-start;
}

#edp .modal .modal-close.modal-close--leading {
    margin: -8px auto 16px -8px;
}

#edp #edit-document-modal .modal-content {
    padding-top: 64px;
}

#edp #edit-document-modal .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 14px;
    background: rgba(var(--secondary-color-rgb, 150, 63, 100), 0.12);
    color: var(--secondary-color, #963f64);
    box-shadow: none;
}

#edp #edit-document-modal .modal-close:hover,
#edp #edit-document-modal .modal-close:focus {
    background: var(--secondary-color, #963f64);
    color: var(--on-secondary-color, #ffffff);
    box-shadow: 0 12px 24px rgba(var(--secondary-color-rgb, 150, 63, 100), 0.25);
}

#edp #edit-document-modal .modal-close__glyph {
    display: block;
    pointer-events: none;
    font-size: 2rem;
    line-height: 1;
    font-weight: 700;
    transform: translateY(-2px);
}

#edp .modal .input-group label {
    font-weight: 600;
    color: #374151;
}

#edp .modal input[type="text"],
#edp .modal input[type="date"],
#edp .modal textarea,
#edp .modal select {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

#edp .modal textarea {
    resize: vertical;
}

#edp .strict-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
}

#edp .strict-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#edp .edp-action-buttons {
    display: inline-flex;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

#edp .edp-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
    text-decoration: none;
    color: inherit;
}

#edp .edp-action-btn:hover,
#edp .edp-action-btn:focus {
    background: #e5e7eb;
    border-color: #9ca3af;
}

#edp .table-wrapper-edp .edp-action-btn {
    background: var(--primary-color, #2797d6);
    border-color: var(--primary-color, #2797d6);
    color: var(--on-primary-color, #ffffff);
}

#edp .table-wrapper-edp .edp-action-btn:hover,
#edp .table-wrapper-edp .edp-action-btn:focus {
    background: var(--primary-hover, #1f7bb0);
    border-color: var(--primary-hover, #1f7bb0);
    color: var(--on-primary-color, #ffffff);
}

#edp .edp-preview[hidden] {
    display: none;
}

#edp .edp-preview {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

#edp .edp-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
}

#edp .edp-preview-panel {
    position: relative;
    width: min(920px, 100%);
    max-width: 100%;
    height: min(90vh, 760px);
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#edp .edp-preview-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
}

#edp .edp-preview-close:hover,
#edp .edp-preview-close:focus {
    color: #111827;
}

#edp .edp-preview-meta {
    margin: 8px 0 16px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
}

#edp .edp-preview-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

#edp .edp-preview-body {
    position: relative;
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
}

#edp .edp-preview-body iframe {
    flex: 1;
    border: none;
    background: #ffffff;
}

#edp .edp-preview-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.7);
}

#edp .edp-preview-empty[hidden],
#edp .edp-detail-preview-empty[hidden] {
    display: none !important;
}

#parametres .utilisateurs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

@media (min-width: 1100px) {
  #parametres .utilisateurs-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

#parametres .utilisateurs-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#parametres .utilisateurs-section__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

#parametres .utilisateurs-section__header h3 {
  margin: 0;
}

#parametres .utilisateurs-section__header p {
  margin: 0;
}

#parametres .utilisateurs-search input {
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  min-width: 200px;
  background: #fff;
}

#parametres .utilisateurs-section .table-wrapper {
  overflow-x: auto;
}

#parametres .utilisateurs-section table {
  width: 100%;
  border-collapse: collapse;
}

#parametres .utilisateurs-section thead {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

#parametres .utilisateurs-section th,
#parametres .utilisateurs-section td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  text-align: left;
}

#parametres .utilisateurs-section tbody tr:hover {
  background: rgba(39, 151, 214, 0.06);
}

#parametres .utilisateurs-section .actions-col {
  width: auto;
  min-width: 150px;
  text-align: right;
  white-space: nowrap;
}

#parametres .utilisateurs-section td.actions-col {
  text-align: right;
  white-space: nowrap;
}

#parametres .utilisateurs-section .user-link {
  color: var(--primary-color, #2797d6);
  text-decoration: none;
  font-weight: 600;
}

#parametres .utilisateurs-section .user-link:hover,
#parametres .utilisateurs-section .user-link:focus {
  text-decoration: underline;
  color: var(--primary-hover, #1f7bb0);
}

#parametres .utilisateurs-section .liste-placeholder {
  padding: 16px;
  text-align: center;
}

#parametres .utilisateurs-section td.actions-col button {
  margin-left: 4px;
  white-space: nowrap;
}

#parametres .utilisateurs-table th.roles-col,
#parametres .utilisateurs-table td.roles-col {
  width: clamp(220px, 32%, 360px);
}

#parametres .utilisateurs-table td.roles-col {
  max-width: 360px;
}

#parametres .reset-password-result-details {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

#parametres .reset-password-result-details__item dt {
  font-weight: 600;
  color: var(--text-color, #0f172a);
}

#parametres .reset-password-result-details__item dd {
  margin: 4px 0 0;
  color: var(--muted-text-color, #475569);
}

#parametres .reset-password-result-password {
  margin-top: 8px;
}

#parametres .reset-password-result-password__label {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--text-color, #0f172a);
}

#parametres .temporary-password-display {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

#parametres .temporary-password {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-color, #0f172a);
  font-family: 'Fira Mono', 'Courier New', monospace;
  font-size: 1.15em;
  letter-spacing: 0.08em;
  word-break: break-all;
}

#parametres .temporary-password-note {
  margin: 12px 0 0;
}

#parametres .copy-feedback {
  min-height: 1.2em;
  margin-top: 8px;
  transition: opacity 0.2s ease;
}

#parametres .copy-feedback--success {
  color: #0f766e;
}

#parametres .copy-feedback--error {
  color: #b91c1c;
}

#parametres .roles-table tr.is-selected {
  background: rgba(39, 151, 214, 0.08);
}

#parametres .roles-table select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #e5e7eb);
}

#parametres .roles-table button {
  margin-right: 4px;
}

#parametres .roles-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

#parametres .roles-cell .assign-role-btn {
  margin-top: 6px;
}

#parametres .role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(39, 151, 214, 0.12);
  color: var(--primary-color, #2797d6);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.85em;
}

#parametres .role-chip--system {
  background: rgba(100, 116, 139, 0.2);
  color: #475569;
}

#parametres .role-chip__remove {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 0.9em;
  padding: 0 2px;
  line-height: 1;
}

#parametres .role-permissions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 48px;
}

#parametres .role-permission-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  gap: 12px;
  flex-wrap: wrap;
}

#parametres .role-permission-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#parametres .role-permission-label {
  font-weight: 600;
  color: #1f2937;
}

#parametres .roles-permissions-matrix-table {
    width: 100%;
    border-collapse: collapse;
}

#parametres .roles-permissions-matrix-table th,
#parametres .roles-permissions-matrix-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    vertical-align: top;
}

#parametres .roles-permissions-matrix-page-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    list-style: disc;
}

#parametres .roles-permissions-matrix-page-list li {
    margin: 0;
    color: #1f2937;
    font-weight: 600;
}

#parametres .roles-permissions-matrix-action {
    display: flex;
    flex-direction: row;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

#parametres .roles-permissions-matrix-action strong {
    color: #1f2937;
}

#parametres .roles-permissions-matrix-action span {
    color: #475569;
}

#parametres .roles-permissions-matrix-action--secondary strong {
    color: #0f172a;
}

#parametres .role-permission-code {
  font-family: 'Fira Code', 'SFMono-Regular', 'Consolas', monospace;
  font-size: 0.75em;
  color: #64748b;
}

#parametres .role-permission-remove {
  border: none;
  background: transparent;
  color: #dc2626;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  align-self: center;
}

#parametres .role-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(30, 64, 175, 0.12);
  color: #1e3a8a;
  margin-left: 6px;
}

#parametres .user-permissions-list__items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

#parametres .user-permissions-list__items li {
  background: rgba(148, 163, 184, 0.15);
  padding: 8px 12px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.95em;
  color: #1f2937;
}

#parametres .user-permission-label {
  font-weight: 600;
}

#parametres .user-permission-code {
  font-family: 'Fira Code', 'SFMono-Regular', 'Consolas', monospace;
  font-size: 0.75em;
  color: #64748b;
}

#parametres .utilisateurs-section--denied {
  text-align: center;
  padding: 32px;
}

#parametres .utilisateurs-section--denied p {
  margin: 0;
}

#parametres .responsables-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

#parametres .responsables-info h3 {
  margin: 0 0 4px 0;
}

#parametres .responsables-info p {
  margin: 0;
}

#parametres .responsables-liste {
  margin-bottom: 24px;
  overflow-x: auto;
}

#parametres .responsables-liste table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#parametres .responsables-liste thead {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

#parametres .responsables-liste th,
#parametres .responsables-liste td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  text-align: left;
  vertical-align: middle;
}

#parametres .responsables-liste td {
  word-break: break-word;
  overflow-wrap: anywhere;
}

#parametres .responsables-liste tbody tr:hover {
  background: rgba(39, 151, 214, 0.06);
}

#parametres .responsables-liste .responsable-link {
  appearance: none;
  background: none;
  border: none;
  display: inline;
  color: var(--primary-color, #2797d6);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: none;
}

#parametres .responsables-liste .responsable-link:hover,
#parametres .responsables-liste .responsable-link:focus {
  text-decoration: underline;
}

#parametres .responsables-liste .responsable-link:focus-visible {
  outline: 2px solid rgba(39, 151, 214, 0.35);
  outline-offset: 2px;
  border-radius: 4px;
#parametres .responsables-liste .actions-col {
  width: 150px;
  text-align: right;
  white-space: nowrap;
}

#parametres .responsables-liste .liste-placeholder {
  padding: 16px;
  text-align: center;
}

#parametres .responsable-form-wrapper {
  padding: 24px;
}

#parametres .utilisateur-form-wrapper {
  padding: 24px;
}

#parametres .utilisateur-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

#parametres .utilisateur-form-header h3 {
  margin: 0;
}

#parametres .utilisateur-form .form-actions {
  justify-content: space-between;
  align-items: center;
}

#parametres .utilisateur-form .form-actions-buttons {
  display: flex;
  gap: 12px;
}

#parametres .utilisateur-form #btn-supprimer-utilisateur {
    margin-right: auto;
    color: #b91c1c;
}

#parametres .utilisateur-form #btn-supprimer-utilisateur[hidden] {
    display: none;
}

#parametres #utilisateur-toast {
  min-height: 20px;
}

#parametres #utilisateur-toast.error {
  color: #b91c1c;
}

#parametres #utilisateur-toast.success {
  color: #047857;
}

#parametres .responsable-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

#parametres .responsable-form-header h3 {
  margin: 0;
}

#parametres .responsable-form .form-actions {
  justify-content: space-between;
  align-items: center;
}

#parametres .responsable-form .form-actions-buttons {
  display: flex;
  gap: 12px;
}

#parametres #responsable-toast {
  min-height: 20px;
}

#parametres #responsable-toast.error {
  color: #b91c1c;
}

#parametres #responsable-toast.success {
  color: #047857;
}

.page-title__label {
    display: inline-block;
}

.page-title__icon {
    --icon-size: clamp(28px, 3vw, 36px);
    width: var(--icon-size);
    height: var(--icon-size);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background-color: var(--primary-color, #2797d6);
    position: relative;
    overflow: hidden;
}

.page-title__icon::after {
    content: '';
    display: block;
    width: 70%;
    height: 70%;
    background-image: var(--icon-url);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color, #edf1f5);
    color: #0f172a;
    --sidebar-expanded-width: 250px;
    --sidebar-collapsed-width: 88px;
    --sidebar-hidden-width: 0px;
    --sidebar-gap: 40px;
    --sidebar-right-margin: 60px;
    --sidebar-current-width: var(--sidebar-expanded-width);
    --sidebar-transition-duration: 0.25s;
    --sidebar-offset-top: 72px;
}

body.sidebar-collapsible {
    --sidebar-current-width: var(--sidebar-hidden-width);
}

body.sidebar-collapsible.sidebar-visible {
    --sidebar-current-width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsible.sidebar-visible.sidebar-expanded {
    --sidebar-current-width: var(--sidebar-expanded-width);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background-color: var(--header-bg, #ffffff);
    border-bottom: 1px solid var(--header-border, #e2e8f0);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    color: var(--header-color, #0f172a);
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-left img { max-height: 40px; }
.header-right {
    display: flex; align-items: center; gap: 10px; margin-right: 20px;
    position: relative; /* pour ancrer le logo structure en position:absolute */
}
.burger-button {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-right: 6px;
    border: 1px solid rgba(15,23,42,0.15);
    border-radius: 10px;
    background: var(--surface-color, #ffffff);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.burger-button:focus-visible {
    outline: 2px solid var(--primary-color, #2797d6);
    outline-offset: 2px;
}
.burger-button:hover {
    background: rgba(39,151,214,0.08);
}
.burger-icon {
    position: relative;
    width: 20px;
    height: 16px;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
}
.burger-bar {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 2px;
    background: var(--primary-color, #2797d6);
    transition: transform 0.3s ease, opacity 0.3s ease;
}
body.sidebar-open .burger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.sidebar-open .burger-bar:nth-child(2) { opacity: 0; }
body.sidebar-open .burger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 890;
}

.sidebar-backdrop[hidden] {
    display: none;
}

/* 👉 Entête : Titre / Nom structure / Nom utilisateur */
.header h1,
.header .site-title,
.header .structure-name,
#user-name,
.header .user-name {
    color: var(--primary-color, #2797d6) !important;
}

/* Styles spécifiques Label/Milo + structure */
.label-bold { font-weight: bold; }
.milo { font-weight: normal; }
/* Nom de structure : non gras + 1/3 plus petit */
#structure-name {
    font-weight: normal !important;
    font-size: 0.67em; /* ≈ -33% */
    margin-left: 6px;
}
/* Ajout d’un séparateur fin automatiquement si non vide */
#structure-name:not(:empty)::before {
    content: "–";
    margin: 0 6px;
    font-size: 0.8em;
    opacity: 0.7;
    font-weight: normal;
}

/* === Overrides logo structure (prend le dessus) === */
/* Nom utilisateur à gauche du logo */
.user-name{
  font-weight: 600;
  opacity: .85;
  white-space: nowrap;
}
.user-name.hidden{ display:none; }

/* Logo structure : plus grand, mais reste dans la hauteur du header */
#structure-logo {
  max-height: clamp(52px, 6vw, 62px);
  width: auto;
  object-fit: contain;
  display: inline-block; /* on évite position:absolute */
  margin-left: 4px;
  vertical-align: middle;
}

#structure-logo.visible {
  display: inline-block;  /* rendu visible par le JS */
}

@media (max-width: 1024px) {
  #structure-logo {
    max-height: 48px;
  }
}

@media (max-width: 640px) {
  #structure-logo {
    max-height: 38px;
  }
}


/* === Tables responsive === */
:where(table) {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: auto;
}

:where(th, td) {
    padding: 0.75rem;
    vertical-align: top;
    text-align: left;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
}

:where(th, td) > * {
    max-width: 100%;
}

:where(thead th) {
    background-color: #f1f5f9;
    font-weight: 600;
}

:where(tr:nth-child(even)) {
    background-color: #f8fafc;
}

:where(caption) {
    caption-side: bottom;
    padding-top: 0.5rem;
    font-size: 0.9rem;
    color: #475569;
    text-align: left;
}

/* === Tableau de bord === */
#dashboard .dashboard-tabs {
    margin-top: clamp(16px, 3vw, 32px);
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    background: rgba(15, 23, 42, 0.04);
    border-radius: 999px;
}

.dashboard-tab {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    background: transparent;
    cursor: pointer;
    transition: background-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
    position: relative;
}

.dashboard-tab::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 10px 25px -20px rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 180ms ease;
}

.dashboard-tab:is(:hover, :focus-visible) {
    background: rgba(39, 151, 214, 0.08);
    outline: none;
}

.dashboard-tab:focus-visible {
    box-shadow: 0 0 0 3px rgba(39, 151, 214, 0.35);
}

.dashboard-tab.is-active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 18px 35px -20px rgba(15, 23, 42, 0.35);
}

.dashboard-tab.is-active::after {
    opacity: 1;
}

#dashboard .dashboard-panels {
    margin-top: clamp(18px, 3vw, 28px);
}

.dashboard-card {
    background: #ffffff;
    border-radius: 18px;
    padding: clamp(18px, 3vw, 28px);
    box-shadow: 0 18px 35px -20px rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 2vw, 24px);
    position: relative;
}

#dashboard .dashboard-panel {
    display: none;
}

#dashboard .dashboard-panel.is-active {
    display: flex;
}

.dashboard-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.dashboard-card__header h3 {
    margin: 0;
    font-size: clamp(1.1rem, 1.6vw, 1.35rem);
    color: #0f172a;
}

.dashboard-card__header .muted {
    margin: 4px 0 0 0;
    font-size: 0.9rem;
}

.dashboard-card__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.dashboard-inline-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: #475569;
}

.dashboard-inline-label > span {
    font-weight: 600;
}

.dashboard-card__actions .input {
    min-width: 160px;
}

.dashboard-card__body {
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 2vw, 20px);
}

.dashboard-card__summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.92rem;
    color: #475569;
}

.dashboard-card__summary strong {
    color: var(--primary-color, #2797d6);
}

.dashboard-card__sub {
    font-size: 0.85rem;
    color: #64748b;
}

.pac-progress {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pac-progress__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    font-size: 0.9rem;
    color: #1e293b;
}

.pac-progress__label {
    font-weight: 600;
}

.pac-progress__bar {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background-color: #e2e8f0;
    overflow: hidden;
}

.pac-progress__fill {
    position: absolute;
    inset: 0;
    width: 0;
    border-radius: inherit;
    transition: width 260ms ease;
}

.pac-progress__fill.is-done {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.pac-progress__fill.is-progress {
    background: linear-gradient(90deg, #38bdf8, #0ea5e9);
}

.pac-progress__fill.is-todo {
    background: linear-gradient(90deg, #fbbf24, #f97316);
}

.pac-progress__value {
    font-variant-numeric: tabular-nums;
    color: #475569;
}

.pac-chart {
    min-height: 220px;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top, rgba(148, 163, 184, 0.15), transparent 60%);
    border-radius: 18px;
    padding: 20px;
    position: relative;
}

.pac-chart::before {
    content: '';
    display: block;
    width: clamp(140px, 40vw, 220px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: conic-gradient(
        rgba(34, 197, 94, 0.85) 0deg 120deg,
        rgba(14, 165, 233, 0.85) 120deg 260deg,
        rgba(249, 115, 22, 0.85) 260deg 360deg
    );
    mask: radial-gradient(circle 45% at center, transparent 0 65%, black 65% 100%);
    box-shadow: 0 18px 35px -24px rgba(15, 23, 42, 0.5);
}

.pac-chart > p {
    position: absolute;
    inset: auto;
    max-width: 240px;
    text-align: center;
}

.dashboard-card__sub ul {
    margin: 6px 0 0;
    padding-left: 20px;
}

.dashboard-card__sub li {
    margin: 4px 0;
}

.dashboard-edp-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dashboard-edp-row {
    display: grid;
    grid-template-columns: minmax(200px, 30%) 1fr;
    gap: 16px;
    align-items: center;
    padding: 6px 10px;
    border-radius: 14px;
    box-sizing: border-box;
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

.dashboard-edp-row[data-edp-critere] {
    cursor: pointer;
}

.dashboard-edp-row[data-edp-critere]:hover {
    background: rgba(148, 163, 184, 0.12);
}

.dashboard-edp-row[data-edp-critere]:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.45);
    outline-offset: 4px;
    background: rgba(148, 163, 184, 0.16);
}

.dashboard-edp-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: #475569;
}

.dashboard-edp-critere {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #0f172a;
    font-weight: 600;
    line-height: 1.3;
}

.dashboard-edp-critere-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--dashboard-critere-bg, var(--secondary-color, #f97316));
    color: var(--dashboard-critere-fg, var(--on-secondary-color, #ffffff));
    font-weight: 600;
    font-size: 0.78rem;
    line-height: 1;
    white-space: nowrap;
}

.dashboard-edp-critere-text {
    display: inline-flex;
    align-items: center;
    line-height: 1.35;
}

.dashboard-edp-bar {
    display: inline-flex;
    align-items: stretch;
    justify-self: start;
    gap: 6px;
    padding: 6px;
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: none;
    min-height: 0;
    width: max-content;
    max-width: 100%;
    flex-wrap: wrap;
}

.dashboard-edp-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
    padding: 0 16px;
    gap: 6px;
    min-width: clamp(92px, calc(var(--segment-count, 1) * 12px), 320px);
    max-width: 360px;
    position: relative;
    text-align: center;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 0 0 auto;
    border-radius: 14px;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    animation: edpSegmentFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
    animation-delay: calc(var(--segment-index, 0) * 0.06s);
}

@keyframes edpSegmentFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dashboard-edp-segment span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.dashboard-edp-segment small {
    font-size: 0.72rem;
    opacity: 0.92;
    font-weight: 700;
}

.dashboard-edp-segment--compact span {
    font-size: 0;
}

.dashboard-edp-segment--compact span::after {
    content: attr(data-count);
    font-size: 0.7rem;
    font-weight: 700;
}

.dashboard-edp-segment:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 16px -4px rgba(15, 23, 42, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    filter: brightness(1.08);
}

.dashboard-edp-segment:active {
    transform: translateY(0) scale(1.01);
    transition-duration: 0.1s;
}

.dashboard-legend {
    margin-top: 4px;
}

.dashboard-legend-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dashboard-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    font-size: 0.82rem;
    color: #475569;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    animation: legendItemFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) backwards;
    animation-delay: calc(var(--legend-index, 0) * 0.06s);
}

@keyframes legendItemFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dashboard-legend-item:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-color: rgba(148, 163, 184, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dashboard-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--legend-color, #64748b);
    box-shadow: 0 0 0 2px #ffffff, 
                0 2px 4px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-legend-item:hover .dashboard-legend-dot {
    transform: scale(1.2);
}

.dashboard-legend-count {
    font-weight: 600;
    color: #0f172a;
    padding: 2px 6px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 0.25rem;
    transition: background 0.2s ease;
}

.dashboard-legend-item:hover .dashboard-legend-count {
    background: rgba(59, 130, 246, 0.14);
}

[data-pac-legend] .dashboard-legend-list {
    flex-wrap: nowrap;
    gap: 16px;
    overflow-x: auto;
}

[data-pac-legend] .dashboard-legend-item {
    background: transparent;
    padding: 0;
}

[data-pac-legend] .dashboard-legend-dot {
    box-shadow: none;
}

@media (max-width: 768px) {
    [data-pac-legend] .dashboard-legend-list {
        flex-wrap: wrap;
    }
}

/* === GANTT CHART === */
#dashboard-panel-taches .dashboard-card__body {
    --gantt-col-action: minmax(320px, 34%);
    --gantt-col-referent: minmax(180px, 200px);
    --gantt-col-dates: minmax(180px, 200px);
}

.gantt-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 12px;
}

.gantt-summary-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gantt-summary-color, #475569);
}

.gantt-summary-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gantt-summary-color, #475569);
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

.gantt-summary-count {
    font-weight: 700;
}

.gantt-summary-separator {
    display: inline-flex;
    align-items: center;
    color: #94a3b8;
    font-weight: 400;
}

.gantt-columns {
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    margin-bottom: 4px;
}

.gantt-layout {
    display: grid;
    grid-template-columns: var(--gantt-col-action) var(--gantt-col-referent) var(--gantt-col-dates) 1fr;
    column-gap: 16px;
}

.gantt-column-label:last-child {
    text-align: center;
}

.gantt-scale-wrapper {
    align-items: end;
    margin-bottom: 12px;
}

.gantt-scale-placeholder {
    min-height: 1px;
}

.gantt-scale {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid !important;
    grid-template-columns: repeat(12, 1fr) !important;
    grid-auto-flow: column !important;
    gap: 0;
    padding: 12px 0;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.gantt-scale-cell {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-right: 1px solid #e2e8f0;
    text-align: center;
    min-width: 0;
}

.gantt-scale-cell:last-child {
    border-right: none;
}

.gantt-scale-cell span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-scale-today {
    position: absolute;
    top: 0;
    bottom: -18px;
    width: 2px;
    background: #ef4444;
    pointer-events: none;
    left: 0;
    transform: translateX(calc(var(--gantt-today-position, -100) * 1%));
    opacity: var(--gantt-today-opacity, 0);
    z-index: 5;
}

.gantt-scale-today span {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 6px;
    border-radius: 4px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
}

.gantt-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gantt-row {
    display: grid;
    grid-template-columns: var(--gantt-col-action) var(--gantt-col-referent) var(--gantt-col-dates) 1fr;
    column-gap: 16px;
    row-gap: 8px;
    align-items: flex-start;
    padding: 12px 0;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.gantt-row:hover {
    background: rgba(226, 232, 240, 0.4);
}

.gantt-row-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.875rem;
    color: #475569;
}

.gantt-row-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gantt-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--gantt-pill-bg, #e2e8f0);
    color: var(--gantt-pill-fg, #475569);
    border: 1px solid var(--gantt-pill-border, #cbd5e1);
}

.gantt-row-plan {
    font-size: 0.8rem;
    color: #64748b;
}

.gantt-row-plan-status {
    font-weight: 600;
    color: inherit;
}

.gantt-row-title {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2563eb;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.gantt-row-title:hover {
    text-decoration: underline;
}

.gantt-row-title:focus-visible {
    outline: 3px solid rgba(39, 151, 214, 0.45);
    outline-offset: 3px;
}

.dashboard-link {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color, #2797d6);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    cursor: pointer;
}

.dashboard-link:hover {
    color: var(--primary-hover, #1f7bb0);
}

.dashboard-link:focus-visible {
    outline: 3px solid rgba(39, 151, 214, 0.45);
    outline-offset: 2px;
}

.gantt-row-bar {
    position: relative;
    height: 48px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    overflow: visible;
}

.gantt-row-owner,
.gantt-row-schedule {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: #475569;
}

.gantt-bar {
    position: absolute;
    top: 6px;
    bottom: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gantt-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gantt-bar--compact span {
    font-size: 0;
}

.gantt-bar span {
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 960px) {
    .dashboard-edp-row,
    .gantt-row {
        grid-template-columns: 1fr;
    }

    .gantt-columns {
        display: none;
    }

    .gantt-scale-wrapper {
        display: block;
    }

    .gantt-scale-placeholder {
        display: none;
    }

    .gantt-summary {
        gap: 8px;
    }

    .gantt-row-bar {
        height: 58px;
    }
}

@media (max-width: 640px) {
    #dashboard .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card__header {
        align-items: stretch;
    }

    .dashboard-edp-bar {
        flex-wrap: wrap;
        overflow-x: visible;
    }
}



/* S’assurer que la cloche reste au-dessus et cliquable */
#notification-bell { position: relative; z-index: 1002; }

#notification-bell {
    background-color: var(--primary-color, #2797d6);
    color: var(--on-primary-color, #ffffff);
    font-size: 18px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}
#notification-bell:hover,
#notification-bell:focus {
    background-color: var(--primary-hover, #1f7bb0);
    color: var(--on-primary-color, #ffffff);
    outline: none;
}

/* Fil d'Ariane */
.breadcrumb {
    position: sticky;
    top: 72px;
    z-index: 950;
    display: flex;
    align-items: center;
    width: calc(100% - (var(--sidebar-current-width) + var(--sidebar-gap) + var(--sidebar-right-margin)));
    margin: 86px var(--sidebar-right-margin) 8px calc(var(--sidebar-current-width) + var(--sidebar-gap));
    padding: 10px 18px;
    background-color: var(--surface-color, #ffffff);
    border: 1px solid var(--surface-border-color, #e5e7eb);
    border-radius: 999px;
    box-shadow: var(--surface-shadow, 0 1px 4px rgba(15, 23, 42, 0.05));
    gap: 0.35rem;
    box-sizing: border-box;
    color: var(--secondary-color, #963f64);
    font-size: 0.85rem;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.35rem;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    color: inherit;
    font-size: 0.85rem;
    gap: 0.25rem;
}

.breadcrumb-item:not(:first-child)::before {
    content: '›';
    color: #9ca3af;
    margin: 0 0.35rem 0 0.45rem;
    font-size: 0.85em;
}

.breadcrumb-link {
    color: var(--secondary-color, #963f64);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-link:hover,
.breadcrumb-link:focus {
    text-decoration: underline;
    color: var(--secondary-hover, #7b324f);
}

.breadcrumb-text {
    color: inherit;
    font-weight: 500;
}

.breadcrumb-item[aria-current="page"] .breadcrumb-link,
.breadcrumb-item[aria-current="page"] .breadcrumb-text {
    color: var(--secondary-color, #963f64);
    font-weight: 600;
}

@media (max-width: 1024px) {
    .breadcrumb {
        position: static;
        width: auto;
        max-width: none;
        margin: 82px 20px 8px 20px;
    }
}

@media (max-width: 640px) {
    .breadcrumb {
        margin-top: 76px;
        padding: 10px 14px;
        border-radius: 14px;
    }
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-current-width);
    background-color: var(--primary-color, #2797d6);
    color: var(--on-primary-color, #ffffff);
    height: calc(100vh - var(--sidebar-offset-top));
    position: fixed;
    left: 0;
    top: var(--sidebar-offset-top);
    z-index: 900;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width var(--sidebar-transition-duration) ease, transform 0.3s ease;
}
.sidebar ul {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    flex-grow: 1;
}
.sidebar ul li a {
    text-decoration: none;
    color: var(--on-primary-color, #ffffff);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    transition: background-color 0.3s ease, padding var(--sidebar-transition-duration) ease, gap var(--sidebar-transition-duration) ease;
}
.sidebar ul li a:hover { background-color: rgba(255,255,255,0.1); }
.sidebar ul li a.active { background-color: rgba(255,255,255,0.2); font-weight: bold; }
.sidebar .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    transition: width var(--sidebar-transition-duration) ease, height var(--sidebar-transition-duration) ease, transform var(--sidebar-transition-duration) ease;
}
.sidebar .nav-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.sidebar .nav-label {
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 500;
    transition: opacity var(--sidebar-transition-duration) ease, transform var(--sidebar-transition-duration) ease, max-width var(--sidebar-transition-duration) ease;
    white-space: normal;
    line-height: 1.25;
}

body.sidebar-collapsible.sidebar-visible #menu-lateral .nav-link {
    justify-content: center;
    padding: 16px 0;
    gap: 0;
    text-align: center;
}

body.sidebar-collapsible.sidebar-visible.sidebar-expanded #menu-lateral .nav-link {
    justify-content: flex-start;
    padding: 12px 20px;
    gap: 12px;
    text-align: left;
}

body.sidebar-collapsible.sidebar-visible #menu-lateral .nav-label {
    opacity: 0;
    transform: translateX(-8px);
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

body.sidebar-collapsible.sidebar-visible.sidebar-expanded #menu-lateral .nav-label {
    opacity: 1;
    transform: translateX(0);
    max-width: 220px;
    white-space: normal;
}

body.sidebar-collapsible.sidebar-visible #menu-lateral .nav-icon {
    width: 36px;
    height: 36px;
}

body.sidebar-collapsible.sidebar-visible.sidebar-expanded #menu-lateral .nav-icon {
    width: 28px;
    height: 28px;
}
#user-name {
    margin: 10px; text-align: center; font-size: 14px; color: var(--primary-color, #2797d6);
    padding-bottom: 10px; border-top: 1px solid rgba(15,23,42,0.08);
}

/* Container */
.container {
    margin-left: calc(var(--sidebar-current-width) + var(--sidebar-gap));
    margin-right: var(--sidebar-right-margin);
    margin-top: clamp(12px, 3vw, 24px);
    padding: 20px;
    width: calc(100% - (var(--sidebar-current-width) + var(--sidebar-gap) + var(--sidebar-right-margin)));
    display: none;
    box-sizing: border-box;
}
.container.active { display: block; }

/* Contenu interne avec marges */
.container h2,
.container .filters,
.container table,
.container .theme-buttons,
.container .login-form,
.container .forgot-password-form,
.container .statistics,
.container button,
.container .settings-section {
    margin-left: 20px;
    margin-right: 60px;
}

/* Login form */
.login-form, .forgot-password-form {
    max-width: 320px;
    margin: 40px auto;
    padding: 24px;
    background: var(--surface-color, #ffffff);
    border-radius: 12px;
    border: 1px solid var(--surface-border-color, #e5e7eb);
    box-shadow: var(--surface-shadow, 0 1px 4px rgba(15, 23, 42, 0.05));
    transition: transform 0.3s ease;
}
.login-form:hover, .forgot-password-form:hover { transform: translateY(-2px); }
.form-group { position: relative; margin-bottom: 28px; }
.form-group label {
    position: absolute; top: -18px; left: 12px; font-size: 12px; color: var(--primary-color, #2797d6);
    background: var(--surface-color, #ffffff); padding: 0 4px; z-index: 1; transition: all 0.2s ease;
}

@media (max-width: 960px) {
    body {
        --sidebar-gap: 16px;
        --sidebar-right-margin: 16px;
        --sidebar-offset-top: 68px;
    }

    .burger-button {
        display: inline-flex;
    }

    .header-left img {
        max-height: 34px;
    }

    .header h1 {
        font-size: 20px;
    }

    .sidebar {
        width: min(var(--sidebar-expanded-width), 84vw);
        transform: translateX(-100%);
        box-shadow: 0 0 18px rgba(15, 23, 42, 0.18);
        z-index: 1001;
        pointer-events: none;
        visibility: hidden;
    }

    body.sidebar-open #menu-lateral {
        transform: translateX(0);
        pointer-events: auto;
        visibility: visible;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar-backdrop {
        z-index: 1000;
    }

    body.sidebar-collapsible,
    body.sidebar-collapsible.sidebar-visible,
    body.sidebar-collapsible.sidebar-visible.sidebar-expanded {
        --sidebar-current-width: 0px;
    }

    .container {
        margin-left: 16px;
        margin-right: 16px;
        width: calc(100% - 32px);
    }

    body.sidebar-open .container {
        pointer-events: none;
    }

    body.sidebar-open .container.active {
        filter: blur(1.5px);
    }
}
.form-group .input-wrapper { position: relative; }
.form-group .input-icon {
    position: absolute; top: 50%; left: 12px; transform: translateY(-50%);
    font-size: 16px; color: var(--primary-color, #2797d6); z-index: 1;
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s; box-sizing: border-box; position: relative; z-index: 0;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--primary-color, #2797d6);
    box-shadow: 0 0 8px rgba(var(--primary-color-rgb, 39, 151, 214), 0.3);
    outline: none;
}
.form-group select[multiple] { height: 100px; }
.form-group.checkbox { display: flex; align-items: center; gap: 8px; }
.form-group.checkbox input { width: auto; margin: 0; }
.login-form button, .forgot-password-form button {
    width: 100%; padding: 12px; background: var(--primary-color, #2797d6); color: var(--on-primary-color, #ffffff); border: none; border-radius: 8px;
    font-size: 14px; font-weight: bold; cursor: pointer; transition: background-color 0.3s, transform 0.2s;
}
.login-form button:hover, .forgot-password-form button:hover { background: var(--primary-hover, #1f7bb0); transform: translateY(-2px); }
.login-form a, .forgot-password-form a {
    display: block; text-align: center; margin-top: 12px; color: var(--secondary-color, #963f64); text-decoration: none; font-size: 13px; transition: color 0.3s;
}
.login-form a:hover, .forgot-password-form a:hover { color: var(--secondary-hover, #7b324f); }

/* Thèmes */
.theme-buttons { display: flex; flex-direction: column; align-items: center; gap: 15px; margin: 20px 0; }
.theme-item { display: flex; flex-direction: column; align-items: center; width: 80%; max-width: 600px; }
.theme-button {
    padding: 15px 30px; font-size: 18px; border: none; border-radius: 6px; font-weight: bold; cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s; width: 100%;
}
.theme-button:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.theme-button.active { transform: scale(1); }
.theme-button:not(.active) { transform: scale(0.75); opacity: 0.8; }
.theme-button[data-theme="La gouvernance"] { background-color: #f9b668; color: #111; }
.theme-button[data-theme="Le positionnement et les valeurs de la Mission Locale"] { background-color: #a8dbca; color: #111; }
.theme-button[data-theme="L'ancrage territorial et partenarial de la Mission Locale"] { background-color: #87cefa; color: #111; }
.theme-button[data-theme="L'offre de service de la Mission Locale"] { background-color: #ff807d; color: #111; }
.theme-button[data-theme="Le management et le pilotage de l'activité"] { background-color: #e7181e; color: #fff; }

/* Critères container */
.criteres-container {
    display: none; flex-wrap: wrap; gap: 15px; margin-top: 10px; width: 100%;
    padding: 15px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.1);
}
.criteres-container.active { display: flex; }
.criteres-container[data-theme="La gouvernance"] { background-color: rgba(249, 182, 104, 0.3); }
.criteres-container[data-theme="Le positionnement et les valeurs de la Mission Locale"] { background-color: rgba(168, 219, 202, 0.3); }
.criteres-container[data-theme="L'ancrage territorial et partenarial de la Mission Locale"] { background-color: rgba(135, 206, 250, 0.3); }
.criteres-container[data-theme="L'offre de service de la Mission Locale"] { background-color: rgba(255, 128, 125, 0.3); }
.criteres-container[data-theme="Le management et le pilotage de l'activité"] { background-color: rgba(231, 24, 30, 0.3); }
.critere-bubble {
    background-color: #ffffff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 15px; width: 100%; max-width: 300px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: transform 0.3s;
}
.critere-bubble:hover { transform: translateY(-2px); }
.critere-bubble a { color: var(--primary-color, #2797d6); font-weight: bold; text-decoration: none; }
.critere-bubble p { margin: 5px 0; font-size: 14px; color: #666; }

/* Tables (générique) */
table {
    width: 100%; max-width: 100%; border-collapse: collapse; margin-top: 20px; background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden;
}
table th, table td { border: 1px solid #ddd; padding: 12px; text-align: left; font-size: 14px; }
table th { background: var(--primary-color, #2797d6); color: var(--on-primary-color, #ffffff); font-weight: bold; }
table td a { color: var(--secondary-color, #963f64); text-decoration: none; }
table td a:hover { text-decoration: underline; }
table td button.edit-critere {
    background: var(--primary-color, #2797d6); color: var(--on-primary-color, #ffffff); border: none; padding: 8px 12px; border-radius: 4px; cursor: pointer; transition: background-color 0.3s;
}
table td button.edit-critere:hover { background: var(--primary-hover, #1f7bb0); }

/* Filters (générique) */
.filters {
    display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center;
}
.filters select, .filters button {
    padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; min-width: 150px;
}
.filters button {
    background: var(--primary-color, #2797d6); color: var(--on-primary-color, #ffffff); border: none; cursor: pointer; transition: background-color 0.3s;
}

.required-indicator {
    color: #d32f2f;
    font-weight: 600;
    margin-left: 4px;
}

label .required-indicator {
    font-size: 0.85em;
}
