@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --white: #ffffff;
    --bg: #f8f9fb;
    --bg-hover: #f3f4f7;
    --text: #1a1a2e;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e8eaef;
    --border-light: #f1f2f5;
    --gold: #a58539;
    --gold-light: #c9a84c;
    --gold-soft: rgba(165,133,57,0.08);
    --accent: #6366f1;
    --green: #10b981;
    --green-bg: rgba(16,185,129,0.08);
    --green-border: rgba(16,185,129,0.2);
    --red: #ef4444;
    --red-bg: rgba(239,68,68,0.06);
    --red-border: rgba(239,68,68,0.15);
    --orange: #f59e0b;
    --orange-bg: rgba(245,158,11,0.06);
    --purple: #8b5cf6;
    --sidebar-w: 72px;
    --sidebar-w-expanded: 200px;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.08);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 13px;
}

/* ═══════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════ */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 56px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header h1 {
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
}
.header h1 span { color: var(--gold); }
.header-sub {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}
.header-right { display: flex; align-items: center; gap: 10px; }
.scan-info {
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--bg);
    border-radius: var(--radius-xs);
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.btn-primary {
    background: var(--text);
    color: var(--white);
}
.btn-primary:hover { background: #2d2d44; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-ghost {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--text); background: var(--bg); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-xs { padding: 3px 8px; font-size: 10px; border-radius: 4px; }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.btn-danger:hover { background: var(--red); color: white; }

/* ═══════════════════════════════════════════
   APP LAYOUT: SIDEBAR + CONTENT
   ═══════════════════════════════════════════ */
.app-layout {
    display: flex;
    height: calc(100vh - 56px);
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-w);
    background: var(--text);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 8px;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.25s ease;
    z-index: 40;
}
.sidebar:hover {
    width: var(--sidebar-w-expanded);
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.5);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}
.nav-item svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}
.nav-item span:not(.nav-badge) {
    opacity: 0;
    transition: opacity 0.15s ease;
}
.sidebar:hover .nav-item span:not(.nav-badge) {
    opacity: 1;
}
.nav-item:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.08);
}
.nav-item.active {
    color: white;
    background: rgba(255,255,255,0.12);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--gold);
}
.nav-badge {
    font-size: 10px;
    font-weight: 700;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.sidebar:hover .nav-badge { opacity: 1; }
.nav-item.active .nav-badge { background: var(--gold); color: white; }

/* MAIN CONTENT */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════
   STATS BAR
   ═══════════════════════════════════════════ */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    padding: 16px 24px;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
}
.stat-card:nth-child(1)::after { background: var(--text); }
.stat-card:nth-child(2)::after { background: var(--green); }
.stat-card:nth-child(3)::after { background: var(--text-muted); }
.stat-card:nth-child(4)::after { background: var(--red); }
.stat-card:nth-child(5)::after { background: var(--orange); }
.stat-card:nth-child(6)::after { background: var(--accent); }

.stat-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 6px;
}
.stat-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--text);
    letter-spacing: -1px;
    line-height: 1;
}
.stat-card.alert-card .stat-value { color: var(--red); }
.stat-sub {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════
   PROGRESS
   ═══════════════════════════════════════════ */
.progress-bar {
    margin: 0 24px 12px;
    height: 38px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--text) 0%, var(--gold) 100%);
    transition: width 0.4s ease;
    width: 0%;
    border-radius: var(--radius-sm);
}
.progress-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    z-index: 2;
}

/* ═══════════════════════════════════════════
   TAB CONTENT
   ═══════════════════════════════════════════ */
.tab-content { padding: 16px 24px; }

/* ═══════════════════════════════════════════
   CHECKS - ALERT CARDS
   ═══════════════════════════════════════════ */
.checks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.checks-filters { display: flex; gap: 5px; flex-wrap: wrap; }
.checks-summary {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.chip {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--white);
    font-size: 11px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-family: inherit;
    color: var(--text-secondary);
}
.chip:hover { border-color: var(--text); color: var(--text); }
.chip.active {
    background: var(--text);
    color: var(--white);
    border-color: var(--text);
}

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

.check-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
    position: relative;
}
.check-card:hover {
    border-color: var(--text);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.check-card.zero-card { opacity: 0.5; }
.check-card.zero-card:hover { opacity: 0.8; }

.check-severity-bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    border-radius: var(--radius) 0 0 var(--radius);
}
.check-severity-bar.critical { background: var(--red); }
.check-severity-bar.high { background: var(--orange); }
.check-severity-bar.medium { background: #eab308; }
.check-severity-bar.low { background: var(--text-muted); }

.check-count-wrap {
    min-width: 56px;
    text-align: center;
    padding: 6px 0;
}
.check-count {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1;
}
.check-count.has-issues { color: var(--red); }
.check-count.clean { color: var(--green); }
.check-count-label {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.check-info { flex: 1; padding-left: 4px; }
.check-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 5px;
}
.check-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.check-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.severity-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.check-num {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ═══════════════════════════════════════════
   FILTERS BAR
   ═══════════════════════════════════════════ */
.filters-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    align-items: center;
    background: var(--white);
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}
.filters-bar label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.filters-bar select {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg);
    font-size: 12px;
    font-family: inherit;
    color: var(--text);
    min-width: 160px;
    cursor: pointer;
    transition: var(--transition);
}
.filters-bar select:hover { border-color: var(--text); }
.filters-bar select:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px rgba(26,26,46,0.08); }
.filter-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
}

/* ═══════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════ */
.table-container {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.table-inner { padding: 12px; }

/* Active alert banner */
.active-alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    margin-bottom: 12px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}
.alert-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}
.alert-banner-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}
.alert-banner-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}
.alert-banner-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--red);
    background: var(--red-bg);
    padding: 2px 10px;
    border-radius: 12px;
}
.alert-banner-cat { }
.alert-banner-close {
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--white);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.alert-banner-close:hover { border-color: var(--red); color: var(--red); background: var(--red-bg); }

table.dataTable { font-size: 12px; border-collapse: collapse !important; width: 100% !important; }
table.dataTable thead th {
    background: var(--bg) !important;
    color: var(--text-secondary) !important;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 10px 18px 10px 10px !important;
    border-bottom: 1px solid var(--border) !important;
    white-space: nowrap;
    position: sticky;
    top: 0;
}
table.dataTable thead th.dt-orderable-asc span.dt-column-order,
table.dataTable thead th.dt-orderable-desc span.dt-column-order {
    right: 2px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}
table.dataTable thead th:first-child { border-radius: var(--radius) 0 0 0; }
table.dataTable thead th:last-child { border-radius: 0 var(--radius) 0 0; }

table.dataTable tbody td {
    padding: 8px 12px !important;
    border-bottom: 1px solid var(--border-light) !important;
    vertical-align: middle;
    color: var(--text);
}
table.dataTable tbody tr { cursor: pointer; transition: background 0.1s; }
table.dataTable tbody tr:hover { background: var(--bg-hover) !important; }
table.dataTable tbody tr:last-child td { border-bottom: none !important; }

div.top, div.dt-layout-row:first-child {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
div.top .dt-length, div.dt-layout-row:first-child .dt-length { order: 2; }
div.top .dt-search, div.dt-layout-row:first-child .dt-search { order: 1; }
.dt-search { margin-bottom: 0 !important; }
.dt-search input {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    padding: 7px 12px !important;
    font-family: inherit !important;
    font-size: 13px !important;
    transition: var(--transition);
    background: var(--bg) !important;
    width: 260px !important;
}
.dt-search input:focus {
    outline: none !important;
    border-color: var(--text) !important;
    box-shadow: 0 0 0 3px rgba(26,26,46,0.06) !important;
    background: var(--white) !important;
}
.dt-length select {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-xs) !important;
    padding: 6px 10px !important;
    font-family: inherit !important;
    background: var(--bg) !important;
}
.dt-info { font-size: 12px !important; color: var(--text-muted) !important; }
.dt-paging button {
    border-radius: var(--radius-xs) !important;
    font-family: inherit !important;
}

/* Cell styles */
.cell-id {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    font-size: 11px;
}
.cell-name {
    font-weight: 500;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cell-ref {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
}
.cell-active {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.cell-active.on { background: var(--green-bg); color: var(--green); }
.cell-active.off { background: var(--red-bg); color: var(--red); }
.cell-active .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.cell-active.on .dot { background: var(--green); }
.cell-active.off .dot { background: var(--red); }

.cell-price {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}
.cell-marge {
    font-weight: 800;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}
.cell-marge.negative { color: var(--red); background: var(--red-bg); }
.cell-marge.low { color: var(--orange); background: var(--orange-bg); }
.cell-marge.ok { color: var(--green); background: var(--green-bg); }

.cell-stock {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.cell-stock.zero { color: var(--red); }
.cell-stock.positive { color: var(--green); }

.cell-supplier {
    font-size: 11px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-empty { color: var(--text-muted); font-size: 11px; }

.cell-alerts-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    border-radius: var(--radius-xs);
    font-weight: 800;
    font-size: 12px;
}
.cell-alerts-count.has-alerts {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red-border);
}
.cell-alerts-count.clean {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-border);
}

.cell-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 24px;
    border-radius: var(--radius-xs);
    font-weight: 800;
    font-size: 11px;
    padding: 0 5px;
}
.cell-score.score-good { background: var(--green-bg); color: var(--green); }
.cell-score.score-warn { background: var(--orange-bg); color: var(--orange); }
.cell-score.score-bad { background: var(--red-bg); color: var(--red); }
.cell-score.clickable-score { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.cell-score.clickable-score:hover { transform: scale(1.15); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }

/* Source row (table.column references) */
.source-row th {
    font-family: 'Courier New', monospace;
    font-size: 9px;
    color: var(--text-muted);
    padding: 2px 8px;
    background: var(--surface);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    border-bottom: 1px solid var(--border);
    opacity: 0.85;
}

/* Column filters row */
.column-filters th {
    background: var(--white) !important;
    padding: 5px 6px !important;
    border-bottom: 2px solid var(--border) !important;
}
.col-filter-input {
    width: 100%;
    padding: 4px 7px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    transition: var(--transition);
    box-sizing: border-box;
}
.col-filter-input:focus {
    outline: none;
    border-color: var(--text);
    background: var(--white);
    box-shadow: 0 0 0 2px rgba(26,26,46,0.06);
}
.col-filter-input::placeholder {
    color: var(--text-muted);
    font-size: 10px;
}
.col-filter-select {
    width: 100%;
    padding: 4px 5px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 10px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    box-sizing: border-box;
}
.col-filter-select:focus {
    outline: none;
    border-color: var(--text);
}

.cell-img { display: flex; align-items: center; gap: 4px; }
.cell-img-count {
    font-weight: 700;
    font-size: 12px;
}
.cell-img-count.zero { color: var(--red); }
.cell-img-count.ok { color: var(--text); }

/* ═══════════════════════════════════════════
   DETAIL PANEL
   ═══════════════════════════════════════════ */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(2px);
    z-index: 90;
    transition: opacity 0.2s;
}
.overlay.show { display: block; }

.detail-panel {
    position: fixed;
    top: 0;
    right: -560px;
    width: 540px;
    height: 100vh;
    background: var(--white);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}
.detail-panel.open { right: 0; }

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 5;
}
.detail-header-info { flex: 1; }
.detail-id {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.detail-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-top: 3px;
    line-height: 1.3;
}
.btn-close {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    flex-shrink: 0;
    margin-left: 12px;
}
.btn-close:hover { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }

.detail-body { padding: 20px 24px; }

.detail-section { margin-bottom: 20px; }
.detail-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 6px;
}
.detail-section-title::before {
    content: '';
    width: 3px;
    height: 12px;
    border-radius: 2px;
    background: var(--text);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    font-size: 12px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.1s;
}
.detail-row:hover { background: var(--bg); }
.detail-row .label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11px;
}
.detail-row .value {
    font-weight: 600;
    text-align: right;
    max-width: 60%;
    color: var(--text);
}

.detail-alert {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid;
    transition: var(--transition);
}
.detail-alert:hover { transform: translateX(2px); }
.detail-alert .alert-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.detail-alert .alert-name { flex: 1; }

.detail-actions {
    display: flex;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}
.detail-actions .btn { flex: 1; justify-content: center; }

/* ═══════════════════════════════════════════
   PARAMETRAGE PAGE (ex-Queries)
   ═══════════════════════════════════════════ */
/* Config toolbar */
.config-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}
.config-toolbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 400px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    color: var(--text-muted);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.config-toolbar-search:focus-within {
    border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(26,26,46,0.06);
    color: var(--text);
}
.config-toolbar-search input {
    flex: 1;
    border: none;
    background: none;
    padding: 8px 0;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    outline: none;
}
.config-toolbar-search input::placeholder { color: var(--text-muted); }
.config-toolbar-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    align-items: center;
}
.queries-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 20px;
}

/* Agent group (top level) */
.agent-group {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}
.agent-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
    border-radius: var(--radius) var(--radius) 0 0;
}
.agent-group-header:hover { background: var(--bg-hover); }
.agent-group.collapsed .agent-group-header { border-bottom: none; border-radius: var(--radius); }
.agent-group-dot {
    width: 11px; height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}
.agent-group-title {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    min-width: 100px;
}
.agent-group-desc {
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.agent-group-count {
    font-size: 11.5px;
    color: var(--text-muted);
    white-space: nowrap;
    padding: 0 8px;
}
.agent-group-count strong { font-size: 13px; }
.agent-group-toggle {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-hover);
}
.agent-group.collapsed .agent-group-toggle { transform: rotate(-90deg); }
.agent-group.collapsed .agent-group-body { display: none; }
.agent-group-body { padding: 0; }

/* Subtag group (second level) */
.subtag-group { border-bottom: 1px solid var(--border-light); }
.subtag-group:last-child { border-bottom: none; }
.subtag-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px 8px 32px;
    background: var(--white);
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid var(--border-light);
}
.subtag-group-header:hover { background: var(--bg); }
.subtag-group-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
    white-space: nowrap;
}
.subtag-group-count {
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
}
.subtag-group-toggle {
    font-size: 10px;
    color: var(--text-muted);
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--bg-hover);
    transition: transform 0.15s;
}
.subtag-group-body { padding: 0; border-top: 1px solid var(--border-light); }

/* Parametrage table */
.param-table {
    width: 100%;
    border-collapse: collapse;
}
.param-thead th {
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1.5px solid var(--border);
    background: var(--bg);
    text-align: left;
    white-space: nowrap;
}
.param-th-num { width: 40px; }
.param-th-cat { width: 110px; }
.param-th-name { }
.param-th-scope { width: 170px; }
.param-th-count { width: 80px; text-align: right !important; padding-right: 20px !important; }
.param-th-excl { width: 120px; text-align: left !important; }
.param-th-excl-eff { width: 120px; text-align: left !important; }
.param-th-controls { width: 290px; text-align: right !important; }
.param-row td {
    padding: 9px 10px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}
.param-row:hover td { background: var(--bg); }
.param-col-num {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
    font-weight: 600;
}
.param-col-name {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 0;
}
.param-col-scope {
    white-space: nowrap;
}
.param-col-count {
    font-weight: 800;
    font-size: 14px;
    text-align: right;
    white-space: nowrap;
    padding-right: 16px !important;
}
.param-col-count.has-issues { color: var(--red); }
.param-col-count.clean { color: var(--green); }
.param-col-cat { white-space: nowrap; }
.param-dd-cat {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}
.param-col-excl { text-align: left; }
.param-col-excl-eff { text-align: left; }
.param-excl-eff-ids {
    font-size: 11px;
    font-family: monospace;
    color: var(--red);
    font-weight: 600;
}
.param-excl-ids {
    font-size: 11px;
    font-family: monospace;
    color: var(--orange);
    cursor: pointer;
    font-weight: 600;
}
.param-excl-ids:hover { text-decoration: underline; }
.param-excl-more {
    font-size: 10px;
    color: var(--text-muted);
    font-family: inherit;
    font-weight: 500;
}
.param-excl-none { color: var(--text-muted); font-size: 11px; }
.excl-id-list { max-height: 200px; overflow-y: auto; }
.excl-id-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.excl-id-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    font-weight: 600;
    color: var(--text);
    background: var(--bg);
}
.excl-id-remove {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    padding: 0 0 0 2px;
    line-height: 1;
}
.excl-id-remove:hover { color: var(--red); }
.bulk-excl-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    overflow: hidden;
}
.bulk-toggle-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: var(--white);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}
.bulk-toggle-btn:not(:last-child) { border-right: 1px solid var(--border); }
.bulk-toggle-btn:hover { background: var(--bg-hover); }
.bulk-toggle-btn.active[data-action="add"] { background: var(--green-bg); color: var(--green); }
.bulk-toggle-btn.active[data-action="remove"] { background: var(--red-bg); color: var(--red); }
.bulk-excl-checks {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 4px 0;
}
.bulk-excl-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
}
.bulk-excl-item:hover { background: var(--bg-hover); }
.bulk-excl-item input[type="checkbox"] { flex-shrink: 0; }
.param-col-controls {
    text-align: right;
    white-space: nowrap;
}
.param-col-controls .param-controls-inner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.param-alert-excluded {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 400;
}
.param-row-sql td {
    padding: 0 10px 12px 10px;
    border-bottom: 1px solid var(--border-light);
}

/* Scope badges */
.scope-badges {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 3px;
}
.scope-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    line-height: 16px;
    white-space: nowrap;
}
.scope-ok {
    background: rgba(16,185,129,0.1);
    color: #059669;
}
.scope-no {
    background: rgba(239,68,68,0.08);
    color: #dc2626;
}
.scope-only {
    background: rgba(139,92,246,0.1);
    color: #7c3aed;
}

.param-alert-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
/* Custom param dropdowns */
.param-dropdown { position: relative; display: inline-block; }
.param-dd-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg);
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    color: var(--text);
    white-space: nowrap;
}
.param-dd-btn:hover { border-color: var(--text-muted); }
.param-dd-arrow { font-size: 8px; color: var(--text-muted); margin-left: 2px; }
.param-dd-label { font-weight: 600; font-size: 11px; }
.param-sev-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.param-sev-dot.critical { background: var(--red); }
.param-sev-dot.high { background: var(--orange); }
.param-sev-dot.medium { background: #eab308; }
.param-sev-dot.low { background: var(--text-muted); }
.param-sev-dot.suggestion { background: #10b981; }
.param-dd-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 100%;
    margin-top: 2px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow);
    padding: 4px 0;
    max-height: 220px;
    overflow-y: auto;
}
.param-dropdown.open .param-dd-menu { display: block; }
.param-dd-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 11px;
    white-space: nowrap;
}
.param-dd-item:hover { background: var(--bg-hover); }
.param-dd-item.active { background: var(--bg); font-weight: 600; }
/* Filter category dropdown (toolbar) */
.filter-cat-dropdown { z-index: 50; }
.filter-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--white);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text);
    white-space: nowrap;
    transition: var(--transition);
}
.filter-cat-btn:hover { border-color: var(--text-muted); background: var(--bg); }
.filter-cat-dropdown.open .filter-cat-btn { border-color: var(--text); box-shadow: 0 0 0 2px rgba(0,0,0,0.06); }
.param-btn-excl {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 10px;
    font-weight: 600;
    font-family: inherit;
    background: var(--white);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    white-space: nowrap;
}
.param-btn-excl:hover { border-color: var(--text); color: var(--text); background: var(--bg); }
.param-btn-excl.has-exclusions { background: var(--orange-bg); color: var(--orange); border-color: var(--orange); }

.param-btn-view {
    width: 28px; height: 28px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--white);
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
    padding: 0;
}
.param-btn-view:hover { background: var(--bg); color: var(--text); border-color: var(--text); }
.param-btn-sql {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 10px;
    font-weight: 600;
    font-family: inherit;
    background: var(--white);
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}
.param-btn-sql:hover { border-color: var(--text); color: var(--text); }

.param-sql-block {
    margin: 8px 0 4px;
}
.param-sql-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    line-height: 1.5;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-all;
    resize: vertical;
    box-sizing: border-box;
}
.param-sql-textarea:focus {
    outline: none;
    border-color: var(--text);
}
.param-btn-save-sql {
    margin-top: 6px;
    padding: 5px 14px;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    background: var(--text);
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}
.param-btn-save-sql:hover { opacity: 0.8; }

/* SQL Panel (slide-in right) */
.sql-panel {
    position: fixed;
    top: 0;
    right: -50%;
    width: 50%;
    height: 100vh;
    background: var(--white);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 24px rgba(0,0,0,0.1);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: right 0.25s ease;
}
.sql-panel.show { right: 0; }
.sql-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.sql-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sql-panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 24px;
    overflow: hidden;
}
.sql-panel-textarea {
    flex: 1;
    width: 100%;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg);
    color: var(--text);
    resize: none;
}
.sql-panel-textarea:focus {
    outline: none;
    border-color: var(--text);
}
.sql-panel-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-shrink: 0;
}

/* Condition Python mode */
.sql-panel-condition { margin-bottom: 8px; }
.sql-cond-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 6px;
}
.sql-cond-text {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13.5px;
    color: #1e293b;
    line-height: 1.5;
    font-weight: 500;
}
.sql-fields-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    margin-top: 6px;
}
.sql-fields-table th {
    background: #f1f5f9;
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.sql-fields-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}
.sql-fields-table tr:hover td { background: #f8fafc; }
.sql-fields-table code {
    background: #e2e8f0;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11.5px;
    color: #6366f1;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.param-btn-rescan {
    width: 28px; height: 28px;
    border: 1px solid var(--gold);
    border-radius: 4px;
    background: var(--white);
    cursor: pointer;
    color: var(--gold);
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
    padding: 0;
}
.param-btn-rescan:hover { background: var(--gold); color: #fff; }

.param-btn-del {
    width: 24px; height: 24px;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    font-size: 14px; line-height: 1;
    font-family: inherit;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.param-btn-del:hover { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }

.param-btn-archive {
    width: 26px; height: 26px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--white);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
    padding: 0;
}
.param-btn-archive:hover { background: var(--orange-bg); color: var(--orange); border-color: var(--orange); }

.param-btn-restore {
    width: 26px; height: 26px;
    border: 1px solid var(--green);
    border-radius: 4px;
    background: var(--green-bg);
    color: var(--green);
    cursor: pointer;
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
    padding: 0;
}
.param-btn-restore:hover { background: var(--green); color: #fff; }

.param-archived-date {
    font-size: 9px;
    color: var(--text-muted);
    font-style: italic;
}
.param-single-scan-badge {
    font-size: 9px;
    color: var(--gold);
    font-weight: 600;
    background: var(--gold-soft);
    padding: 1px 6px;
    border-radius: 4px;
    margin-top: 1px;
}

.btn-outline {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    color: var(--text-muted);
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.btn-outline:hover { border-color: var(--text); color: var(--text); }
.btn-outline.active { background: var(--orange-bg); color: var(--orange); border-color: var(--orange); }

/* Add check modal */
.modal-wide { max-width: 640px; }
.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}
.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.form-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}
.form-group input,
.form-group select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
}
.form-group input:focus,
.form-group select:focus,
.sql-textarea:focus {
    outline: none;
    border-color: var(--text);
}
.sql-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--text);
    background: var(--bg);
    resize: vertical;
    line-height: 1.5;
}
.form-error {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    border-radius: var(--radius-xs);
    color: var(--red);
    font-size: 12px;
    font-weight: 500;
}

/* ═══════════════════════════════════════════
   CONFIG PAGE
   ═══════════════════════════════════════════ */
.config-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.config-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.config-item:hover { border-color: var(--text-muted); }
.config-item-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}
.config-item-name {
    font-weight: 600;
    font-size: 13px;
    flex: 1;
}
.config-item-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 10px;
    border-radius: 12px;
}
.config-item-badge {
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
}
.config-color-picker {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border);
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
    background: none;
}
.config-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.config-color-picker::-webkit-color-swatch { border: none; border-radius: 50%; }
.config-color-picker::-moz-color-swatch { border: none; border-radius: 50%; }
.config-color-picker:hover { border-color: var(--text); }
.config-weight-edit {
    display: flex;
    align-items: center;
    gap: 4px;
}
.config-weight-input {
    width: 50px;
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    background: var(--bg);
}
.config-weight-input:focus {
    outline: none;
    border-color: var(--text);
}
.config-add-form {
    background: var(--white);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

/* ═══════════════════════════════════════════
   EXCLUSION MODAL
   ═══════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(3px);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-weight: 700; font-size: 15px; }
.modal-subtitle { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.modal-body { padding: 20px 24px; }
.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
}
.exclusion-textarea {
    width: 100%;
    height: 150px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    resize: vertical;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}
.exclusion-textarea:focus {
    outline: none;
    border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(26,26,46,0.06);
}
.exclusion-info {
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   SNAPSHOTS
   ═══════════════════════════════════════════ */
.snapshots-list { display: flex; flex-direction: column; gap: 10px; }
.snapshot-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
}
.snapshot-card:hover { box-shadow: var(--shadow); border-color: var(--text); }
.snapshot-date { font-weight: 700; font-size: 14px; }
.snapshot-stats {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    gap: 16px;
}
.snapshot-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}
.snapshot-stat .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
}

/* ═══════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════ */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 40px;
    font-size: 14px;
}
.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}
.empty-state-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ═══════════════════════════════════════════
   SCORE BADGE
   ═══════════════════════════════════════════ */
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-weight: 900;
    font-size: 14px;
    border: 2px solid;
}
.score-badge.score-good { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.score-badge.score-warn { color: var(--orange); border-color: var(--orange); background: var(--orange-bg); }
.score-badge.score-bad { color: var(--red); border-color: var(--red); background: var(--red-bg); }

/* ═══════════════════════════════════════════
   SIDEBAR SEPARATOR
   ═══════════════════════════════════════════ */
.nav-separator {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 16px 14px 4px;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar:hover .nav-separator { opacity: 1; }

/* ═══════════════════════════════════════════
   ANALYSIS PAGES
   ═══════════════════════════════════════════ */
.analysis-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.analysis-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.analysis-search {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    width: 260px;
    background: var(--white);
    transition: border-color 0.2s;
}
.analysis-search:focus {
    outline: none;
    border-color: var(--gold);
}
.analysis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.analysis-table thead th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    user-select: none;
}
.analysis-sortable {
    cursor: pointer;
    transition: color 0.15s;
}
.analysis-sortable:hover {
    color: var(--gold) !important;
}
.analysis-table tbody tr {
    border-bottom: 1px solid var(--border-light, #f0f0f0);
    transition: background 0.1s;
}
.analysis-table tbody tr:hover {
    background: rgba(0,0,0,0.02);
}
.analysis-table td {
    padding: 10px 12px;
    vertical-align: middle;
}
.at-center { text-align: center !important; }
.analysis-name {
    font-weight: 600;
    color: var(--text);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.analysis-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: var(--bg);
    color: var(--text-muted);
    margin: 1px 2px;
}
.analysis-tag strong {
    color: var(--text);
    margin-left: 3px;
}
.analysis-footer {
    text-align: right;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   GROUP HEADERS (DataTable)
   ═══════════════════════════════════════════ */
.group-header-row th.group-header {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 4px 6px;
    color: #fff;
    border-right: 2px solid rgba(255,255,255,0.3);
}
.gh-product    { background: #6366f1; }
.gh-dispo      { background: #22c55e; }
.gh-prix       { background: #f97316; }
.gh-stock      { background: #0ea5e9; }
.gh-logistique { background: #8b5cf6; }
.gh-contenu    { background: #a855f7; }
.gh-securite   { background: #ef4444; }
.gh-marketplace{ background: #ec4899; }
.gh-categorie  { background: #14b8a6; }
.gh-stats      { background: #64748b; }
.gh-score      { background: #eab308; color: #1a1a1a; }
.gh-score-fill { background: #eab308; }

/* ═══════════════════════════════════════════
   ADVANCED FILTERS PANEL
   ═══════════════════════════════════════════ */
.adv-filter-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 8px 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.adv-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
    transition: background .15s;
}
.adv-filter-header:hover { background: var(--bg); }
.adv-filter-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.adv-filter-icon { color: var(--text-muted); }
.adv-filter-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}
.adv-filter-count {
    background: var(--primary);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}
.adv-toggle-arrow {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform .2s;
}
/* Logic bar */
.adv-logic-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.adv-logic-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}
.adv-logic-toggle {
    display: flex;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
}
.adv-logic-btn {
    padding: 4px 14px;
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: 600;
    font-family: Inter, sans-serif;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
}
.adv-logic-btn.active {
    background: var(--primary);
    color: var(--white);
}
.adv-logic-btn:hover:not(.active) { background: rgba(0,0,0,0.06); }
.adv-logic-hint {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}
/* Filter body & rows */
.adv-filter-body { }
#advFilterRows { padding: 12px 16px 4px; }
.adv-connector {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 0;
}
.adv-filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color .15s;
}
.adv-filter-row:hover { border-color: var(--primary); }
.adv-row-fields {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    flex-wrap: wrap;
}
.adv-col-select, .adv-op-select, .adv-val-input {
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    font-family: Inter, sans-serif;
    background: var(--white);
    color: var(--text);
    transition: border-color .15s;
}
.adv-col-select { min-width: 155px; flex-shrink: 0; }
.adv-op-select { min-width: 135px; flex-shrink: 0; }
.adv-val-input { min-width: 90px; max-width: 130px; }
.adv-val-half { min-width: 65px; max-width: 90px; }
.adv-val-sep { font-size: 11px; color: var(--text-muted); padding: 0 2px; }
.adv-col-select:focus, .adv-op-select:focus, .adv-val-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(165,133,57,0.12);
}
.adv-op-wrap, .adv-val-wrap {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}
.adv-remove-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: #ccc;
    font-size: 16px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    flex-shrink: 0;
}
.adv-remove-btn:hover { background: var(--red); color: var(--white); }
/* Actions bar */
.adv-filter-actions {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
}
.adv-add-btn {
    border: 1px dashed var(--border);
    background: none;
    color: var(--text-muted);
    font-size: 12px;
    font-family: Inter, sans-serif;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all .15s;
}
.adv-add-btn:hover { border-color: var(--primary); color: var(--primary); }
.adv-action-right { margin-left: auto; display: flex; gap: 6px; }

/* ═══════════════════════════════════════════
   COLUMN INFO ICON & POPOVER
   ═══════════════════════════════════════════ */
/* Info button (i) — visible, solid background */
.col-info-btn {
    pointer-events: auto !important;
    cursor: pointer !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    background: #e8e5e0;
    color: #aaa;
    font-size: 9px;
    font-weight: 600;
    font-style: normal;
    font-family: Inter, sans-serif;
    line-height: 1;
    margin-left: 4px;
    padding: 0;
    cursor: pointer;
    vertical-align: baseline;
    transition: all .15s;
    flex-shrink: 0;
    position: relative;
    top: -1px;
}
.col-info-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.col-info-popover {
    position: fixed;
    z-index: 9999;
    background: #1c1c1e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.3);
    min-width: 260px;
    max-width: 340px;
    font-size: 12px;
    overflow: hidden;
    animation: cipFadeIn .12s ease;
}
@keyframes cipFadeIn { from { opacity:0; transform:translateY(-4px) } to { opacity:1; transform:translateY(0) } }
.cip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(165,133,57,0.15);
}
.cip-title {
    font-size: 12px;
    font-weight: 700;
    color: #c9a84c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cip-close { display: none; }
.cip-body { padding: 10px 14px 12px; }
.cip-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 7px;
}
.cip-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255,255,255,0.35);
    min-width: 52px;
    flex-shrink: 0;
}
.cip-value {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #e2e8f0;
    background: rgba(255,255,255,0.07);
    padding: 1px 6px;
    border-radius: 4px;
    word-break: break-all;
}
.cip-col { color: #7dd3fc; }
.cip-desc {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.6);
    line-height: 1.5;
    font-size: 11px;
}

/* ═══════════════════════════════════════════
   STICKY COLUMNS (DataTable)
   ═══════════════════════════════════════════ */
/* Hide sort arrows on Row 1 (group header) and Row 2 (column names) */
.dt-scroll-head table thead tr:nth-child(1) th,
.dt-scroll-head table thead tr:nth-child(2) th,
.dataTables_scrollHead table thead tr:nth-child(1) th,
.dataTables_scrollHead table thead tr:nth-child(2) th {
    cursor: default !important;
    pointer-events: none !important;
}
.dt-scroll-head table thead tr:nth-child(1) th .dt-column-order,
.dt-scroll-head table thead tr:nth-child(2) th .dt-column-order,
.dataTables_scrollHead table thead tr:nth-child(1) th .dt-column-order,
.dataTables_scrollHead table thead tr:nth-child(2) th .dt-column-order,
table.dataTable thead tr:nth-child(1) th .dt-column-order,
table.dataTable thead tr:nth-child(2) th .dt-column-order { display: none !important; }

/* Sort buttons in filter row — style DataTables-like */
tr.column-filters th {
    white-space: nowrap;
    padding: 2px 4px !important;
    vertical-align: middle;
}
.col-sort-btns {
    display: inline-flex;
    flex-direction: column;
    gap: 0;
    vertical-align: middle;
    margin-left: 4px;
    opacity: 0.45;
    transition: opacity 0.15s;
}
tr.column-filters th:hover .col-sort-btns { opacity: 1; }
.col-sort-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 1;
    font-size: 8px;
    color: var(--text-muted);
    display: block;
    transition: color 0.1s;
}
.col-sort-btn:hover { color: var(--text); }
.col-sort-btn.col-sort-active { color: var(--gold); opacity: 1; }
.col-sort-asc::before { content: '▲'; }
.col-sort-desc::before { content: '▼'; }
.col-sort-btn span { display: none; }

/* Left sticky: ID (sc-0) and Ref (sc-1) */
td.sticky-col, th.sticky-col {
    position: sticky !important;
    z-index: 3;
    background: var(--white) !important;
    white-space: nowrap;
}
td.sticky-col.sc-0, th.sticky-col.sc-0 { left: 0; min-width: 60px !important; width: 60px !important; }
td.sticky-col.sc-1, th.sticky-col.sc-1 { left: 60px; min-width: 100px !important; width: 100px !important; border-right: 2px solid var(--border); }

/* Right sticky: 5 score columns (sr-0..sr-4) */
td.sticky-right, th.sticky-right {
    position: sticky !important;
    z-index: 3;
    background: var(--white) !important;
    white-space: nowrap;
    min-width: 55px !important;
    width: 55px !important;
    text-align: center;
}
td.sticky-right.sr-4, th.sticky-right.sr-4 { right: 0; }
td.sticky-right.sr-3, th.sticky-right.sr-3 { right: 55px; }
td.sticky-right.sr-2, th.sticky-right.sr-2 { right: 110px; }
td.sticky-right.sr-1, th.sticky-right.sr-1 { right: 165px; }
td.sticky-right.sr-0, th.sticky-right.sr-0 { right: 220px; border-left: 2px solid var(--border); }

/* Hover row: keep sticky bg consistent */
#productsTable tbody tr:hover td.sticky-col,
#productsTable tbody tr:hover td.sticky-right {
    background: var(--bg) !important;
}

/* Score detail panel */
.score-detail-panel {
    width: 480px;
    right: -500px;
}
.score-detail-panel.open { right: 0; }

/* ═══════════════════════════════════════════
   CATALOGUE DE DONNÉES
   ═══════════════════════════════════════════ */
#tabDatasource { padding: 0; }

/* Topbar sticky */
.ds-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    background: var(--white);
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
}
.ds-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.ds-topbar-icon {
    width: 34px;
    height: 34px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-secondary);
}
.ds-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.2;
}
.ds-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}
.ds-topbar-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ds-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.ds-chip-value { font-weight: 700; color: var(--text); }
.ds-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.ds-search {
    padding: 6px 12px 6px 30px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    width: 220px;
    transition: border-color .15s, width .2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 9px center;
}
.ds-search:focus { outline: none; border-color: var(--primary); width: 280px; }
.ds-search::placeholder { color: var(--text-muted); }
.ds-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg);
    padding: 3px;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.ds-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all .15s;
}
.ds-tab:hover { color: var(--text); background: var(--surface); }
.ds-tab.active {
    color: var(--primary);
    background: var(--white);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* Content area */
.ds-content { min-height: 200px; }
.ds-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Table cards */
.ds-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow .15s;
}
.ds-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.ds-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.ds-card-name {
    font-family: monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
}
.ds-card-badge {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--white);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 10px;
}
.ds-field-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}
.ds-field-table th:nth-child(1), .ds-field-table td:nth-child(1) { width: 12%; }
.ds-field-table th:nth-child(2), .ds-field-table td:nth-child(2) { width: 10%; }
.ds-field-table th:nth-child(3), .ds-field-table td:nth-child(3) { width: 14%; }
.ds-field-table th:nth-child(4), .ds-field-table td:nth-child(4) { width: 24%; }
.ds-field-table th:nth-child(5), .ds-field-table td:nth-child(5) { width: 40%; overflow-wrap: break-word; word-break: break-word; }
.ds-field-table thead tr { border-bottom: 1px solid var(--border); }
.ds-field-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    background: var(--bg);
    border-right: 1px solid var(--border);
    white-space: nowrap;
}
.ds-field-table th:last-child { border-right: none; }
.ds-field-table td {
    padding: 8px 16px;
    border-bottom: 1px solid rgba(0,0,0,.04);
    border-right: 1px solid rgba(0,0,0,.04);
    vertical-align: top;
}
.ds-field-table td:last-child { border-right: none; }
.ds-field-table tr:last-child td { border-bottom: none; }
.ds-field-table tr:hover td { background: var(--surface); }
.ds-col-table { font-family: monospace; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.ds-col-label { font-weight: 700; color: var(--text); white-space: nowrap; }
.ds-col-field { font-family: monospace; font-weight: 600; color: var(--text); white-space: nowrap; }
.ds-col-column { font-family: monospace; color: var(--text-muted); white-space: nowrap; }
.ds-col-desc { color: var(--text-secondary); line-height: 1.4; word-break: break-word; }

/* SQL block */
.ds-sql-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.ds-sql-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}
.ds-sql-pre {
    background: #1a1a2e;
    padding: 20px;
    font-size: 11px;
    line-height: 1.7;
    overflow-x: auto;
    max-height: 380px;
    overflow-y: auto;
    color: #a9b1d6;
    margin: 0;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
}

/* Write placeholder */
.ds-write-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: var(--text-muted);
}
.ds-write-placeholder .ds-write-icon { margin-bottom: 20px; opacity: .4; }
.ds-write-placeholder h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin: 0 0 8px; }
.ds-write-placeholder p { font-size: 13px; line-height: 1.6; max-width: 400px; margin: 0; }

.ds-table-group.ds-hidden { display: none; }

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 900px) {
    .sidebar {
        width: 52px;
        padding: 8px 4px;
    }
    .sidebar:hover { width: 52px; }
    .sidebar .nav-item span:not(.nav-badge) { display: none; }
    .sidebar .nav-badge { display: none; }
    .nav-item { padding: 10px; justify-content: center; }
}
@media (max-width: 768px) {
    .stats-bar { grid-template-columns: repeat(2, 1fr); padding: 10px 12px; gap: 8px; }
    .stat-card { padding: 12px 14px; }
    .stat-value { font-size: 22px; }
    .checks-grid { grid-template-columns: 1fr; }
    .header { padding: 0 12px; flex-wrap: wrap; height: auto; padding: 10px 12px; gap: 6px; }
    .tab-content { padding: 12px; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .filters-bar select { min-width: 100%; }
    .detail-panel { width: 100%; right: -100%; }
    .param-table { font-size: 11px; }
    .param-col-name { max-width: 140px; }
    .param-col-controls .param-controls-inner { flex-wrap: wrap; }
}

/* ── Agent tags bar (Paramétrage) ─────────────────────── */
.agent-tags-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    align-items: center;
}
.agent-tags-bar-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}
.agent-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 8px;
    border: 1.5px solid;
    border-radius: 20px;
    background: var(--white);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.1s, transform 0.1s, box-shadow 0.1s;
}
.agent-tag-chip:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.agent-tag-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.agent-tag-count {
    background: rgba(0,0,0,0.08);
    border-radius: 8px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 700;
}

/* ── Modal add check styles ───────────────────────────── */
.label-required { color: var(--red); font-weight: 700; margin-left: 2px; }
.label-hint { color: var(--text-muted); font-weight: 400; font-size: 12px; }
.modal-agent-badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1.5px solid;
}

/* ── Bouton Ajouter dans l'agent group ────────────────── */
.btn-add-check-agent {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
    margin-right: 4px;
}
.btn-add-check-agent:hover { background: var(--bg-hover); border-color: var(--gold); color: var(--gold); }

/* ── Agents IA tab ────────────────────────────────────── */
.agents-ia-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0;
    border-bottom: 1px solid var(--border);
    min-height: 48px;
}
.agents-ia-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    height: 48px;
}
.agent-subtab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}
.agent-subtab-btn:hover { color: var(--text); }
.agent-subtab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.agent-subtab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #dc2626;
    color: #fff;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
}
.agents-ia-title { font-size: 16px; font-weight: 700; }
/* Validations requises */
.validations-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}
.validations-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}
.validations-agent-block {
    margin: 16px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.validations-agent-header {
    padding: 10px 14px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    font-size: 13px;
}
.agents-ia-cards {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.agents-ia-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px 4px 10px;
    margin-top: 8px;
    border-bottom: 1.5px solid var(--group-color, var(--border));
    margin-bottom: 14px;
}
.agents-ia-group-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.agents-ia-group-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--group-color, var(--text));
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.agents-ia-group-count {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 4px;
}
.agents-ia-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}
.agent-ia-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    height: 430px;
}
.agent-ia-card:hover { border-color: var(--gold); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.agent-ia-card.selected { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(165,133,57,0.15); }

/* Header */
.agent-ia-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border-light);
}
.agent-ia-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.agent-ia-name { font-weight: 700; font-size: 14px; flex: 1; }
.agent-ia-active-badge { font-size: 9px; background: #22c55e20; color: #16a34a; border: 1px solid #22c55e50; border-radius: 8px; padding: 2px 7px; font-weight: 700; }
.agent-ia-mode-badge { font-size: 9px; border-radius: 8px; padding: 2px 7px; font-weight: 700; letter-spacing: 0.2px; }
.agent-ia-mode-badge.generation { background: rgba(139,92,246,0.12); color: #7c3aed; }
.agent-ia-mode-badge.analysis   { background: rgba(14,165,233,0.12); color: #0284c7; }
.agent-ia-mode-badge.auto       { background: rgba(34,197,94,0.14); color: #15803d; }

/* Body */
.agent-ia-card-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}
.agent-ia-description { font-size: 12px; color: var(--text-muted); line-height: 1.5; flex-shrink: 0; }
.agent-ia-details { margin: 0; padding-left: 15px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; flex: 1; }
.agent-ia-details li { font-size: 11.5px; color: var(--text); line-height: 1.45; }
.agent-ia-subtags { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 2px; flex-shrink: 0; }
.agent-ia-subtag { font-size: 10px; border-radius: 6px; padding: 2px 8px; font-weight: 600; border: 1px solid; }

/* Footer */
.agent-ia-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--bg);
    border-top: 1px solid var(--border-light);
    border-radius: 0 0 var(--radius) var(--radius);
}
.agent-ia-stats { display: flex; flex-wrap: wrap; gap: 4px; min-height: 18px; align-items: center; }
.agent-ia-stat { font-size: 10px; border-radius: 8px; padding: 2px 8px; font-weight: 600; }
.agent-ia-stat.running { background: rgba(234,179,8,0.15); color: #b45309; }
.agent-ia-stat.done { background: rgba(34,197,94,0.12); color: #15803d; }
.agent-ia-stat.applied { background: rgba(99,102,241,0.12); color: #4f46e5; }
.agent-ia-stat.empty { color: var(--text-muted); background: none; font-size: 10px; }
.agent-ia-model { font-size: 10px; color: var(--text-muted); }
.agent-ia-card-actions { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); }
.agent-ia-card-actions .btn { flex: 1; justify-content: center; }
.btn-xs { padding: 4px 10px !important; font-size: 11px !important; }

/* Mode selector (config panel) */
.agent-mode-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}
.agent-mode-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    font-family: inherit;
    text-align: left;
    transition: border-color 0.12s, background 0.12s;
    position: relative;
}
.agent-mode-btn:hover { border-color: var(--text-muted); background: var(--bg); }
.agent-mode-btn.active[data-mode="analysis"] { border-color: #0284c7; background: rgba(14,165,233,0.06); color: #0284c7; }
.agent-mode-btn.active[data-mode="generation"] { border-color: #7c3aed; background: rgba(139,92,246,0.06); color: #7c3aed; }
.agent-mode-btn.active[data-mode="auto"] { border-color: #15803d; background: rgba(34,197,94,0.06); color: #15803d; }
.agent-mode-hint {
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: auto;
}

/* ── Agent config panel (slide-in) ───────────────────── */
.agent-config-panel {
    position: fixed;
    top: 0; right: -420px;
    width: 420px;
    height: 100vh;
    background: var(--white);
    border-left: 1.5px solid var(--border);
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    z-index: 900;
    transition: right 0.25s ease;
    display: flex;
    flex-direction: column;
}
.agent-config-panel.open { right: 0; }
.agent-config-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.agent-config-panel-title { font-weight: 700; font-size: 14px; }
.agent-config-panel-body { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.agent-config-row { display: flex; flex-direction: column; gap: 5px; }
.agent-config-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.agent-config-select, .agent-config-input { padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--bg); font-family: inherit; }
.agent-config-textarea { padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 12px; background: var(--bg); font-family: inherit; resize: vertical; }
.agent-config-select:focus, .agent-config-input:focus, .agent-config-textarea:focus { border-color: var(--gold); outline: none; }
.agent-config-panel-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg); }

/* ── Jobs table ───────────────────────────────────────── */
.agents-ia-jobs { padding: 0 20px 20px; }
.agent-jobs-title { font-size: 13px; font-weight: 700; color: var(--text-secondary); padding: 12px 0 8px; }
.agent-jobs-table-wrap { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.agent-jobs-table { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--white); }
.agent-jobs-table th { padding: 8px 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); border-bottom: 2px solid var(--border); background: var(--bg); text-align: left; }
.agent-jobs-table td { padding: 8px 12px; font-size: 12px; vertical-align: top; border: none; }
.job-row { box-shadow: 0 1px 0 var(--border); }
.job-row:last-child { box-shadow: none; }
.job-row.job-running { background: rgba(234,179,8,0.04); }
.job-row.job-error { background: rgba(239,68,68,0.04); }
.job-row.job-applied { opacity: 0.6; }
.job-product { font-weight: 600; word-break: break-word; }
.job-ref { color: var(--text-muted); font-size: 11px; word-break: break-all; }
.job-issues { display: flex; flex-wrap: wrap; gap: 3px; }
.job-issue-tag { font-size: 10px; background: var(--bg-hover); border-radius: 4px; padding: 1px 5px; word-break: break-word; }
.job-suggestion { word-break: break-word; }
.job-sug-list { display: flex; flex-direction: column; gap: 6px; }
.job-sug-item { font-size: 11px; line-height: 1.5; }
.job-sug-code { display: inline-block; font-size: 10px; font-weight: 700; color: var(--text-muted); background: var(--bg); border-radius: 4px; padding: 1px 5px; margin-right: 5px; white-space: nowrap; border: 1px solid var(--border-light); }
.job-sug-resume { font-size: 11px; color: var(--text-muted); margin-top: 8px; font-style: italic; }
.job-sug-action { display: block; font-weight: 600; font-size: 12px; }
.job-sug-details { display: block; font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.job-sug-field { display: block; font-size: 11px; margin-bottom: 4px; word-break: break-word; }
.job-no-sug { color: var(--text-muted); }
.job-error { display: block; color: var(--red); font-size: 11px; margin-top: 4px; }
.job-status-badge { font-size: 10px; font-weight: 700; border-radius: 8px; padding: 2px 7px; }
.job-status-badge.pending { background: var(--bg-hover); color: var(--text-muted); }
.job-status-badge.running { background: rgba(234,179,8,0.15); color: #b45309; }
.job-status-badge.done { background: rgba(34,197,94,0.12); color: #15803d; }
.job-status-badge.error { background: rgba(239,68,68,0.1); color: var(--red); }
.job-status-badge.rejected { background: var(--bg-hover); color: var(--text-muted); }
.job-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.agent-jobs-table td.job-actions { vertical-align: middle; }

/* ═══════════════════════════════════════════
   ACCÈS — Gestion IP allowlist
   ═══════════════════════════════════════════ */
.access-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
}
.access-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.access-subtitle { font-size: 12px; color: var(--text-muted); }
.access-body { padding: 24px; max-width: 680px; display: flex; flex-direction: column; gap: 24px; }
.access-status-banner { }
.access-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
}
.access-banner.open { background: rgba(245,158,11,0.1); color: #92400e; border: 1px solid rgba(245,158,11,0.3); }
.access-banner.locked { background: rgba(34,197,94,0.1); color: #14532d; border: 1px solid rgba(34,197,94,0.3); }
.access-section { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 20px; }
.access-section-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.access-section-hint { font-size: 11.5px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.access-ip-list { display: flex; flex-direction: column; gap: 8px; }
.access-ip-empty { font-size: 13px; color: var(--text-muted); padding: 12px 0; }
.access-ip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    gap: 12px;
}
.access-ip-row.current { border-color: var(--gold); background: rgba(165,133,57,0.05); }
.access-ip-info { display: flex; align-items: center; gap: 10px; flex: 1; }
.access-ip-addr { font-family: monospace; font-size: 13px; font-weight: 700; color: var(--text); }
.access-ip-label { font-size: 11px; color: var(--text-muted); background: var(--bg-hover); padding: 2px 8px; border-radius: 10px; }
.access-ip-you { font-size: 10px; font-weight: 700; color: var(--gold); background: rgba(165,133,57,0.1); padding: 1px 7px; border-radius: 10px; }
.access-ip-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.access-ip-delete {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); padding: 4px; border-radius: 4px;
    transition: color 0.1s, background 0.1s;
}
.access-ip-delete:hover { color: var(--red); background: var(--red-bg); }
.access-add-form { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 20px; }
.access-add-title { font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.access-add-row { display: flex; gap: 10px; align-items: center; }
.access-input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.15s;
}
.access-input:focus { outline: none; border-color: var(--text); }

/* ═══════════════════════════════════════════════════════
   WORKFLOWS
   ═══════════════════════════════════════════════════════ */

.wf-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px 12px;
    flex-wrap: wrap;
}
.wf-title { font-size: 18px; font-weight: 700; margin: 0; }
.wf-subtitle { font-size: 13px; color: var(--text-muted); flex: 1; margin: 0; }
/* Workflow filters */
.wf-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 24px 14px;
    flex-wrap: wrap;
}
.wf-filter-search {
    flex: 0 0 220px;
    padding: 7px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    transition: var(--transition);
}
.wf-filter-search:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 2px rgba(165,133,57,0.12); }
.wf-filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}
.wf-filter-pill {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: var(--transition);
}
.wf-filter-pill:hover { border-color: var(--gold); color: var(--gold); }
.wf-filter-pill.active { background: var(--gold); color: #fff; border-color: var(--gold); }
.wf-filter-select {
    padding: 7px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12.5px;
    background: #fff;
    cursor: pointer;
}
.wf-list { padding: 0 24px 24px; display: flex; flex-direction: column; gap: 14px; }

/* Card */
.wf-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.wf-card:hover { border-color: var(--gold); box-shadow: 0 2px 8px rgba(165,133,57,0.10); }
.wf-card.wf-disabled { opacity: 0.55; }
.wf-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.wf-card-top:hover { background: #f8fafc; }
.wf-card-info { flex: 1; min-width: 0; }
.wf-card-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.wf-card-toggle { color: #94a3b8; font-size: 13px; flex-shrink: 0; }
.wf-card-summary { font-size: 11.5px; color: #94a3b8; margin-top: 2px; margin-left: 19px; display: flex; align-items: center; gap: 6px; }
.wf-card-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.wf-card-desc-full { font-size: 12.5px; color: var(--text-muted); padding: 0 18px 8px; line-height: 1.5; }
.wf-card-details { border-top: 1px solid #f1f5f9; }
.wf-status-dot {
    font-size: 10px;
    margin-right: 4px;
    vertical-align: middle;
}
.wf-status-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.2px;
}
.wf-badge-off {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 8px;
    background: var(--bg-hover);
    color: var(--text-muted);
    margin-left: 6px;
    vertical-align: middle;
}
.wf-script-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Fira Code', monospace;
}
.wf-card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.wf-btn {
    width: 30px; height: 30px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.12s;
    color: var(--text-muted);
}
.wf-btn:hover { background: var(--bg); color: var(--text); border-color: var(--text-muted); }
.wf-btn-del:hover { color: var(--red); border-color: var(--red); }

/* Triggers row */
.wf-card-middle { padding: 0 18px 8px; }
.wf-card-triggers { display: flex; flex-wrap: wrap; gap: 5px; }
.wf-trigger-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(165,133,57,0.10);
    color: var(--gold-dark, #8a6d2b);
    font-weight: 500;
    white-space: nowrap;
}
.wf-trigger-unknown { background: rgba(220,38,38,0.08); color: var(--red); }

/* Pipeline row */
.wf-card-pipeline {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--bg);
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}
.wf-step-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border: 1.5px solid;
    border-radius: 14px;
    white-space: nowrap;
}
.wf-step-arrow { color: var(--text-muted); font-size: 14px; }

/* ── Slide-in panel ── */
/* Overlay backdrop */
.wf-panel-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35);
    z-index: 999;
    transition: opacity 0.25s ease;
}
.wf-panel-overlay.open { display: block; }
.wf-panel {
    position: fixed;
    top: 0; right: -780px;
    width: 750px;
    max-width: 90vw;
    height: 100vh;
    background: var(--white);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 30px rgba(0,0,0,0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.wf-panel.open { right: 0; }
.wf-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
.wf-panel-header h3 { margin: 0; font-size: 17px; font-weight: 700; }
.wf-panel-close {
    width: 34px; height: 34px;
    border: 1px solid var(--border);
    background: var(--white);
    font-size: 20px; cursor: pointer;
    color: var(--text-muted);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.wf-panel-close:hover { background: #fee2e2; color: #ef4444; border-color: #fca5a5; }
.wf-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}
.wf-panel-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 28px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}
.wf-field { margin-bottom: 18px; }
.wf-field > label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; color: var(--text); text-transform: uppercase; letter-spacing: 0.3px; }
.wf-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13.5px;
    font-family: inherit;
    background: var(--white);
    color: var(--text);
    box-sizing: border-box;
    transition: var(--transition);
}
.wf-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(165,133,57,0.1); }
.wf-textarea { resize: vertical; min-height: 50px; }
.wf-textarea.wf-collapsed { max-height: 80px; overflow: hidden; resize: none; }
.wf-code { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12.5px; background: #f8fafc; }
.wf-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}
.wf-field-header label { margin-bottom: 0; }
.wf-expand-btn {
    padding: 2px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: var(--transition);
}
.wf-expand-btn:hover { border-color: var(--gold); color: var(--gold); }
.wf-hint { font-size: 11px; color: var(--text-muted); display: block; margin-top: 3px; }

/* Switch toggle */
.wf-switch { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; }
.wf-switch input { opacity: 0; width: 0; height: 0; }
.wf-switch-slider {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 12px;
    transition: 0.2s;
}
.wf-switch-slider::before {
    content: '';
    position: absolute;
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: 0.2s;
}
.wf-switch input:checked + .wf-switch-slider { background: var(--green, #22c55e); }
.wf-switch input:checked + .wf-switch-slider::before { transform: translateX(18px); }

/* Trigger multi-select */
.wf-trigger-select {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    padding: 6px;
}
.wf-trig-group { margin-bottom: 6px; }
.wf-trig-group-label { font-size: 11px; font-weight: 700; color: var(--text-muted); padding: 4px 6px 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.wf-trig-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
}
.wf-trig-item:hover { background: var(--bg-hover); }
.wf-trig-item input { margin: 0; accent-color: var(--gold); }

/* Steps editor */
.wf-steps-section { margin-top: 16px; border-top: 1px solid var(--border-light); padding-top: 12px; }
.wf-steps-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.wf-steps-header h4 { margin: 0; font-size: 13px; font-weight: 700; }
.wf-steps-list { display: flex; flex-direction: column; gap: 0; }
.wf-steps-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 16px; }
.wf-step-card {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
}
.wf-step-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
}
.wf-step-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.wf-step-type-sel {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 12px;
    font-family: inherit;
    background: var(--white);
    color: var(--text);
}
.wf-step-head-actions { display: flex; gap: 3px; }
.wf-btn-xs {
    width: 22px; height: 22px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--white);
    cursor: pointer;
    font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
}
.wf-btn-xs:hover { background: var(--bg); color: var(--text); }
.wf-btn-del-step:hover { color: var(--red); border-color: var(--red); }
.wf-step-body { padding: 10px; }
.wf-step-body .wf-field { margin-bottom: 8px; }
.wf-step-body .wf-field:last-child { margin-bottom: 0; }
.wf-step-connector { display: flex; justify-content: center; padding: 4px 0; }

/* ── Workflow Test (dry-run) ── */
.wf-card-test {
    border-top: 1px solid var(--border-light);
    padding: 10px 18px 14px;
}
.wf-test-bar {
    display: flex;
    gap: 8px;
    align-items: center;
}
.wf-test-ids {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: var(--bg);
    color: var(--text);
}
.wf-test-ids:focus { outline: none; border-color: var(--gold); }
.wf-test-ids::placeholder { color: var(--text-muted); font-family: inherit; }
.wf-test-btn { white-space: nowrap; gap: 4px; display: inline-flex; align-items: center; }
.wf-spinner {
    display: inline-block;
    width: 12px; height: 12px;
    border: 2px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: wfSpin 0.6s linear infinite;
}
@keyframes wfSpin { to { transform: rotate(360deg); } }

/* Results */
.wf-test-results { margin-top: 10px; }
.wf-test-loading {
    font-size: 12px;
    color: var(--text-muted);
    padding: 12px;
    text-align: center;
    background: var(--bg);
    border-radius: 6px;
}
.wf-test-error {
    font-size: 12px;
    color: var(--red);
    padding: 10px 12px;
    background: rgba(220,38,38,0.06);
    border: 1px solid rgba(220,38,38,0.15);
    border-radius: 6px;
}
.wf-test-empty {
    font-size: 12px;
    color: var(--text-muted);
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 6px;
    text-align: center;
}
.wf-test-summary {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding: 6px 10px;
    background: var(--bg);
    border-radius: 6px;
}
.wf-test-product {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    background: var(--white);
}
.wf-test-product-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    font-weight: 600;
}
.wf-test-product-id {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    color: var(--gold);
    background: rgba(165,133,57,0.10);
    padding: 1px 6px;
    border-radius: 4px;
}
.wf-test-section { padding: 8px 12px; border-bottom: 1px solid var(--border-light); }
.wf-test-section:last-child { border-bottom: none; }
.wf-test-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.wf-test-data {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 12px;
    font-size: 11px;
}
.wf-test-field { display: flex; gap: 6px; }
.wf-test-key {
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 100px;
}
.wf-test-val {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wf-test-generated {
    font-size: 13px;
    padding: 10px 12px;
    background: rgba(124,58,237,0.04);
    border: 1px solid rgba(124,58,237,0.12);
    border-radius: 6px;
    line-height: 1.5;
}
.wf-test-chars {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
}
.wf-test-sql {
    font-size: 11px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: var(--bg);
    padding: 8px 10px;
    border-radius: 6px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    color: var(--text);
    border: 1px solid var(--border-light);
}

/* Avant / Après compare */
.wf-test-compare {
    display: flex;
    gap: 12px;
    align-items: stretch;
}
.wf-test-compare-col {
    flex: 1;
    min-width: 0;
    border-radius: 8px;
    padding: 10px;
    overflow: hidden;
}
.wf-test-before {
    background: rgba(220, 38, 38, 0.04);
    border: 1px solid rgba(220, 38, 38, 0.12);
}
.wf-test-after {
    background: rgba(5, 150, 105, 0.04);
    border: 1px solid rgba(5, 150, 105, 0.12);
}
.wf-test-before .wf-test-section-label { color: var(--red, #dc2626); }
.wf-test-after .wf-test-section-label { color: var(--green, #059669); }
.wf-test-compare-arrow {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.wf-test-compare-render {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 6px;
    min-height: 30px;
}
.wf-test-compare-code {
    font-size: 10px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: rgba(0,0,0,0.03);
    padding: 6px 8px;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    color: var(--text-muted);
    max-height: 100px;
    overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════
   WORKFLOW OPTIMISATIONS PAGE — v2
   ═══════════════════════════════════════════════════════ */
.wfo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px 10px;
    flex-wrap: wrap;
    gap: 10px;
}
.wfo-header-left { display: flex; align-items: center; gap: 12px; }
.wfo-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.wfo-select {
    padding: 7px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12.5px;
    background: #fff;
    cursor: pointer;
    color: #334155;
}
.wfo-analyze-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: none;
    border-radius: 8px;
    background: var(--gold);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.wfo-analyze-btn:hover { background: #8b6d2a; }
.wfo-analyze-btn:disabled { opacity: 0.6; cursor: wait; }
/* Filter pills */
.wfo-filter-bar {
    display: flex;
    gap: 6px;
    padding: 0 24px 12px;
}
.wfo-filter-pill {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: var(--transition);
}
.wfo-filter-pill:hover { border-color: var(--gold); color: var(--gold); }
.wfo-filter-pill.active { background: var(--gold); color: #fff; border-color: var(--gold); }
/* Results */
.wfo-results { padding: 0 24px 24px; display: flex; flex-direction: column; gap: 10px; }
.wfo-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 50px;
    color: var(--text-muted);
    font-size: 14px;
}
/* Summary */
.wfo-summary {
    background: linear-gradient(135deg, rgba(165,133,57,0.06) 0%, rgba(165,133,57,0.02) 100%);
    border: 1px solid rgba(165,133,57,0.2);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
    font-weight: 500;
}
/* Stats inline */
.wfo-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.wfo-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    flex: 1;
    min-width: 100px;
}
.wfo-stat-num { font-size: 20px; font-weight: 700; }
.wfo-stat-label { font-size: 11px; color: #64748b; font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px; }
.wfo-stat-ok .wfo-stat-num { color: #15803d; }
.wfo-stat-ok { border-left: 3px solid #22c55e; }
.wfo-stat-warn .wfo-stat-num { color: #b45309; }
.wfo-stat-warn { border-left: 3px solid #f59e0b; }
.wfo-stat-imp .wfo-stat-num { color: #6d28d9; }
.wfo-stat-imp { border-left: 3px solid #8b5cf6; }
.wfo-stat-sug .wfo-stat-num { color: var(--gold); }
.wfo-stat-sug { border-left: 3px solid var(--gold); }
/* Cards — compact, collapsed by default */
.wfo-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: var(--transition);
}
.wfo-card:hover { border-color: #cbd5e1; }
.wfo-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.wfo-card-header:hover { background: #f8fafc; }
.wfo-card-header-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.wfo-card-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.wfo-btn-rescan {
    width: 26px; height: 26px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.wfo-btn-rescan:hover { border-color: var(--gold); color: var(--gold); }
.wfo-btn-rescan:disabled { opacity: 0.5; cursor: wait; }
.wfo-toggle { font-size: 12px; color: #94a3b8; transition: transform 0.2s; }
.wfo-action-count {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--gold);
    color: #fff;
    white-space: nowrap;
}
.wfo-wf-name {
    font-weight: 600;
    font-size: 13.5px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wfo-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.wfo-status-ok { background: #dcfce7; color: #15803d; }
.wfo-status-warn { background: #fef3c7; color: #b45309; }
.wfo-status-improve { background: #ede9fe; color: #6d28d9; }
/* Card body */
.wfo-card-body {
    padding: 10px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid #f1f5f9;
}
.wfo-applied-banner {
    padding: 7px 12px;
    border-radius: 6px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: wfo-flash 0.5s ease;
}
@keyframes wfo-flash {
    0% { background: #bbf7d0; }
    100% { background: #f0fdf4; }
}
/* Suggestions — compact */
.wfo-suggestion {
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 3px solid;
    transition: var(--transition);
}
.wfo-sug-positive { background: #f0fdf4; border-color: #22c55e; }
.wfo-sug-improve { background: #faf5ff; border-color: #8b5cf6; }
.wfo-sug-critical { background: #fef2f2; border-color: #ef4444; }
.wfo-sug-applied { opacity: 0.45; }
.wfo-sug-header { display: flex; align-items: flex-start; gap: 8px; }
.wfo-sug-icon { font-size: 13px; margin-top: 1px; flex-shrink: 0; }
.wfo-sug-text { flex: 1; min-width: 0; }
.wfo-sug-title { font-weight: 600; font-size: 12.5px; color: #1e293b; margin-bottom: 1px; }
.wfo-sug-detail { font-size: 12px; color: #64748b; line-height: 1.45; }
.wfo-sug-actions { display: flex; gap: 5px; flex-shrink: 0; margin-top: 1px; }
.wfo-btn-preview {
    padding: 3px 9px;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: var(--transition);
}
.wfo-btn-preview:hover { border-color: #8b5cf6; color: #8b5cf6; }
.wfo-btn-apply {
    padding: 3px 10px;
    border-radius: 5px;
    border: none;
    background: var(--gold);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
}
.wfo-btn-apply:hover { background: #8b6d2a; }
.wfo-btn-apply:disabled { opacity: 0.6; cursor: wait; }
.wfo-applied-badge {
    font-size: 11px;
    font-weight: 600;
    color: #15803d;
    padding: 3px 9px;
    background: #dcfce7;
    border-radius: 5px;
}
.wfo-applied-warn { color: #b45309; background: #fef3c7; }
/* Preview / diff */
.wfo-preview-zone {
    margin-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 8px;
}
.wfo-preview-header {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #8b5cf6;
    margin-bottom: 6px;
}
.wfo-diff { display: flex; gap: 10px; align-items: stretch; }
.wfo-diff-col { flex: 1; min-width: 0; }
.wfo-diff-arrow {
    display: flex;
    align-items: center;
    font-size: 18px;
    color: #cbd5e1;
    flex-shrink: 0;
}
.wfo-diff-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    display: inline-block;
}
.wfo-diff-before .wfo-diff-label { color: #dc2626; background: #fef2f2; }
.wfo-diff-after .wfo-diff-label { color: #15803d; background: #f0fdf4; }
.wfo-diff-before .wfo-preview-code { border-left: 3px solid #fca5a5; }
.wfo-diff-after .wfo-preview-code { border-left: 3px solid #86efac; }
@media (max-width: 900px) {
    .wfo-diff { flex-direction: column; }
    .wfo-diff-arrow { transform: rotate(90deg); justify-content: center; padding: 4px 0; }
}
.wfo-preview-code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
}


/* ═══════════════════════════════════════════════════════
   WORKFLOW LOGS
   ═══════════════════════════════════════════════════════ */
.wfl-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}
.wfl-title { font-size: 20px; font-weight: 700; color: var(--text); margin: 0; }
.wfl-subtitle { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; }
.wfl-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.wfl-stat {
    text-align: center;
    padding: 8px 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 60px;
}
.wfl-stat-num { display: block; font-size: 18px; font-weight: 700; color: var(--text); }
.wfl-stat-label { display: block; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.wfl-stat-ok .wfl-stat-num { color: #16a34a; }
.wfl-stat-err .wfl-stat-num { color: #dc2626; }
.wfl-stat-blocked .wfl-stat-num { color: #ea580c; }
.wfl-stat-date { min-width: 120px; }
.wfl-stat-date .wfl-stat-num { font-size: 13px; font-weight: 600; }

.wfl-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.wfl-search {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--white);
}
.wfl-search:focus { border-color: var(--gold); outline: none; }
.wfl-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    background: var(--white);
    cursor: pointer;
}

.wfl-table-wrap { overflow-x: auto; }
.wfl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.wfl-table th {
    background: #f8fafc;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid var(--border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.wfl-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}
.wfl-table tr:hover td { background: #fafbfc; }
.wfl-col-date { white-space: nowrap; color: var(--text-muted); font-size: 11.5px; }
.wfl-col-wf { font-weight: 500; max-width: 200px; }
.wfl-col-action { white-space: nowrap; }
.wfl-action-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(99,102,241,0.08);
    color: #6366f1;
}
.wfl-col-product { min-width: 120px; }
.wfl-pid { font-weight: 700; color: var(--gold); margin-right: 4px; }
.wfl-pref { font-size: 11px; color: var(--text-muted); }
.wfl-pname { font-size: 11px; color: #64748b; margin-top: 2px; }
.wfl-col-field code {
    background: #e2e8f0;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    color: #6366f1;
}
.wfl-col-val { max-width: 180px; }
.wfl-val {
    font-size: 11px;
    line-height: 1.4;
    padding: 3px 6px;
    border-radius: 4px;
    max-height: 48px;
    overflow: hidden;
    cursor: help;
}
.wfl-val-old { background: rgba(220,38,38,0.06); color: #991b1b; }
.wfl-val-new { background: rgba(22,163,74,0.06); color: #166534; }
.wfl-status {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.wfl-s-ok { background: rgba(22,163,74,0.10); color: #16a34a; }
.wfl-s-err { background: rgba(220,38,38,0.10); color: #dc2626; }
.wfl-s-blocked { background: rgba(234,88,12,0.10); color: #ea580c; }
.wfl-error { font-size: 10.5px; color: #dc2626; margin-top: 4px; }
.wfl-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    justify-content: center;
}
.wfl-pag-info { font-size: 12px; color: var(--text-muted); }
.wfl-pag-current { font-size: 12px; font-weight: 600; }


/* ═══════════════════════════════════════════════════════
   ACTIONS MANUELLES
   ═══════════════════════════════════════════════════════ */
.ma-header {
    margin-bottom: 20px;
}
.ma-title { font-size: 20px; font-weight: 700; color: var(--text); margin: 0; }
.ma-subtitle { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; }
.ma-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.ma-list { display: flex; flex-direction: column; gap: 10px; }
.ma-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    transition: var(--transition);
}
.ma-card:hover { border-color: var(--gold); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.ma-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.ma-card-left { flex: 1; }
.ma-card-name { font-size: 14px; font-weight: 600; color: var(--text); }
.ma-card-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.ma-card-right { text-align: center; flex-shrink: 0; }
.ma-count {
    display: block;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}
.ma-count-alert { color: #dc2626; }
.ma-count-ok { color: #16a34a; }
.ma-count-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; }
.ma-card-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.ma-card-cats { display: flex; gap: 4px; flex-wrap: wrap; }
.ma-cat-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 8px;
    background: rgba(99,102,241,0.08);
    color: #6366f1;
}
.ma-stats { display: flex; gap: 12px; flex-wrap: wrap; }

/* Group */
.ma-group {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}
.ma-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    gap: 12px;
    transition: background 0.15s;
}
.ma-group-header:hover { background: #fafbfc; }
.ma-group-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ma-group-toggle { color: var(--text-muted); font-size: 12px; }
.ma-group-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.ma-group-count { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.ma-progress-bar {
    width: 80px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}
.ma-progress-fill {
    height: 100%;
    background: #16a34a;
    border-radius: 3px;
    transition: width 0.3s;
}
.ma-sev {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.ma-sev-critical { background: rgba(220,38,38,0.10); color: #dc2626; }
.ma-sev-high { background: rgba(234,88,12,0.10); color: #ea580c; }
.ma-sev-medium { background: rgba(245,158,11,0.10); color: #d97706; }
.ma-sev-low { background: rgba(100,116,139,0.10); color: #64748b; }

/* Tasks */
.ma-group-body { border-top: 1px solid var(--border); }
.ma-task {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 20px;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.15s, opacity 0.2s;
}
.ma-task:last-child { border-bottom: none; }
.ma-task:hover { background: #fafbfc; }
.ma-task-done { opacity: 0.45; }
.ma-task-done .ma-task-name,
.ma-task-done .ma-task-ref,
.ma-task-done .ma-task-pid { text-decoration: line-through; }

/* Custom checkbox */
.ma-check-label {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}
.ma-check-label input { opacity: 0; position: absolute; width: 0; height: 0; }
.ma-checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ma-check-label input:checked + .ma-checkmark {
    background: #16a34a;
    border-color: #16a34a;
}
.ma-check-label input:checked + .ma-checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}
.ma-check-label:hover .ma-checkmark { border-color: var(--gold); }

.ma-task-pid { font-weight: 700; color: var(--gold); font-size: 12px; min-width: 60px; }
.ma-task-ref { font-size: 11px; color: var(--text-muted); min-width: 80px; }
.ma-task-name { font-size: 12.5px; color: var(--text); flex: 1; }


/* ═══════════════════════════════════════════════════════
   RECONDITIONNES
   ═══════════════════════════════════════════════════════ */
/* Top bar */
.rc-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}
.rc-settings-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #8b5cf6;
    border-radius: 8px;
    background: rgba(139,92,246,0.06);
    color: #7c3aed;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.rc-settings-btn:hover { background: rgba(139,92,246,0.14); }
.rc-settings-btn svg { stroke: #7c3aed; }

.rc-top-actions { display: flex; gap: 8px; align-items: center; }
.rc-history-btn { background: rgba(14,165,233,0.06); border-color: #0ea5e9; color: #0284c7; }
.rc-history-btn:hover { background: rgba(14,165,233,0.14); }
.rc-history-btn svg { stroke: #0284c7; }

/* History page */
.rc-history-page-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.rc-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    background: var(--white);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.rc-back-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(165,133,57,0.05);
}
.rc-back-btn svg { stroke: currentColor; }
.rc-history-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.rc-filter-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 20px;
    border: 1.5px solid var(--border); background: var(--white);
    color: var(--text); font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.rc-filter-btn:hover { border-color: #ea580c; color: #ea580c; }
.rc-filter-btn.active { border-color: #ea580c; background: rgba(234,88,12,0.08); color: #ea580c; font-weight: 600; }

/* Infobulles en-têtes */
.rc-th-wrap { display: inline-flex; align-items: center; gap: 5px; }
.rc-th-info {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 15px; height: 15px; border-radius: 50%;
    background: rgba(100,116,139,0.15); color: #64748b;
    font-size: 10px; font-weight: 700; font-style: italic;
    cursor: help; flex-shrink: 0;
}
.rc-th-bubble {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #f1f5f9;
    font-size: 12px;
    font-weight: 400;
    font-style: normal;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 8px;
    white-space: normal;
    width: 220px;
    text-align: left;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.rc-th-bubble::after {
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
}
.rc-th-info:hover .rc-th-bubble { display: block; }
.rc-history-stats { display: flex; gap: 10px; margin-bottom: 12px; }
.rc-history-table-wrap { overflow-x: auto; background: var(--white); border-radius: 8px; }

/* Settings panel */
.rc-settings-panel {
    background: #faf5ff;
    border: 1px solid #d8b4fe;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}
.rc-settings-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #6d28d9;
    margin-bottom: 14px;
}
.rc-settings-panel-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #7c3aed;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.rc-settings-panel-close:hover { color: #4c1d95; }
/* Tableau récapitulatif des règles */
.rc-rules-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9d5ff;
}
.rc-rules-title {
    font-size: 13px;
    font-weight: 700;
    color: #6d28d9;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.rc-rules-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.rc-rules-table thead tr {
    background: #f3e8ff;
}
.rc-rules-table th {
    padding: 8px 10px;
    font-weight: 700;
    color: #5b21b6;
    text-align: left;
    border-bottom: 2px solid #d8b4fe;
    white-space: nowrap;
}
.rc-rules-table td {
    padding: 7px 10px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
    line-height: 1.5;
}
.rc-rules-table td small {
    display: block;
    font-size: 11px;
    color: #94a3b8;
}
.rc-rules-table td:first-child {
    font-weight: 600;
    color: #1e1b4b;
    white-space: nowrap;
    width: 200px;
}
.rc-rules-alt { background: rgba(243,232,255,0.3); }
.rc-col-like  { color: #16a34a !important; }
.rc-col-defect { color: #d97706 !important; }
.rc-col-used  { color: #dc2626 !important; }
.rc-r-yes {
    display: inline-block;
    color: #16a34a;
    font-weight: 600;
}
.rc-r-no {
    display: inline-block;
    color: #dc2626;
    font-weight: 600;
}

.rc-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.rc-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}
.rc-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--white);
    font-family: inherit;
    box-sizing: border-box;
}
.rc-input:focus { border-color: var(--gold); outline: none; }
.rc-textarea { resize: vertical; }
.rc-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: block; }
.rc-settings-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}
.rc-settings-saved { font-size: 12px; color: #16a34a; font-weight: 600; }

/* Search */
.rc-search-zone { margin-bottom: 20px; }
.rc-title { font-size: 20px; font-weight: 700; color: var(--text); margin: 0; }
.rc-subtitle { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; }
.rc-search-bar {
    display: flex;
    gap: 10px;
    max-width: 600px;
}
.rc-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--white);
}
.rc-search-input:focus { border-color: var(--gold); outline: none; }
.rc-loading { text-align: center; padding: 40px; color: var(--text-muted); }

/* Original product card */
.rc-original-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: stretch;
}
.rc-original-card {
    flex: 1.4;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.rc-create-zone {
    flex: 1 1 520px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 24px 18px;
}
.rc-create-zone:has(.rc-create-form) { align-items: stretch; justify-content: flex-start; }
.rc-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 28px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #c9a84c 0%, #a58539 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(165,133,57,0.28);
    transition: all 0.2s ease;
    white-space: nowrap;
    width: auto;
}
.rc-create-btn:hover {
    background: linear-gradient(135deg, #d4b55a 0%, #b8963f 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(165,133,57,0.4);
}
.rc-create-btn:active { transform: translateY(0); box-shadow: 0 3px 10px rgba(165,133,57,0.25); }
.rc-create-btn svg { stroke: white; flex-shrink: 0; }
.rc-create-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
}
.rc-already-recondi {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(220,38,38,0.06);
    border: 1px solid rgba(220,38,38,0.2);
    border-radius: 8px;
    color: #dc2626;
    font-size: 13px;
    font-weight: 500;
}

.rc-fix-zone {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rc-fix-defaut-row { display: flex; }
.rc-fix-defaut-row .rc-ct-input { flex: 1; }
.rc-fix-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
    transition: background .15s;
}
.rc-fix-btn:hover { background: #4f46e5; }
.rc-fix-btn:disabled { opacity: .6; cursor: default; }

/* Guide modal */
.rc-guide-step {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: #444;
}
.rc-guide-num {
    width: 20px;
    height: 20px;
    background: #2e2d2d;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Create form */
.rc-create-form { width: 100%; }
.rc-create-form-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
    text-align: center;
}
.rc-grade-select {
    display: flex;
    gap: 10px;
}
.rc-grade-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    background: var(--white);
}
.rc-grade-option:hover { border-color: var(--gold); background: #fafbfc; }
.rc-grade-option.selected { border-color: var(--gold); background: rgba(165,133,57,0.06); box-shadow: 0 0 0 1px var(--gold); }
.rc-grade-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rc-grade-green { background: rgba(22,163,74,0.10); }
.rc-grade-green svg { stroke: #16a34a; }
.rc-grade-orange { background: rgba(234,88,12,0.10); }
.rc-grade-orange svg { stroke: #ea580c; }
.rc-grade-red { background: rgba(220,38,38,0.10); }
.rc-grade-red svg { stroke: #dc2626; }
.rc-grade-label { font-size: 13px; font-weight: 600; color: var(--text); }
.rc-grade-desc { font-size: 11px; color: var(--text-muted); line-height: 1.3; }

/* Check result */
.rc-check-result { margin-top: 16px; }
.rc-check-exists, .rc-check-notexist {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}
.rc-check-exists-header, .rc-check-notexist-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 12px;
}
/* Check table */
.rc-check-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    margin-bottom: 4px;
}
.rc-check-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}
.rc-check-table tr:last-child td { border-bottom: none; }
.rc-ct-label {
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    width: 160px;
}
.rc-ct-editable td { background: #fafbfc; }
.rc-ct-editable-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.rc-ct-textarea {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12.5px;
    font-family: inherit;
    color: #dc2626;
    resize: vertical;
    line-height: 1.5;
    min-height: 50px;
}
.rc-ct-textarea:focus { border-color: var(--gold); outline: none; }
.rc-ct-save { flex-shrink: 0; align-self: flex-start; margin-top: 2px; }
.rc-ct-highlight td { background: rgba(99,102,241,0.04); }
.rc-ct-input {
    flex: 1;
    padding: 7px 10px;
    border: 2px solid #6366f1;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
}
.rc-ct-input:focus { outline: none; border-color: var(--gold); }
.rc-ct-input::placeholder { color: #94a3b8; }
.rc-ct-generate {
    flex-shrink: 0;
    align-self: flex-start;
    white-space: nowrap;
}
.rc-check-problems {
    margin-top: 12px;
    padding: 10px;
    background: rgba(234,88,12,0.05);
    border: 1px solid rgba(234,88,12,0.15);
    border-radius: 8px;
}
.rc-check-problems-title {
    font-size: 11px;
    font-weight: 700;
    color: #ea580c;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}
.rc-check-problem {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 4px 0;
}
.rc-check-problem-label { font-weight: 600; color: var(--text); min-width: 140px; }
.rc-check-problem-current { color: #dc2626; }
.rc-check-problem-arrow { color: #94a3b8; }
.rc-check-problem-expected { color: #16a34a; font-weight: 600; }
.rc-check-allgood {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #16a34a;
    padding: 8px 12px;
    background: rgba(22,163,74,0.06);
    border-radius: 8px;
}
.rc-check-notexist-desc { font-size: 12.5px; color: var(--text-muted); margin: 0; }

.rc-create-success {
    margin-top: 12px;
    padding: 12px;
    background: rgba(22,163,74,0.08);
    border: 1px solid rgba(22,163,74,0.2);
    border-radius: 8px;
    color: #15803d;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}
.rc-create-success small { color: #16a34a; font-weight: 400; }
.rc-reactivate-zone {
    margin-top: 12px;
    padding: 12px;
    background: rgba(22,163,74,0.06);
    border: 1px solid rgba(22,163,74,0.2);
    border-radius: 8px;
    text-align: center;
}
.rc-reactivate-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: none;
    border-radius: 8px;
    background: #16a34a;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.rc-reactivate-btn:hover { background: #15803d; }
.rc-reactivate-btn svg { stroke: white; }
.rc-reactivate-hint { font-size: 11.5px; color: var(--text-muted); margin: 6px 0 0; }

.rc-create-error {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(220,38,38,0.06);
    border: 1px solid rgba(220,38,38,0.2);
    border-radius: 8px;
    color: #dc2626;
    font-size: 12.5px;
    font-weight: 500;
}

/* Zone upload photos recondi */
.rc-upload-zone-wrapper {
    margin-top: 14px;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}
.rc-upload-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.rc-upload-hint {
    font-weight: 400;
    color: #94a3b8;
    font-size: 11.5px;
}
.rc-upload-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    min-height: 24px;
}
.rc-upload-empty {
    font-size: 12px;
    color: #94a3b8;
    align-self: center;
}
.rc-upload-thumb {
    position: relative;
    width: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    transition: border-color .15s;
}
.rc-upload-thumb.rc-upload-cover {
    border-color: var(--gold);
}
.rc-upload-thumb img {
    width: 100%;
    height: 72px;
    object-fit: cover;
    display: block;
}
.rc-upload-thumb-pos {
    font-size: 10px;
    text-align: center;
    padding: 2px 0;
    background: #f1f5f9;
    color: #64748b;
}
.rc-upload-thumb.rc-upload-cover .rc-upload-thumb-pos {
    background: rgba(165,133,57,0.12);
    color: var(--gold);
    font-weight: 700;
}
.rc-upload-thumb-actions {
    display: none;
    position: absolute;
    top: 2px;
    right: 2px;
    flex-direction: column;
    gap: 2px;
}
.rc-upload-thumb:hover .rc-upload-thumb-actions {
    display: flex;
}
.rc-upload-thumb-btn {
    background: rgba(255,255,255,0.92);
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    width: 20px;
    height: 20px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    color: #374151;
}
.rc-upload-thumb-btn:hover { background: #f1f5f9; }
.rc-upload-thumb-btn:disabled { opacity: .35; cursor: default; }
.rc-upload-cover-btn.active { color: var(--gold); }
.rc-upload-delete-btn:hover { color: #dc2626; border-color: #dc2626; }
.rc-upload-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: #fafbfc;
    font-size: 12.5px;
    color: #64748b;
    text-align: center;
}
.rc-upload-drop:hover, .rc-upload-drop.dragover {
    border-color: var(--gold);
    background: rgba(165,133,57,0.04);
    color: var(--gold);
}
.rc-upload-drop.dragover { background: rgba(165,133,57,0.08); }
.rc-original-content {
    display: flex;
    gap: 16px;
    padding: 16px;
    align-items: center;
}
.rc-original-img {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}
.rc-original-img img { width: 100%; height: 100%; object-fit: contain; }
.rc-no-img { font-size: 11px; color: var(--text-muted); text-align: center; }
.rc-original-info { flex: 1; min-width: 0; }
.rc-original-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rc-original-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(99,102,241,0.10);
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.rc-original-title-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}
.rc-original-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; line-height: 1.3; }
.rc-original-meta-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 8px;
}
.rc-meta-cell {}
.rc-meta-label { display: block; font-size: 9px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.3px; }
.rc-meta-val { font-size: 12.5px; color: var(--text); }
.rc-original-defaut {
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(220,38,38,0.06);
    border-left: 3px solid #dc2626;
    border-radius: 0 6px 6px 0;
    color: #dc2626;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
}
.rc-original-id { font-weight: 700; color: var(--gold); font-size: 14px; }
.rc-original-ref {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 4px;
    color: #6366f1;
    font-weight: 600;
}
.rc-original-name { font-size: 14px; font-weight: 500; color: var(--text); }
.rc-original-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}
.rc-meta-item { font-size: 12px; color: var(--text-muted); }
.rc-meta-stock strong { color: var(--text); }

/* Active/Inactive icons */
.rc-icon-active, .rc-icon-inactive { display: inline-flex; align-items: center; justify-content: center; }
.rc-col-active { text-align: center; width: 40px; }

/* Badges */
.rc-badge-recondi {
    font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 8px;
    background: rgba(168,85,247,0.10); color: #a855f7;
}

/* Grade tags historique */
.rc-grade-tag {
    display: inline-block; font-size: 11px; font-weight: 600;
    padding: 3px 9px; border-radius: 20px; white-space: nowrap;
}
.rc-grade-like-new      { background: rgba(22,163,74,0.1);  color: #16a34a; }
.rc-grade-visible-defect{ background: rgba(234,88,12,0.1);  color: #ea580c; }
.rc-grade-used          { background: rgba(100,116,139,0.1); color: #64748b; }

/* Stock badges */
.rc-stock-badge {
    display: inline-block; font-size: 12px; font-weight: 700;
    padding: 2px 10px; border-radius: 20px;
}
.rc-stock-in   { background: rgba(22,163,74,0.1);   color: #16a34a; }
.rc-stock-zero { background: rgba(100,116,139,0.08); color: #94a3b8; }
.rc-stop-ok {
    display: inline-block; font-size: 11px; font-weight: 600;
    padding: 3px 10px; border-radius: 20px;
    background: rgba(22,163,74,0.1); color: #16a34a;
    white-space: nowrap;
}
.rc-stop-wait {
    display: inline-block; font-size: 11px; font-weight: 500;
    padding: 3px 10px; border-radius: 20px;
    background: rgba(234,88,12,0.08); color: #ea580c;
    white-space: nowrap;
}
.rc-stop-pending {
    display: inline-block; font-size: 11px; font-weight: 500;
    padding: 3px 10px; border-radius: 20px;
    background: rgba(234,179,8,0.1); color: #b45309;
    white-space: nowrap;
}
/* ─── Page Crons ─────────────────────────────────────────────────── */
.crons-list { display: flex; flex-direction: column; gap: 16px; max-width: 800px; }
.cron-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: 12px; padding: 20px 24px;
}
.cron-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cron-title { font-size: 15px; font-weight: 600; color: var(--text); }
.cron-desc { font-size: 13px; color: var(--text-muted); margin: 0 0 16px; line-height: 1.5; }
.cron-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px; }
.cron-active  { background: rgba(22,163,74,0.1);  color: #16a34a; }
.cron-disabled{ background: rgba(100,116,139,0.1); color: #64748b; }
.cron-stopped { background: rgba(220,38,38,0.1);  color: #dc2626; }
.cron-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #16a34a;
    animation: cronPulse 1.5s ease-in-out infinite;
}
@keyframes cronPulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.cron-meta { display: flex; gap: 24px; flex-wrap: wrap; }
.cron-meta-item { display: flex; flex-direction: column; gap: 2px; }
.cron-meta-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cron-meta-val { font-size: 13px; font-weight: 500; color: var(--text); }
.cron-link {
    background: none; border: none; color: var(--gold); font-size: 13px;
    font-weight: 500; cursor: pointer; padding: 0; text-decoration: underline;
}

.rc-badge-neuf {
    font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 8px;
    background: rgba(22,163,74,0.06); color: #64748b;
}
.rc-col-ref {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11.5px;
    color: #6366f1;
}
.rc-grade-badge {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

/* Recondis section */
.rc-recondis-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.rc-recondis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.rc-recondis-header h3 { font-size: 14px; font-weight: 600; color: var(--text); margin: 0; }
.rc-recondis-count {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(168,85,247,0.10);
    color: #a855f7;
}
.rc-recondis-empty { padding: 30px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Table */
.rc-table-wrap { overflow-x: auto; }
.rc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rc-table th {
    background: #f8fafc;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.rc-table td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; }
.rc-table tr:hover td { background: #fafbfc; }
.rc-col-id { font-weight: 700; color: var(--gold); white-space: nowrap; }
.rc-col-name { font-weight: 500; max-width: 250px; }
.rc-col-defaut { color: #dc2626; font-size: 12px; max-width: 400px; white-space: normal; line-height: 1.4; }
.rc-col-price { white-space: nowrap; }
.rc-col-stock { text-align: center; font-weight: 600; }
.rc-stock-ok { color: #16a34a; }
.rc-stock-zero { color: #dc2626; }


/* ═══ TODO V2 ═══════════════════════════════════════════════════════════════ */

/* Top bar with board tabs */
.tdb-topbar {
    display: flex;
    align-items: center;
    padding: 0 18px;
    background: #f8f8f6;
    border-bottom: 1px solid #e5e7eb;
    min-height: 44px;
    gap: 4px;
    overflow-x: auto;
}
.tdb-boards { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; }
.tdb-board-tab {
    display: flex; align-items: center; gap: 7px;
    padding: 6px 14px;
    border-radius: 7px 7px 0 0;
    font-size: 12.5px; font-weight: 600; color: #64748b;
    cursor: pointer; border: none; background: transparent;
    white-space: nowrap; transition: background .12s;
    font-family: inherit;
}
.tdb-board-tab:hover { background: #ede9e1; color: #1e293b; }
.tdb-board-tab.active { background: #fff; color: #1e293b; border: 1px solid #e5e7eb; border-bottom: 1px solid #fff; margin-bottom: -1px; }
.tdb-board-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.tdb-topbar-actions { flex-shrink: 0; }
.tdb-btn-add-board {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 10px; border-radius: 6px; border: 1px dashed #d1d5db;
    background: transparent; color: #94a3b8; font-size: 12px; cursor: pointer;
    font-family: inherit; white-space: nowrap;
}
.tdb-btn-add-board:hover { border-color: var(--gold); color: var(--gold); }

/* Board header */
.tdb-board-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 18px; background: #fff; border-bottom: 1px solid #f1f5f9;
}
.tdb-board-title-wrap { display: flex; align-items: center; gap: 10px; }
.tdb-board-title { font-size: 15px; font-weight: 700; color: #1e293b; }
.tdb-board-actions { display: flex; gap: 6px; }
.tdb-action-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: 6px; border: 1px solid #e5e7eb;
    background: #fff; color: #374151; font-size: 12px; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: all .12s;
}
.tdb-action-btn:hover { border-color: var(--gold); color: var(--gold); }

/* Table */
.tdb-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 190px);
    background: #fff;
}
.tdb-table {
    border-collapse: collapse;
    table-layout: fixed;
    width: max-content;
    min-width: 100%;
    font-size: 13px;
}

/* Header row */
.tdb-table thead tr th {
    position: sticky; top: 0; z-index: 10;
    background: #f8f8f6;
    border-bottom: 2px solid #e5e7eb;
    padding: 0;
    white-space: nowrap;
    font-weight: 700; color: #64748b; font-size: 11.5px;
    text-transform: uppercase; letter-spacing: .04em;
}
.tdb-th-inner {
    display: flex; align-items: center; gap: 5px;
    padding: 8px 10px; min-width: 80px; cursor: default;
}
.tdb-th-name { min-width: 240px; }
th.tdb-col-check { width: 26px; min-width: 26px; position: sticky; left: 0; z-index: 11; background: #f8f8f6; }
th.tdb-col-name { width: 180px; min-width: 160px; max-width: 180px; position: sticky; left: 26px; z-index: 11; background: #f8f8f6; overflow: hidden; }
th.tdb-col-actions { width: 40px; }
.tdb-th-add {
    background: none; border: none; color: #94a3b8; cursor: pointer;
    padding: 8px 12px; font-size: 18px; line-height: 1;
}
.tdb-th-add:hover { color: var(--gold); }

/* Group row */
.tdb-group-row td {
    background: #f4f6f9;
    padding: 9px 10px 7px;
    border-bottom: 1px solid #e8ecf2;
    border-top: 6px solid #eceef2;
}
.tdb-group-chevron {
    cursor: pointer; transition: transform .2s; display: inline-block;
    color: #b0b8c8; font-size: 10px; vertical-align: middle;
}
.tdb-group-chevron.collapsed { transform: rotate(-90deg); }
.tdb-group-label {
    cursor: pointer;
    font-size: 10.5px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .07em;
    color: #2e2d2d; margin-left: 7px; vertical-align: middle;
}
.tdb-group-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 19px; height: 19px; border-radius: 10px;
    background: #f1f5f9; color: #64748b;
    font-size: 10px; font-weight: 700; padding: 0 6px;
    margin-left: 8px; vertical-align: middle;
}
.tdb-group-add-row td {
    padding: 5px 10px 5px 26px;
    background: #fafbfd;
    border-bottom: 1px solid #e8ecf2;
}
.tdb-add-row-btn {
    background: none; border: none; color: #94a3b8; font-size: 12px; cursor: pointer;
    display: flex; align-items: center; gap: 4px; padding: 2px 4px;
    font-family: inherit;
}
.tdb-add-row-btn:hover { color: var(--gold); }

/* Task row */
.tdb-task-row { border-bottom: 1px solid #f1f5f9; }
.tdb-task-row:hover { background: #fafaf9; }
.tdb-task-row:hover .tdb-task-row-actions { opacity: 1; }
.tdb-task-row td {
    border-right: none;
    padding: 0;
    vertical-align: middle;
}
td.tdb-td-check {
    position: sticky; left: 0; z-index: 5; background: inherit;
    width: 26px; min-width: 26px; text-align: center;
}
td.tdb-td-name {
    position: sticky; left: 26px; z-index: 5; background: inherit;
    width: 180px; min-width: 160px; max-width: 180px; overflow: hidden;
}
.tdb-name-cell {
    padding: 3px 6px; display: flex; align-items: center; gap: 5px; cursor: text;
}
.tdb-name-text { flex: 1; font-size: 12px; font-weight: 400; color: #374151; line-height: 1.3; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdb-priority-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.tdb-task-row-actions {
    display: flex; gap: 2px; flex-shrink: 0; opacity: 0; transition: opacity .1s;
}
.tdb-row-action-btn {
    background: none; border: none; cursor: pointer; color: #cbd5e1; padding: 2px 3px; border-radius: 4px;
}
.tdb-row-action-btn:hover { color: #ef4444; }

/* Generic cell */
.tdb-cell {
    padding: 3px 6px; cursor: pointer; min-height: 24px;
    display: flex; align-items: center;
}
.tdb-cell:hover { background: #f0ede6; }
.tdb-cell-status { padding: 0; }
.tdb-cell-status:hover { background: none; }
.tdb-cell-empty { color: #d1d5db; font-size: 12px; }

/* Status pill */
.tdb-status-block {
    display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: 24px; padding: 0 6px;
    font-size: 11px; font-weight: 700; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    letter-spacing: .03em; text-transform: uppercase;
}
.tdb-status-empty { color: #d1d5db; font-size: 12px; }

/* People */
.tdb-people { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; }
.tdb-person { background: #e0f2fe; color: #0369a1; border-radius: 99px; padding: 2px 8px; font-size: 11px; font-weight: 600; }

/* Date */
.tdb-date { font-size: 12px; color: #475569; font-variant-numeric: tabular-nums; }

/* Link */
.tdb-link { font-size: 12px; color: var(--gold); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; display: block; }

/* Tags */
.tdb-tag { background: #f5f3ff; color: #7c3aed; border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 600; }

/* Checkbox */
.tdb-check-cell { display: flex; align-items: center; justify-content: center; }
.tdb-check { width: 15px; height: 15px; cursor: pointer; }

/* Picker styles */
.tdb-picker-option {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; cursor: pointer; font-size: 12.5px; color: #1e293b;
}
.tdb-picker-option:hover { background: #f1f5f9; }
.tdb-picker-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.tdb-picker-clear { padding: 6px 12px; font-size: 12px; color: #94a3b8; cursor: pointer; border-top: 1px solid #f1f5f9; }
.tdb-picker-clear:hover { color: #ef4444; }

/* Modal form styles */
.tdb-form-row { margin-bottom: 14px; }
.tdb-label { display: block; font-size: 12px; font-weight: 700; color: #6b7280; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.tdb-input {
    width: 100%; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 7px;
    font-size: 13.5px; box-sizing: border-box; font-family: inherit;
}
.tdb-input:focus { outline: none; border-color: var(--gold); }
.tdb-select { width: 100%; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 7px; font-size: 13.5px; background: #fff; font-family: inherit; }
.tdb-modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.tdb-btn-cancel { padding: 7px 16px; border-radius: 7px; border: 1px solid #e5e7eb; background: #fff; color: #6b7280; font-size: 13px; cursor: pointer; font-family: inherit; }
.tdb-btn-save { padding: 7px 18px; border-radius: 7px; border: none; background: var(--gold); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; }
.tdb-color-options { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tdb-color-swatch { width: 22px; height: 22px; border-radius: 4px; cursor: pointer; border: 2px solid transparent; }
.tdb-color-swatch.selected { border-color: #1e293b; }
.tdb-status-options-editor { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.tdb-status-option-row { display: flex; align-items: center; gap: 8px; }
.tdb-status-option-input { flex: 1; padding: 5px 8px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 12.5px; font-family: inherit; }
.tdb-status-option-color { width: 28px; height: 28px; border-radius: 5px; border: 1px solid #e5e7eb; cursor: pointer; }

/* Loading */
.tdb-loading { text-align: center; padding: 40px; color: #94a3b8; font-size: 13px; }

/* Inline text editor */
.tdb-inline-input {
    width: 100%; padding: 5px 8px; border: 1.5px solid var(--gold); border-radius: 5px;
    font-size: 13px; font-family: inherit; background: #fff; box-sizing: border-box;
}
.tdb-inline-input:focus { outline: none; }


/* ─── Comments Drawer ────────────────────────────────────────────────────── */
.tdb-comments-overlay {
    position: fixed; inset: 0; z-index: 4000;
    background: rgba(0,0,0,0);
    pointer-events: none;
    transition: background .2s;
}
.tdb-comments-overlay.open {
    background: rgba(0,0,0,.25);
    pointer-events: auto;
}
.tdb-comments-drawer {
    position: fixed; right: -700px; top: 0; bottom: 0;
    width: 640px; max-width: 95vw;
    background: #fff;
    box-shadow: -4px 0 30px rgba(0,0,0,.12);
    display: flex; flex-direction: column;
    transition: right .25s cubic-bezier(.4,0,.2,1);
    z-index: 4001;
}
.tdb-comments-drawer.open { right: 0; }
.tdb-comments-drawer.tdb-drag-over::after {
    content: 'Déposer pour joindre';
    position: absolute; inset: 0;
    background: rgba(201,168,76,0.18);
    border: 3px dashed var(--gold,#c9a84c);
    color: var(--gold,#a58539);
    font-size: 18px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    z-index: 10;
}

.tdb-comments-head {
    padding: 14px 16px;
    background: #2e2d2d;
    color: #fff;
    display: flex; align-items: flex-start; gap: 10px;
}
.tdb-comments-task-title {
    flex: 1; font-size: 13.5px; font-weight: 700; line-height: 1.35;
    color: #fff;
}
.tdb-comments-close {
    background: none; border: none; color: #94a3b8; font-size: 22px;
    cursor: pointer; line-height: 1; flex-shrink: 0; padding: 0;
}
.tdb-comments-close:hover { color: #fff; }

.tdb-comments-body {
    flex: 1; overflow-y: auto; padding: 14px 16px;
    display: flex; flex-direction: column; gap: 12px;
}
.tdb-comments-empty {
    color: #94a3b8; font-size: 13px; text-align: center; padding: 30px 0;
}

.tdb-comment-item {
    display: flex; gap: 10px; align-items: flex-start;
    flex-wrap: wrap;
}
.tdb-comment-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #fff;
    background: var(--gold);
}
.tdb-comment-bubble {
    flex: 1; background: #f8f8f6; border-radius: 0 10px 10px 10px;
    padding: 8px 11px; position: relative;
}
.tdb-comment-author {
    font-size: 12px; font-weight: 700; color: #1e293b; margin-bottom: 3px;
}
.tdb-comment-text {
    font-size: 13px; color: #374151; line-height: 1.45; white-space: pre-wrap;
    word-break: break-word;
}
.tdb-comment-time {
    font-size: 10.5px; color: #94a3b8; margin-top: 4px;
}
.tdb-comment-del {
    position: absolute; top: 6px; right: 8px;
    background: none; border: none; cursor: pointer;
    color: #d1d5db; font-size: 14px; padding: 0; line-height: 1;
    opacity: 0; transition: opacity .1s;
}
.tdb-comment-bubble:hover .tdb-comment-del { opacity: 1; }
.tdb-comment-del:hover { color: #ef4444; }

.tdb-comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.tdb-comment-time { font-size: 10.5px; color: #94a3b8; }
.tdb-comment-edited { font-size: 10.5px; color: #cbd5e1; font-style: italic; }
.tdb-comment-action {
    background: transparent; border: none; padding: 0;
    font-size: 11px; color: #6b6963; cursor: pointer;
    font-family: inherit; font-weight: 500;
    transition: color .12s;
}
.tdb-comment-action:hover { color: var(--gold,#a58539); text-decoration: underline; }
.tdb-comment-action-del:hover { color: #ef4444; }
/* Vertical threading: no horizontal indent. The reply context line above each
   reply makes the parent-child relationship visible. */
.tdb-comment-replies { display: contents; }
.tdb-comment-reply { /* visually identical, header conveys lineage */ }
/* Compact thread marker (no text) */
.tdb-comment-reply .tdb-comment-bubble {
    border-left: 3px solid var(--gold,#c9a84c);
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}
.tdb-comment-replymark {
    flex: 0 0 100%;
    color: var(--gold,#a58539);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    padding-left: 4px;
    margin-bottom: -2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .12s;
}
.tdb-comment-replymark span { font-weight: 700; }
.tdb-comment-replymark:hover { color: #2e2d2d; }
.tdb-comment-flash { animation: tdbCmtFlash 1.2s ease-out; }
@keyframes tdbCmtFlash {
    0% { background: rgba(201,168,76,0.30); }
    100% { background: transparent; }
}

/* Reactions */
.tdb-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.tdb-reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid #ece7dc;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .12s, background .12s;
    line-height: 1.2;
    position: relative;
}
.tdb-reaction-pill[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #2e2d2d;
    color: #fff;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tdb-reaction-pill[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 1px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2e2d2d;
    z-index: 100;
    pointer-events: none;
}
.tdb-reaction-pill:hover { border-color: var(--gold,#c9a84c); }
.tdb-reaction-pill.active {
    background: rgba(201,168,76,0.18);
    border-color: var(--gold,#c9a84c);
}
.tdb-reaction-emoji { font-size: 14px; }
.tdb-reaction-count { color: #6b6963; font-weight: 600; font-size: 11px; }
.tdb-reaction-pill.active .tdb-reaction-count { color: var(--gold,#a58539); }

.tdb-reaction-pop {
    position: fixed;
    z-index: 10003;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    border: 1px solid #ece7dc;
    padding: 6px 8px;
    display: flex;
    gap: 2px;
}
.tdb-reaction-pick {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: transform .1s, background .12s;
    line-height: 1;
}
.tdb-reaction-pick:hover { background: #faf6e9; transform: scale(1.2); }

/* Attachments */
.tdb-attach-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.tdb-attach {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}
.tdb-attach-img {
    width: 140px;
    height: 110px;
    border: 1px solid #ece7dc;
    background: #f9f7f1;
}
.tdb-attach-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .15s;
}
.tdb-attach-img:hover img { transform: scale(1.04); }
.tdb-attach-file {
    background: #f9f7f1;
    border: 1px solid #ece7dc;
    padding: 8px 12px;
    gap: 10px;
    min-width: 180px;
    max-width: 260px;
    transition: border-color .12s, background .12s;
}
.tdb-attach-file:hover {
    border-color: var(--gold,#c9a84c);
    background: #faf6e9;
}
.tdb-attach-icon { color: #6b6963; flex: 0 0 auto; }
.tdb-attach-info { flex: 1; min-width: 0; }
.tdb-attach-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #2e2d2d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tdb-attach-meta { font-size: 10.5px; color: #94a3b8; margin-top: 2px; }
.tdb-attach-del {
    position: absolute;
    top: 4px; right: 4px;
    background: rgba(0,0,0,.55);
    color: #fff;
    border: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: none;
    align-items: center; justify-content: center;
    padding: 0;
}
.tdb-attach:hover .tdb-attach-del { display: flex; }
.tdb-attach-del:hover { background: #ef4444; }

/* Paperclip + staged files */
.tdb-comments-attach {
    background: transparent;
    border: 1px solid #ece7dc;
    color: #6b6963;
    width: 36px; height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .12s, color .12s, background .12s;
    flex: 0 0 auto;
    margin-right: 4px;
}
.tdb-comments-attach:hover {
    border-color: var(--gold,#c9a84c);
    color: var(--gold,#a58539);
    background: #faf6e9;
}
.tdb-staged-files {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: #faf6e9;
    border: 1px dashed rgba(201,168,76,0.40);
    border-radius: 8px;
    margin-bottom: 8px;
}
.tdb-staged-item {
    display: flex; align-items: center; gap: 6px;
    background: #fff;
    border: 1px solid #ece7dc;
    border-radius: 6px;
    padding: 4px 8px 4px 4px;
    font-size: 11.5px;
    max-width: 220px;
}
.tdb-staged-thumb {
    width: 28px; height: 28px;
    object-fit: cover;
    border-radius: 4px;
    flex: 0 0 auto;
}
.tdb-staged-icon {
    width: 28px; height: 28px;
    background: #f4f1e9;
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    color: #6b6963;
    flex: 0 0 auto;
}
.tdb-staged-name {
    flex: 1;
    font-weight: 600;
    color: #2e2d2d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.tdb-staged-size { color: #94a3b8; font-size: 10.5px; flex: 0 0 auto; }
.tdb-staged-del {
    background: transparent; border: none;
    color: #6b6963; cursor: pointer;
    font-size: 16px; line-height: 1;
    padding: 0 2px;
    flex: 0 0 auto;
}
.tdb-staged-del:hover { color: #ef4444; }

.tdb-mention-tag {
    background: rgba(201,168,76,0.16);
    color: var(--gold,#a58539);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
}

.tdb-reply-context {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(201,168,76,0.12);
    border: 1px solid rgba(201,168,76,0.30);
    color: #2e2d2d;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 12px;
}
.tdb-reply-label { color: #6b6963; }
.tdb-reply-label > span { color: var(--gold,#a58539); font-weight: 700; }
.tdb-reply-cancel {
    background: transparent; border: none; color: #6b6963;
    font-size: 16px; cursor: pointer; padding: 0; line-height: 1;
}
.tdb-reply-cancel:hover { color: #ef4444; }

.tdb-mention-pop {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.16);
    border: 1px solid #ece7dc;
    padding: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 20;
}
.tdb-mention-row {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 12.5px;
    cursor: pointer;
}
.tdb-mention-row.active, .tdb-mention-row:hover { background: rgba(201,168,76,0.14); }
.tdb-mention-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.tdb-comments-journal-btn {
    background: transparent;
    border: 1px solid #ece7dc;
    color: #6b6963;
    width: 28px; height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .12s, color .12s;
}
.tdb-comments-journal-btn:hover { border-color: var(--gold,#c9a84c); color: var(--gold,#a58539); }

.tdb-comment-logs-body {
    padding: 12px 16px 16px;
    overflow-y: auto;
    font-size: 12.5px;
}
.tdb-log-row { padding: 8px 0; border-bottom: 1px solid #f4f1e9; }
.tdb-log-row:last-child { border-bottom: none; }
.tdb-log-line { color: #2e2d2d; }
.tdb-log-time { color: #94a3b8; font-size: 11px; margin-left: 6px; }
.tdb-log-snippet {
    color: #6b6963;
    font-style: italic;
    font-size: 11.5px;
    margin-top: 3px;
    padding-left: 8px;
    border-left: 2px solid #ece7dc;
}

/* Bell + notification dropdown */
#tabTodo .tdb-bell-btn {
    position: relative;
    padding: 6px 8px;
}
.tdb-bell-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.tdb-notif-pop {
    position: fixed;
    z-index: 10001;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 14px 40px rgba(0,0,0,.20);
    border: 1px solid #ece7dc;
    width: 360px;
    max-height: 480px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-size: 12.5px;
}
.tdb-notif-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #f1efeb;
    font-weight: 700;
    color: #2e2d2d;
    background: #fafaf7;
}
.tdb-notif-readall {
    background: transparent; border: none;
    color: var(--gold,#a58539);
    font-size: 11.5px;
    cursor: pointer;
    font-family: inherit;
    padding: 2px 6px;
    border-radius: 4px;
}
.tdb-notif-readall:hover { background: rgba(201,168,76,0.12); }
.tdb-notif-list { overflow-y: auto; max-height: 420px; }
.tdb-notif-empty, .tdb-notif-loading {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 12.5px;
    font-style: italic;
}
.tdb-notif-row {
    padding: 10px 14px;
    border-bottom: 1px solid #f5f3ee;
    cursor: pointer;
    transition: background .1s;
}
.tdb-notif-row:hover { background: #faf6e9; }
.tdb-notif-row.tdb-notif-unread {
    background: rgba(201,168,76,0.06);
    border-left: 3px solid var(--gold,#c9a84c);
    padding-left: 11px;
}
.tdb-notif-from { color: #2e2d2d; }
.tdb-notif-task { color: #6b6963; font-size: 11.5px; margin-top: 2px; }
.tdb-notif-snip {
    color: #94a3b8;
    font-size: 11.5px;
    font-style: italic;
    margin-top: 4px;
    padding-left: 8px;
    border-left: 2px solid #ece7dc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tdb-notif-time { color: #b0aea8; font-size: 10.5px; margin-top: 4px; }

/* ── Mon travail (My Work) recap view ─────────────────────────────────────── */
#tabTodoMyWork { padding: 24px 32px 60px; }
.mw-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    margin-bottom: 20px; flex-wrap: wrap; gap: 16px;
}
.mw-title {
    font-size: 22px; font-weight: 800; color: #2e2d2d;
    letter-spacing: -.02em;
}
.mw-subtitle { font-size: 12.5px; color: #6b6963; margin-top: 4px; }
.mw-controls { display: flex; align-items: center; gap: 12px; }
.mw-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: #2e2d2d; cursor: pointer;
}
.mw-toggle input { accent-color: var(--gold,#c9a84c); }
.mw-user-tag {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(201,168,76,0.14);
    color: var(--gold,#a58539);
    border: 1px solid rgba(201,168,76,0.30);
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
}
.mw-user-edit {
    background: transparent; border: none;
    color: #6b6963;
    font-size: 11.5px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 5px;
    text-decoration: underline;
    font-family: inherit;
}
.mw-user-edit:hover { color: var(--gold,#a58539); background: #faf6e9; }
.mw-set-name-btn {
    display: inline-block;
    margin-top: 8px;
    background: var(--gold,#c9a84c);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-style: normal;
}
.mw-set-name-btn:hover { background: var(--gold-dark,#a58539); }
.mw-refresh {
    background: #fff; border: 1px solid #ece7dc; color: #6b6963;
    width: 32px; height: 32px; border-radius: 6px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .12s, color .12s;
}
.mw-refresh:hover { border-color: var(--gold,#c9a84c); color: var(--gold,#a58539); }

.mw-loading, .mw-empty {
    text-align: center; padding: 40px;
    color: #94a3b8; font-style: italic; font-size: 13px;
}

.mw-section { margin-bottom: 32px; }
.mw-section-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
}
.mw-section-title { font-size: 14px; font-weight: 700; color: #2e2d2d; }
.mw-section-count {
    background: #ece7dc; color: #6b6963;
    padding: 1px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600;
}

.mw-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    border: 1px solid #f1efeb;
}
.mw-table thead th {
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #94a3b8;
    padding: 10px 14px;
    background: #faf8f3;
    border-bottom: 1px solid #f1efeb;
}
.mw-row {
    cursor: pointer;
    transition: background .1s;
}
.mw-row:hover { background: #faf6e9; }
.mw-row td {
    padding: 10px 14px;
    border-bottom: 1px solid #f5f3ee;
    font-size: 12.5px;
    color: #2e2d2d;
    vertical-align: middle;
}
.mw-row:last-child td { border-bottom: none; }

.mw-cell-date { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mw-date-todo  { color: #dc2626; }   /* À faire → rouge */
.mw-date-soon  { color: #f97316; }   /* À venir → orange */
.mw-no-date    { color: #cbd5e1; font-weight: 400; }

.mw-cell-title { font-weight: 600; }
.mw-cell-board { white-space: nowrap; color: #6b6963; }
.mw-cell-group { color: #6b6963; font-size: 12px; }
.mw-board-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.mw-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.mw-status-retard      { background: #fee2e2; color: #b91c1c; }
.mw-status-a-faire     { background: #fef3c7; color: #b45309; }
.mw-status-a-venir     { background: #dbeafe; color: #1d4ed8; }
.mw-status-en-attente  { background: #f1f5f9; color: #475569; }
.mw-status-neutral     { background: #f1efeb; color: #94a3b8; }

.mw-people { display: flex; gap: 3px; flex-wrap: wrap; }

.tdb-task-flash { animation: tdbCmtFlash 1.5s ease-out; }

/* Generic modal overlay (used by comment logs) */
.tdb-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.32);
    z-index: 9998;
    display: flex; align-items: center; justify-content: center;
}
.tdb-modal-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0,0,0,.18);
    overflow: hidden;
}
.tdb-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f1efeb;
}
.tdb-modal-title { font-weight: 700; color: #2e2d2d; }
.tdb-modal-close {
    background: transparent; border: none;
    font-size: 20px; color: #94a3b8;
    cursor: pointer; line-height: 1; padding: 0 4px;
}
.tdb-modal-close:hover { color: #ef4444; }

.tdb-comments-footer {
    padding: 12px 16px;
    border-top: 1px solid #f1f5f9;
    background: #fafaf9;
}
.tdb-comments-author-row {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.tdb-comments-author-label {
    font-size: 11px; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; white-space: nowrap;
}
.tdb-comments-author-input {
    flex: 1; padding: 5px 8px; border: 1px solid #e5e7eb; border-radius: 6px;
    font-size: 12.5px; font-family: inherit;
}
.tdb-comments-author-input:focus { outline: none; border-color: var(--gold); }
.tdb-comments-msg-row {
    display: flex; gap: 8px; align-items: flex-end;
}
.tdb-comments-textarea {
    flex: 1; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 8px;
    font-size: 13px; font-family: inherit; resize: none;
    min-height: 40px; max-height: 120px;
    line-height: 1.4;
}
.tdb-comments-textarea:focus { outline: none; border-color: var(--gold); }
.tdb-comments-send {
    flex-shrink: 0; width: 38px; height: 38px;
    border-radius: 8px; border: none;
    background: var(--gold); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.tdb-comments-send:hover { background: #a58539; }
.tdb-comments-send:disabled { background: #d1d5db; cursor: default; }

/* Comment count badge on task row */
.tdb-comment-count {
    display: none; align-items: center; justify-content: center;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; font-size: 10px; font-weight: 700;
    cursor: pointer; flex-shrink: 0;
    background: #f1f5f9; color: #94a3b8;
}
.tdb-comment-count.has-comments {
    background: var(--gold); color: #fff;
}

/* Group gear icon */
.tdb-group-gear {
    display: inline-block; vertical-align: middle;
    margin-left: 8px; font-size: 12px;
    color: #d1d5db; cursor: pointer;
    opacity: 0; transition: opacity .15s, color .15s;
}
.tdb-group-row:hover .tdb-group-gear { opacity: 1; }
.tdb-group-gear:hover { color: var(--gold); }

/* Group drag handle */
.tdb-group-drag {
    display: inline-block; vertical-align: middle;
    color: #d1d5db; font-size: 14px; cursor: grab;
    margin-right: 4px; line-height: 1;
    opacity: 0; transition: opacity .15s;
}
.tdb-group-row:hover .tdb-group-drag { opacity: 1; }
.tdb-group-drag:active { cursor: grabbing; }
.tdb-drop-target td { background: #fef9ec !important; border-top: 2px solid var(--gold) !important; }

.tdb-collapse-all-btn {
    background: none; border: none; cursor: pointer;
    color: #94a3b8; padding: 2px; display: flex;
    align-items: center; justify-content: center;
    transition: color .15s, transform .2s;
    border-radius: 3px;
}
.tdb-collapse-all-btn:hover { color: var(--gold); }

/* Column resize handle */
.tdb-col-resizer {
    position: absolute; right: 0; top: 0; bottom: 0;
    width: 5px; cursor: col-resize;
    background: transparent;
    transition: background .15s;
    z-index: 1;
}
.tdb-col-resizer:hover,
.tdb-col-resizer:active { background: var(--gold); opacity: .5; }
#tdbThead th { position: relative; }

/* ═══════════════════════════════════════════════════════════════
   TODO BOARD — MODERN REDESIGN OVERRIDE
   Rounded, sober, premium
═══════════════════════════════════════════════════════════════ */

/* ── Wrapper ─────────────────────────────────────────────────── */
#tabTodo .tdb-table-wrap {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.04);
    background: #fff;
}

/* ── Thead ───────────────────────────────────────────────────── */
#tabTodo .tdb-table thead tr th {
    background: #f9f9f7;
    border-bottom: 1px solid #ebebea;
    border-right: none;
    font-size: 10.5px;
    font-weight: 700;
    color: #a0a09a;
    letter-spacing: .06em;
    text-transform: uppercase;
}
#tabTodo th.tdb-col-check,
#tabTodo th.tdb-col-name {
    background: #f9f9f7;
}

/* ── Group row ───────────────────────────────────────────────── */
#tabTodo .tdb-group-row td {
    background: #f7f6f3;
    border-top: 8px solid #f0ede6;
    border-bottom: 1px solid #eeede9;
    padding: 8px 12px 7px;
}
#tabTodo .tdb-group-row:first-child td {
    border-top: none;
}
#tabTodo .tdb-group-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
#tabTodo .tdb-group-count {
    background: rgba(0,0,0,.06);
    color: #888;
    font-size: 9.5px;
    font-weight: 700;
    border-radius: 20px;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
}

/* ── Task rows ───────────────────────────────────────────────── */
#tabTodo .tdb-task-row {
    border-bottom: 1px solid #f2f1ee;
    transition: background .1s;
}
#tabTodo .tdb-task-row:hover {
    background: #faf9f7;
}
#tabTodo .tdb-task-row td {
    border-right: none;
}

/* ── Task name ───────────────────────────────────────────────── */
#tabTodo .tdb-name-text {
    font-size: 11.5px;
    font-weight: 400;
    color: #3a3935;
    letter-spacing: .01em;
}

/* ── Cells ───────────────────────────────────────────────────── */
#tabTodo .tdb-cell:hover {
    background: #f2f1ee;
    border-radius: 4px;
}

/* ── Status block ────────────────────────────────────────────── */
#tabTodo .tdb-status-block {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    opacity: .9;
}

/* ── Add row button ──────────────────────────────────────────── */
#tabTodo .tdb-group-add-row td {
    background: #f7f6f3;
    border-bottom: 1px solid #eeede9;
    padding: 4px 12px 4px 28px;
}
#tabTodo .tdb-add-row-btn {
    font-size: 11px;
    color: #b0aea8;
}
#tabTodo .tdb-add-row-btn:hover {
    color: var(--gold);
}

/* ── Board tabs ──────────────────────────────────────────────── */
#tabTodo .tdb-board-tab {
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    background: transparent;
    color: #888;
    transition: background .15s, color .15s;
}
#tabTodo .tdb-board-tab:hover {
    background: #f0ede6;
    color: #3a3935;
}
#tabTodo .tdb-board-tab.active {
    background: #2e2d2d;
    color: #fff;
    font-weight: 600;
}
#tabTodo .tdb-board-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

/* ── Action buttons ──────────────────────────────────────────── */
#tabTodo .tdb-action-btn {
    border-radius: 8px;
    border: 1px solid #e8e7e3;
    background: #fff;
    color: #555;
    font-size: 11.5px;
    font-weight: 500;
    padding: 5px 10px;
    gap: 5px;
    transition: background .12s, border-color .12s;
}
#tabTodo .tdb-action-btn:hover {
    background: #f7f6f3;
    border-color: #d5d4cf;
    color: #2e2d2d;
}

/* ── Board header title ──────────────────────────────────────── */
#tabTodo .tdb-board-title {
    font-size: 15px;
    font-weight: 700;
    color: #2e2d2d;
    letter-spacing: -.01em;
}

/* ── Topbar ──────────────────────────────────────────────────── */
#tabTodo .tdb-topbar {
    padding: 10px 16px;
    background: transparent;
    border-bottom: none;
    margin-bottom: 4px;
}
#tabTodo .tdb-board-header {
    padding: 8px 16px 10px;
    border-bottom: 1px solid #ebebea;
    background: #fff;
    border-radius: 12px 12px 0 0;
}

/* ── Comment badge ───────────────────────────────────────────── */
#tabTodo .tdb-comment-count.has-comments {
    background: #2e2d2d;
    color: #fff;
    border-radius: 20px;
    font-size: 9px;
    min-width: 15px;
    height: 15px;
}

/* ── Drag drop target ────────────────────────────────────────── */
#tabTodo .tdb-drop-target td {
    background: #fef9ec !important;
    border-top: 2px solid var(--gold) !important;
}

/* ── Col resize handle ───────────────────────────────────────── */
#tabTodo .tdb-col-resizer {
    width: 6px;
    border-radius: 2px;
    background: transparent;
}
#tabTodo th:hover .tdb-col-resizer {
    background: linear-gradient(to bottom, transparent 20%, #d6cfa8 30%, #d6cfa8 70%, transparent 80%);
    opacity: .55;
}
#tabTodo .tdb-col-resizer:hover {
    background: var(--gold) !important;
    opacity: 1 !important;
}
#tabTodo .tdb-col-resizer:active { background: var(--gold) !important; opacity: 1 !important; }


/* ═══════════════════════════════════════════════════════════════
   TODO BOARD — MODERN REDESIGN OVERRIDE
   Tout blanc, lignes fines, sobre
═══════════════════════════════════════════════════════════════ */

/* ── Wrapper ─────────────────────────────────────────────────── */
#tabTodo .tdb-table-wrap {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 0 1px #e8e7e3, 0 2px 8px rgba(0,0,0,.04);
    background: #fff;
}

/* ── Thead ───────────────────────────────────────────────────── */
#tabTodo .tdb-table thead tr th {
    background: #fff;
    border-bottom: 1px solid #e8e7e3;
    border-right: none;
    font-size: 10.5px;
    font-weight: 600;
    color: #b0aea8;
    letter-spacing: .05em;
    text-transform: uppercase;
}
#tabTodo th.tdb-col-check,
#tabTodo th.tdb-col-name { background: #fff; }

/* ── Group row ───────────────────────────────────────────────── */
#tabTodo .tdb-group-row td {
    background: #fff;
    border-top: 1px solid #e8e7e3;
    border-bottom: 1px solid #eeecea;
    padding: 10px 12px 8px;
    margin-top: 8px;
}
#tabTodo .tdb-group-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
#tabTodo .tdb-group-count {
    background: #f2f1ee;
    color: #999;
    font-size: 9.5px;
    font-weight: 700;
    border-radius: 20px;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
}

/* ── Task rows ───────────────────────────────────────────────── */
#tabTodo .tdb-task-row {
    border-bottom: 1px solid #f0efec;
    background: #fff;
}
#tabTodo .tdb-task-row:hover { background: #faf9f7; }
#tabTodo .tdb-task-row td { border-right: none; }

/* ── Task name ───────────────────────────────────────────────── */
#tabTodo .tdb-name-text {
    font-size: 11.5px;
    font-weight: 400;
    color: #3a3935;
    letter-spacing: .01em;
}

/* ── Cells ───────────────────────────────────────────────────── */
#tabTodo .tdb-cell { background: #fff; }
#tabTodo .tdb-cell:hover { background: #f7f6f3; border-radius: 4px; }

/* ── Status block ────────────────────────────────────────────── */
#tabTodo .tdb-status-block {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

/* ── Add row ─────────────────────────────────────────────────── */
#tabTodo .tdb-group-add-row td {
    background: #fff;
    border-bottom: 1px solid #f0efec;
    padding: 4px 12px 4px 28px;
}
#tabTodo .tdb-add-row-btn { font-size: 11px; color: #c0bfba; }
#tabTodo .tdb-add-row-btn:hover { color: var(--gold); }

/* ── Board tabs ──────────────────────────────────────────────── */
#tabTodo .tdb-board-tab {
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
    background: transparent;
    color: #999;
    transition: all .15s;
}
#tabTodo .tdb-board-tab:hover { background: #f0ede6; color: #3a3935; }
#tabTodo .tdb-board-tab.active {
    background: #2e2d2d;
    color: #fff;
    font-weight: 600;
    border-color: transparent;
}

/* ── Action buttons ──────────────────────────────────────────── */
#tabTodo .tdb-action-btn {
    border-radius: 8px;
    border: 1px solid #e4e3de;
    background: #fff;
    color: #666;
    font-size: 11.5px;
    font-weight: 500;
    padding: 5px 10px;
    gap: 5px;
    transition: all .12s;
}
#tabTodo .tdb-action-btn:hover {
    background: #faf9f7;
    border-color: #ccc;
    color: #2e2d2d;
}

/* ── Board header ────────────────────────────────────────────── */
#tabTodo .tdb-board-title {
    font-size: 15px;
    font-weight: 700;
    color: #2e2d2d;
    letter-spacing: -.01em;
}
#tabTodo .tdb-board-header {
    padding: 10px 16px 10px;
    border-bottom: 1px solid #e8e7e3;
    background: #fff;
    border-radius: 10px 10px 0 0;
}

/* ── Topbar ──────────────────────────────────────────────────── */
#tabTodo .tdb-topbar {
    padding: 10px 0 8px;
    background: transparent;
    border-bottom: none;
}

/* ── Comment badge ───────────────────────────────────────────── */
#tabTodo .tdb-comment-count.has-comments {
    background: #2e2d2d;
    color: #fff;
    border-radius: 20px;
    font-size: 9px;
    min-width: 15px;
    height: 15px;
}

/* ── Drop target ─────────────────────────────────────────────── */
#tabTodo .tdb-drop-target td {
    background: #fffbf0 !important;
    border-top: 2px solid var(--gold) !important;
}

/* ── Separateur entre groupes ────────────────────────────────── */
#tabTodo .tdb-group-row + .tdb-group-row td,
#tabTodo .tdb-group-add-row + .tdb-group-row td {
    border-top: 16px solid #f5f4f0;
}

/* ── Done button ─────────────────────────────────────────────────── */
#tabTodo .tdb-done-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid #e4e3de;
    border-radius: 20px;
    background: #fff;
    color: #b0aea8;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: all .12s;
    padding: 0;
    margin-left: 6px;
}
#tabTodo .tdb-task-row:hover .tdb-cell-date .tdb-done-btn { display: inline-flex; }
#tabTodo .tdb-done-btn:hover { background: #2e2d2d; color: #fff; border-color: #2e2d2d; transform: rotate(25deg); }
#tabTodo .tdb-cell-date { gap: 0; }

/* ── Recurrence cell ─────────────────────────────────────────────── */
#tabTodo .tdb-recur-label {
    font-size: 10px;
    font-weight: 600;
    color: #7c6f5c;
    letter-spacing: .02em;
    white-space: nowrap;
}
#tabTodo .tdb-cell-recurrence {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 24px;
    padding: 0 6px;
}
#tabTodo .tdb-cell-recurrence:hover { background: #f7f6f3; border-radius: 4px; }

/* ── Column header name (darker + centered) ──────────────────────────────── */
#tabTodo .tdb-table thead tr th {
    color: #4a4845;
    text-align: center;
}
#tabTodo .tdb-th-inner {
    justify-content: center;
}
#tabTodo .tdb-th-name {
    justify-content: flex-start;
}
#tabTodo .tdb-col-name-label {
    cursor: default;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#tabTodo .tdb-col-name-label:hover {
    text-decoration: underline dotted #b0aea8;
}

/* ── Column drag reorder ─────────────────────────────────────────────────── */
#tabTodo th[draggable="true"] { cursor: grab; }
#tabTodo th.tdb-col-dragging  { opacity: .45; }
#tabTodo th.tdb-col-drag-over { box-shadow: inset 2px 0 0 var(--gold); }

/* ── Center cell data ────────────────────────────────────────────────────── */
#tabTodo .tdb-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
#tabTodo .tdb-cell .tdb-date,
#tabTodo .tdb-cell .tdb-person,
#tabTodo .tdb-cell span {
    text-align: center;
}

/* ── Inline rename ✎ button visibility on hover ──────────────────────── */
#tabTodo .tdb-col-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    color: #b0aea8;
    opacity: 0;
    transition: opacity .12s, color .12s, background .12s;
    flex-shrink: 0;
    font-size: 11px;
    line-height: 1;
    border-radius: 3px;
}
#tabTodo .tdb-col-config-btn { margin-left: auto; }
#tabTodo th:hover .tdb-col-edit-btn,
#tabTodo th:focus-within .tdb-col-edit-btn { opacity: 1; color: #2e2d2d; }
#tabTodo .tdb-col-edit-btn:hover { background: #f0ede6; color: #000; }

/* ── Done ↻ button: always visible on date cell ──────────────────────── */
#tabTodo .tdb-done-btn { display: inline-flex !important; }

/* ── Restore vertical scroll on todo board (override sealed wrapper) ── */
#tabTodo .tdb-table-wrap {
    overflow: auto !important;
    max-height: calc(100vh - 220px);
}

/* ── Wider task title column (default; resizable, not locked) ───────── */
#tabTodo th.tdb-col-name,
#tabTodo td.tdb-td-name {
    width: 320px;
    min-width: 100px;
    max-width: none;
    overflow: hidden;
}

/* ── Tighter checkbox column (50% padding reduction) ─────────────────── */
#tabTodo th.tdb-col-check,
#tabTodo td.tdb-td-check {
    width: 16px !important;
    min-width: 16px !important;
    padding: 0 !important;
}
#tabTodo td.tdb-td-name { left: 16px !important; }
#tabTodo th.tdb-col-name { left: 16px !important; }
#tabTodo .tdb-check-cell {
    padding: 0 2px;
    gap: 0;
}
#tabTodo .tdb-check-cell .tdb-check {
    margin: 0;
}
#tabTodo .tdb-check-cell .tdb-task-drag-handle { display: none; }

/* ── Sticky / locked headers ─────────────────────────────────────────── */
/* Column header row stays at top of the scrolling table-wrap */
#tabTodo .tdb-table thead tr th {
    position: sticky !important;
    top: 0 !important;
    z-index: 20;
    box-shadow: 0 2px 0 0 #ebebea, 0 4px 8px -4px rgba(0,0,0,0.06);
}
/* Sticky-left header cells need a higher z so they cover both axes */
#tabTodo th.tdb-col-check,
#tabTodo th.tdb-col-name { z-index: 22 !important; }

/* Group header rows stick just below the column header while their tasks scroll */
#tabTodo .tdb-group-row td {
    position: sticky;
    top: 32px;     /* matches thead height */
    z-index: 12;
    background: #fff !important;
    box-shadow: 0 1px 0 0 #f0ede6;
}
#tabTodo .tdb-group-add-row td { position: relative; z-index: 1; }

/* ═══════════════════════════════════════════════════════════════
   Modern calendar widget (date / deadline picker)
═══════════════════════════════════════════════════════════════ */
.tdb-cal {
    width: 280px;
    padding: 14px;
    font-family: 'Inter', sans-serif;
    user-select: none;
}
.tdb-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.tdb-cal-title {
    font-size: 13px;
    font-weight: 700;
    color: #2e2d2d;
    letter-spacing: -0.2px;
    text-transform: capitalize;
}
.tdb-cal-nav {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: #6b6a66;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.tdb-cal-nav:hover { background: #f0ede6; color: #2e2d2d; }

.tdb-cal-range-info {
    font-size: 11px;
    color: #6b6a66;
    background: #f9f7f0;
    border-radius: 6px;
    padding: 6px 8px;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 600;
}
.tdb-cal-range-info .tdb-cal-active-step { color: var(--gold,#c9a84c); }

.tdb-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}
.tdb-cal-weekdays span {
    text-align: center;
    font-size: 10.5px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    padding: 4px 0;
}

.tdb-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.tdb-cal-day {
    width: 100%;
    aspect-ratio: 1;
    border: none;
    background: transparent;
    color: #2e2d2d;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: background .1s, color .1s, transform .08s;
    font-family: inherit;
}
.tdb-cal-day:hover:not(:disabled) { background: #f0ede6; }
.tdb-cal-day-out { color: transparent; cursor: default; pointer-events: none; }
.tdb-cal-today {
    color: var(--gold,#c9a84c);
    font-weight: 800;
    box-shadow: inset 0 0 0 1.5px var(--gold,#c9a84c);
}
.tdb-cal-selected,
.tdb-cal-day.tdb-cal-selected:hover {
    background: var(--gold,#c9a84c) !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(201,168,76,0.35);
}
.tdb-cal-range { background: rgba(201,168,76,0.18); color: #2e2d2d; }

.tdb-cal-footer {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f0ede6;
}
.tdb-cal-btn {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e4e3de;
    background: #fff;
    color: #2e2d2d;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
    font-family: inherit;
}
.tdb-cal-btn:hover { background: #f0ede6; }
.tdb-cal-today-btn {
    border-color: var(--gold,#c9a84c);
    color: var(--gold,#c9a84c);
    font-weight: 700;
}
.tdb-cal-today-btn:hover {
    background: var(--gold,#c9a84c);
    color: #fff;
}
.tdb-cal-clear { color: #ef4444; }
.tdb-cal-clear:hover { background: #fef2f2; border-color: #fecaca; }

/* ═══════════════════════════════════════════════════════════════
   Color palette swatch + popover (used in column settings)
═══════════════════════════════════════════════════════════════ */
.tdb-color-swatch {
    width: 26px;
    height: 26px;
    border: 2px solid #fff;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 0 0 1px #e4e3de, 0 1px 3px rgba(0,0,0,0.06);
    flex-shrink: 0;
    padding: 0;
    transition: transform .12s, box-shadow .12s;
}
.tdb-color-swatch:hover {
    transform: scale(1.08);
    box-shadow: 0 0 0 2px var(--gold,#c9a84c), 0 2px 6px rgba(0,0,0,0.1);
}

.tdb-palette-pop {
    position: fixed;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
    z-index: 10000;
    width: 220px;
}
.tdb-palette-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}
.tdb-palette-tile {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    padding: 0;
    transition: transform .1s, border-color .1s;
}
.tdb-palette-tile:hover {
    transform: scale(1.12);
    border-color: #2e2d2d;
}
.tdb-palette-custom {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0ede6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11.5px;
    color: #6b6a66;
    font-weight: 600;
}
.tdb-palette-custom input[type="color"] {
    width: 36px;
    height: 28px;
    padding: 0;
    border: 1px solid #e4e3de;
    border-radius: 5px;
    cursor: pointer;
    background: #fff;
}

/* Status presets — modern visual cards with live color preview */
.tdb-status-presets {
    margin-bottom: 16px;
    padding: 14px;
    background: linear-gradient(180deg, #faf8f3 0%, #f5f2eb 100%);
    border: 1px solid #ece7dc;
    border-radius: 10px;
}
.tdb-status-presets-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}
.tdb-status-presets-label {
    font-size: 12px;
    font-weight: 700;
    color: #2e2d2d;
    letter-spacing: -0.01em;
}
.tdb-status-presets-hint {
    font-size: 10.5px;
    color: #94a3b8;
    font-weight: 500;
    font-style: italic;
}
.tdb-status-presets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.tdb-preset-card {
    background: #fff;
    border: 1px solid #ece7dc;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: transform .12s, border-color .12s, box-shadow .12s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tdb-preset-card:hover {
    transform: translateY(-1px);
    border-color: var(--gold,#c9a84c);
    box-shadow: 0 4px 12px rgba(201,168,76,0.15), 0 0 0 1px var(--gold,#c9a84c);
}
.tdb-preset-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.tdb-preset-card-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #2e2d2d;
}
.tdb-preset-card-count {
    font-size: 10px;
    font-weight: 700;
    color: #b0aea8;
    background: #f5f2eb;
    border-radius: 99px;
    padding: 2px 7px;
    letter-spacing: .03em;
}
.tdb-preset-card:hover .tdb-preset-card-count {
    background: var(--gold,#c9a84c);
    color: #fff;
}
.tdb-preset-card-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}
.tdb-preset-pill {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Date cell: dates centered with monospace digits for cross-row alignment */
#tabTodo .tdb-cell-date {
    justify-content: center;
}
#tabTodo .tdb-cell-date .tdb-date {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Auto-status pill icon */
#tabTodo .tdb-auto-icon {
    margin-right: 4px;
    font-size: 11px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

/* Dedicated "Action" column — sits right after the auto_status column */
#tabTodo th.tdb-col-action,
#tabTodo td.tdb-td-action {
    width: 96px;
    min-width: 96px;
    text-align: center;
    padding: 0;
    background: #fafaf7;
}
#tabTodo .tdb-action-empty { color: #d1d5db; font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════
   Archives modal
═══════════════════════════════════════════════════════════════ */
.tdb-arch-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.tdb-arch-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 1100px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    overflow: hidden;
}
.tdb-arch-header {
    background: #2e2d2d;
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tdb-arch-title-main {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.tdb-arch-sub {
    font-size: 11.5px;
    color: #c9c5b8;
    margin-top: 2px;
}
.tdb-arch-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}
.tdb-arch-close:hover { color: #fff; }

.tdb-arch-body {
    overflow: auto;
    padding: 0;
    flex: 1;
}
.tdb-arch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.tdb-arch-table thead th {
    position: sticky;
    top: 0;
    background: #f9f9f7;
    color: #94a3b8;
    text-transform: uppercase;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #ebebea;
    z-index: 1;
}
.tdb-arch-row td {
    padding: 10px 12px;
    border-bottom: 1px solid #f4f1ea;
    vertical-align: middle;
}
.tdb-arch-row:hover td { background: #fafaf9; }
.tdb-arch-name { display: flex; flex-direction: column; gap: 2px; min-width: 220px; }
.tdb-arch-title { font-size: 13px; font-weight: 600; color: #2e2d2d; }
.tdb-arch-meta { font-size: 10.5px; color: #94a3b8; font-style: italic; }
.tdb-arch-cell { color: #4a4845; font-size: 12px; }
.tdb-arch-actions { white-space: nowrap; text-align: right; }
.tdb-arch-btn {
    border: 1px solid #e4e3de;
    background: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 4px;
    font-family: inherit;
    transition: background .12s, color .12s, border-color .12s;
}
.tdb-arch-btn.tdb-arch-restore { color: var(--gold,#c9a84c); border-color: var(--gold,#c9a84c); }
.tdb-arch-btn.tdb-arch-restore:hover { background: var(--gold,#c9a84c); color: #fff; }
.tdb-arch-btn.tdb-arch-delete { color: #ef4444; border-color: #fecaca; }
.tdb-arch-btn.tdb-arch-delete:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

.tdb-arch-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-style: italic;
}

/* Archive count badge in board header */
.tdb-archive-count {
    display: inline-block;
    margin-left: 6px;
    background: var(--gold,#c9a84c);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 99px;
    padding: 1px 7px;
    line-height: 1.4;
}

/* Done button (used in Action column) */
#tabTodo .tdb-done-btn-auto {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 12px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #2e2d2d;
    background: #fff;
    border: 1px solid #e4e3de;
    border-radius: 6px;
    cursor: pointer;
    width: auto !important;
    transition: background .12s, color .12s, border-color .12s, transform .08s;
    flex-shrink: 0;
    line-height: 1;
    font-family: inherit;
}
#tabTodo .tdb-done-btn-auto:hover {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(34,197,94,0.2);
}

/* Auto-status rule editor rows */
.tdb-auto-rule-header {
    display: grid;
    grid-template-columns: 32px 32px 1.4fr 1.6fr 70px 24px;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    color: #b0aea8;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 4px;
}
.tdb-auto-rule-header > span { text-align: center; }
.tdb-auto-rule-header > span:nth-child(3),
.tdb-auto-rule-header > span:nth-child(4) { text-align: left; padding-left: 4px; }

.tdb-auto-rules { display: flex; flex-direction: column; gap: 8px; }
.tdb-auto-rule-row {
    display: grid;
    grid-template-columns: 32px 32px 1.4fr 1.6fr 70px 24px;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #ece7dc;
    border-radius: 8px;
    transition: border-color .12s, box-shadow .12s;
}
.tdb-auto-rule-row:hover {
    border-color: #d6d0c1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.tdb-auto-rule-row .tdb-auto-rule-label {
    min-width: 0;
    padding: 6px 10px;
    font-size: 12.5px;
    border: 1px solid #e4e3de;
    border-radius: 6px;
    font-family: inherit;
    color: #2e2d2d;
    width: 100%;
    box-sizing: border-box;
}
.tdb-auto-rule-row .tdb-auto-rule-label:focus { outline: none; border-color: var(--gold,#c9a84c); }
.tdb-auto-rule-row .tdb-auto-rule-trigger {
    min-width: 0;
    padding: 6px 8px;
    font-size: 12px;
    border: 1px solid #e4e3de;
    border-radius: 6px;
    background: #fff;
    color: #2e2d2d;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
}
.tdb-auto-rule-row .tdb-auto-rule-n {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #e4e3de;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    text-align: center;
}
.tdb-auto-rule-row .tdb-auto-rule-color { width: 32px; height: 32px; }
.tdb-auto-rule-row .tdb-auto-rule-icon  { width: 32px; height: 32px; }

/* Icon swatch button (replaces dropdown) */
.tdb-icon-swatch {
    width: 32px;
    height: 32px;
    border: 1px solid #ece7dc;
    background: #fff;
    border-radius: 7px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: border-color .12s, background .12s, transform .1s;
}
.tdb-icon-swatch:hover {
    border-color: var(--gold,#c9a84c);
    background: #faf8f3;
    transform: scale(1.04);
}
.tdb-icon-swatch .tdb-icon-empty { color: #cbd5e1; font-size: 14px; }

/* Picker icon shown left of the label in status options */
.tdb-picker-icon {
    display: inline-block;
    margin-right: 6px;
    font-size: 13px;
    line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════
   Filter bar (above the board table)
═══════════════════════════════════════════════════════════════ */
#tabTodo .tdb-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 10px 14px;
    margin: 8px 0 12px;
    background: #fff;
    border: 1px solid #ece7dc;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
#tabTodo .tdb-filter-bar:empty { display: none; }

#tabTodo .tdb-filter-search {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #faf8f3;
    border: 1px solid #ece7dc;
    border-radius: 7px;
    padding: 4px 10px;
    flex: 0 1 280px;
    color: #94a3b8;
    transition: border-color .12s, background .12s;
}
#tabTodo .tdb-filter-search:focus-within {
    border-color: var(--gold,#c9a84c);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}
#tabTodo .tdb-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 12.5px;
    color: #2e2d2d;
    padding: 4px 0;
}
#tabTodo .tdb-search-input::placeholder { color: #b0aea8; }
#tabTodo .tdb-search-clear {
    flex: 0 0 auto;
    background: #e9e4d6;
    border: none;
    color: #6b6963;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .12s, color .12s;
}
#tabTodo .tdb-search-clear:hover {
    background: var(--gold,#c9a84c);
    color: #fff;
}

#tabTodo .tdb-filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}
#tabTodo .tdb-filter-label {
    font-size: 10.5px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-right: 2px;
}
#tabTodo .tdb-filter-empty {
    font-size: 11.5px;
    color: #cbd5e1;
    font-style: italic;
}
#tabTodo .tdb-filter-dot,
.tdb-filter-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

#tabTodo .tdb-filter-chip {
    background: #fff;
    border: 1px solid #ece7dc;
    color: #4a4845;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s, color .12s, border-color .12s, transform .08s;
    line-height: 1.4;
}
#tabTodo .tdb-filter-chip:hover {
    border-color: var(--gold,#c9a84c);
    color: var(--gold,#c9a84c);
}
#tabTodo .tdb-filter-chip.active {
    background: var(--gold,#c9a84c);
    color: #fff;
    border-color: var(--gold,#c9a84c);
    box-shadow: 0 1px 3px rgba(201,168,76,0.25);
}

#tabTodo .tdb-filter-reset {
    margin-left: auto;
    background: transparent;
    border: 1px solid #fecaca;
    color: #ef4444;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s, color .12s;
}
#tabTodo .tdb-filter-reset:hover { background: #ef4444; color: #fff; }

/* Filtre par colonne */
#tabTodo .tdb-colfilter-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px dashed #d4cdb8;
    color: #6b6963;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .12s, color .12s, background .12s;
}
#tabTodo .tdb-colfilter-btn:hover {
    border-color: var(--gold,#c9a84c);
    color: var(--gold,#c9a84c);
    border-style: solid;
}
#tabTodo .tdb-colfilter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}
.tdb-colfilter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(201,168,76,0.10);
    border: 1px solid rgba(201,168,76,0.30);
    color: #2e2d2d;
    padding: 3px 4px 3px 9px;
    border-radius: 6px;
    font-size: 11.5px;
    cursor: pointer;
    transition: background .12s;
}
.tdb-colfilter-pill:hover { background: rgba(201,168,76,0.18); }
.tdb-colfilter-pill-name { font-weight: 700; color: var(--gold,#a58539); }
.tdb-colfilter-pill-name::after { content: ' :'; }
.tdb-colfilter-pill-vals { color: #4a4845; }
.tdb-colfilter-pill-x {
    background: transparent;
    border: none;
    color: #6b6963;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background .12s, color .12s;
}
.tdb-colfilter-pill-x:hover { background: #ef4444; color: #fff; }

.tdb-colfilter-pop {
    position: fixed;
    z-index: 10000;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0,0,0,.18);
    border: 1px solid #ece7dc;
    min-width: 260px;
    max-width: 360px;
    padding: 8px;
    font-size: 12.5px;
    color: #2e2d2d;
}
.tdb-colfilter-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px 8px;
    border-bottom: 1px solid #f1efeb;
    margin-bottom: 8px;
}
.tdb-colfilter-back {
    background: transparent;
    border: none;
    color: #6b6963;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.tdb-colfilter-back:hover { background: #f4f1e9; color: var(--gold,#a58539); }
.tdb-colfilter-title {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .04em;
    flex: 1;
    padding: 4px 6px;
}
.tdb-colfilter-clear {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 5px;
    font-family: inherit;
}
.tdb-colfilter-clear:hover { background: #fee2e2; }

.tdb-colfilter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .1s;
}
.tdb-colfilter-row:hover { background: #faf6e9; }
.tdb-colfilter-name { font-weight: 500; color: #2e2d2d; }
.tdb-colfilter-tag {
    font-size: 10px;
    color: #b0aea8;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.tdb-colfilter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0 4px 4px;
    max-height: 280px;
    overflow-y: auto;
}
.tdb-colfilter-chip {
    background: #fff;
    border: 1px solid #ece7dc;
    color: #4a4845;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .12s, background .12s, color .12s;
}
.tdb-colfilter-chip:hover { border-color: var(--gold,#c9a84c); }
.tdb-colfilter-chip.active {
    background: var(--gold,#c9a84c);
    border-color: var(--gold,#c9a84c);
    color: #fff;
    font-weight: 600;
}
.tdb-colfilter-chip-empty { font-style: italic; opacity: .85; }
.tdb-colfilter-empty {
    color: #cbd5e1;
    font-style: italic;
    padding: 8px 10px;
    font-size: 11.5px;
}

/* Export menu popover */
.tdb-export-pop {
    position: fixed;
    z-index: 10000;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0,0,0,.18);
    border: 1px solid #ece7dc;
    min-width: 240px;
    padding: 8px;
    font-size: 12.5px;
}
.tdb-export-title {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 4px 8px 8px;
    border-bottom: 1px solid #f1efeb;
    margin-bottom: 6px;
}
.tdb-export-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
    font-family: inherit;
    color: #2e2d2d;
    transition: background .1s;
}
.tdb-export-row:hover { background: #faf6e9; }
.tdb-export-row-name { font-weight: 600; font-size: 12.5px; }
.tdb-export-row-meta { font-size: 11px; color: #94a3b8; }

/* Icon palette popover */
.tdb-icon-pop {
    position: fixed;
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
    z-index: 10000;
    width: 260px;
}
.tdb-icon-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}
.tdb-icon-tile {
    aspect-ratio: 1;
    border: 1px solid transparent;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color .1s, background .1s, transform .08s;
}
.tdb-icon-tile:hover {
    background: #faf8f3;
    border-color: #ece7dc;
    transform: scale(1.1);
}
.tdb-icon-tile-active {
    background: var(--gold,#c9a84c) !important;
    border-color: var(--gold,#c9a84c) !important;
    color: #fff;
}
.tdb-icon-tile-none .tdb-icon-empty { color: #cbd5e1; font-size: 14px; }
.tdb-auto-rule-n { flex-shrink: 0; }
.tdb-auto-rule-del {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.tdb-auto-rule-del:hover { color: #ef4444; }

/* Status option row alignment with the new swatch */
.tdb-status-option-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.tdb-status-option-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #e4e3de;
    border-radius: 6px;
    font-size: 12.5px;
    font-family: inherit;
    color: #2e2d2d;
}
.tdb-status-option-input:focus { outline: none; border-color: var(--gold,#c9a84c); }

/* Generic "Effacer" button used in non-status pickers (link/text/tags/number) */
.tdb-picker-clear-btn {
    border: 1px solid #fecaca;
    background: #fff;
    color: #ef4444;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s, color .12s;
}
.tdb-picker-clear-btn:hover { background: #ef4444; color: #fff; }
.tdb-cal-ok {
    background: #2e2d2d;
    color: #fff;
    border-color: #2e2d2d;
}
.tdb-cal-ok:hover { background: #1a1a1a; border-color: #1a1a1a; }

/* ── Modern thin column dividers ─────────────────────────────────────── */
#tabTodo .tdb-table thead tr th,
#tabTodo .tdb-task-row td {
    border-right: 1px solid #f1efeb !important;
}
/* No divider on the last column (actions "+") */
#tabTodo .tdb-table thead tr th.tdb-col-actions,
#tabTodo .tdb-task-row td:last-child {
    border-right: none !important;
}
/* Slightly stronger divider after the sticky-left columns to mark the boundary */
#tabTodo .tdb-table thead tr th.tdb-col-name,
#tabTodo .tdb-task-row td.tdb-td-name {
    border-right: 1px solid #e6e3dc !important;
}
#tabTodo .tdb-name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    max-width: none !important;
}
/* Inline rename input must follow the column width too */
#tabTodo .tdb-name-cell .tdb-inline-input {
    flex: 1;
    min-width: 0;
    max-width: none !important;
    width: 100%;
}
/* Resize handle on the "Tâche" column is the only sibling, sits flush right */
#tabTodo th.tdb-col-name .tdb-col-resizer {
    right: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    z-index: 12;
}
#tabTodo th.tdb-col-name:hover .tdb-col-resizer {
    background: linear-gradient(to bottom, transparent 20%, #d6cfa8 30%, #d6cfa8 70%, transparent 80%);
    opacity: .55;
}
#tabTodo th.tdb-col-name .tdb-col-resizer:hover {
    background: var(--gold, #c9a84c) !important;
    opacity: 1 !important;
}

/* ── Task drag-and-drop handle + indicators ─────────────────────────── */
#tabTodo .tdb-task-row { cursor: grab; }
#tabTodo .tdb-task-row.tdb-task-dragging { opacity: .4; cursor: grabbing; }
#tabTodo .tdb-task-row:hover { cursor: grab; }
#tabTodo .tdb-task-drag-handle {
    color: #d6d3cc;
    font-size: 11px;
    line-height: 1;
    letter-spacing: -2px;
    margin-right: 2px;
    cursor: grab;
    user-select: none;
    opacity: 0;
    transition: opacity .12s;
}
#tabTodo .tdb-task-row:hover .tdb-task-drag-handle { opacity: 1; }
#tabTodo .tdb-task-drag-handle:hover { color: var(--gold,#c9a84c); }

/* Drop position indicators */
#tabTodo .tdb-task-row.tdb-task-drop-above td { box-shadow: inset 0 2px 0 0 var(--gold, #c9a84c); }
#tabTodo .tdb-task-row.tdb-task-drop-below td { box-shadow: inset 0 -2px 0 0 var(--gold, #c9a84c); }
#tabTodo .tdb-group-row.tdb-drop-target td {
    background: rgba(201,168,76,0.08) !important;
    box-shadow: inset 0 0 0 2px var(--gold, #c9a84c);
}

/* ── Selected task row ───────────────────────────────────────────────── */
#tabTodo .tdb-task-row.tdb-task-selected td {
    background: rgba(201,168,76,0.12) !important;
}
#tabTodo .tdb-task-row.tdb-task-selected td.tdb-td-name {
    box-shadow: inset 3px 0 0 0 var(--gold, #c9a84c);
}

/* ── Bulk action bar ─────────────────────────────────────────────────── */
.tdb-bulk-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #2e2d2d;
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.25), 0 2px 8px rgba(0,0,0,0.15);
    z-index: 200;
    font-size: 12.5px;
    font-weight: 600;
    animation: tdbBulkBarIn .18s ease-out;
}
@keyframes tdbBulkBarIn {
    from { opacity: 0; transform: translate(-50%, 12px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}
.tdb-bulk-bar .tdb-bulk-count {
    padding: 0 12px 0 4px;
    color: var(--gold, #c9a84c);
    font-weight: 700;
    white-space: nowrap;
}
.tdb-bulk-bar .tdb-bulk-divider {
    width: 1px;
    height: 22px;
    background: rgba(255,255,255,0.15);
    margin: 0 4px;
}
.tdb-bulk-bar .tdb-bulk-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    color: #e4e3de;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    transition: background .12s, color .12s, border-color .12s;
    white-space: nowrap;
}
.tdb-bulk-bar .tdb-bulk-btn:hover {
    background: rgba(201,168,76,0.18);
    color: var(--gold, #c9a84c);
    border-color: var(--gold, #c9a84c);
}
.tdb-bulk-bar .tdb-bulk-btn.tdb-bulk-warn:hover {
    background: rgba(245,158,11,0.2);
    color: #fbbf24;
    border-color: #fbbf24;
}
.tdb-bulk-bar .tdb-bulk-btn.tdb-bulk-danger:hover {
    background: rgba(239,68,68,0.2);
    color: #fca5a5;
    border-color: #ef4444;
}
.tdb-bulk-bar .tdb-bulk-btn.tdb-bulk-ghost {
    border: none;
    background: transparent;
    color: #94a3b8;
    padding: 6px 8px;
    font-size: 16px;
}
.tdb-bulk-bar .tdb-bulk-btn.tdb-bulk-ghost:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

/* Bulk popover */
.tdb-bulk-pop {
    position: fixed;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.04);
    padding: 10px;
    min-width: 180px;
    max-width: 260px;
    max-height: 360px;
    overflow: auto;
    z-index: 201;
    font-size: 12.5px;
    animation: tdbBulkBarIn .15s ease-out;
}
.tdb-bulk-pop-title {
    font-size: 10.5px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 4px 8px 8px;
    border-bottom: 1px solid #f0ede6;
    margin-bottom: 6px;
}
.tdb-bulk-pop-body { display: flex; flex-direction: column; gap: 4px; }
.tdb-bulk-pop-item {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #2e2d2d;
    font-weight: 600;
    font-size: 12.5px;
    transition: background .1s, transform .08s;
    user-select: none;
}
.tdb-bulk-pop-item:hover { transform: translateX(2px); }
.tdb-bulk-pop-item:not([style*="background:"]):hover { background: #f0ede6; }
.tdb-bulk-pop-clear {
    color: #ef4444 !important;
    background: transparent !important;
    border-top: 1px solid #f0ede6;
    margin-top: 4px;
    padding-top: 8px;
    border-radius: 0;
}
.tdb-bulk-pop-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e4e3de;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: #2e2d2d;
    box-sizing: border-box;
}
.tdb-bulk-pop-input:focus { outline: none; border-color: var(--gold, #c9a84c); }

/* ═══════════════════════════════════════════════════════════════
   TOP APP SWITCHER (Outils Market / Newsletters / TO DO)
═══════════════════════════════════════════════════════════════ */
.app-switcher {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: stretch;
    gap: 0;
    background: #2e2d2d;
    border-bottom: 1px solid #1a1a1a;
    padding: 0 24px;
    height: 44px;
}
.app-switcher .app-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    color: #c9c5b8;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .02em;
    border: none;
    background: transparent;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s, background .15s;
    white-space: nowrap;
}
.app-switcher .app-tab svg { opacity: .85; }
.app-switcher .app-tab:hover {
    color: #fff;
    background: rgba(255,255,255,0.04);
}
.app-switcher .app-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
    background: rgba(201,168,76,0.08);
}
.app-switcher .app-tab.active svg { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════
   NEWSLETTERS APP — Pages & placeholders
═══════════════════════════════════════════════════════════════ */
.nls-page {
    padding: 32px;
    max-width: 1200px;
}
.nls-page-header {
    margin-bottom: 28px;
}
.nls-page-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text, #2e2d2d);
    letter-spacing: -0.3px;
    margin: 0 0 6px 0;
}
.nls-page-header p {
    font-size: 13px;
    color: var(--text-muted, #94a3b8);
    margin: 0;
}
.nls-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px dashed #e4e3de;
    border-radius: 12px;
    color: #94a3b8;
}
.nls-empty svg {
    color: var(--gold, #c9a84c);
    margin-bottom: 16px;
    opacity: .55;
}
.nls-empty h3 {
    font-size: 16px;
    font-weight: 700;
    color: #4a4845;
    margin: 0 0 6px 0;
}
.nls-empty p {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

/* ── Center column title; pin edit buttons to the right edge ─────────── */
#tabTodo .tdb-col-rename-btn,
#tabTodo .tdb-col-config-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
}
#tabTodo .tdb-col-rename-btn { right: 22px; }
#tabTodo .tdb-col-config-btn { right: 4px; }
#tabTodo .tdb-th-inner {
    justify-content: center !important;
    padding-left: 38px;
    padding-right: 38px;
}
/* "Tâche" header stays left-aligned (matches names below) */
#tabTodo .tdb-th-name {
    justify-content: flex-start !important;
    padding-left: 6px;
    padding-right: 6px;
}
