/* solo CRM — Feuille de style (portée depuis le CRM PHP d'origine) */

:root {
	--primary: #0176d3;
	--primary-dark: #014486;
	--primary-light: #1b96ff;
	--secondary: #747474;
	--success: #2e844a;
	--warning: #dd7a01;
	--danger: #ea001e;
	--info: #5eb4ff;
	--white: #ffffff;
	--gray-50: #f3f3f3;
	--gray-100: #e5e5e5;
	--gray-200: #c9c9c9;
	--gray-300: #aeaeae;
	--gray-400: #939393;
	--gray-500: #747474;
	--gray-600: #5a5a5a;
	--gray-700: #414141;
	--gray-800: #2e2e2e;
	--gray-900: #1a1a1a;
	--black: #000000;
	--space-xs: 0.25rem;
	--space-sm: 0.5rem;
	--space-md: 1rem;
	--space-lg: 1.5rem;
	--space-xl: 2rem;
	--space-xxl: 3rem;
	--font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	--font-mono: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
	--shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
	--shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
	--shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
	--radius-sm: 0.25rem;
	--radius-md: 0.5rem;
	--radius-lg: 1rem;
	--radius-full: 9999px;
	--transition-fast: 150ms ease;
	--transition-base: 250ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-sans); line-height: 1.5; color: var(--gray-900); background-color: var(--gray-50); min-height: 100vh; }

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

/* Header */
.app-header {
	background: var(--white); border-bottom: 1px solid var(--gray-200);
	padding: var(--space-md) var(--space-xl); display: flex; align-items: center; justify-content: space-between;
	position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm);
}
.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: var(--space-sm); text-decoration: none; cursor: pointer; }
.logo::before {
	content: ''; width: 32px; height: 32px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230176d3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M18.7 8l-5.1 5.2-2.8-2.7L7 14.3'/%3E%3C/svg%3E");
	background-size: contain; background-repeat: no-repeat;
}
.global-search { flex: 1; max-width: 600px; margin: 0 var(--space-xl); position: relative; }
.global-search input { width: 100%; padding: var(--space-sm) var(--space-md) var(--space-sm) 2.5rem; border: 1px solid var(--gray-300); border-radius: var(--radius-full); font-size: 0.875rem; transition: all var(--transition-fast); }
.global-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(1, 118, 211, 0.1); }
.global-search::before {
	content: ''; position: absolute; left: var(--space-md); top: 50%; transform: translateY(-50%); width: 16px; height: 16px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23747474' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
	background-size: contain; opacity: 0.6;
}
.user-menu { display: flex; align-items: center; gap: var(--space-md); }
.user-avatar { width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--primary-light); display: flex; align-items: center; justify-content: center; color: var(--white); font-weight: 600; font-size: 0.875rem; cursor: pointer; position: relative; }
.user-avatar img { width: 100%; height: 100%; border-radius: var(--radius-full); object-fit: cover; }

/* Layout + sidebar */
.app-body { display: flex; flex: 1; }
.sidebar { width: 250px; background: var(--white); border-right: 1px solid var(--gray-200); padding: var(--space-md) 0; overflow-y: auto; }
.nav-section { margin-bottom: var(--space-lg); }
.nav-title { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); padding: var(--space-sm) var(--space-lg); }
.nav-list { list-style: none; }
.nav-item { position: relative; }
.nav-link { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-lg); color: var(--gray-700); text-decoration: none; font-size: 0.875rem; transition: all var(--transition-fast); border-left: 3px solid transparent; cursor: pointer; }
.nav-link:hover { background: var(--gray-50); color: var(--primary); }
.nav-link.active { background: var(--gray-50); color: var(--primary); border-left-color: var(--primary); font-weight: 500; }
.nav-link::before { content: ''; width: 20px; height: 20px; flex-shrink: 0; opacity: 0.7; }
.nav-link.dashboard::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='14' y='14' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3C/svg%3E"); }
.nav-link.accounts::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.nav-link.contacts::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"); }
.nav-link.leads::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a10 10 0 1 0 10 10H12V2z'/%3E%3Cpath d='M12 2a10 10 0 0 1 10 10'/%3E%3Cpath d='M12 12 2.1 10.5'/%3E%3Cpath d='M12 12v10'/%3E%3C/svg%3E"); }
.nav-link.opportunities::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='20' x2='12' y2='10'/%3E%3Cline x1='18' y1='20' x2='18' y2='4'/%3E%3Cline x1='6' y1='20' x2='6' y2='16'/%3E%3C/svg%3E"); }
.nav-link.cases::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E"); }
.nav-link.tasks::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3Cpath d='m9 16 2 2 4-4'/%3E%3C/svg%3E"); }
.nav-link.contracts::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cpath d='M9 15l2 2 4-4'/%3E%3C/svg%3E"); }
.nav-link.assets::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z'/%3E%3Cpolyline points='3.27 6.96 12 12.01 20.73 6.96'/%3E%3Cline x1='12' y1='22.08' x2='12' y2='12'/%3E%3C/svg%3E"); }
.nav-link.reports::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M18 17V9'/%3E%3Cpath d='M13 17V5'/%3E%3Cpath d='M8 17v-3'/%3E%3C/svg%3E"); }
.nav-link.settings::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.nav-link.trash::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6'/%3E%3Cpath d='M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E"); }

.main-content { flex: 1; padding: var(--space-xl); overflow-y: auto; max-width: calc(100% - 250px); }
.page-header { margin-bottom: var(--space-xl); display: flex; justify-content: space-between; align-items: flex-start; }
.page-title { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); margin-bottom: var(--space-xs); }
.page-subtitle { color: var(--gray-500); font-size: 0.875rem; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); font-size: 0.875rem; font-weight: 500; line-height: 1.5; text-align: center; text-decoration: none; vertical-align: middle; cursor: pointer; border: 1px solid transparent; border-radius: var(--radius-md); transition: all var(--transition-fast); white-space: nowrap; }
.btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(1, 118, 211, 0.3); }
.btn-primary { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { background: var(--white); color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-danger { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-danger:hover { background: #c5001a; border-color: #c5001a; }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; pointer-events: none; box-shadow: none; }
.btn-success { background: var(--success); color: var(--white) !important; border-color: var(--success); }
.btn-success:hover { background: #246a3b; border-color: #246a3b; color: var(--white) !important; }
.data-table a.btn-primary, .data-table a.btn-danger, .data-table a.btn-success { color: var(--white) !important; text-decoration: none !important; }
.data-table a.btn-secondary { color: var(--gray-700) !important; text-decoration: none !important; }
.btn-ghost { background: transparent; color: var(--gray-600); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }
.btn-sm { padding: var(--space-xs) var(--space-sm); font-size: 0.8125rem; }
.btn-lg { padding: var(--space-md) var(--space-lg); font-size: 1rem; }
.btn-add::before { content: ''; width: 16px; height: 16px; display: inline-block; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E"); }
.btn-edit::before { content: ''; width: 16px; height: 16px; display: inline-block; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E"); }
.btn-delete::before { content: ''; width: 16px; height: 16px; display: inline-block; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E"); }

/* Cards */
.card { background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); margin-bottom: var(--space-lg); }
.card-header { padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--gray-200); display: flex; justify-content: space-between; align-items: center; }
.card-title { font-size: 1rem; font-weight: 600; color: var(--gray-900); }
.card-body { padding: var(--space-lg); }
.card-footer { padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--gray-200); background: var(--gray-50); border-radius: 0 0 var(--radius-md) var(--radius-md); }

/* Formulaires */
.form-group { margin-bottom: var(--space-md); }
.form-label { display: block; margin-bottom: var(--space-xs); font-size: 0.875rem; font-weight: 500; color: var(--gray-700); }
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-control { display: block; width: 100%; padding: var(--space-sm) var(--space-md); font-size: 0.875rem; line-height: 1.5; color: var(--gray-900); background-color: var(--white); border: 1px solid var(--gray-300); border-radius: var(--radius-md); transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(1, 118, 211, 0.1); }
.form-control:disabled { background-color: var(--gray-100); opacity: 0.6; cursor: not-allowed; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23747474' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right var(--space-sm) center; background-size: 16px; padding-right: 2.5rem; }
textarea.form-control { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--space-md); }
.form-actions { display: flex; gap: var(--space-md); justify-content: flex-end; padding-top: var(--space-lg); border-top: 1px solid var(--gray-200); margin-top: var(--space-lg); }
.form-hint { font-size: 0.75rem; color: var(--gray-500); margin-top: var(--space-xs); }
.checkbox-group { display: flex; align-items: center; gap: var(--space-sm); }

/* Tables */
.data-table-container { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th { background: var(--gray-50); padding: var(--space-sm) var(--space-md); text-align: left; font-weight: 600; color: var(--gray-700); border-bottom: 2px solid var(--gray-200); white-space: nowrap; cursor: pointer; user-select: none; }
.data-table th.no-sort { cursor: default; }
.data-table th.no-sort:hover { background: var(--gray-50); }
.data-table th a.sort-link { color: inherit; text-decoration: none; display: inline-block; width: 100%; }
.data-table th a.sort-link:hover { color: var(--primary); }
.data-table th:hover { background: var(--gray-100); }
.data-table td { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--gray-200); vertical-align: middle; }
.data-table tr:hover td { background: var(--gray-50); }
.data-table .actions { text-align: right; white-space: nowrap; }
.data-table .actions > * { margin-left: var(--space-xs); vertical-align: middle; }
.data-table a { color: var(--primary); text-decoration: none; font-weight: 500; }
.data-table a:hover { text-decoration: underline; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: var(--space-xs) var(--space-sm); font-size: 0.75rem; font-weight: 600; line-height: 1; border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.025em; }
.badge-success { background: rgba(46, 132, 74, 0.1); color: var(--success); }
.badge-warning { background: rgba(221, 122, 1, 0.1); color: var(--warning); }
.badge-danger { background: rgba(234, 0, 30, 0.1); color: var(--danger); }
.badge-info { background: rgba(94, 180, 255, 0.1); color: var(--primary); }
.badge-secondary { background: var(--gray-100); color: var(--gray-600); }

/* Pagination */
.pagination { display: flex; gap: var(--space-xs); justify-content: center; margin-top: var(--space-lg); }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 var(--space-sm); font-size: 0.875rem; color: var(--gray-700); text-decoration: none; background: var(--white); border: 1px solid var(--gray-300); border-radius: var(--radius-md); transition: all var(--transition-fast); cursor: pointer; }
.pagination a:hover { background: var(--gray-50); border-color: var(--gray-400); color: var(--primary); }
.pagination .current { background: var(--primary); color: var(--white); border-color: var(--primary); font-weight: 500; }
.pagination .disabled { opacity: 0.5; cursor: not-allowed; }

/* Filtres */
.filters-bar { display: flex; gap: var(--space-md); margin-bottom: var(--space-lg); flex-wrap: wrap; align-items: center; }

/* Onglets */
.tabs { display: flex; border-bottom: 1px solid var(--gray-200); margin-bottom: var(--space-lg); gap: var(--space-xs); flex-wrap: wrap; }
.tab { padding: var(--space-sm) var(--space-md); font-size: 0.875rem; color: var(--gray-600); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all var(--transition-fast); cursor: pointer; }
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* Fiche détail */
.record-header { background: var(--white); border-radius: var(--radius-md); padding: var(--space-lg); margin-bottom: var(--space-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); }
.record-title { font-size: 1.5rem; font-weight: 700; margin-bottom: var(--space-sm); color: var(--gray-900); }
.record-meta { display: flex; gap: var(--space-lg); font-size: 0.875rem; color: var(--gray-500); flex-wrap: wrap; }
.record-actions { display: flex; gap: var(--space-sm); margin-top: var(--space-md); flex-wrap: wrap; }
.detail-section { background: var(--white); border-radius: var(--radius-md); margin-bottom: var(--space-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); }
.detail-section-header { padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--gray-200); font-weight: 600; color: var(--gray-900); display: flex; justify-content: space-between; align-items: center; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-md); padding: var(--space-lg); }
.detail-item { display: flex; flex-direction: column; gap: var(--space-xs); }
.detail-label { font-size: 0.75rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.025em; font-weight: 600; }
.detail-value { font-size: 0.875rem; color: var(--gray-900); }
.detail-value.empty { color: var(--gray-400); font-style: italic; }

/* Timeline */
.timeline { position: relative; padding-left: var(--space-lg); }
.timeline::before { content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: var(--gray-200); }
.timeline-item { position: relative; padding-bottom: var(--space-lg); }
.timeline-item::before { content: ''; position: absolute; left: -14px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 2px solid var(--primary); }
.timeline-item.task::before { border-color: var(--info); }
.timeline-item.email::before { border-color: var(--success); }
.timeline-item.call::before { border-color: var(--warning); }
.timeline-item.note::before { border-color: var(--gray-400); }
.timeline-content { background: var(--gray-50); padding: var(--space-md); border-radius: var(--radius-md); }
.timeline-header { display: flex; justify-content: space-between; margin-bottom: var(--space-xs); font-size: 0.875rem; gap: var(--space-sm); }
.timeline-title { font-weight: 600; color: var(--gray-900); }
.timeline-date { color: var(--gray-500); font-size: 0.75rem; white-space: nowrap; }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; transition: all var(--transition-base); }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--white); border-radius: var(--radius-lg); width: 90%; max-width: 600px; max-height: 90vh; overflow: hidden; transform: translateY(-20px); transition: transform var(--transition-base); box-shadow: var(--shadow-lg); }
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { padding: var(--space-lg); border-bottom: 1px solid var(--gray-200); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 1.25rem; font-weight: 600; }
.modal-close { width: 32px; height: 32px; border: none; background: transparent; cursor: pointer; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; transition: background var(--transition-fast); }
.modal-close:hover { background: var(--gray-100); }
.modal-close::before { content: ''; width: 20px; height: 20px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23747474' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E"); }
.modal-body { padding: var(--space-lg); overflow-y: auto; max-height: calc(90vh - 140px); }
.modal-footer { padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: var(--space-md); }

/* Toasts */
.toast-container { position: fixed; top: var(--space-lg); right: var(--space-lg); z-index: 1100; display: flex; flex-direction: column; gap: var(--space-sm); }
.toast { background: var(--white); border-radius: var(--radius-md); padding: var(--space-md) var(--space-lg); box-shadow: var(--shadow-lg); border-left: 4px solid var(--primary); display: flex; align-items: center; gap: var(--space-md); min-width: 300px; animation: slideIn 0.3s ease; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--primary); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast-message { flex: 1; font-size: 0.875rem; }

/* Dashboard */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-lg); }
.stat-card { background: var(--white); padding: var(--space-lg); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); margin-bottom: var(--space-xs); }
.stat-label { font-size: 0.875rem; color: var(--gray-500); }
.stat-change { font-size: 0.875rem; margin-top: var(--space-sm); }
.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

/* Autocomplete */
.autocomplete-results { position: absolute; top: 100%; left: 0; right: 0; background: var(--white); border: 1px solid var(--gray-300); border-radius: var(--radius-md); margin-top: var(--space-xs); max-height: 300px; overflow-y: auto; z-index: 100; box-shadow: var(--shadow-md); display: none; }
.autocomplete-results.active { display: block; }
.autocomplete-item { padding: var(--space-sm) var(--space-md); cursor: pointer; border-bottom: 1px solid var(--gray-100); }
.autocomplete-item:hover { background: var(--gray-50); }
.autocomplete-item-title { font-weight: 500; font-size: 0.875rem; }
.autocomplete-item-subtitle { font-size: 0.75rem; color: var(--gray-500); }

/* Pipeline (drag & drop) — fidèle au CRM d'origine */
.pipeline-container { display: flex; gap: var(--space-md); overflow-x: auto; padding-bottom: var(--space-md); align-items: flex-start; }
.pipeline-column { min-width: 250px; max-width: 250px; flex-shrink: 0; min-height: 200px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: var(--space-sm); display: flex; flex-direction: column; }
.pipeline-column.drag-over { background: var(--gray-100); border-color: var(--primary); }
.pipeline-header { font-weight: 600; font-size: 0.875rem; padding: var(--space-xs) var(--space-sm); display: flex; justify-content: space-between; align-items: center; }
.pipeline-count { background: var(--primary); color: var(--white); border-radius: var(--radius-full); padding: 1px 8px; font-size: 0.75rem; font-weight: 600; min-width: 20px; text-align: center; }
.pipeline-total { font-size: 0.75rem; color: var(--gray-500); margin-bottom: var(--space-sm); padding: 0 var(--space-sm); }
.pipeline-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md); margin-bottom: var(--space-sm); cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow var(--transition-fast), border-color var(--transition-fast); }
.pipeline-card:hover { box-shadow: var(--shadow-md); border-color: var(--gray-300); }
.pipeline-card.dragging { opacity: 0.4; transform: rotate(2deg); }
.pipeline-card-title { font-weight: 600; font-size: 0.875rem; margin-bottom: var(--space-xs); }
.pipeline-card-title a { color: var(--primary); text-decoration: none; }
.pipeline-card-title a:hover { text-decoration: underline; }
.pipeline-card-meta { font-size: 0.75rem; color: var(--gray-500); margin-bottom: 2px; }
.pipeline-card-amount { font-weight: 700; color: var(--success); font-size: 0.875rem; margin-top: var(--space-xs); }

/* Report builder */
.report-layout { display: grid; grid-template-columns: 360px 1fr; gap: var(--space-lg); align-items: start; }
.report-config { position: sticky; top: var(--space-md); max-height: calc(100vh - var(--space-xl)); overflow-y: auto; }
.report-config-inner { padding: var(--space-lg); }
.config-section { margin-bottom: var(--space-lg); border-bottom: 1px solid var(--gray-100); padding-bottom: var(--space-md); }
.config-section:last-child { border-bottom: none; }
.config-section-title { font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-500); margin-bottom: var(--space-sm); }
.col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xs); max-height: 240px; overflow-y: auto; padding: var(--space-xs); background: var(--gray-50); border-radius: var(--radius-sm); border: 1px solid var(--gray-200); }
.col-item { display: flex; align-items: center; gap: var(--space-xs); padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-sm); font-size: 0.8125rem; cursor: pointer; }
.col-item:hover { background: var(--gray-100); }
.col-item input[type="checkbox"] { accent-color: var(--primary); cursor: pointer; }
.col-item .col-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-item .col-source { font-size: 0.6875rem; color: var(--gray-400); background: var(--gray-200); padding: 1px 4px; border-radius: var(--radius-sm); flex-shrink: 0; }
.filter-row { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; margin-bottom: var(--space-sm); }
.filter-row > .filter-col-sel { flex: 1 1 140px; }
.filter-row > .filter-op { flex: 0 0 110px; }
.filter-row > .filter-value-wrap { flex: 1 1 100%; }
.filter-row > .filter-remove { flex: 0 0 28px; }
.filter-row select, .filter-row input { font-size: 0.8125rem; padding: var(--space-xs) var(--space-sm); border: 1px solid var(--gray-300); border-radius: var(--radius-sm); }
.filter-remove { width: 28px; height: 28px; border: none; background: transparent; cursor: pointer; border-radius: var(--radius-sm); color: var(--gray-400); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.filter-remove:hover { background: var(--gray-100); color: var(--danger); }
.report-results { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-md); display: flex; flex-direction: column; overflow: hidden; }
.report-results-empty { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-md); min-height: 400px; display: flex; align-items: center; justify-content: center; }
.empty-state { text-align: center; color: var(--gray-400); }
.empty-state h3 { font-size: 1.125rem; color: var(--gray-500); margin-bottom: var(--space-xs); }
.empty-state p { font-size: 0.875rem; }
.results-toolbar { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--gray-200); background: var(--gray-50); flex-wrap: wrap; }
.results-info { font-size: 0.8125rem; color: var(--gray-500); }
.results-table-wrap { flex: 1; overflow: auto; max-height: 600px; }
.results-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.results-table th { background: var(--gray-50); padding: var(--space-sm) var(--space-md); text-align: left; font-weight: 600; color: var(--gray-700); border-bottom: 2px solid var(--gray-200); position: sticky; top: 0; white-space: nowrap; z-index: 2; }
.results-table td { padding: var(--space-xs) var(--space-md); border-bottom: 1px solid var(--gray-100); }
.results-table tr:hover td { background: var(--gray-50); }
.results-table .num-cell { text-align: right; font-variant-numeric: tabular-nums; }
.chart-config-bar { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-lg); border-top: 1px solid var(--gray-200); background: var(--gray-50); flex-wrap: wrap; }
.chart-config-bar select, .chart-config-bar input { font-size: 0.8125rem; padding: var(--space-xs) var(--space-sm); border: 1px solid var(--gray-300); border-radius: var(--radius-sm); }
.chart-config-bar label { font-size: 0.75rem; color: var(--gray-500); }
.chart-container { padding: var(--space-lg); border-top: 1px solid var(--gray-200); }
.chart-box { max-width: 700px; margin: 0 auto; position: relative; }

/* Bannière de sauvegarde (export) */
.export-banner { background: rgba(221, 122, 1, 0.1); border-bottom: 1px solid var(--warning); color: var(--gray-800); padding: var(--space-sm) var(--space-xl); display: flex; align-items: center; gap: var(--space-md); font-size: 0.875rem; }

/* Dropdown user menu */
.dropdown { position: absolute; top: 60px; right: 20px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); min-width: 200px; z-index: 200; }
.dropdown-section { padding: var(--space-md); border-bottom: 1px solid var(--gray-200); }
.dropdown-item { display: block; padding: var(--space-sm) var(--space-md); color: var(--gray-700); text-decoration: none; font-size: 0.875rem; cursor: pointer; background: none; border: none; width: 100%; text-align: left; }
.dropdown-item:hover { background: var(--gray-50); }
.lang-switch { display: flex; gap: var(--space-xs); }
.lang-switch button { display: block; flex: 1; text-align: center; padding: 2px 8px; border-radius: var(--radius-sm); font-size: 0.8rem; border: 1px solid var(--gray-200); cursor: pointer; background: var(--white); color: var(--gray-700); }
.lang-switch button.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* Mobile */
.mobile-menu-toggle { display: none; background: none; border: none; color: var(--gray-700); cursor: pointer; padding: var(--space-xs); align-items: center; justify-content: center; }
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 199; opacity: 0; transition: opacity var(--transition-base); }
.sidebar-overlay.active { display: block; opacity: 1; }

@media (max-width: 1024px) {
	.sidebar { width: 200px; }
	.main-content { max-width: calc(100% - 200px); padding: var(--space-lg); }
	.report-layout { grid-template-columns: 1fr; }
	.report-config { position: static; }
}
@media (max-width: 768px) {
	.mobile-menu-toggle { display: flex; }
	.app-header { padding: var(--space-sm) var(--space-md); flex-wrap: nowrap; }
	.logo { font-size: 1.1rem; }
	.logo::before { width: 24px; height: 24px; }
	.global-search { margin: 0 var(--space-sm); max-width: none; }
	.user-menu { gap: var(--space-sm); }
	.sidebar { position: fixed; left: -260px; top: 0; bottom: 0; width: 250px; z-index: 200; transition: left var(--transition-base); box-shadow: var(--shadow-lg); }
	.sidebar.open { left: 0; }
	.main-content { max-width: 100%; padding: var(--space-md); }
	.detail-grid { grid-template-columns: 1fr; }
	.form-row { grid-template-columns: 1fr; }
	.dashboard-grid { grid-template-columns: 1fr; }
	.tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
	.tab { white-space: nowrap; padding: var(--space-sm); }
	.card-body { padding: var(--space-md); }
	.detail-section-header { padding: var(--space-sm) var(--space-md); }
	.dashboard-grid .stat-card { min-width: calc(50% - var(--space-sm)); }
}
@media (max-width: 480px) {
	.main-content { padding: var(--space-sm); }
	.page-header { flex-direction: column; gap: var(--space-sm); align-items: stretch; }
	.filters-bar { flex-direction: column; align-items: stretch; }
	.data-table th, .data-table td { padding: var(--space-xs) var(--space-sm); font-size: 0.8125rem; }
	.data-table { font-size: 0.8125rem; }
	.dashboard-grid .stat-card { min-width: 100%; }
	.stat-value { font-size: 1.5rem; }
	.form-actions { flex-direction: column-reverse; }
	.form-actions .btn { width: 100%; }
	.card-footer.form-actions { padding: var(--space-md); }
	.record-title { font-size: 1.25rem; }
	.record-meta { gap: var(--space-sm); }
	.record-actions { flex-wrap: wrap; }
	.modal { width: 95%; max-height: 95vh; }
	.modal-header, .modal-body, .modal-footer { padding: var(--space-md); }
}

/* Utilitaires */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: var(--space-xs); } .mt-2 { margin-top: var(--space-sm); } .mt-3 { margin-top: var(--space-md); } .mt-4 { margin-top: var(--space-lg); }
.mb-1 { margin-bottom: var(--space-xs); } .mb-2 { margin-bottom: var(--space-sm); } .mb-3 { margin-bottom: var(--space-md); } .mb-4 { margin-bottom: var(--space-lg); }
.hidden { display: none !important; }
.empty-text { color: var(--gray-500); text-align: center; padding: var(--space-lg); }
