/* ============================================================
   Matrice Organisationnelle du Service Administratif
   Feuille de style principale
   ============================================================ */

:root {
    --primary: #1b4332;
    --primary-light: #2d6a4f;
    --primary-dark: #10291d;
    --accent: #d4a017;
    --accent-light: #f2c94c;
    --bg: #f4f6f5;
    --card-bg: #ffffff;
    --text: #1f2a24;
    --text-muted: #6b7a72;
    --border: #e1e6e3;
    --danger: #c0392b;
    --success: #2f9e44;
    --header-fill: #44546a;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(16, 41, 29, 0.08);
    --shadow-lg: 0 10px 40px rgba(16, 41, 29, 0.18);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { text-decoration: none; color: inherit; }

/* ------------------------------------------------------------
   Splash screen
   ------------------------------------------------------------ */
.splash-screen {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #1b4332 0%, #0c2016 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeOutSplash 0.6s ease forwards;
    animation-delay: 2.6s;
}

.splash-logo {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    box-shadow: 0 0 60px rgba(242, 201, 76, 0.55);
    animation: splashPulse 1.8s ease-in-out infinite;
}

.splash-title {
    color: #f5f0dc;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 26px;
    text-align: center;
    max-width: 520px;
    padding: 0 20px;
    opacity: 0;
    animation: splashTitleIn 0.8s ease forwards 0.5s;
}

.splash-sub {
    color: #cfead9;
    font-size: 13px;
    margin-top: 8px;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0;
    animation: splashTitleIn 0.8s ease forwards 0.9s;
}

.splash-loader {
    margin-top: 30px;
    width: 180px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    overflow: hidden;
}
.splash-loader::after {
    content: '';
    display: block;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, var(--accent-light), var(--accent));
    border-radius: 4px;
    animation: splashLoad 2.4s ease-in-out forwards;
}

@keyframes splashPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}
@keyframes splashTitleIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes splashLoad {
    from { width: 0%; }
    to { width: 100%; }
}
@keyframes fadeOutSplash {
    to { opacity: 0; visibility: hidden; }
}

/* ------------------------------------------------------------
   Page de connexion
   ------------------------------------------------------------ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 55%, #40916c 100%);
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 36px 32px 30px;
    text-align: center;
    animation: cardIn 0.5s ease;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-card img.logo {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    margin-bottom: 14px;
    box-shadow: 0 0 0 4px #f2c94c33;
}

.login-card h1 {
    font-size: 18px;
    color: var(--primary-dark);
    margin: 0 0 4px;
}
.login-card p.subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0 0 26px;
}

.field {
    text-align: left;
    margin-bottom: 16px;
}
.field label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.field input {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color .15s;
}
.field input:focus {
    outline: none;
    border-color: var(--primary-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 8px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .1s, box-shadow .15s, background .15s;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    width: 100%;
    padding: 12px;
}
.btn-primary:hover { background: var(--primary-light); }
.btn-primary:active { transform: scale(0.98); }

.btn-accent { background: var(--accent); color: #2b2200; }
.btn-accent:hover { background: var(--accent-light); }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a5281c; }

.btn-success { background: #1e8e3e; color: #fff; }
.btn-success:hover { background: #197a35; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 6px; }

.login-error {
    background: #fdecea;
    color: #611a15;
    border: 1px solid #f5c2c0;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: left;
}

.login-footer-hint {
    margin-top: 22px;
    font-size: 11.5px;
    color: var(--text-muted);
}

/* ------------------------------------------------------------
   Layout applicatif (après connexion)
   ------------------------------------------------------------ */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--primary-dark);
    color: #eaf4ee;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    /* Menu FIXE : il reste en place quand la page défile */
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 120;
    overflow-y: auto;
}
.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 14px;
}
.sidebar .brand img { width: 40px; height: 40px; border-radius: 50%; }
.sidebar .brand span { font-size: 13.5px; font-weight: 700; line-height: 1.25; }

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    font-size: 13.5px;
    color: #cfead9;
    border-left: 3px solid transparent;
    transition: background .15s;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); }
.sidebar nav a.active {
    background: rgba(242,201,76,0.12);
    border-left-color: var(--accent);
    color: #fff;
    font-weight: 600;
}
.sidebar .nav-section-title {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7fa08d;
    padding: 16px 20px 6px;
}
.sidebar .sidebar-footer {
    margin-top: auto;
    padding: 14px 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: #9fc2ab;
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 62px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar h2 { font-size: 16px; margin: 0; color: var(--primary-dark); }
.topbar .user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.topbar .user-chip .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.topbar-right { display: flex; align-items: center; gap: 16px; }

.bell-wrap { position: relative; cursor: pointer; }
.bell-wrap .bell-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    min-width: 17px;
    height: 17px;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    padding: 0 3px;
}
.bell-wrap .bell-icon { font-size: 20px; }

.notif-panel {
    position: absolute;
    right: 24px;
    top: 60px;
    width: 340px;
    max-height: 420px;
    overflow-y: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    display: none;
    z-index: 100;
}
.notif-panel.open { display: block; }
.notif-panel .notif-header {
    padding: 12px 16px;
    font-weight: 700;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f2f1;
    font-size: 12.5px;
    display: flex;
    gap: 10px;
}
.notif-item.unread { background: #fbf6e3; }
.notif-item .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); margin-top: 4px; flex-shrink: 0;
}
.notif-item .notif-text { color: var(--text); }
.notif-item .notif-time { color: var(--text-muted); font-size: 11px; margin-top: 3px; }
.notif-empty { padding: 24px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

.notif-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--primary-dark);
    color: #fff;
    padding: 14px 18px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    max-width: 320px;
    z-index: 999;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    transform: translateY(20px);
    opacity: 0;
    transition: all .3s ease;
}
.notif-toast.show { transform: translateY(0); opacity: 1; }

.content {
    padding: 24px;
    flex: 1;
}

/* ------------------------------------------------------------
   Cards / stats
   ------------------------------------------------------------ */
.cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent);
}
.stat-card .stat-value { font-size: 26px; font-weight: 800; color: var(--primary-dark); }
.stat-card .stat-label { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

.panel {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}
.panel h3 {
    margin: 0 0 16px;
    font-size: 15px;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.toolbar-left, .toolbar-right { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.select, select {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: var(--text);
}

.toggle-group {
    display: inline-flex;
    background: #eef1ef;
    border-radius: 8px;
    padding: 3px;
}
.toggle-group button {
    border: none;
    background: transparent;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
}
.toggle-group button.active {
    background: var(--primary);
    color: #fff;
}

.day-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.day-tabs button {
    border: 1.5px solid var(--border);
    background: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
}
.day-tabs button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.day-tabs button .d-num { display:block; font-size: 15px; }

/* ------------------------------------------------------------
   Matrice / tableau horaire — style "calendrier" MATRIXO
   ------------------------------------------------------------ */
.matrix-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 8px;
    box-shadow: var(--shadow);
}

table.matrix {
    border-collapse: separate;
    border-spacing: 4px;
    width: 100%;
    min-width: 900px;
    font-size: 12px;
}
table.matrix th, table.matrix td {
    border: none;
    padding: 4px;
    vertical-align: middle;
    text-align: center;
}
table.matrix thead th {
    background: #f6f8f7;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    padding: 8px 6px;
    position: sticky;
    top: 0;
    z-index: 5;
}
table.matrix th.slot-th { background: transparent; padding: 4px 2px; }
.slot-pill {
    display: inline-block;
    background: #eef2f0;
    color: #55645c;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
}

/* En-tête de jour (vue semaine) : nom + grand numéro, comme un agenda */
table.matrix .day-block-header {
    background: #e8f2ee;
    color: var(--primary-dark);
    border-radius: 12px;
    padding: 10px 6px;
}
table.matrix .day-block-header .dh-name {
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: capitalize;
    color: #5c6f66;
    letter-spacing: 0.4px;
}
table.matrix .day-block-header .dh-num {
    display: block;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--primary-dark);
}
table.matrix .day-separator {
    background: transparent !important;
    width: 14px;
    min-width: 14px;
    padding: 0 !important;
    border: none !important;
    border-left: 2px dashed #d5ddd9 !important;
}

/* Colonne Bureau / Cellule */
table.matrix td.svc-label {
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
    font-size: 13.5px;
    background: color-mix(in srgb, var(--evt-color, #1b4332) 10%, #ffffff);
    border-radius: 10px;
    padding: 8px 10px;
    color: var(--primary-dark);
}
table.matrix td.svc-label .svc-dot {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--evt-color, #1b4332);
    margin-right: 8px;
    vertical-align: middle;
}

/* Cellules de tâches : cartes centrées, arrondies, pastel */
table.matrix td.task-cell {
    cursor: pointer;
    min-width: 110px;
    position: relative;
    padding: 0;
}
.evt-card {
    position: relative;
    background: color-mix(in srgb, var(--evt-color, #1b4332) 16%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--evt-color, #1b4332) 30%, #ffffff);
    border-left: 4px solid var(--evt-color, #1b4332);
    border-radius: 10px;
    padding: 9px 11px;
    min-height: 68px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    line-height: 1.35;
    transition: transform .12s ease, box-shadow .12s ease;
}
table.matrix td.task-cell:hover .evt-card {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 41, 29, 0.14);
}
.evt-card .evt-person {
    font-weight: 800;
    font-size: 14px;
    color: #17251d;
}
.evt-card .evt-desc {
    font-size: 13px;
    color: #33413a;
    max-width: 260px;
}
.evt-card .evt-time {
    font-size: 11.5px;
    font-weight: 700;
    color: #45564d;
    background: rgba(255,255,255,0.65);
    border-radius: 999px;
    padding: 3px 9px;
    margin-top: 2px;
    white-space: nowrap;
}

/* Cellule vide : zone cliquable discrète */
table.matrix td.task-cell.empty-cell {
    background: #fafbfa;
    border: 1.5px dashed #e3e8e5;
    border-radius: 10px;
    min-height: 62px;
}
table.matrix td.task-cell.empty-cell .add-hint {
    opacity: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-light);
    transition: opacity .12s;
}
table.matrix td.task-cell.empty-cell:hover { background: #eef6f1; border-color: var(--primary-light); }
table.matrix td.task-cell.empty-cell:hover .add-hint { opacity: 1; }

table.matrix td.task-cell .cell-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: none;
    gap: 3px;
}
table.matrix td.task-cell:hover .cell-actions { display: flex; }
.cell-actions button {
    border: none;
    background: rgba(0,0,0,0.5);
    color: #fff;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    line-height: 1;
}

.week-block { margin-bottom: 26px; }
.week-block h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--primary-dark);
    border-left: 4px solid var(--accent);
    padding-left: 10px;
}

.legend-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.08);
}
.legend-chip .sw { width: 10px; height: 10px; border-radius: 3px; }

/* ------------------------------------------------------------
   Modal (formulaire tâche)
   ------------------------------------------------------------ */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(16,41,29,0.55);
    display: none; align-items: center; justify-content: center; z-index: 500;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: #fff; border-radius: 14px; width: 100%; max-width: 460px;
    padding: 24px; box-shadow: var(--shadow-lg); animation: cardIn .3s ease;
    max-height: 90vh; overflow-y: auto;
}
.modal-box h3 { margin: 0 0 18px; font-size: 16px; color: var(--primary-dark); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.form-row { display: flex; gap: 12px; }
.form-row .field { flex: 1; }
textarea {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
    border-radius: 8px; font-size: 13.5px; resize: vertical; min-height: 70px;
    font-family: inherit;
}

/* ------------------------------------------------------------
   Tables admin (users / periodes)
   ------------------------------------------------------------ */
table.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin-table th, table.admin-table td {
    padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left;
}
table.admin-table th { color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700;
}
.badge-green { background: #e6f6ea; color: #1e7b34; }
.badge-red { background: #fdecea; color: #a5281c; }
.badge-gray { background: #eef1ef; color: #667; }
.badge-gold { background: #fdf3d6; color: #8a6d00; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 40px; margin-bottom: 10px; }

/* ------------------------------------------------------------
   Navigation calendrier (jour précédent / suivant)
   ------------------------------------------------------------ */
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 6px 8px;
}
.calendar-nav button.nav-arrow {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.calendar-nav button.nav-arrow:hover:not(:disabled) { background: #eef4ef; border-color: var(--primary-light); }
.calendar-nav button.nav-arrow:disabled { opacity: 0.35; cursor: not-allowed; }
.calendar-nav .nav-date-label {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--primary-dark);
    min-width: 190px;
    text-align: center;
}

/* ------------------------------------------------------------
   Recherche de personnel
   ------------------------------------------------------------ */
.search-wrap { position: relative; }
.search-input-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 7px 12px;
    min-width: 230px;
}
.search-input-box input {
    border: none;
    outline: none;
    font-size: 13px;
    flex: 1;
    background: transparent;
}
.search-results {
    position: absolute;
    top: 44px;
    left: 0;
    width: 320px;
    max-height: 340px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    display: none;
}
.search-results.open { display: block; }
.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.search-result-item:hover { background: #f4f8f5; }
.search-result-item .sr-name { font-weight: 700; font-size: 13px; color: var(--primary-dark); }
.search-result-item .sr-meta { font-size: 11px; color: var(--text-muted); }
.search-result-item .sr-count {
    font-size: 11px; background: #eef4ef; color: var(--primary); border-radius: 20px; padding: 2px 9px; font-weight: 700;
}
.search-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 12.5px; }

/* Panneau des tâches d'une personne */
.person-panel-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px;
}
.person-panel-header h3 { margin: 0; }
.scope-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 18px; }
.scope-tabs button {
    border: 1.5px solid var(--border); background: #fff; padding: 7px 14px; border-radius: 20px;
    font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text);
}
.scope-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.person-task-list { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; }
.person-task-item {
    border: 1px solid var(--border); border-left-width: 5px; border-radius: 8px; padding: 10px 14px; background: #fff;
}
.person-task-item .pt-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.person-task-item .pt-bureau { font-weight: 700; color: var(--primary-dark); }
.person-task-item .pt-desc { font-size: 13px; color: var(--text); }

/* ------------------------------------------------------------
   Impression
   ------------------------------------------------------------ */
@media print {
    @page { size: A4 landscape; margin: 10mm; }
    .sidebar, .topbar, .toolbar, .no-print, .cell-actions, .notif-toast, .notif-panel, .menu-toggle, .sidebar-overlay, .app-dialog-overlay { display: none !important; }
    .main { display: block; }
    .matrix-wrap { overflow: visible; border: none; box-shadow: none; padding: 0; }
    table.matrix { min-width: 0 !important; width: 100%; }
    .evt-card, .day-block-header, .svc-label, .slot-pill {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .content { padding: 0; }
    .main { margin-left: 0 !important; }
    body { background: #fff; }
    table.matrix { font-size: 10px; }
    .panel { box-shadow: none; }
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 900px) {
    .sidebar { position: fixed; left: -240px; height: 100vh; z-index: 200; transition: left .2s; }
    .sidebar.open { left: 0; }
    .app-shell { display: block; }
}

/* ------------------------------------------------------------
   Barre d'outils "⋯ Plus d'options" : sur mobile, seule l'action
   principale reste visible directement ; les actions secondaires
   (recherche, disponibilité, impression...) se replient derrière un
   bouton "⋯" pour une présentation simplifiée et non encombrée.
   Sur ordinateur, .toolbar-more s'affiche normalement (display:contents
   = ses enfants rejoignent le flux du .toolbar-right comme s'il n'existait pas).
   ------------------------------------------------------------ */
.toolbar-more { display: contents; }
.toolbar-more-toggle { display: none; }

@media (max-width: 760px) {
    .toolbar-more-toggle {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background: #eef2f0;
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 9px 14px;
        font-size: 13px;
        font-weight: 700;
        color: var(--primary-dark);
        cursor: pointer;
    }
    .toolbar-more {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
        margin-top: 8px;
        order: 10;
    }
    .toolbar-more.open { display: flex; }
    .toolbar-more > * { width: 100%; }
    .toolbar-more .search-wrap { width: 100%; }
}

/* ------------------------------------------------------------
   Ajustements généraux pour petits écrans (téléphones/tablettes) :
   présentation resserrée mais lisible, options secondaires réduites.
   ------------------------------------------------------------ */
@media (max-width: 900px) {
    .content { padding: 14px; }
    .topbar { padding: 0 14px; height: 56px; }
    .topbar h2 { font-size: 14px; }
    .topbar .user-chip span { display: none; } /* seul l'avatar reste visible */
    .panel { padding: 14px; border-radius: 12px; }
    .toolbar { gap: 8px; }
    .toolbar-left, .toolbar-right { width: 100%; }
    .form-row { flex-direction: column; gap: 0; }
    .calendar-nav { width: 100%; justify-content: space-between; }
    .calendar-nav .nav-date-label { min-width: 0; font-size: 12.5px; }
    .modal-box { padding: 18px; max-width: 94vw; }
    table.admin-table { display: block; overflow-x: auto; white-space: nowrap; }
    .reunion-card { flex-direction: column; align-items: stretch; }
    .reunion-card-action { align-self: flex-start; }
    .dispo-row { grid-template-columns: 1fr 1fr; }
    .dispo-remaining { grid-column: span 2; }
}

@media (max-width: 480px) {
    .evt-card .evt-person { font-size: 13px; }
    .evt-card .evt-desc { font-size: 12px; }
    .day-tabs button { min-width: 40px; padding: 6px 8px; }
    .stat-card .stat-value { font-size: 21px; }
}

.spinner {
    border: 3px solid #e1e6e3;
    border-top-color: var(--primary);
    border-radius: 50%;
    width: 22px; height: 22px;
    animation: spin .7s linear infinite;
    margin: 30px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ------------------------------------------------------------
   Menu latéral : ouverture / fermeture (MATRIXO)
   ------------------------------------------------------------ */
.sidebar { transition: width .2s ease, left .2s ease, transform .2s ease; }
.app-shell.sidebar-collapsed .sidebar { width: 0; padding: 0; overflow: hidden; }

/* Le contenu principal laisse la place du menu fixe et suit son repli */
.main { margin-left: 240px; transition: margin-left .2s ease; }
.app-shell.sidebar-collapsed .main { margin-left: 0; }

.menu-toggle {
    border: none;
    background: #eef2f0;
    border-radius: 8px;
    width: 38px;
    height: 34px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    margin-right: 14px;
    flex-shrink: 0;
}
.menu-toggle span {
    display: block;
    width: 17px;
    height: 2px;
    border-radius: 2px;
    background: var(--primary-dark);
    transition: transform .15s;
}
.menu-toggle:hover { background: #e2e9e5; }

.brand-name { font-size: 17px; font-weight: 800; letter-spacing: 1px; color: #fff; line-height: 1.15; }
.brand-name small { display: block; font-size: 10px; font-weight: 500; letter-spacing: 0.4px; color: #9fc2ab; text-transform: uppercase; }

.sidebar-close {
    display: none;
    margin-left: auto;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #cfead9;
    width: 26px; height: 26px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(12, 27, 19, 0.45);
    z-index: 150;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 900px) {
    .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
    .app-shell.sidebar-collapsed .sidebar { width: 240px; padding: 20px 0; }
    .main, .app-shell.sidebar-collapsed .main { margin-left: 0; }
    table.matrix { min-width: 760px; }
}

/* ------------------------------------------------------------
   Boîte de dialogue applicative (remplace alert/confirm)
   ------------------------------------------------------------ */
.app-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 27, 19, 0.55);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}
.app-dialog-overlay.open { display: flex; }
.app-dialog-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 420px;
    width: 100%;
    padding: 26px 26px 20px;
    text-align: center;
    animation: cardIn 0.22s ease;
}
.app-dialog-icon { font-size: 34px; margin-bottom: 8px; }
.app-dialog-box h3 { margin: 0 0 6px; font-size: 16px; color: var(--primary-dark); }
.app-dialog-box p { margin: 0 0 20px; font-size: 13.5px; color: var(--text); line-height: 1.5; }
.app-dialog-box p small { color: var(--text-muted); font-size: 12px; }
.app-dialog-actions { display: flex; justify-content: center; gap: 10px; }

/* Bouton "+ Ajouter une tâche" */
.btn-add-task {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(27, 67, 50, 0.28);
}
.btn-add-task:hover { background: var(--primary-light); transform: translateY(-1px); }


/* ------------------------------------------------------------
   Pagination des tableaux (ex : Toutes les périodes)
   ------------------------------------------------------------ */
.table-pager {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.pager-btn {
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    padding: 0 8px;
}
.pager-btn:hover:not(:disabled) { background: #eef6f1; border-color: var(--primary-light); }
.pager-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.pager-btn:disabled { opacity: 0.4; cursor: default; }
.pager-info { margin-left: 8px; font-size: 12px; color: var(--text-muted); }

/* Champ texte dans la boîte de dialogue MATRIXO (appPrompt) */
.app-dialog-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 18px;
}
.app-dialog-input:focus { outline: none; border-color: var(--primary-light); }

/* Case "réunion" dans le formulaire de tâche */
.field-check { margin-top: -4px; }
.check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text);
}
.check-label input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }

/* Badge "réunion" sur une carte de tâche */
.evt-card.evt-meeting {
    border-style: dashed;
    border-width: 2px;
}
.evt-meeting-badge {
    display: inline-block;
    background: #b8860b;
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.3px;
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 2px;
}

/* ------------------------------------------------------------
   Disponibilité (recherche de personnel libre)
   ------------------------------------------------------------ */
.modal-box-wide { max-width: 640px; }
.dispo-hint { font-size: 12.5px; color: var(--text-muted); margin: -8px 0 16px; line-height: 1.5; }
.dispo-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
.dispo-row {
    display: grid;
    grid-template-columns: 1.3fr 1.3fr 0.9fr 1fr;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: #f6f8f7;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s, transform .12s;
}
.dispo-row:hover { background: #eaf4ee; border-color: var(--primary-light); transform: translateY(-1px); }
.dispo-name { font-weight: 700; font-size: 13.5px; color: var(--primary-dark); }
.dispo-scope { font-size: 12px; color: var(--text-muted); }
.dispo-status { font-size: 12px; font-weight: 700; white-space: nowrap; }
.dispo-status-libre { color: #1e8e3e; }
.dispo-status-termine { color: #1c6dd0; }
.dispo-remaining { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
@media (max-width: 640px) {
    .dispo-row { grid-template-columns: 1fr; gap: 3px; }
}

/* ------------------------------------------------------------
   Réunions
   ------------------------------------------------------------ */
.reunion-bureaux-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    background: #f6f8f7;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
}
.reunion-bureau-check { font-weight: 500; font-size: 13px; }

.reunion-list { display: flex; flex-direction: column; gap: 12px; }
.reunion-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
}
.reunion-card.pending { border-left: 4px solid #d4a017; }
.reunion-card.acked { border-left: 4px solid #2d6a4f; }
.reunion-card-main { display: flex; gap: 14px; flex: 1; min-width: 0; }
.reunion-card-date {
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    border-radius: 10px;
    background: #eef4f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
}
.reunion-card-date .rc-day { font-size: 19px; font-weight: 800; line-height: 1.1; }
.reunion-card-date .rc-mon { font-size: 10.5px; text-transform: uppercase; color: var(--text-muted); }
.reunion-card-body h4 { margin: 0 0 4px; font-size: 14.5px; color: var(--primary-dark); }
.reunion-meta { font-size: 12px; color: var(--text-muted); margin: 0 0 6px; }
.reunion-desc { font-size: 12.5px; color: var(--text); margin: 0 0 8px; }
.reunion-card-action { flex-shrink: 0; }
.reunion-accuses { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.acc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    background: #f6f8f7;
    border-radius: 8px;
    padding: 6px 10px;
}

/* Pastille de compteur sur "Réunions" dans le menu (réunions non accusées) */
.nav-badge {
    display: inline-block;
    background: #c0392b;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    border-radius: 999px;
    padding: 1px 7px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ------------------------------------------------------------
   Module "Gestion des RDV"
   ------------------------------------------------------------ */
.rdv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}
.rdv-tabs { display: flex; gap: 6px; background: #f0f3f1; border-radius: 10px; padding: 4px; }
.rdv-tabs a {
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
}
.rdv-tabs a.active { background: var(--primary); color: #fff; }

.rdv-group { margin-bottom: 22px; }
.rdv-group-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-dark);
    color: #fff;
    font-weight: 800;
    font-size: 12.5px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 7px 16px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.rdv-bureau-tag {
    background: rgba(255,255,255,0.22);
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 10.5px;
}

.rdv-cards { display: flex; flex-direction: column; gap: 10px; }
.rdv-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary-light);
    border-radius: 12px;
    padding: 14px 18px;
}
.rdv-card-main { flex: 1; min-width: 0; }
.rdv-titre { font-size: 14.5px; font-weight: 600; color: var(--text); margin: 0 0 8px; line-height: 1.5; }
.rdv-freq-chip {
    display: inline-block;
    background: #fdf3d8;
    color: #8a6a10;
    border: 1px solid #f0d98c;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
}
.rdv-notes { font-size: 12.5px; color: var(--text-muted); margin: 8px 0 0; line-height: 1.5; }
.rdv-card-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

.rdv-history { display: flex; flex-direction: column; gap: 8px; }
.rdv-hist-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f6f8f7;
    border-radius: 10px;
    padding: 10px 14px;
}
.rdv-hist-icon { font-size: 16px; flex-shrink: 0; }
.rdv-hist-text { flex: 1; font-size: 13px; color: var(--text); }
.rdv-hist-date { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

@media (max-width: 760px) {
    .rdv-card { flex-direction: column; }
    .rdv-card-actions { flex-direction: row; width: 100%; }
    .rdv-card-actions .btn { flex: 1; }
    .rdv-hist-row { flex-wrap: wrap; }
    .rdv-hist-date { width: 100%; }
}

/* ------------------------------------------------------------
   Module Gantt
   ------------------------------------------------------------ */
.gantt-toolbar-top {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    flex-wrap: wrap;
}
.gantt-project-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex: 1;
    padding-bottom: 2px;
}
.gantt-project-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f6f8f7;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.gantt-project-chip .gpc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--proj-color, #2D6A4F); }
.gantt-project-chip .gpc-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-project-chip .gpc-pct { color: var(--text-muted); font-size: 11px; }
.gantt-project-chip.active {
    border-color: var(--proj-color, #2D6A4F);
    background: color-mix(in srgb, var(--proj-color, #2D6A4F) 12%, #ffffff);
}

.gantt-proj-title { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.gantt-proj-title h3 { margin: 0; font-size: 16px; color: var(--primary-dark); }
.gantt-proj-dot { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.gantt-proj-meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; }
.gantt-proj-progress { display: flex; align-items: center; gap: 8px; }
.gpp-bar { display: inline-block; width: 120px; height: 7px; border-radius: 999px; background: #e6ebe8; overflow: hidden; }
.gpp-bar > span { display: block; height: 100%; border-radius: 999px; }
.gantt-proj-desc { font-size: 12.5px; color: var(--text); margin: 6px 0; }
.gantt-proj-actions { margin-top: 6px; }

.gantt-color-picker { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; }
.gantt-swatch {
    width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
    border: 2px solid transparent; box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.gantt-swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--primary-dark); }

/* ---- Grille du diagramme ---- */
.gantt-scroll {
    overflow: auto;
    max-height: 65vh;
    border: 1px solid var(--border);
    border-radius: 12px;
    position: relative;
}
.gantt-row { display: flex; border-bottom: 1px solid #eef1ef; min-height: 44px; }
.gantt-row:last-child { border-bottom: none; }
.gantt-header-row { position: sticky; top: 0; z-index: 5; background: #f6f8f7; border-bottom: 2px solid var(--border); min-height: 44px; }

.gantt-cell-label {
    position: sticky;
    left: 0;
    z-index: 3;
    width: 300px;
    flex-shrink: 0;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px 0 0;
    font-size: 12.5px;
    cursor: pointer;
    border-right: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gantt-header-row .gantt-cell-label {
    background: #f6f8f7;
    z-index: 6;
    font-weight: 700;
    color: var(--primary-dark);
    cursor: default;
    padding-left: 14px;
}
.gantt-wbs { font-weight: 700; color: var(--text-muted); font-size: 11px; flex-shrink: 0; }
.gantt-titre-block { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.gantt-titre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-resp-mini { font-size: 10px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-cellule-tag {
    background: color-mix(in srgb, var(--evt-color, #2D6A4F) 15%, #ffffff);
    color: var(--primary-dark);
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    flex-shrink: 0;
}
.gantt-wf-badge { font-size: 11px; flex-shrink: 0; }
.gantt-wf-badge.wf-brouillon { color: #8a6a10; }
.gantt-wf-badge.wf-soumis { color: #1c6dd0; }
.gantt-wf-badge.wf-valide { color: #1e8e3e; }
.gantt-wf-badge.wf-rejete { color: #c0392b; }

.gantt-cell-timeline {
    position: relative;
    background-image: repeating-linear-gradient(to right, #f0f2f0 0, #f0f2f0 1px, transparent 1px, transparent 100%);
}

.gantt-tick {
    position: absolute;
    top: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-muted);
    border-right: 1px solid #e5e9e6;
}
.gantt-tick.weekend { background: #fafbfa; }
.gantt-tick.today { background: #eaf4ee; }
.gantt-tick .gt-dow { font-size: 8.5px; text-transform: uppercase; }
.gantt-tick .gt-num { font-weight: 700; font-size: 11px; }
.gantt-today-flag {
    position: absolute;
    top: 2px;
    transform: translateX(-50%);
    background: var(--danger, #c0392b);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 2;
}

.gantt-bar {
    position: absolute;
    top: 5px;
    height: 34px;
    border-radius: 7px;
    /* Fond très légèrement teinté (repère de couleur du projet/cellule) —
       nettement plus clair que les pistes de progression pour qu'elles
       ne se confondent jamais avec lui. */
    background: color-mix(in srgb, var(--bar-color, #2D6A4F) 10%, #ffffff);
    border: 1px solid var(--bar-color, #2D6A4F);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 4px 8px;
    box-sizing: border-box;
    transition: transform .1s;
}
.gantt-bar:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.15); }
.gantt-bar.gantt-readonly { cursor: default; opacity: 0.85; }
.gantt-bar-label {
    font-size: 10.5px;
    font-weight: 700;
    color: #17251d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gantt-bar-tracks { display: flex; flex-direction: column; gap: 2.5px; }
.gantt-bar-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.10);
    overflow: hidden;
}
.gantt-bar-track > span { display: block; height: 100%; border-radius: 999px; }
/* Deux couleurs délibérément très différentes (bleu-gris neutre vs doré
   saturé) pour que les deux barres de progression restent lisibles l'une
   à côté de l'autre, quelle que soit la couleur du projet/cellule. */
.gantt-track-tempo > span { background: #64748b; }
.gantt-track-manuel > span { background: #d4a017; }
.gantt-milestone {
    position: absolute;
    top: 10px;
    width: 20px;
    height: 20px;
    transform: rotate(45deg) translateX(-50%);
    border-radius: 3px;
    cursor: pointer;
    box-shadow: 0 0 0 2px #fff, 0 2px 5px rgba(0,0,0,0.2);
}

/* Case "Terminée" : coche rapide sur la ligne (colonne étiquette), et
   habillage discret (opacité réduite + liseré vert) de la barre/losange
   correspondant — sans changer la structure des deux pistes de
   progression, qui restent affichées comme repère du travail effectué. */
.gantt-done-toggle {
    flex-shrink: 0;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    user-select: none;
    opacity: 0.55;
}
.gantt-done-toggle:hover { opacity: 1; transform: scale(1.15); }
.gantt-done-toggle.done { opacity: 1; }
.gantt-titre-done { text-decoration: line-through; color: var(--text-muted); }
.gantt-collapse-toggle {
    flex-shrink: 0;
    cursor: pointer;
    font-size: 10px;
    color: var(--text-muted);
    width: 12px;
    display: inline-flex;
    justify-content: center;
    user-select: none;
}
.gantt-collapse-toggle:hover { color: var(--primary); }
.gantt-collapse-spacer { flex-shrink: 0; width: 12px; display: inline-block; }

/* ---- Vue Liste/Tableau (alternative à la frise) ---- */
.gantt-list-wrap { overflow-x: auto; }
.gantt-list-table { min-width: 900px; }
.gantt-list-table td { vertical-align: middle; }
.gantt-list-wbs { font-weight: 700; color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.gantt-list-row:hover { background: #f6f8f7; }
.gantt-list-pct-track {
    display: inline-block;
    width: 60px;
    height: 6px;
    border-radius: 999px;
    background: rgba(0,0,0,0.08);
    overflow: hidden;
    vertical-align: middle;
    margin-right: 4px;
}
.gantt-list-pct-track > span { display: block; height: 100%; }

/* ---- Vue Ressources (charge de travail par personne) ---- */
.gantt-resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.gantt-resource-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: #fff;
}
.gantt-resource-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.gantt-resource-name { font-weight: 700; font-size: 14px; }
.gantt-resource-count { font-size: 11px; color: var(--text-muted); }
.gantt-resource-load-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.gantt-resource-load-label { flex-shrink: 0; }
.gantt-resource-tasks { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.gantt-resource-task-chip {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #eef4f0;
    color: var(--primary-dark);
    cursor: pointer;
    white-space: nowrap;
}
.gantt-resource-task-chip:hover { background: #dcebe1; }
.gantt-resource-task-chip.done { background: #e9f6ec; color: #1e8e3e; text-decoration: line-through; }
.gantt-bar.gantt-bar-done, .gantt-milestone.gantt-bar-done {
    opacity: 0.6;
    box-shadow: 0 0 0 2px #1e8e3e inset;
}

.gantt-fiche-section-title {
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--primary-dark);
    background: #eef4f0;
    padding: 7px 12px;
    border-radius: 8px;
    margin: 18px 0 12px;
}
.gantt-pieces-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.gantt-pieces-table th {
    background: #f6f8f7;
    text-align: left;
    font-size: 10.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 6px 8px;
}
.gantt-pieces-table td { padding: 4px; border-bottom: 1px solid #eef1ef; }
.gantt-pieces-table input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 7px;
    font-size: 12px;
    box-sizing: border-box;
}
.gantt-row-remove {
    border: none;
    background: #fdecea;
    color: #c0392b;
    width: 24px; height: 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.gantt-workflow-zone { background: #f6f8f7; border-radius: 10px; padding: 12px 14px; margin-top: 16px; }
.gantt-rejet-note { font-size: 12px; color: #c0392b; margin: 8px 0 0; }

.modal-box-tall { max-height: 88vh; overflow-y: auto; }

@media (max-width: 900px) {
    .gantt-cell-label { width: 200px; }
    .gantt-scroll { max-height: 55vh; }
    .gantt-proj-meta { gap: 10px; }
}

/* ------------------------------------------------------------
   Saisie multi-noms "Personnes concernées" (étiquettes), façon
   personnel de la matrice — utilisée dans le formulaire de tâche ET
   dans la fiche de détail (lecture seule).
   ------------------------------------------------------------ */
.gantt-chip-input-row { display: flex; gap: 8px; margin-top: 6px; }
.gantt-chip-input-row input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 13px;
}
.gantt-chip-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.gantt-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef4f0;
    color: var(--primary-dark);
    border: 1px solid #d5e6dc;
    border-radius: 999px;
    padding: 5px 8px 5px 12px;
    font-size: 12.5px;
    font-weight: 600;
}
.gantt-chip button {
    border: none;
    background: rgba(27, 67, 50, 0.12);
    color: var(--primary-dark);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.gantt-chip button:hover { background: rgba(27, 67, 50, 0.22); }
.gantt-chip-static { padding: 5px 12px; }
.gantt-detail-empty { color: var(--text-muted); font-size: 12.5px; font-style: italic; }

/* ------------------------------------------------------------
   Fiche de détail d'une tâche (vue lecture au clic)
   ------------------------------------------------------------ */
.gantt-detail-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.gantt-detail-header h3 { margin: 0; font-size: 17px; color: var(--primary-dark); }
.gantt-detail-dot { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.gantt-detail-badges { display: flex; gap: 8px; margin-bottom: 18px; }
.gantt-detail-block { margin-bottom: 18px; }
.gantt-detail-label {
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.gantt-detail-text { font-size: 13.5px; color: var(--text); line-height: 1.6; margin: 0; white-space: pre-line; }

.gantt-progress-row {
    display: grid;
    grid-template-columns: 220px 1fr 46px;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.gantt-progress-row:last-child { margin-bottom: 0; }
.gantt-progress-name { font-size: 12.5px; color: var(--text); }
.gantt-progress-track {
    display: block;
    height: 9px;
    border-radius: 999px;
    background: #eef1ef;
    overflow: hidden;
}
.gantt-progress-track > span { display: block; height: 100%; border-radius: 999px; }
.gantt-progress-tempo > span { background: #64748b; }
.gantt-progress-manuel > span { background: #d4a017; }
.gantt-progress-pct { font-size: 12.5px; font-weight: 700; color: var(--text); text-align: right; }

@media (max-width: 640px) {
    .gantt-progress-row { grid-template-columns: 1fr; gap: 4px; }
    .gantt-progress-pct { text-align: left; }
}

/* ------------------------------------------------------------
   Alertes de performance (retard, échéance proche/dépassée)
   ------------------------------------------------------------ */
.gantt-alert-badge { font-size: 11px; flex-shrink: 0; cursor: help; }

.gantt-alert-summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.gantt-alert-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}
.gantt-alert-chip.gantt-alert-echeance_depassee { background: #fdecea; color: #c0392b; }
.gantt-alert-chip.gantt-alert-echeance_proche { background: #fdf3d8; color: #8a6a10; }
.gantt-alert-chip.gantt-alert-retard { background: #eef1f6; color: #45557a; }

.gantt-alert-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 10px;
}
.gantt-alert-banner.gantt-alert-echeance_depassee { background: #fdecea; color: #a3281e; }
.gantt-alert-banner.gantt-alert-echeance_proche { background: #fdf3d8; color: #7a5c0d; }
.gantt-alert-banner.gantt-alert-retard { background: #eef1f6; color: #38466b; }

/* ------------------------------------------------------------
   Sous-tâches (dans la fiche de détail d'une tâche)
   ------------------------------------------------------------ */
.gantt-detail-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.gantt-subtask-list { display: flex; flex-direction: column; gap: 6px; }
.gantt-subtask-row.gantt-subtask-done .gantt-subtask-title { text-decoration: line-through; color: var(--text-muted); }
.gantt-subtask-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: #f6f8f7;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    cursor: pointer;
    font-family: inherit;
}
.gantt-subtask-row:hover { background: #eef4f0; border-color: var(--primary-light); }
.gantt-subtask-title { flex: 1; font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-subtask-mini-bars { display: flex; flex-direction: column; gap: 3px; width: 90px; flex-shrink: 0; }
.gantt-mini-bar { display: block; height: 4px; border-radius: 999px; background: #e2e7e4; overflow: hidden; }
.gantt-mini-bar > span { display: block; height: 100%; border-radius: 999px; }
.gantt-mini-tempo > span { background: #64748b; }
.gantt-mini-manuel > span { background: #d4a017; }
.gantt-subtask-pct { font-size: 12px; font-weight: 700; color: var(--text-muted); width: 36px; text-align: right; flex-shrink: 0; }
.gantt-subtask-wf, .gantt-subtask-alert { font-size: 13px; flex-shrink: 0; width: 16px; text-align: center; }

/* ------------------------------------------------------------
   Entrées de la matrice provenant du Gantt (lecture seule, sans
   duplication de données — voir includes/functions.php)
   ------------------------------------------------------------ */
.evt-card.evt-gantt {
    border-style: dotted;
    border-width: 2px;
    cursor: default;
}
.evt-gantt-badge {
    display: inline-block;
    background: #4a5fa5;
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.3px;
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 2px;
}
.evt-gantt-link {
    font-size: 10px;
    font-weight: 700;
    color: #4a5fa5;
    text-decoration: none;
    margin-top: 2px;
}
.evt-gantt-link:hover { text-decoration: underline; }

/* Petit badge sur une tâche RÉELLE de la matrice, associée à une tâche Gantt (référence, elle reste pleinement modifiable ici) */
.evt-linked-badge {
    display: inline-block;
    background: #eef1f6;
    color: #4a5fa5;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    margin-top: 2px;
}

/* Tâches de la matrice associées, dans la fiche de détail Gantt */
.gantt-lien-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f6f8f7;
    border-radius: 8px;
    padding: 7px 12px;
    margin-bottom: 6px;
    font-size: 12px;
}
.gantt-lien-date { font-weight: 700; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
.gantt-lien-desc { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* ============================================================
   MATRIXO v5
   ============================================================ */
.field-hint { font-size: 11.5px; color: var(--text-muted); }
.pager-gap { padding: 0 4px; color: var(--text-muted); }
.table-scroll { overflow-x: auto; }

/* --- Statut d'exécution des tâches de la matrice --- */
.evt-card.evt-done { opacity: .78; background-image: linear-gradient(0deg, rgba(30,142,62,.08), rgba(30,142,62,.08)); }
.evt-card.evt-done .evt-desc { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.35); }
.evt-card.evt-late { box-shadow: inset 0 0 0 2px #c0392b; }
.evt-statut {
    display: inline-block; font-size: 9.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-bottom: 2px;
}
.evt-statut-termine { background: #e6f6ea; color: #1e7b34; }
.evt-statut-non_termine { background: #fdecea; color: #a5281c; }
.cell-actions button.cell-done-btn { background: #1e8e3e; }
.task-statut-banner { padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.task-statut-banner.ok { background: #e6f6ea; color: #1e7b34; }
.task-statut-banner.ko { background: #fdecea; color: #a5281c; }
.task-statut-banner a { text-decoration: underline; font-weight: 700; }

/* --- Sélecteur de ressources --- */
.rp-chips { margin-bottom: 6px; }
.rp-select { width: 100%; }
.rp-empty { font-size: 12px; color: var(--text-muted); background: #f6f8f7; border: 1px dashed var(--border); border-radius: 8px; padding: 8px 10px; }
.gantt-chip.rp-chip-off { background: #fdf3d6; color: #8a6d00; }

/* --- Notifications cliquables --- */
.notif-item.notif-link { cursor: pointer; }
.notif-item.notif-link:hover { background: #eef6f1; }

/* --- Tâches non terminées --- */
.nt-motif { font-size: 12.5px; margin: 4px 0 2px; max-width: 360px; }
.nt-synthese { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.nt-bar-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 12.5px; }
.nt-bar-lbl { flex: 0 0 220px; }
.nt-bar-track { flex: 1; height: 8px; background: #eef1ef; border-radius: 4px; overflow: hidden; }
.nt-bar-track span { display: block; height: 100%; background: #c2703d; border-radius: 0 4px 4px 0; }
.nt-bar-val { width: 28px; text-align: right; font-weight: 700; }

/* --- Synchronisation Gantt → Matrice + tâches associées --- */
.gtd-sync-form { background: #f6f8f7; border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.gts-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gts-chip input { width: auto; margin: 0; }
.gts-chip { display: inline-flex; flex-direction: row; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; }
.gts-chip.gts-deja { border-color: #1e8e3e; background: #e6f6ea; }
.lien-resume { display: flex; align-items: center; gap: 10px; font-size: 12.5px; margin-bottom: 8px; }
.lien-group-title { font-size: 12px; font-weight: 700; color: var(--primary-dark); margin: 10px 0 4px; }
.gantt-lien-row .lien-statut { font-size: 14px; }
.gantt-lien-row.lien-ok { background: #eef8f0; }
.gantt-lien-row.lien-ko { background: #fdf0ee; }
.gantt-lien-row .gantt-lien-desc { white-space: normal; }
.lien-motif { color: #a5281c; }

/* --- Module Ressources --- */
.rs-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rs-scope-label { font-weight: 400; color: var(--text-muted); font-size: 14px; }
.rs-group-title { font-weight: 700; color: var(--primary-dark); margin: 14px 0 8px; font-size: 13px; }
.rs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.rs-card { text-align: left; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; font: inherit; }
.rs-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow); }
.rs-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.rs-card-name { font-weight: 700; font-size: 13px; }
.rs-card-fn { font-size: 11.5px; color: var(--text-muted); }
.rs-card-counts { display: flex; gap: 12px; font-size: 12px; color: var(--text); }
.rs-taux { font-weight: 800; font-size: 12px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.rs-taux-good { background: #e6f6ea; color: #1e7b34; }
.rs-taux-warn { background: #fdf3d6; color: #8a6d00; }
.rs-taux-bad { background: #fdecea; color: #a5281c; }
.rs-taux-na { background: #eef1ef; color: #667; }
.rs-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rs-kpi { background: #f6f8f7; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.rs-kpi-val { font-size: 22px; font-weight: 800; color: var(--primary-dark); }
.rs-kpi-val .rs-taux { font-size: 18px; }
.rs-kpi-lbl { font-size: 11.5px; color: var(--text-muted); }
.rs-evo { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding: 4px 2px; border-bottom: 1px solid var(--border); }
.rs-evo-col { flex: 1; max-width: 56px; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; }
.rs-evo-val { font-size: 10.5px; color: var(--text); font-weight: 700; }
.rs-evo-track { flex: 1; width: 22px; display: flex; align-items: flex-end; }
.rs-evo-bar { display: block; width: 100%; border-radius: 4px 4px 0 0; }
.rs-evo-bar.rs-taux-good { background: #2f9e44; }
.rs-evo-bar.rs-taux-warn { background: #d4a017; }
.rs-evo-bar.rs-taux-bad { background: #c0392b; }
.rs-evo-bar.rs-taux-na { background: #c9d1cd; }
.rs-evo-lbl { font-size: 10px; color: var(--text-muted); }
.rs-tabs { display: flex; gap: 6px; margin: 14px 0 8px; flex-wrap: wrap; }
.rs-tabs button { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; }
.rs-tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.rs-etat { font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.rs-etat-ok { color: #1e7b34; } .rs-etat-ko { color: #a5281c; } .rs-etat-run { color: #8a6d00; } .rs-etat-next { color: #4a5fa5; } .rs-etat-na { color: #889; }
.rs-motif { color: #a5281c; }
.rs-link { font-size: 12px; color: var(--primary-light); font-weight: 700; white-space: nowrap; }
.rs-name-link { color: var(--primary-light); font-weight: 700; }
.rs-name-link:hover { text-decoration: underline; }
@media (max-width: 700px) {
    .rs-kpis { grid-template-columns: repeat(2, 1fr); }
    .nt-bar-lbl { flex-basis: 130px; }
}

/* --- Objectifs (module RDV) --- */
.obj-grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
.obj-grid th { background: #f6f8f7; color: var(--text-muted); font-weight: 700; padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
.obj-grid th.obj-today { background: var(--primary); color: #fff; border-radius: 6px 6px 0 0; }
.obj-grid td { border-bottom: 1px solid var(--border); padding: 6px 8px; text-align: center; }
.obj-grid .obj-col-title { text-align: left; min-width: 240px; }
.obj-type { display: inline-block; font-size: 10px; font-weight: 700; background: #eef1ef; color: #556; padding: 1px 7px; border-radius: 999px; margin-right: 4px; }
.obj-type-jour { background: #eef1f6; color: #4a5fa5; }
.obj-cell { font-size: 15px; min-width: 46px; position: relative; }
.obj-cell.obj-clickable { cursor: pointer; }
.obj-cell.obj-clickable:hover { outline: 2px solid var(--primary-light); outline-offset: -3px; border-radius: 6px; }
.obj-cell.obj-ok { background: #eef8f0; }
.obj-cell.obj-mid { background: #fdf8e6; }
.obj-cell.obj-ko { background: #fdf0ee; }
.obj-cell.obj-na { color: #c9d1cd; }
.obj-cell.obj-missing { color: #8a6d00; font-weight: 700; background: repeating-linear-gradient(45deg, #fff, #fff 5px, #fdf8e6 5px, #fdf8e6 10px); }
.obj-cell.obj-todo { color: var(--primary-light); font-weight: 700; }
.obj-cell.obj-future { background: #fafbfa; }
.obj-pb { font-size: 11px; position: absolute; top: 1px; right: 3px; }
.obj-unit { margin-bottom: 18px; }
.obj-radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.obj-radio { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; }
.obj-radio:has(input:checked) { border-color: var(--primary); background: #eef6f1; font-weight: 700; }
.obj-kpis .stat-value .rs-taux { font-size: 20px; }
details.manual-periode summary { cursor: pointer; font-weight: 700; color: var(--primary-dark); font-size: 14px; }

/* --- v5.1 : Gantt plein écran, archives, ressources matrice --- */
body.gantt-fs #ganttChartPanel {
    position: fixed; inset: 0; z-index: 400; margin: 0; border-radius: 0; overflow: auto; padding: 14px 18px;
}
body.gantt-fs .gantt-scroll { max-height: calc((100vh - 80px) / var(--gz, 1)); }
body.gantt-fs .gantt-list-wrap, body.gantt-fs .gantt-resources-grid { max-height: calc(100vh - 90px); overflow: auto; }
.gantt-archive-banner { background: #fdf3d6; color: #8a6d00; border-radius: 8px; padding: 8px 12px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.gantt-project-chip.archived { opacity: .75; border-style: dashed; }
#ganttArchivesBtn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.gantt-resource-matrice { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; }
.grm-chip { padding: 1px 7px; border-radius: 999px; font-weight: 700; }
.grm-ok { background: #e6f6ea; color: #1e7b34; } .grm-ko { background: #fdecea; color: #a5281c; } .grm-todo { background: #eef1f6; color: #4a5fa5; }
.grm-days { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.grm-day { font-size: 10px; padding: 1px 5px; border-radius: 4px; background: #eef1ef; color: #556; }
.grm-day.grm-termine { background: #e6f6ea; color: #1e7b34; }
.grm-day.grm-non_termine { background: #fdecea; color: #a5281c; }
.obj-conf { position: absolute; bottom: 1px; left: 3px; font-size: 10px; font-weight: 800; }
.obj-conf-ok { color: #1e7b34; } .obj-conf-ko { color: #a5281c; }
.obj-cell.obj-to-confirm { box-shadow: inset 0 -3px 0 #d4a017; }
.obj-confirm-box { background: #f6f8f7; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 6px; }
.obj-conf-count { font-size: 11px; color: var(--text-muted); }

/* --- v5.1 : « Nos RDV » (registre) --- */
.rdv2-apercu { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 18px; }
.rdv2-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; align-content: start; }
.rdv2-kpi { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; cursor: pointer; border-left: 4px solid var(--rdv-c, var(--primary)); }
.rdv2-kpi:hover { box-shadow: var(--shadow); }
.rdv2-kpi-main { cursor: default; background: linear-gradient(135deg, #1b4332, #2d6a4f); color: #fff; border: none; }
.rdv2-kpi-main .rdv2-kpi-lbl { color: #d8efe2; }
.rdv2-kpi-val { font-size: 22px; font-weight: 800; }
.rdv2-kpi-lbl { font-size: 11.5px; color: var(--text-muted); }
.rdv2-next { background: #fffaf0; border: 1px solid #f2e3b3; border-radius: 12px; padding: 12px 14px; }
.rdv2-next-title { font-weight: 800; color: #8a6d00; font-size: 13px; }
.rdv2-next-title small { font-weight: 400; }
.rdv2-next-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rdv2-next-list li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.rdv2-next-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdv2-next-date { color: var(--text-muted); font-weight: 700; }
.rdv2-j { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #eef1f6; color: #4a5fa5; white-space: nowrap; }
.rdv2-j-soon { background: #fdf3d6; color: #8a6d00; }
.rdv2-j-urgent { background: #fdecea; color: #a5281c; }
.rdv2-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.rdv2-filters input[type=search] { min-width: 240px; }
.rdv2-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.rdv2-chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; }
.rdv2-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.rdv2-group { margin-bottom: 22px; }
.rdv2-group-title { display: flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .5px; text-transform: uppercase; color: var(--primary-dark); margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid #e6efe9; }
.rdv2-count { background: #eef1ef; color: #556; border-radius: 999px; font-size: 11px; padding: 1px 8px; }
.rdv2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.rdv2-card { display: flex; gap: 12px; background: #fff; border: 1px solid var(--border); border-left: 5px solid var(--rdv-c, var(--primary)); border-radius: 12px; padding: 12px 14px; transition: box-shadow .15s; }
.rdv2-card:hover { box-shadow: var(--shadow); }
.rdv2-card-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--rdv-bg, #eef6f1); flex-shrink: 0; }
.rdv2-card-body { flex: 1; min-width: 0; }
.rdv2-card-title { margin: 0 0 6px; font-weight: 700; font-size: 14px; line-height: 1.45; }
.rdv2-card-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rdv2-freq { background: #fff3b8; color: #5c4700; font-weight: 700; font-size: 12px; padding: 2px 9px; border-radius: 6px; }
.rdv2-notes { margin: 8px 0 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.rdv2-card-actions { display: flex; flex-direction: column; gap: 6px; }
.rdv2-cat-quotidien { --rdv-c: #2f9e44; --rdv-bg: #e6f6ea; }
.rdv2-cat-hebdomadaire { --rdv-c: #4a5fa5; --rdv-bg: #eef1f6; }
.rdv2-cat-mensuel { --rdv-c: #8e5ab5; --rdv-bg: #f3ecf8; }
.rdv2-cat-annuel { --rdv-c: #2a8f8f; --rdv-bg: #e6f4f4; }
.rdv2-cat-echeance { --rdv-c: #c2703d; --rdv-bg: #fbeee5; }
.rdv2-cat-evenement { --rdv-c: #b8860b; --rdv-bg: #fdf3d6; }
.rdv2-cat-autre { --rdv-c: #6b7a72; --rdv-bg: #eef1ef; }
.rdv2-print { display: none; }
@media (max-width: 900px) { .rdv2-apercu { grid-template-columns: 1fr; } .rdv2-grid { grid-template-columns: 1fr; } }
@media print {
    body.printing-rdv .app-shell > *:not(.main), body.printing-rdv .topbar, body.printing-rdv .content > *:not(.panel) { display: none !important; }
    body.printing-rdv .panel > *:not(.rdv2-print) { display: none !important; }
    body.printing-rdv .rdv2-print { display: block !important; font-family: Arial, sans-serif; }
    body.printing-rdv .panel { box-shadow: none; border: none; padding: 0; }
    .rdv2-print h2 { margin: 0 0 2px; color: #1b4332; }
    .rdv2-print p { margin: 0 0 12px; font-size: 11px; color: #555; }
    .rdv2-print table { width: 100%; border-collapse: collapse; }
    .rdv2-print th, .rdv2-print td { border: 1px solid #333; padding: 6px 8px; font-size: 12px; text-align: left; vertical-align: top; }
    .rdv2-print th { background: #44546a; color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .rdv2-print .rdv2-print-des { font-weight: 700; text-align: center; vertical-align: middle; }
    .rdv2-print .rdv2-print-freq { background: #ffff00; font-weight: 700; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* --- v5.1 : fiches personnalisées par bureau --- */
.gf-mk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.gf-mk-grid .gf-mk-large { grid-column: 1 / -1; }
@media (max-width: 700px) { .gf-mk-grid { grid-template-columns: 1fr; } }
.obj-radio input { width: auto; margin: 0; }
.obj-radio { flex-direction: row; }
.dispo-status-coche { background: #e6f6ea; color: #1e7b34; }

/* --- v5.2 : infobulles (3 s de survol) --- */
.app-tip {
    position: absolute; z-index: 3000; max-width: 280px; padding: 7px 10px; border-radius: 8px;
    background: #10291d; color: #f1f5f3; font-size: 12px; line-height: 1.45; font-weight: 500;
    box-shadow: 0 6px 20px rgba(0,0,0,.18); pointer-events: none; opacity: 0; transform: translateY(3px);
    transition: opacity .15s, transform .15s; top: -9999px; left: -9999px;
}
.app-tip.show { opacity: 1; transform: none; }
[data-tip] { cursor: help; }
button[data-tip], a[data-tip], .btn[data-tip], [onclick][data-tip], label[data-tip] { cursor: pointer; }
.obj-legend { margin-top: 12px; font-size: 11.5px; color: var(--text-muted); }
.gantt-scale { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; }
.gantt-scale #ganttScaleLbl { font-size: 12px; font-weight: 700; color: var(--text-muted); min-width: 44px; text-align: center; }
body.gantt-fs #ganttChartPanel .toolbar { position: sticky; top: 0; background: #fff; z-index: 10; padding-bottom: 8px; }

.gantt-scroll { max-height: calc(65vh / var(--gz, 1)); }
.gantt-bar-outlabel { position: absolute; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 11.5px; color: var(--text); cursor: pointer; pointer-events: auto; }
.gantt-bar-outlabel b { color: var(--text-muted); font-weight: 700; }

/* --- v5.3 : connexion par nom (choix en cas d'homonymes) --- */
.login-choices { margin: 4px 0 14px; text-align: left; }
.login-choices-title { font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; }
.login-choice { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 6px;
    border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; transition: border-color .15s, background .15s; }
.login-choice:hover { border-color: var(--primary-light); background: #f3f8f5; }
.login-choice small { color: var(--text-muted); font-size: 12px; }

/* ==================================================================
   v5.3 — ESPACE RESSOURCE (ressource/index.php) : mobile d'abord
   ================================================================== */
.btn-danger-soft { background: #fdecea; color: #a5281c; border: 1px solid #f5c6c0; }
.btn-danger-soft:hover { background: #fadbd6; }
.rp-body { background: #eef2f0; min-height: 100vh; }
.rp-header { position: sticky; top: 0; z-index: 300; background: var(--primary-dark); color: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.15); }
.rp-header-in { max-width: 980px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rp-brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.rp-brand img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.rp-brand span { font-weight: 800; letter-spacing: .5px; line-height: 1.1; display: flex; flex-direction: column; }
.rp-brand small { font-weight: 500; font-size: 11px; opacity: .7; letter-spacing: 0; }
.rp-header-actions { display: flex; align-items: center; gap: 16px; position: relative; }
.rp-header .bell-icon { filter: grayscale(1) brightness(3); }
.rp-header .notif-panel { right: 40px; top: 44px; color: var(--text); }
.rp-menu { position: relative; }
.rp-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); background: var(--accent); color: var(--primary-dark);
    font-weight: 800; font-size: 13px; cursor: pointer; }
.rp-menu-list { display: none; position: absolute; right: 0; top: 46px; min-width: 240px; background: #fff; color: var(--text); border-radius: 12px;
    box-shadow: var(--shadow-lg); padding: 6px; z-index: 400; }
.rp-menu-list.open { display: block; }
.rp-menu-who { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; gap: 2px; }
.rp-menu-who small { color: var(--text-muted); font-size: 12px; }
.rp-menu-list button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: 8px; font: inherit; font-size: 13.5px; cursor: pointer; }
.rp-menu-list button:hover { background: #f1f5f3; }

.rp-main { max-width: 980px; margin: 0 auto; padding: 16px 16px 60px; }
.rp-hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: #fff; border-radius: 18px; padding: 20px;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; box-shadow: 0 8px 24px rgba(27,67,50,.25); }
.rp-hello { font-size: 20px; }
.rp-hello b { font-weight: 800; }
.rp-unit { opacity: .85; font-size: 13px; margin-top: 4px; }
.rp-date { opacity: .7; font-size: 12.5px; margin-top: 8px; }
.rp-hero-kpis { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.rp-ring { position: relative; width: 92px; height: 92px; flex: 0 0 auto; }
.rp-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rp-ring circle { fill: none; stroke-width: 3.2; }
.rp-ring-bg { stroke: rgba(255,255,255,.18); }
.rp-ring-val { stroke: #fff; stroke-linecap: round; stroke-dasharray: 0 100; transition: stroke-dasharray .6s ease; }
.rp-ring-val.good { stroke: #8ce99a; } .rp-ring-val.warn { stroke: var(--accent-light); } .rp-ring-val.bad { stroke: #ffa8a8; }
.rp-ring-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rp-ring-txt b { font-size: 20px; }
.rp-ring-txt small { font-size: 10.5px; opacity: .75; }
.rp-kpi-list { display: grid; grid-template-columns: repeat(2, minmax(92px, 1fr)); gap: 8px; }
.rp-kpi { background: rgba(255,255,255,.1); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; }
.rp-kpi b { font-size: 18px; }
.rp-kpi span { font-size: 11.5px; opacity: .8; }
.rp-kpi-ok b { color: #b2f2bb; } .rp-kpi-ko b { color: #ffc9c9; }

.rp-tabs { display: flex; gap: 6px; margin: 18px 0 14px; overflow-x: auto; scrollbar-width: none; background: #fff; border-radius: 12px; padding: 5px; box-shadow: var(--shadow); }
.rp-tabs::-webkit-scrollbar { display: none; }
.rp-tabs button { flex: 1 0 auto; border: 0; background: none; padding: 10px 14px; border-radius: 9px; font: inherit; font-size: 13.5px; font-weight: 600;
    color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.rp-tabs button.active { background: var(--primary); color: #fff; }
.rp-count { background: var(--accent); color: var(--primary-dark); border-radius: 999px; font-size: 11px; font-weight: 800; padding: 1px 7px; }

.rp-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 4px 2px 10px; flex-wrap: wrap; }
.rp-section-head h2 { margin: 0; font-size: 17px; color: var(--primary-dark); }
.rp-section-head span { color: var(--text-muted); font-size: 12.5px; }
.rp-hint { color: var(--text-muted); font-size: 13px; margin: 0 2px 12px; }
.rp-list { display: flex; flex-direction: column; gap: 10px; }
.rp-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); display: flex; overflow: hidden; border-left: 4px solid #adb5bd; }
.rp-card.rp-st-termine { border-left-color: var(--success); }
.rp-card.rp-st-non_termine { border-left-color: var(--danger); }
.rp-card.rp-st-a_faire { border-left-color: var(--accent); }
.rp-card.rp-gantt { border-left-color: var(--primary-light); }
.rp-card-time { flex: 0 0 72px; background: #f6f8f7; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 6px; gap: 2px; }
.rp-card-time b { font-size: 15px; color: var(--primary-dark); }
.rp-card-time span { font-size: 12px; color: var(--text-muted); }
.rp-card-main { flex: 1; padding: 12px 14px; min-width: 0; }
.rp-card-top { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.rp-card-title { font-weight: 700; font-size: 14.5px; line-height: 1.35; word-wrap: break-word; }
.rp-card-meta { color: var(--text-muted); font-size: 12.5px; margin-top: 4px; }
.rp-card-compact .rp-card-main { padding: 10px 14px; }
.rp-desc { font-size: 13px; margin-top: 6px; color: #3d4a43; }
.rp-wbs { display: inline-block; font-size: 11px; font-weight: 700; color: var(--text-muted); background: #f1f3f2; border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }
.rp-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 9px; }
.rp-b-ok { background: #e6f6ea; color: #1e7b34; } .rp-b-ko { background: #fdecea; color: #b02a1d; }
.rp-b-run { background: #e7f0fd; color: #1c5dbf; } .rp-b-todo { background: #fff6dc; color: #8a6400; }
.rp-tag { font-size: 11px; font-weight: 600; background: #f1f3f2; color: var(--text-muted); border-radius: 999px; padding: 3px 8px; }
.rp-motif { margin-top: 8px; font-size: 12.5px; color: #8c2a1f; background: #fff5f4; border-radius: 8px; padding: 6px 10px; }
.rp-ctrl { margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.rp-ctrl-ok { color: #1e7b34; } .rp-ctrl-ko { color: #b02a1d; }
.rp-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.rp-btn { flex: 1 1 140px; border: 1.5px solid var(--border); background: #fff; border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 13.5px;
    font-weight: 700; cursor: pointer; transition: all .15s; }
.rp-btn:hover { border-color: var(--primary-light); }
.rp-btn-ok { color: #1e7b34; } .rp-btn-ok:hover, .rp-btn-ok.is-on { background: #1e8e3e; border-color: #1e8e3e; color: #fff; }
.rp-btn-ko { color: #b02a1d; } .rp-btn-ko:hover, .rp-btn-ko.is-on { background: #c0392b; border-color: #c0392b; color: #fff; }
.rp-lock { margin-top: 10px; font-size: 12.5px; color: var(--text-muted); background: #f6f8f7; border-radius: 8px; padding: 7px 10px; }
.rp-progress { height: 8px; background: #edf1ef; border-radius: 999px; overflow: hidden; margin-top: 10px; }
.rp-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary-light), #52b788); border-radius: 999px; }
.rp-progress-lbl { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.rp-proj-title { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--primary-dark); margin: 16px 2px 8px; }
.rp-dot { width: 10px; height: 10px; border-radius: 50%; }
.rp-week { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.rp-day { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 12px; }
.rp-day.is-today { outline: 2px solid var(--accent); }
.rp-day.is-past { opacity: .85; }
.rp-day-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rp-day-count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.rp-mini { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; padding: 8px 0; border-top: 1px solid #f0f2f1; font-size: 13px; align-items: center; }
.rp-mini .rp-badge { grid-column: 2; justify-self: start; font-size: 10.5px; padding: 2px 7px; }
.rp-mini-time { color: var(--text-muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.rp-mini-title { font-weight: 600; }
.rp-mini-empty { color: var(--text-muted); font-size: 12.5px; padding: 6px 0; }
.rp-empty { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 36px 20px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; color: var(--text-muted); }
.rp-empty b { color: var(--text); font-size: 15px; }
.rp-empty-icon { font-size: 34px; }
.rp-modal { max-width: 440px; }
.rp-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rp-modal-head h3 { margin: 0; }
.rp-modal-sub { color: var(--text-muted); font-size: 13px; margin: 6px 0 14px; }
.rp-x { border: 0; background: #f1f3f2; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 13px; color: var(--text-muted); }
.rp-x:hover { background: #e4e8e6; color: var(--text); }
@media (max-width: 560px) {
    .rp-hero { padding: 16px; }
    .rp-hero-kpis { width: 100%; justify-content: space-between; }
    .rp-kpi-list { flex: 1; }
    .rp-card-time { flex-basis: 60px; }
    .rp-header .notif-panel { right: -50px; width: calc(100vw - 24px); }
}

/* --- v5.3 : contrôle des déclarations --- */
.vl-num:not(:empty) { background: var(--danger); color: #fff; border-radius: 999px; font-size: 10.5px; font-weight: 800; padding: 1px 6px; margin-left: 4px; }
.vl-table td { vertical-align: middle; }
.vl-person { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.vl-person span:last-child { display: flex; flex-direction: column; }
.vl-person small, .vl-when small, .vl-task small, .vl-by { color: var(--text-muted); font-size: 11.5px; display: block; }
.vl-avatar { width: 34px; height: 34px; border-radius: 50%; background: #e3efe8; color: var(--primary); font-weight: 800; font-size: 12px;
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.vl-when { white-space: nowrap; }
.vl-when b { text-transform: capitalize; }
.vl-task { max-width: 360px; font-weight: 600; }
.vl-task small { font-weight: 400; margin-top: 2px; }
.vl-motif { font-size: 12px; color: #8c2a1f; margin-top: 4px; max-width: 280px; }
.vl-actions { white-space: nowrap; text-align: right; }
.vl-actions .btn + .btn { margin-left: 4px; }
.evt-decl { display: inline-block; margin-top: 3px; font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 7px; background: #e7f0fd; color: #1c5dbf; }
.evt-decl.ok { background: #e6f6ea; color: #1e7b34; } .evt-decl.ko { background: #fdecea; color: #b02a1d; }

/* --- v5.3 : imports (ressources, tâches) --- */
.imp-box { max-width: 860px; }
.imp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.imp-head h3 { margin: 0 0 6px; }
.imp-steps { display: flex; gap: 6px; }
.imp-step-dot { font-size: 11.5px; font-weight: 700; color: var(--text-muted); background: #f1f3f2; border-radius: 999px; padding: 3px 10px; }
.imp-step-dot.active { background: var(--primary); color: #fff; }
.imp-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; border: 2px dashed #c9d6cf; border-radius: 14px;
    background: #f7faf8; cursor: pointer; text-align: center; transition: all .15s; }
.imp-drop:hover, .imp-drop.over { border-color: var(--primary-light); background: #eef6f1; }
.imp-drop input { display: none; }
.imp-drop-icon { font-size: 30px; }
.imp-drop small { color: var(--text-muted); }
.imp-spec { margin-top: 14px; background: #fbfcfb; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.imp-spec-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); margin-bottom: 8px; }
.imp-cols { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.imp-col { font-family: Consolas, monospace; font-size: 12px; font-weight: 700; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; }
.imp-col.req { border-color: var(--primary-light); color: var(--primary); }
.imp-col.req::after { content: ' *'; color: var(--danger); }
.imp-summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.imp-pill { font-weight: 700; font-size: 13px; border-radius: 999px; padding: 5px 12px; }
.imp-pill.ok { background: #e6f6ea; color: #1e7b34; } .imp-pill.skip { background: #fff6dc; color: #8a6400; } .imp-pill.ko { background: #fdecea; color: #b02a1d; }
.imp-table-wrap { max-height: 52vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.imp-table { margin: 0; }
.imp-table th { position: sticky; top: 0; z-index: 1; }
.imp-table tr.imp-erreur td { background: #fff8f7; }
.imp-msg { display: block; color: var(--text-muted); font-size: 11.5px; margin-top: 3px; max-width: 320px; }
.imp-names { display: flex; flex-wrap: wrap; gap: 4px; }
.imp-name { font-size: 11.5px; border-radius: 999px; padding: 2px 8px; background: #e6f6ea; color: #1e7b34; font-weight: 600; }
.imp-name.ko { background: #fdecea; color: #b02a1d; }
.rs-pwd-card { min-width: 250px; }
.rs-pwd-line { display: flex; align-items: center; gap: 6px; margin: 6px 0 4px; }
.rs-pwd-line code { font-size: 15px; font-weight: 700; background: #f6f8f7; border-radius: 6px; padding: 3px 8px; }
.rs-conn small { display: block; color: var(--text-muted); font-size: 11px; margin-top: 3px; }
.rs-actions { white-space: nowrap; }
.rs-actions .btn { padding: 5px 8px; }
.rs-del:hover { background: #fdecea; border-color: #f5c6c0; }

/* --- v5.3 : impression de la matrice (paysage, ajustée ou grand format) --- */
.pm-panel { padding-bottom: 12px; }
.pm-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.pm-options { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.pm-group { display: flex; flex-direction: column; gap: 5px; }
.pm-group > label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
.pm-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pm-info { margin-top: 12px; font-size: 13px; color: var(--text); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pm-warn { color: #8a6400; }
.pm-mini { display: inline-grid; gap: 2px; margin-left: 6px; vertical-align: middle; }
.pm-mini i { font-style: normal; font-size: 9.5px; font-weight: 700; background: #e8f2ee; color: var(--primary); border-radius: 3px; padding: 1px 4px; text-align: center; }
.pm-preview { overflow: auto; max-height: 72vh; }
.pm-section { display: inline-block; min-width: 100%; vertical-align: top; margin-bottom: 24px; }
.pm-section .matrix-wrap, .pm-clone .matrix-wrap { overflow: visible; }
.pm-section table.matrix, .pm-clone table.matrix { width: max-content; min-width: 0; }
.pm-section table.matrix thead th, .pm-clone table.matrix thead th { position: static; }
#printOut { display: none; }
@media print {
    body.pm-printing > *:not(#printOut) { display: none !important; }
    body.pm-printing #printOut { display: block; }
    body.pm-printing { background: #fff; }
    #printOut, #printOut * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    #printOut table.matrix { font-size: 12px; }
    #printOut .pm-break { break-before: page; page-break-before: always; }
    #printOut .pm-fit .pm-clone { transform-origin: 0 0; }
    #printOut .evt-card { transition: none; }
    #printOut .matrix-wrap { box-shadow: none; }
    #printOut .pm-tile { break-inside: avoid; }
    #printOut .pm-tile-label { display: flex; align-items: center; gap: 14px; font: 11px Arial, sans-serif; color: #333; border-bottom: 1px solid #ccc; box-sizing: border-box; }
    #printOut .pm-tile-label b { font-size: 13px; color: #1b4332; }
    #printOut .pm-tile-label span:last-child { margin-left: auto; }
    #printOut .pm-tile-vp { position: relative; overflow: hidden; contain: strict; }
    #printOut .pm-tile-vp thead { display: table-row-group; }
    #printOut .pm-tile-vp > .pm-clone { position: absolute; left: 0; top: 0; transform-origin: 0 0; margin: 0; }
    #printOut .pm-cut { position: absolute; z-index: 3; }
    #printOut .pm-cut-v { top: 0; bottom: 0; border-left: 1px dashed #555; }
    #printOut .pm-cut-h { left: 0; right: 0; border-top: 1px dashed #555; }
    #printOut .pm-cut span { position: absolute; font-size: 12px; background: #fff; line-height: 1; }
    #printOut .pm-cut-v span { top: 2px; left: -7px; }
    #printOut .pm-cut-h span { left: 2px; top: -7px; }
    #printOut .pm-glue { position: absolute; z-index: 2; background: repeating-linear-gradient(45deg, rgba(0,0,0,.06) 0 4px, rgba(0,0,0,.12) 4px 8px); }
    #printOut .pm-glue-v { left: 0; top: 0; bottom: 0; border-right: 1.5px solid #333; }
    #printOut .pm-glue-h { left: 0; right: 0; top: 0; border-bottom: 1.5px solid #333; }
    #printOut .pm-glue span { position: absolute; font: bold 8px Arial; color: #333; background: #fff; padding: 0 2px; }
    #printOut .pm-glue-v span { top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-90deg); }
    #printOut .pm-glue-h span { left: 50%; top: 50%; transform: translate(-50%, -50%); }
    #printOut .pm-plan { font-family: Arial, sans-serif; color: #1f2a24; }
    #printOut .pm-plan h2 { color: #1b4332; margin: 0 0 4px; }
    #printOut .pm-plan p { margin: 0 0 10px; color: #555; }
    #printOut .pm-plan-steps { font-size: 12px; margin: 0 0 14px 18px; padding: 0; }
    #printOut .pm-plan-block { margin-bottom: 12px; }
    #printOut .pm-plan-grid { display: grid; gap: 3px; max-width: 170mm; max-height: 110mm; margin-top: 6px; }
    #printOut .pm-plan-grid span { border: 1.5px solid #1b4332; background: #eef5f1; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; min-height: 12mm; }
}
.pm-section > div[style*="text-align:center"], .pm-clone > div[style*="text-align:center"] { text-align: left !important; }

/* --- v5.3 : panneau « Ressources » (refonte) --- */
.rs2 { max-width: 920px; padding: 22px 24px; }
.rs2-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rs2-head h3 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rs2-scope { font-size: 12px; font-weight: 700; color: var(--primary); background: #e8f2ee; border-radius: 999px; padding: 3px 10px; }
.rs2-scope:empty { display: none; }
.rs2-periode { color: var(--text-muted); font-size: 12.5px; margin-top: 3px; display: block; }
.rs2-who { display: flex; align-items: center; gap: 12px; }
.rs2-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 16px 0 12px; }
.rs2-kpi { background: #f6f8f7; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.rs2-kpi b { font-size: 20px; color: var(--primary-dark); line-height: 1.2; }
.rs2-kpi span { font-size: 11.5px; color: var(--text-muted); }
.rs2-kpi.ok b { color: #1e7b34; } .rs2-kpi.run b { color: #1c5dbf; } .rs2-kpi.ko b { color: #b02a1d; }
.rs2-kpi .rs-taux { font-size: 15px; }
.rs2-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.rs2-tools input[type=search] { flex: 1 1 220px; }
.rs2-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.rs2-switch input { width: auto; margin: 0; }
.rs2-body { display: flex; flex-direction: column; gap: 14px; }
.rs2-group { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.rs2-group header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #f6f8f7; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.rs2-count { font-size: 11px; font-weight: 800; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; color: var(--text-muted); }
.rs2-group-taux { margin-left: auto; }
.rs2-row { display: grid; grid-template-columns: 40px minmax(150px, 1.4fr) minmax(140px, 1fr) 64px 14px; align-items: center; gap: 12px; width: 100%;
    padding: 10px 14px; border: 0; border-top: 1px solid #f0f2f1; background: #fff; font: inherit; text-align: left; cursor: pointer; transition: background .12s; }
.rs2-group header + .rs2-row { border-top: 0; }
.rs2-row:hover { background: #f5faf7; }
.rs2-row:hover .rs2-chev { color: var(--primary); transform: translateX(2px); }
.rs2-avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
    background: #eef1f0; color: #6b7a72; flex: 0 0 auto; }
.rs2-avatar.rs-taux-good { background: #e6f6ea; color: #1e7b34; } .rs2-avatar.rs-taux-warn { background: #fff4d6; color: #8a6400; }
.rs2-avatar.rs-taux-bad { background: #fdecea; color: #b02a1d; }
.rs2-avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.rs2-id { display: flex; flex-direction: column; min-width: 0; }
.rs2-id b { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs2-id small { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs2-stats { display: flex; flex-direction: column; gap: 5px; }
.rs2-bar { display: flex; height: 7px; border-radius: 999px; overflow: hidden; background: #eef1f0; }
.rs2-bar i { display: block; height: 100%; }
.rs2-bar i.ok { background: #2f9e44; } .rs2-bar i.run { background: #74a9f0; } .rs2-bar i.ko { background: #e03131; }
.rs2-nums { display: flex; gap: 10px; font-size: 11.5px; font-weight: 700; }
.rs2-nums em { font-style: normal; } .rs2-nums .ok { color: #1e7b34; } .rs2-nums .run { color: #1c5dbf; } .rs2-nums .ko { color: #b02a1d; }
.rs2-row .rs-taux { justify-self: end; }
.rs2-chev { color: #b8c3bd; font-size: 20px; transition: all .12s; }
@media (max-width: 700px) {
    .rs2-kpis { grid-template-columns: repeat(3, 1fr); }
    .rs2-row { grid-template-columns: 38px 1fr 58px; }
    .rs2-stats, .rs2-chev { display: none; }
}

/* --- v5.3 : détail d'une tâche Gantt (refonte) --- */
.gtd2 { max-width: 760px; padding: 0; overflow: hidden auto; --gtd-c: #2d6a4f; }
.gtd2-head { display: flex; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; border-top: 5px solid var(--gtd-c);
    background: linear-gradient(180deg, color-mix(in srgb, var(--gtd-c) 7%, #fff), #fff); }
.gtd2-head-main { min-width: 0; }
.gtd2-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.gtd2-eyebrow .gantt-detail-dot { width: 10px; height: 10px; border-radius: 3px; }
.gtd2-head h3 { margin: 6px 0 10px; font-size: 19px; line-height: 1.3; color: var(--text); word-wrap: break-word; }
.gtd2-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gtd2-chip { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: #f1f3f2; color: #4f5d56; }
.gtd2-chip:empty { display: none; }
.gtd2-etat-ok { background: #e6f6ea; color: #1e7b34; } .gtd2-etat-ko { background: #fdecea; color: #b02a1d; }
.gtd2-etat-run { background: #e7f0fd; color: #1c5dbf; } .gtd2-etat-todo { background: #fff6dc; color: #8a6400; }
.gtd2-wf-valide { background: #e6f6ea; color: #1e7b34; } .gtd2-wf-soumis { background: #e7f0fd; color: #1c5dbf; } .gtd2-wf-rejete { background: #fdecea; color: #b02a1d; }
.gtd2-alerts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 22px; }
.gtd2-alerts:empty { display: none; }
.gtd2-alert { font-size: 12px; font-weight: 600; border-radius: 8px; padding: 5px 10px; background: #fff4e5; color: #8a4b00; }
.gtd2-alert-echeance_depassee { background: #fdecea; color: #b02a1d; }
.gtd2-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 22px 4px; }
.gtd2-fact { background: #f7f9f8; border: 1px solid #edf1ef; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gtd2-fact b { font-size: 14.5px; color: var(--text); }
.gtd2-fact small { font-size: 12px; color: var(--text-muted); }
.gtd2-fact-lbl { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
.gtd2-fact-progress { grid-column: 1 / -1; gap: 8px; }
.gtd2-prog { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; }
.gtd2-prog b { text-align: right; font-size: 13px; }
.gtd2-prog .gantt-progress-track { height: 8px; }
.gtd2-desc { margin: 10px 22px 0; font-size: 13.5px; line-height: 1.5; color: #33413a; white-space: pre-line; }
.gtd2-tabs { display: flex; gap: 4px; margin: 16px 22px 0; border-bottom: 1px solid var(--border); }
.gtd2-tabs button { border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--text-muted); padding: 9px 12px; cursor: pointer;
    border-bottom: 2.5px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.gtd2-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.gtd2-n:not(:empty) { font-size: 11px; background: #e8f2ee; color: var(--primary); border-radius: 999px; padding: 0 7px; }
.gtd2-pane { padding: 12px 22px 4px; min-height: 64px; }
.gtd2-pane-tools { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.gtd2-pane-tools:not(:has(button:not([style*="none"]))) { display: none; }
.gtd2-empty { color: var(--text-muted); font-size: 13px; padding: 10px 0; }
.gtd2 #gtd_workflow_zone:not(:empty) { padding: 8px 22px 0; }
.gtd2-foot { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 12px 22px; margin-top: 14px; background: #fff; border-top: 1px solid var(--border); }
.gtd2-foot-right { display: flex; gap: 8px; }
@media (max-width: 640px) {
    .gtd2-facts { grid-template-columns: 1fr; }
    .gtd2-prog { grid-template-columns: 100px 1fr 40px; }
}
.rs2-bar-empty { opacity: .5; }
@media (max-width: 480px) {
    .rp-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 4px; }
    .rp-tabs button { padding: 7px 2px; font-size: 12px; gap: 3px; white-space: normal; flex-direction: column; line-height: 1.2; }
}
.rp-gantt .rp-actions .rp-btn { flex: 0 0 auto; }

/* --- v5.4 --- */
.email-suffix { display: flex; align-items: stretch; }
.email-suffix input { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; flex: 1; min-width: 0; }
.email-suffix span { display: inline-flex; align-items: center; padding: 0 10px; background: #f1f4f2; border: 1.5px solid var(--border); border-left: 0;
    border-radius: 0 8px 8px 0; color: var(--text-muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.rp-new-link { margin-top: 8px; border: 1.5px dashed #c9d6cf; background: #f7faf8; color: var(--primary); font: inherit; font-size: 12.5px; font-weight: 700;
    border-radius: 8px; padding: 7px 10px; cursor: pointer; width: 100%; text-align: left; }
.rp-new-link:hover { border-color: var(--primary-light); background: #eef6f1; }
.rp-new { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.rp-new input { padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 8px; font: inherit; font-size: 13px; }
.rp-new .rp-new-grade { width: 90px; }
.rp-new .rp-new-nom { flex: 1 1 160px; min-width: 0; }
.rs-opt-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfd8d3; border-radius: 999px; cursor: pointer; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--primary-light); }
.switch input:checked + span::before { transform: translateX(20px); }
.pwa-btn { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--primary-light); background: #eef6f1; color: var(--primary);
    font: inherit; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 6px 12px; cursor: pointer; margin-right: 6px; }
.pwa-btn:hover { background: var(--primary); color: #fff; }
.pwa-btn[hidden], .pwa-login-btn[hidden] { display: none !important; }
.pwa-btn-dark { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); }
.pwa-btn-dark:hover { background: #fff; color: var(--primary-dark); }
.pwa-login-btn { display: block; width: 100%; margin-top: 14px; padding: 10px; border: 1.5px dashed #c9d6cf; background: #f7faf8; color: var(--primary);
    font: inherit; font-size: 13.5px; font-weight: 700; border-radius: 10px; cursor: pointer; }
.pwa-login-btn:hover { border-color: var(--primary-light); background: #eef6f1; }
@media (max-width: 560px) { .pwa-btn span { display: none; } }
.demo-panel { border-left: 4px solid var(--accent); }
.demo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin: 12px 0; }
.demo-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: #fbfcfb; }
.demo-item input { width: auto; margin-top: 3px; }
.demo-item small { display: block; color: var(--text-muted); font-size: 11.5px; margin-top: 2px; }

/* --- v5.5 : tableaux en « cartes » sur téléphone --- */
@media (max-width: 640px) {
    table.admin-table.rt { display: block; white-space: normal; overflow: visible; }
    table.admin-table.rt thead { display: none; }
    table.admin-table.rt tbody { display: block; }
    table.admin-table.rt tr { display: block; background: #fff; border: 1px solid var(--border); border-radius: 12px; margin: 0 0 10px; padding: 6px 12px; box-shadow: 0 1px 4px rgba(16,41,29,.05); }
    table.admin-table.rt tr.rt-full { border: 0; box-shadow: none; padding: 0; }
    table.admin-table.rt td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border: 0; border-bottom: 1px dashed #edf1ef; text-align: right; white-space: normal; max-width: none; }
    table.admin-table.rt td:last-child { border-bottom: 0; }
    table.admin-table.rt td::before { content: attr(data-label); flex: 0 0 38%; text-align: left; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; color: var(--text-muted); }
    table.admin-table.rt td[data-label=""]::before { display: none; }
    table.admin-table.rt td[data-label=""] { justify-content: flex-end; flex-wrap: wrap; }
    table.admin-table.rt tr.rt-full td { display: block; text-align: center; }
    table.admin-table.rt tr.rt-full td::before { display: none; }
    table.admin-table.rt td > div, table.admin-table.rt td .vl-person { justify-content: flex-end; }
    .rs-actions, .vl-actions { white-space: normal !important; }
    .table-scroll { overflow: visible; }
}
.demo-item b { font-size: 14px; }

/* --- v5.6 : nouvelle version installée --- */
.update-banner { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 4000; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: var(--primary-dark); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 13.5px; max-width: calc(100vw - 32px); }
.update-banner b { font-weight: 600; opacity: .75; font-size: 12.5px; }
.update-banner button { border: 0; background: var(--accent); color: var(--primary-dark); font: inherit; font-weight: 800; border-radius: 8px; padding: 7px 12px; cursor: pointer; }

/* --- v5.6 : application installée — la barre de titre ne cache plus le nom de l'utilisateur --- */
@media (display-mode: window-controls-overlay) {
    .topbar { padding-right: calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw) + 16px); }
    .rp-header-in { padding-right: calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw) + 16px); }
}

/* --- v5.6 : aide et à propos --- */
.help2-hero { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border-left: 5px solid var(--primary-light); }
.help2-hero h3 { margin: 0 0 4px; }
.help2-hero p { margin: 0; color: var(--text-muted); }
.help2-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.help2-tools input { min-width: 240px; }
.help2-cats { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.help2-cats a { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; color: var(--primary); }
.help2-cats a span { font-size: 11px; background: #e8f2ee; border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.help2-section { margin-bottom: 18px; }
.help2-section h3 { font-size: 16px; color: var(--primary-dark); margin: 0 0 10px; }
.help2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; align-items: start; }
.help2-card { background: #fff; border-radius: 12px; box-shadow: var(--shadow); border: 1px solid #edf1ef; }
.help2-card summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 13px 14px; font-size: 14.5px; }
.help2-card summary::-webkit-details-marker { display: none; }
.help2-card summary::after { content: '›'; margin-left: auto; color: #b8c3bd; font-size: 20px; transition: transform .15s; }
.help2-card[open] summary::after { transform: rotate(90deg); }
.help2-ico { width: 32px; height: 32px; border-radius: 9px; background: #eef6f1; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.help2-card ol, .help2-card > p { margin: 0; padding: 0 16px 14px 36px; font-size: 14px; line-height: 1.65; }
.help2-card > p { padding-left: 16px; }
.help2-card li { margin-bottom: 4px; }
.help2-tip { margin: 0 14px 14px !important; padding: 9px 12px !important; background: #fff8e6; border-radius: 8px; font-size: 13px !important; color: #6b5200; }
.about-hero { display: flex; align-items: center; gap: 18px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; }
.about-hero img { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.about-hero h2 { margin: 0; font-size: 26px; letter-spacing: .5px; }
.about-hero p { margin: 4px 0 8px; opacity: .85; }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.about-grid .panel { margin-bottom: 16px; }
.about-me { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.about-me div { display: flex; flex-direction: column; }
.about-me small { color: var(--text-muted); font-size: 12.5px; }
.about-list { margin: 6px 0 14px; padding-left: 20px; line-height: 1.8; font-size: 14px; }
.about-p { font-size: 14.5px; line-height: 1.7; }
.about-org { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.about-org-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.about-org-card small { color: var(--text-muted); }
.about-org-card div { display: flex; flex-wrap: wrap; gap: 5px; }
.about-sys th { width: 38%; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text-muted); text-align: left; }
.about-sys td { word-break: break-word; }
.about-foot { text-align: center; color: var(--text-muted); font-size: 12px; }
@media (max-width: 640px) { .help2-grid { grid-template-columns: 1fr; } .help2-tools input { min-width: 0; flex: 1; } .about-sys th { width: 45%; } }

/* --- v5.8 : titre de l'application FIXE dans le menu (seuls les liens défilent) --- */
.sidebar { overflow: hidden; }
.sidebar .brand, .sidebar .sidebar-footer { flex-shrink: 0; }
.sidebar nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.sidebar nav::-webkit-scrollbar { width: 6px; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 3px; }
.sidebar .sidebar-footer { padding-bottom: 4px; }

/* --- v5.8 : panneau des notifications (non lues / lues) --- */
.notif-panel { width: 380px; max-width: calc(100vw - 20px); }
.notif-allread { font-size: 12px; color: var(--primary-light); font-weight: 700; }
.notif-tabs { display: flex; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--border); background: #fafbfa; }
.notif-tabs button { flex: 1; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--text-muted); padding: 6px 4px; border-radius: 8px; cursor: pointer; }
.notif-tabs button.active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(16,41,29,.08); }
.notif-tabs span { font-size: 11px; background: #eef1f0; border-radius: 999px; padding: 0 6px; margin-left: 3px; }
.notif-tabs button.active span { background: #e8f2ee; }
#notifList { max-height: 60vh; overflow-y: auto; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; position: relative; }
.notif-item .notif-body { flex: 1; min-width: 0; }
.notif-item .dot { flex: 0 0 auto; margin-top: 6px; }
.notif-item:not(.unread) .dot { background: #cfd6d2 !important; }
.notif-item:not(.unread) .notif-text { color: var(--text-muted); }
.notif-mark { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--primary); cursor: pointer; font-size: 13px; opacity: .55; }
.notif-item:hover .notif-mark, .notif-mark:focus { opacity: 1; }
.notif-mark:hover { background: var(--primary); color: #fff; }
.notif-more { display: block; width: 100%; border: 0; border-top: 1px solid var(--border); background: #fafbfa; padding: 10px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--primary); cursor: pointer; }

/* v5.8 — déconnexion par un autre appareil */
.login-kick { text-align: left; line-height: 1.45; }
.login-kick small { display: block; margin-top: 6px; opacity: .85; font-size: 12px; }
/* v5.8 — appareils connectés (À propos) */
.about-dev { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.about-dev-card { border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; }
.about-dev-card > span { font-size: 22px; line-height: 1; }
.about-dev-card b { display: block; font-size: 13px; }
.about-dev-card small { display: block; color: var(--muted, #64748b); font-size: 12px; }
.about-dev-card.is-me { border-color: #16a34a; background: rgba(22,163,74,.06); }
.about-dev-card.is-free { border-style: dashed; opacity: .75; }
.notif-more[hidden] { display: none; }
@media (max-width: 640px) {
    .notif-panel, .rp-header .notif-panel { position: fixed; left: 10px; right: 10px; top: 62px; width: auto; max-width: none; }
}

/* v5.9 — tâches des chefs (T. CS / T. CB / T. CC) */
.chef-tag { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 5px; background: #1b4332; color: #fff;
    font-size: 10.5px; font-weight: 800; letter-spacing: .02em; vertical-align: 1px; white-space: nowrap; }
.svc-label.svc-chef { font-style: italic; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(27,67,50,.04) 6px 12px); }
.svc-label.svc-chef .chef-tag { background: var(--evt-color, #1b4332); }
.task-niveau-service { margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; background: rgba(27,67,50,.07); font-size: 13px; }
.rs2-chef { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px; background: #1b4332; color: #fff; font-size: 10.5px; font-weight: 800; }
.rp-tag-chef { background: #1b4332 !important; color: #fff !important; }
.pf-chef-deja { margin-top: 6px; padding: 7px 10px; border-radius: 7px; background: #fff4e5; color: #8a4b00; font-size: 12.5px; }

/* v5.9.2 — hiérarchie service / bureau / cellule dans la matrice */
table.matrix td.svc-label .svc-name { vertical-align: middle; }
table.matrix td.svc-label .svc-sub { display: block; margin: 2px 0 0 17px; font-size: 11px; font-weight: 600; opacity: .72; white-space: normal; }
table.matrix td.svc-label.svc-service {
    background: var(--evt-color, #1b4332); color: #fff; text-transform: uppercase; letter-spacing: .03em; font-size: 12.5px;
    border-left: 6px solid color-mix(in srgb, var(--evt-color, #1b4332) 60%, #000);
}
table.matrix td.svc-label.svc-service .svc-kind { display: inline-block; margin-right: 8px; padding: 1px 6px; border-radius: 4px;
    background: rgba(255,255,255,.18); font-size: 9.5px; letter-spacing: .08em; }
table.matrix td.svc-label.svc-service .svc-sub { margin-left: 0; color: #fff; text-transform: none; letter-spacing: 0; }
table.matrix td.svc-label.svc-bureau {
    font-size: 14px; border-left: 6px solid var(--evt-color, #1b4332);
    background: color-mix(in srgb, var(--evt-color, #1b4332) 16%, #ffffff);
}
table.matrix td.svc-label.svc-cellule {
    font-weight: 600; font-size: 13px; padding-left: 14px;
    border-left: 6px solid color-mix(in srgb, var(--evt-color, #1b4332) 55%, #ffffff);
    background: color-mix(in srgb, var(--evt-color, #1b4332) 8%, #ffffff);
}
table.matrix td.svc-label .svc-indent { display: inline-block; margin-right: 4px; color: color-mix(in srgb, var(--evt-color, #1b4332) 70%, #000); font-weight: 800; }

/* ------------------------------------------------------------
   v5.11 — Espace ressource : tâches réalisées non programmées
   ------------------------------------------------------------ */
.rp-libre-btn { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 2px dashed var(--primary-light); background: #f3faf6;
    color: var(--primary-dark); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; cursor: pointer; font: inherit; }
.rp-libre-btn:hover { background: #e6f4ec; }
.rp-libre-btn > span { flex: 0 0 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 22px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; }
.rp-libre-btn b { display: block; font-size: 14.5px; }
.rp-libre-btn small { color: var(--text-muted); font-size: 12px; }
.rp-libre-modal { max-width: 520px; }
.rp-libre-line { display: flex; gap: 10px; align-items: flex-start; background: #f6f8f7; border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.rp-libre-num { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: 12.5px;
    display: flex; align-items: center; justify-content: center; margin-top: 4px; }
.rp-libre-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rp-libre-times { display: flex; gap: 10px; flex-wrap: wrap; }
.rp-libre-times label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.rp-libre-times input { padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 15px; background: #fff; }
.rp-libre-fields textarea { min-height: 54px; font-size: 14px; width: 100%; box-sizing: border-box; }
.rp-libre-times input { width: 118px; }
.rp-libre-del { border: 0; background: #fdecea; color: #a5281c; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; flex: 0 0 auto; }
.rp-libre-del[hidden] { display: none; }
.rp-add-line { border: 1.5px dashed var(--border); background: #fff; border-radius: 10px; width: 100%; padding: 9px; font: inherit; font-size: 13.5px;
    font-weight: 600; color: var(--primary); cursor: pointer; }
.rp-conf-title { font-weight: 700; color: #8a6400; margin: 14px 0 6px; font-size: 13.5px; }
.rp-conf { display: block; background: #fff8e6; border: 1px solid #f2d27a; border-radius: 10px; padding: 9px 11px; font-size: 13px; margin-bottom: 6px; }
.rp-conf-ko { background: #fdecea; border-color: #f5c2c0; color: #8c2a1f; }
.rp-conf-q { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.rp-conf-q input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }
.rp-conf small { display: block; color: var(--text-muted); margin-top: 3px; font-size: 12px; }
.rp-tag-libre { background: #e7f0fd; color: #1c5dbf; }
.evt-libre-badge { display: inline-block; font-size: 10px; font-weight: 700; background: #e7f0fd; color: #1c5dbf; border-radius: 999px; padding: 1px 7px; margin-bottom: 2px; }
.vl-libre { display: inline-block; font-size: 11px; font-weight: 700; background: #e7f0fd; color: #1c5dbf; border-radius: 999px; padding: 1px 7px; margin-right: 4px; }

/* ============================================================
   v5.12 — Vue séquentielle, tâches sans heure, répétition multi-jours
   ============================================================ */
/* Modale : répétition + sans heure */
.repeat-days { display: flex; flex-wrap: wrap; gap: 6px; }
.rpt-day { position: relative; cursor: pointer; }
.rpt-day input { position: absolute; opacity: 0; pointer-events: none; }
.rpt-day span { display: inline-block; padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 12.5px; font-weight: 600; background: #fff; }
.rpt-day input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.rpt-day.is-principal span { background: var(--accent); border-color: var(--accent); color: #2b2200; }

/* Vue séquentielle : cartes de largeur égale, dans l'ordre */
table.matrix.matrix-seq td.seq-cell { padding: 6px; vertical-align: top; }
.seq-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.seq-card { flex: 1 1 200px; max-width: 320px; min-width: 180px; display: flex; }
.seq-card > .evt-card { width: 100%; height: 100%; }
.matrix-seq .seq-card .evt-card { cursor: pointer; }
.seq-add { flex: 0 0 auto; align-self: center; border: 1.5px dashed var(--border); background: #fff; color: var(--primary);
    border-radius: 10px; min-width: 42px; min-height: 42px; font-size: 20px; font-weight: 700; cursor: pointer; }
.seq-add:hover { border-color: var(--primary-light); background: #f3faf6; }
.matrix-seq th { background: var(--header-fill); color: #fff; }
.matrix-seq.matrix-week-big td.seq-cell { min-width: 220px; }

/* Bande « sans heure » dans la vue horaire */
tr.free-strip-row td.free-strip { background: #f6f8f7; vertical-align: middle; }
.free-strip-label { display: inline-block; font-size: 11px; font-weight: 700; color: var(--text-muted); margin-right: 8px; vertical-align: top; padding-top: 6px; }
tr.free-strip-row .seq-list { display: inline-flex; vertical-align: top; width: calc(100% - 90px); }
.evt-card.evt-free { border-left: 3px dashed var(--accent); }
.evt-time-free { color: var(--accent); font-weight: 600; }

/* v5.13.1 — recherche dans le RH de RHÔNE */
.rh-recherche { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.rh-recherche .rh-q { width: 100%; }
.rh-resultats { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.rh-ligne { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.rh-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rh-id small { color: var(--text-muted); font-size: 12px; }
.rh-hel { font-variant-numeric: tabular-nums; }
.rh-aide { font-size: 12.5px; color: var(--text-muted); padding: 6px 2px; }
.rh-erreur { color: #b42318; }
.rs-lien { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #e7f2ec; color: #1b4332; }
.rs-lien.non { background: #f3f3f3; color: #777; }
.rp-rh { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: #f7faf8; }
.rp-rh-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
