/* ============================================
   AMY ERP — Global Stylesheet
   ============================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #0f172a;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #6366f1;

  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #2563eb;
  --sidebar-hover: #1e293b;

  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --border: #e2e8f0;
  --border-dark: #cbd5e1;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.14);

  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --topbar-height: 60px;

  --font: 'Inter', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; }
a { cursor: pointer; text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ====== SIDEBAR ====== */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  transition: width 0.3s ease;
  z-index: 100;
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .sidebar-toggle-btn { margin-left: auto; }

.sidebar-logo {
  height: var(--topbar-height);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}
.logo-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.logo-text { color: #fff; font-weight: 700; font-size: 16px; flex: 1; white-space: nowrap; }
.sidebar-toggle-btn {
  background: none; border: none; color: var(--sidebar-text);
  padding: 4px; border-radius: 6px; font-size: 14px;
  transition: color 0.2s;
}
.sidebar-toggle-btn:hover { color: #fff; }

.sidebar-nav {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 12px 0;
}
.nav-group { margin-bottom: 8px; }
.nav-group-label {
  font-size: 9px; font-weight: 600; letter-spacing: 0.08em;
  color: #475569; padding: 8px 16px 4px;
  white-space: nowrap;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  color: var(--sidebar-text);
  font-size: 13px; font-weight: 400;
  border-radius: 0;
  transition: all 0.15s;
  white-space: nowrap;
  position: relative;
}
.nav-item i { font-size: 14px; flex-shrink: 0; width: 20px; text-align: center; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active {
  background: var(--primary);
  color: #fff;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--accent);
  border-radius: 0 2px 2px 0;
}

/* ====== MAIN WRAPPER ====== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}
.main-wrapper.collapsed { margin-left: var(--sidebar-collapsed); }

/* ====== TOPBAR ====== */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.mobile-menu-btn {
  display: none; background: none; border: none;
  color: var(--text-muted); font-size: 18px;
}
.breadcrumb { font-size: 14px; font-weight: 600; color: var(--text); }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 14px;
}
.topbar-search i { color: var(--text-muted); font-size: 12px; }
.topbar-search input {
  border: none; background: none; outline: none;
  font-size: 13px; color: var(--text); width: 160px;
}
.topbar-notif {
  position: relative; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer;
  color: var(--text-muted);
  transition: background 0.2s;
}
.topbar-notif:hover { background: var(--bg); }
.topbar-notif .badge {
  position: absolute; top: 4px; right: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 4px 10px;
  border-radius: 8px;
  transition: background 0.2s;
  font-size: 13px;
}
.topbar-user:hover { background: var(--bg); }
/* Sélecteur de site actif (multisite) */
.topbar-site {
  display: flex; align-items: center; gap: 6px;
  background: var(--primary-light); color: var(--primary);
  border: 1px solid var(--primary); border-radius: 20px;
  padding: 4px 10px; font-size: 13px; font-weight: 600;
}
.topbar-site select {
  border: none; background: none; outline: none; cursor: pointer;
  color: var(--primary); font-weight: 600; font-size: 13px; font-family: var(--font);
  max-width: 180px;
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}

/* ====== CONTENT ====== */
.content { flex: 1; padding: 24px; overflow-x: hidden; }

/* ====== PAGE HEADER ====== */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 22px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ====== CARDS ====== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* ====== STATS CARDS ====== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-icon.blue { background: #dbeafe; color: var(--primary); }
.stat-icon.green { background: #d1fae5; color: var(--success); }
.stat-icon.orange { background: #fef3c7; color: var(--warning); }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.cyan { background: #cffafe; color: var(--accent); }
.stat-icon.red { background: #fee2e2; color: var(--danger); }
.stat-value { font-size: 22px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat-change { font-size: 11px; margin-top: 4px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.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-warning:hover { background: #d97706; }
.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { background: #4f46e5; }
.btn-ghost { background: none; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-icon { padding: 7px; border-radius: 8px; }

/* ====== BADGES ====== */
.badge-pill {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #ede9fe; color: #4c1d95; }
.badge-muted { background: #f1f5f9; color: var(--text-muted); }

/* ====== TABLE ====== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: #f8fafc; }
thead th {
  padding: 11px 14px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
tbody td {
  padding: 11px 14px;
  font-size: 13px;
  color: var(--text);
}
tfoot td {
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  border-top: 2px solid var(--border-dark);
  white-space: nowrap;
}
.table-actions { display: flex; gap: 6px; }
.action-btn {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-muted);
  transition: all 0.15s;
}
.action-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.action-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: #fee2e2; }

/* ====== TOOLBAR ====== */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 12px; flex: 1; min-width: 200px;
}
.toolbar-search i { color: var(--text-muted); font-size: 12px; }
.toolbar-search input {
  border: none; background: none; outline: none;
  font-size: 13px; width: 100%;
}
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-select {
  border: 1px solid var(--border); background: var(--bg);
  border-radius: 8px; padding: 7px 12px;
  font-size: 13px; color: var(--text); outline: none;
  cursor: pointer;
}
.filter-select:focus { border-color: var(--primary); }

/* ====== FORM ====== */
.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-control {
  border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px;
  font-size: 13px; color: var(--text);
  background: var(--bg-card); outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
.form-control:disabled { background: #f8fafc; color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 11px; color: var(--text-muted); }
.form-section { margin-bottom: 24px; }
.form-section-title {
  font-size: 13px; font-weight: 600;
  color: var(--primary); margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}

/* ====== TABS ====== */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; gap: 4px; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 18px; border: none; background: none;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  border-radius: 8px 8px 0 0; transition: all 0.2s;
}
.tab-btn:hover { color: var(--text); background: var(--bg); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: none; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ====== MODAL ====== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 200;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: block; }
.modal {
  display: none; position: fixed;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); z-index: 201;
  width: 90vw; max-width: 900px; max-height: 90vh;
  flex-direction: column; overflow: hidden;
}
.modal.open { display: flex; }
.modal.modal-xl { max-width: 1100px; }
.modal.modal-sm { max-width: 480px; }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-header button {
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; width: 30px; height: 30px;
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.modal-header button:hover { background: #fee2e2; color: var(--danger); }
.modal-body { flex: 1; overflow-y: auto; padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  flex-shrink: 0;
}

/* ====== PRODUCT IMAGE UPLOAD ====== */
.img-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px; text-align: center;
  cursor: pointer; transition: all 0.2s;
  position: relative;
}
.img-upload-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.img-upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.img-preview { width: 80px; height: 80px; border-radius: 10px; object-fit: cover; margin: 0 auto 8px; display: block; }

/* ====== QTE INDICATORS ====== */
.qte-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.qte-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  text-align: center;
}
.qte-card .qte-val { font-size: 22px; font-weight: 700; }
.qte-card .qte-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.qte-card.total .qte-val { color: var(--primary); }
.qte-card.reserved .qte-val { color: var(--warning); }
.qte-card.available .qte-val { color: var(--success); }
.qte-card.pending .qte-val { color: var(--info); }

/* ====== DOCUMENT ====== */
.doc-type-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.doc-type-tab {
  padding: 8px 16px; border-radius: 20px;
  font-size: 12px; font-weight: 600; border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text-muted);
  cursor: pointer; transition: all 0.2s;
}
.doc-type-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.doc-type-tab.Q-ACHAT { border-color: #f59e0b; }
.doc-type-tab.Q-VENTE { border-color: #10b981; }
.doc-type-tab.Q-STOCK { border-color: #6366f1; }
.doc-type-tab.active.Q-ACHAT { background: #f59e0b; border-color: #f59e0b; }
.doc-type-tab.active.Q-VENTE { background: #10b981; border-color: #10b981; }
.doc-type-tab.active.Q-STOCK { background: #6366f1; border-color: #6366f1; }

/* ====== MARGE INDICATOR ====== */
.marge-indicator {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
  margin-bottom: 16px;
}
.marge-bar-wrap { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.marge-bar { height: 100%; border-radius: 4px; transition: width 0.4s; }
.marge-bar.good { background: var(--success); }
.marge-bar.medium { background: var(--warning); }
.marge-bar.bad { background: var(--danger); }
.marge-pct { font-size: 15px; font-weight: 700; min-width: 56px; text-align: right; }
.marge-pct.good { color: var(--success); }
.marge-pct.medium { color: var(--warning); }
.marge-pct.bad { color: var(--danger); }

/* ====== PRODUCT DETAIL TABS ====== */
.product-detail-layout {
  display: grid; grid-template-columns: 280px 1fr;
  gap: 20px;
}

/* ====== EMPTY STATE ====== */
.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 12px; opacity: 0.3; }
.empty-state h4 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ====== ALERT ====== */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 13px; display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ====== TOAST ====== */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--secondary); color: #fff;
  padding: 12px 18px; border-radius: var(--radius);
  font-size: 13px; display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  min-width: 240px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ====== RESPONSIVE ====== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); width: var(--sidebar-width); }
  .main-wrapper { margin-left: 0 !important; }
  .mobile-menu-btn { display: flex; }
  .topbar-search { display: none; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .product-detail-layout { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================
   ESPACE COLLABORATIF (modules/collab-*.js)
   Mêmes variables et composants que le reste de l'ERP
   ============================================ */
.cl-nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
.sidebar.collapsed .cl-nav-badge { position: absolute; top: 4px; right: 8px; display: inline-flex; }

/* Avatars & sélection d'utilisateurs */
.cl-avatar { border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; letter-spacing: .02em; vertical-align: middle; }
.cl-avatar-group { display: inline-flex; align-items: center; }
.cl-avatar-group .cl-avatar { border: 2px solid var(--bg-card); margin-left: -7px; }
.cl-avatar-group .cl-avatar:first-child { margin-left: 0; }
.cl-avatar-more { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.cl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border: 1px solid var(--border); border-radius: 20px; font-size: 12px; cursor: pointer; transition: all .15s; background: var(--bg-card); }
.cl-chip:hover { border-color: var(--primary); }
.cl-chip input { display: none; }
.cl-chip:has(input:checked) { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.cl-links { display: flex; flex-wrap: wrap; gap: 4px; }
.cl-link { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-link i { font-size: 10px; }
.cl-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.cl-late { color: var(--danger) !important; font-weight: 600; }
.cl-progress { height: 7px; background: var(--border); border-radius: 4px; overflow: hidden; }
.cl-progress > div { height: 100%; background: var(--primary); border-radius: 4px; transition: width .4s; }
.cl-check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 5px 0; cursor: pointer; }
.cl-check input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.cl-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; font-size: 13px; }
.cl-detail-grid .form-label { margin-bottom: 4px; }

/* Bascule de vue (Kanban / Liste...) */
.cl-segment { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 2px; }
.cl-segment button { border: none; background: none; padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.cl-segment button:hover { color: var(--text); }
.cl-segment button.active { background: var(--bg-card); color: var(--primary); box-shadow: var(--shadow); }

/* Kanban (tâches + pipeline) */
.cl-kanban { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.cl-pipeline { grid-template-columns: repeat(6, minmax(220px, 1fr)); }
.cl-kanban-col { background: #eef2f7; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; display: flex; flex-direction: column; min-height: 200px; transition: background .15s, border-color .15s; }
.cl-kanban-col.drag-over { background: var(--primary-light); border-color: var(--primary); border-style: dashed; }
.cl-kanban-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 0 2px 10px; }
.cl-count { margin-left: auto; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted); font-size: 11px; border-radius: 10px; padding: 0 8px; }
.cl-pipe-total { font-size: 12px; font-weight: 600; color: var(--text-muted); padding: 0 2px 10px; margin-top: -4px; }
.cl-kanban-body { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cl-kanban-empty { font-size: 12px; color: var(--text-light); text-align: center; padding: 18px 0; border: 1px dashed var(--border-dark); border-radius: var(--radius); }
.cl-kanban-add { margin-top: 10px; border: 1px dashed var(--border-dark); background: none; border-radius: 8px; padding: 7px; font-size: 12px; color: var(--text-muted); transition: all .15s; }
.cl-kanban-add:hover { border-color: var(--primary); color: var(--primary); background: var(--bg-card); }
.cl-task-card { position: relative; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 12px 10px 15px; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; overflow: hidden; }
.cl-task-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cl-task-card.dragging { opacity: .45; }
.cl-task-prio { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.cl-task-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; line-height: 1.35; word-break: break-word; }
.cl-task-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.45; }
.cl-task-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.cl-task-card .cl-links { margin-bottom: 8px; }
.cl-task-foot { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--text-muted); padding-top: 8px; border-top: 1px solid var(--border); }

/* Commentaires */
.cl-comments { display: flex; flex-direction: column; gap: 12px; max-height: 260px; overflow-y: auto; }
.cl-comment { display: flex; gap: 10px; align-items: flex-start; }

/* Projets */
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.cl-project-card { display: flex; flex-direction: column; }
.cl-project-card .card-body { flex: 1; }
.cl-project-color { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.cl-project-desc { font-size: 12.5px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 37px; }
.cl-card-actions { display: flex; gap: 4px; padding: 8px 12px; border-top: 1px solid var(--border); background: #f8fafc; }
.cl-color-pick input { display: none; }
.cl-color-pick span { display: block; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; box-shadow: 0 0 0 1px var(--border); }
.cl-color-pick input:checked + span { border-color: var(--bg-card); box-shadow: 0 0 0 2px var(--text); }

/* Agenda */
.cl-agenda-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.cl-cal-head { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; padding-bottom: 8px; }
.cl-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cl-cal-day { min-height: 98px; border: 1px solid var(--border); border-radius: 8px; padding: 5px; cursor: pointer; transition: border-color .15s, background .15s; overflow: hidden; background: var(--bg-card); }
.cl-cal-day:hover { border-color: var(--primary); }
.cl-cal-day.other { background: #f8fafc; }
.cl-cal-day.other .cl-cal-num { color: var(--text-light); }
.cl-cal-day.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.cl-cal-num { font-size: 12px; font-weight: 600; margin-bottom: 3px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.cl-cal-day.today .cl-cal-num { background: var(--primary); color: #fff; }
.cl-cal-evt { font-size: 10.5px; font-weight: 500; padding: 2px 5px; border-radius: 4px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-cal-evt:hover { filter: brightness(.92); }
.cl-cal-more { font-size: 10px; color: var(--text-muted); padding-left: 4px; }
.cl-agenda-item { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 6px; }
.cl-agenda-item:last-child { border-bottom: none; }
.cl-agenda-item:hover { background: var(--bg); }
.cl-agenda-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.cl-agenda-label { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-agenda-sub { font-size: 11px; color: var(--text-muted); }

/* Messagerie */
.cl-chat { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - var(--topbar-height) - 150px); min-height: 480px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.cl-chat-side { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.cl-chat-side-head { padding: 12px; border-bottom: 1px solid var(--border); }
.cl-chat-list { flex: 1; overflow-y: auto; padding: 6px; }
.cl-chat-section { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-light); padding: 12px 8px 6px; }
.cl-chat-none { font-size: 12px; color: var(--text-muted); padding: 4px 8px 8px; }
.cl-chat-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; transition: background .15s; }
.cl-chat-item:hover { background: var(--bg); }
.cl-chat-item.active { background: var(--primary-light); }
.cl-chat-item-top, .cl-chat-item-bottom { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.cl-chat-item-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-chat-item-time { font-size: 10px; color: var(--text-light); white-space: nowrap; }
.cl-chat-item-preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-unread { background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; }
.cl-canal-icon { border-radius: 10px; background: var(--primary-light); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; font-size: 14px; }
.cl-chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.cl-chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.cl-chat-back { display: none; }
.cl-chat-msgs { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; background: #fafbfd; }
.cl-chat-day { text-align: center; margin: 14px 0 8px; position: relative; }
.cl-chat-day::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--border); }
.cl-chat-day span { position: relative; background: #fafbfd; padding: 0 12px; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.cl-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 75%; margin-top: 8px; }
.cl-msg.grouped { margin-top: 2px; }
.cl-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.cl-msg-av { width: 30px; flex-shrink: 0; }
.cl-msg-body { min-width: 0; display: flex; flex-direction: column; }
.cl-msg.mine .cl-msg-body { align-items: flex-end; }
.cl-msg-author { font-size: 11px; font-weight: 600; color: var(--text-muted); margin: 0 0 3px 4px; }
.cl-msg-bubble { background: var(--bg-card); border: 1px solid var(--border); padding: 8px 12px; border-radius: 14px 14px 14px 4px; font-size: 13px; line-height: 1.5; word-break: break-word; }
.cl-msg.mine .cl-msg-bubble { background: var(--primary); color: #fff; border-color: var(--primary); border-radius: 14px 14px 4px 14px; }
.cl-msg-time { font-size: 10px; color: var(--text-light); margin: 2px 6px 0; }
.cl-mention { background: var(--primary-light); color: var(--primary); font-weight: 600; border-radius: 4px; padding: 0 3px; }
.cl-msg.mine .cl-mention { background: rgba(255,255,255,.22); color: #fff; }
.cl-chat-input { position: relative; display: flex; gap: 8px; align-items: flex-end; padding: 12px 16px; border-top: 1px solid var(--border); }
.cl-chat-input textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: 13px; outline: none; max-height: 140px; font-family: var(--font); color: var(--text); background: var(--bg-card); }
.cl-chat-input textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.cl-mention-box { position: absolute; bottom: 100%; left: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md); padding: 4px; min-width: 220px; z-index: 5; }
.cl-mention-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.cl-mention-opt:hover, .cl-mention-opt:first-child { background: var(--bg); }

/* Activité / notifications */
.cl-activity { display: flex; flex-direction: column; }
.cl-activity-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px; border-bottom: 1px solid var(--border); border-radius: 6px; }
.cl-activity-item:last-child { border-bottom: none; }
.cl-activity-item.unread { background: #eff6ff; }
.cl-activity-icon { width: 32px !important; height: 32px !important; font-size: 13px !important; border-radius: 9px !important; }
.cl-activity-text { font-size: 12.5px; line-height: 1.45; }
.cl-activity-time { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* Appels */
.cl-calls-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.cl-dial-display { width: 100%; border: none; border-bottom: 2px solid var(--border); font-size: 26px; font-weight: 600; text-align: center; padding: 8px; outline: none; letter-spacing: .04em; color: var(--text); background: none; font-family: var(--font); }
.cl-dial-display:focus { border-color: var(--primary); }
.cl-dial-match { text-align: center; font-size: 12px; color: var(--success); font-weight: 600; min-height: 20px; margin: 8px 0 12px; }
.cl-dialpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cl-dialpad button { height: 52px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); font-size: 20px; font-weight: 600; color: var(--text); transition: all .12s; }
.cl-dialpad button:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.cl-dialpad button:active { transform: scale(.96); }
.cl-oncall { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cl-oncall-pulse { width: 78px; height: 78px; border-radius: 50%; background: #d1fae5; color: var(--success); display: flex; align-items: center; justify-content: center; font-size: 30px; box-shadow: 0 0 0 10px rgba(16,185,129,.12), 0 0 0 20px rgba(16,185,129,.06); margin-top: 10px; }
.cl-oncall-timer { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 10px 0 16px; color: var(--success); }
.cl-annuaire { max-height: 430px; overflow-y: auto; padding: 0 12px 12px; }
.cl-annuaire-item { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.cl-annuaire-item:last-child { border-bottom: none; }

/* Réunions */
.cl-reu-list { display: flex; flex-direction: column; }
.cl-reu-item { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.cl-reu-item:hover { background: #f8fafc; }
.cl-reu-date { width: 52px; text-align: center; border-radius: 10px; background: #ede9fe; color: #6d28d9; padding: 6px 0; flex-shrink: 0; }
.cl-reu-day { font-size: 19px; font-weight: 700; line-height: 1.1; }
.cl-reu-month { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* Pipeline : étapes */
.cl-stepper { display: flex; gap: 4px; margin-bottom: 18px; flex-wrap: wrap; }
.cl-step { flex: 1; min-width: 90px; text-align: center; padding: 7px 6px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; transition: all .15s; }
.cl-step:hover { border-color: var(--primary); color: var(--primary); }

/* Tableau de bord collaboratif */
.cl-dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cl-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.cl-row:last-child { border-bottom: none; }
.cl-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--success); cursor: pointer; flex-shrink: 0; }
.cl-row-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.cl-row-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; min-width: 70px; text-align: right; }

@media (max-width: 1100px) {
  .cl-agenda-layout, .cl-calls-layout, .cl-dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .cl-chat { grid-template-columns: 1fr; height: calc(100vh - var(--topbar-height) - 190px); }
  .cl-chat.show-list .cl-chat-main, .cl-chat.show-conv .cl-chat-side { display: none; }
  .cl-chat-back { display: inline-flex; }
  .cl-msg { max-width: 90%; }
  .cl-detail-grid { grid-template-columns: 1fr; }
  .cl-cal-day { min-height: 64px; }
  .cl-cal-evt { font-size: 0; height: 6px; padding: 0; }
}

/* ============================================
   Paramètres > WorkSpace (modules/parametres-workspace.js)
   ============================================ */
.ws-settings { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.ws-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: none; background: none; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer; text-align: left; }
.ws-menu-item i { width: 16px; text-align: center; }
.ws-menu-item:hover { background: var(--bg); color: var(--text); }
.ws-menu-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.ws-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ws-toggle-row:last-child { border-bottom: none; }
.ws-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; cursor: pointer; }
.ws-switch input { opacity: 0; width: 0; height: 0; }
.ws-switch span { position: absolute; inset: 0; background: var(--border-dark); border-radius: 22px; transition: background .2s; }
.ws-switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.ws-switch input:checked + span { background: var(--primary); }
.ws-switch input:checked + span::before { transform: translateX(18px); }
.ws-theme-choice { min-width: 110px; padding: 16px 22px; border-radius: 10px; border: 2px solid var(--border); background: var(--bg); color: var(--text-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: center; }
.ws-theme-choice i { display: block; font-size: 22px; margin-bottom: 8px; }
.ws-theme-choice.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.ws-color { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--bg-card); box-shadow: 0 0 0 1px var(--border); color: #fff; cursor: pointer; transition: transform .15s; }
.ws-color:hover { transform: scale(1.12); }
.ws-color.active { box-shadow: 0 0 0 2px var(--text); }
.ws-integration { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.ws-integration:last-child { border-bottom: none; }
.ws-settings-menu { display: flex; flex-direction: column; gap: 4px; }
.ws-integ-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; color: var(--primary); flex-shrink: 0; }
@media (max-width: 768px) {
  .ws-settings { grid-template-columns: 1fr; }
  .ws-settings-menu { flex-direction: row; overflow-x: auto; }
  .ws-menu-item { width: auto; white-space: nowrap; }
}

/* ============================================
   THÈME WORKSPACE — s'impose à tout l'ERP
   (repris de workspace/style.css : couleurs, menu, barre du haut, formulaires, tableaux)
   ============================================ */
:root {
  --primary: #4f46e5; --primary-dark: #3730a3; --primary-light: #ede9fe; --primary-soft: #6366f1;
  --accent: #06b6d4; --success: #10b981; --warning: #f59e0b; --danger: #ef4444;
  --bg: #f8fafc; --bg-card: #ffffff; --surface2: #f1f5f9;
  --sidebar-bg: var(--bg-card); --sidebar-text: var(--text-muted); --sidebar-hover: var(--surface2); --sidebar-active: var(--primary);
  --text: #0f172a; --text-muted: #64748b; --text-light: #94a3b8;
  --border: #e2e8f0; --border-dark: #cbd5e1;
  --shadow: 0 1px 3px rgba(0,0,0,.08); --shadow-md: 0 4px 16px rgba(0,0,0,.1); --shadow-lg: 0 12px 40px rgba(0,0,0,.15);
  --success-bg: #d1fae5; --warning-bg: #fef3c7; --danger-bg: #fee2e2; --accent-bg: #cffafe;
}
.dark {
  --bg: #0f172a; --bg-card: #1e293b; --surface2: #162032;
  --border: #2d3f54; --border-dark: #3d5068;
  --text: #f1f5f9; --text-muted: #94a3b8; --text-light: #64748b; --secondary: #f1f5f9;
  --shadow: 0 1px 3px rgba(0,0,0,.3); --shadow-md: 0 4px 16px rgba(0,0,0,.4); --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  --success-bg: #064e3b; --warning-bg: #451a03; --danger-bg: #450a0a; --accent-bg: #0e4f5f;
  color-scheme: dark;
}
body { font-size: 14px; line-height: 1.5; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 99px; }

/* Menu latéral */
.sidebar { background: var(--bg-card); border-right: 1px solid var(--border); }
.sidebar-logo { border-bottom: 1px solid var(--border); padding: 16px 14px; }
.logo-icon { width: 34px; height: 34px; border-radius: 9px; font-size: 15px; background: linear-gradient(135deg, var(--primary), var(--primary-soft)); }
.logo-text { color: var(--text); font-size: 15px; }
.sidebar-toggle-btn { width: 30px; height: 30px; border-radius: 7px; color: var(--text-muted); }
.sidebar-toggle-btn:hover { background: var(--surface2); color: var(--text); }
.sidebar-nav { padding: 10px 8px; }
.nav-group { margin-bottom: 6px; }
.nav-group-label { font-size: 10px; color: var(--text-light); padding: 10px 8px 4px; }
.nav-item { padding: 8px 10px; border-radius: var(--radius); color: var(--text-muted); font-weight: 500; font-size: 13.5px; margin-bottom: 2px; }
.nav-item i { font-size: 15px; }
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); }
.nav-item.active::before { display: none; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius); background: var(--surface2); overflow: hidden; }
.user-card .user-info { flex: 1; min-width: 0; }
.user-card .user-name { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.user-card .user-role { display: block; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.sidebar.collapsed .user-info, .sidebar.collapsed .user-card .ws-icon-btn { display: none; }

/* Barre du haut */
.topbar { background: var(--bg-card); box-shadow: none; padding: 0 16px; gap: 12px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.breadcrumb i { color: var(--primary); }
.topbar-left { min-width: 180px; }
.topbar-center { flex: 1; max-width: 480px; margin: 0 auto; }
.topbar-search { border-radius: 8px; padding: 7px 12px; background: var(--surface2); width: 100%; }
.topbar-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.topbar-search input { flex: 1; width: auto; min-width: 0; }
.topbar-search kbd { background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 11px; color: var(--text-muted); white-space: nowrap; font-family: inherit; }
.topbar-right { gap: 8px; }
.ws-icon-btn, .topbar-notif { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 15px; background: none; border: none; cursor: pointer; position: relative; flex-shrink: 0; }
.ws-icon-btn:hover, .topbar-notif:hover { background: var(--surface2); color: var(--text); }
.topbar-user { padding: 5px 10px; border-radius: 99px; background: var(--surface2); border: 1px solid var(--border); font-weight: 500; color: var(--text); }
.topbar-user:hover { border-color: var(--primary); background: var(--surface2); }
.user-avatar { width: 32px; height: 32px; background: linear-gradient(135deg, var(--primary), var(--primary-soft)); flex-shrink: 0; }
.ws-search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 6px; z-index: 300; max-height: 360px; overflow-y: auto; }
.ws-search-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.ws-search-item i { width: 18px; text-align: center; color: var(--text-muted); }
.ws-search-item:hover, .ws-search-item.active { background: var(--primary-light); color: var(--primary); }
.ws-search-item:hover i, .ws-search-item.active i { color: var(--primary); }

/* Cartes, statistiques */
.card, .stat-card { background: var(--bg-card); box-shadow: var(--shadow); }
.card-title { font-weight: 700; }
.stat-card { padding: 20px; transition: box-shadow .2s, transform .2s; }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; }
.stat-value { font-size: 26px; line-height: 1; }
.stat-label { margin-top: 4px; }
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-bg); }
.stat-icon.orange { background: var(--warning-bg); }
.stat-icon.cyan { background: var(--accent-bg); }
.stat-icon.red { background: var(--danger-bg); }
.dark .stat-icon.purple { background: #3b0764; color: #c4b5fd; }

/* Boutons */
.btn { border-radius: 8px; font-size: 13.5px; font-weight: 500; gap: 7px; }
.btn-secondary { background: var(--surface2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost:hover { background: var(--surface2); }

/* Formulaires */
.form-label, .form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: .02em; }
.form-control, .filter-select, .toolbar-search { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13.5px; }
.form-control:focus, .filter-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.form-control:disabled { background: var(--bg); }
.form-section-title { color: var(--text); }
.form-hint { color: var(--text-muted); }

/* Onglets */
.tab-btn { color: var(--text-muted); border-radius: 8px 8px 0 0; }
.tab-btn:hover { background: var(--surface2); }

/* Tableaux */
thead tr, thead th { background: var(--surface2); }
thead th { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--text-muted); }
tbody tr:hover { background: var(--surface2); }
tbody td { border-color: var(--border); font-size: 13.5px; }

/* Badges */
.badge-success { background: var(--success-bg); }
.badge-warning { background: var(--warning-bg); }
.badge-danger { background: var(--danger-bg); }
.badge-muted { background: var(--surface2); }
.dark .badge-success { color: #6ee7b7; }
.dark .badge-warning { color: #fcd34d; }
.dark .badge-danger { color: #fca5a5; }
.dark .badge-info { background: #2e1065; color: #c4b5fd; }

/* Fenêtres, alertes, divers */
.modal { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.action-btn { background: var(--surface2); border-color: var(--border); color: var(--text-muted); }
.action-btn.danger:hover, .modal-header button:hover { background: var(--danger-bg); }
.cl-card-actions, .cl-cal-day.other, .cl-reu-item:hover { background: var(--surface2); }
.cl-chat-msgs, .cl-chat-day span { background: var(--bg); }
.dark .alert-info { background: #1e1b4b; color: #c7d2fe; border-color: #3730a3; }
.dark .alert-warning { background: #451a03; color: #fde68a; border-color: #78350f; }
.dark .alert-danger { background: #450a0a; color: #fecaca; border-color: #7f1d1d; }
.dark .alert-success { background: #064e3b; color: #a7f3d0; border-color: #065f46; }

/* Paramètres > WorkSpace : mêmes styles que les Paramètres du WorkSpace */
.ws-settings { grid-template-columns: 200px 1fr; gap: 20px; }
.ws-settings-menu { gap: 2px; }
.ws-menu-item { padding: 9px 12px; font-size: 13.5px; }
.ws-menu-item:hover { background: var(--surface2); }
.ws-menu-item.active { font-weight: 500; }
.ws-settings .form-section-title { font-size: 16px; font-weight: 700; color: var(--text); text-transform: none; letter-spacing: 0; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.ws-theme-choice { min-width: 0; padding: 16px 24px; background: var(--surface2); }
.ws-color { border: 3px solid transparent; box-shadow: none; }
.ws-color.active { box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--primary); }
.ws-integ-icon { background: var(--surface2); }

@media (max-width: 900px) {
  .topbar-center { display: none; }
  .topbar-left { min-width: 0; }
}
