/* Feuille de style unique de l'application. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   IMPORT GOOGLE FONTS
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   1. VARIABLES & RESET GLOBAL
   ========================================================================== */
:root {
    --primary-color: #1EBCFF;
    --primary-dark: #0aa8eb;
    --secondary-color: #FFFFFF;
    --background-color: #F0F4F8;
    --surface-color: #FFFFFF;
    --text-color: #1a2332;
    --text-muted: #64748b;
    --nav-background: #1a2332;
    --nav-dropdown-bg: #243044;
    --nav-text-color: #FFFFFF;
    --input-border-color: #d1d9e0;
    --input-focus-color: #1EBCFF;
    --border-radius: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
}

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

html {
    min-width: 320px;
    /* Garde la largeur de la fenêtre stable quand le contenu change de hauteur. */
    overflow-y: scroll;
    scroll-behavior: smooth;
}

button,
input,
select {
    font: inherit;
}

.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: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   2. EN-TÊTE & PIED DE PAGE
   ========================================================================== */
header {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 1em 0;
    text-align: center;
}

h1 {
    margin-bottom: 0.5em;
    font-weight: 700;
    letter-spacing: -0.02em;
}

p {
    margin-bottom: 1em;
}

footer {
    background-color: var(--nav-background);
    color: var(--secondary-color);
    text-align: center;
    padding: 1em 0;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 10;
    font-size: 0.85em;
    opacity: 0.9;
}

/* ==========================================================================
   3. BARRE DE NAVIGATION (sans !important)
   ========================================================================== */
.navbar {
    background-color: var(--nav-background);
    height: 54px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    height: 100%;
    gap: 4px;
}

.menu-toggle {
    display: none;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 7px;
    min-width: 42px;
    min-height: 38px;
    cursor: pointer;
}

.menu-toggle-icon { font-size: 1.25rem; line-height: 1; }

.navbar ul li {
    list-style: none;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.navbar .logo {
    display: flex;
    align-items: center;
    padding-right: 24px;
    height: 100%;
    background: none;
    margin-right: 8px;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.navbar .logo img {
    height: 36px;
    width: auto;
    display: block;
}

.dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.navbar a,
.dropbtn {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0 16px;
    height: 38px;
    display: flex;
    align-items: center;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
    letter-spacing: 0.01em;
}

.navbar a:hover,
.dropdown:hover .dropbtn {
    background-color: rgba(30, 188, 255, 0.15);
    color: var(--primary-color);
}

/* Liens directs hors dropdown */
.navbar > ul > a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0 16px;
    height: 38px;
    display: flex;
    align-items: center;
    font-size: 0.9em;
    font-weight: 500;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.navbar > ul > a:hover {
    background-color: rgba(30, 188, 255, 0.15);
    color: var(--primary-color);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--nav-dropdown-bg);
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    border-radius: 0 0 8px 8px;
    top: 54px;
    left: 0;
    padding: 6px;
    border-top: 2px solid var(--primary-color);
}

.dropdown:hover .dropdown-content {
    display: flex;
    flex-direction: column;
}

.dropdown-content a {
    color: rgba(255,255,255,0.85);
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 14px;
    font-size: 0.875em;
    font-weight: 400;
    border-radius: 5px;
    height: auto;
    transition: background-color 0.15s ease, color 0.15s ease;
    border: none;
}

.dropdown-content a:hover {
    background-color: rgba(30, 188, 255, 0.15);
    color: var(--primary-color);
}

/* ==========================================================================
   4. FORMULAIRES — LAYOUT 2 COLONNES
   ========================================================================== */
.form-container {
    padding: 32px 24px 80px;
    max-width: 900px;
    margin: 0 auto;
}

form {
    background: var(--surface-color);
    padding: 36px 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0,0,0,0.05);
}

form h1 {
    margin-bottom: 28px;
    font-size: 1.4em;
    color: var(--text-color);
    text-align: left;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--background-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

form h1::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 22px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Grille 2 colonnes */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
}

.form-grid .form-full {
    grid-column: 1 / -1;
}

form label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

form select,
form input[type="text"],
form input[type="password"],
form input[type="date"] {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 20px;
    border: 1.5px solid var(--input-border-color);
    border-radius: 7px;
    font-size: 0.95em;
    font-family: 'Inter', sans-serif;
    background: #fafbfc;
    color: var(--text-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Menus déroulants personnalisés du formulaire de mise à jour. */
.custom-select {
    position: relative;
    margin-bottom: 20px;
}

.custom-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.custom-select-trigger {
    position: relative;
    width: 100%;
    min-height: 43px;
    padding: 10px 42px 10px 14px;
    border: 1.5px solid var(--input-border-color);
    border-radius: 7px;
    background: #fafbfc;
    color: var(--text-color);
    text-align: left;
    cursor: pointer;
    font-size: 0.95em;
}

.custom-select-trigger::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 16px;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-65%) rotate(45deg);
    transition: transform 0.18s ease;
}

.custom-select.is-open .custom-select-trigger,
.custom-select-trigger:focus {
    outline: none;
    border-color: var(--input-focus-color);
    box-shadow: 0 0 0 3px rgba(30, 188, 255, 0.12);
    background: #fff;
}

.custom-select.is-open .custom-select-trigger::after {
    transform: translateY(-25%) rotate(225deg);
}

.custom-select-options {
    position: absolute;
    z-index: 100;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    display: none;
    max-height: 230px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #dbe4ec;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 10px 25px rgba(26, 35, 50, 0.14);
}

.custom-select.is-open .custom-select-options {
    display: block;
}

.custom-select-option {
    display: block;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    text-align: left;
    font-size: 0.92em;
}

.custom-select-option:hover,
.custom-select-option.is-selected {
    background: rgba(30, 188, 255, 0.1);
    color: #087cae;
}

.custom-select-option.is-disabled {
    color: var(--text-muted);
    cursor: default;
}

.date-picker {
    position: relative;
    margin-bottom: 20px;
}

.date-picker-input-wrap {
    position: relative;
}

.date-picker .date-picker-display {
    width: 100%;
    min-height: 43px;
    margin-bottom: 0 !important;
    padding: 10px 46px 10px 14px;
    border: 1.5px solid var(--input-border-color);
    border-radius: 7px;
    background: #fafbfc;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.95em;
}

.date-picker-display:focus {
    outline: none;
    border-color: var(--input-focus-color);
    box-shadow: 0 0 0 3px rgba(30, 188, 255, 0.12);
    background: #fff;
}

.date-picker-toggle {
    position: absolute;
    top: 50% !important;
    bottom: auto !important;
    right: 8px;
    width: 34px;
    height: 34px;
    transform: translateY(-50%) !important;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25em;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 0;
}

.date-picker-toggle:hover {
    background: rgba(30, 188, 255, 0.1);
    color: var(--primary-dark);
}

.date-picker-toggle svg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 17px;
    height: 17px;
    transform: translate(-50%, -50%);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.date-picker-panel {
    position: absolute;
    z-index: 110;
    top: calc(100% + 6px);
    left: 0;
    width: min(320px, 100%);
    padding: 14px;
    border: 1px solid #dbe4ec;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 25px rgba(26, 35, 50, 0.14);
}

.date-picker-header,
.date-picker-footer,
.date-picker-weekdays,
.date-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.date-picker-header {
    grid-template-columns: 34px 1fr 34px;
    align-items: center;
    margin-bottom: 12px;
    text-align: center;
}

.date-picker-period {
    display: flex;
    justify-content: center;
    gap: 9px;
}

.date-picker-period select {
    min-width: 0;
    margin: 0;
    padding: 5px 28px 5px 9px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #f5f8fb;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.82em;
    font-weight: 700;
}

.date-picker-period select:first-child {
    width: 114px;
}

.date-picker-period select:last-child {
    width: 78px;
}

.date-picker-period .custom-select {
    width: auto;
    margin: 0;
}

.date-picker-period .custom-select-trigger {
    min-height: 32px;
    padding: 5px 28px 5px 9px;
    background: #f5f8fb;
    font-size: 0.82em;
    font-weight: 700;
}

.date-picker-period .custom-select:first-child .custom-select-trigger {
    width: 114px;
}

.date-picker-period .custom-select:last-child .custom-select-trigger {
    width: 78px;
}

.date-picker-period .custom-select-trigger::after {
    right: 10px;
}

.date-picker-period select:hover,
.date-picker-period select:focus {
    outline: none;
    border-color: var(--input-focus-color);
    background: #fff;
}

.date-picker-nav,
.date-picker-footer button {
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
}

.date-picker-nav {
    height: 30px;
    font-size: 1.35em;
}

.date-picker-nav:hover,
.date-picker-footer button:hover {
    background: rgba(30, 188, 255, 0.1);
    color: var(--primary-dark);
}

.date-picker-weekdays {
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 0.72em;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

.date-picker-grid button {
    min-height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.85em;
}

.date-picker-grid button:hover,
.date-picker-grid button.is-selected {
    background: var(--primary-color);
    color: #fff;
}

.date-picker-grid button.is-today {
    box-shadow: inset 0 0 0 1px var(--primary-color);
}

.date-picker-grid button.is-outside {
    color: #b5c0ca;
}

.date-picker-footer {
    grid-template-columns: 1fr 1fr;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid #edf1f5;
}

.date-picker-footer button {
    padding: 6px;
    color: var(--primary-dark);
    font-size: 0.8em;
    font-weight: 600;
}

form select:focus,
form input[type="text"]:focus,
form input[type="password"]:focus,
form input[type="date"]:focus {
    border-color: var(--input-focus-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 188, 255, 0.12);
    background: #fff;
}

form input[type="submit"],
.btn-submit,
.btn-reset {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 11px 32px;
    font-size: 0.95em;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    border-radius: 7px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(30, 188, 255, 0.3);
    letter-spacing: 0.01em;
}

.btn-reset {
    margin-left: 10px;
    background: #fff;
    color: var(--text-color);
    border: 1.5px solid var(--input-border-color);
    box-shadow: none;
}

.btn-reset:hover {
    background: #f4f7fa;
    border-color: #b8c6d3;
    box-shadow: var(--shadow-sm);
}

form input[type="submit"]:hover,
.btn-submit:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 14px rgba(30, 188, 255, 0.4);
    transform: translateY(-1px);
}

form input[type="submit"]:active,
.btn-submit:active,
.btn-reset:active {
    transform: translateY(0);
}

.filters select,
#societeFilter {
    margin: 8px 6px;
    padding: 8px 14px;
    border: 1.5px solid var(--input-border-color);
    border-radius: 7px;
    font-size: 0.9em;
    font-family: 'Inter', sans-serif;
    background: var(--surface-color);
    color: var(--text-color);
    min-width: 180px;
    transition: border-color 0.2s ease;
}

.filters select:focus,
#societeFilter:focus {
    border-color: var(--input-focus-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 188, 255, 0.12);
}

/* ==========================================================================
   5. ONGLETS
   ========================================================================== */
.table-container .tabs-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin: 28px 0 20px 0;
    padding: 0;
    list-style: none;
    height: 45px;
}

.table-container .tabs-nav .tab-btn {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.9em;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    border-radius: 7px;
    box-sizing: border-box;
    transition: background-color 0.15s ease, color 0.15s ease;
    background-color: var(--surface-color);
    color: var(--text-muted);
    border: 1.5px solid var(--input-border-color);
}

.table-container .tabs-nav .tab-btn:not(.active):hover {
    background-color: #f0f4f8;
    color: var(--text-color);
    border-color: #b0bec5;
}

.table-container .tabs-nav .tab-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(30, 188, 255, 0.25);
}

/* Les onglets de l'historique restent compacts tout en conservant le design général. */
.table-container .history-tabs .tab-btn {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    font-size: 0.84em;
}

.table-container .history-filters input[type="search"] {
    width: 260px;
    min-width: 260px;
    min-height: 43px;
    padding: 10px 14px;
    margin: 0;
    border: 1.5px solid var(--input-border-color);
    border-radius: 7px;
    font-size: 0.95em;
    font-family: 'Inter', sans-serif;
    background: #fafbfc;
    color: var(--text-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.table-container .history-filters input[type="search"]:focus {
    outline: none;
    border-color: var(--input-focus-color);
    box-shadow: 0 0 0 3px rgba(30, 188, 255, 0.12);
    background: #fff;
}

.table-container .history-filters select {
    width: 180px;
    min-width: 180px;
    min-height: 43px;
    height: 43px;
    padding: 10px 14px;
    margin: 0;
    border: 1.5px solid var(--input-border-color);
    border-radius: 7px;
    font-size: 0.95em;
    font-family: 'Inter', sans-serif;
    background: #fafbfc;
    color: var(--text-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.table-container .history-filters select:focus {
    outline: none;
    border-color: var(--input-focus-color);
    box-shadow: 0 0 0 3px rgba(30, 188, 255, 0.12);
    background: #fff;
}

/* Le filtre Opération utilise le même sélecteur personnalisé que les formulaires. */
.table-container .history-filters .custom-select {
    width: 180px;
    min-width: 180px;
    margin: 0;
}

.table-container .history-filters .custom-select-trigger {
    min-height: 43px;
    padding: 10px 42px 10px 14px;
    background: #fafbfc;
    font-size: 0.95em;
}

/* ==========================================================================
   6. DASHBOARD (page d'accueil)
   ========================================================================== */
.dashboard {
    padding: 32px 24px 80px;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-header {
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--text-color);
    border: none;
    padding: 0;
    margin-bottom: 4px;
}

.dashboard-header p {
    color: var(--text-muted);
    font-size: 0.95em;
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}

.stat-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 12px 12px 0 0;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    font-size: 1.6em;
    line-height: 1;
}

.stat-card .stat-value {
    font-size: 2em;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.03em;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.82em;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.dashboard-actions-grid {
    grid-template-columns: repeat(3, 1fr);
}

.dashboard-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.05);
}

.dashboard-card h2 {
    font-size: 1em;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-card h2 .badge {
    background: var(--background-color);
    color: var(--text-muted);
    font-size: 0.78em;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
}

.quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    background: var(--background-color);
    font-size: 0.875em;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
    border: 1px solid transparent;
}

.quick-link:hover {
    background-color: rgba(30, 188, 255, 0.08);
    color: var(--primary-color);
    border-color: rgba(30, 188, 255, 0.2);
}

.quick-link .ql-icon {
    font-size: 1.1em;
    width: 20px;
    text-align: center;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--background-color);
    font-size: 0.875em;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    margin-top: 5px;
    flex-shrink: 0;
}

.activity-dot.green { background: #22c55e; }
.activity-dot.red   { background: #ef4444; }
.activity-dot.blue  { background: var(--primary-color); }
.activity-dot.amber { background: #f59e0b; }

.activity-text {
    flex: 1;
    color: var(--text-color);
    line-height: 1.4;
}

.activity-time {
    color: var(--text-muted);
    font-size: 0.8em;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .navbar {
        width: 100%;
        min-height: 58px;
        height: auto;
        padding: 9px 14px;
        position: sticky;
        flex-wrap: wrap;
        align-content: flex-start;
        align-items: center;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
    }

    .navbar > ul {
        display: none;
        width: 100%;
        height: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 3px;
        padding: 12px 0 4px;
        margin: 0;
    }

    .navbar > ul.is-open { display: flex; flex-basis: 100%; }
    .navbar > ul > li {
        display: block;
        width: 100%;
    }
    .navbar > ul > li,
    .navbar > ul > a { height: auto; }

    .navbar .logo {
        position: static;
        height: 38px;
        width: auto;
        padding: 0 0 0 10px;
        margin: 0 0 0 8px;
        border-left: 1px solid rgba(255,255,255,.1);
        border-right: 0;
        flex: 0 0 auto;
    }

    .navbar .logo img { height: 32px; }
    .navbar a, .dropbtn, .navbar > ul > a {
        min-height: 44px;
        padding: 10px 14px;
        justify-content: flex-start;
        width: 100%;
    }
    .dropdown { display: block; height: auto; width: 100%; }
    .dropdown > .dropbtn::after {
        content: '›';
        margin-left: auto;
        font-size: 1.35em;
        line-height: 1;
        transform: rotate(90deg);
        transition: transform .2s ease;
    }
    .dropdown.is-open > .dropbtn::after { transform: rotate(-90deg); }
    .dropdown-content {
        display: none !important;
        position: static !important;
        min-width: 0;
        width: calc(100% - 14px);
        margin: 2px 0 6px 14px;
        padding: 3px 0 3px 8px;
        border-top: 0;
        border-left: 2px solid var(--primary-color);
        border-radius: 0;
        box-shadow: none;
        background-color: rgba(255,255,255,.04);
    }
    .dropdown:hover .dropdown-content { display: none !important; }
    .dropdown.is-open .dropdown-content { display: flex !important; }
    .dropdown-content a { min-height: 40px; }

    .dashboard,
    .form-container,
    .message-container,
    .success-message,
    .success-container,
    .contracts-dashboard { padding-left: 14px; padding-right: 14px; }
    .dashboard { padding-top: 24px; }
    .dashboard-header { margin-bottom: 24px; }
    .dashboard-header h1 { font-size: 1.35em; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .quick-links { grid-template-columns: 1fr; }
    .dashboard-card { padding: 18px; }
    .form-container { padding-top: 20px; }
    form { padding: 24px 18px; border-radius: 10px; }
    form h1 { font-size: 1.15em; margin-bottom: 22px; }
    form input[type="submit"], .btn-submit, .btn-reset { width: 100%; min-height: 46px; margin-left: 0; margin-top: 8px; }
    .table-container { width: auto; margin: 24px 14px; }
    .table-container > h1 { font-size: 1.3em; margin-bottom: 18px; }
    .filters { align-items: stretch; gap: 5px; padding: 12px; }
    .filters label { margin-top: 5px; }
    .filters select, #societeFilter { width: 100%; min-width: 0; margin: 0 0 6px; min-height: 44px; }
    .table-container .tabs-nav { height: auto; flex-direction: column; align-items: stretch; gap: 8px; margin: 20px 0 16px; }
    .table-container .tabs-nav .tab-btn { width: 100%; min-width: 0; max-width: none; min-height: 46px; height: auto; }
    /* Les onglets de l'historique restent compacts sur les petits écrans. */
    .table-container .history-tabs { flex-direction: row; align-items: center; flex-wrap: wrap; }
    .table-container .history-tabs .tab-btn { width: 150px; min-width: 150px; max-width: 150px; min-height: 38px; height: 38px; }
    .contracts-header { padding: 18px; }
    .contracts-title { align-items: flex-start; }
    .contracts-title-icon { width: 38px; height: 38px; font-size: 1.4rem; flex: 0 0 38px; }
    .contracts-header h1 { font-size: 1.2rem; }
    .counter-value { font-size: 2.6rem; }
}

@media (max-width: 420px) {
    .stats-grid { grid-template-columns: 1fr; gap: 12px; }
    .stat-card { padding: 18px; }
    .quick-link { min-height: 46px; }
    .contract-item { padding-left: 14px; padding-right: 14px; }
    .days-left { font-size: .74rem; }
}

/* ==========================================================================
   7. MESSAGES DE SUCCÈS / CONFIRMATION
   ========================================================================== */
.success-message,
.success-container,
.message-container {
    padding: 32px 24px 80px;
    max-width: 900px;
    margin: 0 auto;
}

.success-message,
.success-container {
    background: var(--surface-color);
    padding: 28px 32px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border-left: 4px solid #22c55e;
    margin-top: 20px;
}

.success-message h2,
.success-container h2 {
    color: #22c55e;
    font-size: 1.3em;
    margin-bottom: 10px;
}

.success-message p,
.success-container p {
    color: var(--text-color);
    margin-bottom: 16px;
}

.success-message a,
.success-container a {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 7px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.success-message a:hover,
.success-container a:hover {
    background-color: var(--primary-dark);
}

/* ===========================================================================
   ÉCHÉANCES DES CONTRATS
   =========================================================================== */
.contracts-dashboard { max-width: 1200px; margin: 0 auto; padding: 38px 24px 80px; }
.contracts-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; padding: 24px 28px; background: var(--surface-color); color: var(--text-color); border: 1px solid rgba(15, 23, 42, .06); border-radius: 16px; box-shadow: var(--shadow-sm); }
.contracts-title { display: flex; align-items: center; gap: 15px; }
.contracts-title-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 12px; background: linear-gradient(135deg, #31c3ff, #168be6); color: #fff; font-size: 1.8rem; font-weight: 700; line-height: 1; box-shadow: 0 5px 12px rgba(30, 188, 255, .25); }
.contracts-header h1 { margin: 0 0 3px; font-size: 1.5rem; color: var(--text-color); }
.contracts-header p { margin: 0; color: var(--text-muted); font-size: .9rem; }
.refresh-date { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; color: var(--text-muted); background: #f7fafc; border: 1px solid #e7edf3; border-radius: 999px; font-size: .8rem; white-space: nowrap; }
.refresh-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.contract-counters, .contracts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.contract-counters { margin-bottom: 28px; }
.contract-counter { position: relative; overflow: hidden; min-height: 168px; border-radius: 16px; padding: 24px 27px; color: #fff; box-shadow: 0 8px 18px rgba(15, 23, 42, .16); transition: transform .2s ease, box-shadow .2s ease; }
.contract-counter:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(15, 23, 42, .2); }
.contract-counter::before { content: ''; position: absolute; width: 190px; height: 190px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; right: -62px; top: -92px; }
.contract-counter::after { content: ''; position: absolute; width: 125px; height: 125px; border-radius: 50%; right: -22px; top: -44px; background: rgba(255,255,255,.11); }
.contract-counter.urgent { background: linear-gradient(135deg, #f05d4e 0%, #d9363c 100%); }
.contract-counter.upcoming { background: linear-gradient(135deg, #f0a329 0%, #d97706 100%); }
.counter-top, .counter-value, .counter-note { position: relative; z-index: 1; }
.counter-top { display: flex; align-items: center; gap: 9px; }
.counter-icon { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid rgba(255,255,255,.38); border-radius: 7px; font-size: .84rem; font-weight: 800; }
.counter-caption { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .92; }
.counter-value { margin: 16px 0 5px; font-size: 3.15rem; line-height: 1; font-weight: 700; letter-spacing: -.04em; }
.counter-note { font-size: .84rem; font-weight: 500; opacity: .92; }
.contract-panel { position: relative; overflow: hidden; background: var(--surface-color); border: 1px solid rgba(15, 23, 42, .07); border-radius: 16px; box-shadow: var(--shadow-sm); transition: box-shadow .2s ease; }
.contract-panel:hover { box-shadow: var(--shadow-md); }
.contract-panel::before { content: ''; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, #e34442, #f06c56); }
.contract-panel.upcoming::before { background: linear-gradient(90deg, #d97706, #f0aa37); }
.contract-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 23px 22px 18px; border-bottom: 1px solid var(--background-color); }
.contract-panel h2 { margin: 0; font-size: 1rem; }
.contract-badge { padding: 3px 9px; border-radius: 999px; background: #fff0ed; color: #c83d36; font-size: .78rem; font-weight: 700; }
.upcoming .contract-badge { background: #fff7e8; color: #b66b08; }
.contract-list { list-style: none; margin: 0; padding: 0; }
.contract-item { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--background-color); }
.contract-item:last-child { border-bottom: none; }
.contract-date { width: 44px; flex: 0 0 44px; border-radius: 7px; padding: 4px; text-align: center; color: #c83d36; background: #fff0ed; font-size: .75rem; font-weight: 700; line-height: 1.2; }
.upcoming .contract-date { color: #b66b08; background: #fff7e8; }
.contract-date strong { display: block; font-size: 1.05rem; }
.contract-person { min-width: 0; flex: 1; }
.contract-person strong, .contract-person span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contract-person strong { font-size: .9rem; }
.contract-person span, .days-left { color: var(--text-muted); font-size: .8rem; }
.days-left { text-align: right; white-space: nowrap; }
.empty-state, .error-state { padding: 32px 22px; text-align: center; color: var(--text-muted); font-size: .9rem; }
.error-state { color: #c83d36; }

@media (max-width: 760px) {
    .contracts-header, .contract-counters, .contracts-grid { display: block; }
    .contracts-header { margin-bottom: 20px; }
    .refresh-date { display: block; margin-top: 8px; }
    .contract-counter, .contract-panel { margin-bottom: 18px; }
}


/* Module recherche */
/* ==========================================================================
   1. BARRES DE RECHERCHE & CARTES DE RÉSULTATS
   ========================================================================== */
.search-container {
    width: 100%;
    max-width: 600px;
    margin: 30px auto;
    text-align: center;
}

.search-bar {
    width: 100%;
    padding: 12px 16px 12px 44px;
    font-size: 1em;
    font-family: 'Inter', sans-serif;
    border-radius: 8px;
    border: 1.5px solid var(--input-border-color);
    background: var(--secondary-color) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 14px center no-repeat;
    box-shadow: var(--shadow-sm);
    color: var(--text-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-bar:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 188, 255, 0.12);
}

/* Champ de recherche intégré au formulaire de mise à jour. */
.form-container .search-users-container .search-bar {
    display: block;
    width: 100%;
    min-height: 43px;
    margin-bottom: 20px;
    padding: 10px 14px 10px 44px;
    border: 1.5px solid var(--input-border-color);
    border-radius: 7px;
    background-color: #fafbfc;
    box-shadow: none;
    color: var(--text-color);
    font-size: 0.95em;
}

.form-container .search-users-container .search-bar:focus {
    background-color: #fff;
}

.cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto 60px auto;
}

.card {
    background: var(--secondary-color);
    padding: 20px 24px;
    width: 100%;
    max-width: 550px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px 20px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

.card h2 {
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--primary-color);
    text-align: center;
    grid-column: 1 / -1;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--background-color);
}

.card-item {
    display: block;
    font-size: 0.875em;
    word-break: break-word;
}

.card-item strong {
    color: var(--text-muted);
    display: inline-block;
    margin-right: 4px;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.no-result {
    text-align: center;
    margin-top: 20px;
    font-size: 1em;
    color: var(--text-muted);
}

/* ==========================================================================
   2. TAGS DE SÉLECTION & SUGGESTIONS PRÉDICTIVES
   ========================================================================== */
.search-users-container {
    position: relative;
    width: 100%;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    margin-bottom: 15px;
}

.tags-container:empty {
    margin: 0;
    padding: 0;
    min-height: 0;
}

.user-tag {
    background-color: rgba(30, 188, 255, 0.1);
    color: #0aa8eb;
    border: 1px solid rgba(30, 188, 255, 0.25);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.875em;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.user-tag:hover {
    background-color: rgba(30, 188, 255, 0.18);
}

.remove-tag-btn {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1em;
    line-height: 1;
    font-weight: bold;
    padding: 0 2px;
    transition: color 0.2s ease;
}

.remove-tag-btn:hover {
    color: #ef4444;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--secondary-color);
    border: 1.5px solid var(--input-border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    z-index: 99999;
    display: none;
    margin-top: -1px;
}

.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    text-align: left;
    font-size: 0.9em;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.15s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: rgba(30, 188, 255, 0.06);
    color: var(--primary-color);
}

.suggestion-item {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    font-family: inherit;
}

.suggestion-item small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.85em;
}

@media (max-width: 768px) {
    .search-container, 
    .search-bar {
        width: 95%;
    }
}


/* Module tableaux */
/* ==========================================================================
   1. TABLEAUX GENERAUX & FILTRES
   ========================================================================== */
.table-container {
    margin: 40px auto;
    width: 95%;
    max-width: 1400px;
}

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

.table-container th, 
.table-container td {
    border: none;
    border-bottom: 1px solid #eef0f4;
    padding: 12px 14px;
    text-align: left;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

.table-container th {
    background-color: var(--nav-background);
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    position: sticky;
    top: 0;
    z-index: 2;
}

.table-container th:first-child { border-radius: 8px 0 0 0; }
.table-container th:last-child  { border-radius: 0 8px 0 0; }

.table-container tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.table-container tbody tr:hover {
    background-color: rgba(30, 188, 255, 0.06);
}

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

.filters {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: var(--secondary-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.05);
}

.filters label {
    font-weight: 600;
    font-size: 0.82em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filters .custom-select {
    min-width: 180px;
    margin: 0;
}

.filters .custom-select-trigger {
    min-height: 40px;
    padding: 8px 36px 8px 14px;
    background: #fff;
    font-size: 0.9em;
}

.filters .custom-select-options {
    min-width: 100%;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    box-shadow: var(--shadow-md);
    border-radius: 8px;
    margin-bottom: 25px;
    background-color: var(--secondary-color);
    border: 1px solid rgba(0,0,0,0.06);
}

.table-responsive:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* La liste des utilisateurs reste lisible sur une ligne par personne.
   Le conteneur conserve un défilement horizontal sur les petits écrans. */
#usersTable {
    min-width: 1050px;
    table-layout: auto;
}

#usersTable th,
#usersTable td {
    white-space: nowrap;
    overflow-wrap: normal;
    word-wrap: normal;
    word-break: normal;
}

/* ==========================================================================
   2. TRIS DES COLONNES
   ========================================================================== */
th.sortable, #usersTable th, #groupsTable th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

th.sortable:hover, #usersTable th:hover, #groupsTable th.sortable:hover {
    background-color: #243044;
}

th.sortable::after, #usersTable th::after, #groupsTable th.sortable::after {
    content: ' \2195';
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.4);
}

th.sort-asc::after, #usersTable th.sort-asc::after, #groupsTable th.sort-asc::after {
    content: ' \25B2';
    color: var(--primary-color);
}

th.sort-desc::after, #usersTable th.sort-desc::after, #groupsTable th.sort-desc::after {
    content: ' \25BC';
    color: var(--primary-color);
}

/* ==========================================================================
   3. SECTIONS SPECIFIQUES (SUIVI DES MODIFICATIONS)
   ========================================================================== */
.file-section {
    width: 100%;
    margin-bottom: 40px;
    text-align: left;
}

@media (max-width: 768px) {
    .table-container {
        width: auto;
        margin: 24px 14px;
    }

    .table-container > h1 {
        font-size: 1.3em;
        margin-bottom: 18px;
    }
}

.file-section h2 {
    color: var(--text-color);
    font-size: 1.1em;
    font-weight: 700;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.no-changes {
    font-style: italic;
    color: var(--text-muted);
    padding: 14px 18px;
    background-color: var(--secondary-color);
    border-left: 3px solid var(--input-border-color);
    border-radius: 6px;
    font-size: 0.875em;
    box-shadow: var(--shadow-sm);
    margin-top: 5px;
}






/* Module modales */
/* ==========================================================================
   1. STRUCTURE DE LA FENÊTRE MODALE
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--secondary-color);
    padding: 28px 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: modal-in 0.2s ease;
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.close-modal {
    position: absolute;
    top: 12px;
    right: 15px;
    font-size: 22px;
    font-weight: 400;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s ease, background-color 0.2s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

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

#modalTitle {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.15em;
    font-weight: 700;
    border-bottom: 2px solid var(--background-color);
    padding-bottom: 12px;
    padding-right: 32px;
}

#modalBody {
    max-height: 300px;
    overflow-y: auto;
    word-break: break-word;
    line-height: 1.5;
}

.user-modal-content { max-width: 760px; }
.user-modal-content h2 { margin-bottom: 20px; }
.user-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    max-height: 65vh;
    overflow-y: auto;
}
.user-detail-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px 11px;
    border-radius: 7px;
    background-color: var(--background-color);
}
.user-detail-item strong {
    color: var(--text-muted);
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.user-detail-item span { color: var(--text-color); overflow-wrap: anywhere; }
@media (max-width: 600px) { .user-details-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   2. COMPOSANTS DE GESTION DE MEMBRES (DANS LA MODALE)
   ========================================================================== */
.member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 6px;
    background-color: var(--background-color);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 7px;
    transition: background-color 0.2s ease;
}

.member-row:hover {
    background-color: #e8edf2;
}

.member-row span {
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-color);
}

.btn-voir {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.2s ease;
}

.btn-voir:hover {
    background-color: var(--primary-dark);
}

.btn-delete-member {
    background-color: transparent;
    color: #ef4444;
    border: 1.5px solid #fca5a5;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-delete-member:hover {
    background-color: #ef4444;
    color: var(--secondary-color);
    border-color: #ef4444;
}

.add-member-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 2px solid var(--background-color);
    position: relative;
}

.add-member-section h3 {
    font-size: 0.82em;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.search-member-input {
    width: 100% !important;
    margin: 5px 0 !important;
    padding: 10px 14px !important;
    border: 1.5px solid var(--input-border-color);
    border-radius: 7px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-member-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 188, 255, 0.12);
}

.add-member-section .suggestions-list {
    top: 100%;
    left: 0;
    width: 100%;
    box-shadow: var(--shadow-md);
}

/* Feuille de style principale de l'application.
   Les modules CSS existants sont regroupés derrière ce point d'entrée unique. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Styles spécifiques à la page d'accès refusé. */
.error-page {
  color-scheme: dark;
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #e7eefc;
  background:
    radial-gradient(circle at 16% 10%, rgba(40, 120, 255, .24), transparent 32rem),
    radial-gradient(circle at 86% 88%, rgba(19, 201, 160, .16), transparent 30rem),
    #0b1220;
}

.error-page main {
  width: min(100%, 610px);
  padding: clamp(32px, 7vw, 64px);
  text-align: center;
  background: rgba(18, 29, 49, .9);
  border: 1px solid rgba(180, 205, 255, .16);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .35);
}

.error-page .code {
  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 24px;
  border: 1px solid #3966a5;
  border-radius: 50%;
  color: #9fc2ff;
  background: #1c3965;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.error-page h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.45rem); }

.error-page p {
  max-width: 430px;
  margin: 16px auto 30px;
  color: #b8c6dc;
  line-height: 1.6;
}

.error-page a {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 10px;
  color: #071221;
  background: #76adff;
  font-weight: 700;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease;
}

.error-page a:hover,
.error-page a:focus-visible { background: #a7caff; transform: translateY(-2px); }
.error-page a:focus-visible { outline: 3px solid white; outline-offset: 3px; }

