/* ═══════════════════════════════════════════════════════════════════════════════
   VARIABLES & RESET — Light Theme (default)
   ═══════════════════════════════════════════════════════════════════════════════ */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --info: #6366f1;
  --info-light: #e0e7ff;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #1A1F36;
  --text: #1e293b;
  --text-light: #475569;  /* AAA contraste 7.1:1 */
  --text-sidebar: #e2e8f0;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --radius: 10px;
  --sidebar-w: 260px;
  --topbar-h: 56px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DARK THEME
   ═══════════════════════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-sidebar: #020617;
  --text: #e2e8f0;
  --text-light: #cbd5e1;  /* Meilleur contraste sur fond sombre */
  --text-sidebar: #cbd5e1;
  --border: #334155;
  --primary-light: #1e3a5f;
  --danger-light: #451a1a;
  --success-light: #14342b;
  --warning-light: #422006;
  --info-light: #272463;
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -2px rgba(0,0,0,.3);
}
[data-theme="dark"] th { background: #1a2332; }
[data-theme="dark"] tr:hover td { background: rgba(37,99,235,.08); }
[data-theme="dark"] .btn-outline { border-color: var(--border); color: var(--text); }
[data-theme="dark"] .btn-outline:hover { background: #334155; border-color: var(--primary); color: #93c5fd; }
[data-theme="dark"] .form-control { background: #0f172a; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .filters select, [data-theme="dark"] .filters input { background: #0f172a; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .topbar-search input { background: #0f172a; color: var(--text); }
[data-theme="dark"] .alert-danger { background: #3b1111; color: #fca5a5; border-color: #7f1d1d; }
[data-theme="dark"] .alert-success { background: #0a2e1f; color: #6ee7b7; border-color: #065f46; }
[data-theme="dark"] .alert-warning { background: #2e1a05; color: #fcd34d; border-color: #92400e; }
[data-theme="dark"] .alert-info { background: #1a1847; color: #a5b4fc; border-color: #3730a3; }
[data-theme="dark"] .badge-primary { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .badge-success { background: #14342b; color: #6ee7b7; }
[data-theme="dark"] .badge-danger { background: #451a1a; color: #fca5a5; }
[data-theme="dark"] .badge-warning { background: #422006; color: #fcd34d; }
[data-theme="dark"] .badge-info { background: #272463; color: #a5b4fc; }
[data-theme="dark"] .badge-gray { background: #334155; color: #94a3b8; }
[data-theme="dark"] .chat-msg.assistant { background: #0f172a; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .pagination button { background: var(--bg-card); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .modal { background: var(--bg-card); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; transition: background .3s, color .3s; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font); cursor: pointer; border: none; }
input, select, textarea { font-family: var(--font); font-size: .9rem; }

/* ═══════════════════════════════════════════════════════════════════════════════
   SVG ICONS (Lucide-style)
   ═══════════════════════════════════════════════════════════════════════════════ */
.nav-item .icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-item .icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ═══════════════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════════════ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--bg-sidebar); color: var(--text-sidebar);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0;
  height: 100vh; z-index: 100; transition: transform .3s;
}
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: var(--topbar-h); background: var(--bg-card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow); transition: background .3s, border-color .3s;
}
.content { padding: 24px; flex: 1; }

/* Sidebar — Logo */
.sidebar-logo { padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: 12px; }
.sidebar-logo img { height: 36px; width: auto; }
.sidebar-logo-text { display: flex; flex-direction: column; }
.sidebar-logo-text h1 { font-size: 1.1rem; font-weight: 800; color: #fff; letter-spacing: -.3px; line-height: 1.1; }
.sidebar-logo-text span { font-size: .62rem; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section { padding: 8px 20px 4px; font-size: .65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: rgba(255,255,255,.35); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--text-sidebar);
  font-size: .85rem; font-weight: 500; transition: all .15s; cursor: pointer; border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(37,99,235,.22) 0%, rgba(37,99,235,.06) 100%); color: #93c5fd; border-left-color: #60a5fa; font-weight: 600; }
.nav-item .badge {
  margin-left: auto; background: var(--danger); color: #fff; font-size: .65rem;
  padding: 2px 7px; border-radius: 10px; font-weight: 700;
}
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1);
  font-size: .7rem; color: rgba(255,255,255,.3); text-align: center; }

/* Theme toggle in sidebar */
.theme-toggle { padding: 8px 20px; display: flex; align-items: center; gap: 10px; cursor: pointer;
  color: rgba(255,255,255,.5); font-size: .78rem; transition: color .15s; }
.theme-toggle:hover { color: #fff; }
.theme-toggle svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }

/* Topbar */
.topbar-title { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.topbar-search { margin-left: auto; position: relative; }
.topbar-search input {
  width: 300px; padding: 8px 12px 8px 36px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); font-size: .85rem; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.topbar-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.topbar-search::before { content: ''; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat center;
}
.topbar-status { margin-left: 16px; display: flex; align-items: center; gap: 6px; font-size: .75rem; }
.topbar-user { margin-left: 16px; display: flex; align-items: center; gap: 8px; }
.topbar-user-label { font-size: .78rem; color: var(--text-light); white-space: nowrap; }
.auth-blocked { filter: blur(1px); pointer-events: none; user-select: none; }
.auth-note { font-size: .8rem; color: var(--text-light); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.connected { background: var(--success); }
.status-dot.disconnected { background: var(--danger); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ═══════════════════════════════════════════════════════════════════════════════
   CARDS & KPIs
   ═══════════════════════════════════════════════════════════════════════════════ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px; transition: transform .15s, box-shadow .15s; cursor: pointer;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.kpi-icon.docs { background: var(--primary-light); }
.kpi-icon.sal { background: var(--success-light); }
.kpi-icon.contrats { background: var(--info-light); }
.kpi-icon.litiges { background: var(--danger-light); }
.kpi-icon.ech { background: var(--warning-light); }
.kpi-icon.factures { background: #fce7f3; }
[data-theme="dark"] .kpi-icon.factures { background: #3b1034; }
.kpi-icon.fourn { background: #e0e7ff; }
.kpi-icon.soc { background: #ccfbf1; }
[data-theme="dark"] .kpi-icon.soc { background: #0c2922; }
.kpi-value { font-size: 1.6rem; font-weight: 800; color: var(--text); line-height: 1; }
.kpi-label { font-size: .75rem; color: var(--text-light); margin-top: 2px; }

/* Cards */
.card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; transition: background .3s, box-shadow .3s; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex;
  align-items: center; justify-content: space-between; }
.card-header h2 { font-size: 1rem; font-weight: 700; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); text-align: right; }

/* ═══════════════════════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--bg); font-weight: 600; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-light); padding: 10px 12px; text-align: left;
  border-bottom: 2px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: .85rem; vertical-align: middle; }
tr:hover td { background: rgba(37,99,235,.03); }
tbody tr:nth-child(even) td { background: rgba(248,250,252,.55); }
[data-theme="dark"] tbody tr:nth-child(even) td { background: rgba(255,255,255,.02); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .7rem; font-weight: 600; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: var(--success-light); color: #065f46; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-info { background: var(--info-light); color: #3730a3; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* ═══════════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px;
  font-size: .8rem; font-weight: 600; transition: all .15s;
}
.btn-primary { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); color: #fff; box-shadow: 0 1px 3px rgba(37,99,235,.30), 0 4px 12px rgba(37,99,235,.18); }
.btn-primary:hover { background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%); transform: translateY(-1px); box-shadow: 0 2px 6px rgba(37,99,235,.35), 0 6px 16px rgba(37,99,235,.22); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 5px 10px; font-size: .72rem; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: flex; align-items: center;
  justify-content: center; border-radius: 8px; background: transparent; color: var(--text-light); }
.btn-icon:hover { background: var(--bg); color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.form-control {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: .85rem; outline: none; transition: border-color .2s; background: var(--bg-card); color: var(--text);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
textarea.form-control { min-height: 80px; resize: vertical; }
.password-wrap { position: relative; }
.password-wrap .form-control { padding-right: 42px; }
.password-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; color: var(--text-light); cursor: pointer; font-size: .95rem;
}
.password-toggle:hover { color: var(--primary); }
.auth-warning { font-size: .78rem; color: #b45309; margin-top: 6px; display: none; }

/* ═══════════════════════════════════════════════════════════════════════════════
   FILTERS BAR
   ═══════════════════════════════════════════════════════════════════════════════ */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filters select, .filters input { padding: 7px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: .8rem; outline: none; background: var(--bg-card); color: var(--text); }
.filters select:focus, .filters input:focus { border-color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════════════════════════ */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 16px; }
.pagination button { min-width: 36px; height: 36px; border-radius: 8px; font-size: .8rem; font-weight: 600;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text); }
.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: .4; cursor: default; }
.pagination-info { font-size: .75rem; color: var(--text-light); margin: 0 8px; }

/* ═══════════════════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200;
  display: flex; align-items: center; justify-content: center; opacity: 0;
  visibility: hidden; transition: all .2s;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-card); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 90%; max-width: 640px; max-height: 85vh; display: flex; flex-direction: column;
  transform: translateY(20px); transition: transform .2s;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex;
  align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex;
  justify-content: flex-end; gap: 8px; }

/* ═══════════════════════════════════════════════════════════════════════════════
   ALERT / TOAST / BANNER
   ═══════════════════════════════════════════════════════════════════════════════ */
.alert {
  padding: 12px 16px; border-radius: 8px; font-size: .85rem; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.alert-danger { background: var(--danger-light); color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #6ee7b7; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.alert-info { background: var(--info-light); color: #3730a3; border: 1px solid #a5b4fc; }

#toast-container {
  position: fixed; top: 70px; right: 24px; z-index: 999; display: flex;
  flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  padding: 12px 20px; border-radius: 10px; font-size: .85rem; font-weight: 500;
  box-shadow: var(--shadow-lg); pointer-events: auto; animation: toastIn .3s ease;
  display: flex; align-items: center; gap: 8px; max-width: 400px;
}
.toast-success { background: #065f46; color: #fff; }
.toast-error { background: #991b1b; color: #fff; }
.toast-info { background: #1e40af; color: #fff; }
.toast-warning { background: #92400e; color: #fff; }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ═══════════════════════════════════════════════════════════════════════════════
   LOADING / EMPTY
   ═══════════════════════════════════════════════════════════════════════════════ */
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { text-align: center; color: var(--text-light); font-size: .85rem; margin-top: 8px; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-light); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: .9rem; }

/* ═══════════════════════════════════════════════════════════════════════════════
   DETAIL VIEW
   ═══════════════════════════════════════════════════════════════════════════════ */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item label { font-size: .7rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: .5px; }
.detail-item .val { font-size: .9rem; margin-top: 2px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════════════════════════ */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 8px 16px; font-size: .8rem; font-weight: 600; color: var(--text-light);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════════════════════════════════════════ */
.progress-bar { width: 100%; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .5s ease; }

/* ═══════════════════════════════════════════════════════════════════════════════
   CHAT (IA)
   ═══════════════════════════════════════════════════════════════════════════════ */
.chat-messages { max-height: 500px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { padding: 10px 14px; border-radius: 12px; font-size: .85rem; max-width: 80%; line-height: 1.5; }
.chat-msg.user { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-msg.assistant { background: var(--bg); color: var(--text); align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid var(--border); }
.chat-input-row { display: flex; gap: 8px; padding: 16px; border-top: 1px solid var(--border); }
.chat-input-row input { flex: 1; }

/* ═══════════════════════════════════════════════════════════════════════════════
   ONBOARDING
   ═══════════════════════════════════════════════════════════════════════════════ */
.onboarding-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 300;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: all .3s;
}
.onboarding-overlay.show { opacity: 1; visibility: visible; }
.onboarding-card {
  background: var(--bg-card); border-radius: 20px; box-shadow: var(--shadow-lg);
  width: 90%; max-width: 560px; padding: 40px; text-align: center;
  transform: scale(.95); transition: transform .3s;
}
.onboarding-overlay.show .onboarding-card { transform: scale(1); }
.onboarding-card h2 { font-size: 1.5rem; font-weight: 800; margin: 16px 0 8px; }
.onboarding-card p { color: var(--text-light); font-size: .9rem; line-height: 1.6; margin-bottom: 24px; }
.onboarding-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; margin-bottom: 28px; }
.onboarding-step { padding: 14px; border-radius: 12px; border: 1px solid var(--border); }
.onboarding-step strong { font-size: .82rem; display: block; margin-bottom: 4px; }
.onboarding-step span { font-size: .75rem; color: var(--text-light); }

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .topbar-search input { width: 180px; }
  .form-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  #burger { display: flex !important; }
  .onboarding-steps { grid-template-columns: 1fr; }
}


@media (max-width: 480px) {
  /* Telephone : layout compact */
  .kpi-grid { grid-template-columns: 1fr; gap: 8px; }
  .topbar { flex-wrap: wrap; padding: 8px; gap: 8px; min-height: auto; }
  .topbar-search { flex: 1 1 100%; order: 3; }
  .topbar-search input { width: 100%; min-width: 0; }
  .topbar-user { font-size: .8rem; gap: 6px; }
  .topbar-user-label { display: none; }
  .main { padding: 12px 8px; }
  .content { padding: 0; }
  .card, .detail-card { padding: 12px; border-radius: 8px; }
  .modal-content { width: 95vw; max-height: 90vh; margin: 20px auto; }
  .modal-body { padding: 12px; }
  .form-row { gap: 12px; }
  /* Tables : scroll horizontal pour eviter debordement */
  .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 600px; font-size: .85rem; }
  th, td { padding: 6px 8px; }
  /* Boutons plus petits mais encore cliquables (44x44 min pour accessibilite) */
  .btn { padding: 10px 14px; font-size: .85rem; min-height: 44px; }
  .btn-sm { padding: 8px 10px; font-size: .75rem; min-height: 36px; }
  .onboarding-steps { grid-template-columns: 1fr; }
  /* Sidebar reste cachee sauf ouverture volontaire */
  .sidebar { width: 85vw; max-width: 320px; }
}


/* ═══════════════════════════════════════════════════════════════════════════════
   IMPORT DROPZONE (drag & drop)
   ═══════════════════════════════════════════════════════════════════════════════ */
.import-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 20px; border: 2px dashed var(--border); border-radius: 10px;
  background: var(--bg); cursor: pointer; transition: all .2s ease;
  text-align: center; min-height: 140px;
}
.import-dropzone:hover, .import-dropzone:focus-visible {
  border-color: var(--primary); background: var(--primary-light);
  outline: none;
}
.import-dropzone.dragover {
  border-color: var(--primary); background: var(--primary-light);
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(99,102,241,.15);
}
.import-dropzone-icon { font-size: 2.5rem; margin-bottom: 8px; opacity: .8; }
.import-dropzone-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.import-dropzone-hint { font-size: .85rem; color: var(--text-light); margin-bottom: 8px; }
.import-dropzone-hint .link { color: var(--primary); text-decoration: underline; }
.import-dropzone-formats { font-size: .7rem; color: var(--text-light); letter-spacing: .3px; }
.import-dropzone-selected {
  margin-top: 10px; padding: 10px 12px; border-radius: 6px;
  background: var(--primary-light); color: var(--text); font-size: .85rem;
}

/* ─── IMPORT : preview live fichiers selectionnes (Sprint 3 item 23) ─────────*/
.import-selected-list {
  margin-top: 16px; padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px;
}
.import-selected-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; font-size: .85rem; color: var(--text);
}
#import-selected-items {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}
.import-sel-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  animation: import-sel-slide-in .25s ease-out;
}
@keyframes import-sel-slide-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.import-sel-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .72rem; font-weight: 700;
}
.import-sel-icon.pdf   { background: linear-gradient(135deg, #ef4444, #dc2626); }
.import-sel-icon.docx  { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.import-sel-icon.xlsx  { background: linear-gradient(135deg, #10b981, #059669); }
.import-sel-icon.email { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.import-sel-icon.img   { background: linear-gradient(135deg, #f59e0b, #d97706); }
.import-sel-icon.other { background: linear-gradient(135deg, #64748b, #475569); font-size: 1rem; }
.import-sel-info { flex: 1; min-width: 0; }
.import-sel-name {
  font-size: .82rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.import-sel-meta { font-size: .72rem; color: var(--text-light); margin-top: 2px; }
.import-sel-remove {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 6px;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-light); font-size: 1rem; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.import-sel-remove:hover { background: #fee2e2; color: #ef4444; }

/* ═══════════════════════════════════════════════════════════════════════════════
   CHAT IA PREMIUM (Sprint 2 wow — 2026-05-04)
   Les classes .chat-msg / .chat-msg.user / .chat-msg.assistant ci-dessus sont
   PRESERVEES pour compat historique. Ce bloc ajoute uniquement de nouvelles
   classes (chat-msg-row, chat-avatar, chat-msg-bubble, etc.).
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Zone de messages : full-height viewport */
#page-ia_assistant .chat-messages,
#chat-messages {
  max-height: calc(100vh - var(--topbar-h, 56px) - 220px);
  min-height: 320px;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 16px 12px;
}

/* Ligne de message (avatar + bulle) */
.chat-msg-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.chat-msg-row.user { flex-direction: row-reverse; }

/* Avatar carre arrondi avec initiales colorees */
.chat-avatar {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; color: #fff;
  letter-spacing: .02em;
}
.chat-avatar.user    { background: linear-gradient(135deg, var(--primary), var(--primary-dark, #1d4ed8)); }
.chat-avatar.assistant { background: linear-gradient(135deg, #10b981, #059669); }
.chat-avatar.system  { background: linear-gradient(135deg, #64748b, #475569); }

/* Bulle message amelioree */
.chat-msg-bubble {
  max-width: min(70ch, 75%); padding: 12px 16px; border-radius: 14px;
  line-height: 1.55; font-size: .9rem;
  animation: chat-msg-pop .2s ease-out;
  word-break: break-word;
}
.chat-msg-row.user .chat-msg-bubble {
  background: var(--primary); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-row.assistant .chat-msg-bubble {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-msg-row.system .chat-msg-bubble {
  background: var(--bg); border: 1px solid var(--border); color: var(--text-light);
  border-radius: 14px; font-style: italic; font-size: .85rem;
}
[data-theme="dark"] .chat-msg-row.assistant .chat-msg-bubble {
  background: rgba(255,255,255,.04);
}
@keyframes chat-msg-pop {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Typing indicator (3 points animes) + texte de progression visible
   Bug fix 2026-05-04 : avant, juste 3 dots silencieux pendant 30-60s — l'utilisateur
   ne savait pas si l'IA travaillait ou plantait. Maintenant, texte explicatif +
   compteur de secondes qui s'incremente (sans re-render du chat -> plus de saut). */
.chat-typing { display: inline-flex; align-items: center; gap: 4px; padding: 4px 2px; }
.chat-typing-status {
  font-size: .8rem; color: var(--text-light, #64748b);
  padding: 2px 4px 6px 4px; line-height: 1.4;
}
.chat-typing-elapsed {
  font-variant-numeric: tabular-nums; font-weight: 600;
  color: var(--primary, #2563eb); margin-left: 2px;
}
.chat-typing-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-light);
  animation: chat-typing-bounce 1.2s infinite ease-in-out;
}
.chat-typing-dot:nth-child(2) { animation-delay: .15s; }
.chat-typing-dot:nth-child(3) { animation-delay: .30s; }
@keyframes chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30%            { transform: translateY(-6px); opacity: 1; }
}

/* Empty state premium */
.chat-empty-state-pro {
  text-align: center; padding: 40px 16px;
  color: var(--text-light);
}
.chat-empty-state-pro .chat-empty-icon {
  width: 64px; height: 64px; border-radius: 16px;
  background: linear-gradient(135deg, #10b981, #2563eb);
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #fff;
}
.chat-empty-state-pro h3 {
  font-size: 1.15rem; color: var(--text); margin-bottom: 6px; font-weight: 700;
}
.chat-empty-state-pro p {
  font-size: .87rem; color: var(--text-light); margin-bottom: 0;
}

/* Suggestions chips contextuelles */
.chat-suggestions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 20px; justify-content: center;
}
.chat-suggestion-chip {
  padding: 8px 14px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text);
  border-radius: 20px; font-size: .82rem; cursor: pointer;
  transition: border-color .15s, color .15s, transform .15s;
  font-family: inherit;
}
.chat-suggestion-chip:hover {
  border-color: var(--primary); color: var(--primary);
  transform: translateY(-1px);
}

/* Responsive : sur petit ecran, bulles pleine largeur */
@media (max-width: 600px) {
  .chat-msg-bubble { max-width: 90%; font-size: .85rem; }
  .chat-avatar { width: 30px; height: 30px; font-size: .7rem; }
}

/* PAGE HIDDEN */
.page { display: none; }
.page.active { display: block; }

/* ─── SEARCH : mark highlight (FTS5 snippets) ─────────────────────────────── */
/* Mise en evidence des termes recherches dans les extraits FTS5.             */
/* fond jaune doux, texte inchange, coins arrondis. Fonctionne en dark mode  */
/* grace a color:inherit (herite du texte courant).                           */
mark {
  background: #fef3c7;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}
[data-theme="dark"] mark {
  background: #78350f;
  color: #fef3c7;
}

/* ─── DOCUMENTS : colonnes triables ─────────────────────────────────────────*/
th.sortable, th[data-sort] { cursor: pointer; user-select: none; }
th.sortable:hover, th[data-sort]:hover { background: var(--bg-hover, rgba(37,99,235,.05)); }
.sort-indicator { display: inline-block; min-width: 12px; opacity: .7; margin-left: 4px; font-size: .75em; }

/* ─── SKELETON LOADERS (Sprint 1 wow polish) ────────────────────────────────*/
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: 6px;
}
[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.10) 50%, rgba(255,255,255,.04) 75%);
  background-size: 200% 100%;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-stack { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.skeleton-row  { height: 44px; }
.skeleton-card { height: 110px; }
.skeleton-text { height: 14px; width: 80%; }
.kpi-card.skeleton.skeleton-card { padding: 0; border: 1px solid var(--border); }

/* ─── TOPBAR : bouton command palette (Ctrl+K) ──────────────────────────────*/
.topbar-cmdk {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; margin-left: 8px;
  font-size: .78rem; color: var(--text-light);
  border: 1px solid var(--border); background: var(--bg-card);
  border-radius: 8px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.topbar-cmdk:hover { border-color: var(--primary); color: var(--primary); background: var(--bg); }
.topbar-cmdk-kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 6px; font-size: .7rem; color: var(--text);
}
@media (max-width: 900px) { .topbar-cmdk-label { display: none; } }

/* ─── DASHBOARD HERO (Sprint 2 wow) ────────────────────────────────────────*/
.dashboard-hero {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 24px;
  align-items: center;
  padding: 24px 28px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(37,99,235,.06) 0%, rgba(16,185,129,.05) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .dashboard-hero {
  background: linear-gradient(135deg, rgba(37,99,235,.10) 0%, rgba(16,185,129,.08) 100%);
}
.dashboard-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 100% 0%, rgba(37,99,235,.08), transparent 50%);
}
.hero-main { position: relative; z-index: 1; }
.hero-label {
  font-size: .82rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  margin-bottom: 6px;
}
.hero-value {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -.02em;
}
.hero-trend { margin-top: 10px; font-size: .82rem; color: var(--text-light); }
.hero-delta { font-weight: 700; }
.hero-delta.up   { color: #10b981; }
.hero-delta.down { color: #ef4444; }
.hero-delta.flat { color: var(--text-light); }
.hero-spark {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 220px;
  color: var(--primary);
}
.hero-spark svg { width: 200px; height: 60px; }
.hero-spark-label { font-size: .7rem; color: var(--text-light); margin-top: 4px; }
.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}
@media (max-width: 900px) {
  .dashboard-hero { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
  .hero-spark { align-items: flex-start; }
  .hero-actions { flex-direction: row; }
}

/* ─── DECISION HUB BANDEAU (Sprint 2 wow) ──────────────────────────────────*/
.decision-hub-bandeau {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 22px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
  border: 1px solid #fde68a;
  border-radius: 12px;
}
[data-theme="dark"] .decision-hub-bandeau {
  background: linear-gradient(135deg, rgba(251,191,36,.10), rgba(251,146,60,.05));
  border-color: rgba(251,191,36,.30);
}
.decision-hub-headline {
  font-size: 1.05rem;
  font-weight: 700;
  color: #78350f;
  white-space: nowrap;
}
[data-theme="dark"] .decision-hub-headline { color: #fbbf24; }
.decision-hub-count {
  font-size: 1.6rem;
  font-weight: 800;
  padding: 0 6px;
}
.decision-hub-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}
.decision-chip {
  padding: 6px 12px;
  background: rgba(255,255,255,.6);
  border: 1px solid rgba(120,53,15,.15);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 500;
  color: #78350f;
  cursor: pointer;
  transition: all .15s;
}
.decision-chip:hover { background: #fff; transform: translateY(-1px); }
[data-theme="dark"] .decision-chip {
  background: rgba(0,0,0,.20);
  color: #fef3c7;
  border-color: rgba(251,191,36,.25);
}
.decision-chip:hover { box-shadow: 0 2px 6px rgba(0,0,0,.10); }
/* Zone detail (factures urgentes / echeances etc.) — conservee en dessous du bandeau */
.decision-hub-detail { margin-top: 0; }
@media (max-width: 768px) {
  .decision-hub-bandeau { flex-direction: column; align-items: flex-start; gap: 12px; }
  .decision-hub-headline { white-space: normal; }
}

/* ─── DOCUMENTS : view toggle list/grid (Sprint 2 wow) ──────────────────────*/
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg-card); }
.view-toggle-btn {
  padding: 6px 10px; background: transparent; border: none; cursor: pointer;
  display: inline-flex; align-items: center; color: var(--text-light);
  transition: background .15s, color .15s;
}
.view-toggle-btn:hover { background: var(--bg); color: var(--text); }
.view-toggle-btn.active { background: var(--primary); color: #fff; }
[data-theme="dark"] .view-toggle-btn.active { background: var(--primary); color: #fff; }

.docs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; padding: 8px 0;
}
.doc-card-grid {
  position: relative; padding: 16px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-card); cursor: pointer; transition: all .18s;
  display: flex; flex-direction: column; gap: 10px; overflow: hidden;
}
.doc-card-grid:hover { box-shadow: var(--shadow-lg, 0 8px 30px rgba(0,0,0,.12)); transform: translateY(-2px); border-color: var(--primary); }
.doc-card-grid .dc-icon {
  width: 56px; height: 56px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: #fff; flex-shrink: 0;
}
.doc-card-grid .dc-icon.pdf  { background: linear-gradient(135deg, #ef4444, #dc2626); }
.doc-card-grid .dc-icon.docx { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.doc-card-grid .dc-icon.xlsx { background: linear-gradient(135deg, #10b981, #059669); }
.doc-card-grid .dc-icon.email { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.doc-card-grid .dc-icon.other { background: linear-gradient(135deg, #64748b, #475569); }
.doc-card-grid .dc-name {
  font-size: .92rem; font-weight: 600; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.3; min-height: 2.4em;
}
.doc-card-grid .dc-meta { display: flex; flex-direction: column; gap: 4px; font-size: .72rem; color: var(--text-light); margin-top: auto; }
.doc-card-grid .dc-overlay {
  position: absolute; inset: 0; background: rgba(15,23,42,.85); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.doc-card-grid:hover .dc-overlay { opacity: 1; pointer-events: auto; }
[data-theme="dark"] .doc-card-grid:hover .dc-overlay { background: rgba(2,6,23,.92); }
/* Item 16 audit no-regression : checkbox de selection batch en mode grille */
.doc-card-grid .dc-check-grid {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 18px; height: 18px; cursor: pointer;
  accent-color: var(--primary);
}

/* ─── DOC PREVIEW PANEL slide-in (Sprint 2 wow) ─────────────────────────────*/
.doc-preview-backdrop {
  position: fixed !important; inset: 0 !important; background: rgba(15,23,42,.45);
  z-index: 9998 !important;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.doc-preview-backdrop.open { opacity: 1; pointer-events: auto; }

/* Bug fix 2026-05-10 : panneau plein hauteur cote droit forcement.
   Avant le panel s'affichait parfois en bas a droite (mini popup) car des
   transforms parents ou des CSS conflictuels reinterpretaient `position:
   fixed`. Solution : tout en !important + z-index tres haut pour passer
   au-dessus de tout (modale, AI float buttons, sidebars). */
.doc-preview-panel {
  position: fixed !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  height: 100vh !important;
  width: 55% !important;
  max-width: 1100px !important;
  min-width: 480px !important;
  background: var(--bg-card);
  box-shadow: -8px 0 40px rgba(0,0,0,.18);
  z-index: 9999 !important;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.2,.8,.4,1);
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
}
.doc-preview-panel.open { transform: translateX(0) !important; }

.doc-preview-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--bg);
  flex-shrink: 0;
}
.doc-preview-title { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.dpp-icon { font-size: 1.6rem; flex-shrink: 0; }
.dpp-name { font-size: .98rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 400px; }
.dpp-meta { font-size: .75rem; color: var(--text-light); margin-top: 2px; }
.doc-preview-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.doc-preview-close {
  width: 32px; height: 32px; border-radius: 8px; background: transparent;
  border: 1px solid var(--border); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; color: var(--text-light);
  transition: background .15s, color .15s; font-size: 1rem;
}
.doc-preview-close:hover { background: var(--bg); color: var(--text); }

.doc-preview-body { flex: 1; min-height: 0; overflow: hidden; }
.doc-preview-body iframe {
  width: 100%; height: 100%; border: 0; background: var(--bg);
  display: block;
}

@media (max-width: 900px) {
  .doc-preview-panel { width: 95%; min-width: 0; }
}

/* ─── DOSSIER 360 TIMELINE (Sprint 3 Item 19) ───────────────────────────────*/
.d360-timeline { position: relative; padding-left: 8px; }
.d360-timeline::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 22px;
  width: 2px; background: linear-gradient(180deg, var(--border) 0%, var(--bg) 100%);
}
.d360-tl-item {
  position: relative; display: flex; gap: 14px; padding: 10px 0; align-items: flex-start;
  transition: transform .15s;
}
.d360-tl-item[onclick]:hover { transform: translateX(2px); }
.d360-tl-marker {
  position: relative; z-index: 2; flex-shrink: 0;
  width: 38px; height: 38px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem; box-shadow: 0 0 0 3px var(--bg-card);
}
.d360-tl-content {
  flex: 1; min-width: 0; padding: 4px 12px 12px 0;
  border-bottom: 1px dashed var(--border);
}
.d360-tl-item:last-child .d360-tl-content { border-bottom: none; }
.d360-tl-date {
  font-size: .72rem; color: var(--text-light); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px;
}
.d360-tl-title {
  font-size: .92rem; font-weight: 600; color: var(--text); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.d360-tl-meta {
  font-size: .78rem; color: var(--text-light); margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ACCESSIBILITE : prefers-reduced-motion (audit P2 2026-05-12)
   ═══════════════════════════════════════════════════════════════════════════════
   Neutralise toutes les animations / transitions pour les utilisateurs qui ont
   active la preference systeme "Reduire les animations" (WCAG 2.1 SC 2.3.3).
   Regle catch-all : couvre les 7 @keyframes de ce fichier (pulse, toastIn,
   spin, import-sel-slide-in, chat-msg-pop, chat-typing-bounce,
   skeleton-shimmer) ET toute animation future sans avoir a enumerer chaque
   nom. Plus durable.
   ═══════════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
