/* ── DSI Pilot — Design System (charte Golive TimeSheet) ──────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --sidebar-w: 218px;
    --sidebar-collapsed-w: 50px;
    --topbar-h: 52px;
    --base-size: 13px;

    /* Palette Golive */
    --primary: #2b4251;
    --primary-hover: #3d5a6e;
    --accent: #6366f1;          /* Indigo DSI Pilot (≠ bleu TimeSheet) */
    --accent-hover: #4f46e5;
    --bg: #f0f4f8;
    --card: #ffffff;
    --surface: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;

    --success: #10b981;
    --success-bg: #dcfce7;
    --success-fg: #166534;
    --warning: #f59e0b;
    --warning-bg: #fff7ed;
    --warning-fg: #9a3412;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-fg: #991b1b;
    --info-bg: #eff6ff;
    --info-fg: #1e40af;

    --sidebar-text: #a8c4d4;
    --sidebar-active: rgba(255,255,255,0.12);

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    --radius: 8px;
    --radius-sm: 5px;
    --radius-lg: 12px;
}

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

html, body {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: var(--base-size);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

/* ── LAYOUT ─────────────────────────────────────────────────────────────── */

.app { display: flex; min-height: 100vh; }

.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content {
    flex: 1;
    padding: 24px 28px;
    width: 100%;
}

/* ── SIDEBAR ─────────────────────────────────────────────────────────────── */

.sidebar {
    width: var(--sidebar-w);
    background: var(--primary);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    z-index: 100;
}

.sidebar-brand {
    padding: 14px 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    position: relative;
}

.sidebar-logo {
    width: 34px; height: 34px;
    background: var(--sidebar-text);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.sidebar-brand-text { line-height: 1.25; }
.sidebar-brand-name { color: #fff; font-size: 13px; font-weight: 700; letter-spacing: -.2px; display: block; }
.sidebar-brand-sub { color: var(--sidebar-text); font-size: 10.5px; opacity: .8; }

.sidebar-nav {
    flex: 1;
    min-height: 0;        /* crucial Chrome fix : autorise le shrink en flexbox */
    padding: 8px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-group { padding: 8px 10px 2px; }

.nav-group-label {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .9px;
    text-transform: uppercase;
    color: var(--sidebar-text);
    opacity: .45;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 9px;
    margin: 1px 0;
    border-radius: 6px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 11.5px;
    transition: background .15s, color .15s;
    white-space: nowrap;
    overflow: hidden;
}

.nav-link:hover { background: var(--sidebar-active); color: #fff; }
.nav-link.active { background: var(--sidebar-active); color: #fff; font-weight: 500; }

.nav-link--project { padding-left: 10px; }
.project-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.nav-link--sm { font-size: 12px; opacity: .7; }
.nav-link--sm:hover { opacity: 1; }

/* ── SIDEBAR FOOTER ─────────────────────────────────────────────────────── */

.sidebar-footer {
    padding: 8px 10px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sf-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
}
.sf-user-info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; overflow: hidden; }
.sf-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
}

/* ── TOPBAR (supprimée — conservé pour rétrocompat éventuelle) ─────────── */

.topbar { display: none; }
.topbar-left  { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* ── BREADCRUMB BAR (remplace topbar) ─────────────────────────────────── */

.breadcrumb-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 10px 0 12px;
    min-height: 28px;
}
.breadcrumb-bar-crumbs { display: flex; align-items: center; gap: 4px; }
.breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb-link { color: var(--muted); text-decoration: none; font-size: 13px; }
.breadcrumb-link:hover { color: var(--text); }
.breadcrumb-sep { color: #94a3b8; margin: 0 6px; font-weight: 600; }

/* ── PAGE HELP TOOLTIP (icône ⓘ en haut à droite) ─────────────────────── */

.page-help { position: relative; display: flex; align-items: center; }
.page-help-trigger {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px;
    border-radius: 50%;
    color: var(--muted);
    cursor: help;
    transition: background .15s, color .15s;
}
.page-help-trigger:hover,
.page-help-trigger:focus-visible { background: var(--bg); color: var(--text); outline: none; }

.page-help-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 300px;
    background: var(--text);
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .15s, transform .15s;
    pointer-events: none;
    z-index: 60;
}
.page-help:hover .page-help-tooltip,
.page-help-trigger:focus-visible + .page-help-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ── USER CHIP (sidebar footer) ─────────────────────────────────────────── */

.user-chip { display: flex; align-items: center; gap: 8px; }
.user-avatar {
    width: 30px; height: 30px;
    background: var(--sidebar-text);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    font-size: 11px; font-weight: 600;
    flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: rgba(255,255,255,.5); text-transform: capitalize; }

/* ── NOTIFICATIONS ───────────────────────────────────────────────────────── */

.notif-btn {
    position: relative; cursor: pointer;
    padding: 6px; border-radius: 6px;
    color: var(--muted);
    transition: background .15s, color .15s;
}
.notif-btn:hover { background: var(--bg); color: var(--text); }

.notif-badge {
    position: absolute; top: 2px; right: 2px;
    min-width: 16px; height: 16px;
    background: var(--danger);
    color: #fff;
    border-radius: 8px;
    font-size: 10px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
}

.notif-panel {
    position: fixed; bottom: 80px; left: calc(var(--sidebar-w) + 8px);
    width: 320px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
}

.notif-panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: 13px;
}

.notif-list { max-height: 360px; overflow-y: auto; }
.notif-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--bg);
    cursor: pointer;
    transition: background .1s;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--info-bg); }
.notif-item-title { font-weight: 500; font-size: 13px; margin-bottom: 2px; }
.notif-item-body { color: var(--muted); font-size: 12px; }

/* ── PAGE HEADER ─────────────────────────────────────────────────────────── */

.page-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 24px;
}
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }

/* Action buttons row — always left-aligned, sits above a .task-filters-card
   when the page has filters. Kept close to the filter card on purpose so
   the two rows read as related without eating vertical space. */
.page-actions { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ── CARDS ───────────────────────────────────────────────────────────────── */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 600; }

/* ── STATS ───────────────────────────────────────────────────────────────── */

.stats-row {
    display: flex; gap: 16px; margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1; min-width: 160px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon--blue { background: #eff6ff; color: #3b82f6; }
.stat-icon--green { background: var(--success-bg); color: var(--success); }
.stat-icon--orange { background: var(--warning-bg); color: var(--warning); }

.stat-value { font-size: 24px; font-weight: 700; line-height: 1; }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 3px; }

/* ── DASHBOARD GRID ──────────────────────────────────────────────────────── */

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

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

/* ── TASK LIST (dashboard) ───────────────────────────────────────────────── */

.task-list { list-style: none; }

.task-list-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--bg);
}
.task-list-item:last-child { border-bottom: none; }

.task-list-link {
    flex: 1; color: var(--text); text-decoration: none; font-size: 13px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-list-link:hover { color: var(--accent); }

.task-due { font-size: 11px; color: var(--muted); }
.task-due.overdue { color: var(--danger); font-weight: 600; }

/* ── PROJECT MINI LIST (dashboard) ──────────────────────────────────────── */

.project-mini-list { list-style: none; }

.project-mini-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--bg);
}
.project-mini-item:last-child { border-bottom: none; }

.project-color-bar { width: 4px; height: 32px; border-radius: 2px; flex-shrink: 0; }
.project-mini-body { flex: 1; min-width: 0; }
.project-mini-name { display: block; color: var(--text); text-decoration: none; font-weight: 500; font-size: 13px; }
.project-mini-name:hover { color: var(--accent); }
.project-mini-status { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.project-mini-members { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ── PROJECTS GRID ───────────────────────────────────────────────────────── */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}

.project-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: box-shadow .2s, transform .15s;
}
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.project-card-accent { height: 3px; background: var(--project-color, var(--accent)); }

.project-card-body { flex: 1; padding: 10px 10px 6px; }

.project-card-header { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 3px; }

.project-name { font-size: 13px; font-weight: 600; margin-bottom: 1px; }
.project-desc { font-size: 11px; color: var(--muted); margin-bottom: 4px; line-height: 1.3; }

.project-meta { display: flex; gap: 10px; align-items: center; }

.project-members-count, .project-owner {
    display: flex; align-items: center; gap: 4px;
    font-size: 11px; color: var(--muted);
}
.project-owner { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:120px; }

.project-card-actions {
    padding: 5px 10px;
    border-top: 1px solid var(--bg);
    display: flex; gap: 6px;
}

/* ── KANBAN ──────────────────────────────────────────────────────────────── */

.project-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}

.project-views { display: flex; gap: 2px; background: var(--bg); border-radius: 6px; padding: 3px; }

.view-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 13px; font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.view-btn:hover { background: var(--card); color: var(--text); }
.view-btn--active { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }

.toolbar-actions { display: flex; gap: 8px; }

.kanban-board {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 20px;
    align-items: flex-start;
    min-height: calc(100vh - 200px);
}

.kanban-col {
    flex-shrink: 0;
    width: 280px;
    background: var(--bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex; flex-direction: column;
}

.kanban-col-header {
    padding: 12px 14px 10px;
    display: flex; align-items: center; gap: 8px;
    border-bottom: 2px solid var(--col-color, var(--border));
}

.col-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.col-name { font-size: 13px; font-weight: 600; flex: 1; }
.col-count {
    font-size: 11px; font-weight: 600;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1px 7px;
    color: var(--muted);
}

.kanban-cards {
    flex: 1;
    padding: 8px;
    min-height: 60px;
    display: flex; flex-direction: column; gap: 8px;
}

.kanban-cards.drag-over { background: var(--info-bg); border-radius: 8px; }

/* ── TASK CARD ───────────────────────────────────────────────────────────── */

.task-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    cursor: grab;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .15s, transform .1s;
}
.task-card:hover { box-shadow: var(--shadow-md); }
.task-card.dragging { opacity: .5; cursor: grabbing; }
.task-card.drag-ghost { box-shadow: var(--shadow-lg); opacity: 1; transform: rotate(1.5deg); }

.task-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }

.task-title {
    display: block;
    font-size: 13px; font-weight: 500; color: var(--text);
    text-decoration: none; line-height: 1.4;
    margin-bottom: 8px;
}
.task-title:hover { color: var(--accent); }

.task-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }

.label-chip {
    font-size: 10px; font-weight: 500;
    padding: 2px 6px; border-radius: 4px;
    border: 1px solid;
}

.task-card-footer { display: flex; justify-content: space-between; align-items: center; }

.task-avatar {
    width: 24px; height: 24px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 9px; font-weight: 600;
}
.task-avatar--sm { width: 22px; height: 22px; font-size: 9px; }

.task-meta-right { display: flex; gap: 8px; align-items: center; }

.task-subtask-count,
.task-comment-count {
    display: flex; align-items: center; gap: 3px;
    font-size: 11px; color: var(--muted);
}

.task-due-badge {
    font-size: 10px; font-weight: 500;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px; color: var(--muted);
}
.task-due-badge.overdue {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

.kanban-add-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px; margin: 4px 8px 8px;
    background: none; border: none;
    color: var(--muted); font-size: 12px; cursor: pointer;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.kanban-add-btn:hover { background: var(--card); color: var(--text); }

/* ── PRIORITY BADGES ─────────────────────────────────────────────────────── */

.priority-badge {
    font-size: 10px; font-weight: 600;
    padding: 2px 6px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: .3px;
}
.priority-badge--critical { background: #fef2f2; color: #dc2626; }
.priority-badge--high { background: #fff7ed; color: #ea580c; }
.priority-badge--medium { background: #fefce8; color: #ca8a04; }
.priority-badge--low { background: #f0fdf4; color: #16a34a; }

.priority-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.priority-dot--critical { background: #dc2626; }
.priority-dot--high { background: #ea580c; }
.priority-dot--medium { background: #ca8a04; }
.priority-dot--low { background: #16a34a; }

/* ── STATUS CHIPS ────────────────────────────────────────────────────────── */

.status-chip {
    font-size: 11px; font-weight: 500;
    padding: 2px 8px; border-radius: 10px;
    white-space: nowrap;
}
.status-chip--sm { font-size: 10px; padding: 1px 6px; }

.status-chip--active { background: var(--success-bg); color: var(--success-fg); }
.status-chip--archived { background: var(--bg); color: var(--muted); }
.status-chip--completed { background: var(--info-bg); color: var(--info-fg); }

/* ── TABLE VIEW ──────────────────────────────────────────────────────────── */

.filter-bar {
    display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
    margin-bottom: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: 11px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.filter-select, .filter-input {
    height: 32px; padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px; background: var(--card); color: var(--text);
    outline: none;
}
.filter-select:focus, .filter-input:focus { border-color: var(--accent); }
.filter-group--search { flex: 1; min-width: 180px; }
.filter-input { width: 100%; }

.table-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* ── Generic .table (audit, my_time, reports/time, project_dashboard) ────── */
.table { width: 100%; border-collapse: collapse; }
.table thead th {
    padding: 10px 14px;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .4px; color: var(--sidebar-text);
    background: var(--primary); border-bottom: none;
    text-align: left; white-space: nowrap; position: relative;
}
.table thead th:first-child { padding-left: 16px; }
.table tbody td {
    padding: 10px 14px; font-size: 13px;
    border-bottom: 1px solid #edf0f5; vertical-align: middle;
}
.table tbody td:first-child { padding-left: 16px; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:nth-child(odd) td  { background: #f8fafc; }
.table tbody tr:nth-child(even) td { background: #ffffff; }
.table tbody tr:hover td { background: #eff6ff !important; }

.tasks-table { width: 100%; border-collapse: collapse; }
.tasks-table th {
    padding: 10px 14px;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .4px; color: var(--sidebar-text);
    background: var(--primary); border-bottom: none;
    text-align: left; white-space: nowrap; position: relative;
}
.tasks-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #edf0f5;
    font-size: 13px; vertical-align: middle;
}
.tasks-table tbody tr:nth-child(odd) td  { background: #f8fafc; }
.tasks-table tbody tr:nth-child(even) td { background: #ffffff; }
.tasks-table tr:last-child td { border-bottom: none; }
.tasks-table tr:hover td { background: #eff6ff !important; }

.task-title-cell { max-width: 320px; }
.task-table-link { color: var(--text); text-decoration: none; font-weight: 500; }
.task-table-link:hover { color: var(--accent); }
.task-desc-hint { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

.assignee-cell { display: flex; align-items: center; gap: 7px; }

.text-muted { color: var(--muted); }
.count-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 10px; font-size: 11px; color: var(--muted);
}

.overdue-text { color: var(--danger); font-weight: 600; }

/* ── TASK DETAIL ─────────────────────────────────────────────────────────── */

.task-detail-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .task-detail-layout { grid-template-columns: 1fr; }
    .task-detail-side { order: -1; }
}

.task-title-input {
    width: 100%; border: none; outline: none;
    font-size: 18px; font-weight: 700;
    color: var(--text); padding: 0;
    margin-bottom: 16px;
    background: transparent;
    border-bottom: 2px solid transparent;
    transition: border-color .2s;
}
.task-title-input:focus { border-bottom-color: var(--accent); }

.task-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.meta-item { display: flex; flex-direction: column; gap: 5px; }
.meta-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.meta-value { font-size: 13px; font-weight: 500; }

.form-select--sm, .form-input--sm {
    height: 32px; font-size: 13px;
    padding: 0 10px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg); color: var(--text); outline: none;
}
.form-select--sm:focus, .form-input--sm:focus { border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }

.task-edit-form .form-actions { margin-top: 16px; display: flex; gap: 8px; align-items: center; }

/* Comments */
.comment {
    display: flex; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg);
}
.comment:last-of-type { border-bottom: none; }
.comment--deleted { opacity: .5; }
.comment-avatar {
    width: 32px; height: 32px; flex-shrink: 0;
    background: var(--accent); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 11px; font-weight: 600;
}
.comment-avatar--deleted { background: var(--muted); }
.comment-body { flex: 1; }
.comment-header { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.comment-author { font-size: 13px; font-weight: 600; }
.comment-date { font-size: 11px; color: var(--muted); }
.comment-text { font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.comment-form { margin-top: 16px; }

/* @mention autocomplete */
.mention-input-wrap { position: relative; }
.mention-dropdown {
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    margin-top: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    max-height: 220px;
    overflow-y: auto;
    z-index: 50;
}
.mention-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
}
.mention-item:hover,
.mention-item.selected { background: var(--bg); }
.mention-item-name { font-weight: 500; color: var(--text); }
.mention-item-email { font-size: 11px; }

/* Subtasks */
.subtask-list { list-style: none; }
.subtask-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 0; border-bottom: 1px solid var(--bg); font-size: 13px;
}
.subtask-item a { color: var(--text); text-decoration: none; flex: 1; }
.subtask-item a:hover { color: var(--accent); }

/* Info list */
.info-list { list-style: none; }
.info-list dt { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 10px; }
.info-list dd { font-size: 13px; margin-top: 2px; }
.info-list dd a { color: var(--accent); text-decoration: none; }
.info-list dd:first-of-type { margin-top: 0; }

.quick-links { display: flex; flex-direction: column; gap: 6px; }
.quick-link { font-size: 13px; color: var(--accent); text-decoration: none; }
.quick-link:hover { text-decoration: underline; }

/* ── FORMS ───────────────────────────────────────────────────────────────── */

.form-page { display: flex; justify-content: center; padding-top: 8px; }

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

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }

.form-label { font-size: 12px; font-weight: 600; color: var(--text); }
.required { color: var(--danger); }

.field-hint {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px;
    margin-left: 4px;
    border-radius: 50%;
    background: var(--border); color: var(--muted);
    font-size: 10px; font-weight: 700; font-style: normal;
    cursor: help;
}
.field-hint:hover { background: var(--muted); color: #fff; }

.form-input {
    height: 38px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13px; background: var(--card); color: var(--text);
    font-family: inherit; outline: none;
    transition: border-color .2s;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }

.form-textarea {
    height: auto; padding: 10px 12px;
    resize: vertical; line-height: 1.5;
}

.form-select { appearance: none; cursor: pointer; }
.form-select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }

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

.color-picker-row { display: flex; align-items: center; gap: 10px; }
.color-input { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; padding: 2px; }
.color-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.color-preset {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid transparent; cursor: pointer;
    transition: transform .1s;
}
.color-preset:hover { transform: scale(1.2); border-color: rgba(0,0,0,.2); }

.icon-preset-row { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-preset-btn {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg); color: var(--muted);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; transition: border-color .1s, color .1s;
}
.icon-preset-btn:hover { color: var(--text); border-color: var(--muted); }
.icon-preset-btn--active { color: var(--primary); border-color: var(--primary); background: var(--card); }

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    border: none; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500; font-family: inherit;
    cursor: pointer; text-decoration: none;
    transition: background .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
}

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

.btn-outline {
    background: transparent; color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg); }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }

.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-bg); }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

.btn:disabled, .btn.btn-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn-link {
    background: none; border: none;
    color: var(--accent); font-size: 13px; cursor: pointer;
    text-decoration: none; font-family: inherit;
}
.btn-link:hover { text-decoration: underline; }
.btn-link--danger { color: var(--danger); }

/* ── MODAL ───────────────────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.35);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 480px; max-width: 95vw;
    padding: 24px;
}

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
    background: none; border: none;
    font-size: 20px; color: var(--muted);
    cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* ── EMPTY STATES ────────────────────────────────────────────────────────── */

.empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--muted);
}
.empty-icon { margin-bottom: 16px; opacity: .3; }
.empty-state h2 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 13px; margin-bottom: 20px; }
.empty-state a { color: var(--accent); text-decoration: none; }

.empty-state-sm { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }

/* ── ALERTS ──────────────────────────────────────────────────────────────── */

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.alert-success { background: var(--success-bg); color: var(--success-fg); border: 1px solid var(--success); }

/* ── SETTINGS PAGE ───────────────────────────────────────────────────────── */

.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

.settings-page { display: flex; flex-direction: column; gap: 20px; }
.settings-card { max-width: 680px; }

/* ── Shell "Paramètres" / "Administration documentaire" (sous-onglets + soufflets, façon D365) ── */
.settings-shell { display: flex; align-items: flex-start; gap: 24px; }
.settings-subnav-v {
    flex: 0 0 220px; display: flex; flex-direction: column;
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
    background: var(--card);
}
.settings-subnav-v-link {
    padding: 10px 14px; font-size: 13px; color: var(--text); text-decoration: none;
    border-left: 3px solid transparent; border-bottom: 1px solid var(--border);
    transition: background .1s, border-color .1s;
}
.settings-subnav-v-link:last-child { border-bottom: none; }
.settings-subnav-v-link:hover { background: var(--bg); }
.settings-subnav-v-link.active {
    border-left-color: var(--accent); background: var(--bg); font-weight: 600; color: var(--accent);
}
.settings-shell-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.settings-soufflet {
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
    overflow: hidden;
}
.settings-soufflet-header {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 16px; cursor: pointer; list-style: none; user-select: none;
    background: var(--bg); font-weight: 600; font-size: 13.5px; color: var(--text);
}
.settings-soufflet-header::-webkit-details-marker { display: none; }
.settings-soufflet-header::marker { content: ""; }
.settings-soufflet-chevron { flex-shrink: 0; color: var(--muted); transition: transform .15s; }
.settings-soufflet[open] > .settings-soufflet-header .settings-soufflet-chevron { transform: rotate(180deg); }
.settings-soufflet-subtitle { font-size: 12px; color: var(--muted); padding: 10px 16px 0; margin: 0; }
.settings-soufflet-body { padding: 16px; }

.danger-zone {
    padding: 16px;
    background: var(--danger-bg);
    border: 1px solid var(--danger);
    border-radius: var(--radius-sm);
}
.danger-title { font-size: 14px; font-weight: 600; color: var(--danger-fg); margin-bottom: 6px; }
.danger-desc { font-size: 12px; color: var(--danger-fg); margin-bottom: 12px; }

/* ── Project list — groups + gear ───────────────────────────────────────── */

.project-group { margin-bottom: 28px; }
.project-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.project-group-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.project-group-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.project-group-desc {
    font-size: 12px;
    color: var(--muted);
}
.project-group-count {
    margin-left: auto;
    font-size: 11px;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1px 8px;
}

.card-gear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    opacity: 0;
    transition: opacity .15s, background .15s, color .15s;
}
.project-card:hover .card-gear-btn { opacity: 1; }
.card-gear-btn:hover { background: var(--bg); color: var(--primary); }

.pole-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 11px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    padding: 0 6px;
}

/* ── Status management table ─────────────────────────────────────────────── */

.status-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 13px;
}
.status-table thead th {
    background: var(--primary);
    color: var(--sidebar-text);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 8px 10px;
    border-bottom: none;
    text-align: left;
}
.status-table thead th.st-col-flag,
.status-table thead th.st-col-pos { text-align: center; }
.status-table thead th.st-col-actions { width: 108px; }

.status-row td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.status-row:last-child td { border-bottom: none; }
.status-row:nth-child(even) td { background: #f8fafc; }
.status-row:hover td { background: #eff6ff; }

.st-col-color  { width: 52px; }
.st-col-name   { }
.st-col-pos    { width: 60px; text-align: center; }
.st-col-flag   { width: 72px; text-align: center; }
.st-col-actions{ width: 108px; text-align: right; }

.color-input-sm {
    width: 34px; height: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer; padding: 2px;
    display: block;
}
.form-input-inline {
    height: 30px;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    width: 100%;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.form-input-inline:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.form-input-num { width: 44px; text-align: center; }

.st-btn-save { gap: 4px; }
.st-btn-del  { padding: 4px 7px; }

/* ── Toggle switch ───────────────────────────────────────────────────────── */

.toggle-wrap {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    width: 34px;
    height: 18px;
    flex-shrink: 0;
}
.toggle-chk { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 9px;
    transition: background .2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    left: 2px; top: 2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-chk:checked + .toggle-slider { background: var(--accent); }
.toggle-chk:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle-chk:focus + .toggle-slider { box-shadow: 0 0 0 3px rgba(99,102,241,.2); }

/* ── Add status row ──────────────────────────────────────────────────────── */

.status-add-row {
    border-top: 1px solid var(--border);
    padding: 12px 10px 4px;
}
.status-add-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.st-add-label { font-size: 11px; color: var(--muted); margin-left: -6px; }

/* ── SCROLLBAR ───────────────────────────────────────────────────────────── */

/* Page-level : fine, discrète */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Sidebar nav : scrollbar 3px overlay pour ne pas réduire la largeur utile */
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.3); }
.sidebar-nav { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }

/* ── PHASE 2 ─────────────────────────────────────────────────────────────── */

/* Project sub-nav */
.project-subnav {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}
.subnav-link {
    padding: 6px 14px;
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .15s;
}
.subnav-link:hover { color: var(--text); }
.subnav-link.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 200;
    padding: 4px 0;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.active { color: var(--accent); font-weight: 500; }
.dropdown-divider { border-top: 1px solid var(--border); margin: 4px 0; }

/* Flex utils */
.flex { display: flex; }
.flex.gap-2 { gap: 8px; }
.align-center { align-items: center; }
.ml-2 { margin-left: 8px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.text-nowrap { white-space: nowrap; }
.text-muted { color: var(--muted); font-size: 12px; }
.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Stats row small */
.stats-row--sm { margin-bottom: 16px; }
.stat-card--sm { padding: 10px 16px; min-width: 80px; }
.stat-card--sm .stat-value { font-size: 20px; }

/* Phase 2 layout */
.phase2-grid { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .phase2-grid { grid-template-columns: 1fr; } }
.burndown-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }

/* Milestone cards */
.milestones-list { display: flex; flex-direction: column; gap: 10px; }
.milestone-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.milestone-diamond {
    width: 14px;
    height: 14px;
    min-width: 14px;
    transform: rotate(45deg);
    border-radius: 2px;
    margin-top: 3px;
}
.milestone-body { flex: 1; }
.milestone-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.milestone-name { font-weight: 600; font-size: 14px; }
.milestone-date { font-size: 12px; color: var(--muted); margin-left: auto; }
.milestone-date.overdue { color: var(--danger); }
.milestone-desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.milestone-tasks { font-size: 12px; color: var(--muted); margin-top: 6px; }
.milestone-actions { display: flex; gap: 6px; align-items: center; }

/* Gantt container */
.gantt-container { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.gantt-container svg { min-width: 600px; }
.priority-critical .bar { fill: #fee2e2 !important; }
.priority-high .bar { fill: #ffedd5 !important; }
.priority-medium .bar { fill: #e0e7ff !important; }
.milestone-bar .bar { fill: #fef3c7 !important; }

/* Calendar */
.calendar-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.fc-toolbar-title { font-size: 18px !important; font-weight: 600 !important; color: var(--text) !important; }
.fc-button { background: var(--bg) !important; border-color: var(--border) !important; color: var(--text) !important; font-size: 13px !important; }
.fc-button-active, .fc-button:hover { background: var(--accent) !important; color: #fff !important; border-color: var(--accent) !important; }
.fc-day-today { background: rgba(99,102,241,0.05) !important; }

/* Time tracking */
.duration-input { display: flex; align-items: center; gap: 6px; }
.duration-sep { color: var(--muted); font-size: 13px; }
.date-range-form { display: flex; align-items: center; gap: 8px; }
.time-summary-grid { display: grid; gap: 16px; }

/* Reports */
.reports-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 900px) { .reports-grid { grid-template-columns: 1fr; } }
.filter-bar { margin-bottom: 16px; }
.filter-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.progress-bar-wrap { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.progress-bar { height: 6px; background: var(--accent); border-radius: 3px; flex-shrink: 0; }
.progress-bar-wrap span { font-size: 12px; color: var(--muted); }

/* Workload grid */
.workload-legend { display: flex; gap: 16px; margin-bottom: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.workload-table-wrap { overflow-x: auto; }
.workload-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.workload-table th, .workload-table td { border: 1px solid var(--border); padding: 6px 8px; text-align: center; }
.workload-table .member-col { text-align: left; min-width: 140px; white-space: nowrap; font-weight: 500; }
.workload-table .day-col { min-width: 42px; font-size: 11px; }
.workload-table .day-name { font-weight: 400; }
.workload-table .weekend { background: var(--bg); color: var(--muted); }
.workload-table .day-cell { font-size: 11px; }
.workload-table .total-col { font-size: 13px; background: var(--bg); }
.workload-table thead th { background: var(--primary); color: var(--sidebar-text); font-weight: 600; border-bottom: none; position: sticky; top: 0; }

/* Floating timer */
.timer-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 14px 16px;
    min-width: 220px;
    z-index: 1000;
}
.timer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.timer-task-label { font-size: 12px; color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-close { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 14px; padding: 0; }
.timer-display { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); letter-spacing: 1px; margin-bottom: 10px; }
.timer-actions { display: flex; gap: 8px; }

/* Btn danger ghost */
.btn-danger-ghost { background: none; border: 1px solid var(--danger); color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-bg); }

/* btn-group */
.btn-group { display: flex; gap: 0; }
.btn-group .btn { border-radius: 0; border-right-width: 0; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-right-width: 1px; }
.btn-group .btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* icon button */
.btn-icon { background: none; border: none; cursor: pointer; padding: 4px; border-radius: 4px; color: var(--muted); display: inline-flex; align-items: center; }
.btn-icon--danger:hover { color: var(--danger); background: var(--danger-bg); }

/* color input */
.form-control--color { padding: 2px; height: 36px; width: 80px; cursor: pointer; }

/* card body */
.card-body { padding: 16px; }

/* Table link */
table .link { font-size: 13px; }

/* Time entries in task detail */
.time-entry-list { list-style: none; padding: 0 16px; margin: 0 0 8px; }
.time-entry-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; border-bottom: 1px solid var(--border); }
.time-entry-date { color: var(--muted); min-width: 36px; }
.time-entry-name { color: var(--muted); flex: 1; }
.w-full { width: 100%; }

/* Sprint status chips */
.status-chip--planning { background: rgba(100,116,139,0.12); color: #64748b; }
.status-chip--active { background: rgba(99,102,241,0.12); color: #6366f1; }
.status-chip--completed { background: rgba(34,197,94,0.12); color: #16a34a; }
.status-chip--pending { background: rgba(100,116,139,0.12); color: #64748b; }
.status-chip--reached { background: rgba(34,197,94,0.12); color: #16a34a; }
.status-chip--missed { background: rgba(239,68,68,0.12); color: #ef4444; }

/* ── Phase 3 — Search modal (Ctrl+K) ──────────────────────────────────────── */
.search-backdrop {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.45);
    backdrop-filter: blur(2px);
    z-index: 2000;
}
.search-modal {
    position: fixed;
    top: 14vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(600px, 92vw);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 70vh;
}
.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.search-icon { color: var(--muted); flex-shrink: 0; }
.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: var(--text);
    font-family: inherit;
}
.search-kbd {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
}
.search-results {
    overflow-y: auto;
    max-height: calc(70vh - 110px);
    padding: 6px 0;
}
.search-group-label {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    border-radius: 6px;
    margin: 0 6px;
    transition: background .1s;
}
.search-result-item:hover,
.search-result-item.selected { background: var(--bg); }
.search-result-item mark { background: rgba(99,102,241,.18); color: var(--accent); padding: 0 2px; border-radius: 2px; }
.search-type-badge {
    background: rgba(99,102,241,.1);
    color: var(--accent);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.search-empty {
    padding: 28px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}
.search-footer {
    display: flex;
    gap: 16px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    font-size: 11px;
    color: var(--muted);
}
.search-footer kbd {
    background: var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: inherit;
    font-size: 11px;
}

/* ── Phase 3 — Audit log page ─────────────────────────────────────────────── */
.audit-action {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.audit-action--create { background: rgba(16,185,129,.12); color: #059669; }
.audit-action--update { background: rgba(99,102,241,.12); color: var(--accent); }
.audit-action--delete { background: rgba(239,68,68,.12); color: var(--danger); }
.audit-action--start, .audit-action--complete { background: rgba(245,158,11,.12); color: #d97706; }
.audit-id {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: var(--muted);
    background: var(--bg);
    padding: 1px 4px;
    border-radius: 3px;
}
.audit-diff-row td { vertical-align: top; }
.audit-diff {
    display: none;
    margin-top: 6px;
}
.audit-diff.open { display: block; }
.diff-grid {
    display: grid;
    grid-template-columns: 120px 1fr 1fr;
    gap: 4px 8px;
    font-size: 12px;
    background: var(--bg);
    border-radius: 6px;
    padding: 10px 12px;
}
.diff-key { color: var(--muted); font-weight: 500; }
.diff-old { color: var(--danger); text-decoration: line-through; }
.diff-new { color: var(--success); }
.diff-arrow { color: var(--muted); text-align: center; }
.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
}
.pagination .btn { min-width: 34px; padding: 5px 8px; font-size: 12px; }

/* ── Phase 3 — Dashboard enrichi ─────────────────────────────────────────── */
.stat-card--danger { border-left: 3px solid var(--danger); }
.stat-card--danger .stat-value { color: var(--danger); }
.text-green { color: var(--success); }
.text-red { color: var(--danger); }

.project-progress-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.project-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.project-progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width .3s ease;
}
.project-mini-pct { font-size: 12px; color: var(--muted); min-width: 36px; text-align: right; }

.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    margin-top: 4px;
}
.activity-dot--create { background: var(--success); }
.activity-dot--delete { background: var(--danger); }
.activity-entity { font-weight: 500; color: var(--text); }
.activity-user { color: var(--muted); font-size: 12px; }
.activity-time { color: var(--muted); font-size: 11px; margin-left: auto; white-space: nowrap; }

/* ── Phase 3 — Récurrence ─────────────────────────────────────────────────── */
.recurrence-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(245,158,11,.12);
    color: #d97706;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
}
.recurrence-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.recurrence-select-wrap input[type=checkbox] { accent-color: var(--accent); }

/* ── Phase 3 — History / audit panel in task detail ─────────────────────── */
.history-panel {
    margin-top: 24px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}
.history-list { display: flex; flex-direction: column; gap: 6px; }
.history-item {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
    align-items: flex-start;
}
.history-item-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border);
    margin-top: 4px;
    flex-shrink: 0;
}
.history-item-dot--update { background: var(--accent); }
.history-item-dot--create { background: var(--success); }
.history-item-dot--delete { background: var(--danger); }
.history-item-body { flex: 1; }
.history-item-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Phase 4 — AI Assistant ────────────────────────────────────────────────── */
.ai-panel-header {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ai-badge {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.ai-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px 4px;
}
.ai-actions .btn { font-size: 12px; }

.ai-output {
    min-height: 0;
    max-height: 360px;
    overflow-y: auto;
    margin: 8px 16px 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    transition: max-height .3s ease;
}
.ai-output:not(:empty) {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    max-height: 360px;
}
.ai-output h1, .ai-output h2, .ai-output h3 {
    font-size: 13px;
    font-weight: 700;
    margin: 10px 0 4px;
    color: var(--text);
}
.ai-output h2 { font-size: 14px; }
.ai-output ul { padding-left: 18px; margin: 4px 0; }
.ai-output li { margin: 2px 0; }
.ai-output strong { color: var(--accent); }
.ai-output code {
    background: rgba(99,102,241,.1);
    color: var(--accent);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
}

/* Typing indicator */
.ai-typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 8px 0;
}
.ai-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    opacity: .4;
    animation: ai-bounce 1s ease-in-out infinite;
}
.ai-typing span:nth-child(2) { animation-delay: .15s; }
.ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-bounce {
    0%, 80%, 100% { transform: scale(1); opacity: .4; }
    40% { transform: scale(1.3); opacity: 1; }
}

.ai-error { color: var(--danger); font-size: 12px; }
.ai-success { color: var(--success); font-size: 12px; font-weight: 500; }

.ai-apply-wrap {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 12px;
}

/* Insights card full-width */
.ai-insights-card { margin-top: 20px; }
.ai-insights-output {
    padding: 0 16px 16px;
    font-size: 13px;
    line-height: 1.65;
}
.ai-insights-output:not(:empty) {
    background: var(--bg);
    border-radius: 8px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    margin: 0 16px 16px;
}
.ai-insights-output h1, .ai-insights-output h2, .ai-insights-output h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 10px 0 4px;
    color: var(--text);
}
.ai-insights-output ul { padding-left: 20px; margin: 4px 0; }
.ai-insights-output li { margin: 2px 0; }
.ai-insights-output strong { color: var(--accent); }

/* ── Page Tâches globale ───────────────────────────────────────────────────── */
.tasks-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.tasks-filter-search {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    flex: 1;
    min-width: 160px;
    max-width: 260px;
}
.filter-search-icon { color: var(--muted); flex-shrink: 0; }
.filter-search-input { border: none; outline: none; background: transparent; font-size: 13px; color: var(--text); width: 100%; font-family: inherit; }
.tasks-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    background: var(--bg);
    transition: all .15s;
}
.tasks-filter-toggle:hover { border-color: var(--accent); color: var(--accent); }
.tasks-filter-toggle.active { background: rgba(99,102,241,.1); border-color: var(--accent); color: var(--accent); font-weight: 500; }

/* Table — global tasks page */
.tasks-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); }
.task-row { transition: background .1s; }
.task-row:hover td { background: #eff6ff !important; }
.task-row--overdue td { background: #fff5f5 !important; }
.task-row--overdue:hover td { background: #fee2e2 !important; }

/* Column widths */
.col-priority { width: 130px; }
.col-title { min-width: 200px; }
.col-project { width: 150px; }
.col-status { width: 140px; }
.col-assignee { width: 120px; }
.col-due { width: 100px; }
.col-actions { width: 70px; }

/* Task link */
.task-table-link { color: var(--text); text-decoration: none; font-weight: 500; line-height: 1.4; display: block; }
.task-table-link:hover { color: var(--accent); }
.task-table-desc { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }

/* Inline selects */
.inline-form { margin: 0; }
.inline-select {
    border: none;
    background: transparent;
    font-size: 12px;
    color: var(--text);
    cursor: pointer;
    padding: 3px 4px;
    border-radius: 4px;
    max-width: 130px;
    outline: none;
    font-family: inherit;
}
.inline-select:hover, .inline-select:focus { background: var(--bg); border: 1px solid var(--border); }
.inline-select--status { padding-left: 6px; }

/* Project chip in table */
.project-chip {
    display: inline-block;
    padding: 3px 8px 3px 10px;
    background: var(--bg);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}
.project-chip:hover { background: var(--border); }

/* Assignee chip */
.assignee-chip { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.assignee-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Due date badges */
.due-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.due-badge--overdue { background: rgba(239,68,68,.12); color: var(--danger); }
.due-badge--soon { background: rgba(245,158,11,.12); color: #d97706; }
.due-overdue-delta { font-size: 10px; font-weight: 700; }
.due-date-normal { font-size: 12px; color: var(--muted); }

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR COLLAPSE + SETTINGS — ajout dynamique
═══════════════════════════════════════════════════════════════════ */

/* ── Transitions ── */
.sidebar { transition: width .22s cubic-bezier(.4,0,.2,1); }
.main    { transition: margin-left .22s cubic-bezier(.4,0,.2,1); }

/* ── Toggle button — dans sidebar-brand, icône blanche sur fond sombre ── */
.sidebar-toggle {
    width: 30px; height: 30px;
    border-radius: 7px;
    background: rgba(255,255,255,.10);
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.80);
    flex-shrink: 0;
    margin-left: auto;
    transition: background .15s, color .15s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.22); color: #fff; }

/* Collapsed : seulement l'icône toggle, centré */
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 10px 0; }
body.sidebar-collapsed .sidebar-logo  { display: none; }
body.sidebar-collapsed .sidebar-toggle { margin-left: 0; }

/* ── Collapsed state ── */
body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-w); }
body.sidebar-collapsed .main    { margin-left: var(--sidebar-collapsed-w); }

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .nav-group-label,
body.sidebar-collapsed .nav-link-label,
body.sidebar-collapsed .sf-user-info { display: none; }

body.sidebar-collapsed .sidebar-footer { padding: 8px 4px 10px; }
body.sidebar-collapsed .sf-user { justify-content: center; padding: 4px; }
body.sidebar-collapsed .sf-actions { justify-content: center; }
body.sidebar-collapsed .notif-panel { left: calc(var(--sidebar-collapsed-w) + 8px); }
body.sidebar-collapsed .settings-panel { left: calc(var(--sidebar-collapsed-w) + 8px); }

body.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 14px 0; }
body.sidebar-collapsed .nav-group     { padding: 5px 6px 2px; }
body.sidebar-collapsed .nav-link      { justify-content: center; padding: 7px 0; gap: 0; border-radius: 8px; }
body.sidebar-collapsed .nav-link svg  { flex-shrink: 0; }
body.sidebar-collapsed .project-dot   { margin: 0 auto; }

/* ── Tooltip in collapsed mode ── */
#navTooltip {
    position: fixed;
    background: var(--primary);
    color: rgba(255,255,255,.92);
    font-size: 11px; font-weight: 500;
    padding: 4px 10px 4px 8px;
    border-radius: 0 5px 5px 0;
    z-index: 500;
    pointer-events: none;
    display: none;
    white-space: nowrap;
    box-shadow: 2px 2px 6px rgba(0,0,0,.14);
    transform: translateY(-50%);
}

/* ── Nav group separator (visual bloc) ── */
.nav-group + .nav-group { border-top: 1px solid rgba(255,255,255,.06); }
body.sidebar-collapsed .nav-group + .nav-group { border-top: 1px solid rgba(255,255,255,.06); }

/* ── Settings panel (topbar) ── */
.settings-wrap  { position: relative; }
.settings-btn   { width: 30px; height: 30px; border-radius: 6px; background: none; border: none;
                  cursor: pointer; color: var(--muted); display: flex; align-items: center;
                  justify-content: center; transition: background .12s, color .12s; }
.settings-btn:hover { background: var(--bg); color: var(--text); }
.settings-btn.open  { background: var(--bg); color: var(--accent); }

.settings-panel {
    position: fixed; left: calc(var(--sidebar-w) + 8px); bottom: 70px; right: auto; top: auto;
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 14px 14px 12px; min-width: 210px; z-index: 400;
}
.settings-sep { height: 1px; background: var(--border); margin: 10px 0; }
.settings-section-title {
    font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
    color: var(--muted); margin-bottom: 8px;
}

/* Font scale buttons */
.sfb-row { display: flex; gap: 4px; }
.sfb {
    flex: 1; padding: 5px 0; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg);
    cursor: pointer; font-size: 10px; font-weight: 700;
    color: var(--muted); letter-spacing: .2px; text-align: center;
    transition: background .1s, color .1s, border-color .1s;
}
.sfb:hover             { border-color: var(--accent); color: var(--accent); }
.sfb.sfb-active        { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Sidebar toggle hint in settings */
.settings-sidebar-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11px; color: var(--text);
}
.settings-toggle-btn {
    padding: 3px 10px; font-size: 11px; font-weight: 500;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg); cursor: pointer; color: var(--muted);
    transition: background .1s, color .1s;
}
.settings-toggle-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Matrice de préférences de notification par type (panneau engrenage) */
.notif-prefs { margin-top: 10px; }
.notif-prefs-row {
    display: grid; grid-template-columns: 1fr 22px 22px; align-items: center;
    gap: 4px; font-size: 11px; color: var(--text); padding: 2px 0;
}
.notif-prefs-head { color: var(--muted); font-size: 12px; }
.notif-prefs-head span { text-align: center; }
.notif-prefs-label { color: var(--text); }
.notif-prefs-row input[type=checkbox] { justify-self: center; cursor: pointer; }

/* Row actions */
.row-actions { display: flex; gap: 4px; align-items: center; opacity: 0; transition: opacity .15s; }
.task-row:hover .row-actions { opacity: 1; }

/* ── Filter Bar — partagé entre toutes les pages de liste ─────────────────── */
.task-filters-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    padding: 9px 12px; display: flex; align-items: center; gap: 7px;
    flex-wrap: wrap; margin-bottom: 16px;
}
.filter-sep { width:1px; height:18px; background:var(--border); margin:0 1px; flex-shrink:0; }
.filter-search-wrap { position:relative; display:flex; align-items:center; }
.filter-search-ico  { position:absolute; left:8px; color:var(--muted); pointer-events:none; }
.filter-search-inp  {
    padding: 5px 8px 5px 28px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 12px; background: var(--bg); width: 160px;
    transition: border-color .15s, box-shadow .15s;
}
.filter-search-inp:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 2px rgba(43,66,81,.10); }
.filter-sel-wrap { position:relative; display:inline-flex; align-items:center; }
.filter-sel-wrap::after {
    content:''; position:absolute; right:7px; pointer-events:none;
    width:0; height:0; border-left:4px solid transparent;
    border-right:4px solid transparent; border-top:5px solid var(--muted);
}
.filter-sel {
    appearance:none; -webkit-appearance:none;
    padding: 5px 24px 5px 9px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 12px;
    background: var(--bg); color: var(--text); cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.filter-sel:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 2px rgba(43,66,81,.10); }
.filter-sel--active { border-color:var(--primary); background:rgba(43,66,81,.06); color:var(--primary); font-weight:600; }
.filter-pill {
    display:inline-flex; align-items:center; gap:5px; padding: 5px 11px;
    border: 1px solid var(--border); border-radius: 20px; font-size: 12px;
    cursor: pointer; background: var(--bg); color: var(--muted);
    user-select: none; transition: background .12s, border-color .12s, color .12s; white-space: nowrap;
}
.filter-pill:hover { border-color:var(--primary); color:var(--primary); }
.filter-pill.active { background:var(--primary); border-color:var(--primary); color:#fff; }
.filter-actions { margin-left:auto; display:flex; align-items:center; gap:6px; }
.filter-clear {
    display:inline-flex; align-items:center; gap:3px; padding: 4px 8px;
    border:none; background:none; font-size:11px; color:var(--muted);
    cursor:pointer; border-radius:var(--radius-sm); text-decoration:none; transition:color .12s;
}
.filter-clear:hover { color:#ef4444; }

/* ── Tableau de données avancé — partagé entre toutes les pages qui reprennent
   le pattern de tasks/all_tasks.html (voir CLAUDE.md, section du même nom) :
   colonnes triables/filtrables/redimensionnables/réordonnables, configurateur
   de colonnes, menu contextuel sur sélection de lignes. ───────────────────── */

/* Redimensionnement de colonne (bordure droite du <th>) */
.col-resizer {
    position:absolute; top:0; right:-3px; bottom:0; width:7px;
    cursor:col-resize; z-index:10; touch-action:none;
}
.col-resizer:hover, .col-resizer.resizing { background:rgba(255,255,255,.25); }

/* Réordonnement de colonne par glisser-déposer de l'en-tête */
.tg-th-draggable  { cursor:grab; }
.tg-th-dragging   { opacity:.35; }
.tg-th-dragover   { box-shadow:inset 3px 0 0 #fff, inset -3px 0 0 #fff; }

/* Configurateur de colonnes visibles (bouton "Colonnes") */
.col-cfg-panel {
    position:absolute; right:0; top:calc(100% + 6px); z-index:200;
    background:var(--card); border:1px solid var(--border);
    border-radius:var(--radius-lg); box-shadow:var(--shadow-md);
    padding:10px 14px; min-width:160px;
}
.col-cfg-title {
    font-size:10px; font-weight:700; color:var(--muted);
    text-transform:uppercase; letter-spacing:.6px; margin-bottom:8px;
}
.col-cfg-item {
    display:flex; align-items:center; gap:8px; padding:4px 0;
    font-size:12px; cursor:pointer; color:var(--text); white-space:nowrap;
}
.col-cfg-item:hover { color:var(--primary); }
.col-cfg-item input[type="checkbox"] { cursor:pointer; accent-color:var(--primary); }
[data-col].col-hidden { display:none !important; }
.col-cfg-hint {
    margin-top:6px; padding-top:8px; border-top:1px solid var(--border);
    font-size:10.5px; color:var(--muted); max-width:170px; line-height:1.4;
}
.col-cfg-reset {
    display:flex; align-items:center; gap:5px; width:100%; margin-top:8px;
    padding:5px 0; border:none; background:none; cursor:pointer;
    font-size:11px; font-weight:600; color:var(--primary); font-family:inherit;
}
.col-cfg-reset:hover { color:var(--accent); }

/* Sélecteur de vue (ex: "Vue par projet" / "Vue détaillée") — optionnel,
   seulement si une page propose plusieurs présentations des mêmes données */
.view-toggle { display:flex; border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; }
.view-toggle-btn {
    display:inline-flex; align-items:center; gap:5px; padding:4px 10px;
    font-size:11px; font-weight:600; color:var(--muted); text-decoration:none;
    background:var(--bg); transition:background .12s, color .12s; white-space:nowrap;
}
.view-toggle-btn:hover { color:var(--primary); }
.view-toggle-btn.active { background:var(--primary); color:#fff; }
.view-toggle-btn + .view-toggle-btn { border-left:1px solid var(--border); }

/* En-tête de colonne triable + filtrable — voir macro filterable_th() dans
   partials/_macros.html. Suppose un en-tête sombre (fond var(--primary)),
   comme .table thead th / .tasks-table th. */
.th-filterable { position:relative; }
.th-label { cursor:pointer; user-select:none; outline:none; }
.th-label:hover { text-decoration:underline; text-decoration-style:dotted; }
.th-sort-arrow { display:inline-block; margin-left:3px; font-size:9px; opacity:0.35; }
.filter-btn {
    border:none; background:rgba(255,255,255,.08); padding:2px 4px; border-radius:4px;
    color:rgba(255,255,255,.6); cursor:pointer; transition:background .12s, color .12s;
    vertical-align:middle; line-height:1; display:inline-flex; align-items:center; margin-left:3px;
}
.filter-btn:hover { background:rgba(255,255,255,.18); color:#fff; }
.filter-btn.filter-btn--active { background:#fff; color:var(--primary); }

.filter-menu {
    position:fixed; z-index:400; width:220px;
    background:var(--card); color:var(--text); border:1px solid var(--border);
    border-radius:10px; box-shadow:0 16px 40px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
    display:none; overflow:hidden; text-transform:none; letter-spacing:normal; font-weight:400;
}
.filter-menu.is-open { display:block; animation:filterFadeIn .12s ease; }
@keyframes filterFadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }

.filter-actions-row { display:flex; align-items:center; gap:6px; padding:10px 12px 8px; border-bottom:1px solid var(--border); }
.filter-actions-row .btn-outline { font-size:11px; padding:3px 10px; border-radius:100px; color:var(--muted); }
.filter-actions-row .btn-outline:hover { color:var(--text); }

.filter-search { display:block; width:calc(100% - 24px); margin:8px 12px 4px; padding:6px 10px;
    border:1px solid var(--border); border-radius:6px; font-family:inherit; font-size:12px;
    color:var(--text); background:var(--bg); outline:none; transition:border-color .12s, box-shadow .12s; }
.filter-search:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(79,156,249,.12); }
.filter-search::placeholder { color:var(--muted); }

.filter-list { max-height:200px; overflow-y:auto; padding:4px 0; scrollbar-width:thin; scrollbar-color:var(--border) transparent; }
.filter-option { display:flex; align-items:center; gap:8px; font-size:12px; padding:7px 12px; cursor:pointer; color:var(--text); transition:background .1s; user-select:none; }
.filter-option:hover { background:var(--bg); }
.filter-option input[type="checkbox"] {
    appearance:none; -webkit-appearance:none; width:15px; height:15px; flex-shrink:0; cursor:pointer;
    margin:0; border:1.5px solid #cbd5e1; border-radius:4px; background:var(--card);
    transition:background .12s, border-color .12s; position:relative;
}
.filter-option input[type="checkbox"]:checked { background:var(--primary); border-color:var(--primary); }
.filter-option input[type="checkbox"]:checked::after {
    content:""; position:absolute; left:4px; top:1px; width:4px; height:8px;
    border:2px solid #fff; border-top:none; border-left:none; transform:rotate(45deg);
}

.filter-footer { display:flex; justify-content:flex-end; gap:6px; padding:8px 12px; border-top:1px solid var(--border); background:#fafbfc; }

/* Menu contextuel (clic droit sur une sélection de lignes) */
.ctx-menu {
    position:fixed; z-index:500; min-width:210px;
    background:var(--card); color:var(--text); border:1px solid var(--border);
    border-radius:10px; box-shadow:0 16px 40px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
    padding:4px; display:none;
}
.ctx-menu.is-open { display:block; }
.ctx-menu-item {
    display:flex; align-items:center; gap:8px; width:100%;
    padding:8px 10px; border:none; background:none; text-align:left;
    font-size:13px; color:var(--text); cursor:pointer; border-radius:6px; font-family:inherit;
}
.ctx-menu-item:hover { background:var(--bg); }
.ctx-menu-item svg { flex-shrink:0; color:var(--muted); }

/* Ligne sélectionnée (case cochée) dans un tableau de ce type */
.dt-row--selected td { background:#eff6ff !important; }

/* ── Row selection → header action buttons (see admin/permissions.html):
   checking exactly one row enables the related buttons; anything else
   keeps them greyed out via .btn-disabled ─────────────────────────────── */
.row-selected td { background:#eff6ff !important; }
.role-row-check { cursor:pointer; accent-color:var(--primary); }

/* ══════════════════════════════════════════════════
   MODULE DOCS
══════════════════════════════════════════════════ */
.doc-layout { display:flex; gap:20px; align-items:flex-start; }
.doc-sidebar {
    flex:0 0 240px; background:var(--card); border:1px solid var(--border);
    border-radius:var(--radius); padding:12px; position:sticky; top:12px;
    max-height:calc(100vh - 90px); overflow-y:auto;
}
.doc-sidebar-title {
    font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px;
    color:var(--muted); padding:0 4px 8px;
}
.doc-main { flex:1; min-width:0; }
.doc-toc {
    flex:0 0 220px; position:sticky; top:12px; font-size:12px;
}
.doc-toc-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--muted); margin-bottom:8px; }
.doc-toc a { display:block; padding:3px 0; color:var(--muted); text-decoration:none; }
.doc-toc a:hover { color:var(--accent); }
.doc-toc a.doc-toc-h3 { padding-left:12px; font-size:11.5px; }
@media (max-width: 1200px) { .doc-toc { display:none; } }

.doc-tree-list { list-style:none; margin:0; padding-left:12px; }
.doc-sidebar > .doc-tree-list { padding-left:0; }
.doc-tree-item { margin:1px 0; }
.doc-tree-node > summary { list-style:none; }
.doc-tree-node > summary::-webkit-details-marker { display:none; }
.doc-tree-summary, .doc-tree-leaf {
    display:flex; align-items:center; gap:5px; padding:5px 6px; border-radius:6px;
    font-size:12.5px; color:var(--text); text-decoration:none; cursor:pointer;
}
.doc-tree-summary:hover, .doc-tree-leaf:hover { background:var(--bg); }
.doc-tree-summary--active { background:var(--accent-soft, #eef2ff); color:var(--accent); font-weight:600; }
.doc-tree-chevron { flex-shrink:0; transition:transform .12s; color:var(--muted); }
.doc-tree-node[open] > summary .doc-tree-chevron { transform:rotate(90deg); }
.doc-tree-summary a { color:inherit; text-decoration:none; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.doc-entity-card {
    display:flex; align-items:center; gap:12px; padding:14px 16px; border:1px solid var(--border);
    border-radius:var(--radius); background:var(--card); text-decoration:none; color:var(--text);
    transition:box-shadow .12s, border-color .12s;
}
.doc-entity-card:hover { box-shadow:var(--shadow-sm); border-color:var(--accent); }
.doc-entity-icon { font-size:22px; flex-shrink:0; }
.doc-entity-name { font-weight:600; font-size:13.5px; }
.doc-entity-desc { font-size:11.5px; color:var(--muted); margin-top:2px; }
.doc-entity-lock { margin-left:auto; color:var(--muted); flex-shrink:0; }
.doc-entity-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:12px; }

.doc-pole-badge {
    display:inline-block; padding:2px 9px; border-radius:10px; font-size:10.5px; font-weight:600;
    background:var(--bg); color:var(--muted); margin-left:8px; vertical-align:middle;
}

.doc-restore-badge {
    display:inline-block; padding:2px 9px; border-radius:10px; font-size:10.5px; font-weight:600;
    background:var(--info-bg, var(--bg)); color:var(--info-fg, var(--muted));
}

.doc-shelf-section { margin:20px 0; }
.doc-shelf-section-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.doc-shelf-section-title { font-size:15px; font-weight:600; margin:0; }
.doc-shelf-section-title a { color:inherit; text-decoration:none; }
.doc-shelf-section-title a:hover { color:var(--accent); }

.doc-page-meta { font-size:11.5px; color:var(--muted); display:flex; gap:14px; flex-wrap:wrap; margin-bottom:16px; }

/* Typographie « façon Outline » du contenu documentaire — lecture (.doc-content) et
   édition (.ProseMirror) partagent la même échelle pour que le rendu final ressemble à
   ce qu'on voit en tapant. Colonne de lecture resserrée (760px) plutôt que pleine largeur,
   corps de texte plus grand/aéré que le reste de l'app (13.5px) qui reste dense pour l'UI. */
.doc-content { max-width:760px; }
.doc-content, .ProseMirror {
    font-size:16px; line-height:1.7; color:var(--text);
}
.doc-content h1, .doc-content h2, .doc-content h3, .doc-content h4, .doc-content h5, .doc-content h6,
.ProseMirror h1, .ProseMirror h2, .ProseMirror h3, .ProseMirror h4, .ProseMirror h5, .ProseMirror h6 {
    font-weight:700; letter-spacing:-.01em; scroll-margin-top:16px;
}
.doc-content h1, .ProseMirror h1 { font-size:30px; line-height:1.25; margin:40px 0 16px; }
.doc-content h2, .ProseMirror h2 { font-size:22px; line-height:1.3; margin:32px 0 12px; }
.doc-content h3, .ProseMirror h3 { font-size:18px; line-height:1.35; margin:26px 0 10px; }
.doc-content h4, .ProseMirror h4 { font-size:15px; margin:22px 0 8px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.doc-content h5, .doc-content h6, .ProseMirror h5, .ProseMirror h6 { font-size:14px; margin:18px 0 6px; }
.doc-content > :first-child, .ProseMirror > :first-child { margin-top:0 !important; }

.doc-content p, .ProseMirror p { margin:0 0 16px; }
.doc-content ul, .doc-content ol, .ProseMirror ul, .ProseMirror ol { margin:0 0 16px; padding-left:26px; }
.doc-content li, .ProseMirror li { margin-bottom:4px; }

/* Listes de tâches GFM (`- [ ] texte`) — `.task-list-item` collisionne avec la classe du
   widget "Tâches" du tableau de bord (display:flex/padding/border-bottom/gap, voir plus
   haut dans ce fichier), qui n'est scopée par aucun ancêtre. Cette collision touche DEUX
   surfaces distinctes qui doivent donc être neutralisées séparément :
   - .doc-content (vue lecture) : classe émise par mdit_py_plugins.tasklists (docs_render.py).
   - .ProseMirror / .toastui-editor-contents (éditeur Toast UI, WYSIWYG) : sa propre classe
     "task-list-item" vendored (case cochée via ::before, voir toastui-editor.css) — sans ce
     correctif, le <li> heritait quand même display:flex/padding/border-bottom du widget
     dashboard (confirmé : 40px de haut pour une seule ligne courte au lieu de ~24px). */
.doc-content ul.contains-task-list { list-style:none; padding-left:4px; }
.doc-content li.task-list-item {
    display:list-item; list-style:none; align-items:normal; gap:0; padding:0; border-bottom:none;
}
.doc-content .task-list-item-checkbox { margin-right:8px; vertical-align:middle; accent-color:var(--accent); }

/* Éditeur : ne PAS toucher padding-left/margin-left ici — le vendored s'appuie dessus
   (padding-left:24px + margin-left:-24px) pour positionner sa case ::before ; il ne
   surcharge que padding-left (propriété individuelle), donc padding-top/bottom/right
   doivent être remis à zéro explicitement (le raccourci `padding:10px 0` de la collision
   n'est autrement jamais réécrit sur ces axes). */
.ProseMirror li.task-list-item, .toastui-editor-contents li.task-list-item {
    display:list-item; align-items:normal; gap:0; border-bottom:none;
    padding-top:0; padding-right:0; padding-bottom:0;
}
.doc-content li > ul, .doc-content li > ol, .ProseMirror li > ul, .ProseMirror li > ol { margin-top:4px; margin-bottom:0; }

.doc-content code, .ProseMirror code {
    background:rgba(99,102,241,.1); color:var(--accent); padding:2px 6px; border-radius:4px;
    font-size:.85em; font-family:'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.doc-content pre, .ProseMirror pre {
    background:var(--bg); border:1px solid var(--border); border-radius:8px;
    padding:14px 16px; margin:0 0 16px; overflow-x:auto;
}
.doc-content pre code, .ProseMirror pre code { background:none; color:inherit; padding:0; font-size:13.5px; }

.doc-content blockquote { border-left:3px solid var(--border); margin:0 0 16px; padding:2px 16px; color:var(--muted); font-style:italic; }

.doc-content table, .ProseMirror table { border-collapse:collapse; width:100%; margin:0 0 16px; font-size:14px; }
.doc-content th, .doc-content td, .ProseMirror th, .ProseMirror td { border:1px solid var(--border); padding:8px 12px; text-align:left; }
.doc-content th, .ProseMirror th { background:var(--bg); font-weight:600; }

.doc-content a, .ProseMirror a { color:var(--accent); text-decoration:none; }
.doc-content a:hover, .ProseMirror a:hover { text-decoration:underline; }

.doc-content hr, .ProseMirror hr { border:none; border-top:1px solid var(--border); margin:28px 0; }
.doc-content img, .ProseMirror img { max-width:100%; border-radius:8px; margin:8px 0; }

.doc-empty { text-align:center; padding:60px 0; color:var(--muted); }

.doc-lock-banner {
    display:flex; align-items:center; gap:10px; padding:10px 14px; border-radius:var(--radius);
    background:var(--warning-bg); color:var(--warning-fg); font-size:12.5px; margin-bottom:14px;
}

.doc-editor-wrap { border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }

.doc-search-result { padding:12px 14px; border-bottom:1px solid var(--border); }
.doc-search-result:last-child { border-bottom:none; }
.doc-search-result-title { font-weight:600; font-size:13.5px; }
.doc-search-result-title a { color:var(--text); text-decoration:none; }
.doc-search-result-title a:hover { color:var(--accent); }
.doc-search-result-path { font-size:11px; color:var(--muted); margin-bottom:4px; }
.doc-search-excerpt { font-size:12.5px; color:var(--muted); margin-top:4px; }
.doc-search-excerpt mark { background:#fef08a; color:inherit; border-radius:2px; }

.doc-link-search-wrap { position:relative; }
.doc-link-results {
    position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:20;
    background:var(--card); border:1px solid var(--border); border-radius:var(--radius-sm);
    box-shadow:var(--shadow-md); max-height:220px; overflow-y:auto;
}
.doc-link-result { padding:7px 10px; cursor:pointer; display:flex; flex-direction:column; gap:1px; font-size:12px; }
.doc-link-result:hover { background:var(--bg); }
.doc-link-result strong { font-size:12.5px; color:var(--text); }
.doc-link-result span { font-size:10.5px; color:var(--muted); }
.doc-link-result-empty { padding:8px 10px; font-size:12px; color:var(--muted); }

.doc-recent-list { display:flex; flex-direction:column; }
.doc-recent-row {
    display:flex; align-items:center; gap:10px; padding:10px 16px;
    text-decoration:none; color:inherit; border-bottom:1px solid var(--border);
    transition:background .1s;
}
.doc-recent-row:last-child { border-bottom:none; }
.doc-recent-row:hover { background:var(--bg); }
.doc-recent-row svg { color:var(--muted); }

/* Glisser-déposer des pages (docs/book.html + docs_dragdrop.js). Pas de display:contents :
   un chapitre sans page doit rester une zone de dépôt visible/ciblable (min-height inline
   ajouté côté template quand elle est vide) — un conteneur bloc ordinaire suffit sinon à
   préserver l'empilement visuel identique à l'ancienne liste plate. */
.doc-drag-handle { flex-shrink:0; color:var(--border); cursor:grab; display:flex; touch-action:none; }
.doc-drag-handle:hover { color:var(--muted); }
.doc-page-drag-row.doc-page-dragging { opacity:.5; cursor:grabbing; }
.doc-page-drag-row.doc-page-drag-ghost { background:var(--accent-soft, #eef2ff); box-shadow:inset 0 0 0 1px var(--accent); }
.doc-entity-card.doc-page-dragging { opacity:.5; cursor:grabbing; }
.doc-entity-card.doc-page-drag-ghost { background:var(--accent-soft, #eef2ff); box-shadow:inset 0 0 0 1px var(--accent); }
/* .doc-drag-handle est très pâle par défaut (var(--border), révélé au survol) — pertinent
   dans une liste dense de lignes déjà surlignées au survol (docs/book.html), mais invisible
   au premier coup d'œil sur une grille de cartes plus espacées : rendu visible par défaut ici. */
.doc-shelf-book-card .doc-drag-handle { color:var(--muted); }
.doc-shelf-book-card .doc-drag-handle:hover { color:var(--text); }
/* Zone de dépôt vide : bordure en pointillés pour la lire comme une cible de glisser-déposer
   plutôt que du texte inerte — classe togglée par docs_shelf_dragdrop.js après chaque drop. */
.doc-shelf-dragzone-empty { display:none; grid-column:1/-1; margin:0; padding:8px; font-size:12.5px; color:var(--muted); text-align:center; }
.doc-shelf-dragzone--empty { border:1px dashed var(--border); border-radius:var(--radius); min-height:60px; align-items:center; justify-content:center; }
.doc-shelf-dragzone--empty .doc-shelf-dragzone-empty { display:block; }
.doc-recent-info { display:flex; flex-direction:column; gap:1px; min-width:0; }
.doc-recent-title {
    font-weight:600; font-size:13px; color:var(--text);
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.doc-recent-meta { font-size:11.5px; color:var(--muted); }

.doc-tag-cloud { display:flex; flex-wrap:wrap; gap:8px; }
.doc-tag-chip {
    display:inline-flex; align-items:center; padding:4px 12px; border-radius:14px;
    font-size:12px; font-weight:600; text-decoration:none; transition:filter .1s;
}
.doc-tag-chip:hover { filter:brightness(0.92); }

.doc-page-tags { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.doc-page-tag-chip {
    display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:12px;
    font-size:11.5px; font-weight:600; text-decoration:none;
}
.doc-page-tag-remove {
    background:none; border:none; cursor:pointer; padding:0; margin-left:2px;
    line-height:1; color:inherit; opacity:.6; font-size:13px;
}
.doc-page-tag-remove:hover { opacity:1; }
.doc-tag-input-wrap { position:relative; display:inline-block; }
.doc-tag-input {
    border:1px dashed var(--border); border-radius:12px; padding:3px 10px; font-size:11.5px;
    background:none; color:var(--muted); width:120px; font-family:inherit;
}
.doc-tag-input:focus { outline:none; border-color:var(--accent); color:var(--text); }

/* Menu slash "/" de l'éditeur de documentation */
.docs-slash-menu {
    display:none; position:fixed; z-index:500; width:260px; max-height:320px; overflow-y:auto;
    background:var(--card); border:1px solid var(--border); border-radius:var(--radius);
    box-shadow:var(--shadow-lg); padding:4px;
}
.docs-slash-menu.open { display:block; }
.docs-slash-menu-item { display:flex; align-items:center; gap:10px; padding:6px 8px; border-radius:var(--radius-sm); cursor:pointer; }
.docs-slash-menu-item:hover, .docs-slash-menu-item.active { background:var(--bg); }
.docs-slash-menu-icon {
    flex-shrink:0; width:28px; height:28px; display:flex; align-items:center; justify-content:center;
    border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--muted);
    font-size:12px; font-weight:700;
}
.docs-slash-menu-text { display:flex; flex-direction:column; min-width:0; }
.docs-slash-menu-title { font-size:12.5px; font-weight:600; color:var(--text); }
.docs-slash-menu-desc { font-size:11px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.docs-slash-menu-empty { padding:10px 8px; font-size:12px; color:var(--muted); text-align:center; }

/* Citation normale (sans marqueur [!TYPE]) pendant l'édition — un vrai encadré coloré est
   appliqué en direct par docsNoticePlugin (wysiwygNodeViews) via la classe .doc-notice
   ci-dessous, réutilisée telle quelle par le NodeView ; ceci ne stylise QUE le cas restant. */
.ProseMirror blockquote:not(.doc-notice) {
    border-left:3px solid var(--border); margin:0 0 16px; padding:2px 16px;
    color:var(--muted); font-style:italic;
}
/* Paragraphe-marqueur ("[!INFO]" etc.) masqué en édition — voir docsNoticePlugin (décoration
   ProseMirror). Le texte reste dans le document/Markdown enregistré, seul le rendu est masqué. */
.docs-notice-marker-hidden { display:none; }

/* Encadrés (notices) info/success/warning/tip — <div> en lecture, <blockquote> classifié par
   docsNoticePlugin en édition (voir page_form.html + CLAUDE.md « Encadrés / notices ») */
.doc-notice {
    border-left:4px solid var(--border); border-radius:var(--radius-sm);
    padding:12px 16px 12px 44px; margin:16px 0; position:relative;
    background:var(--bg);
}
.doc-notice::before {
    position:absolute; left:14px; top:50%; transform:translateY(-50%); font-size:16px; line-height:1;
}
.doc-notice p { margin:0 0 8px; }
.doc-notice > p:first-child { margin-top:0; }
.doc-notice > p:last-child { margin-bottom:0; }
/* Le CSS par défaut de Toast UI (`.toastui-editor-contents blockquote`) est plus spécifique
   qu'un simple `.doc-notice` et écraserait son padding/sa marge dans l'éditeur — réaffirmé ici. */
.ProseMirror blockquote.doc-notice {
    padding:12px 16px 12px 44px; margin:16px 0; border-radius:var(--radius-sm); color:inherit;
}
.ProseMirror blockquote.doc-notice p { color:inherit; }
.doc-notice-info { border-left-color:#3b82f6; background:rgba(59,130,246,.08); }
.doc-notice-info::before { content:"ℹ️"; }
.doc-notice-success { border-left-color:#22c55e; background:rgba(34,197,94,.08); }
.doc-notice-success::before { content:"✅"; }
.doc-notice-warning { border-left-color:#f59e0b; background:rgba(245,158,11,.1); }
.doc-notice-warning::before { content:"⚠️"; }
.doc-notice-tip { border-left-color:#8b5cf6; background:rgba(139,92,246,.08); }
.doc-notice-tip::before { content:"💡"; }

/* Barre d'outils additionnelle de l'éditeur (encadrés) */
.docs-editor-extra-toolbar {
    display:flex; align-items:center; gap:4px; padding:6px 10px;
    border:1px solid var(--border); border-top:none; background:var(--surface);
}
.docs-editor-extra-label { font-size:11px; color:var(--muted); margin-right:4px; }
.docs-editor-extra-btn {
    display:inline-flex; align-items:center; gap:5px; padding:4px 10px; font-size:12px;
    border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--card);
    color:var(--text); cursor:pointer; transition:background .1s;
}
.docs-editor-extra-btn:hover { background:var(--bg); }

/* Titres repliables (H1-H4) — lecture et édition */
.doc-heading-toggle {
    display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px;
    margin-right:4px; vertical-align:middle; cursor:pointer; color:var(--muted); flex-shrink:0;
    background:none; border:none; padding:0; transition:transform .15s;
}
.doc-heading-toggle svg { width:14px; height:14px; }
.doc-heading-collapsed > .doc-heading-toggle { transform:rotate(-90deg); }
.doc-heading-hidden { display:none !important; }
