/* ============================================================
   Tac Industries — Feuille de style principale
   Design : moderne, lumineux, aéré, coloré
   ============================================================ */

:root {
    /* JARVIS — palette dark futuriste */
    --bg:           #0a0e1a;
    --bg-elevated:  #111827;
    --bg-sidebar:   #050913;
    --bg-sidebar-active: rgba(6, 182, 212, 0.10);
    --bg-muted:     #1e293b;
    --bg-hover:     #1a2236;

    --border:       #1e293b;
    --border-strong:#334155;

    --text:         #e2e8f0;
    --text-muted:   #94a3b8;
    --text-light:   #64748b;

    --primary:      #06b6d4;   /* cyan électrique */
    --primary-hover:#22d3ee;
    --primary-light:rgba(6, 182, 212, 0.14);
    --primary-glow: rgba(6, 182, 212, 0.45);

    --accent:       #818cf8;   /* indigo soft */
    --accent-glow:  rgba(129, 140, 248, 0.4);

    --success:      #10b981;
    --success-light:rgba(16, 185, 129, 0.14);
    --warning:      #f59e0b;
    --warning-light:rgba(245, 158, 11, 0.14);
    --danger:       #ef4444;
    --danger-light: rgba(239, 68, 68, 0.14);
    --info:         #06b6d4;
    --info-light:   rgba(6, 182, 212, 0.14);

    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 18px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow:    0 4px 12px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 8px 20px -8px rgba(6, 182, 212, 0.15);
    --shadow-glow: 0 0 24px rgba(6, 182, 212, 0.25);

    --sidebar-width: 240px;
    --header-height: 60px;
    --bottom-nav-height: 64px;

    --font:        'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono:   "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color .12s ease;
}
a:hover { color: var(--primary-hover); }

img, svg { max-width: 100%; display: block; }

h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 700; color: var(--text); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }
.section-title { font-size: 1.1rem; color: var(--text-muted); margin: 0 0 12px; }

p { margin: 0 0 1em; }

code, pre, kbd {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-muted);
    padding: 1px 5px;
    border-radius: 4px;
}
pre {
    padding: 12px 14px;
    overflow-x: auto;
    line-height: 1.45;
    border: 1px solid var(--border);
    background: #0f172a;
    color: #e2e8f0;
    border-radius: var(--radius);
}
pre code { background: transparent; padding: 0; color: inherit; }

/* ============================================================
   LAYOUT GÉNÉRAL : sidebar gauche + main
   ============================================================ */

.layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid rgba(6, 182, 212, 0.15);
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: inset -1px 0 0 rgba(6, 182, 212, 0.05);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 18px;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    color: var(--text);
}
.sidebar-brand .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6 60%, #ec4899);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-section-title {
    text-transform: uppercase;
    color: var(--text-light);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 14px 10px 6px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    transition: background .12s ease, color .12s ease, padding-left .12s ease;
    position: relative;
}
.sidebar-link:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-link.is-active {
    background: var(--bg-sidebar-active);
    color: var(--primary);
    padding-left: 14px;
}
.sidebar-link.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-light);
}

/* ============================================================
   HEADER + MAIN
   ============================================================ */

.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 30;
}
.topbar-burger {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 38px;
    height: 38px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.topbar-title {
    font-weight: 700;
    font-size: 1.05rem;
}
.topbar-search {
    flex: 1;
    max-width: 520px;
    margin: 0;
    position: relative;
    display: flex;
    align-items: center;
}
.topbar-search svg {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-light);
    pointer-events: none;
}
.topbar-search input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-muted);
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--text);
    transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.topbar-search input:focus {
    outline: none;
    background: var(--bg-elevated);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-muted);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.88rem;
    color: inherit;
    text-decoration: none;
}
.user-chip .avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.75rem;
}

.content {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-header h1 { margin: 0; }
.page-header .subtitle { color: var(--text-muted); margin-top: 4px; }

.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 6px; color: var(--text-light); }

/* ============================================================
   COMPONENTS
   ============================================================ */

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -20px -20px 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    gap: 10px;
    flex-wrap: wrap;
}
.card-header h3 { margin: 0; }
.card-body p:last-child { margin-bottom: 0; }

.grid {
    display: grid;
    gap: 16px;
}
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }

.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
}
.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.stat-card .stat-icon svg { width: 22px; height: 22px; color: #fff; }
.stat-card.is-primary .stat-icon { background: var(--primary); }
.stat-card.is-success .stat-icon { background: var(--success); }
.stat-card.is-warning .stat-icon { background: var(--warning); }
.stat-card.is-danger  .stat-icon { background: var(--danger); }
.stat-card.is-info    .stat-icon { background: var(--info); }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat-label { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary);
    color: #0a0e1a;
    border: 1px solid var(--primary);
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
    text-decoration: none;
    box-shadow: 0 2px 12px -2px rgba(6, 182, 212, 0.35);
}
.btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #0a0e1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 22px -2px var(--primary-glow);
}
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }
.btn.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border-color: var(--border-strong);
}
.btn.btn-secondary:hover { background: var(--bg-hover); color: var(--text); }
.btn.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}
.btn.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn.btn-success { background: var(--success); border-color: var(--success); }
.btn.btn-success:hover { background: #15803d; border-color: #15803d; }
.btn.btn-sm { padding: 5px 10px; font-size: 0.82rem; }
.btn.btn-lg { padding: 12px 22px; font-size: 1.02rem; }
.btn.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Forms */
form .field { margin-bottom: 18px; }
form label, .field-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text);
}
form .field-hint, .field-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
}
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="url"], input[type="search"], input[type="color"],
select, textarea {
    width: 100%;
    border: 1px solid var(--border-strong);
    background: var(--bg-muted);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.94rem;
    color: var(--text);
    transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-light); opacity: 0.7; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(6, 182, 212, 0.06);
    box-shadow: 0 0 0 3px var(--primary-light), 0 0 20px rgba(6, 182, 212, 0.15);
}
textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row.three { grid-template-columns: 1fr 1fr 1fr; }
.field-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
input[type="color"] { padding: 2px; height: 38px; width: 60px; }

.form-row-inline {
    display: flex;
    gap: 10px;
    align-items: center;
}
.form-row-inline > input, .form-row-inline > select {
    flex: 1;
}

/* Tableau */
.table-wrapper { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
table.data th, table.data td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
table.data th {
    background: var(--bg-muted);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--bg-hover); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-gray   { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.25); }
.badge-blue   { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-green  { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-orange { background: rgba(249, 115, 22, 0.15); color: #fdba74; border: 1px solid rgba(249, 115, 22, 0.3); }
.badge-red    { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-yellow { background: rgba(234, 179, 8, 0.15); color: #fde047; border: 1px solid rgba(234, 179, 8, 0.3); }
.badge-purple { background: rgba(139, 92, 246, 0.15); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-cyan   { background: rgba(6, 182, 212, 0.15); color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.3); }

/* Flash alerts */
.flash-list { margin-bottom: 18px; }
.alert {
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 8px;
    border-left: 4px solid;
    font-size: 0.92rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alert-success { background: var(--success-light); border-color: var(--success); color: #6ee7b7; }
.alert-error,
.alert-danger  { background: var(--danger-light);  border-color: var(--danger);  color: #fca5a5; }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: #fde047; }
.alert-info    { background: var(--info-light);    border-color: var(--info);    color: #67e8f9; }

/* Cartes projet/famille */
.tile {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    display: block;
    color: inherit;
}
.tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
    color: var(--text);
}
.tile-title { font-weight: 700; font-size: 1.05rem; margin: 0 0 4px; }
.tile-desc { color: var(--text-muted); font-size: 0.88rem; margin: 0; }
.tile-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 0.82rem; color: var(--text-muted); }
.tile-strip {
    height: 4px;
    margin: -18px -18px 14px;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    background: var(--primary);
}

/* Vignette avec image de fond */
.tile.has-cover {
    position: relative;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    border-color: transparent;
}
.tile.has-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.25) 0%, rgba(15, 23, 42, 0.85) 100%);
    z-index: 0;
}
.tile.has-cover > * {
    position: relative;
    z-index: 1;
}
.tile.has-cover .tile-title,
.tile.has-cover .tile-desc,
.tile.has-cover .tile-meta {
    color: #fff;
}
.tile.has-cover:hover {
    color: #fff;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state .empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--bg-muted);
    display: grid;
    place-items: center;
}
.empty-state .empty-icon svg { width: 30px; height: 30px; color: var(--text-light); }
.empty-state h4 { color: var(--text); margin-bottom: 6px; }

/* Drop zone */
.dropzone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 26px;
    text-align: center;
    background: var(--bg-muted);
    transition: border-color .12s ease, background .12s ease;
    cursor: pointer;
}
.dropzone:hover, .dropzone.is-drag {
    border-color: var(--primary);
    background: var(--primary-light);
}
.dropzone-label { font-weight: 600; }
.dropzone-hint  { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }
.dropzone input[type="file"] { display: none; }

/* Comments */
.comment {
    border-left: 3px solid var(--border);
    padding: 10px 14px;
    margin-bottom: 10px;
    background: var(--bg-muted);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.comment.is-resolved { opacity: 0.55; border-left-color: var(--success); }
.comment-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 5px; }
.comment-actions { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }

/* Filters bar */
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    align-items: center;
}
.filters select, .filters input[type="search"] { width: auto; min-width: 160px; }

/* Family color swatch */
.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -200px;
    left: 0;
    background: var(--primary);
    color: #fff;
    padding: 8px 14px;
    z-index: 1000;
}
.skip-link:focus { top: 0; color: #fff; }

/* ============================================================
   AUTH LAYOUT (login, install)
   ============================================================ */

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(800px 400px at 20% 10%, rgba(6, 182, 212, 0.15), transparent 60%),
        radial-gradient(700px 400px at 80% 90%, rgba(129, 140, 248, 0.15), transparent 60%),
        var(--bg);
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--bg-elevated);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(6, 182, 212, 0.1);
    padding: 36px;
    position: relative;
}
.auth-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.4), transparent 50%, rgba(129, 140, 248, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}
.auth-brand {
    text-align: center;
    margin-bottom: 26px;
}
.auth-brand .brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6 60%, #ec4899);
    display: inline-grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    font-size: 1.4rem;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}
.auth-brand h1 { margin: 0; font-size: 1.45rem; }
.auth-brand p  { margin: 4px 0 0; color: var(--text-muted); font-size: 0.92rem; }

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 900px) {
    .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
    .field-row, .field-row.three { grid-template-columns: 1fr; }
    .content { padding: 16px; }
}

@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 82%;
        max-width: 300px;
        z-index: 110;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.6), var(--shadow-lg);
        border-right: 1px solid rgba(6, 182, 212, 0.3);
    }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(5, 9, 19, 0.7);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 100;
        opacity: 0;
        pointer-events: none;
        transition: opacity .22s ease;
    }
    .sidebar-overlay.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    /* Tableaux → cartes */
    table.data {
        display: block;
    }
    table.data thead { display: none; }
    table.data tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 12px;
        margin-bottom: 10px;
        background: var(--bg-elevated);
    }
    table.data td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
        border: none;
        padding: 4px 0;
    }
    table.data td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        flex-shrink: 0;
    }
    .table-wrapper { border: none; background: transparent; }
}

/* ============================================================
   ATELIER MAGIQUE — Hero, Welcome, Activity, Form JARVIS
   ============================================================ */

.hero-card {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 45%, #ec4899 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    box-shadow: 0 18px 40px -20px rgba(99, 102, 241, 0.55);
    position: relative;
    overflow: hidden;
}
.hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(600px 200px at 100% 0%, rgba(255,255,255,0.25), transparent 60%),
        radial-gradient(400px 200px at 0% 100%, rgba(255,255,255,0.15), transparent 60%);
    pointer-events: none;
}
.hero-card-sm { padding: 20px 26px; }
.hero-content { position: relative; z-index: 1; min-width: 0; }
.hero-title {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #fff;
}
.hero-quote {
    margin: 6px 0 0;
    font-size: 1rem;
    color: rgba(255,255,255,0.9);
    font-weight: 400;
    max-width: 720px;
}
.hero-actions { position: relative; z-index: 1; flex-shrink: 0; }
.hero-actions .btn {
    background: rgba(255,255,255,0.16);
    border-color: rgba(255,255,255,0.32);
    color: #fff;
    backdrop-filter: blur(6px);
}
.hero-actions .btn:hover {
    background: rgba(255,255,255,0.26);
    border-color: rgba(255,255,255,0.48);
    color: #fff;
    transform: translateY(-1px);
}

/* Onboarding cards */
.welcome-card {
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.06) 0%, var(--bg-elevated) 100%);
    border: 1px solid rgba(6, 182, 212, 0.2);
    box-shadow: inset 0 1px 0 rgba(6, 182, 212, 0.08), var(--shadow);
}
.steps {
    display: grid;
    gap: 16px;
    margin-top: 8px;
}
.step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 4px 10px -2px rgba(79, 70, 229, 0.4);
}

/* Activity feed */
.activity-feed { display: grid; gap: 12px; }
.activity-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background .12s ease;
}
.activity-item:hover { background: var(--bg-hover); }
.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-light);
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

/* Formulaire en deux colonnes : form + side */
.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: flex-start;
}
.form-side { display: grid; gap: 16px; position: sticky; top: calc(var(--header-height) + 16px); }

.form-section {
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}
.form-section:first-child { padding-top: 4px; }
.form-section:last-of-type { border-bottom: none; padding-bottom: 8px; }
.form-section-title {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
}
.form-section-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.form-section-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

/* JARVIS card */
.jarvis-card {
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.05) 0%, var(--bg-elevated) 100%);
    border: 1px solid rgba(6, 182, 212, 0.25);
    box-shadow: inset 0 1px 0 rgba(6, 182, 212, 0.1), 0 4px 16px -4px rgba(6, 182, 212, 0.15);
    position: relative;
    overflow: hidden;
}
.jarvis-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.18), transparent 70%);
    pointer-events: none;
}
.jarvis-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.jarvis-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #06b6d4, #818cf8);
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.15), 0 0 24px rgba(6, 182, 212, 0.4);
    animation: jarvis-pulse 2.4s ease-in-out infinite;
}
@keyframes jarvis-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.15), 0 0 24px rgba(6, 182, 212, 0.4); }
    50%      { box-shadow: 0 0 0 10px rgba(6, 182, 212, 0.08), 0 0 36px rgba(6, 182, 212, 0.6); }
}
.jarvis-tip-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 8px;
}
.jarvis-tip-list {
    margin: 0 0 12px;
    padding-left: 18px;
    color: var(--text);
}
.jarvis-tip-list li {
    margin-bottom: 6px;
    line-height: 1.45;
}
.jarvis-tip-foot {
    font-size: 0.8rem;
    color: var(--text-light);
    font-style: italic;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.next-steps, .inspire-list {
    margin: 0;
    padding-left: 20px;
}
.next-steps li, .inspire-list li {
    margin-bottom: 8px;
    line-height: 1.5;
}
.inspire-list { list-style: '✨ '; padding-left: 24px; }

/* Mobile : form-side passe sous le form */
@media (max-width: 1100px) {
    .form-layout { grid-template-columns: 1fr; }
    .form-side { position: static; }
}

@media (max-width: 768px) {
    .hero-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px;
    }
    .hero-title { font-size: 1.35rem; }
}

/* ============================================================
   ATELIER IA — Modale + boutons Claude
   ============================================================ */

.ai-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 16px 16px;
    overflow-y: auto;
    animation: ai-fade-in .15s ease;
}
.ai-modal-overlay[hidden] { display: none; }
@keyframes ai-fade-in { from { opacity: 0; } to { opacity: 1; } }

.ai-modal {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 760px;
    overflow: hidden;
    animation: ai-slide-in .18s ease;
}
@keyframes ai-slide-in {
    from { transform: translateY(-12px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}
.ai-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #f8faff 0%, var(--bg-elevated) 100%);
}
.ai-modal-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5, #ec4899);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.ai-modal-titles { flex: 1; min-width: 0; }
.ai-modal-titles h3 { margin: 0; }
.ai-modal-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.ai-modal-close {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    transition: background .12s ease;
}
.ai-modal-close:hover { background: var(--bg-muted); color: var(--text); }
.ai-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}
.ai-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-muted);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.ai-modal-footer:empty { display: none; }

.ai-modal-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    color: var(--text-muted);
}
.ai-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: ai-spin .8s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

.ai-modal-result {
    white-space: pre-wrap;
    line-height: 1.55;
    font-size: 0.95rem;
}
.ai-modal-result.markdown h1,
.ai-modal-result.markdown h2,
.ai-modal-result.markdown h3 { margin: 14px 0 6px; }
.ai-modal-result.markdown pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
}
.ai-modal-result.markdown code { font-size: 0.88em; }

.ai-modal-diff {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 720px) {
    .ai-modal-diff { grid-template-columns: 1fr; }
}
.ai-modal-diff > div {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--bg-muted);
}
.ai-modal-diff > div.is-improved {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.06);
}
.ai-modal-diff h4 {
    margin: 0 0 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.ai-modal-diff pre {
    margin: 0;
    background: transparent;
    border: none;
    color: var(--text);
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.5;
}

/* Boutons "✨ Améliorer" attachés à un textarea/input */
.ai-action-wrap { position: relative; }
.ai-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    border: none;
    padding: 5px 11px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.78rem;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
    box-shadow: 0 2px 8px -2px rgba(79, 70, 229, 0.4);
}
.ai-action-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.5); }
.ai-action-btn:disabled { opacity: .55; cursor: progress; transform: none; }
.ai-action-btn svg { width: 12px; height: 12px; }

.ai-field-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: -4px;
    margin-bottom: 6px;
}

/* ============================================================
   VOICE MODAL — dictée vocale + extraction Claude
   ============================================================ */
.voice-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 9, 19, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: ai-fade-in .15s ease;
}
.voice-modal-overlay[hidden] { display: none; }

.voice-modal {
    width: 100%;
    max-width: 540px;
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.06), var(--bg-elevated) 40%);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 80px rgba(6, 182, 212, 0.15);
    padding: 32px 24px 24px;
    position: relative;
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}

.voice-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    transition: background .12s ease;
}
.voice-modal-close:hover { background: var(--bg-muted); color: var(--text); }

.voice-modal-header h3 { margin: 0 0 6px; }
.voice-modal-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 22px;
}

/* Bouton micro géant */
.voice-mic-btn {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    color: #0a0e1a;
    cursor: pointer;
    display: grid;
    place-items: center;
    margin: 8px auto 18px;
    position: relative;
    transition: transform .15s ease;
    box-shadow:
        0 0 0 6px rgba(6, 182, 212, 0.12),
        0 0 40px rgba(6, 182, 212, 0.35);
}
.voice-mic-btn:hover { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(6, 182, 212, 0.16), 0 0 60px rgba(6, 182, 212, 0.55); }
.voice-mic-btn:active { transform: scale(0.97); }
.voice-mic-btn svg { width: 48px; height: 48px; position: relative; z-index: 2; }
.voice-mic-btn.is-active {
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.18), 0 0 50px rgba(239, 68, 68, 0.5);
    animation: voice-rec-pulse 1.4s ease-in-out infinite;
}
@keyframes voice-rec-pulse {
    0%, 100% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.18), 0 0 50px rgba(239, 68, 68, 0.5); }
    50%      { box-shadow: 0 0 0 16px rgba(239, 68, 68, 0.08), 0 0 80px rgba(239, 68, 68, 0.75); }
}
.voice-pulse {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 2px solid rgba(239, 68, 68, 0.5);
    animation: voice-wave 1.4s ease-out infinite;
    pointer-events: none;
}
@keyframes voice-wave {
    0%   { transform: scale(1);   opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

.voice-status {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}
.voice-status small {
    display: block;
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}
.voice-status-success { color: var(--success); }
.voice-status-error   { color: var(--danger); }

.voice-example {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-muted);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin: 18px 0 0;
    text-align: left;
    line-height: 1.5;
}
.voice-example em { color: var(--primary); font-style: normal; }

.voice-transcript {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-top: 18px;
    min-height: 70px;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.55;
}
.voice-transcript-done { background: rgba(6, 182, 212, 0.05); border-color: rgba(6, 182, 212, 0.2); }
.voice-interim { color: var(--text-light); font-style: italic; }

.voice-processing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 30px 0 20px;
}
.voice-processing .ai-spinner { width: 28px; height: 28px; border-width: 4px; }

.voice-preview {
    text-align: left;
    background: var(--bg-muted);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 14px 0;
    display: grid;
    gap: 10px;
}
.voice-preview-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.15);
    padding-bottom: 8px;
}
.voice-preview-row:last-child { border-bottom: none; padding-bottom: 0; }
.voice-preview-label {
    flex-shrink: 0;
    width: 110px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-top: 2px;
}
.voice-preview-value { flex: 1; color: var(--text); font-size: 0.95rem; word-break: break-word; }
.voice-preview-value em { color: var(--text-light); font-style: italic; }

.voice-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
    flex-wrap: wrap;
}

.voice-stage[data-voice-state="text"] textarea {
    margin: 14px 0;
}

/* Bouton "Dicter le projet" mis en valeur sur le form */
.voice-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #0a0e1a;
    border: none;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(6, 182, 212, 0.4);
    transition: transform .15s ease, box-shadow .15s ease;
}
.voice-trigger:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(6, 182, 212, 0.55); }
.voice-trigger svg { width: 18px; height: 18px; }

/* ============================================================
   BOTTOM NAV — mobile only
   ============================================================ */
.bottom-nav { display: none; }

@media (max-width: 900px) {
    .bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--bottom-nav-height);
        background: rgba(5, 9, 19, 0.92);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-top: 1px solid rgba(6, 182, 212, 0.22);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(6, 182, 212, 0.1);
        z-index: 90;
        padding: 6px 6px 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--text-muted);
        font-size: 0.7rem;
        background: transparent;
        border: none;
        text-decoration: none;
        cursor: pointer;
        font-family: inherit;
        font-weight: 500;
        transition: color .12s ease;
        padding: 4px;
        min-width: 0;
    }
    .bottom-nav-item span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .bottom-nav-item svg { width: 22px; height: 22px; flex-shrink: 0; }
    .bottom-nav-item:hover, .bottom-nav-item:focus-visible { color: var(--text); }
    .bottom-nav-item.is-active { color: var(--primary); }
    .bottom-nav-item.is-active svg {
        filter: drop-shadow(0 0 6px var(--primary-glow));
    }

    .bottom-nav-item.is-center {
        position: relative;
    }
    .bottom-nav-center-mark {
        width: 54px;
        height: 54px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--primary), var(--accent));
        display: grid;
        place-items: center;
        margin-top: -22px;
        margin-bottom: 1px;
        box-shadow: 0 6px 22px rgba(6, 182, 212, 0.55), 0 0 0 4px rgba(5, 9, 19, 1);
        animation: jarvis-pulse 2.4s ease-in-out infinite;
    }
    .bottom-nav-center-mark svg { width: 24px; height: 24px; color: #0a0e1a; }
    .bottom-nav-item.is-center.is-active span { color: var(--primary); }
    .bottom-nav-item.is-center.is-active .bottom-nav-center-mark {
        box-shadow: 0 6px 30px rgba(6, 182, 212, 0.7), 0 0 0 4px rgba(5, 9, 19, 1);
    }

    .content {
        padding-bottom: calc(var(--bottom-nav-height) + 28px) !important;
    }
    .topbar-title { display: none; }
    .topbar-burger { display: none; } /* on a déjà le menu en bas */
}

@media (max-width: 600px) {
    .topbar { padding: 0 14px; }
    .topbar-search input { font-size: 0.86rem; }
    .topbar-user .user-chip span:not(.avatar) { display: none; }
    .topbar-user .btn span { display: none; }
}

/* Sidebar brand tagline */
.sidebar-brand-tagline {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

/* Animations sobres */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================
   GALERIE D'IMAGES (concept art / éléments)
   ============================================================ */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.image-thumb {
    position: relative;
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-muted);
    aspect-ratio: 4 / 3;
}
.image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.image-thumb-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 4px 8px;
    font-size: 0.72rem;
    color: #fff;
    background: linear-gradient(180deg, rgba(15,23,42,0) 0%, rgba(15,23,42,0.8) 100%);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   MENU CONTEXTUEL (clic droit : restaurer)
   ============================================================ */
.context-menu {
    position: fixed;
    z-index: 2000;
    min-width: 170px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 4px;
}
.context-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font: inherit;
    color: var(--text);
}
.context-menu-item:hover { background: var(--primary-light); color: var(--primary); }

/* ============================================================
   GESTION DE PROJET (tâches / timeline)
   ============================================================ */
.muted-text { color: var(--text-muted); }

/* Checklist (façon Google Keep) */
.checklist { display: flex; flex-direction: column; gap: 8px; max-width: 780px; }
.cl-item {
    display: flex; align-items: flex-start; gap: 12px;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px 14px; transition: box-shadow .12s ease, opacity .12s ease;
}
.cl-item:hover { box-shadow: var(--shadow); }
.cl-item.cl-dragging { opacity: .45; border-style: dashed; }
.cl-handle { color: var(--text-light); cursor: grab; user-select: none; line-height: 1.4; font-size: 1.05rem; }
.cl-handle:active { cursor: grabbing; }
.cl-check { width: 19px; height: 19px; margin-top: 2px; cursor: pointer; flex-shrink: 0; accent-color: var(--primary); }
.cl-main { flex: 1; min-width: 0; }
.cl-title { font-weight: 600; line-height: 1.3; }
.cl-item.is-done .cl-title { text-decoration: line-through; color: var(--text-muted); font-weight: 500; }
.cl-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.cl-meta a { color: inherit; text-decoration: none; }
.cl-meta a:hover { color: var(--primary); }
.cl-meta .color-dot { width: 9px; height: 9px; }
.cl-by:not(:empty) { color: var(--success, #059669); font-weight: 600; }
.checklist.hide-done .cl-item.is-done { display: none; }

/* Sections (tuiles de rangement) */
.checklist { gap: 18px; }
.cl-section { background: var(--bg-muted); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.cl-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cl-section-name { font-weight: 700; font-size: 1rem; }
.cl-section-list { display: flex; flex-direction: column; gap: 8px; min-height: 38px; border-radius: var(--radius-sm); }
.cl-section-list:empty::after { content: "Dépose une tâche ici"; display: block; text-align: center; color: var(--text-light); font-size: 0.8rem; padding: 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.cl-section-actions { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.cl-sec-menu { position: relative; }
.cl-sec-menu > summary { list-style: none; cursor: pointer; padding: 2px 8px; }
.cl-sec-menu > summary::-webkit-details-marker { display: none; }
.cl-sec-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 50; width: 300px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 12px; }
.cl-newsec { display: flex; gap: 8px; align-items: center; }
.cl-newsec input { flex: 1; }
.cl-expand { font-size: 1rem; line-height: 1; }

/* Popup d'agrandissement de section */
.cl-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; }
.cl-modal[hidden] { display: none; }
.cl-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.5); }
.cl-modal-dialog { position: relative; z-index: 1; width: 100%; max-width: 720px; max-height: 86vh; overflow-y: auto; background: var(--bg-elevated); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 18px 22px; }
.cl-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cl-modal-title { font-weight: 800; font-size: 1.2rem; }
.cl-modal-x { border: none; background: var(--bg-muted); width: 32px; height: 32px; border-radius: 50%; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--text-muted); flex-shrink: 0; }
.cl-modal-x:hover { background: var(--border); color: var(--text); }
.cl-modal-x-float { position: absolute; top: 12px; right: 14px; z-index: 2; }
body.cl-modal-open { overflow: hidden; }

/* Bouton info sur une tâche */
.cl-info { border: none; background: transparent; color: var(--text-light); cursor: pointer; font-size: 1.05rem; line-height: 1; padding: 2px 4px; flex-shrink: 0; align-self: center; border-radius: var(--radius-sm); }
.cl-info:hover { color: var(--primary); background: var(--primary-light); }

/* Fragment détails de tâche (popup) */
.ti-title { margin: 0 36px 12px 0; font-size: 1.25rem; }
.ti-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ti-fields { display: flex; flex-direction: column; gap: 8px; margin: 0 0 6px; }
.ti-fields > div { display: flex; gap: 12px; align-items: baseline; }
.ti-fields dt { width: 110px; flex-shrink: 0; color: var(--text-muted); font-size: 0.85rem; }
.ti-fields dd { margin: 0; }
.ti-sec { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.ti-sec h4 { margin: 0 0 6px; font-size: 0.9rem; color: var(--text-muted); }

/* Notes de version (changelog) */
.nav-new { margin-left: auto; background: var(--danger); color: #fff; font-size: 0.62rem; font-weight: 700; letter-spacing: .02em; padding: 1px 7px; border-radius: 999px; text-transform: uppercase; }
.changelog { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.chlog-entry { background: var(--bg-elevated); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--radius); padding: 16px 18px; }
.chlog-entry.is-current { border-left-color: var(--primary); box-shadow: var(--shadow); }
.chlog-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.chlog-ver { font-weight: 800; color: var(--primary); font-size: 1.05rem; }
.chlog-title { font-weight: 600; }
.chlog-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.chlog-list li { line-height: 1.5; }

/* ============================================================
   ARBRE D'UNE ANIMATION (éléments → tâches)
   ============================================================ */
.tree { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.tree-node { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tree-node-head { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.tree-node-head::-webkit-details-marker { display: none; }
.tree-caret { width: 0; height: 0; border-left: 6px solid var(--text-muted); border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform .15s ease; flex-shrink: 0; }
.tree-node[open] .tree-caret { transform: rotate(90deg); }
.tree-node-name { font-weight: 700; font-size: 1rem; }
.tree-node-count { font-size: 0.8rem; color: var(--text-muted); }
.tree-node-link { margin-left: auto; font-size: 0.8rem; color: var(--text-muted); text-decoration: none; flex-shrink: 0; }
.tree-node-link:hover { color: var(--primary); }
.tree-tasks { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.tree-tasks .cl-item { padding: 8px 10px; background: var(--bg-muted); }

.cl-title-btn { border: none; background: transparent; padding: 0; font: inherit; font-weight: 600; text-align: left; cursor: pointer; color: var(--text); }
.cl-title-btn:hover { color: var(--primary); text-decoration: underline; }
.cl-item.is-done .cl-title-btn { color: var(--text-muted); text-decoration: line-through; font-weight: 500; }

/* Ajout rapide (un seul champ) */
.tree-add { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: transparent; }
.tree-add:focus-within { border-color: var(--primary); background: var(--primary-light); }
.tree-add-plus { color: var(--text-light); font-size: 1.1rem; font-weight: 700; }
.tree-add input { flex: 1; border: none; background: transparent; padding: 3px 0; font: inherit; color: var(--text); }
.tree-add input:focus { outline: none; }
.tree-add-element { max-width: 820px; margin-top: 4px; }

/* Sections secondaires repliables */
.tree-sec { margin-top: 16px; }
.tree-sec > summary { list-style: none; cursor: pointer; }
.tree-sec > summary::-webkit-details-marker { display: none; }
.tree-sec > summary h3 { display: inline-block; margin: 0; }
.tree-sec > summary::before { content: "▸"; color: var(--text-muted); margin-right: 8px; display: inline-block; }
.tree-sec[open] > summary::before { content: "▾"; }
.tree-sec-body { margin-top: 14px; }

.task-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.task-row:last-child { border-bottom: none; }
.task-main { flex: 1; min-width: 0; }
.task-desc { color: var(--text-muted); font-size: 0.88rem; margin-top: 4px; white-space: pre-line; }
.task-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.task-actions { flex-shrink: 0; }
.task-quick select { min-width: 150px; }
.task-edit > summary { list-style: none; cursor: pointer; }
.task-edit > summary::-webkit-details-marker { display: none; }
.task-edit[open] > summary { margin-bottom: 4px; }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: center; }
.timeline-label {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.timeline-track {
    position: relative;
    height: 26px;
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.timeline-bar {
    position: absolute;
    top: 3px;
    bottom: 3px;
    min-width: 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    padding: 0 8px;
    overflow: hidden;
}
.timeline-bar span {
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.timeline-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding-left: 172px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
@media (max-width: 768px) {
    .timeline-row { grid-template-columns: 1fr; gap: 4px; }
    .timeline-axis { padding-left: 0; }
    .task-row { flex-direction: column; }
}

/* ============================================================
   ESPACE DE GESTION DE PROJET (monday-like)
   ============================================================ */
/* Barre de vues */
.pm-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
    border-bottom: 1px solid var(--border); padding-bottom: 8px;
}
.pm-views { display: flex; gap: 4px; flex-wrap: wrap; }
.pm-view-tab {
    padding: 7px 14px; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 600;
    color: var(--text-muted); text-decoration: none; border: 1px solid transparent;
}
.pm-view-tab:hover { background: var(--bg-muted); color: var(--text); }
.pm-view-tab.is-active { background: var(--primary-light); color: var(--primary); }
.pm-toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn.is-active { background: var(--primary-light); color: var(--primary); }

/* Popover d'ajout */
.pm-add { position: relative; }
.pm-add > summary { list-style: none; cursor: pointer; }
.pm-add > summary::-webkit-details-marker { display: none; }
.pm-add-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: min(420px, 90vw); }
.pm-add-card { margin: 0; box-shadow: var(--shadow-lg); }

/* Avatars / pills */
.pm-avatar {
    display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary); color: #fff; font-size: 0.72rem; font-weight: 700;
}
.pm-avatar-empty { background: var(--bg-muted); border: 1px dashed var(--border-strong); }
.pm-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; color: #fff; font-size: 0.74rem; font-weight: 700; }
.pm-timeline { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #1f2937; color: #fff; font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
.pm-late { color: var(--danger); font-weight: 700; }
.pm-kind-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 7px; vertical-align: middle; }

/* Select statut coloré (auto-submit) */
.pm-status-select {
    color: #fff; font-weight: 700; border: none; border-radius: var(--radius-sm);
    padding: 5px 8px; min-width: 130px; cursor: pointer; -webkit-appearance: none; appearance: none;
    text-align: center; text-align-last: center;
}
.pm-status-select option { color: var(--text); background: #fff; }

/* Groupes (tableur) */
.pm-group { margin-bottom: 22px; }
.pm-group-head {
    display: flex; align-items: baseline; gap: 10px; padding: 6px 0 8px 12px;
    border-left: 4px solid var(--g); margin-bottom: 4px;
}
.pm-group-name { font-weight: 700; color: var(--g); font-size: 1.02rem; }
.pm-group-count { font-size: 0.8rem; color: var(--text-muted); }
.pm-table-wrap { border-left: 4px solid var(--g, var(--border)); }
.pm-table th { white-space: nowrap; font-size: 0.76rem; }
.pm-table td { vertical-align: middle; }
.pm-col-title { min-width: 220px; }
.pm-cell-control { width: 150px; }
.pm-cell-actions { width: 90px; text-align: right; }
.pm-table .task-quick { margin: 0; }

/* Kanban */
.pm-kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.pm-kcol { flex: 0 0 300px; max-width: 300px; }
.pm-kcol-head { color: #fff; font-weight: 700; padding: 9px 14px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.pm-kcol-count { float: right; opacity: .85; }
.pm-kcol-body { background: var(--bg-muted); border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 10px; min-height: 60px; display: flex; flex-direction: column; gap: 10px; }
.pm-kcard { background: var(--bg-elevated); border: 1px solid var(--border); border-left: 4px solid var(--g); border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--shadow); }
.pm-kcard-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.pm-kcard-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.pm-kcard-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }
.pm-kcard-notes { font-size: 0.82rem; color: var(--text-muted); border-top: 1px dashed var(--border); padding-top: 6px; margin-top: 2px; }
.pm-kcard-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* Fiches */
.pm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.pm-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.pm-card-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; color: #fff; font-weight: 700; }
.pm-card-body { padding: 14px; }
.pm-card-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 10px; }
.pm-card-fields { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.pm-card-fields > div { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.pm-card-fields dt { color: var(--text-muted); font-size: 0.82rem; }
.pm-card-fields dd { margin: 0; text-align: right; }
.pm-card-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }

/* Gantt */
.pm-gantt { display: flex; flex-direction: column; gap: 8px; }
.pm-gantt-row { display: grid; grid-template-columns: 180px 1fr; gap: 12px; align-items: center; }
.pm-gantt-label { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-gantt-track { position: relative; height: 30px; background: var(--bg-muted); border-radius: var(--radius-sm); overflow: hidden; }
.pm-gantt-bar { position: absolute; top: 4px; bottom: 4px; min-width: 8px; border-radius: var(--radius-sm); display: flex; align-items: center; padding: 0 8px; }
.pm-gantt-bar span { color: #fff; font-size: 0.72rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 2; }
.pm-gantt-axis { display: flex; justify-content: space-between; margin-top: 10px; padding-left: 192px; font-size: 0.78rem; color: var(--text-muted); }
.pm-gantt-axis-today { color: var(--danger); font-weight: 600; }

/* Calendrier */
.pm-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pm-cal-dow { text-align: center; font-size: 0.76rem; font-weight: 700; color: var(--text-muted); padding: 4px 0; }
.pm-cal-cell { min-height: 92px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; background: var(--bg-elevated); display: flex; flex-direction: column; gap: 3px; }
.pm-cal-out { background: var(--bg-muted); opacity: .5; }
.pm-cal-today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.pm-cal-num { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); }
.pm-cal-chip { font-size: 0.7rem; color: #fff; padding: 2px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tableau de bord */
.pm-dash { display: flex; flex-direction: column; gap: 16px; }
.pm-dash-stats { margin: 0; }
.pm-stat { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.pm-stat-label { font-size: 0.82rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.pm-stat-value { font-size: 1.9rem; font-weight: 800; margin-top: 4px; }
.pm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.pm-pie-wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.pm-pie { width: 150px; height: 150px; border-radius: 50%; flex-shrink: 0; box-shadow: var(--shadow); }
.pm-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 0.88rem; }
.pm-legend li { display: flex; align-items: center; gap: 8px; }
.pm-legend-inline { flex-direction: row; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 0.8rem; color: var(--text-muted); }
.pm-legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.pm-hbars { display: flex; flex-direction: column; gap: 10px; }
.pm-hbar-row { display: grid; grid-template-columns: 120px 1fr 32px; gap: 10px; align-items: center; }
.pm-hbar-label { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-hbar-track { background: var(--bg-muted); border-radius: 999px; height: 16px; overflow: hidden; }
.pm-hbar-fill { height: 100%; background: var(--primary); border-radius: 999px; }
.pm-hbar-val { text-align: right; font-weight: 700; font-size: 0.85rem; }
.pm-vbars { display: flex; gap: 16px; align-items: flex-end; height: 180px; padding-top: 10px; }
.pm-vbar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.pm-vbar-track { width: 70%; max-width: 54px; height: 120px; background: var(--bg-muted); border-radius: var(--radius-sm); display: flex; flex-direction: column-reverse; overflow: hidden; }
.pm-vbar-fill { width: 100%; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.pm-stack-seg:first-child { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.pm-vbar-val { font-weight: 700; font-size: 0.82rem; margin-top: 6px; }
.pm-vbar-label { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; text-align: center; }

@media (max-width: 768px) {
    .pm-gantt-row { grid-template-columns: 110px 1fr; }
    .pm-gantt-axis { padding-left: 122px; }
    .pm-hbar-row { grid-template-columns: 90px 1fr 28px; }
    .pm-cal-cell { min-height: 64px; }
    .pm-cal-chip { font-size: 0; padding: 3px; }
}

/* Vignette animation : raccourci « Gestion de projet » */
.tile-wrap { position: relative; display: flex; }
.tile-wrap > .tile { flex: 1; }
.tile-quick {
    position: absolute; right: 12px; bottom: 12px; z-index: 3;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 700;
    background: var(--primary); color: #fff; text-decoration: none;
    box-shadow: var(--shadow); opacity: .92;
}
.tile-quick:hover { opacity: 1; color: #fff; transform: translateY(-1px); }
.tile.has-cover ~ .tile-quick { background: rgba(255,255,255,.92); color: var(--primary); }

/* ============================================================
   SUIVI DES PROJETS (overview dépliable)
   ============================================================ */
.pm-prog { display: inline-block; width: 120px; height: 8px; background: var(--bg-muted); border-radius: 999px; overflow: hidden; vertical-align: middle; }
.pm-prog-fill { display: block; height: 100%; background: #22c55e; border-radius: 999px; }

.pm-ov-fam { margin-bottom: 24px; }
.pm-ov-fam-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 6px 0 10px 12px; border-left: 4px solid var(--g); margin-bottom: 8px; }
.pm-ov-fam-name { font-weight: 800; font-size: 1.1rem; color: var(--g); text-decoration: none; }
.pm-ov-fam-name:hover { text-decoration: underline; }

.pm-ov-item { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.pm-ov-sum { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
.pm-ov-sum::-webkit-details-marker { display: none; }
.pm-ov-caret { width: 0; height: 0; border-left: 6px solid var(--text-muted); border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform .15s ease; flex-shrink: 0; }
.pm-ov-item[open] .pm-ov-caret { transform: rotate(90deg); }
.pm-ov-title { font-weight: 700; min-width: 140px; }
.pm-ov-pct { font-weight: 700; font-size: 0.85rem; color: var(--text-muted); }
.pm-ov-counts { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-left: auto; font-size: 0.82rem; }
.pm-ov-body { padding: 0 16px 16px; border-top: 1px solid var(--border); }
.pm-ov-table { margin-top: 12px; }
.pm-ov-table th { font-size: 0.76rem; }

@media (max-width: 768px) {
    .pm-ov-counts { margin-left: 0; width: 100%; }
    .pm-prog { width: 90px; }
}

/* ============================================================
   CATALOGTECH (composants électroniques)
   ============================================================ */
.cat-families { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cat-fam-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
    font-size: 0.84rem; font-weight: 600; text-decoration: none; color: var(--text);
    background: var(--bg-muted); border: 1px solid var(--border);
}
.cat-fam-chip:hover { border-color: var(--g, var(--primary)); color: var(--g, var(--primary)); }
.cat-fam-chip.is-active { background: var(--g, var(--primary)); color: #fff; border-color: transparent; }
.cat-fam-count { font-size: 0.74rem; opacity: .8; background: rgba(0,0,0,.08); padding: 0 6px; border-radius: 999px; }
.cat-fam-chip.is-active .cat-fam-count { background: rgba(255,255,255,.25); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.cat-card { display: flex; flex-direction: column; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease; }
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.cat-card-img { position: relative; aspect-ratio: 4 / 3; background: var(--bg-muted); display: grid; place-items: center; overflow: hidden; }
.cat-card-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-card-noimg { font-size: 2.4rem; opacity: .5; }
.cat-card-qty { position: absolute; top: 8px; right: 8px; background: rgba(15,23,42,.85); color: #fff; font-size: 0.74rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.cat-card-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.cat-card-name { font-weight: 700; font-size: 0.92rem; }
.cat-card-ref { font-size: 0.78rem; color: var(--text-muted); font-family: ui-monospace, monospace; }

.cat-show-img { aspect-ratio: 4 / 3; background: var(--bg-muted); border-radius: var(--radius-sm); display: grid; place-items: center; overflow: hidden; }
.cat-show-img img { width: 100%; height: 100%; object-fit: contain; }
.cat-ai { border: 1px dashed var(--primary); background: var(--primary-light); }
.cat-mouser { border: 1px dashed var(--success, #059669); }
.cat-imgprev { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.cat-imgprev img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.cat-remove { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-muted); margin-top: 8px; }
.cat-addfam { margin-top: 14px; }
.cat-addfam > summary { list-style: none; cursor: pointer; }
.cat-addfam > summary::-webkit-details-marker { display: none; }

/* Autocomplete Mouser */
.ms-results {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); max-height: 360px; overflow-y: auto; padding: 4px;
}
.ms-item {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    border: none; background: transparent; padding: 8px 10px; border-radius: var(--radius-sm);
    cursor: pointer; font: inherit; color: var(--text);
}
.ms-item:hover { background: var(--primary-light); }
.ms-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); flex-shrink: 0; background: #fff; }
.ms-noimg { width: 40px; height: 40px; display: grid; place-items: center; color: var(--text-light); background: var(--bg-muted); border-radius: 6px; flex-shrink: 0; }
.ms-txt { display: flex; flex-direction: column; min-width: 0; }
.ms-txt strong { font-size: 0.88rem; }
.ms-txt small { color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-empty { padding: 10px 12px; color: var(--text-muted); font-size: 0.85rem; }
.ms-error { color: var(--danger); }
