/* ==========================================================
   gespro by 3B Agency — Feuille de styles
   Identité : noir profond + accent or bronze, Inter
   ========================================================== */

:root {
    --bg: #0a0a0b;
    --bg-elevated: #131316;
    --bg-card: #17171c;
    --bg-input: #101013;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    --text: #ffffff;
    --text-soft: rgba(255, 255, 255, 0.72);
    --text-muted: rgba(255, 255, 255, 0.48);

    --accent: #c8945b;
    --accent-hover: #d8a66d;
    --accent-soft: rgba(200, 148, 91, 0.15);
    --accent-border: rgba(200, 148, 91, 0.45);

    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, 0.15);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.15);
    --info: #60a5fa;
    --info-soft: rgba(96, 165, 250, 0.15);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-full: 999px;

    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);

    --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);

    --max-w: 1280px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background:
        radial-gradient(ellipse at top, rgba(200, 148, 91, 0.05), transparent 60%),
        var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 0.5em;
    letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.6rem, 2.5vw, 2rem); }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; }

button { font-family: inherit; cursor: pointer; }

input, textarea, select, button { font-family: inherit; font-size: inherit; }

::selection { background: var(--accent-soft); color: var(--text); }

/* ==========================================================
   HEADER / NAV
   ========================================================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 10, 11, 0.85);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}

.app-header__inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
}
.app-brand:hover { color: var(--text); }
.app-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--accent);
    color: #0a0a0b;
    border-radius: var(--radius-sm);
    font-weight: 800;
    letter-spacing: -0.02em;
}
.app-brand__name {
    font-size: 14px;
    color: var(--text-soft);
}

.app-nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
}
.app-nav a {
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.app-nav a:hover { color: var(--text); background: var(--bg-elevated); }

.app-user {
    display: flex;
    align-items: center;
    gap: 14px;
}
.app-user__bell {
    position: relative;
    color: var(--text-soft);
    padding: 8px;
    border-radius: var(--radius-sm);
    display: flex;
    transition: all var(--transition);
}
.app-user__bell:hover { color: var(--text); background: var(--bg-elevated); }
.app-user__badge {
    position: absolute;
    top: 2px; right: 2px;
    background: var(--accent);
    color: #0a0a0b;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-user__info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: right;
    color: inherit;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.app-user__info:hover { background: var(--bg-elevated); color: inherit; }
.app-user__name {
    font-size: 13px;
    font-weight: 600;
}
.app-user__role {
    font-size: 11px;
    color: var(--text-muted);
}

.app-user__logout {
    color: var(--text-soft);
    padding: 8px;
    border-radius: var(--radius-sm);
    display: flex;
    transition: all var(--transition);
}
.app-user__logout:hover { color: var(--danger); background: var(--danger-soft); }

/* ==========================================================
   MAIN / FOOTER
   ========================================================== */
.app-main {
    flex: 1;
    max-width: var(--max-w);
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.app-footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}
.app-footer__inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================
   AUTH (login / install)
   ========================================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
}

.auth-card__head {
    text-align: center;
    margin-bottom: 28px;
}
.auth-card__head .app-brand__mark {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    font-size: 18px;
}
.auth-card__head h1 { margin-bottom: 4px; }
.auth-card__sub {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-soft);
}
.auth-form input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    color: var(--text);
    transition: border-color var(--transition);
}
.auth-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-card__foot {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin: 24px 0 0;
}

/* ==========================================================
   BOUTONS
   ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.2;
}
.btn:hover { background: var(--bg-card); }

.btn--primary {
    background: var(--accent);
    color: #0a0a0b;
    font-weight: 600;
}
.btn--primary:hover { background: var(--accent-hover); color: #0a0a0b; }

.btn--ghost {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text-soft);
}
.btn--ghost:hover { background: var(--bg-elevated); color: var(--text); }

.btn--danger {
    background: transparent;
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--danger);
}
.btn--danger:hover { background: var(--danger-soft); }

.btn--small { padding: 6px 12px; font-size: 12px; }

/* ==========================================================
   PAGES / COMMUN
   ========================================================== */
.page { display: flex; flex-direction: column; gap: 24px; }

.page__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.page__head h1 { margin: 0; }
.page__sub { color: var(--text-muted); font-size: 14px; margin: 6px 0 0; }
.page__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.back-link {
    display: inline-block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.back-link:hover { color: var(--accent); }

/* ==========================================================
   FLASH MESSAGES
   ========================================================== */
.flash-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    border: 1px solid transparent;
}
.flash--success { background: var(--success-soft); border-color: rgba(74, 222, 128, 0.3); color: var(--success); }
.flash--error   { background: var(--danger-soft); border-color: rgba(248, 113, 113, 0.3); color: var(--danger); }
.flash--info    { background: var(--info-soft); border-color: rgba(96, 165, 250, 0.3); color: var(--info); }

/* ==========================================================
   DASHBOARD — CARTES PROJET
   ========================================================== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-soft), transparent 50%);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}
.project-card:hover {
    border-color: var(--accent-border);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--text);
}
.project-card:hover::before { opacity: 1; }

.project-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.project-card__pct {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}
.project-card__title {
    font-size: 1.15rem;
    margin: 0;
}
.project-card__desc {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}
.project-card__foot {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* ==========================================================
   BARRE DE PROGRESSION
   ========================================================== */
.progress-bar {
    position: relative;
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-bar--lg { height: 10px; }
.progress-bar--inline { display: inline-block; width: 100px; vertical-align: middle; }

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: var(--radius-full);
    transition: width 500ms ease;
}

.progress-pct {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

/* ==========================================================
   PILLULES STATUT
   ========================================================== */
.status-pill, .status-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.status-pill--en_attente,
.status-chip--a_faire {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-soft);
    border-color: var(--border);
}

.status-pill--en_cours,
.status-chip--en_cours {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: rgba(251, 191, 36, 0.25);
}

.status-pill--en_revision {
    background: var(--info-soft);
    color: var(--info);
    border-color: rgba(96, 165, 250, 0.25);
}

.status-pill--termine,
.status-chip--termine {
    background: var(--success-soft);
    color: var(--success);
    border-color: rgba(74, 222, 128, 0.25);
}

.status-pill--archive {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border-color: var(--border);
}

/* ==========================================================
   EMPTY STATE
   ========================================================== */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    background: var(--bg-card);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
}
.empty-state h2 { margin-bottom: 6px; }
.empty-state p { color: var(--text-muted); margin: 0; }

/* ==========================================================
   CARTE (contenant générique)
   ========================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.card__title {
    margin: 0 0 16px;
    font-size: 1rem;
    letter-spacing: -0.005em;
}
.card__text { color: var(--text-soft); margin: 0; }
.card__empty {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    padding: 24px 0;
    margin: 0;
}
.card__help {
    font-size: 12px;
    color: var(--text-muted);
    margin: 10px 0 0;
}

.card__head-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}
.card__head-row .card__title { margin: 0; }

.card--progress .card__progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.card--progress .card__title { margin: 0; }

/* ==========================================================
   PROJET — EN-TÊTE
   ========================================================== */
.page__head--project h1 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
}
.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 10px;
}
.project-meta strong { color: var(--text-soft); font-weight: 500; }

/* ==========================================================
   LISTE DES ÉTAPES (vue client)
   ========================================================== */
.task-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}
.task-list::before {
    content: '';
    position: absolute;
    left: 9px; top: 8px; bottom: 8px;
    width: 2px;
    background: var(--border);
}

.task-item {
    display: flex;
    gap: 18px;
    padding: 14px 0;
    position: relative;
}
.task-item__dot {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    background: var(--bg-card);
    margin-top: 2px;
    position: relative;
    z-index: 1;
}
.task-item--en_cours .task-item__dot {
    border-color: var(--warning);
    background: var(--warning-soft);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.08);
}
.task-item--termine .task-item__dot {
    border-color: var(--success);
    background: var(--success);
}
.task-item--termine .task-item__dot::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a0a0b;
    font-size: 12px;
    font-weight: 700;
}

.task-item__body { flex: 1; min-width: 0; }
.task-item__head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.task-item__desc {
    color: var(--text-muted);
    font-size: 13px;
    margin: 4px 0 0;
}
.task-item__due {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}
.task-item--termine strong { text-decoration: line-through; color: var(--text-muted); }

/* ==========================================================
   LISTE DES ÉTAPES (admin)
   ========================================================== */
.task-admin-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.task-admin-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.task-admin-item--termine { opacity: 0.7; }
.task-admin-item--termine strong { text-decoration: line-through; }
.task-admin-item select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 6px 10px;
    font-size: 12px;
    min-width: 120px;
}
.task-admin-item__body { flex: 1; min-width: 0; }
.task-admin-item__body p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}
.task-admin-item__due {
    display: inline-block;
    margin-left: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

.task-new {
    padding: 16px;
    background: var(--bg-elevated);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ==========================================================
   FICHIERS
   ========================================================== */
.file-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.file-item__icon { color: var(--accent); flex-shrink: 0; }
.file-item__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.file-item__body strong {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-item__body span { color: var(--text-muted); font-size: 12px; }

.file-upload {
    padding: 16px;
    background: var(--bg-elevated);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.file-upload input[type="file"] {
    flex: 1;
    min-width: 200px;
    color: var(--text-soft);
    font-size: 13px;
}
.file-upload small {
    width: 100%;
    color: var(--text-muted);
    font-size: 11px;
}

/* ==========================================================
   COMMENTAIRES
   ========================================================== */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.comment {
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-left: 3px solid var(--border-strong);
}
.comment--admin { border-left-color: var(--accent); }
.comment--client { border-left-color: var(--info); }

.comment__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 12px;
}
.comment__head strong { font-weight: 600; }
.comment__role {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-input);
    color: var(--text-muted);
}
.comment--admin .comment__role { background: var(--accent-soft); color: var(--accent); }
.comment--client .comment__role { background: var(--info-soft); color: var(--info); }

.comment__date { margin-left: auto; color: var(--text-muted); }
.comment__body { color: var(--text-soft); font-size: 14px; }

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}
.comment-form textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    color: var(--text);
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    transition: border-color var(--transition);
}
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ==========================================================
   TABLEAUX
   ========================================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th {
    text-align: left;
    padding: 12px 14px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-soft);
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.data-table small { color: var(--text-muted); font-size: 12px; }
.data-table__actions {
    white-space: nowrap;
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}

/* ==========================================================
   FILTRE
   ========================================================== */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.filter-bar input,
.filter-bar select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--text);
}
.filter-bar input { flex: 1; min-width: 220px; }

/* ==========================================================
   STATS (admin home)
   ========================================================== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-card__num {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    letter-spacing: -0.02em;
}
.stat-card__label {
    color: var(--text-muted);
    font-size: 13px;
}

/* ==========================================================
   FORMULAIRES
   ========================================================== */
.form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-soft);
}
.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="number"],
.form input[type="date"],
.form select,
.form textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 11px 14px;
    color: var(--text);
    font-size: 14px;
    transition: border-color var(--transition);
    font-family: inherit;
}
.form input:focus,
.form select:focus,
.form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form textarea { resize: vertical; min-height: 80px; }
.form small {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

.form__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.form__checkbox {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 10px;
}
.form__checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }

.form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* ==========================================================
   NOTIFICATIONS
   ========================================================== */
.notif-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.notif-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.notif-item__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.notif-item__body span {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 760px) {
    .app-header__inner { flex-wrap: wrap; gap: 16px; padding: 12px 16px; }
    .app-nav { order: 3; width: 100%; margin-left: 0; justify-content: flex-start; overflow-x: auto; }
    .app-brand__name { display: none; }
    .app-user__info { display: none; }
    .app-main { padding: 20px 16px 48px; }

    .data-table thead { display: none; }
    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td { display: block; width: 100%; }
    .data-table tr {
        background: var(--bg-elevated);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 10px;
        padding: 10px;
    }
    .data-table td { padding: 6px 0; border-bottom: none; }
    .data-table__actions { justify-content: flex-start; padding-top: 8px; border-top: 1px solid var(--border); margin-top: 8px; }

    .page__head { align-items: flex-start; }
    .page__head--project .page__actions { width: 100%; }
}

/* ========================================================== */
/* Fonctionnalités métier agence (migration 002)              */
/* ========================================================== */

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; margin-left: 6px; vertical-align: middle; }
.badge--info    { background: rgba(90, 140, 220, 0.18); color: #9ab8e6; }
.badge--success { background: rgba(76, 175, 80, 0.18);  color: #8bce8f; }
.badge--warning { background: rgba(200, 148, 91, 0.22); color: var(--accent); }
.badge--danger  { background: rgba(220, 80, 80, 0.2);   color: #e89b9b; }

/* ---------- Sous-tâches (checklist) ---------- */
.subtasks { margin-top: 12px; padding: 10px 12px; border-left: 2px solid var(--border); background: rgba(255,255,255,0.02); border-radius: 0 4px 4px 0; }
.subtasks__title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin: 0 0 8px; font-weight: 600; }
.subtasks__count { font-weight: 400; color: var(--accent); margin-left: 6px; }
.subtasks--readonly { border-left-color: var(--accent); opacity: 0.92; }
.subtask-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.subtask-item { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; }
.subtask-item.is-done .subtask-label { text-decoration: line-through; color: var(--text-muted); }
.subtask-toggle { margin: 0; padding: 0; }
.subtask-check { background: transparent; border: 0; color: var(--accent); font-size: 16px; cursor: pointer; padding: 0; line-height: 1; }
.subtask-label { flex: 1; }
.subtask-del { background: transparent; border: 0; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 0 4px; opacity: 0.6; }
.subtask-del:hover { color: #e89b9b; opacity: 1; }
.subtask-add { display: flex; gap: 6px; margin-top: 8px; }
.subtask-add input { flex: 1; background: rgba(0,0,0,0.2); border: 1px solid var(--border); color: var(--text); padding: 6px 10px; border-radius: 4px; font-size: 13px; }

/* ---------- Validation client ---------- */
.validation-box { margin-top: 14px; padding: 14px 16px; background: linear-gradient(135deg, rgba(200,148,91,0.12), rgba(200,148,91,0.06)); border: 1px solid rgba(200,148,91,0.35); border-radius: 6px; }
.validation-box__intro { margin: 0 0 10px; color: var(--accent); }
.validation-box__actions { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.validation-reject summary { cursor: pointer; list-style: none; }
.validation-reject summary::-webkit-details-marker { display: none; }
.validation-reject[open] summary { margin-bottom: 8px; }
.validation-reject form { display: flex; flex-direction: column; gap: 8px; min-width: 280px; }
.validation-reject textarea { background: rgba(0,0,0,0.25); border: 1px solid var(--border); color: var(--text); padding: 8px 10px; border-radius: 4px; font: inherit; resize: vertical; }
.validation-history { margin-top: 10px; font-size: 12px; color: var(--text-muted); font-style: italic; }
.task-validation-note { margin: 8px 0 0; padding: 8px 12px; background: rgba(220,80,80,0.08); border-left: 3px solid #e89b9b; font-size: 13px; }

/* ---------- Commentaires sur tâche ---------- */
.task-comments { margin-top: 12px; }
.task-comments__title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin: 0 0 6px; font-weight: 600; }
.comment-list--compact { gap: 8px; }
.comment-list--compact .comment { padding: 8px 12px; font-size: 13px; }
.comment__attachments { list-style: none; margin: 6px 0 0; padding: 6px 0 0; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.comment__attachments a { color: var(--accent); text-decoration: none; }
.comment__attachments a:hover { text-decoration: underline; }
.comment__attach-meta { color: var(--text-muted); margin-left: 6px; font-size: 11px; }

/* ---------- Formulaire commentaire avec pièce jointe ---------- */
.comment-form__actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.comment-form__attach { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text-muted); font-size: 12px; }
.comment-form__attach input[type="file"] { max-width: 180px; font-size: 11px; color: var(--text-muted); }
.comment-form--inline { margin-top: 10px; }
.comment-form--inline textarea { min-height: 50px; }

/* ---------- Admin tâches : ligne principale + actions ---------- */
.task-admin-item { flex-direction: column; align-items: stretch; gap: 10px; }
.task-admin-item__row { display: flex; gap: 14px; align-items: flex-start; }
.task-admin-item__actions { display: flex; gap: 6px; flex-direction: column; }
.inline-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.inline-check input { margin: 0; }

/* ---------- Invoices (devis/factures) ---------- */
.invoice-table, .time-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.invoice-table th, .time-table th { text-align: left; padding: 8px 10px; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); font-weight: 600; }
.invoice-table td, .time-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.invoice-table tfoot td, .time-table tfoot td { font-weight: 600; border-top: 2px solid var(--border); border-bottom: 0; }
.invoice-table code { background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 3px; font-size: 12px; color: var(--accent); }
.invoice-status { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.invoice-status--brouillon { background: rgba(150,150,150,0.2); color: #aaa; }
.invoice-status--envoye    { background: rgba(90,140,220,0.2); color: #9ab8e6; }
.invoice-status--accepte   { background: rgba(76,175,80,0.18); color: #8bce8f; }
.invoice-status--refuse    { background: rgba(220,80,80,0.2);  color: #e89b9b; }
.invoice-status--paye      { background: rgba(76,175,80,0.28); color: #8bce8f; }
.invoice-status--annule    { background: rgba(100,100,100,0.25); color: #888; }
.invoice-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.invoice-actions form { margin: 0; }
.invoice-new { margin-top: 14px; }
.invoice-new summary { cursor: pointer; list-style: none; }
.invoice-new summary::-webkit-details-marker { display: none; }
.invoice-new[open] summary { margin-bottom: 12px; }
.invoice-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px dashed var(--border); border-radius: 6px; background: rgba(0,0,0,0.15); }
.invoice-form .form__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.invoice-form label { display: flex; flex-direction: column; font-size: 12px; color: var(--text-muted); gap: 4px; }
.invoice-form input, .invoice-form select, .invoice-form textarea { background: rgba(0,0,0,0.25); border: 1px solid var(--border); color: var(--text); padding: 8px 10px; border-radius: 4px; font: inherit; }

/* ---------- Timesheet ---------- */
.time-form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; padding: 14px; border: 1px dashed var(--border); border-radius: 6px; background: rgba(0,0,0,0.15); }
.time-form .form__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.time-form label { display: flex; flex-direction: column; font-size: 12px; color: var(--text-muted); gap: 4px; }
.time-form input, .time-form select { background: rgba(0,0,0,0.25); border: 1px solid var(--border); color: var(--text); padding: 8px 10px; border-radius: 4px; font: inherit; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .invoice-form .form__row, .time-form .form__row { grid-template-columns: 1fr; }
    .task-admin-item__row { flex-direction: column; }
    .task-admin-item__actions { flex-direction: row; }
    .invoice-table, .time-table { font-size: 12px; }
    .invoice-table th, .time-table th, .invoice-table td, .time-table td { padding: 6px 4px; }
}

/* ========================================================== */
/* Messages non lus + preview images (migration 003)          */
/* ========================================================== */

/* ---------- Carte projet avec badge non lu ---------- */
.project-card { position: relative; }
.project-card.has-unread { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(200,148,91,0.4); }
.project-card__unread {
    position: absolute;
    top: -8px; right: -8px;
    background: var(--accent); color: #1b1c1e;
    padding: 4px 10px; border-radius: 12px;
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.3px; white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* ---------- Lignes liste projets admin ---------- */
.data-table tr.row--has-unread td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* ---------- Étapes avec non lu ---------- */
.task-item.has-unread,
.task-admin-item.has-unread { box-shadow: inset 3px 0 0 var(--accent); }

/* ---------- Previews images (PJ) ---------- */
.comment__previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}
.comment__preview {
    display: block;
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.3);
    transition: transform .15s ease, border-color .15s ease;
}
.comment__preview:hover {
    transform: scale(1.03);
    border-color: var(--accent);
}
.comment__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 720px) {
    .comment__previews { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}

/* ========================================================== */
/* Améliorations UX — 4 points (banner / time-ago / nav / DnD) */
/* ========================================================== */

/* ---------- Bandeau actions requises ---------- */
.action-banner {
    margin: 12px 0 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(200,148,91,0.18), rgba(200,148,91,0.06));
    border: 1px solid rgba(200,148,91,0.4);
    border-radius: 8px;
}
.action-banner__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--accent); }
.action-banner__icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--accent); color: #1b1c1e;
    font-weight: 800; font-size: 15px;
}
.action-banner__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.action-banner__item a {
    display: grid;
    grid-template-columns: 140px 1fr auto auto;
    gap: 12px;
    padding: 10px 12px;
    align-items: center;
    color: var(--text);
    text-decoration: none;
    border-radius: 4px;
    transition: background .15s ease;
    font-size: 13px;
}
.action-banner__item a:hover { background: rgba(200,148,91,0.1); }
.action-banner__type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent); }
.action-banner__label { font-weight: 600; }
.action-banner__project { color: var(--text-muted); font-size: 12px; }
.action-banner__due { color: var(--text-muted); font-size: 11px; font-style: italic; }
.action-banner--admin { background: linear-gradient(135deg, rgba(220,80,80,0.15), rgba(220,80,80,0.05)); border-color: rgba(220,80,80,0.4); }
.action-banner--admin .action-banner__head { color: #e89b9b; }
.action-banner--admin .action-banner__icon { background: #e89b9b; }
.action-banner--admin .action-banner__item a:hover { background: rgba(220,80,80,0.1); }
.action-banner--admin .action-banner__type { color: #e89b9b; }

/* ---------- Nav ancrée projet ---------- */
.project-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 0;
    margin: 0 0 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.project-nav a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 16px;
    transition: color .15s ease, background .15s ease;
}
.project-nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.project-nav a.is-active { color: var(--accent); background: rgba(200,148,91,0.12); }
.project-nav__count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 6px;
    background: rgba(255,255,255,0.08);
    color: var(--text-muted);
    border-radius: 9px;
    font-size: 11px; font-weight: 600;
}
.project-nav__count--alert { background: var(--accent); color: #1b1c1e; }

/* ---------- Dates relatives (hover = pleine) ---------- */
.comment__date { cursor: help; border-bottom: 1px dotted transparent; }
.comment__date:hover { border-bottom-color: var(--text-muted); }

/* ---------- Liens cliquables dans les messages ---------- */
.comment__body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.comment__body a:hover { text-decoration-thickness: 2px; }

/* ---------- Drag & drop sur formulaires de message ---------- */
.comment-form { position: relative; transition: background .15s ease, box-shadow .15s ease; }
.comment-form.is-dropping {
    background: rgba(200,148,91,0.08);
    box-shadow: inset 0 0 0 2px dashed var(--accent);
    outline: 2px dashed var(--accent);
    outline-offset: -2px;
}
.comment-form.is-dropping::after {
    content: "Déposez pour joindre…";
    position: absolute;
    inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(200,148,91,0.2);
    color: var(--accent);
    font-weight: 600;
    pointer-events: none;
    border-radius: 6px;
}
.comment-form__selected { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.comment-form__chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(200,148,91,0.15);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

@media (max-width: 720px) {
    .action-banner__item a {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    .action-banner__type { font-size: 10px; }
    .project-nav { gap: 2px; padding: 8px 0; overflow-x: auto; flex-wrap: nowrap; }
    .project-nav a { flex-shrink: 0; font-size: 12px; padding: 5px 10px; }
}
